From 41f11d5fd764a2bc7e8463a70bb340467d99a3ca Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 14 七月 2023 09:42:36 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/work/BusinessWork.vue | 150 +++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 117 insertions(+), 33 deletions(-) diff --git a/Source/UBCS-WEB/src/components/work/BusinessWork.vue b/Source/UBCS-WEB/src/components/work/BusinessWork.vue index 97e3f18..783f534 100644 --- a/Source/UBCS-WEB/src/components/work/BusinessWork.vue +++ b/Source/UBCS-WEB/src/components/work/BusinessWork.vue @@ -1,55 +1,142 @@ <template> <div> - <el-button @click="add"></el-button> - <el-table :data="data"> - <el-table-column - fixed - type="selection" - width="55"> + <el-button @click="HandlerRend" size="small" type="primary">淇濆瓨</el-button> + <el-table + v-loading="isLoading" + :data="tableData" + max-height="700" + style="" + @cell-click="handleCellClick" + > + <el-table-column fixed type="selection" width="55"> </el-table-column> + <el-table-column fixed label="搴忓彿" type="index" width="55"> </el-table-column> <el-table-column - fixed - label="搴忓彿" - type="index" - width="55"> + v-for="item in this.tableHeadData" + :key="item.id" + :label="item.label" + :prop="item.prop" + :sortable="item.sortable" + :formatter="item.formatter" + :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'" + :show-overflow-tooltip="true" + align="center" + > + <!-- 缂栬緫鍜屽睍绀洪�昏緫 --> + <!-- <template slot-scope="{ row }">--> + <!-- <el-input v-if="editingRow === row && editShow== item.prop" v-model="row[item.prop]" @blur="saveRow"></el-input>--> + <!-- <span v-else>{{row[item.prop]}}</span>--> + <!-- <el-switch--> + <!-- v-if="editShow === 'true'"--> + <!-- v-model="row[item.prop]"--> + <!-- active-color="#13ce66"--> + <!-- inactive-color="#ff4949">--> + <!-- </el-switch>--> + <!-- </template>--> </el-table-column> </el-table> </div> </template> <script> -import {businese,add} from '@/api/work/businese' +import {businese} from '@/api/work/businese' +import {FlowTable} from "@/api/GetItem"; +import {validatenull} from "@/util/validate"; export default { name: "BusinessWork", - props:['oid','templateId'], + props:['ids','templateId',"taskId","modelKey","codeClassifyOid"], data() { return { - data:[ - { - label:'app' - } - ] + BuinessOids:[], + isLoading:false, + tableHeadData:[], + tableData:[], + editingRow: null, + editShow: "", + editAttr: "", + columnType: { + text: "input", + combox: "select", + truefalse: "switch", + number: "number", + datetime: "datetime", + } + } + }, + watch:{ + ids:{ + handler(newval,oldval){ + this.BuinessOids=newval; + this.CrudHeaderRend() + this.BuinseseRend() + }, + deep:true } }, created() { - businese({oid: this.oid, - templateOid: this.templateId}).then(res=>{ - console.log(res) - }) + }, + mounted() { }, methods:{ - add(){ - // businese({oid: this.oid[2], - // templateOid: this.templateId}).then(res=>{ - // console.log(res) - // }) - add({ + HandlerRend(){ + this.editingRow = null; + }, + //琛ㄦ牸澶存覆鏌� + CrudHeaderRend() { + if (this.codeClassifyOid != "") { + var data=new FormData() + data.append('templateId', this.templateId) + data.append('taskId', this.taskId) + data.append('modelKey', this.modelKey) + data.append('codeClassifyOid', this.codeClassifyOid) + FlowTable({ + 'templateId': this.templateId, + 'taskId': this.taskId, + 'modelKey': this.modelKey, + 'codeClassifyOid': this.codeClassifyOid + }).then((res) => { + this.options = res.data.tableDefineVO.seniorQueryColumns; + this.List = res.data.tableDefineVO.cols[0]; + this.tableHeadData=[]; + this.List.forEach((item) => { + let columnItem = { + label: item.title, + prop: item.field, + type: this.columnType[item.type], + sortable: item.sort, + width: item.minWidth + }; + if(item.field == 'id' && validatenull(item.templet)){ + //浼佷笟缂栫爜鐨勯粯璁ゆ坊鍔犺秴閾炬帴,鏆傛湭瀹炵幇 + columnItem.formatter = ''; + }else { + if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)") > -1) { + columnItem.formatter = eval("(" + item.templet + ")"); + } else if (item.fieldType == "truefalse") { + columnItem.formatter = function (row, column) { + return row[column.property] == 'true' || row[column.property] == '1' ? '鏄�' : '鍚�' + } + } + } + this.tableHeadData.push(columnItem) + }); + }); + } + }, + //琛ㄦ牸鏁版嵁 + BuinseseRend(){ + businese({ btmType:'wupin', - 'conditionMap[oid]':'D49A28F3-3740-D0EF-A3C6-5A71CA6978CC' + 'conditionMap[oid]':this.BuinessOids.toString() }).then(res=>{ - console.log(res) + this.tableData = res.data.data; }) - } + }, + // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮 + handleCellClick(row, column) { + this.editingRow = row; + this.editShow = column.property; + }, } } </script> @@ -57,6 +144,3 @@ <style scoped> </style> - -<!--mdmEngineController/getTableDataByOids?page=1&limit=-1&btmType=wupin&conditionMap%5B%27oid%27%5D=90DC514B-396D-9664-67D0-1587640FE15E&_=1687773044552--> -<!--mdmEngineController/getTableDataByOids?conditionMap%5Boid%5D=D49A28F3-3740-D0EF-A3C6-5A71CA6978CC--> -- Gitblit v1.9.3