From 2ad2a3cdd0df63b6557789ba8a9d968984fe5da3 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 26 十一月 2024 16:25:31 +0800
Subject: [PATCH] 调整页面

---
 Source/plt-web/plt-web-ui/src/views/wel/components/UndoTaskPortlet.vue |  249 ++++++++++++++++---------------------------------
 1 files changed, 82 insertions(+), 167 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/wel/components/UndoTaskPortlet.vue b/Source/plt-web/plt-web-ui/src/views/wel/components/UndoTaskPortlet.vue
index ae5aa53..c0d691a 100644
--- a/Source/plt-web/plt-web-ui/src/views/wel/components/UndoTaskPortlet.vue
+++ b/Source/plt-web/plt-web-ui/src/views/wel/components/UndoTaskPortlet.vue
@@ -1,199 +1,114 @@
 <template>
-  <!--浠e姙浠诲姟-->
-  <basic-containers  :key="loadKey">
-    <div>
-      <avue-crud
-        ref="crud"
-        :data="data"
-        :option="options"
-        :page.sync="pages"
-        :search.sync="searchParams"
-        :table-loading="loading"
-        @search-change="handleSearch"
-        @search-reset="handleReset"
-        @current-change="currentChange"
-        @size-change="sizeChange">
-        <template slot="title" slot-scope="{row}">
-          <el-link type="primary" @click="linkClickHandler(row)">{{ row.title }}</el-link>
-        </template>
-      </avue-crud>
-    </div>
-  </basic-containers>
+  <basic-container title="寰呭姙娴佺▼浠诲姟">
+    <avue-crud ref="crud" :data="todoData" :option="todoOption" :page.sync="page"
+               :table-loading="loading"
+               @on-load="onLoad"
+               @cell-click="cellHandle">
+      <template #menu="{size,row,index}">
+        <el-button :size="size"
+                   icon="el-icon-check"
+                   type="text"
+                   @click="gotodo(row,index)">鎵ц
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
 </template>
 
 <script>
 export default {
   name: "UndoTaskPortlet",
-  data() {
+  data(){
     return {
-      loadKey:0,
-      data: [],
-      options: {
-        height: 'auto',
-        calcHeight:210,
+      loading: false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      // 浠e姙娴佺▼浠诲姟data
+      todoData: [],
+      // 浠e姙娴佺▼浠诲姟option
+      todoOption: {
+        height: 500,
         addBtn: false,
+        header: false,
+        align: 'center',
+        index: true,
+        menuWidth: 80,
         editBtn: false,
         delBtn: false,
-        index: true,
         border: true,
-        menu: false,
-        refreshBtn: false,
-        searchIcon: true,
-        searchShow: true,
-        menuWidth: 120,
-        menuAlign: "center",
-        column: [
+        column: [{
+          label: '浠诲姟鍚嶇О',
+          prop: 'taskName',
+          sortable: true,
+          headerAlign: 'center',
+          align: 'left',
+          html: true,
+          width: 300,
+          overHidden: true,
+          formatter: (val) => {
+            return '<a name="processname" href="javascript:;" style="color: #66b1ff;">' + val.variables.processName + '-' + val.taskName + '</a>'
+          }
+        },
           {
-            label: "绫诲瀷",
-            prop: "msgClassifyText",
+            label: '涓婁竴姝ュ鐞嗘椂闂�',
             sortable: true,
-            width: 100,
+            width: 150,
+            prop: 'createTime'
           },
           {
-            label: "娑堟伅鏍囬",
-            prop: "title",
-            search:true,
-            minWidth: 400,
+            label: '涓婁竴姝ユ搷浣滀汉',
             sortable: true,
-            searchSpan:6,
+            width: 120,
+            prop: 'historyActivityAssigneName'
+          },
+          {
+            label: '娴佺▼鎻忚堪',
+            prop: 'processDesc',
             overHidden: true,
-            slot:true,
+            formatter: (val) => {
+              return val.variables.processDesc
+            }
           },
           {
-            label: "鍙戦�佹椂闂�",
-            prop: "sendTime",
-            width: 130,
-            type:'datetime',
-            overHidden: true,
-            format:'yyyy-MM-dd HH:mm',
-            sortable:true,
-            slot: true
-          },
-          {
-            label: '宸ュ彿',
-            prop: "sendUserCode",
-            searchLabelWidth: 100,
-            search:true,
+            label: '鎵�灞炴祦绋嬫ā鏉�',
             sortable: true,
-            searchSpan:6,
-            width: 130,
-          },
-          {
-            label: "鍙戦�佷汉濮撳悕",
-            prop: "sendUserName",
-            searchLabelWidth: 100,
-            search:true,
-            searchSpan:6,
-            sort: true,
-            width: 130,
-          },
-          {
-            label: "鍐呭",
-            overHidden:true,
-            prop: "msgContent",
-            minWidth: 300
-          },
+            overHidden: true,
+            prop: 'categoryName'
+          }
         ]
       },
-      pages: {
-        currentPage: 1,
-        pageSize: 15,
-        pageSizes: [15, 25, 45, 60, 100],
-        total: 0,
-        layout: "prev,pager,next,jumper,sizes,total",
-      },
-      loading: false,
-      searchParams: {
-        pageNum: 1,
-        pageSize: 15,
-      },
-    };
+    }
   },
   created() {
-    this.getTableList();
-  },
-  mounted() {
-    window.addEventListener('resize', this.handleResize); // 鑾峰彇鐢ㄦ埛缂╂斁浜嬩欢
-  },
-  beforeDestroy() {
-    window.removeEventListener('resize', this.handleResize); // 閿�姣佺粦瀹氱殑鏂规硶
   },
   methods: {
-    // 寮哄埗淇敼瀹瑰櫒key鍊�
-    handleResize() {
-      this.loadKey += 1;
+    onLoad(page, params = {}) {
+      this.loading = true;
+      const query = {
+        ...this.query,
+        category: (params.category) ? flowCategory(params.category) : null
+      };
+      todoList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.todoData = data.records;
+        this.loading = false;
+      }).catch(error => {
+        this.$message.error(error);
+        this.loading = false;
+      })
     },
-
-    // 鍒濆鍖栨牴鎹垎杈ㄧ巼鏉ュ喅瀹氶〉闈㈠垵濮嬪灏戞潯鏁版嵁
-    createdPageSize(){
-      let windowHeight = window.outerHeight;
-      if(windowHeight > 1350) this.homeTable.pages.pageSize = 25;
-      if(windowHeight > 1350) this.searchParams.pageSize = 25;
-    },
-
-    getTableList() {
-      this.createdPageSize(); // 鍒ゆ柇椤甸潰鍒嗚鲸鐜�
-
-      getList(this.searchParams).then(res => {
-        if (res && res.success) {
-          this.homeTable.data = res.data;
-          this.homeTable.pages.total = res.total;
-        }
-      });
-    },
-
-    linkClickHandler(row){
-      if(row.msgLink != null && row.msgLink != ''){
-        var link = row.msgLink.replace("inner:","").replace("?","").split("&");
-        var html = link.find((val=>(val.toLowerCase().startsWith("html=")|| val.toLowerCase().startsWith("html ="))));
-        if(html!=null && html!=''){
-          var page = html.split("=")[1].replace("-","/");
-          var single = {
-            fromUndo:true
-          };
-          link.forEach((val)=>{
-            var temp = val.split("=");
-            single[temp[0]] = temp[1];
-          });
-          this.$router.push({
-            path:"/" + page,
-            query:single
-          });
-        }
+    cellHandle(row, column, cell, event) {
+      if (column.property == 'taskName') {
+        this.gotodo(row)
       }
     },
-
-    // 鍒嗛〉閫夋嫨鏄剧ず澶氬皯鏉�
-    sizeChange(val) {
-      this.searchParams.pageSize = val;
-      this.searchParams.pageNum = 1;
-      this.getTableList();
-    },
-
-    // 鍒嗛〉椤电爜
-    currentChange(val) {
-      this.searchParams.pageNum = val;
-      this.getTableList();
-    },
-
-    // 鏌ヨ
-    handleSearch(params, done) {
-      setTimeout(() => {
-        done();
-        this.searchParams = { ...params };
-        this.getTableList();
-      }, 300);
-    },
-
-    // 娓呯┖鎼滅储
-    handleReset() {
-      this.searchParams = this.defaultSearch;
-      this.getTableList();
-    },
-    // 鍒锋柊鏁版嵁
-    handleRefresh() {
-      this.getTableList();
-    },
+    gotodo(row, index) {
+      this.$router.push({path: `/work/process/${flowRoute(this.flowRoutes, row.category)}/handle/${row.taskId}/${row.processInstanceId}/${row.businessId}`});
+    }
   }
 }
 </script>

--
Gitblit v1.9.3