yijing 1 年之前
父節點
當前提交
728a402f38
共有 1 個文件被更改,包括 20 次插入61 次删除
  1. 20 61
      src/views/rulesManagement/earlyWarningRules/components/user-select/user-select.vue

+ 20 - 61
src/views/rulesManagement/earlyWarningRules/components/user-select/user-select.vue

@@ -10,11 +10,7 @@
     width="70%"
   >
     <el-card shadow="never">
-      <ele-split-layout
-        width="244px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
+      <ele-split-layout width="244px" allow-collapse>
         <div class="ele-border-lighter split-layout-right-content">
           <DepartmentTree
             @handleNodeClick="handleNodeClick"
@@ -26,16 +22,15 @@
         <template v-slot:content>
           <user-select-search @search="reload"></user-select-search>
           <ele-pro-table
-            ref="table"
-            :columns="columns"
+            class="table1"
+            ref="table222"
+            :columns="columns1"
             :datasource="datasource"
-            row-key="id"
+            :selection.sync="selection"
             height="calc(100vh - 430px)"
-            class="dict-table"
             cache-key="systemRoleTable3"
-            :selection.sync="selection"
-          >
-          </ele-pro-table>
+            row-key="id"
+          ></ele-pro-table>
         </template>
       </ele-split-layout>
     </el-card>
@@ -61,7 +56,7 @@
       return {
         visible: false,
         currentIndex: 0,
-        title: '选择负责人',
+        title: '选择',
         statusOptions: [
           { value: 1, label: '全职' },
           { value: 2, label: '兼职' },
@@ -71,25 +66,24 @@
           { value: 6, label: '离职' }
         ],
         selection: [],
-        columns: [
+        columns1: [
           {
             width: 45,
             type: 'selection',
             columnKey: 'selection',
-            align: 'center'
+            reserveSelection: true
           },
           {
             columnKey: 'index',
             label: '序号',
             type: 'index',
-            align: 'center',
-            showOverflowTooltip: true
+            width: 55
           },
           {
             prop: 'name',
             label: '姓名',
             sortable: 'custom',
-            align: 'center',
+
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -97,7 +91,6 @@
             prop: 'jobNumber',
             label: '工号',
             sortable: 'custom',
-            align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -105,7 +98,6 @@
             prop: 'loginName',
             label: '用户账号',
             sortable: 'custom',
-            align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -113,7 +105,6 @@
             prop: 'sex',
             label: '性别',
             sortable: 'custom',
-            align: 'center',
             showOverflowTooltip: true,
             minWidth: 80,
             formatter: (_row, _column, cellValue) => {
@@ -123,7 +114,7 @@
           {
             prop: 'status',
             label: '状态',
-            align: 'center',
+
             sortable: 'custom',
             width: 80,
             formatter: (_row, _column, cellValue) => {
@@ -140,7 +131,7 @@
     watch: {},
     methods: {
       /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
+      datasource({ page, limit, where }) {
         return getUserPage({
           pageNum: page,
           size: limit,
@@ -150,14 +141,14 @@
 
       /* 刷新表格 */
       reload(where) {
-        this.$refs.table.reload({ pageNum: 1, where: where });
+        this.$refs.table222.reload({ pageNum: 1, where: where });
       },
 
       open(row, index) {
         this.visible = true;
         this.selection = [];
         this.currentIndex = index;
-        this.$refs.table.toggleRowSelection(row);
+        this.$refs.table222.clearSelection();
       },
       handleNodeClick(data, node) {
         this.curNodeData = data;
@@ -168,14 +159,6 @@
       },
 
       selected() {
-        // if (this.multiple) {
-
-        // } else {
-        //   if (!this.current) {
-        //     return this.$message.warning('请选择');
-        //   }
-        //   this.$emit('changeParent', this.current, this.currentIndex);
-        // }
         if (!this.selection.length) return this.$message.warning('请选择');
         this.$emit('changeParent', this.selection, this.currentIndex);
         this.handleClose();
@@ -185,33 +168,9 @@
 </script>
 
 <style lang="scss" scoped>
-  .tree_col {
-    border: 1px solid #eee;
-    padding: 10px 0;
-    box-sizing: border-box;
-    height: 500px;
-    overflow: auto;
-  }
-
-  .table_col {
-    padding-left: 10px;
-
-    ::v-deep .el-table th.el-table__cell {
-      background: #f2f2f2;
-    }
-  }
-
-  .pagination {
-    text-align: right;
-    padding: 10px 0;
-  }
-
-  .btns {
-    text-align: center;
-    padding: 10px 0;
-  }
-
-  .topsearch {
-    margin-bottom: 15px;
+  ::v-deep .table1 .el-table .el-table__cell .cell {
+    display: flex;
+    width: 100%;
+    justify-content: center;
   }
 </style>