From 02dbaaa04bc443e860a715cf907bc0fb5c1a7da4 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 11 七月 2023 09:09:34 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS-WEB/src/components/work/BusinessWork.vue |  134 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 101 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..4f0b688 100644
--- a/Source/UBCS-WEB/src/components/work/BusinessWork.vue
+++ b/Source/UBCS-WEB/src/components/work/BusinessWork.vue
@@ -1,55 +1,126 @@
 <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 {MasterTable} from "@/api/GetItem";
+import {validatenull} from "@/util/validate";
 export default {
   name: "BusinessWork",
-  props:['oid','templateId'],
+  props:['ids','templateId'],
   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 != "") {
+        MasterTable({
+          codeClassifyOid: this.codeClassifyOid,
+          functionId: 5,
+        }).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 + ")");
+                //function(row,column){return row[column.property]=='true'?'鏄�':'鍚�'}
+              }
+            }
+            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 +128,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