Explorar el Código

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

汪钰 hace 3 años
padre
commit
ec47bd475a

+ 2 - 1
.eslintrc.js

@@ -18,6 +18,7 @@ module.exports = {
   rules: {
     'no-console': 'off',
     'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
-    'vue/multi-word-component-names': 'off'
+    'vue/multi-word-component-names': 'off',
+    'space-before-function-paren': 0
   }
 };

+ 24 - 22
package-lock.json

@@ -2028,6 +2028,29 @@
         "webpack-merge": "^5.7.3",
         "webpack-virtual-modules": "^0.4.2",
         "whatwg-fetch": "^3.6.2"
+      },
+      "dependencies": {
+        "@vue/vue-loader-v15": {
+          "version": "npm:vue-loader@15.10.1",
+          "resolved": "https://registry.npmmirror.com/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.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
+              "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
+              "dev": true
+            }
+          }
+        }
       }
     },
     "@vue/cli-shared-utils": {
@@ -2177,27 +2200,6 @@
         }
       }
     },
-    "@vue/vue-loader-v15": {
-      "version": "npm:vue-loader@15.10.1",
-      "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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",
@@ -9046,7 +9048,7 @@
     },
     "vue-hot-reload-api": {
       "version": "2.3.4",
-      "resolved": "https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
+      "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
       "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
       "dev": true
     },

+ 0 - 0
src/api/classifyManage/index.js


+ 9 - 0
src/api/codeManagement/index.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request';
+
+export async function saveNew(data) {
+    const res = await request.post('/main/codemanage/saveNew', data);
+    if (res.data.code == 0) {
+        return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+}

+ 16 - 16
src/components/FormGenerator/components/generator/js.js

@@ -1,4 +1,4 @@
-// import { isArray } from 'util'
+// import { Array.isArray } from 'util';
 import {
   exportDefault,
   titleCase,
@@ -22,7 +22,7 @@ const inheritAttrs = {
  * @param {Object} formConfig 整个表单配置
  * @param {String} type 生成类型,文件或弹窗等
  */
-export function makeUpJs(formConfig, type) {
+export function makeUpJs (formConfig, type) {
   confGlobal = formConfig = deepClone(formConfig);
   const dataList = [];
   const ruleList = [];
@@ -61,7 +61,7 @@ export function makeUpJs(formConfig, type) {
 }
 
 // 构建组件属性
-function buildAttributes(
+function buildAttributes (
   scheme,
   dataList,
   ruleList,
@@ -124,12 +124,12 @@ function buildAttributes(
 }
 
 // 在Created调用函数
-function callInCreated(methodName, created) {
+function callInCreated (methodName, created) {
   created.push(`this.${methodName}()`);
 }
 
 // 混入处理函数
-function mixinMethod(type) {
+function mixinMethod (type) {
   const list = [];
   const minxins = {
     file: confGlobal.formBtns
@@ -173,7 +173,7 @@ function mixinMethod(type) {
 }
 
 // 构建data
-function buildData(scheme, dataList) {
+function buildData (scheme, dataList) {
   const config = scheme.__config__;
   if (scheme.__vModel__ === undefined) return;
   const defaultValue = JSON.stringify(config.defaultValue);
@@ -181,14 +181,14 @@ function buildData(scheme, dataList) {
 }
 
 // 构建校验规则
-function buildRules(scheme, ruleList) {
+function buildRules (scheme, ruleList) {
   const config = scheme.__config__;
   if (scheme.__vModel__ === undefined) return;
   const rules = [];
   if (ruleTrigger[config.tag]) {
     if (config.required) {
-      const type = isArray(config.defaultValue) ? "type: 'array'," : '';
-      let message = isArray(config.defaultValue)
+      const type = Array.isArray(config.defaultValue) ? "type: 'array'," : '';
+      let message = Array.isArray(config.defaultValue)
         ? `请至少选择一个${config.label}`
         : scheme.placeholder;
       if (message === undefined) message = `${config.label}不能为空`;
@@ -198,7 +198,7 @@ function buildRules(scheme, ruleList) {
         }' }`
       );
     }
-    if (config.regList && isArray(config.regList)) {
+    if (config.regList && Array.isArray(config.regList)) {
       config.regList.forEach((item) => {
         if (item.pattern) {
           rules.push(
@@ -214,7 +214,7 @@ function buildRules(scheme, ruleList) {
 }
 
 // 构建options
-function buildOptions(scheme, optionsList) {
+function buildOptions (scheme, optionsList) {
   if (scheme.__vModel__ === undefined) return;
   // el-cascader直接有options属性,其他组件都是定义在slot中,所以有两处判断
   let { options } = scheme;
@@ -226,7 +226,7 @@ function buildOptions(scheme, optionsList) {
   optionsList.push(str);
 }
 
-function buildProps(scheme, propsList) {
+function buildProps (scheme, propsList) {
   const str = `${scheme.__vModel__}Props: ${JSON.stringify(
     scheme.props.props
   )},`;
@@ -234,7 +234,7 @@ function buildProps(scheme, propsList) {
 }
 
 // el-upload的BeforeUpload
-function buildBeforeUpload(scheme) {
+function buildBeforeUpload (scheme) {
   const config = scheme.__config__;
   const unitNum = units[config.sizeUnit];
   let rightSizeCode = '';
@@ -263,14 +263,14 @@ function buildBeforeUpload(scheme) {
 }
 
 // el-upload的submit
-function buildSubmitUpload(scheme) {
+function buildSubmitUpload (scheme) {
   const str = `submitUpload() {
     this.$refs['${scheme.__vModel__}'].submit()
   },`;
   return str;
 }
 
-function buildOptionMethod(methodName, model, methodList, scheme) {
+function buildOptionMethod (methodName, model, methodList, scheme) {
   const config = scheme.__config__;
   const str = `${methodName}() {
     // 注意:this.$axios是通过Vue.prototype.$axios = axios挂载产生的
@@ -286,7 +286,7 @@ function buildOptionMethod(methodName, model, methodList, scheme) {
 }
 
 // js整体拼接
-function buildexport(
+function buildexport (
   conf,
   type,
   data,

+ 8 - 2
src/router/routes.js

@@ -23,6 +23,12 @@ export const routes = [
     path: '*',
     component: () => import('@/views/exception/404/index.vue')
   }
+
+  // {
+  //   path: '/codeManagement/details',
+  //   component: () => import('@/views/codeManagement/details.vue'),
+  //   meta: { title: '编码信息' }
+  // }
 ];
 
 /**
@@ -30,7 +36,7 @@ export const routes = [
  * @param menus 菜单数据
  * @param homePath 菜单数据的第一个页面地址
  */
-export function getMenuRoutes(menus, homePath) {
+export function getMenuRoutes (menus, homePath) {
   const routes = [
     // 用于刷新的路由
     {
@@ -58,7 +64,7 @@ export function getMenuRoutes(menus, homePath) {
  * 获取路由组件
  * @param component 组件名称
  */
-function getComponent(component) {
+function getComponent (component) {
   if (component) {
     return () => import('@/views/' + component);
   }

+ 10 - 9
src/store/modules/user.js

@@ -19,19 +19,19 @@ export default {
   },
   mutations: {
     // 设置登录用户的信息
-    setUserInfo(state, info) {
+    setUserInfo (state, info) {
       state.info = info;
     },
     // 设置登录用户的菜单
-    setMenus(state, menus) {
+    setMenus (state, menus) {
       state.menus = menus;
     },
     // 设置登录用户的权限
-    setAuthorities(state, authorities) {
+    setAuthorities (state, authorities) {
       state.authorities = authorities;
     },
     // 设置登录用户的角色
-    setRoles(state, roles) {
+    setRoles (state, roles) {
       state.roles = roles;
     }
   },
@@ -69,7 +69,7 @@ export default {
     //   return { menus, homePath };
     // },
     //动态路由
-    async fetchUserInfo({ commit }) {
+    async fetchUserInfo ({ commit }) {
       const result = await getUserInfo().catch(() => {});
       console.log('result--', result);
       if (!result) {
@@ -90,7 +90,8 @@ export default {
       const { menus, homePath } = formatMenus(
         USER_MENUS ??
           toTreeData({
-            data: result?.filter((d) => d.menuType !== 1),
+            data: result,
+            // data: result?.filter((d) => d.menuType !== 2),  暂时不做按钮权限
             idField: 'id',
             parentIdField: 'parentId'
           })
@@ -106,19 +107,19 @@ export default {
     /**
      * 更新用户信息
      */
-    setInfo({ commit }, value) {
+    setInfo ({ commit }, value) {
       commit('setUserInfo', value);
     },
     /**
      * 更新菜单数据
      */
-    setMenus({ commit }, value) {
+    setMenus ({ commit }, value) {
       commit('setMenus', value);
     },
     /**
      * 更新菜单的badge
      */
-    setMenuBadge({ commit, state }, { path, value, color }) {
+    setMenuBadge ({ commit, state }, { path, value, color }) {
       const menus = formatTreeData(state.menus, (m) => {
         if (path === m.path) {
           return {

+ 136 - 0
src/views/classifyManage/components/addDialog.vue

@@ -0,0 +1,136 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="addRoleDialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="40%"
+  >
+    <div class="dialog_top"></div>
+    <div class="main_container">
+      <el-form :model="addForm" :rules="addFormRules" label-width="120px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="父级节点" prop="name">
+                研磨棒(501)
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="层级全览" prop="other">
+              硬质合金-自用合金-研磨棒(121-002-501)
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="节点编码" prop="order">
+              <el-input
+                placeholder="请输入"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="节点名称" prop="remark">
+              <el-input
+                placeholder="请输入"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="与下层分隔" prop="remark">
+              <el-select size="small"  placeholder="请选择" style="width: 100%;">
+                <el-option
+                  v-for="item in options.fgf"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="本层排序" prop="remark">
+              <el-input
+                v-model="addForm.remark"
+                placeholder="请输入"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="submitAdd">保存</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  props: {
+    dialogTitle: {
+      type: String,
+      default: "节点信息",
+    },
+  },
+  // components: { EquipmentDialog, SelectUpload , selectTree},
+  watch: {},
+  data() {
+    return {
+      addRoleDialog: false,
+      addForm: {},
+      addFormRules: {
+        name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
+        other: [{ required: true, message: "请输入角色别名", trigger: "blur" }],
+      },
+      options:{
+        fgf:[
+          {
+            value: null,
+            label: '无分隔符'
+          },
+          {
+            value: '-',
+            label: '-'
+          },
+          {
+            value: '~',
+            label: '~'
+          },{
+            value: '_',
+            label: '_'
+          },
+        ]
+      }
+    };
+  },
+  created() {
+    // this.getrecipientDep()
+  },
+  methods: {
+    open(){
+      this.addRoleDialog = true
+    },
+    handleClose() {
+      this.addRoleDialog = false;
+    },
+    submitAdd() {},
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog_top {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10px;
+}
+.btns {
+  text-align: right;
+  margin: 10px 0;
+}
+</style>

+ 167 - 0
src/views/classifyManage/details.vue

@@ -0,0 +1,167 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="container-main">
+        <div class="tree-wrap">
+          <el-tree
+            :data="treeData"
+            :props="defaultProps"
+            @node-click="handleNodeClick"
+          ></el-tree>
+        </div>
+        <div class="main-wrap">
+          <div class="top-bar">
+            <el-button size="medium" class="btn" @click="handlOpen"
+              >新建下级节点</el-button
+            >
+            <el-button size="medium" class="btn">编辑节点</el-button>
+          </div>
+          <div class="basic-details-title">
+            <span class="border-span">基本信息</span>
+          </div>
+          <el-descriptions size="medium">
+            <el-descriptions-item label="父级节点"
+              >自用合金(002)</el-descriptions-item
+            >
+            <el-descriptions-item label="层级全览"
+              >硬质合金-自用合金-研磨棒(121-002-501)</el-descriptions-item
+            >
+            <el-descriptions-item label="节点编码">501</el-descriptions-item>
+            <el-descriptions-item label="节点名称">研磨棒</el-descriptions-item>
+            <el-descriptions-item label="与下层分隔">-</el-descriptions-item>
+          </el-descriptions>
+          <div class="fhlb-wrap">
+            <el-button size="medium">返回列表</el-button>
+          </div>
+        </div>
+      </div>
+      <addDialog ref="addDialog"></addDialog>
+    </el-card>
+  </div>
+</template>
+<script>
+import addDialog from './components/addDialog.vue';
+export default {
+  components: {
+    addDialog
+  },
+  data() {
+    return {
+      treeData: [
+        {
+          label: '一级 1',
+          children: [
+            {
+              label: '二级 1-1',
+              children: [
+                {
+                  label: '三级 1-1-1'
+                }
+              ]
+            }
+          ]
+        },
+        {
+          label: '一级 2',
+          children: [
+            {
+              label: '二级 2-1',
+              children: [
+                {
+                  label: '三级 2-1-1'
+                }
+              ]
+            },
+            {
+              label: '二级 2-2',
+              children: [
+                {
+                  label: '三级 2-2-1'
+                }
+              ]
+            }
+          ]
+        },
+        {
+          label: '一级 3',
+          children: [
+            {
+              label: '二级 3-1',
+              children: [
+                {
+                  label: '三级 3-1-1'
+                }
+              ]
+            },
+            {
+              label: '二级 3-2',
+              children: [
+                {
+                  label: '三级 3-2-1'
+                }
+              ]
+            }
+          ]
+        }
+      ],
+      defaultProps: {
+        children: 'children',
+        label: 'label'
+      }
+    };
+  },
+  methods: {
+    handlOpen() {
+      this.$refs.addDialog.open();
+    },
+    handleNodeClick() {}
+  }
+};
+</script>
+<style lang="scss" scoped>
+.container-main {
+  display: flex;
+  height: calc(100vh - 160px);
+  .tree-wrap {
+    width: 220px;
+    border-right: 1px solid #d7d7d7;
+  }
+  .main-wrap {
+    flex: 1;
+    margin-left: 20px;
+  }
+}
+.top-bar {
+  height: 50px;
+  background: #f2f2f2;
+  display: flex;
+  align-items: center;
+  padding-left: 10px;
+}
+.btn {
+  background: #157a2c;
+  color: #ffffff;
+}
+.basic-details-title {
+  margin-bottom: 12px;
+  margin-top: 20px;
+  border-bottom: 1px solid #157a2c;
+  padding-bottom: 8px;
+  display: flex;
+  justify-content: space-between;
+}
+.basic-details-title .border-span {
+  height: 18px;
+  font-size: 16px;
+  border-left: 4px solid #157a2c;
+  padding-left: 8px;
+
+  font-weight: 500;
+}
+.fhlb-wrap {
+  padding: 20px 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+</style>

+ 120 - 0
src/views/classifyManage/index.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="app-container ele-body">
+    <div class="zw-page-table">
+      <!-- 条件区 -->
+      <el-form label-width="100px" class="zw-criterion">
+        <div class="zw-criterion-normal">
+          <el-row>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input size="small" placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input size="small" placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4" style="padding-left: 10px">
+              <el-button
+                type="primary"
+                @click="search"
+                icon="el-icon-search"
+                size="small"
+                >搜索</el-button
+              >
+              <el-button @click="reset" icon="el-icon-refresh-left" size="small"
+                >重置</el-button
+              >
+            </el-col>
+          </el-row>
+        </div>
+      </el-form>
+    </div>
+    <el-table class="table" :data="tableData">
+      <el-table-column prop="s1" label="类型编码" width="180">
+      </el-table-column>
+      <el-table-column prop="name" label="类型名称" width="180">
+      </el-table-column>
+      <el-table-column prop="address" label="描述"></el-table-column>
+      <el-table-column prop="address" label="操作">
+        <template slot-scope="{ row }">
+          <el-button type="text" @click="junmpEdit(row)" size="small">编辑</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <div class="pagination-wrap">
+      <el-pagination
+        background
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        :page-size="size"
+        :current-page.sync="page"
+        @current-change="handleCurrentChange"
+        @size-change="handleSizeChange"
+      >
+      </el-pagination>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      searchForm: {},
+      tableData: [
+        {
+            s1:'1'
+        }
+      ],
+      total: 0,
+      size: 10,
+      page: 1,
+    };
+  },
+  methods: {
+    search() {
+      this.pagination.page = 1;
+      this.getData();
+    },
+    reset() {},
+    // 分页器方法
+    handleCurrentChange(page) {
+      this.page = page;
+      this.getData();
+    },
+    handleSizeChange(size) {
+      this.page = 1;
+      this.size = size;
+      this.getData();
+    },
+    getData() {},
+    // 编辑
+    junmpEdit(row){
+      this.$router.push({
+        path:'/classifyManage/details'
+      })
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.app-container {
+  background: #f0f3f3;
+  min-height: calc(100vh - 84px);
+}
+.zw-page-table {
+  background: #ffffff;
+  padding-top: 20px;
+}
+.pagination-wrap {
+  display: flex;
+  justify-content: flex-end;
+  padding: 10px 0;
+}
+.table {
+  width: 100%;
+  margin-top: 10px;
+}
+</style>

+ 138 - 0
src/views/codeManagement/components/addDialog.vue

@@ -0,0 +1,138 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="addRoleDialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="1000px"
+  >
+    <div class="main_container">
+      <el-form :model="addForm" :rules="addFormRules" label-width="120px">
+        <el-card
+          shadow="never"
+          header="基本信息"
+          body-style="padding: 22px 22px 0 22px;"
+        >
+          <div class="form-wrap">
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="编码" prop="code" style="margin-bottom: 22px;">
+                  <el-input
+                    v-model="addForm.code"
+                    type="text"
+                    
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="名称" prop="name" style="margin-bottom: 22px;">
+                  <el-input
+                    v-model="addForm.name"
+                    type="text"
+                    
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="描述" prop="remark" style="margin-bottom: 22px;">
+                  <el-input
+                    v-model="addForm.remark"
+                    placeholder="请输入"
+                    
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </el-card>
+        <el-card
+          shadow="never"
+          header="编码配置"
+          body-style="padding: 22px 22px 0 22px;"
+        >
+            <myTable ref="myTable"></myTable>
+        </el-card>
+      </el-form>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="submitAdd">保存</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { saveNew } from '@/api/codeManagement/index';
+import myTable from './myTable.vue'
+export default {
+  components:{
+    myTable
+  },
+  watch: {},
+  data() {
+    return {
+      addRoleDialog: false,
+      dialogTitle:'新建编码规则',
+      addForm: {
+        name: '',
+        code: '',
+        remark: ''
+      },
+      addFormRules: {
+        name: [{ required: true, message: '请输入', trigger: 'blur' }],
+        code: [{ required: true, message: '请输入', trigger: 'blur' }]
+      },
+    };
+  },
+  created() {
+    // this.getrecipientDep()
+  },
+  methods: {
+    open(type,row) {
+      if(type == 'add'){
+        this.dialogTitle = '新建编码规则'
+      }else if(type == 'edit'){
+        this.dialogTitle = '编辑编码规则'
+      }
+      this.addRoleDialog = true;
+    },
+    handleClose() {
+      this.restForm();
+      this.addRoleDialog = false;
+    },
+    restForm() {
+      this.addForm = {
+        name: '',
+        code: '',
+        remark: ''
+      };
+    },
+    submitAdd() {
+      let par = {
+        code: this.addForm.code,
+        name: this.addForm.name,
+        remark: this.addForm.remark
+      };
+      saveNew(par).then((res) => {
+        console.log(res);
+      });
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog_top {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10px;
+}
+.btns {
+  text-align: right;
+  margin: 10px 0;
+}
+</style>

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

@@ -0,0 +1,152 @@
+<!-- 用户编辑弹窗 -->
+<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>

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

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <code-search @search="reload">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+          >
+            添加
+          </el-button>
+        </code-search>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="openEdit(row)"
+        >
+          编辑
+        </el-link>
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此用户吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <!-- 编辑弹窗 -->
+    <code-list-add
+      :data="current"
+      :visible.sync="showEdit"
+      :organization-list="organizationList"
+      :organization-id="organizationId"
+      @done="reload"
+    />
+  </div>
+</template>
+
+<script>
+  import CodeSearch from './code-search.vue';
+  import CodeListAdd from './code-list-add.vue';
+  import { getUserPage , removePersonnel } from '@/api/system/organization';
+
+  export default {
+    components: { CodeSearch, CodeListAdd },
+    props: {
+      // 机构id
+      organizationId: [Number,String],
+      // 全部机构
+      organizationList: Array
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '编码',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'loginName',
+            label: '名称',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '描述',
+            align: 'center',
+            sortable: 'custom',
+            minWidth: 200,
+            showOverflowTooltip: true,
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 130,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        statusOptions:[
+          {value:1,label:'全职'},
+          {value:2,label:'兼职'},
+          {value:3,label:'实习'},
+          {value:4,label:'正式'},
+          {value:5,label:'试用'},
+          {value:6,label:'离职'}
+        ],
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getUserPage({
+          ...where,
+          ...order,
+          pageNum:page,
+          size:limit,
+          groupId: this.organizationId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+      /* 显示编辑 */
+      openEdit(row) {
+        if(row){
+           this.$router.push({
+             path: '/codeManagement/details'
+           });
+        }else{
+          this.current = row;
+          this.showEdit = true;
+        }
+
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+        removePersonnel([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            this.$message.error(e.message);
+          });
+      },
+      /* 更改状态 */
+      editStatus(row) {
+        const loading = this.$loading({ lock: true });
+        updateUserStatus(row.userId, row.status)
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+          })
+          .catch((e) => {
+            loading.close();
+            row.status = !row.status ? 1 : 0;
+            this.$message.error(e.message);
+          });
+      }
+    },
+    watch: {
+      // 监听机构id变化
+      organizationId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 90 - 0
src/views/codeManagement/components/code-search.vue

@@ -0,0 +1,90 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.code"
+            placeholder="请输入编码"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.name"
+            placeholder="请输入名称"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.remark"
+            placeholder="请输入描述"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <slot></slot>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        code: '',
+        name: '',
+        remark:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 236 - 0
src/views/codeManagement/components/myTable.vue

@@ -0,0 +1,236 @@
+<template>
+  <div class="bmpz-wrap">
+    <div class="btn-wrap">
+      <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-table
+        ref="multipleTable"
+        @selection-change="selectionChange"
+        :data="tableData"
+        style="width: 100%"
+      >
+        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column prop="date" label="排序" width="100">
+          <template slot-scope="{ row }">
+            <div class="sort-wrap">
+              <i class="el-icon-caret-top" @click="sortTop(row)"></i>
+              <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="type.descp" label="类型" width="130">
+          <template slot-scope="{ row }">
+            <el-select
+              @change="settype(row, $event)"
+              v-model="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>
+          </template>
+        </el-table-column>
+        <el-table-column prop="content" label="内容" width="180">
+          <template slot-scope="{ row }">
+            <!-- 固定值 -->
+            <el-input
+              v-if="row.type.code == 3"
+              v-model="row.content"
+              placeholder="请输入内容"
+            ></el-input>
+            <!-- 日期 -->
+            <el-select
+              v-if="row.type.code == 1"
+              v-model="row.content"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in options.date"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column prop="length" label="长度">
+          <template slot-scope="{ row }">
+            <el-input
+              v-if="row.type.code == 2"
+              v-model="row.length"
+              placeholder="请输入"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column prop="currentId" label="当前流水">
+          <template slot-scope="{ row }">
+            <el-input
+              v-if="row.type.code == 2"
+              v-model="row.currentId"
+              placeholder="请输入"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column prop="step" label="步长">
+          <template slot-scope="{ row }">
+            <el-input
+              v-if="row.type.code == 2"
+              v-model="row.step"
+              placeholder="请输入"
+            ></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column prop="address" label="说明"></el-table-column>
+      </el-table>
+    </div>
+  </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());
+      }
+    },
+
+    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;
+        });
+        if (itemIndex !== -1) {
+          this.tableData.splice(itemIndex, 1);
+          this.againSort();
+        }
+      }
+    },
+    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;
+  }
+  .el-icon-caret-top {
+    color: red;
+  }
+  .el-icon-caret-bottom {
+    color: #157a2c;
+  }
+}
+.btn-wrap{
+  margin-bottom: 20px;
+}
+</style>

+ 62 - 0
src/views/codeManagement/components/tree.vue

@@ -0,0 +1,62 @@
+<template>
+  <div class="main">
+    <div class="input-warp">
+        <el-input size="small" suffix-icon="el-icon-search" placeholder="请输入功能名称" v-model="filterText"> </el-input>
+    </div>      
+
+    <el-tree
+      class="filter-tree"
+      :data="data"
+      :props="defaultProps"
+      default-expand-all
+      :highlight-current="true"
+      :filter-node-method="filterNode"
+      @node-click="handleNodeClick"
+      ref="tree"
+    >
+    </el-tree>
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default() {
+        return [];
+      },
+    },
+  },
+  data() {
+    return {
+      filterText: "",
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+    };
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  methods: {
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    handleNodeClick(data, Node){
+        this.$emit("change", data);
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.input-warp{
+    padding: 10px;
+}
+.main{
+    background: #ffffff;
+}
+</style>

+ 111 - 0
src/views/codeManagement/details.vue

@@ -0,0 +1,111 @@
+<template>
+  <div class="ele-body">
+    <el-card
+      shadow="never"
+      header="基本信息"
+      body-style="padding: 22px 22px 0 22px;"
+    >
+      <div class="form-wrap">
+        <el-form :model="form" :rules="addFormRules" label-width="120px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="编码" prop="name">
+                <el-input
+                  type="text"
+                  size="small"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="名称" prop="other">
+                <el-input
+                  type="text"
+                  size="small"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="描述" prop="order">
+                <el-input placeholder="请输入" size="small"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+    </el-card>
+    <el-card
+      shadow="never"
+      header="编码配置"
+      body-style="padding: 22px 22px 0 22px;"
+    >
+      <div class="bmpz-wrap">
+        <div class="btn-wrap">
+          <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-table :data="tableData" style="width: 100%">
+            <el-table-column prop="date" label="排序" width="180">
+            </el-table-column>
+            <el-table-column prop="name" label="类型" width="180">
+            </el-table-column>
+            <el-table-column prop="address" label="内容"></el-table-column>
+            <el-table-column prop="address" label="长度"></el-table-column>
+            <el-table-column prop="address" label="当前流水"></el-table-column>
+            <el-table-column prop="address" label="步长"></el-table-column>
+            <el-table-column prop="address" label="说明"></el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      form: {},
+      addFormRules: {},
+      tableData: [
+        {
+          sort: 1,
+          type: '业务变量',
+          content: 'asdad',
+          length: '',
+          running: '',
+          stepSize: ''
+        }
+      ]
+    };
+  },
+  methods: {
+    add() {},
+    _delete() {}
+  }
+};
+</script>
+<style lang="scss" scoped>
+.basic-details-title {
+  margin-bottom: 12px;
+  margin-top: 20px;
+  border-bottom: 1px solid #157a2c;
+  padding-bottom: 8px;
+  display: flex;
+  justify-content: space-between;
+}
+.basic-details-title .border-span {
+  height: 18px;
+  font-size: 16px;
+  border-left: 4px solid #157a2c;
+  padding-left: 8px;
+
+  font-weight: 500;
+}
+.form-wrap {
+  max-width: 700px;
+}
+</style>

+ 148 - 0
src/views/codeManagement/index.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div>
+          <!-- 操作按钮 -->
+          <ele-toolbar class="ele-toolbar-actions">
+            <div style="margin: 5px 0">
+              <el-input size="small" suffix-icon="el-icon-search" placeholder="请输入功能名称" v-model="filterText"> </el-input>
+            </div>
+          </ele-toolbar>
+          <div class="ele-border-lighter sys-organization-list">
+            <el-tree
+              ref="tree"
+              :data="data"
+              highlight-current
+              node-key="id"
+              :props="{ label: 'name' }"
+              :expand-on-click-node="false"
+              :default-expand-all="true"
+              @node-click="onNodeClick"
+            />
+          </div>
+        </div>
+        <template v-slot:content>
+          <code-list
+            v-if="current"
+            :organization-list="data"
+            :organization-id="current.id"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import CodeList from './components/code-list.vue';
+  import {
+    listOrganizations,
+    removeOrganization
+  } from '@/api/system/organization';
+
+  export default {
+    name: 'codeManagement',
+    components: { CodeList },
+    data() {
+      return {
+        // 加载状态
+        loading: true,
+        // 列表数据
+        data: [],
+        // 选中数据
+        current: null,
+        // 是否显示表单弹窗
+        showEdit: false,
+        // 编辑回显数据
+        editData: null,
+        // 上级id
+        parentId: null,
+        filterText:''
+      };
+    },
+    created() {
+      this.query();
+    },
+    methods: {
+      /* 查询 */
+      query() {
+        this.loading = true;
+        listOrganizations()
+          .then((list) => {
+            this.loading = false;
+            this.data = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+            this.$nextTick(() => {
+              this.onNodeClick(this.data[0]);
+            });
+          })
+          .catch((e) => {
+            this.loading = false;
+            this.$message.error(e.message);
+          });
+      },
+      /* 选择数据 */
+      onNodeClick(row) {
+        if (row) {
+          this.current = row;
+          this.parentId = row.id;
+          this.$refs.tree.setCurrentKey(row.id);
+        } else {
+          this.current = null;
+          this.parentId = null;
+        }
+      },
+      /* 显示编辑 */
+      openEdit(item) {
+        this.editData = item;
+        this.showEdit = true;
+      },
+      /* 删除 */
+      remove() {
+        this.$confirm('确定要删除选中的机构吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            removeOrganization([this.current.id])
+              .then((msg) => {
+                loading.close();
+                this.$message.success(msg);
+                this.query();
+              })
+              .catch((e) => {
+                loading.close();
+                this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 207 - 0
src/views/codeManagement/index2.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="app-container ele-body">
+    <div class="zw-page-table">
+      <!-- 条件区 -->
+      <el-form label-width="100px" class="zw-criterion">
+        <div class="zw-criterion-normal">
+          <el-row>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4" style="padding-left: 10px">
+              <el-button
+                type="primary"
+                @click="search"
+                icon="el-icon-search"
+
+                >搜索</el-button
+              >
+              <el-button @click="reset" icon="el-icon-refresh-left"
+                >重置</el-button
+              >
+            </el-col>
+          </el-row>
+        </div>
+      </el-form>
+    </div>
+    <div class="butn-wrap">
+      <el-button
+        type="primary"
+        @click="add"
+        icon="el-icon-search"
+        size="small"
+        >新增</el-button
+      >
+    </div>
+    <div class="container-main">
+      <div class="tree-wrap">
+        <tree ref="tree" :data="treeData" @change="treeChange"></tree>
+      </div>
+      <div class="main-wrap">
+        <el-table class="table" :data="tableData">
+          <el-table-column prop="s1" label="编码" width="180">
+          </el-table-column>
+          <el-table-column prop="name" label="名称" width="180">
+          </el-table-column>
+          <el-table-column prop="address" label="描述"></el-table-column>
+          <el-table-column prop="address" label="操作">
+            <template slot-scope="{ row }">
+              <el-button type="text" @click="junmpEdit(row)" size="small"
+                >编辑</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <div class="pagination-wrap">
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            :page-size="size"
+            :current-page.sync="page"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+    <addDialog ref="addDialog"></addDialog>
+  </div>
+</template>
+<script>
+import tree from './components/tree.vue';
+import addDialog from './components/addDialog.vue'
+export default {
+  components: {
+    tree,
+    addDialog
+  },
+  data() {
+    return {
+      treeData: [
+        {
+          id: 1,
+          label: '一级 1',
+          children: [
+            {
+              id: 4,
+              label: '二级 1-1',
+              children: [
+                {
+                  id: 9,
+                  label: '三级 1-1-1'
+                },
+                {
+                  id: 10,
+                  label: '三级 1-1-2'
+                }
+              ]
+            }
+          ]
+        },
+        {
+          id: 2,
+          label: '一级 2',
+          children: [
+            {
+              id: 5,
+              label: '二级 2-1'
+            },
+            {
+              id: 6,
+              label: '二级 2-2'
+            }
+          ]
+        },
+        {
+          id: 3,
+          label: '一级 3',
+          children: [
+            {
+              id: 7,
+              label: '二级 3-1'
+            },
+            {
+              id: 8,
+              label: '二级 3-2'
+            }
+          ]
+        }
+      ],
+      tableData: [
+        {
+          s1: '1'
+        }
+      ],
+      total: 0,
+      size: 10,
+      page: 1
+    };
+  },
+  methods: {
+    treeChange(val) {
+      console.log(val);
+    },
+    // 编辑
+    junmpEdit(row) {
+      // this.$router.push({
+      //   path: '/codeManagement/details'
+      // });
+      this.$refs.addDialog.open('edit')
+    },
+    search() {},
+    reset() {},
+    handleCurrentChange() {},
+    handleSizeChange() {},
+    add(){
+      this.$refs.addDialog.open('add')
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-container {
+  min-height: calc(100vh - 150px);
+}
+.container-main {
+  display: flex;
+  height: calc(100vh - 230px);
+  .tree-wrap {
+    width: 220px;
+  }
+  .main-wrap {
+    flex: 1;
+    margin-left: 20px;
+  }
+}
+
+.btn {
+  background: #157a2c;
+  color: #ffffff;
+}
+.zw-page-table {
+  background: #ffffff;
+  padding-top: 20px;
+  margin-bottom: 20px;
+}
+.pagination-wrap {
+  display: flex;
+  justify-content: flex-end;
+  padding: 10px 0;
+}
+.tree-wrap {
+  background: #ffffff;
+}
+.butn-wrap{
+  margin-bottom: 10px;
+}
+</style>

+ 8 - 3
src/views/system/menu/index.vue

@@ -44,9 +44,14 @@
             type="primary"
             size="mini"
             :disable-transitions="true"
-          >
-            {{row.type==1?'菜单':(row.type==2?'按钮':'')}}
-          </el-tag>
+            v-if="row.type==1"
+          > 菜单  </el-tag>
+          <el-tag
+            type="warning"
+            size="mini"
+            :disable-transitions="true"
+            v-if="row.type==2"
+          >  按钮  </el-tag>
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">

+ 17 - 17
src/views/system/user/index.vue

@@ -41,7 +41,7 @@
           </el-button>
         </template>
         <!-- 用户名列 -->
-<!--        <template v-slot:nickname="{ row }">
+        <!--        <template v-slot:nickname="{ row }">
           <router-link :to="'/system/user/details?id=' + row.userId">
             {{ row.nickname }}
           </router-link>
@@ -49,7 +49,7 @@
         <!-- 角色列 -->
         <template v-slot:roleList="{ row }">
           <el-tag
-            v-for="(item,index) in row.roleList"
+            v-for="item in row.roleList"
             :key="item.id"
             size="mini"
             type="primary"
@@ -127,7 +127,7 @@
       UserEdit,
       UserImport
     },
-    data() {
+    data () {
       return {
         // 表格列配置
         columns: [
@@ -202,13 +202,13 @@
     },
     methods: {
       /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return pageUsers({ ...where, ...order, pageNum:page, size:limit });
+      datasource ({ page, limit, where, order }) {
+        return pageUsers({ ...where, ...order, pageNum: page, size: limit });
       },
-      async changeEnable(row) {
-        let params = {...row}
-        params.roleId = row.roleList.map((d) => d.id)
-        delete params.roleList
+      async changeEnable (row) {
+        let params = { ...row };
+        params.roleId = row.roleList.map((d) => d.id);
+        delete params.roleList;
         const res = await putUsers(params);
         if (res.code == 0) {
           this.$message({
@@ -220,20 +220,20 @@
         }
       },
       /* 刷新表格 */
-      reload(where) {
+      reload (where) {
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit(row) {
+      openEdit (row) {
         this.current = row;
         this.showEdit = true;
       },
       /* 打开导入弹窗 */
-      openImport() {
+      openImport () {
         this.showImport = true;
       },
       /* 删除 */
-      remove(row) {
+      remove (row) {
         const loading = this.$loading({ lock: true });
         deleteUsers([row.id])
           .then((msg) => {
@@ -247,7 +247,7 @@
           });
       },
       /* 批量删除 */
-      removeBatch() {
+      removeBatch () {
         if (!this.selection.length) {
           this.$message.error('请至少选择一条数据');
           return;
@@ -257,7 +257,7 @@
         })
           .then(() => {
             const loading = this.$loading({ lock: true });
-            deleteUsers(this.selection.map((d) => d.id ))
+            deleteUsers(this.selection.map((d) => d.id))
               .then((msg) => {
                 loading.close();
                 this.$message.success(msg);
@@ -271,7 +271,7 @@
           .catch(() => {});
       },
       /* 重置用户密码 */
-      resetPsw(row) {
+      resetPsw (row) {
         this.$confirm('确定要重置此用户的密码为"123456"吗?', '提示', {
           type: 'warning'
         })
@@ -290,7 +290,7 @@
           .catch(() => {});
       },
       /* 更改状态 */
-      editStatus(row) {
+      editStatus (row) {
         const loading = this.$loading({ lock: true });
         updateUserStatus(row.userId, row.status)
           .then((msg) => {