Просмотр исходного кода

feat(规则管理): 新增自定义表格复制功能,支持复制表格数据并生成新实例

feat(系统管理): 在组织用户列表和搜索中新增手机号字段,优化推送状态显示格式
yusheng 5 месяцев назад
Родитель
Сommit
0430fcc6a7

+ 16 - 0
src/views/rulesManagement/releaseRules/components/experimentationProcess.vue

@@ -62,6 +62,7 @@
               @calculation="calculation"
               @editShow="editShowFn"
               :readonly="readonly"
+              @copy="copy"
               :edit="edit"
             ></customTable>
           </div>
@@ -504,6 +505,21 @@
           valueObj: {}
         });
       },
+      copy(data) {
+        console.log(data, 'asdasd');
+        let id = generateRandomString(6);
+        this.list.push({
+          id,
+          type: 'customTable',
+          ...data
+        });
+        this.$nextTick(() => {
+          this.$refs['customTextRef' + id][0].init({
+            form: null,
+            ...data
+          });
+        });
+      },
       getValue() {
         this.list.forEach((item, index) => {
           let { form, valueObj, equation, units } =

+ 17 - 11
src/views/rulesManagement/releaseRules/components/templateDiv/customTable.vue

@@ -8,7 +8,7 @@
     <el-button type="primary" @click="addRow(columns[0].length)" v-if="edit"
       >新增行</el-button
     >
-    <!-- <el-button type="primary" @click="copy()" v-if="edit">复制表格</el-button> -->
+    <el-button type="primary" @click="copy()" v-if="edit">复制表格</el-button>
     <el-checkbox v-model="isMerge" style="margin-left: 10px" v-if="edit"
       >合并单元格</el-checkbox
     >
@@ -535,16 +535,22 @@
           });
         }
       },
-      // copy() {
-      //   this.$emit('copy', {
-      //     form: null,
-      //     equation: JSON.parse(JSON.stringify(this.equation)),
-      //     units: JSON.parse(JSON.stringify(this.units)),
-      //     valueObj: {
-      //       columns: JSON.parse(JSON.stringify(this.valueObj))
-      //     }
-      //   });
-      // },
+      copy() {
+        let columns = JSON.parse(JSON.stringify(this.columns));
+        columns.forEach((item, index) => {
+          item.forEach((cell, _index) => {
+            cell.id = generateRandomString(5);
+          });
+        });
+        this.$emit('copy', {
+          value: null,
+          equation: {},
+          units: {},
+          valueObj: {
+            columns
+          }
+        });
+      },
       inputClick(item, type) {
         if (!this.edit) {
           return;

+ 16 - 8
src/views/system/organization/components/org-user-list.vue

@@ -296,7 +296,13 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
-
+          {
+            prop: 'phone',
+            label: '手机号',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'postName',
             label: '岗位',
@@ -351,7 +357,7 @@
             showOverflowTooltip: true,
             minWidth: 120,
             formatter: (_row, _column, cellValue) => {
-              return _row.code? '已推送' : '未推送';
+              return _row.code ? '已推送' : '未推送';
             }
           },
           {
@@ -483,12 +489,14 @@
     methods: {
       allPushBtn() {
         const dataId = this.selection.map((v) => v.id);
-        employeePush(dataId).then((res) => {
-          this.$message.success('推送成功!');
-          this.reload();
-        }).catch(() => {
-          console.log('推送失败!');
-        });
+        employeePush(dataId)
+          .then((res) => {
+            this.$message.success('推送成功!');
+            this.reload();
+          })
+          .catch(() => {
+            console.log('推送失败!');
+          });
       },
       async addUsers(row) {
         // this.userRow = null;

+ 14 - 2
src/views/system/organization/components/org-user-search.vue

@@ -38,9 +38,20 @@
           />
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model.trim="where.phone"
+            placeholder="手机号"
+          />
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <DictSelection
-          dictName="岗位"   placeholder="请选择岗位"
+          dictName="岗位"
+          placeholder="请选择岗位"
           clearable
           filterable
           v-model="where.postId"
@@ -82,7 +93,8 @@
         jobNumber: '',
         loginName: '',
         name: '',
-        postId:[],
+        phone:'',
+        postId: []
       };
       return {
         // 表单数据