From ec407e8676f6245d88da3d9f729ad545ae3218c0 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 18 七月 2023 15:20:03 +0800 Subject: [PATCH] 代码提交 --- Source/UBCS-WEB/src/components/work/BusinessWork.vue | 74 +++++++++++++++++++++++++----------- 1 files changed, 51 insertions(+), 23 deletions(-) diff --git a/Source/UBCS-WEB/src/components/work/BusinessWork.vue b/Source/UBCS-WEB/src/components/work/BusinessWork.vue index 4f0b688..ff955e8 100644 --- a/Source/UBCS-WEB/src/components/work/BusinessWork.vue +++ b/Source/UBCS-WEB/src/components/work/BusinessWork.vue @@ -22,17 +22,25 @@ :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>--> + <template slot-scope="{ row }"> + <el-input v-if="editingRow === row && editShow== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" + @blur="editingRows=null"></el-input> + <el-input-number size="small" controls-position="right" v-if="editingRow === row && editShow== item.prop && item.edit == 'number'" v-model="row[item.prop]" + @blur="editingRows=null" :style="{width:(item.width-10)+'px'}"></el-input-number> + <el-select v-model="row[item.prop]" filterable allow-create default-first-option slot="prepend" v-if="editingRow === row && editShow== item.prop && item.edit == 'select' " @blur="editingRows=null"> + <el-option + v-for="optionItem in item.data" + :key="optionItem.dictValue" + :label="optionItem.dictValue" + :value="optionItem.dictValue"> + </el-option> + </el-select> + <el-switch + v-if="item.edit === 'switch' || item.edit === 'truefalse'" v-model="row[item.prop]" active-value="true" + inactive-value="false"> + </el-switch> + <span v-else>{{ row[item.prop] }}</span> + </template> </el-table-column> </el-table> </div> @@ -40,11 +48,11 @@ <script> import {businese} from '@/api/work/businese' -import {MasterTable} from "@/api/GetItem"; +import {FlowTable} from "@/api/GetItem"; import {validatenull} from "@/util/validate"; export default { name: "BusinessWork", - props:['ids','templateId'], + props:['ids','templateId',"taskId","modelKey","codeClassifyOid"], data() { return { BuinessOids:[], @@ -53,16 +61,22 @@ tableData:[], editingRow: null, editShow: "", - editAttr: "" + editAttr: "", + columnType: { + text: "input", + combox: "select", + truefalse: "switch", + number: "number", + datetime: "datetime", + } } }, watch:{ ids:{ handler(newval,oldval){ this.BuinessOids=newval; + this.CrudHeaderRend() this.BuinseseRend() - console.log(newval) - console.log(this.BuinessOids) }, deep:true } @@ -78,9 +92,16 @@ //琛ㄦ牸澶存覆鏌� CrudHeaderRend() { if (this.codeClassifyOid != "") { - MasterTable({ - codeClassifyOid: this.codeClassifyOid, - functionId: 5, + 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]; @@ -97,12 +118,19 @@ //浼佷笟缂栫爜鐨勯粯璁ゆ坊鍔犺秴閾炬帴,鏆傛湭瀹炵幇 columnItem.formatter = ''; }else { - if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)")>-1) { + if (item.templet && typeof (item.templet) == 'string' && !validatenull(item.templet) && item.templet.indexOf("function(row,column)") > -1) { columnItem.formatter = eval("(" + item.templet + ")"); - //function(row,column){return row[column.property]=='true'?'鏄�':'鍚�'} + } else if (item.fieldType == "truefalse") { + columnItem.formatter = function (row, column) { + return row[column.property] == 'true' || row[column.property] == '1' ? '鏄�' : '鍚�' + } + } + if (item.edit == 'select') { + //闇�瑕佽幏鍙栦笅鎷夋鏁版嵁 + columnItem.data=[] } } - this.tableHeadData.push(columnItem) + this.tableHeadData.push(Object.assign(item, columnItem)) }); }); } @@ -117,7 +145,7 @@ }) }, // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮 - handleCellClick(row, column) { + handleCellClick(row, column, cell, event) { this.editingRow = row; this.editShow = column.property; }, -- Gitblit v1.9.3