From a3c868db4d017961be2d394eadb7d428045d5adc Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期四, 13 七月 2023 11:13:16 +0800
Subject: [PATCH] 业务类型页面增加生命周期的处理
---
Source/UBCS-WEB/src/components/work/BusinessWork.vue | 139 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 106 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..3597bfa 100644
--- a/Source/UBCS-WEB/src/components/work/BusinessWork.vue
+++ b/Source/UBCS-WEB/src/components/work/BusinessWork.vue
@@ -1,55 +1,131 @@
<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: ""
+ }
+ },
+ watch:{
+ ids:{
+ handler(newval,oldval){
+ this.BuinessOids=newval;
+ this.BuinseseRend()
+ console.log(newval)
+ console.log(this.BuinessOids)
+ },
+ 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 != "") {
+ 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 +133,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