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

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

quwangxin 3 лет назад
Родитель
Сommit
ee2ed6ab77

+ 2 - 23
package-lock.json

@@ -2032,7 +2032,7 @@
       "dependencies": {
         "@vue/vue-loader-v15": {
           "version": "npm:vue-loader@15.10.1",
-          "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
+          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.10.1.tgz",
           "integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
           "dev": true,
           "requires": {
@@ -2045,7 +2045,7 @@
           "dependencies": {
             "hash-sum": {
               "version": "1.0.2",
-              "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
+              "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
               "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
               "dev": true
             }
@@ -2200,27 +2200,6 @@
         }
       }
     },
-    "@vue/vue-loader-v15": {
-      "version": "npm:vue-loader@15.10.1",
-      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
-      "integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
-      "dev": true,
-      "requires": {
-        "@vue/component-compiler-utils": "^3.1.0",
-        "hash-sum": "^1.0.2",
-        "loader-utils": "^1.1.0",
-        "vue-hot-reload-api": "^2.3.0",
-        "vue-style-loader": "^4.1.0"
-      },
-      "dependencies": {
-        "hash-sum": {
-          "version": "1.0.2",
-          "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
-          "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
-          "dev": true
-        }
-      }
-    },
     "@vue/web-component-wrapper": {
       "version": "1.3.0",
       "resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",

+ 1 - 1
src/components/FormGenerator/FormDrawer.vue

@@ -354,7 +354,7 @@
     }
   }
   @include action-bar;
-  ::v-deep .el-drawer__header {
+  :deep(.el-drawer__header) {
     display: none;
   }
 </style>

+ 1 - 1
src/components/FormGenerator/IconsDialog.vue

@@ -101,7 +101,7 @@
     }
   }
   .icon-dialog {
-    ::v-deep .el-dialog {
+    :deep(.el-dialog) {
       border-radius: 8px;
       margin-bottom: 0;
       margin-top: 4vh !important;

+ 1 - 1
src/components/FormGenerator/JsonDrawer.vue

@@ -143,7 +143,7 @@
 <style lang="scss" scoped>
   @import '@/components/FormGenerator/styles/mixin.scss';
 
-  ::v-deep .el-drawer__header {
+  :deep(.el-drawer__header) {
     display: none;
   }
   @include action-bar;

Разница между файлами не показана из-за своего большого размера
+ 542 - 169
src/components/FormGenerator/RightPanel.vue


+ 0 - 1
src/router/routes.js

@@ -23,7 +23,6 @@ export const routes = [
     path: '*',
     component: () => import('@/views/exception/404/index.vue')
   }
-
   // {
   //   path: '/codeManagement/details',
   //   component: () => import('@/views/codeManagement/details.vue'),

+ 34 - 14
src/views/codeManagement/components/addDialog.vue

@@ -8,7 +8,7 @@
     width="1000px"
   >
     <div class="main_container">
-      <el-form :model="addForm" :rules="addFormRules" label-width="120px">
+      <el-form :model="addForm" :rules="addFormRules" ref="addForm" label-width="120px">
         <el-card
           shadow="never"
           header="基本信息"
@@ -21,7 +21,7 @@
                   <el-input
                     v-model="addForm.code"
                     type="text"
-                    
+
                     placeholder="请输入"
                   ></el-input>
                 </el-form-item>
@@ -31,7 +31,7 @@
                   <el-input
                     v-model="addForm.name"
                     type="text"
-                    
+
                     placeholder="请输入"
                   ></el-input>
                 </el-form-item>
@@ -41,7 +41,7 @@
                   <el-input
                     v-model="addForm.remark"
                     placeholder="请输入"
-                    
+
                   ></el-input>
                 </el-form-item>
               </el-col>
@@ -82,8 +82,8 @@ export default {
         remark: ''
       },
       addFormRules: {
-        name: [{ required: true, message: '请输入', trigger: 'blur' }],
-        code: [{ required: true, message: '请输入', trigger: 'blur' }]
+        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+        code: [{ required: true, message: '请输入编码', trigger: 'blur' }]
       },
     };
   },
@@ -111,14 +111,34 @@ export default {
       };
     },
     submitAdd() {
-      let par = {
-        code: this.addForm.code,
-        name: this.addForm.name,
-        remark: this.addForm.remark
-      };
-      saveNew(par).then((res) => {
-        console.log(res);
-      });
+      // this.$refs.addForm.validate((valid) => {
+      //   if (!valid) {
+      //     return false;
+      //   }
+      //   let par = {
+      //     code: this.addForm.code,
+      //     name: this.addForm.name,
+      //     remark: this.addForm.remark
+      //   };
+      //   saveNew(par).then((res) => {
+      //     console.log(res);
+      //   });
+      // });
+
+          const a1 = new Promise((resolve, reject) => {
+            this.$refs.addForm.validate((valid) => {
+              if (valid) resolve()
+            })
+          })
+          const a2 = new Promise((resolve, reject) => {
+            this.$refs.myTable.validateForm((valid) => {
+              if (valid) resolve()
+            })
+          })
+          Promise.all([a1, a2]).then(() => {
+              console.log('1111')
+          })
+
     },
   }
 };

+ 0 - 152
src/views/codeManagement/components/code-list-add.vue

@@ -1,152 +0,0 @@
-<!-- 用户编辑弹窗 -->
-<template>
-  <ele-modal
-    width="500px"
-    :visible="visible"
-    :close-on-click-modal="true"
-    custom-class="ele-dialog-form"
-    title="新建编码规则"
-    @update:visible="updateVisible"
-  >
-    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
-      <el-row :gutter="15">
-        <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
-          <el-form-item label="编码:" prop="code">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.code"
-              placeholder="请输入编码"
-            />
-          </el-form-item>
-          <el-form-item label="名称:" prop="name">
-            <el-input
-              clearable
-              :maxlength="100"
-              v-model="form.name"
-              placeholder="请输入名称"
-            />
-          </el-form-item>
-          <el-form-item label="描述:" prop="remark">
-            <el-input
-              clearable
-              type="textarea"
-              :maxlength="100"
-              v-model="form.remark"
-              :row="2"
-              placeholder="请输入描述"
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
-    <template v-slot:footer>
-      <el-button @click="updateVisible(false)">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </ele-modal>
-</template>
-
-<script>
-  import { getNotBoundAccount } from '@/api/system/user';
-  import { getUserDetail , saveOrUpdateUser , checkExistence } from '@/api/system/organization'
-  export default {
-    components: { },
-    props: {
-      // 弹窗是否打开
-      visible: Boolean,
-      // 修改回显的数据
-      data: Object,
-      // 全部机构
-      organizationList: Array,
-      // 机构id
-      organizationId: [Number,String]
-    },
-    data() {
-      const defaultForm = {
-        id: null,
-        groupId: null,
-        name: '',
-        sex: null,
-        email: '',
-        phone: '',
-        age:'',
-        accountId:''
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm },
-        // 表单验证规则
-        rules: {
-          name: [{ required: true, message: '请输入名称',trigger: 'blur'}],
-          code: [{ required: true, message: '请输入编码',trigger: 'blur'}],
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-      };
-    },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    methods: {
-      /* 保存编辑 */
-      save() {
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            return false;
-          }
-          this.loading = true;
-          const data = {
-            ...this.form,
-          };
-          saveOrUpdateUser(data)
-            .then((msg) => {
-              this.loading = false;
-              if(this.isUpdate){
-                 this.$message.success('人员信息编辑成功');
-              }else{
-                 this.$message.success('人员新增成功');
-              }
-              this.updateVisible(false);
-              this.$emit('done');
-            })
-            .catch((e) => {
-              this.loading = false;
-              this.$message.error(e.message);
-            });
-        });
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.$emit('update:visible', value);
-      }
-    },
-    watch: {
-      visible(visible) {
-        if (visible) {
-          if (this.data) {
-            // getUserDetail(this.data.id).then(res=>{
-            //    this.form = {...res}
-            //    this.city = res.addressId?res.addressId.toString():null
-            //    this.isUpdate = true;
-            // })
-          } else {
-            // this.form.groupId = this.organizationId;
-            // this.isUpdate = false;
-          }
-        } else {
-          this.$refs.form.clearValidate();
-          this.form = { ...this.defaultForm };
-        }
-      }
-    }
-  };
-</script>

+ 8 - 26
src/views/codeManagement/components/code-list.vue

@@ -48,23 +48,17 @@
       </template>
     </ele-pro-table>
     <!-- 编辑弹窗 -->
-    <code-list-add
-      :data="current"
-      :visible.sync="showEdit"
-      :organization-list="organizationList"
-      :organization-id="organizationId"
-      @done="reload"
-    />
+    <addDialog ref="addDialog"></addDialog>
   </div>
 </template>
 
 <script>
   import CodeSearch from './code-search.vue';
-  import CodeListAdd from './code-list-add.vue';
+  import addDialog from './addDialog.vue'
   import { getUserPage , removePersonnel } from '@/api/system/organization';
 
   export default {
-    components: { CodeSearch, CodeListAdd },
+    components: { CodeSearch , addDialog },
     props: {
       // 机构id
       organizationId: [Number,String],
@@ -119,14 +113,6 @@
         current: null,
         // 是否显示编辑弹窗
         showEdit: false,
-        statusOptions:[
-          {value:1,label:'全职'},
-          {value:2,label:'兼职'},
-          {value:3,label:'实习'},
-          {value:4,label:'正式'},
-          {value:5,label:'试用'},
-          {value:6,label:'离职'}
-        ],
       };
     },
     methods: {
@@ -146,15 +132,11 @@
       },
       /* 显示编辑 */
       openEdit(row) {
-        if(row){
-           this.$router.push({
-             path: '/codeManagement/details'
-           });
-        }else{
-          this.current = row;
-          this.showEdit = true;
-        }
-
+          if(row){
+            this.$refs.addDialog.open('edit')
+          }else{
+            this.$refs.addDialog.open('add')
+          }
       },
       /* 删除 */
       remove(row) {

+ 177 - 136
src/views/codeManagement/components/myTable.vue

@@ -4,15 +4,16 @@
       <el-button type="primary" @click="add" size="small">添加</el-button>
       <el-button type="primary" @click="_delete" size="small">删除</el-button>
     </div>
-    <div class="table-wrap">
+    <el-form class="table-wrap" :model="form" ref="tableForm" :rules="rules">
       <el-table
         ref="multipleTable"
         @selection-change="selectionChange"
-        :data="tableData"
+        :data="form.tableData"
         style="width: 100%"
       >
-        <el-table-column type="selection" width="55"> </el-table-column>
-        <el-table-column prop="date" label="排序" width="100">
+        <el-table-column type="selection" width="55" align="center">
+        </el-table-column>
+        <el-table-column prop="date" label="排序" width="80" align="center">
           <template slot-scope="{ row }">
             <div class="sort-wrap">
               <i class="el-icon-caret-top" @click="sortTop(row)"></i>
@@ -21,7 +22,31 @@
           </template>
         </el-table-column>
         <el-table-column prop="type.descp" label="类型" width="130">
-          <template slot-scope="{ row }">
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="'tableData.' + scope.$index + '.type.code'"
+              :rules="{
+                required: true,
+                message: '',
+                trigger: 'change'
+              }"
+            >
+              <el-select
+                @change="settype(scope.row, $event)"
+                v-model="scope.row.type.code"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.type"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+          <!--          <template slot-scope="{ row }">
             <el-select
               @change="settype(row, $event)"
               v-model="row.type.code"
@@ -35,7 +60,7 @@
               >
               </el-option>
             </el-select>
-          </template>
+          </template> -->
         </el-table-column>
         <el-table-column prop="content" label="内容" width="180">
           <template slot-scope="{ row }">
@@ -88,149 +113,165 @@
             ></el-input>
           </template>
         </el-table-column>
-        <el-table-column prop="address" label="说明"></el-table-column>
+        <el-table-column prop="address" label="说明">
+          <template slot-scope="{ row }">
+            <el-input v-model="row.remark" placeholder="请输入"></el-input>
+          </template>
+        </el-table-column>
       </el-table>
-    </div>
+    </el-form>
   </div>
 </template>
 <script>
-export default {
-  data() {
-    return {
-      tableData: [],
-      selectData: [],
-      options: {
-        type: [
-          {
-            value: 1,
-            label: '日期'
-          },
-          {
-            value: 2,
-            label: '流水号'
-          },
-          {
-            value: 3,
-            label: '固定值'
-          }
-        ],
-        date: [
-          {
-            value: '年月日',
-            label: '年月日'
-          },
-          {
-            value: '年月日时分秒',
-            label: '年月日时分秒'
-          },
-          {
-            value: '年月日时',
-            label: '年月日时'
-          },
-          {
-            value: '年月',
-            label: '年月'
-          },
-          {
-            value: '年',
-            label: '年'
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-    selectionChange(selection) {
-      if (selection.length > 1) {
-        this.$refs.multipleTable.clearSelection();
-        this.$refs.multipleTable.toggleRowSelection(selection.pop());
-      }
+  export default {
+    data () {
+      return {
+        selectData: [],
+        form: {
+          tableData: []
+        },
+        rules: {},
+        options: {
+          type: [
+            {
+              value: 1,
+              label: '日期'
+            },
+            {
+              value: 2,
+              label: '流水号'
+            },
+            {
+              value: 3,
+              label: '固定值'
+            }
+          ],
+          date: [
+            {
+              value: '年月日',
+              label: '年月日'
+            },
+            {
+              value: '年月日时分秒',
+              label: '年月日时分秒'
+            },
+            {
+              value: '年月日时',
+              label: '年月日时'
+            },
+            {
+              value: '年月',
+              label: '年月'
+            },
+            {
+              value: '年',
+              label: '年'
+            }
+          ]
+        }
+      };
     },
+    methods: {
+      selectionChange (selection) {
+        if (selection.length > 1) {
+          this.$refs.multipleTable.clearSelection();
+          this.$refs.multipleTable.toggleRowSelection(selection.pop());
+        }
+      },
 
-    settype(row, val) {
-      row.type.descp = this.options.type.find((n) => n.value == val).label;
-      // 重选初始化数据
-      row.content = ''
-      row.length = ''
-      row.currentId = ''
-      row.step = ''
-      row.remark = ''
-    },
+      settype (row, val) {
+        row.type.descp = this.options.type.find((n) => n.value == val).label;
+        // 重选初始化数据
+        row.content = '';
+        row.length = '';
+        row.currentId = '';
+        row.step = '';
+        row.remark = '';
+      },
 
-    // 获取选中值
-    getSelection() {
-      return this.$refs.multipleTable.selection;
-    },
-    _delete() {
-      let selection = this.getSelection();
-      if (selection.length > 0) {
-        let itemIndex = this.tableData.findIndex((n) => {
-          return n.sort == selection[0].sort;
+      // 获取选中值
+      getSelection () {
+        return this.$refs.multipleTable.selection;
+      },
+      _delete () {
+        let selection = this.getSelection();
+        if (selection.length > 0) {
+          let itemIndex = this.tableData.findIndex((n) => {
+            return n.sort == selection[0].sort;
+          });
+          if (itemIndex !== -1) {
+            this.tableData.splice(itemIndex, 1);
+            this.againSort();
+          }
+        }
+      },
+      add () {
+        this.form.tableData.push({
+          type: {
+            code: '',
+            descp: ''
+          },
+          content: '',
+          length: '', // 长度
+          currentId: '', // 当前流水
+          step: '', // 步长
+          remark: '', // 说明
+          sort: this.form.tableData.length + 1
         });
-        if (itemIndex !== -1) {
-          this.tableData.splice(itemIndex, 1);
-          this.againSort();
+      },
+      sortTop (row) {
+        if (row.sort <= 1) {
+          return;
         }
+        let rowN = this.form.tableData.find((n) => n.sort == row.sort - 1);
+        rowN.sort += 1;
+        row.sort -= 1;
+        this.form.tableData.sort((a, b) => {
+          return a.sort - b.sort;
+        });
+      },
+      sortBottom (row) {
+        if (row.sort >= this.form.tableData.length) {
+          return;
+        }
+        let rowN = this.form.tableData.find((n) => n.sort == row.sort + 1);
+        rowN.sort -= 1;
+        row.sort += 1;
+        this.form.tableData.sort((a, b) => {
+          return a.sort - b.sort;
+        });
+      },
+      againSort () {
+        this.form.tableData.forEach((n, index) => {
+          n.sort = index + 1;
+        });
+      },
+      validateForm (callback) {
+        //开始表单校验
+        this.$refs.tableForm.validate((valid) => {
+          callback(valid);
+        });
       }
-    },
-    add() {
-      this.tableData.push({
-        type: {
-          code: '',
-          descp: ''
-        },
-        content: '',
-        length: '', // 长度
-        currentId: '', // 当前流水
-        step: '', // 步长
-        remark: '', // 说明
-        sort: this.tableData.length + 1
-      });
-    },
-    sortTop(row) {
-      if (row.sort <= 1) {
-        return;
-      }
-      let rowN = this.tableData.find((n) => n.sort == row.sort - 1);
-      rowN.sort += 1;
-      row.sort -= 1;
-      this.tableData.sort((a, b) => {
-        return a.sort - b.sort;
-      });
-    },
-    sortBottom(row) {
-      if (row.sort >= this.tableData.length) {
-        return;
-      }
-      let rowN = this.tableData.find((n) => n.sort == row.sort + 1);
-      rowN.sort -= 1;
-      row.sort += 1;
-      this.tableData.sort((a, b) => {
-        return a.sort - b.sort;
-      });
-    },
-    againSort() {
-      this.tableData.forEach((n, index) => {
-        n.sort = index + 1;
-      });
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.sort-wrap {
-  i {
-    font-size: 30px;
-    cursor: pointer;
+  .sort-wrap {
+    i {
+      font-size: 30px;
+      cursor: pointer;
+    }
+    .el-icon-caret-top {
+      color: red;
+    }
+    .el-icon-caret-bottom {
+      color: #157a2c;
+    }
   }
-  .el-icon-caret-top {
-    color: red;
+  .btn-wrap {
+    margin-bottom: 20px;
   }
-  .el-icon-caret-bottom {
-    color: #157a2c;
+  :deep(.table-wrap .el-form-item__error) {
+    display: none;
   }
-}
-.btn-wrap{
-  margin-bottom: 20px;
-}
-</style>
+</style>

+ 21 - 2
src/views/system/dictionary/components/dict-edit.vue

@@ -120,10 +120,13 @@
       style="width: 100%"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" align="center"> </el-table-column>
       <el-table-column prop="code" label="字典项编码">
         <template slot-scope="scope">
-          <el-input v-model="scope.row.code" placeholder=""></el-input>
+          <el-input
+            @blur="checkedValue(scope.row.code)"
+            v-model="scope.row.code"
+            placeholder=""
+          ></el-input>
         </template>
       </el-table-column>
       <el-table-column prop="name" label="字典项名称">
@@ -337,6 +340,10 @@
         });
         this.filterArr();
       },
+      //
+      checkedValue(val) {
+        console.log(val);
+      },
       removeArr(row) {
         console.log(row);
         let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
@@ -355,6 +362,16 @@
           if (!valid) {
             return false;
           }
+          let falg = this.form.dictStaticSubmitPOList.some(
+            (item, index) => item.code.length === 0
+          );
+          if (falg) {
+            this.$message({
+              message: '字典项编码不能为空',
+              type: 'warning'
+            });
+            return;
+          }
           this.loading = true;
           const saveOrUpdate = this.isUpdate ? updateDictionary : addDictionary;
           saveOrUpdate(this.form)
@@ -405,6 +422,8 @@
         } else {
           this.$refs.form.clearValidate();
           this.form = { ...this.defaultForm };
+          this.form.dictStaticSubmitPOList = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后
+          this.tableData = []; // clear the list of the dictionary static push button. 描述变化的字段不会在push后。
         }
       }
     }

+ 2 - 1
vue.config.js

@@ -17,7 +17,8 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:18086', // 跨域请求的地址
         // target: 'http://192.168.3.35:8080', // kang杨威
-        target: 'http://192.168.3.25:8080', // 黄峥嵘
+        // target: 'http://192.168.3.25:8080', // 黄峥嵘
+        target: 'http://192.168.3.41:8080', // 何江鹏
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {

Некоторые файлы не были показаны из-за большого количества измененных файлов