Kaynağa Gözat

编码bug修复

LAPTOP-16IUEB3P\Lenovo 3 yıl önce
ebeveyn
işleme
34b779cc50
95 değiştirilmiş dosya ile 5296 ekleme ve 997 silme
  1. 758 12
      package-lock.json
  2. 4 1
      package.json
  3. 37 0
      src/api/classifyManage/itemInformation.js
  4. 161 109
      src/components/FormGenerator/DraggableItem.vue
  5. 11 6
      src/components/FormGenerator/RightPanel.vue
  6. 1 0
      src/components/FormGenerator/styles/home.scss
  7. 3 0
      src/components/Pagination/index.vue
  8. 0 4
      src/components/VueBpmn/index.vue
  9. 1 0
      src/icons/index.js
  10. 0 0
      src/icons/svg/button.svg
  11. 0 0
      src/icons/svg/cascader.svg
  12. 0 0
      src/icons/svg/checkbox.svg
  13. 0 0
      src/icons/svg/color.svg
  14. 0 0
      src/icons/svg/component.svg
  15. 0 0
      src/icons/svg/date-range.svg
  16. 0 0
      src/icons/svg/date.svg
  17. 0 0
      src/icons/svg/input.svg
  18. 0 0
      src/icons/svg/number.svg
  19. 0 0
      src/icons/svg/password.svg
  20. 0 0
      src/icons/svg/radio.svg
  21. 0 0
      src/icons/svg/rate.svg
  22. 0 0
      src/icons/svg/rich-text.svg
  23. 0 0
      src/icons/svg/row.svg
  24. 0 0
      src/icons/svg/select.svg
  25. 0 0
      src/icons/svg/slider.svg
  26. 0 0
      src/icons/svg/switch.svg
  27. 0 0
      src/icons/svg/table.svg
  28. 0 0
      src/icons/svg/textarea.svg
  29. 0 0
      src/icons/svg/time-range.svg
  30. 0 0
      src/icons/svg/time.svg
  31. 0 0
      src/icons/svg/upload.svg
  32. 22 0
      src/icons/svgo.yml
  33. 1 1
      src/layout/components/header-notice.vue
  34. 1 1
      src/layout/components/password-modal.vue
  35. 8 0
      src/main.js
  36. 6 6
      src/views/classifyManage/components/classifyManageEdit.vue
  37. 8 8
      src/views/classifyManage/components/list-edit.vue
  38. 955 0
      src/views/classifyManage/itemInformation/add.vue
  39. 325 0
      src/views/classifyManage/itemInformation/components/AddDialog.vue
  40. 122 0
      src/views/classifyManage/itemInformation/components/ItemDetail.vue
  41. 315 0
      src/views/classifyManage/itemInformation/components/ItemForm.vue
  42. 202 0
      src/views/classifyManage/itemInformation/components/RowDetail.vue
  43. 357 0
      src/views/classifyManage/itemInformation/components/RowForm.vue
  44. 18 19
      src/views/classifyManage/itemInformation/components/item-list.vue
  45. 441 0
      src/views/classifyManage/itemInformation/details.vue
  46. 10 24
      src/views/classifyManage/itemInformation/index.vue
  47. 226 126
      src/views/codeManagement/components/addDialog.vue
  48. 15 18
      src/views/codeManagement/components/code-list.vue
  49. 5 6
      src/views/codeManagement/index.vue
  50. 1 1
      src/views/dashboard/analysis/components/hot-search.vue
  51. 1 1
      src/views/dashboard/analysis/components/sale-card.vue
  52. 1 1
      src/views/dashboard/analysis/components/statistics-card.vue
  53. 1 1
      src/views/dashboard/analysis/components/visit-hour.vue
  54. 1 1
      src/views/dashboard/monitor/components/browser-card.vue
  55. 2 2
      src/views/dashboard/monitor/components/map-card.vue
  56. 1 1
      src/views/example/choose/index.vue
  57. 1 1
      src/views/example/document/components/file-sort.vue
  58. 1 1
      src/views/extension/file/components/file-list.vue
  59. 3 3
      src/views/extension/file/components/file-toolbar.vue
  60. 1 1
      src/views/extension/file/components/folder-add.vue
  61. 1 1
      src/views/extension/file/components/name-edit.vue
  62. 1 1
      src/views/extension/file/index.vue
  63. 264 200
      src/views/flowable/ProcessDefinitionIdentityLink.vue
  64. 42 5
      src/views/flowable/components/ProcessImage.vue
  65. 85 0
      src/views/flowable/form/FormDesign.vue
  66. 47 39
      src/views/flowable/form/FormParser.vue
  67. 68 0
      src/views/flowable/form/edit.vue
  68. 290 0
      src/views/flowable/form/index.vue
  69. 75 58
      src/views/flowable/processDefinition.vue
  70. 10 22
      src/views/flowable/processInstance.vue
  71. 1 1
      src/views/form/advanced/components/user-select.vue
  72. 1 1
      src/views/list/basic/components/edit-form.vue
  73. 1 1
      src/views/list/basic/details/index.vue
  74. 1 1
      src/views/list/basic/edit/index.vue
  75. 7 7
      src/views/login/index.vue
  76. 2 1
      src/views/system/dictionary/components/dict-data-edit.vue
  77. 3 3
      src/views/system/dictionary/components/dict-data.vue
  78. 1 1
      src/views/system/dictionary/components/dict-edit.vue
  79. 1 1
      src/views/system/dictionary/index.vue
  80. 3 3
      src/views/system/file/index.vue
  81. 1 1
      src/views/system/login-record/index.vue
  82. 9 5
      src/views/system/menu/index.vue
  83. 1 1
      src/views/system/operation-record/index.vue
  84. 9 12
      src/views/system/organization/components/org-edit.vue
  85. 72 51
      src/views/system/organization/components/org-user-edit.vue
  86. 35 30
      src/views/system/organization/components/org-user-list.vue
  87. 2 2
      src/views/system/role/components/role-auth.vue
  88. 3 3
      src/views/system/role/components/role-edit.vue
  89. 157 157
      src/views/system/role/index.vue
  90. 1 1
      src/views/system/user/components/role-select.vue
  91. 28 17
      src/views/system/user/components/user-edit.vue
  92. 1 1
      src/views/system/user/components/user-import.vue
  93. 12 12
      src/views/system/user/index.vue
  94. 1 1
      src/views/user/message/index.vue
  95. 33 2
      vue.config.js

Dosya farkı çok büyük olduğundan ihmal edildi
+ 758 - 12
package-lock.json


+ 4 - 1
package.json

@@ -9,7 +9,8 @@
     "build:preview": "vue-cli-service build --mode preview",
     "build:report": "vue-cli-service build --report",
     "lint": "vue-cli-service lint",
-    "clean:lib": "rimraf node_modules"
+    "clean:lib": "rimraf node_modules",
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
   },
   "dependencies": {
     "@amap/amap-jsapi-loader": "^1.0.1",
@@ -62,6 +63,8 @@
     "prettier": "^2.7.1",
     "sass": "^1.54.8",
     "sass-loader": "^13.0.2",
+    "svg-sprite-loader": "^6.0.11",
+    "svgo": "^1.2.2",
     "vue-eslint-parser": "^9.0.3",
     "vue-template-compiler": "^2.7.10",
     "webpack": "^5.74.0"

+ 37 - 0
src/api/classifyManage/itemInformation.js

@@ -0,0 +1,37 @@
+import request from '@/utils/request';
+// 物品信息列表
+export async function getList (data) {
+  const res = await request.post('/main/category/getList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// // 物品信息保存
+// export const informationAdd = (data) => {
+//   return http.asyncCall('/information/add', data, 'post', 'json');
+// };
+
+// // 物品信息编辑
+// export const informationEdit = (data) => {
+//   return http.asyncCall('/information/edit', data, 'post', 'json');
+// };
+
+// // 物品信息详情
+// export const getDetails = (data) => {
+//   return http.asyncCall(`/information/info/${data.id}`, {}, 'get');
+// };
+
+// 物品信息删除
+export async function removeItem (id) {
+  const res = await request.get(`/main/category/remove/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// // 物品信息获取编码
+// export const getOrderNo = (data) => {
+//   return http.asyncCall(`/information/createOrderNo/${data.prefix}`, {}, 'get');
+// };

+ 161 - 109
src/components/FormGenerator/DraggableItem.vue

@@ -1,120 +1,172 @@
 <script>
-import draggable from 'vuedraggable'
-import render from '@/components/FormGenerator/components/render/render'
+  import draggable from 'vuedraggable';
+  import render from '@/components/FormGenerator/components/render/render';
 
-const components = {
-  itemBtns(h, currentItem, index, list) {
-    const { copyItem, deleteItem } = this.$listeners
-    return [
-      <span class="drawing-item-copy" title="复制" onClick={event => {
-        copyItem(currentItem, list); event.stopPropagation()
-      }}>
-        <i class="el-icon-copy-document" />
-      </span>,
-      <span class="drawing-item-delete" title="删除" onClick={event => {
-        deleteItem(index, list); event.stopPropagation()
-      }}>
-        <i class="el-icon-delete" />
-      </span>
-    ]
-  }
-}
-const layouts = {
-  colFormItem(h, currentItem, index, list) {
-    const { activeItem } = this.$listeners
-    const config = currentItem.__config__
-    const child = renderChildren.apply(this, arguments)
-    let className = this.activeId === config.formId ? 'drawing-item active-from-item' : 'drawing-item'
-    if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered'
-    let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
-    if (config.showLabel === false) labelWidth = '0'
-    return (
-      <el-col span={config.span} class={className}
-        nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}>
-        <el-form-item label-width={labelWidth}
-          label={config.showLabel ? config.label : ''} required={config.required}>
-          <render key={config.renderKey} conf={currentItem} onInput={ event => {
-            this.$set(config, 'defaultValue', event)
-          }}>
+  const components = {
+    itemBtns(h, currentItem, index, list) {
+      const { copyItem, deleteItem } = this.$listeners;
+      return [
+        <span
+          class="drawing-item-copy"
+          title="复制"
+          onClick={(event) => {
+            copyItem(currentItem, list);
+            event.stopPropagation();
+          }}
+        >
+          <i class="el-icon-copy-document" />
+        </span>,
+        <span
+          class="drawing-item-delete"
+          title="删除"
+          onClick={(event) => {
+            deleteItem(index, list);
+            event.stopPropagation();
+          }}
+        >
+          <i class="el-icon-delete" />
+        </span>
+      ];
+    }
+  };
+  const layouts = {
+    colFormItem(h, currentItem, index, list) {
+      const { activeItem } = this.$listeners;
+      const config = currentItem.__config__;
+      const child = renderChildren.apply(this, arguments);
+      let className =
+        this.activeId === config.formId
+          ? 'drawing-item active-from-item'
+          : 'drawing-item';
+      if (this.formConf.unFocusedComponentBorder)
+        className += ' unfocus-bordered';
+      let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null;
+      if (config.showLabel === false) labelWidth = '0';
+      return (
+        <el-col
+          span={config.span}
+          class={className}
+          nativeOnClick={(event) => {
+            activeItem(currentItem);
+            event.stopPropagation();
+          }}
+        >
+          <el-form-item
+            label-width={labelWidth}
+            label={config.showLabel ? config.label : ''}
+            required={config.required}
+          >
+            <render
+              key={config.renderKey}
+              conf={currentItem}
+              onInput={(event) => {
+                console.log(event, 8888);
+                this.$set(config, 'defaultValue', event);
+              }}
+            >
+              {child}
+            </render>
+          </el-form-item>
+          {components.itemBtns.apply(this, arguments)}
+        </el-col>
+      );
+    },
+    rowFormItem(h, currentItem, index, list) {
+      const { activeItem } = this.$listeners;
+      const config = currentItem.__config__;
+      const className =
+        this.activeId === config.formId
+          ? 'drawing-row-item active-from-item'
+          : 'drawing-row-item';
+      let child = renderChildren.apply(this, arguments);
+      if (currentItem.type === 'flex') {
+        child = (
+          <el-row
+            type={currentItem.type}
+            justify={currentItem.justify}
+            align={currentItem.align}
+          >
             {child}
-          </render>
-        </el-form-item>
-        {components.itemBtns.apply(this, arguments)}
-      </el-col>
-    )
-  },
-  rowFormItem(h, currentItem, index, list) {
-    const { activeItem } = this.$listeners
-    const config = currentItem.__config__
-    const className = this.activeId === config.formId
-      ? 'drawing-row-item active-from-item'
-      : 'drawing-row-item'
-    let child = renderChildren.apply(this, arguments)
-    if (currentItem.type === 'flex') {
-      child = <el-row type={currentItem.type} justify={currentItem.justify} align={currentItem.align}>
+          </el-row>
+        );
+      }
+      return (
+        <el-col span={config.span}>
+          <el-row
+            gutter={config.gutter}
+            class={className}
+            nativeOnClick={(event) => {
+              activeItem(currentItem);
+              event.stopPropagation();
+            }}
+          >
+            <span class="component-name">{config.componentName}</span>
+            <draggable
+              list={config.children || []}
+              animation={340}
+              group="componentsGroup"
+              class="drag-wrapper"
+            >
               {child}
-            </el-row>
+            </draggable>
+            {components.itemBtns.apply(this, arguments)}
+          </el-row>
+        </el-col>
+      );
+    },
+    raw(h, currentItem, index, list) {
+      const config = currentItem.__config__;
+      const child = renderChildren.apply(this, arguments);
+      return (
+        <render
+          key={config.renderKey}
+          conf={currentItem}
+          onInput={(event) => {
+            this.$set(config, 'defaultValue', event);
+          }}
+        >
+          {child}
+        </render>
+      );
     }
-    return (
-      <el-col span={config.span}>
-        <el-row gutter={config.gutter} class={className}
-          nativeOnClick={event => { activeItem(currentItem); event.stopPropagation() }}>
-          <span class="component-name">{config.componentName}</span>
-          <draggable list={config.children || []} animation={340}
-            group="componentsGroup" class="drag-wrapper">
-            {child}
-          </draggable>
-          {components.itemBtns.apply(this, arguments)}
-        </el-row>
-      </el-col>
-    )
-  },
-  raw(h, currentItem, index, list) {
-    const config = currentItem.__config__
-    const child = renderChildren.apply(this, arguments)
-    return <render key={config.renderKey} conf={currentItem} onInput={ event => {
-      this.$set(config, 'defaultValue', event)
-    }}>
-      {child}
-    </render>
-  }
-}
+  };
 
-function renderChildren(h, currentItem, index, list) {
-  const config = currentItem.__config__
-  if (!Array.isArray(config.children)) return null
-  return config.children.map((el, i) => {
-    const layout = layouts[el.__config__.layout]
-    if (layout) {
-      return layout.call(this, h, el, i, config.children)
-    }
-    return layoutIsNotFound.call(this)
-  })
-}
+  function renderChildren(h, currentItem, index, list) {
+    const config = currentItem.__config__;
+    if (!Array.isArray(config.children)) return null;
+    return config.children.map((el, i) => {
+      const layout = layouts[el.__config__.layout];
+      if (layout) {
+        return layout.call(this, h, el, i, config.children);
+      }
+      return layoutIsNotFound.call(this);
+    });
+  }
 
-function layoutIsNotFound() {
-  throw new Error(`没有与${this.currentItem.__config__.layout}匹配的layout`)
-}
+  function layoutIsNotFound() {
+    throw new Error(`没有与${this.currentItem.__config__.layout}匹配的layout`);
+  }
 
-export default {
-  components: {
-    render,
-    draggable
-  },
-  props: [
-    'currentItem',
-    'index',
-    'drawingList',
-    'activeId',
-    'formConf'
-  ],
-  render(h) {
-    const layout = layouts[this.currentItem.__config__.layout]
+  export default {
+    components: {
+      render,
+      draggable
+    },
+    props: ['currentItem', 'index', 'drawingList', 'activeId', 'formConf'],
+    render(h) {
+      const layout = layouts[this.currentItem.__config__.layout];
+      console.log(layout);
 
-    if (layout) {
-      return layout.call(this, h, this.currentItem, this.index, this.drawingList)
+      if (layout) {
+        return layout.call(
+          this,
+          h,
+          this.currentItem,
+          this.index,
+          this.drawingList
+        );
+      }
+      return layoutIsNotFound.call(this);
     }
-    return layoutIsNotFound.call(this)
-  }
-}
+  };
 </script>

+ 11 - 6
src/components/FormGenerator/RightPanel.vue

@@ -18,7 +18,7 @@
         <el-form
           v-show="currentTab === 'field' && showField"
           size="small"
-          label-width="90px"
+          label-width="80px"
         >
           <el-form-item v-if="activeData.__config__.changeTag" label="组件类型">
             <el-select
@@ -38,10 +38,10 @@
                   :label="item.__config__.label"
                   :value="item.__config__.tagIcon"
                 >
-                  <svg-icon
+                  <!-- <svg-icon
                     class="node-icon"
                     :icon-class="item.__config__.tagIcon"
-                  />
+                  /> -->
                   <span> {{ item.__config__.label }}</span>
                 </el-option>
               </el-option-group>
@@ -555,7 +555,9 @@
               ) > -1
             "
           >
-            <el-divider>选项</el-divider>
+            <div>
+              <el-divider>选项</el-divider>
+            </div>
 
             <el-form-item
               v-if="activeData.__config__.dataType"
@@ -938,12 +940,12 @@
             >
               <span slot-scope="{ node, data }">
                 <span class="node-label">
-                  <svg-icon
+                  <!-- <svg-icon
                     class="node-icon"
                     :icon-class="
                       data.__config__ ? data.__config__.tagIcon : data.tagIcon
                     "
-                  />
+                  /> -->
                   {{ node.label }}
                 </span>
               </span>
@@ -1476,4 +1478,7 @@
   .node-icon {
     color: #bebfc3;
   }
+  .el-divider {
+    margin: 24px 5px;
+  }
 </style>

+ 1 - 0
src/components/FormGenerator/styles/home.scss

@@ -5,6 +5,7 @@ $lighterBlue: #409EFF;
   position: relative;
   width: 100%;
   height: 100%;
+  background-color: #fff;
 }
 
 .components-list {

+ 3 - 0
src/components/Pagination/index.vue

@@ -87,6 +87,9 @@
     background: #fff;
     /*padding: 5px 5px;*/
   }
+  .el-pagination {
+    text-align: left !important;
+  }
 
   .pagination-container.hidden {
     display: none;

+ 0 - 4
src/components/VueBpmn/index.vue

@@ -48,10 +48,6 @@
         </el-aside>
       </el-container>
     </el-main>
-    <el-footer height="30px" style="font-weight: 600">
-      Powered by
-      <a target="_blank" href="https://gitee.com/zjm16/zjmzxfzhl">zjmzxfzhl</a>
-    </el-footer>
 
     <el-dialog :visible.sync="xmlVisible" title="预览" fullscreen center>
       <vue-ace-editor

+ 1 - 0
src/components/FormGenerator/icons/index.js → src/icons/index.js

@@ -5,6 +5,7 @@ import SvgIcon from '@/components/FormGenerator/components/SvgIcon'; // svg comp
 Vue.component('svg-icon', SvgIcon);
 
 const req = require.context('./svg', false, /\.svg$/);
+
 const requireAll = (requireContext) =>
   requireContext.keys().map(requireContext);
 requireAll(req);

+ 0 - 0
src/components/FormGenerator/icons/svg/button.svg → src/icons/svg/button.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/cascader.svg → src/icons/svg/cascader.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/checkbox.svg → src/icons/svg/checkbox.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/color.svg → src/icons/svg/color.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/component.svg → src/icons/svg/component.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/date-range.svg → src/icons/svg/date-range.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/date.svg → src/icons/svg/date.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/input.svg → src/icons/svg/input.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/number.svg → src/icons/svg/number.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/password.svg → src/icons/svg/password.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/radio.svg → src/icons/svg/radio.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/rate.svg → src/icons/svg/rate.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/rich-text.svg → src/icons/svg/rich-text.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/row.svg → src/icons/svg/row.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/select.svg → src/icons/svg/select.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/slider.svg → src/icons/svg/slider.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/switch.svg → src/icons/svg/switch.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/table.svg → src/icons/svg/table.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/textarea.svg → src/icons/svg/textarea.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/time-range.svg → src/icons/svg/time-range.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/time.svg → src/icons/svg/time.svg


+ 0 - 0
src/components/FormGenerator/icons/svg/upload.svg → src/icons/svg/upload.svg


+ 22 - 0
src/icons/svgo.yml

@@ -0,0 +1,22 @@
+# replace default config
+
+# multipass: true
+# full: true
+
+plugins:
+
+  # - name
+  #
+  # or:
+  # - name: false
+  # - name: true
+  #
+  # or:
+  # - name:
+  #     param1: 1
+  #     param2: 2
+
+- removeAttrs:
+    attrs:
+      - 'fill'
+      - 'fill-rule'

+ 1 - 1
src/layout/components/header-notice.vue

@@ -154,7 +154,7 @@
             this.todo = result.todo;
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 清空通知 */

+ 1 - 1
src/layout/components/password-modal.vue

@@ -114,7 +114,7 @@
               })
               .catch((e) => {
                 this.loading = false;
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           } else {
             return false;

+ 8 - 0
src/main.js

@@ -8,7 +8,15 @@ import EleAdmin from 'ele-admin';
 import VueClipboard from 'vue-clipboard2';
 import i18n from './i18n';
 import './styles/index.scss';
+import '@/components/FormGenerator/styles/index.scss';
 import DictSelection from '@/components/Dict/DictSelection';
+// import tinymce from '@/components/FormGenerator/components/tinymce/index.js';
+import TinymceEditor from '@/components/TinymceEditor/index.vue';
+// import SvgIcon from '@/components/FormGenerator/components/SvgIcon'; // svg component
+
+// // register globally
+Vue.component('tinymce', TinymceEditor);
+import '@/icons';
 
 Vue.component('DictSelection', DictSelection);
 Vue.config.productionTip = false;

+ 6 - 6
src/views/classifyManage/components/classifyManageEdit.vue

@@ -82,7 +82,7 @@
 
   export default {
     props: {},
-    data () {
+    data() {
       const defaultForm = {
         name: '',
         code: '',
@@ -128,13 +128,13 @@
       };
     },
     methods: {
-      open (parentData, data) {
+      open(parentData, data) {
         this.parentData = parentData;
         this.data = data;
         this.visible = true;
       },
       /* 保存编辑 */
-      save () {
+      save() {
         this.$refs.formRef.validate((valid) => {
           if (!valid) {
             return false;
@@ -151,17 +151,17 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },
       /* 更新visible */
-      updateVisible (value) {
+      updateVisible(value) {
         this.visible = value;
       }
     },
     watch: {
-      visible (visible) {
+      visible(visible) {
         if (visible) {
           if (this.data) {
             this.$util.assignObject(this.formData, this.data);

+ 8 - 8
src/views/classifyManage/components/list-edit.vue

@@ -118,7 +118,7 @@
       }
     },
     mixins: [dictMixins],
-    data () {
+    data() {
       const defaultForm = {
         name: '',
         code: '',
@@ -178,7 +178,7 @@
       };
     },
     computed: {
-      fullName () {
+      fullName() {
         let str = '';
         let codeStr = '';
         let node = this.curNode;
@@ -194,15 +194,15 @@
         );
       }
     },
-    created () {},
+    created() {},
     methods: {
-      open (data, parentData) {
+      open(data, parentData) {
         this.parentData = parentData;
         this.data = data;
         this.visible = true;
       },
       /* 保存编辑 */
-      save () {
+      save() {
         this.$refs.formRef.validate((valid) => {
           if (!valid) {
             return false;
@@ -228,17 +228,17 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },
       /* 更新visible */
-      updateVisible (value) {
+      updateVisible(value) {
         this.visible = value;
       }
     },
     watch: {
-      visible (visible) {
+      visible(visible) {
         if (visible) {
           if (this.data) {
             this.$util.assignObject(this.formData, this.data);

+ 955 - 0
src/views/classifyManage/itemInformation/add.vue

@@ -0,0 +1,955 @@
+<template>
+  <div class="content-height p20">
+    <div class="page-title">
+      <el-page-header @back="goBack">
+        <div slot="content" class="pageContent">
+          <div>{{ pageTitle }}</div>
+          <el-form class="topform">
+            <el-form-item label="物品类型" label-width="70px">
+              <el-select
+                v-model="defaultNum"
+                placeholder="请选择"
+                @change="chooseItem"
+                :disabled="uneditable"
+              >
+                <el-option
+                  v-for="item in typeList"
+                  :key="item.id"
+                  :label="item.value"
+                  :value="item.prefix"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </div>
+      </el-page-header>
+    </div>
+    <div class="table-container">
+      <div class="tree-col">
+        <ItemForm
+          ref="itemFormRef"
+          :itemForm="itemForm"
+          :defaultNum="defaultNum"
+          :classList="[]"
+        />
+      </div>
+      <div class="attribute-row">
+        <RowForm
+          ref="customFormRef"
+          :itemForm="itemForm"
+          :defaultNum="defaultNum"
+        />
+        <div
+          class="row-table"
+          v-if="
+            defaultNum != 'w08' && defaultNum != 'w02' && defaultNum != 'w03'
+          "
+        >
+          <el-tabs v-model="activeName" type="card">
+            <el-tab-pane
+              label="匹配产品"
+              name="product"
+              v-if="defaultNum == 'w06' || defaultNum == 'w04'"
+            >
+              <el-button type="primary" @click="clickAdd([4], '选择产品')"
+                >添加</el-button
+              >
+              <el-table
+                :data="productData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column
+                  prop="informationName"
+                  label="物品名称"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="classificationUrl"
+                  show-overflow-tooltip
+                  label="分类"
+                >
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      @click="handleDelete(scope.$index, scope.row)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配模具"
+              name="mould"
+              v-if="defaultNum == 'w01' || defaultNum == 'w07'"
+            >
+              <el-button type="primary" @click="clickAdd([6], '选择模具')"
+                >添加</el-button
+              >
+              <el-table
+                :data="mouldData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column
+                  prop="informationCode"
+                  label="物品编码"
+                  width="120"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="informationName"
+                  label="物品名称"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  prop="shrinkageCoefficient"
+                  label="收缩系数"
+                  :formatter="shrinkFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="dieBodyModel"
+                  width="120"
+                  label="大模体型号"
+                  :formatter="modleFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="classificationUrl"
+                  show-overflow-tooltip
+                  label="分类"
+                >
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      @click="handleDelete(scope.$index, scope.row)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配备品备件"
+              name="part"
+              v-if="defaultNum == 'w01'"
+            >
+              <el-button type="primary" @click="clickAdd([7], '选择备品备件')"
+                >添加</el-button
+              >
+              <el-table
+                :data="partData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column
+                  prop="informationName"
+                  label="物品名称"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="classificationUrl"
+                  show-overflow-tooltip
+                  label="分类"
+                >
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      @click="handleDelete(scope.$index, scope.row)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == 'w07'">
+              <div class="bom-top">
+                <el-button type="primary" @click="clickAdd([3], '选择物料')"
+                  >添加</el-button
+                >
+                <div class="top-input">
+                  <span>基本数量</span>
+                  <el-input
+                    class="input-box"
+                    @input="handleEdit"
+                    v-model="itemForm.basicNum"
+                    placeholder="请输入"
+                  ></el-input>
+                  <span>{{ itemForm.measuringUnit }}</span>
+                </div>
+              </div>
+              <el-table
+                :data="bomData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column
+                  prop="informationCode"
+                  label="物品编码"
+                  width="120"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="informationName"
+                  label="物品名称"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="classificationUrl"
+                  label="分类"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="num" label="数量" width="120">
+                  <template slot-scope="scope">
+                    <el-input
+                      type="number"
+                      v-model="scope.row.num"
+                      placeholder="请输入"
+                      oninput="value=value.replace(/[^0-9.]/g,'')"
+                    ></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column label="计量单位" prop="measuringUnit">
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      @click="handleDelete(scope.$index, scope.row)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配设备"
+              name="facility"
+              v-if="defaultNum == 'w04' || defaultNum == 'w05'"
+            >
+              <el-button type="primary" @click="clickAdd([1], '选择设备')"
+                >添加</el-button
+              >
+              <el-table
+                :data="facilityData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column
+                  prop="informationName"
+                  label="物品名称"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column
+                  prop="classificationUrl"
+                  label="分类"
+                  show-overflow-tooltip
+                >
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      @click="handleDelete(scope.$index, scope.row)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+          </el-tabs>
+        </div>
+        <div class="page-footer-btn mt20">
+          <el-button @click="goBack">取消</el-button>
+          <el-button type="primary" @click="submit">确定</el-button>
+        </div>
+      </div>
+    </div>
+
+    <!-- 选择添加 -->
+    <AddDialog
+      ref="addDialogRef"
+      @submit="selectedEquipment"
+      :typeValue="typeValue"
+      :dialogTitle="dialogTitle"
+      :mapList="mapList"
+    />
+  </div>
+</template>
+
+<script>
+  import ItemForm from './components/ItemForm';
+  import RowForm from './components/RowForm';
+  import AddDialog from './components/AddDialog.vue';
+  import {
+    informationAdd,
+    getDetails,
+    informationEdit,
+    getOrderNo
+  } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: { ItemForm, RowForm, AddDialog },
+    data() {
+      return {
+        pageTitle: '',
+        typeList: [
+          {
+            id: 1,
+            value: 'w01  生产设备',
+            name: '生产设备',
+            prefix: 'w01',
+            code: 1
+          },
+          { id: 2, value: 'w02  舟皿', name: '舟皿', prefix: 'w02', code: 2 },
+          {
+            id: 3,
+            value: 'w03  周转车',
+            name: '周转车',
+            prefix: 'w03',
+            code: 5
+          },
+          { id: 4, value: 'w04  模具', name: '模具', prefix: 'w04', code: 6 },
+          {
+            id: 5,
+            value: 'w05  备品备件',
+            name: '备品备件',
+            prefix: 'w05',
+            code: 7
+          },
+          { id: 6, value: 'w06  原料', name: '物料', prefix: 'w06', code: 3 },
+          { id: 7, value: 'w07  产品', name: '产品', prefix: 'w07', code: 4 },
+          { id: 8, value: 'w08  耗材', name: '耗材', prefix: 'w08', code: 8 }
+        ],
+        itemForm: {
+          classificationUrlId: [],
+          addList: [],
+          info: {
+            angle: 'notA'
+          },
+          urlIdList: [],
+          univalenceUnit: 'yuan',
+          expirationDateUnit: 'minute',
+          takeStockPattern: 1
+        },
+        activeName: 'mould',
+        productData: [],
+        mouldData: [],
+        partData: [],
+        bomData: [],
+        facilityData: [],
+        bomNumber: null,
+        defaultNum: 'w01',
+        selectNode: null,
+        classList: [],
+        changeData: [],
+        urlIdList: [],
+        requestData: {},
+        typeValue: [],
+        mapList: [],
+        uneditable: false,
+        currentItem: null,
+        dialogTitle: '',
+        newCode: ''
+      };
+    },
+    created() {
+      this.pageTitle = this.$route.query.pageTitle;
+      if (this.pageTitle == '新建物品') {
+        this.selectNode = JSON.parse(this.$route.query.selectNode);
+        console.log('selectNode', this.selectNode);
+        if (this.selectNode) {
+          this.itemForm.classificationId = this.selectNode.id;
+          let code = 1;
+          if (this.selectNode.id != '0') {
+            code = this.selectNode.type;
+            this.typeList.map((item) => {
+              if (item.code == code) {
+                this.currentItem = item;
+                this.defaultNum = item.prefix;
+                this.setDefault(this.defaultNum);
+              }
+            });
+          } else {
+            this.currentItem = {
+              id: 1,
+              value: 'w01  生产设备',
+              prefix: 'w01',
+              code: 1
+            };
+          }
+          this.getTreeData(code);
+        }
+      } else {
+        this.getDetilInfo(this.$route.query.id);
+      }
+      if (this.pageTitle == '编辑物品') {
+        this.uneditable = true;
+      } else {
+        this.uneditable = false;
+        this.getOrderCode();
+      }
+    },
+    methods: {
+      async getOrderCode() {
+        const res = await getOrderNo({ prefix: this.defaultNum });
+        if (res.success) {
+          this.newCode = res.data;
+          this.$set(this.itemForm, 'itemCode', res.data.substring(3));
+          // console.log('itemCode',res.data)
+        }
+      },
+
+      getCode(code) {
+        this.typeList.map((item) => {
+          if (item.code == code) {
+            this.defaultNum = item.prefix;
+            this.setDefault(this.defaultNum);
+          }
+        });
+      },
+
+      // 在 Input 值改变时触发
+      handleEdit(e) {
+        let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
+        value = value.replace(/(\d{15})\d*/, '$1'); // 最多保留15位整数
+      },
+      goBack() {
+        this.$router.go(-1);
+      },
+
+      // 获取详情
+      async getDetilInfo(id) {
+        const res = await getDetails({ id: id });
+        if (res.success) {
+          this.defaultNum = res.data.classificationCode;
+          this.chooseItem(res.data.classificationCode);
+          this.itemForm = res.data;
+          if (res.data.univalence) {
+            this.$set(this.itemForm, 'univalence', res.data.univalence);
+          } else {
+            this.$set(this.itemForm, 'univalence', 'null');
+          }
+          if (res.data.expirationDate) {
+            this.$set(this.itemForm, 'expirationDate', res.data.expirationDate);
+          } else {
+            this.$set(this.itemForm, 'expirationDate', 'null');
+          }
+          this.$set(this.itemForm, 'info', JSON.parse(res.data.extendField));
+          this.$set(this.itemForm, 'informationName', res.data.informationName);
+          this.$set(
+            this.itemForm,
+            'addList',
+            JSON.parse(res.data.selfDefinedParameter)
+          );
+          this.itemForm.urlIdList = JSON.parse(res.data.classificationUrlId);
+          if (this.pageTitle == '编辑物品') {
+            // this.itemForm.itemCode = res.data.informationCode.substring(3)
+            this.$set(
+              this.itemForm,
+              'itemCode',
+              res.data.informationCode.substring(3)
+            );
+          } else {
+            this.$set(this.itemForm, 'isCitation', false);
+            this.$set(this.itemForm, 'itemCode', this.newCode.substring(3));
+          }
+          this.itemForm.isTransferAssets = res.data.isTransferAssets
+            ? 'true'
+            : 'false';
+          this.itemForm.isUnpack = res.data.isUnpack ? 'true' : 'false';
+          for (const key in this.itemForm.informationRelationMap) {
+            this.matchList(key, this.itemForm.informationRelationMap);
+          }
+        }
+      },
+
+      // 改变物品类型
+      chooseItem(val) {
+        if (this.currentItem && this.currentItem.prefix != val) {
+          this.initItemForm();
+          this.$refs.itemFormRef.$refs.formName.resetFields();
+          this.getOrderCode();
+        }
+        this.typeList.map((item) => {
+          if (item.prefix == val) {
+            this.currentItem = item;
+            this.defaultNum = item.prefix;
+            this.itemForm.classificationCode = this.defaultNum;
+            this.selectNode = null;
+            this.getTreeData(item.code);
+          }
+        });
+        this.setDefault(this.defaultNum);
+      },
+
+      submit() {
+        const a1 = new Promise((resolve, reject) => {
+          this.$refs.itemFormRef.validateForm((valid) => {
+            if (valid) resolve();
+          });
+        });
+        const a2 = new Promise((resolve, reject) => {
+          this.$refs.customFormRef.validateForm((valid) => {
+            if (valid) resolve();
+          });
+        });
+        Promise.all([a1, a2]).then(() => {
+          this.mapAddList();
+          this.requestData = this.itemForm;
+          const { pathName, pathId } = this.$refs.itemFormRef.getText();
+          this.requestData.classificationUrl = pathName;
+          this.requestData.classificationId = pathId;
+          this.requestData.isTransferAssets =
+            this.requestData.isTransferAssets == 'true' ? true : false;
+          this.requestData.isUnpack =
+            this.requestData.isUnpack == 'true' ? true : false;
+          this.requestData.selfDefinedParameter = JSON.stringify(
+            this.requestData.addList
+          );
+          this.requestData.extendField = JSON.stringify(this.requestData.info);
+          this.requestData.informationCode =
+            this.defaultNum + this.requestData.itemCode;
+          this.requestData.classificationCode = this.defaultNum;
+          this.requestData.classificationUrlId = JSON.stringify(
+            this.requestData.urlIdList
+          );
+          this.requestData.expirationDate = this.itemForm.expirationDate
+            ? this.itemForm.expirationDate
+            : null;
+          this.requestData.univalence = this.itemForm.univalence
+            ? this.itemForm.univalence
+            : null;
+          this.mapList.map((item) => {
+            item.informationId = item.id;
+            delete item.id;
+          });
+          this.requestData.informationRelation = this.mapList;
+          if (this.pageTitle == '编辑物品') {
+            this.requestData.mainInformationId = this.$route.query.id;
+            delete this.requestData.informationRelationMap;
+            this.$confirm(
+              '参数信息有变更,与当前已存在的台账信息参数不一致,确定后将同步已存在的台账信息参数 !',
+              '重要提示!',
+              {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning',
+                center: true
+              }
+            )
+              .then(() => {
+                informationEdit(this.requestData).then((res) => {
+                  if (res.success) {
+                    this.$message.success('物品编辑成功');
+                    this.$router.push({
+                      path: '/warehouseManagement/itemInformation'
+                    });
+                  }
+                });
+              })
+              .catch(() => {});
+          } else {
+            informationAdd(this.requestData).then((res) => {
+              if (res.success) {
+                this.$message.success('物品新增成功');
+                this.$router.push({
+                  path: '/warehouseManagement/itemInformation'
+                });
+              }
+            });
+          }
+        });
+      },
+
+      handleDelete(index, row) {
+        this.$confirm(`确认删除[${row.informationName}]吗?`)
+          .then(async () => {
+            switch (this.activeName) {
+              case 'product': {
+                this.productData.splice(index, 1);
+                break;
+              }
+              case 'mould': {
+                this.mouldData.splice(index, 1);
+                break;
+              }
+              case 'part': {
+                this.partData.splice(index, 1);
+                break;
+              }
+              case 'bom': {
+                this.bomData.splice(index, 1);
+                break;
+              }
+              case 'facility': {
+                this.facilityData.splice(index, 1);
+                break;
+              }
+              default:
+                break;
+            }
+            this.mapAddList();
+          })
+          .catch(() => {});
+      },
+
+      //点击添加打开弹窗
+      clickAdd(val, name) {
+        this.$refs.addDialogRef.equipmentdialog = true;
+        if (val) {
+          this.typeValue = val;
+          this.dialogTitle = name;
+          this.mapAddList();
+        }
+      },
+
+      // 选择的设备
+      selectedEquipment(val) {
+        switch (this.activeName) {
+          case 'product': {
+            this.productData = val;
+            break;
+          }
+          case 'mould': {
+            this.mouldData = val;
+            break;
+          }
+          case 'part': {
+            this.partData = val;
+            break;
+          }
+          case 'bom': {
+            this.bomData = val;
+            break;
+          }
+          case 'facility': {
+            this.facilityData = val;
+            break;
+          }
+          default:
+            break;
+        }
+      },
+
+      async getTreeData(code) {
+        // try {
+        //   const res = await common.getClassify({
+        //     type: code,
+        //     id: '0'
+        //   });
+        //   if (res.success) {
+        //     this.classList = res.data;
+        //     if (this.selectNode) {
+        //       this.$nextTick(() => {
+        //         this.convertTreeData(res.data);
+        //         if (!this.selectNode.hasOwnProperty('children')) {
+        //           this.urlIdList = [];
+        //           this.urlIdList.push(this.selectNode.id);
+        //           let parentId = this.selectNode.parentId;
+        //           this.deepEach(parentId);
+        //           this.itemForm.urlIdList = this.urlIdList.reverse();
+        //         }
+        //       });
+        //     }
+        //   }
+        // } catch (error) {}
+      },
+
+      convertTreeData(data) {
+        this.changeData = data;
+        for (let i = 0; i < this.changeData.length; i++) {
+          if (this.changeData[i].children != undefined) {
+            const temp = this.changeData[i].children;
+            delete this.changeData[i].children;
+            this.changeData = this.changeData.concat(temp);
+          }
+        }
+      },
+
+      // 子节点处理
+      deepEach(parentId) {
+        this.changeData.map((item, index) => {
+          if (item.id == parentId) {
+            this.urlIdList.push(item.id);
+            this.deepEach(item.parentId); // 递归
+          }
+        });
+      },
+
+      setDefault(val) {
+        switch (val) {
+          case 'w06': {
+            this.activeName = 'product';
+            break;
+          }
+          case 'w01': {
+            this.activeName = 'mould';
+            break;
+          }
+          case 'w07': {
+            this.activeName = 'mould';
+            break;
+          }
+          case 'w04': {
+            this.activeName = 'product';
+            break;
+          }
+          case 'w05': {
+            this.activeName = 'facility';
+            break;
+          }
+          default:
+            break;
+        }
+      },
+
+      // 物品类型格式化
+      classificationCodeFormatter(row) {
+        let itemName = '';
+        this.typeList.map((item) => {
+          if (item.prefix == row.classificationCode) {
+            itemName = item.name;
+          }
+        });
+        return itemName;
+      },
+
+      // 收缩系数格式化
+      shrinkFormatter(row) {
+        let shrink = '';
+        let extendField = JSON.parse(row.extendField);
+        if (extendField.hasOwnProperty('shrinkageCoefficient')) {
+          shrink = extendField.shrinkageCoefficient;
+        }
+        return shrink;
+      },
+
+      modleFormatter(row) {
+        let modle = '';
+        let extendField = JSON.parse(row.extendField);
+        if (extendField.hasOwnProperty('dieBodyModel')) {
+          modle = extendField.dieBodyModel;
+        }
+        return modle;
+      },
+
+      mapAddList() {
+        this.mapList = [];
+        if (this.defaultNum == 'w01') {
+          this.mapList = this.partData.concat(this.mouldData);
+        } else if (this.defaultNum == 'w04') {
+          this.mapList = this.facilityData.concat(this.productData);
+        } else if (this.defaultNum == 'w05') {
+          this.mapList = this.facilityData;
+        } else if (this.defaultNum == 'w06') {
+          this.mapList = this.productData;
+        } else if (this.defaultNum == 'w07') {
+          this.mapList = this.mouldData.concat(this.bomData);
+        }
+      },
+
+      matchList(key, data) {
+        switch (key) {
+          case 'w01': {
+            this.facilityData = data[key];
+            break;
+          }
+          case 'w04': {
+            this.mouldData = data[key];
+            break;
+          }
+          case 'w05': {
+            this.partData = data[key];
+            break;
+          }
+          case 'w07': {
+            this.productData = data[key];
+            break;
+          }
+          case 'w06': {
+            this.bomData = data[key];
+            break;
+          }
+          default:
+            break;
+        }
+      },
+
+      initItemForm() {
+        this.itemForm = {
+          classificationUrlId: [],
+          addList: [],
+          info: { angle: 'notA' },
+          urlIdList: [],
+          univalenceUnit: 'yuan',
+          expirationDateUnit: 'minute',
+          takeStockPattern: 1
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.page-title) {
+    border-bottom: 1px solid #eaeefb;
+    padding-bottom: 8px;
+    margin-bottom: 16px;
+    display: flex;
+    align-items: center;
+    .el-page-header__left {
+      display: flex;
+      align-items: center;
+    }
+    .pageContent {
+      display: flex;
+      align-items: center;
+      font-size: 18px;
+      color: #303133;
+      .topform {
+        margin: 5px 0 0 30px;
+      }
+    }
+  }
+  .table-container {
+    flex: 1;
+    display: flex;
+    overflow: hidden;
+    .tree-col {
+      margin-right: 10px;
+      width: 30%;
+      min-width: 250px;
+      overflow: auto;
+      padding: 20px 20px 20px 0px;
+      background-color: #fff;
+      margin-top: 10px;
+      border: 1px solid #e6ebf5;
+      border-radius: 4px;
+      box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+    }
+  }
+
+  :deep(.attribute-row) {
+    padding: 20px 5px;
+    background: #fff;
+    margin-top: 10px;
+    overflow: auto;
+    width: 70%;
+    border: 1px solid #e6ebf5;
+    border-radius: 4px;
+    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+    position: relative;
+    .row-table {
+      width: 100%;
+      margin: 20px auto 80px;
+      .table-box {
+        width: 100%;
+        margin: 10px auto;
+        // max-height:400px;
+        // overflow-y: auto;
+      }
+      .bom-top {
+        width: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: flex-start;
+        .top-input {
+          margin-left: 20px;
+          display: flex;
+          align-items: center;
+          justify-content: flex-start;
+          .input-box {
+            width: 150px;
+            margin: 0 10px;
+          }
+        }
+      }
+    }
+    .page-footer-btn {
+      background: #fff;
+      z-index: 1;
+      position: absolute;
+      bottom: 20px;
+      right: 0px;
+      text-align: right;
+      width: 100%;
+      border-top: 1px solid #e6ebf5;
+      padding: 20px 20px 0 0;
+    }
+  }
+</style>

+ 325 - 0
src/views/classifyManage/itemInformation/components/AddDialog.vue

@@ -0,0 +1,325 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="65%"
+  >
+    <div>
+      <el-row>
+        <el-col :span="24" class="topsearch">
+          <el-form>
+            <el-row>
+              <el-col :span="6">
+                <el-input
+                  v-model="searchForm.searchKey"
+                  placeholder="输入物品编码或名称"
+                  size="small"
+                ></el-input>
+              </el-col>
+              <el-col :span="6" style="margin-left: 10px">
+                <el-button type="primary" size="small" @click="searchByKeyWords"
+                  >搜索</el-button
+                >
+                <el-button size="small" @click="reset">重置</el-button>
+              </el-col>
+            </el-row>
+          </el-form>
+        </el-col>
+        <el-col :span="6" class="tree_col">
+          <!-- <vTreeList
+            @handleNodeClick="handleNodeClick"
+            ref="commonTree"
+            :defaultExpandAll="false"
+            :defaultExpandedKeys="defaultExpandedKeys"
+            :type="typeValue"
+          /> -->
+          <AssetTree
+            :data="treeList"
+            :props="defaultProps"
+            :default-expanded-keys="defaultExpandedKeys"
+            :expand-on-click-node="false"
+            v-loading="treeLoading"
+            node-key="id"
+            ref="tree"
+            :highlight-current="true"
+            @node-click="handleNodeClick"
+          />
+        </el-col>
+        <el-col :span="18" class="table_col">
+          <el-table
+            :data="tableData"
+            height="450"
+            highlight-current-row
+            @selection-change="handleSelectionChange"
+            :row-key="getRowKeys"
+            ref="tableRef"
+          >
+            <el-table-column
+              type="selection"
+              width="60"
+              align="center"
+              :reserve-selection="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="informationCode"
+              width="130"
+            ></el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="informationName"
+            ></el-table-column>
+            <el-table-column
+              label="牌号"
+              prop="brandNum"
+              v-if="dialogTitle != '选择设备' && dialogTitle != '选择备品备件'"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              prop="modelType"
+              v-if="dialogTitle != '选择物料'"
+            ></el-table-column>
+            <el-table-column
+              label="收缩系数"
+              prop="shrinkageCoefficient"
+              v-if="dialogTitle == '选择模具'"
+            >
+              <template slot-scope="scope">
+                <span>
+                  {{ JSON.parse(scope.row.extendField).shrinkageCoefficient }}
+                </span>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="大模体型号"
+              prop="dieBodyModel"
+              v-if="dialogTitle == '选择模具'"
+              width="120"
+            >
+              <template slot-scope="scope">
+                <span>
+                  {{ JSON.parse(scope.row.extendField).dieBodyModel }}
+                </span>
+              </template>
+            </el-table-column>
+          </el-table>
+          <div class="pagination">
+            <el-pagination
+              background
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="pagination.total"
+              :page-sizes="[15, 30, 50, 100, 500]"
+              :page-size="pagination.size"
+              :current-page.sync="pagination.page"
+              @current-change="handleCurrent"
+              @size-change="handleSize"
+            >
+            </el-pagination>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import { getList } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: { AssetTree },
+    props: {
+      typeValue: {
+        type: Array,
+        default: []
+      },
+      mapList: {
+        type: Array,
+        default: []
+      },
+      dialogTitle: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        treeLoading: false,
+        equipmentdialog: false,
+        defaultExpandedKeys: [],
+        tableData: [],
+        currentTreeData: {},
+        pagination: {
+          page: 1,
+          size: 10,
+          total: 0
+        },
+        searchForm: {},
+        defaultProps: {
+          children: 'children',
+          value: 'code',
+          label: 'name'
+        },
+        currentKey: null,
+        tableSelectionList: []
+      };
+    },
+    watch: {
+      equipmentdialog(val) {
+        if (val) {
+          if (this.tableData.length) this.$refs.tableRef.clearSelection();
+          this.$nextTick(() => {
+            this.mapList.forEach((item) => {
+              const row = this.tableData.find((i) => i.id === item.id);
+              if (row) {
+                this.$refs.tableRef.toggleRowSelection(row, true);
+              }
+            });
+          });
+          // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
+        }
+      },
+      typeValue(val) {
+        if (val) {
+          this.currentKey = null;
+        }
+      },
+      mapList(val) {
+        if (val) {
+          // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
+          // this.$nextTick(() => {
+          //     this.mapList.forEach(item => {
+          //       const row = this.tableData.find(i => i.id === item.id)
+          //       console.log('row',row)
+          //       if (row) {
+          //         this.$refs.tableRef.toggleRowSelection(row, true)
+          //       }
+          //     })
+          // })
+        }
+      }
+    },
+    methods: {
+      handleClose() {
+        this.equipmentdialog = false;
+        this.tableSelectionList = [];
+      },
+
+      handleCurrent(page) {
+        this.pagination.page = page;
+        this.handleList();
+      },
+      handleSize(size) {
+        this.pagination.page = 1;
+        this.pagination.size = size;
+        this.handleList();
+      },
+
+      handleSelectionChange(val) {
+        this.tableSelectionList = val;
+      },
+      // handleCurSelectionChange (selection, row) {
+
+      // },
+
+      toDelete(val) {
+        console.log('触发删除', val);
+      },
+
+      getRowKeys(row) {
+        return row.id;
+      },
+
+      // 确定
+      selected() {
+        this.$emit('submit', this.tableSelectionList);
+        this.handleClose();
+      },
+
+      // 树点击事件
+      handleNodeClick(data, node) {
+        if (data.id === this.currentTreeData.id) return;
+        this.currentTreeData = data;
+        this.searchForm.classificationId = data.id;
+        this.handleList();
+      },
+
+      async handleList() {
+        const params = {
+          ...this.searchForm,
+          ...this.pagination
+        };
+        const res = await getList(params);
+        if (res?.success) {
+          this.tableData = res.data.records;
+          this.pagination.total = res.data.total;
+          if (this.tableData.length) this.$refs.tableRef.clearSelection();
+          this.$nextTick(() => {
+            this.mapList.forEach((item) => {
+              const row = this.tableData.find((i) => i.id === item.id);
+              if (row) {
+                this.$refs.tableRef.toggleRowSelection(row, true);
+              }
+            });
+          });
+        }
+      },
+
+      // 弹窗 - 按关键字搜索
+      searchByKeyWords() {
+        if (!this.currentTreeData) {
+          this.$message.warning('请先选择设备!');
+          return;
+        }
+        this.pagination.page = 1;
+        this.handleList();
+      },
+      // 重置
+      reset() {
+        this.pagination.page = 1;
+        this.searchForm.searchKey = '';
+        this.handleList();
+      },
+
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      }
+    }
+  };
+</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;
+    :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;
+  }
+</style>

+ 122 - 0
src/views/classifyManage/itemInformation/components/ItemDetail.vue

@@ -0,0 +1,122 @@
+<template>
+  <el-form label-width="90px" class="formBox">
+    <el-form-item label="分类">
+      <span>{{ customForm.classificationUrl }}</span>
+    </el-form-item>
+    <el-form-item label="物品编码">
+      <span>{{ customForm.informationCode }}</span>
+    </el-form-item>
+    <el-form-item label="物品名称">
+      <span>{{ customForm.informationName }}</span>
+    </el-form-item>
+    <el-form-item label="计量单位">
+      <span>{{ customForm.measuringUnit }}</span>
+    </el-form-item>
+    <el-form-item label="包装单位">
+      <span>{{ customForm.packingUnit }}</span>
+    </el-form-item>
+    <el-form-item label="参考单价">
+      <span
+        >{{ customForm.univalence }} {{ univalenceUnit }}/{{
+          customForm.measuringUnit
+        }}</span
+      >
+    </el-form-item>
+    <el-form-item label="保质期">
+      <span>{{ customForm.expirationDate }} {{ expirationDateUnit }}</span>
+    </el-form-item>
+    <el-form-item label="安全库存">
+      <span>{{ customForm.safeStock }}</span>
+    </el-form-item>
+    <el-form-item label="盘点模式" prop="itemMode">
+      <span>{{ inventoryMode[customForm.takeStockPattern] }}</span>
+    </el-form-item>
+    <!-- <el-form-item label="允许转资产" prop="isTransferAssets">
+             <span>{{customForm.isTransferAssets?'允许':'不允许'}}</span>
+         </el-form-item> -->
+    <el-form-item label="允许拆包" prop="isUnpack">
+      <span>{{ customForm.isUnpack ? '允许' : '不允许' }}</span>
+    </el-form-item>
+    <el-form-item label="描述" prop="itemRemark">
+      <span>{{ customForm.description }}</span>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    props: {
+      customForm: {
+        type: Object,
+        default: {}
+      }
+    },
+    components: {},
+    data() {
+      return {
+        inventoryMode: ['逐个盘点', '批量盘点', '混合模式'],
+        priceList: [
+          { id: 0, value: '元', name: 'yuan' },
+          { id: 1, value: '万元', name: 'wanyuan' }
+        ],
+        dateList: [
+          { id: 0, value: '分钟', name: 'minute' },
+          { id: 1, value: '小时', name: 'hour' },
+          { id: 2, value: '天', name: 'day' },
+          { id: 3, value: '月', name: 'month' },
+          { id: 4, value: '年', name: 'year' }
+        ],
+        univalenceUnit: '',
+        expirationDateUnit: ''
+      };
+    },
+    watch: {
+      customForm(val) {
+        if (val) {
+          this.priceList.map((item) => {
+            if (item.name == val.univalenceUnit) {
+              this.univalenceUnit = item.value;
+            }
+          });
+          this.dateList.map((item) => {
+            if (item.name == val.expirationDateUnit) {
+              this.expirationDateUnit = item.value;
+            }
+          });
+        }
+      }
+    },
+    created() {},
+    methods: {}
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.formBox .el-form-item) {
+    margin-bottom: 17px;
+    .twobox {
+      width: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+    }
+    .w60.el-input--medium {
+      width: 60%;
+      margin-right: 5px;
+    }
+    .el-input--small .el-input__inner {
+      height: 36px;
+      line-height: 36px;
+    }
+    .el-select.el-select--medium {
+      width: 100%;
+    }
+    .w40.el-select.el-select--medium {
+      width: 40%;
+    }
+    .el-radio {
+      display: block;
+      margin-top: 10px;
+    }
+  }
+</style>

+ 315 - 0
src/views/classifyManage/itemInformation/components/ItemForm.vue

@@ -0,0 +1,315 @@
+<template>
+  <el-form
+    :model="itemForm"
+    :rules="rules"
+    ref="formName"
+    label-width="90px"
+    class="formBox"
+  >
+    <el-form-item label="分类" prop="urlIdList" label-width="60px">
+      <!-- <el-tooltip class="item" effect="dark" content="Top Left 提示文字" placement="top-start"> -->
+      <el-cascader
+        :key="keyValue"
+        v-model="itemForm.urlIdList"
+        :options="classList"
+        :props="defaultProps"
+        separator="-"
+        filterable
+        @change="chooseClassify"
+        ref="cascader"
+      >
+      </el-cascader>
+      <!-- </el-tooltip> -->
+    </el-form-item>
+    <el-form-item label="物品编码" prop="itemCode">
+      <el-input
+        placeholder="请输入"
+        v-model="itemForm.itemCode"
+        maxlength="9"
+        :disabled="itemForm.isCitation"
+      >
+        <template slot="prepend">{{ defaultNum }}</template>
+      </el-input>
+    </el-form-item>
+    <el-form-item label="物品名称" prop="informationName">
+      <el-input
+        placeholder="请输入"
+        v-model="itemForm.informationName"
+      ></el-input>
+    </el-form-item>
+    <el-form-item label="计量单位" prop="measuringUnit">
+      <el-input
+        placeholder="请输入"
+        v-model="itemForm.measuringUnit"
+      ></el-input>
+    </el-form-item>
+    <el-form-item label="包装单位" prop="packingUnit">
+      <el-input placeholder="请输入" v-model="itemForm.packingUnit"></el-input>
+    </el-form-item>
+    <!-- oninput="value=value.replace(/[^0-9.]/g,'')" -->
+    <el-form-item label="参考单价" prop="univalence">
+      <div class="twobox">
+        <el-input-number
+          placeholder="请输入"
+          v-model="itemForm.univalence"
+          :min="0"
+          style="width: 80%; margin-right: 10px"
+        ></el-input-number>
+        <el-select
+          v-model="itemForm.univalenceUnit"
+          placeholder="请选择"
+          class="w40"
+        >
+          <el-option
+            v-for="item in priceList"
+            :key="item.id"
+            :label="item.value"
+            :value="item.name"
+          >
+          </el-option>
+        </el-select>
+      </div>
+    </el-form-item>
+    <el-form-item label="保质期" prop="expirationDate">
+      <div class="twobox">
+        <el-input-number
+          placeholder="请输入"
+          type="number"
+          v-model="itemForm.expirationDate"
+          :min="0"
+          style="width: 80%; margin-right: 10px"
+        ></el-input-number>
+        <el-select
+          v-model="itemForm.expirationDateUnit"
+          placeholder="请选择"
+          class="w40"
+        >
+          <el-option
+            v-for="item in dateList"
+            :key="item.id"
+            :label="item.value"
+            :value="item.name"
+          >
+          </el-option>
+        </el-select>
+      </div>
+    </el-form-item>
+    <el-form-item label="安全库存" prop="safeStock">
+      <el-input placeholder="请输入" v-model="itemForm.safeStock"></el-input>
+    </el-form-item>
+    <el-form-item label="盘点模式" prop="takeStockPattern">
+      <el-radio-group v-model="itemForm.takeStockPattern">
+        <el-radio :label="0">逐个盘点</el-radio>
+        <el-radio :label="1">批量盘点</el-radio>
+        <!-- <el-radio :label="2">混合模式</el-radio> -->
+      </el-radio-group>
+    </el-form-item>
+    <!--         <el-form-item label="允许转资产" prop="isTransferAssets">
+             <el-switch v-model="itemForm.isTransferAssets"
+                active-value="true"
+                inactive-value="false"
+             > </el-switch>
+         </el-form-item> -->
+    <el-form-item label="允许拆包" prop="isUnpack">
+      <el-switch
+        v-model="itemForm.isUnpack"
+        active-value="true"
+        inactive-value="false"
+        :disabled="itemForm.isCitation"
+      >
+      </el-switch>
+    </el-form-item>
+    <el-form-item label="描述" prop="description">
+      <el-input
+        type="textarea"
+        rows="3"
+        resize="none"
+        placeholder="请输入"
+        v-model="itemForm.description"
+      ></el-input>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    props: {
+      itemForm: {
+        type: Object,
+        default: {}
+      },
+      defaultNum: {
+        type: String,
+        default: 'w01'
+      },
+      classList: {
+        type: Array,
+        default: []
+      }
+    },
+    components: {},
+    data() {
+      let validateCode = (rule, value, callback) => {
+        let reg = /[\u4e00-\u9fa5]/;
+        // console.log('reg.test(value)',reg.test(value))
+        if (reg.test(value)) {
+          callback(new Error('仅支持英文、数字及特殊字符'));
+        } else {
+          callback();
+        }
+      };
+      return {
+        rules: {
+          urlIdList: [
+            {
+              type: 'array',
+              required: true,
+              message: '请选择分类',
+              trigger: 'change'
+            }
+          ],
+          itemCode: [
+            { required: true, message: '请输入物品编码', trigger: 'blur' },
+            { validator: validateCode, trigger: 'blur' }
+          ],
+          informationName: [
+            { required: true, message: '请输入物品名称', trigger: 'blur' }
+          ],
+          measuringUnit: [
+            { required: true, message: '请输入计量单位', trigger: 'blur' }
+          ],
+          packingUnit: [
+            { required: true, message: '请输入包装单位', trigger: 'blur' }
+          ],
+          takeStockPattern: [
+            { required: true, message: '请选择一个盘点模式', trigger: 'change' }
+          ]
+        },
+        priceList: [
+          { id: 0, value: '元', name: 'yuan' },
+          { id: 1, value: '万元', name: 'wanyuan' }
+        ],
+        dateList: [
+          { id: 0, value: '分钟', name: 'minute' },
+          { id: 1, value: '小时', name: 'hour' },
+          { id: 2, value: '天', name: 'day' },
+          { id: 3, value: '月', name: 'month' },
+          { id: 4, value: '年', name: 'year' }
+        ],
+        typeList: [
+          { id: 1, value: 'w01  原料', prefix: 'w01' },
+          { id: 2, value: 'w02  耗材', prefix: 'w02' },
+          { id: 3, value: 'w03  设备', prefix: 'w03' },
+          { id: 4, value: 'w04  产品', prefix: 'w04' },
+          { id: 5, value: 'w05  舟皿', prefix: 'w05' },
+          { id: 6, value: 'w06  周转车', prefix: 'w06' },
+          { id: 7, value: 'w07  模具', prefix: 'w07' },
+          { id: 8, value: 'w08  备品备件', prefix: 'w08' }
+        ],
+        // itemForm:{
+        //   priceType:1, dateType:1
+        // },
+        defaultProps: {
+          children: 'children',
+          value: 'id',
+          label: 'name'
+        },
+        keyValue: 0
+      };
+    },
+    watch: {
+      defaultNum(val) {
+        if (val) {
+        }
+      },
+
+      itemForm(val) {},
+
+      classList(val) {
+        this.keyValue++;
+      }
+    },
+    created() {},
+    methods: {
+      // // 在 Input 值改变时触发
+      handleEdit(e) {
+        // let value = e.replace(/^(0+)|[^\d]+/g,''); // 以0开头或者输入非数字,会被替换成空
+        // value = value.replace(/(\d{15})\d*/, '$1') // 最多保留15位整数
+        // this.itemForm.expirationDate = value
+      },
+
+      //子组件接收callback为父组件传过来的next()方法
+      validateForm(callback) {
+        // let flag = true;
+        //开始表单校验
+        this.$refs.formName.validate((valid) => {
+          callback(valid);
+          // if (valid) {
+          //   this.itemForm.informationCode = this.defaultNum + this.itemForm.informationCode
+          //   console.log('itemForm',this.itemForm)
+          //   flag = true
+          // } else {
+          //   console.log('error submit!!');
+          //   return false;
+          // }
+        });
+        // 如果flag为true,则执行callback()
+        // if (flag) {
+        // callback();
+        // }
+      },
+
+      // 选择分类
+      chooseClassify(val) {},
+
+      getText() {
+        // 获取节点下的汉字
+        let pathName = this.$refs.cascader
+          .getCheckedNodes()[0]
+          .pathLabels.toString();
+        let pathId = this.$refs.cascader.getCheckedNodes()[0].path;
+        pathId = pathId[pathId.length - 1];
+        //用for循环遍历获取的数据,并把逗号替换
+        for (let i = 0; i < pathName.length; i++) {
+          if (pathName[i] === ',') {
+            pathName = pathName.replace(pathName[i], '-');
+          }
+        }
+        return { pathName, pathId };
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.formBox .el-form-item) {
+    margin-bottom: 17px;
+    .twobox {
+      width: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+    }
+    .el-form-item__content .el-cascader {
+      width: 100%;
+    }
+    .w60.el-input--medium {
+      width: 60%;
+      margin-right: 5px;
+    }
+    .el-input--small .el-input__inner {
+      height: 36px;
+      line-height: 36px;
+    }
+    .el-select.el-select--medium {
+      width: 100%;
+    }
+    .w40.el-select.el-select--medium {
+      width: 40%;
+    }
+    .el-radio {
+      display: block;
+      margin-top: 10px;
+    }
+  }
+</style>

+ 202 - 0
src/views/classifyManage/itemInformation/components/RowDetail.vue

@@ -0,0 +1,202 @@
+<template>
+  <el-form :model="customForm" ref="formCustom" class="row-form">
+    <el-row>
+      <el-col
+        :span="8"
+        v-if="defaultNum == 'w06' || defaultNum == 'w07' || defaultNum == 'w04'"
+      >
+        <el-form-item label="牌号" prop="brandNumber" label-width="60px">
+          <span>{{ customForm.brandNum }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col
+        :span="8"
+        v-if="
+          defaultNum == 'w08' ||
+          defaultNum == 'w01' ||
+          defaultNum == 'w02' ||
+          defaultNum == 'w03' ||
+          defaultNum == 'w05'
+        "
+      >
+        <el-form-item label="规格" prop="gg" label-width="60px">
+          <span>{{ customForm.specification }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum != 'w06'">
+        <el-form-item label="型号" prop="xh" label-width="60px">
+          <span>{{ customForm.modelType }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w03'">
+        <el-form-item label="材质" prop="xh" label-width="60px">
+          <span>{{ extendField.texture }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w01'">
+        <el-form-item label="标准产能" prop="bzcn" label-width="85px">
+          <span
+            >{{
+              extendField.standardCapacity ? extendField.standardCapacity : '-'
+            }}/小时</span
+          >
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w07'">
+        <el-form-item label="标准单重" prop="bzcn" label-width="85px">
+          <span
+            >{{
+              extendField.pieceWeight ? extendField.pieceWeight : '-'
+            }}KG</span
+          >
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w07'">
+        <el-form-item label="不良品率" prop="bzcn" label-width="85px">
+          <span
+            >{{
+              extendField.unqualifiedRate ? extendField.unqualifiedRate : '-'
+            }}%</span
+          >
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02'">
+        <el-form-item label="角度" prop="bzcn" label-width="60px">
+          <span>{{ extendField.angle }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="长" prop="bzcn" label-width="60px">
+          <span>{{ extendField.length ? extendField.length : '-' }}mm</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="宽" prop="bzcn" label-width="60px">
+          <span>{{ extendField.width ? extendField.width : '-' }}mm</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="高" prop="bzcn" label-width="60px">
+          <span>{{ extendField.high ? extendField.high : '-' }}mm</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="大模体型号" prop="bzcn" label-width="95px">
+          <span>{{ extendField.dieBodyModel }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="收缩系数" prop="bzcn" label-width="85px">
+          <span>{{ extendField.shrinkageCoefficient }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="芯杆数量" prop="bzcn" label-width="85px">
+          <span>{{ extendField.mandrelNum }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="模孔数量" prop="bzcn" label-width="85px">
+          <span>{{ extendField.dieHoleNum }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="上冲头数量" prop="bzcn" label-width="95px">
+          <span>{{ extendField.upperPunchNum }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="下冲头数量" prop="bzcn" label-width="95px">
+          <span>{{ extendField.lowerPunchNum }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="最大冲压次数" prop="bzcn" label-width="105px">
+          <span>{{ extendField.maximumStampingTimes }}</span>
+        </el-form-item>
+      </el-col>
+      <el-col
+        :span="8"
+        v-for="(item, index) in selfDefinedParameter"
+        :key="index"
+      >
+        <el-form-item>
+          <div class="add-col">
+            <span class="col-input">{{ item.key }}</span>
+            <span class="col-input">{{ item.value }}</span>
+          </div>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    props: {
+      customForm: {
+        type: Object,
+        default: {}
+      },
+      defaultNum: {
+        type: String,
+        default: 'w01'
+      }
+    },
+    components: {},
+    data() {
+      return {
+        angleList: [
+          { id: 0, value: '非A' },
+          { id: 1, value: 'A' }
+        ],
+        extendField: {},
+        selfDefinedParameter: []
+      };
+    },
+    watch: {
+      customForm(val) {
+        if (val) {
+          this.extendField = JSON.parse(val.extendField);
+          this.selfDefinedParameter = JSON.parse(val.selfDefinedParameter);
+        }
+      }
+    },
+    created() {},
+    methods: {}
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.row-form) {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+    border-bottom: 1px dashed #ccc;
+    .el-row {
+      width: 100%;
+    }
+    .el-form-item {
+      margin-bottom: 15px;
+    }
+    .row-col {
+      display: flex;
+      align-items: center;
+      justify-content: flex-start;
+      .el-input--medium {
+        width: 80%;
+        margin-right: 10px;
+      }
+    }
+    .add-col {
+      display: flex;
+      align-items: center;
+      margin-left: 20px;
+      .col-input {
+        margin-right: 5px;
+      }
+    }
+  }
+</style>

+ 357 - 0
src/views/classifyManage/itemInformation/components/RowForm.vue

@@ -0,0 +1,357 @@
+<template>
+  <el-form
+    :model="itemForm"
+    :rules="customRule"
+    ref="formCustom"
+    class="row-form"
+  >
+    <el-row>
+      <el-col
+        :span="8"
+        v-if="defaultNum == 'w06' || defaultNum == 'w07' || defaultNum == 'w04'"
+      >
+        <el-form-item
+          label="牌号"
+          label-width="60px"
+          :prop="defaultNum == 'w06' ? 'brandNum' : ''"
+        >
+          <el-input v-model="itemForm.brandNum" placeholder="请输入"></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col
+        :span="8"
+        v-if="
+          defaultNum == 'w08' ||
+          defaultNum == 'w01' ||
+          defaultNum == 'w02' ||
+          defaultNum == 'w03' ||
+          defaultNum == 'w05'
+        "
+      >
+        <el-form-item label="规格" prop="specification" label-width="60px">
+          <el-input
+            v-model="itemForm.specification"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum != 'w06'">
+        <el-form-item label="型号" prop="modelType" label-width="60px">
+          <el-input
+            v-model="itemForm.modelType"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w03'">
+        <el-form-item label="材质" prop="texture" label-width="60px">
+          <el-input
+            :disabled="itemForm.isCitation"
+            v-model="itemForm.info.texture"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w01'">
+        <el-form-item label="标准产能" label-width="85px">
+          <div class="row-col">
+            <el-input
+              type="number"
+              v-model="itemForm.info.standardCapacity"
+              placeholder="请输入"
+            ></el-input>
+            <span>/小时</span>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w07'">
+        <el-form-item label="标准单重" label-width="85px">
+          <el-input-number
+            style="width: 80%"
+            type="number"
+            v-model="itemForm.info.pieceWeight"
+            :min="0"
+            placeholder="请输入"
+          ></el-input-number>
+          <span class="spanbox">KG</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w07'">
+        <el-form-item label="不良品率" label-width="85px">
+          <el-input-number
+            style="width: 85%"
+            type="number"
+            v-model="itemForm.info.unqualifiedRate"
+            :min="0"
+            :max="100"
+            placeholder="请输入"
+          ></el-input-number>
+          <span class="spanbox">%</span>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02'">
+        <el-form-item label="角度" label-width="60px">
+          <el-select v-model="itemForm.info.angle" placeholder="请选择">
+            <el-option
+              v-for="item in angleList"
+              :key="item.id"
+              :label="item.value"
+              :value="item.name"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="长" label-width="60px">
+          <div>
+            <el-input-number
+              style="width: 80%; margin-right: 10px"
+              type="number"
+              v-model="itemForm.info.length"
+              :min="0"
+              placeholder="请输入"
+            ></el-input-number>
+            <span>mm</span>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="宽" label-width="60px">
+          <div>
+            <el-input-number
+              style="width: 80%; margin-right: 10px"
+              type="number"
+              v-model="itemForm.info.width"
+              :min="0"
+              placeholder="请输入"
+            ></el-input-number>
+            <span>mm</span>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+        <el-form-item label="高" label-width="60px">
+          <div>
+            <el-input-number
+              style="width: 80%; margin-right: 10px"
+              type="number"
+              v-model="itemForm.info.high"
+              :min="0"
+              placeholder="请输入"
+            ></el-input-number>
+            <span>mm</span>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="大模体型号" label-width="95px">
+          <el-input
+            v-model="itemForm.info.dieBodyModel"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="收缩系数" label-width="85px">
+          <el-input
+            v-model="itemForm.info.shrinkageCoefficient"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="芯杆数量" label-width="85px">
+          <el-input
+            v-model="itemForm.info.mandrelNum"
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            type="number"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="模孔数量" label-width="85px">
+          <el-input
+            v-model="itemForm.info.dieHoleNum"
+            type="number"
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="上冲头数量" label-width="95px">
+          <el-input
+            v-model="itemForm.info.upperPunchNum"
+            type="number"
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="下冲头数量" label-width="95px">
+          <el-input
+            v-model="itemForm.info.lowerPunchNum"
+            type="number"
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="defaultNum == 'w04'">
+        <el-form-item label="最大冲压次数" label-width="105px">
+          <el-input
+            v-model="itemForm.info.maximumStampingTimes"
+            type="number"
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-for="(item, index) in itemForm.addList" :key="index">
+        <el-form-item
+          :prop="'addList.' + index + '.key'"
+          :rules="{
+            required: true,
+            message: '自定义参数名称不能为空',
+            trigger: 'blur'
+          }"
+        >
+          <div class="add-col">
+            <el-input
+              class="col-input"
+              v-model="item.key"
+              placeholder="参数名称"
+            ></el-input>
+            <el-input
+              class="col-input"
+              v-model="item.value"
+              placeholder="参数值"
+            ></el-input>
+            <el-button type="text" @click="delt(item, index)"> 删除 </el-button>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8" v-if="itemForm.addList.length < 10">
+        <el-form-item label-width="20px">
+          <el-button type="primary" @click="addItem">增加自定义参数</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    props: {
+      itemForm: {
+        type: Object,
+        default: {}
+      },
+      defaultNum: {
+        type: String,
+        default: 'w01'
+      }
+    },
+    components: {},
+    data() {
+      return {
+        // customForm:{
+        //   addList:[]
+        // },
+        customRule: {
+          brandNum: [{ required: true, message: '请输入牌号', trigger: 'blur' }]
+        },
+        angleList: [
+          { id: 0, value: '非A', name: 'notA' },
+          { id: 1, value: 'A', name: 'A' }
+        ]
+      };
+    },
+    watch: {
+      itemForm(val) {
+        if (val) {
+        }
+      }
+    },
+    created() {},
+    methods: {
+      // 在 Input 值改变时触发
+      handleEdit(e) {
+        let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
+      },
+      // 添加自定义参数
+      addItem() {
+        if (this.itemForm.addList.length < 10) {
+          let item = { key: '', value: '' };
+          this.itemForm.addList.push(item);
+        } else {
+          this.$message.warning('自定义参数最多添加10条');
+        }
+      },
+
+      // 删除自定义参数
+      delt(item, index) {
+        this.itemForm.addList.splice(index, 1);
+      },
+
+      //子组件接收callback为父组件传过来的next()方法
+      validateForm(callback) {
+        // let flag = true;
+        //开始表单校验
+        this.$refs.formCustom.validate((valid) => {
+          callback(valid);
+          // if (valid) {
+          //   flag = true
+          // } else {
+          //   return false;
+          // }
+        });
+        // 如果flag为true,则执行callback()
+        // if (flag) {
+        // callback();
+        // }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.row-form) {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+    border-bottom: 1px dashed #ccc;
+    .el-row {
+      width: 100%;
+    }
+    .el-form-item {
+      margin-bottom: 15px;
+    }
+    .row-col {
+      display: flex;
+      align-items: center;
+      justify-content: flex-start;
+      .el-input--medium {
+        width: 75%;
+        margin-right: 10px;
+      }
+    }
+    .spanbox {
+      display: inline-block;
+      margin-left: 10px;
+    }
+    .add-col {
+      display: flex;
+      align-items: center;
+      margin-left: 20px;
+      .col-input {
+        margin-right: 5px;
+      }
+    }
+  }
+</style>

+ 18 - 19
src/views/classifyManage/itemInformation/components/item-list.vue

@@ -35,7 +35,7 @@
         </el-link>
         <el-popconfirm
           class="ele-action"
-          title="确定要删除此用户吗?"
+          title="确定要删除此物品?"
           @confirm="remove(row)"
         >
           <template v-slot:reference>
@@ -51,12 +51,12 @@
 
 <script>
   import ItemSearch from './item-search.vue';
-  import {
-    getUserPage,
-    removePersonnel,
-    unbindLoginName
-  } from '@/api/system/organization';
-  import { handlers } from 'mdast-util-to-hast/lib/handlers';
+  // import {
+  //   getUserPage,
+  //   removePersonnel,
+  //   unbindLoginName
+  // } from '@/api/system/organization';
+  import { getList, removeItem } from '@/api/classifyManage/itemInformation';
 
   export default {
     components: { ItemSearch },
@@ -140,8 +140,12 @@
     },
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
-        return Promise.resolve([]);
+      datasource ({ page, limit, where }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
       },
       /* 刷新表格 */
       reload (where) {
@@ -167,16 +171,11 @@
       /* 删除 */
       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);
-          });
+        removeItem(row.id).then((msg) => {
+          loading.close();
+          this.$message.success(msg);
+          this.reload();
+        });
       },
       /* 更改状态 */
       editStatus (row) {

+ 441 - 0
src/views/classifyManage/itemInformation/details.vue

@@ -0,0 +1,441 @@
+<template>
+  <div class="content-height p20">
+    <div class="page-title">
+      <el-page-header @back="goBack">
+        <div slot="content" class="pageContent">
+          <div>物品详情 </div>
+          <el-form class="topform">
+            <el-form-item label="物品类型" label-width="70px">
+              <span>{{ itemValue }}</span>
+            </el-form-item>
+          </el-form>
+        </div>
+      </el-page-header>
+    </div>
+    <div class="table-container">
+      <div class="tree-col">
+        <ItemDetail ref="itemDetailRef" :customForm="customForm" />
+      </div>
+      <div class="attribute-row">
+        <RowDetail
+          ref="rowDetailRef"
+          :customForm="customForm"
+          :defaultNum="defaultNum"
+        />
+        <div
+          class="row-table"
+          v-if="
+            defaultNum != 'w08' && defaultNum != 'w02' && defaultNum != 'w03'
+          "
+        >
+          <el-tabs v-model="activeName" type="card">
+            <el-tab-pane
+              label="匹配产品"
+              name="product"
+              v-if="defaultNum == 'w06' || defaultNum == 'w04'"
+            >
+              <el-table
+                :data="productData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column prop="informationName" label="物品名称">
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column prop="classificationUrl" label="分类">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配模具"
+              name="mould"
+              v-if="defaultNum == 'w01' || defaultNum == 'w07'"
+            >
+              <el-table
+                :data="mouldData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column prop="informationName" label="物品名称">
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column prop="classificationUrl" label="分类">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配备品备件"
+              name="part"
+              v-if="defaultNum == 'w01'"
+            >
+              <el-table
+                :data="partData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column prop="informationName" label="物品名称">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column prop="classificationUrl" label="分类">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == 'w07'">
+              <div class="bom-top">
+                <div class="top-input">
+                  <span>基本数量</span>
+                  <div class="input-box">{{ customForm.basicNum }}</div>
+                  <span>{{ customForm.measuringUnit }}</span>
+                </div>
+              </div>
+              <el-table
+                :data="bomData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column prop="informationName" label="物品名称">
+                </el-table-column>
+                <el-table-column prop="brandNum" label="牌号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column prop="classificationUrl" label="分类">
+                </el-table-column>
+                <el-table-column prop="num" label="数量"> </el-table-column>
+                <el-table-column prop="date" label="计量单位">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <el-tab-pane
+              label="匹配设备"
+              name="facility"
+              v-if="defaultNum == 'w04' || defaultNum == 'w05'"
+            >
+              <el-table
+                :data="facilityData"
+                class="table-box"
+                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+              >
+                <el-table-column type="index" label="序号" width="50">
+                </el-table-column>
+                <el-table-column prop="informationCode" label="物品编码">
+                </el-table-column>
+                <el-table-column prop="informationName" label="物品名称">
+                </el-table-column>
+                <el-table-column prop="modelType" label="型号">
+                </el-table-column>
+                <el-table-column
+                  label="物品类型"
+                  prop="classificationCode"
+                  :formatter="classificationCodeFormatter"
+                >
+                </el-table-column>
+                <el-table-column prop="classificationUrl" label="分类">
+                </el-table-column>
+              </el-table>
+            </el-tab-pane>
+            <!--                   <div class="pagination">
+                     <el-pagination
+                       background
+                       layout="total, sizes, prev, pager, next, jumper"
+                       :total="pagination.total"
+                       :page-sizes="[5, 10, 20, 50, 100]"
+                       :page-size="pagination.size"
+                       :current-page.sync="pagination.page"
+                       @current-change="handleCurrent"
+                       @size-change="handleSize"
+                     >
+                     </el-pagination>
+                   </div> -->
+          </el-tabs>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import ItemDetail from './components/ItemDetail';
+  import RowDetail from './components/RowDetail';
+  import { getDetails } from '@/api/classifyManage/itemInformation';
+  export default {
+    components: { ItemDetail, RowDetail },
+    data() {
+      return {
+        pageTitle: '',
+        typeList: [
+          { id: 1, value: 'w01  生产设备', prefix: 'w01', code: 1 },
+          { id: 2, value: 'w02  舟皿', prefix: 'w02', code: 2 },
+          { id: 3, value: 'w03  周转车', prefix: 'w03', code: 5 },
+          { id: 4, value: 'w04  模具', prefix: 'w04', code: 6 },
+          { id: 5, value: 'w05  备品备件', prefix: 'w05', code: 7 },
+          { id: 6, value: 'w06  物料', prefix: 'w06', code: 3 },
+          { id: 7, value: 'w07  产品', prefix: 'w07', code: 4 },
+          { id: 8, value: 'w08  耗材', prefix: 'w08', code: 8 }
+        ],
+        defaultNum: 'w01',
+        // itemForm:{
+        //   priceType:0, dateType:0,
+        // },
+        customForm: {
+          addList: []
+        },
+        activeName: 'product',
+        productData: [],
+        mouldData: [],
+        partData: [],
+        bomData: [],
+        facilityData: [],
+        pagination: {
+          page: 1,
+          size: 10,
+          total: 0
+        },
+        itemValue: ''
+      };
+    },
+    created() {
+      this.getDetilInfo(this.$route.query.id);
+    },
+    methods: {
+      async getDetilInfo(id) {
+        const res = await getDetails({ id: id });
+        if (res.success) {
+          this.customForm = res.data;
+          this.defaultNum = res.data.classificationCode;
+          this.formatterValue(res.data.classificationCode);
+          this.setDefault(res.data.classificationCode);
+          for (const key in this.customForm.informationRelationMap) {
+            this.matchList(key, this.customForm.informationRelationMap);
+          }
+        }
+      },
+
+      formatterValue(code) {
+        this.typeList.map((item) => {
+          if (item.prefix == code) {
+            this.itemValue = item.value;
+          }
+        });
+      },
+
+      goBack() {
+        this.$router.go(-1);
+      },
+      // 显示默认选中的tab
+      setDefault(val) {
+        switch (val) {
+          case 'w06': {
+            this.activeName = 'product';
+            break;
+          }
+          case 'w01': {
+            this.activeName = 'mould';
+            break;
+          }
+          case 'w07': {
+            this.activeName = 'mould';
+            break;
+          }
+          case 'w04': {
+            this.activeName = 'product';
+            break;
+          }
+          case 'w05': {
+            this.activeName = 'facility';
+            break;
+          }
+          default:
+            break;
+        }
+      },
+
+      matchList(key, data) {
+        switch (key) {
+          case 'w01': {
+            this.facilityData = data[key];
+            break;
+          }
+          case 'w04': {
+            this.mouldData = data[key];
+            break;
+          }
+          case 'w05': {
+            this.partData = data[key];
+            break;
+          }
+          case 'w07': {
+            this.productData = data[key];
+            break;
+          }
+          case 'w06': {
+            this.bomData = data[key];
+            break;
+          }
+          default:
+            break;
+        }
+      },
+
+      handleDelete(index, row) {},
+
+      //点击添加打开弹窗
+      clickAdd() {
+        this.$refs.addDialogRef.equipmentdialog = true;
+      },
+
+      handleCurrent(page) {
+        this.pagination.page = page;
+        // this._getList(this.params)
+      },
+      handleSize(size) {
+        this.pagination.page = 1;
+        this.pagination.size = size;
+        // this._getList(this.params)
+      },
+
+      // 物品类型格式化
+      classificationCodeFormatter(row) {
+        let itemName = '';
+        this.typeList.map((item) => {
+          if (item.prefix == row.classificationCode) {
+            itemName = item.value;
+          }
+        });
+        return itemName;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.page-title) {
+    border-bottom: 1px solid #eaeefb;
+    padding-bottom: 8px;
+    margin-bottom: 16px;
+    display: flex;
+    align-items: center;
+    .el-page-header__left {
+      display: flex;
+      align-items: center;
+    }
+    .pageContent {
+      display: flex;
+      align-items: center;
+      font-size: 18px;
+      color: #303133;
+      .topform {
+        margin: 5px 0 0 30px;
+      }
+    }
+  }
+  .table-container {
+    flex: 1;
+    display: flex;
+    overflow: hidden;
+    .tree-col {
+      margin-right: 10px;
+      width: 25%;
+      min-width: 250px;
+      overflow: auto;
+      padding: 20px 20px 20px 10px;
+      background-color: #fff;
+      margin-top: 10px;
+      border: 1px solid #e6ebf5;
+      border-radius: 4px;
+      box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+    }
+  }
+
+  :deep(.attribute-row) {
+    padding: 20px 5px;
+    background: #fff;
+    margin-top: 10px;
+    overflow: auto;
+    flex: 1;
+    border: 1px solid #e6ebf5;
+    border-radius: 4px;
+    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+    position: relative;
+    .row-table {
+      width: 100%;
+      margin: 20px auto 0;
+      .table-box {
+        width: 100%;
+        margin: 10px auto;
+        min-height: 400px;
+      }
+      .bom-top {
+        width: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: flex-start;
+        .top-input {
+          margin-left: 20px;
+          display: flex;
+          align-items: center;
+          justify-content: flex-start;
+          .input-box {
+            width: 150px;
+            margin: 0 10px;
+            display: inline-box;
+          }
+        }
+      }
+    }
+    .page-footer-btn {
+      background: #fff;
+      z-index: 1;
+      position: fixed;
+      bottom: 40px;
+      right: 80px;
+      text-align: right;
+      width: 50%;
+    }
+  }
+</style>

+ 10 - 24
src/views/classifyManage/itemInformation/index.vue

@@ -23,16 +23,6 @@
           </ele-toolbar>
           <div class="ele-border-lighter sys-organization-list">
             <asset-tree @handleNodeClick="onNodeClick" />
-            <!-- <el-tree
-              ref="tree"
-              :data="treeData"
-              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>
@@ -45,7 +35,6 @@
 
 <script>
   import itemList from './components/item-list';
-  import { getTreeByPid } from '@/api/classifyManage';
   import AssetTree from '@/components/AssetTree';
 
   export default {
@@ -56,23 +45,20 @@
         current: {}
       };
     },
-    created () {
-      this.getTree();
-    },
+    created () {},
     methods: {
       onNodeClick (data, node) {
         this.current = node;
       },
-      openEdit () {},
-      async getTree () {
-        const res = await getTreeByPid(0);
-
-        if (res.code == '0') {
-          this.treeData = res.data;
-          return;
-        }
-
-        return Promise.reject();
+      openEdit () {
+        // const selectList = this.$refs.commonTree.getSelectList()
+        this.$router.push({
+          path: '/classifyManage/itemInformation/add',
+          query: {
+            pageTitle: '新建物品'
+            // selectNode: JSON.stringify(selectList)
+          }
+        });
       }
     }
   };

+ 226 - 126
src/views/codeManagement/components/addDialog.vue

@@ -8,7 +8,12 @@
     width="1000px"
   >
     <div class="main_container">
-      <el-form :model="addForm" :rules="addFormRules" ref="addForm" label-width="120px">
+      <el-form
+        :model="addForm"
+        :rules="addFormRules"
+        ref="addForm"
+        label-width="120px"
+      >
         <el-card
           shadow="never"
           header="基本信息"
@@ -17,7 +22,11 @@
           <div class="form-wrap">
             <el-row>
               <el-col :span="12">
-                <el-form-item label="编码" prop="code" style="margin-bottom: 22px;">
+                <el-form-item
+                  label="编码"
+                  prop="code"
+                  style="margin-bottom: 22px"
+                >
                   <el-input
                     v-model="addForm.code"
                     type="text"
@@ -26,7 +35,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="名称" prop="name" style="margin-bottom: 22px;">
+                <el-form-item
+                  label="名称"
+                  prop="name"
+                  style="margin-bottom: 22px"
+                >
                   <el-input
                     v-model="addForm.name"
                     type="text"
@@ -35,7 +48,11 @@
                 </el-form-item>
               </el-col>
               <el-col :span="24">
-                <el-form-item label="描述" prop="remark" style="margin-bottom: 22px;">
+                <el-form-item
+                  label="描述"
+                  prop="remark"
+                  style="margin-bottom: 22px"
+                >
                   <el-input
                     v-model="addForm.remark"
                     placeholder="请输入"
@@ -52,7 +69,10 @@
           header="编码配置"
           body-style="padding: 22px 22px 0 22px;"
         >
-            <myTable ref="myTable" :codeConfigurationList="codeConfigurationList"></myTable>
+          <myTable
+            ref="myTable"
+            :codeConfigurationList="codeConfigurationList"
+          ></myTable>
         </el-card>
       </el-form>
     </div>
@@ -64,140 +84,220 @@
 </template>
 
 <script>
-import { saveNew , getCodeDetail , checkCode } from '@/api/codeManagement/index';
-import myTable from './myTable.vue'
-export default {
-  components:{
-    myTable
-  },
-  data() {
-    return {
-      addRoleDialog: false,
-      dialogTitle:'新建编码规则',
-      addForm: {
-        name: '',
-        code: '',
-        remark: ''
-      },
-      addFormRules: {
-        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-        code: [
-          {
-            required: true,
-            trigger: 'blur',
-            validator: (_rule, value, callback) => {
-              if (!value) {
-                return callback(new Error('请输入编码'));
-              }
-              checkCode(this.addForm.code)
-                .then(res => {
-                  if(res!=true&&res!=this.addForm.id){
-                    callback(new Error('编号已经存在'));
-                  }else{
+  import {
+    saveNew,
+    getCodeDetail,
+    checkCode
+  } from '@/api/codeManagement/index';
+  import myTable from './myTable.vue';
+  export default {
+    components: {
+      myTable
+    },
+    data() {
+      return {
+        addRoleDialog: false,
+        dialogTitle: '新建编码规则',
+        addForm: {
+          name: '',
+          code: '',
+          remark: ''
+        },
+        addFormRules: {
+          name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+          code: [
+            {
+              required: true,
+              trigger: 'blur',
+              validator: (_rule, value, callback) => {
+                if (!value) {
+                  return callback(new Error('请输入编码'));
+                }
+                checkCode(this.addForm.code)
+                  .then((res) => {
+                    if (res != true && res != this.addForm.id) {
+                      callback(new Error('编号已经存在'));
+                    } else {
+                      callback();
+                    }
+                  })
+                  .catch(() => {
                     callback();
-                  }
-                })
-                .catch(() => {
-                  callback();
-                });
+                  });
+              }
             }
-          }
-        ],
-      },
-      codeConfigurationList:[],
-      openType:'add',
-    };
-  },
-  created() {
-    // this.getrecipientDep()
-  },
-  methods: {
-    open(type,row) {
-      if(type == 'add'){
-        this.dialogTitle = '新建编码规则'
-        this.codeConfigurationList = []
-      }else if(type == 'edit'){
-        this.dialogTitle = '编辑编码规则'
-        getCodeDetail(row.id).then(res=>{
-          this.addForm = {...res}
-          if(this.addForm.codeConfigurationList) delete this.addForm.codeConfigurationList
-          this.codeConfigurationList = res.codeConfigurationList
-        })
-      }
-      this.addRoleDialog = true;
-      this.openType = type
-    },
-    handleClose() {
-      this.restForm();
-      this.addRoleDialog = false;
-    },
-    restForm() {
-      this.$refs.myTable.handleReset();  //清空表格校验
-      this.$refs.addForm.resetFields();
-      this.addForm = {
-        name: '',
-        code: '',
-        remark: ''
+          ]
+        },
+        codeConfigurationList: [],
+        openType: 'add'
       };
     },
-    submitAdd() {
+    created() {
+      // this.getrecipientDep()
+    },
+    methods: {
+      open(type, row) {
+        if (type == 'add') {
+          this.dialogTitle = '新建编码规则';
+          this.codeConfigurationList = [];
+        } else if (type == 'edit') {
+          this.dialogTitle = '编辑编码规则';
+          getCodeDetail(row.id).then((res) => {
+            this.addForm = { ...res };
+            if (this.addForm.codeConfigurationList)
+              delete this.addForm.codeConfigurationList;
+            this.codeConfigurationList = res.codeConfigurationList;
+          });
+        }
+        this.addRoleDialog = true;
+        this.openType = type;
+      },
+      data() {
+        return {
+          addRoleDialog: false,
+          dialogTitle: '新建编码规则',
+          addForm: {
+            name: '',
+            code: '',
+            remark: ''
+          },
+          addFormRules: {
+            name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+            code: [{ required: true, message: '请输入编码', trigger: 'blur' }]
+          },
+          codeConfigurationList: [],
+          openType: 'add'
+        };
+      },
+      submitAdd() {
+        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(() => {
+          const codeConfigurationList = this.$refs.myTable.getTableValue();
+          if (!codeConfigurationList.length) {
+            this.$message.error('至少有1项配置内容');
+            return;
+          }
+          // codeConfigurationList.map(item=>{
+          //    item.type = item.type.code
+          // })
+          let par = {
+            code: this.addForm.code,
+            name: this.addForm.name,
+            remark: this.addForm.remark,
+            codeConfigurationList: codeConfigurationList,
+            codeManageTreeId: 1
+          };
+          if (this.openType == 'edit') {
+            par.id = this.addForm.id;
+          }
+          saveNew(par)
+            .then((res) => {
+              console.log('res', res);
+              this.loading = false;
+              this.addRoleDialog = false;
+              this.$message.success(res);
+              this.$emit('done');
+              this.restForm();
+            })
+            .catch((e) => {
+              this.loading = false;
+              this.$message.error(e.message);
+            });
+        });
+      },
+      methods: {
+        open(type, row) {
+          if (type == 'add') {
+            this.dialogTitle = '新建编码规则';
+            this.codeConfigurationList = [];
+          } else if (type == 'edit') {
+            this.dialogTitle = '编辑编码规则';
+            getCodeDetail(row.id).then((res) => {
+              this.addForm = { ...res };
+              if (this.addForm.codeConfigurationList)
+                delete this.addForm.codeConfigurationList;
+              this.codeConfigurationList = res.codeConfigurationList;
+            });
+          }
+          this.addRoleDialog = true;
+          this.openType = type;
+        },
+        handleClose() {
+          this.restForm();
+          this.addRoleDialog = false;
+        },
+        restForm() {
+          this.$refs.myTable.handleReset(); //清空表格校验
+          this.$refs.addForm.resetFields();
+          this.addForm = {
+            name: '',
+            code: '',
+            remark: ''
+          };
+        },
+        submitAdd() {
           const a1 = new Promise((resolve, reject) => {
             this.$refs.addForm.validate((valid) => {
-              if (valid) resolve()
-            })
-          })
+              if (valid) resolve();
+            });
+          });
           const a2 = new Promise((resolve, reject) => {
             this.$refs.myTable.validateForm((valid) => {
-              if (valid) resolve()
-            })
-          })
+              if (valid) resolve();
+            });
+          });
           Promise.all([a1, a2]).then(() => {
-              const codeConfigurationList  = this.$refs.myTable.getTableValue()
-              if(!codeConfigurationList.length){
-                 this.$message.error('至少有1项配置内容');
-                 return
-              }
-              // codeConfigurationList.map(item=>{
-              //    item.type = item.type.code
-              // })
-              let par = {
-                code: this.addForm.code,
-                name: this.addForm.name,
-                remark: this.addForm.remark,
-                codeConfigurationList:codeConfigurationList,
-                codeManageTreeId: 1
-              };
-              if(this.openType == 'edit'){
-                 par.id = this.addForm.id
-              }
-              saveNew(par).then(res => {
-                  console.log('res',res)
-                  this.loading = false;
-                  this.addRoleDialog = false
-                  this.$message.success(res);
-                  this.$emit('done');
-                  this.restForm();
+            const codeConfigurationList = this.$refs.myTable.getTableValue();
+            // codeConfigurationList.map(item=>{
+            //    item.type = item.type.code
+            // })
+            let par = {
+              code: this.addForm.code,
+              name: this.addForm.name,
+              remark: this.addForm.remark,
+              codeConfigurationList: codeConfigurationList,
+              codeManageTreeId: 1
+            };
+            if (this.openType == 'edit') {
+              par.id = this.addForm.id;
+            }
+            saveNew(par)
+              .then((res) => {
+                console.log('res', res);
+                this.loading = false;
+                this.addRoleDialog = false;
+                this.$message.success(res);
+                this.$emit('done');
               })
               .catch((e) => {
-                  this.loading = false;
-                  this.$message.error(e.message);
+                this.loading = false;
+                // this.$message.error(e.message);
               });
-          })
-
-    },
-  }
-};
+          });
+        }
+      }
+    }
+  };
 </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;
-}
+  .dialog_top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 10px;
+  }
+  .btns {
+    text-align: right;
+    margin: 10px 0;
+  }
 </style>

+ 15 - 18
src/views/codeManagement/components/code-list.vue

@@ -48,23 +48,20 @@
       </template>
     </ele-pro-table>
     <!-- 编辑弹窗 -->
-    <addDialog
-      ref="addDialog"
-      @done="reload"
-    ></addDialog>
+    <addDialog ref="addDialog" @done="reload"></addDialog>
   </div>
 </template>
 
 <script>
   import CodeSearch from './code-search.vue';
-  import addDialog from './addDialog.vue'
-  import { getCodeList , removeCodeInfo } from '@/api/codeManagement/index';
+  import addDialog from './addDialog.vue';
+  import { getCodeList, removeCodeInfo } from '@/api/codeManagement/index';
 
   export default {
-    components: { CodeSearch , addDialog },
+    components: { CodeSearch, addDialog },
     props: {
       // 机构id
-      organizationId: [Number,String],
+      organizationId: [Number, String],
       // 全部机构
       organizationList: Array
     },
@@ -100,7 +97,7 @@
             align: 'left',
             // sortable: 'custom',
             minWidth: 200,
-            showOverflowTooltip: true,
+            showOverflowTooltip: true
           },
           {
             columnKey: 'action',
@@ -115,7 +112,7 @@
         // 当前编辑数据
         current: null,
         // 是否显示编辑弹窗
-        showEdit: false,
+        showEdit: false
       };
     },
     methods: {
@@ -124,8 +121,8 @@
         return getCodeList({
           ...where,
           ...order,
-          pageNum:page,
-          size:limit,
+          pageNum: page,
+          size: limit
           // groupId: 1
         });
       },
@@ -135,11 +132,11 @@
       },
       /* 显示编辑 */
       openEdit(row) {
-          if(row){
-            this.$refs.addDialog.open('edit',row)
-          }else{
-            this.$refs.addDialog.open('add')
-          }
+        if (row) {
+          this.$refs.addDialog.open('edit', row);
+        } else {
+          this.$refs.addDialog.open('add');
+        }
       },
       /* 删除 */
       remove(row) {
@@ -152,7 +149,7 @@
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     },

+ 5 - 6
src/views/codeManagement/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="ele-body">
-<!--    <el-card shadow="never" v-loading="loading">
+    <!--    <el-card shadow="never" v-loading="loading">
       <ele-split-layout
         width="266px"
         allow-collapse
@@ -34,8 +34,7 @@
         </template>
       </ele-split-layout>
     </el-card> -->
-    <code-list
-    />
+    <code-list />
   </div>
 </template>
 
@@ -63,7 +62,7 @@
         editData: null,
         // 上级id
         parentId: null,
-        filterText:''
+        filterText: ''
       };
     },
     created() {
@@ -87,7 +86,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 选择数据 */
@@ -121,7 +120,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});

+ 1 - 1
src/views/dashboard/analysis/components/hot-search.vue

@@ -65,7 +65,7 @@
             };
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

+ 1 - 1
src/views/dashboard/analysis/components/sale-card.vue

@@ -140,7 +140,7 @@
             this.onSaleTypeChange();
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
 

+ 1 - 1
src/views/dashboard/analysis/components/statistics-card.vue

@@ -219,7 +219,7 @@
             };
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

+ 1 - 1
src/views/dashboard/analysis/components/visit-hour.vue

@@ -95,7 +95,7 @@
             };
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

+ 1 - 1
src/views/dashboard/monitor/components/browser-card.vue

@@ -63,7 +63,7 @@
             };
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

+ 2 - 2
src/views/dashboard/monitor/components/map-card.vue

@@ -81,7 +81,7 @@
             this.getUserCountData();
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 获取用户分布数据 */
@@ -126,7 +126,7 @@
             };
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

+ 1 - 1
src/views/example/choose/index.vue

@@ -124,7 +124,7 @@
             this.classes = data;
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 添加 */

+ 1 - 1
src/views/example/document/components/file-sort.vue

@@ -198,7 +198,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 上移 */

+ 1 - 1
src/views/extension/file/components/file-list.vue

@@ -160,7 +160,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});

+ 3 - 3
src/views/extension/file/components/file-toolbar.vue

@@ -119,12 +119,12 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
         return false;
       },
@@ -147,7 +147,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});

+ 1 - 1
src/views/extension/file/components/folder-add.vue

@@ -78,7 +78,7 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },

+ 1 - 1
src/views/extension/file/components/name-edit.vue

@@ -74,7 +74,7 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },

+ 1 - 1
src/views/extension/file/index.vue

@@ -88,7 +88,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 刷新列表数据 */

+ 264 - 200
src/views/flowable/ProcessDefinitionIdentityLink.vue

@@ -1,214 +1,278 @@
 <template>
-    <el-dialog :title="title" fullscreen :visible.sync="dialogProcessDefinitionIdentityLinkInChild" width="75%">
-        <el-button-group style="padding-bottom: 10px">
-            <el-button v-permission="'flowable:processDefinitionIdentityLink:save'" icon="el-icon-plus" type="primary"
-                       @click="btnCreate" class="filter-item">新增
-            </el-button>
-        </el-button-group>
-        <el-table
-                :data="records"
-                @selection-change="selectionChange"
-                border
-                fit
-                highlight-current-row
-                style="width:100%;"
-                :cell-style="{padding:'3px'}"
+  <!-- <el-dialog
+    :title="title"
+    fullscreen
+    :visible.sync="dialogProcessDefinitionIdentityLinkInChild"
+    width="75%"
+  > -->
+  <ele-modal
+    width="800px"
+    :maxable="true"
+    :visible="dialogProcessDefinitionIdentityLinkInChild"
+    :close-on-click-modal="true"
+    :title="title"
+    @update:visible="updateVisible"
+  >
+    <!-- <el-button-group style="padding-bottom: 10px">
+      <el-button
+        icon="el-icon-plus"
+        type="primary"
+        @click="btnCreate"
+        class="filter-item"
+        >新增
+      </el-button>
+    </el-button-group> -->
+    <el-table
+      :data="records"
+      @selection-change="selectionChange"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%"
+      :cell-style="{ padding: '3px' }"
+    >
+      <el-table-column type="selection" align="center"> </el-table-column>
+      <el-table-column label="授权ID" prop="identityId" align="center">
+        <template slot-scope="scope"
+          ><span>{{ scope.row.identityId }}</span></template
         >
-            <el-table-column type="selection" align="center">
-            </el-table-column>
-            <el-table-column label="授权ID" prop="identityId" align="center">
-                <template slot-scope="scope"><span>{{ scope.row.identityId }}</span></template>
-            </el-table-column>
-            <el-table-column label="授权类型" prop="identityType" align="center">
-                <template slot-scope="scope">
-                    <span v-html="formatDictText(dicts.identityType,scope.row.identityType)"></span>
-                </template>
-            </el-table-column>
-            <el-table-column label="授权名称" prop="identityName" align="center">
-                <template slot-scope="scope"><span>{{ scope.row.identityName }}</span></template>
-            </el-table-column>
-            <el-table-column label="操作" align="center">
-                <template slot-scope="{row}">
-                    <el-dropdown>
-                        <span class="el-dropdown-link">操作<i
-                                class="el-icon-arrow-down el-icon--right"></i></span>
-                        <el-dropdown-menu slot="dropdown">
-                            <el-dropdown-item icon="el-icon-view" @click.native="btnView(row)">查看
-                            </el-dropdown-item>
-                            <el-dropdown-item v-permission="'flowable:processDefinitionIdentityLink:delete'"
-                                              icon="el-icon-delete" divided @click.native="btnDelete(row)">删除
-                            </el-dropdown-item>
-                        </el-dropdown-menu>
-                    </el-dropdown>
-                </template>
-            </el-table-column>
-        </el-table>
+      </el-table-column>
+      <el-table-column label="授权类型" prop="identityType" align="center">
+        <template slot-scope="scope">
+          <span
+            v-html="formatDictText(dicts.identityType, scope.row.identityType)"
+          ></span>
+        </template>
+      </el-table-column>
+      <el-table-column label="授权名称" prop="identityName" align="center">
+        <template slot-scope="scope"
+          ><span>{{ scope.row.identityName }}</span></template
+        >
+      </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{ row }">
+          <el-dropdown>
+            <span class="el-dropdown-link"
+              >操作<i class="el-icon-arrow-down el-icon--right"></i
+            ></span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item icon="el-icon-view" @click.native="btnView(row)"
+                >查看
+              </el-dropdown-item>
+              <el-dropdown-item
+                v-permission="'flowable:processDefinitionIdentityLink:delete'"
+                icon="el-icon-delete"
+                divided
+                @click.native="btnDelete(row)"
+                >删除
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
 
-        <el-dialog title="流程授权" :visible.sync="dialogFormVisible" :append-to-body="true">
-            <el-form ref="dataForm" :rules="rules" :model="temp" :disabled="dialogStatus==='view'"
-                     label-position="right" label-width="110px">
-                <el-form-item label="授权类型" prop="identityType">
-                    <!--<el-input v-model="temp.identityType"/>-->
-                    <el-select v-model="temp.identityType" placeholder="授权类型">
-                        <el-option v-for="(item, index) in dicts.identityType" :key="index"
-                                   :label="item.content" :value="item.value"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="授权id" prop="identityId">
-                    <el-input v-model="temp.identityId" :placeholder="placeholderIdentityId"/>
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button icon="el-icon-close" @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus!=='view'" icon="el-icon-check" type="primary" @click="createData()">确定
-                </el-button>
-            </div>
-        </el-dialog>
+    <el-dialog
+      title="流程授权"
+      :visible.sync="dialogFormVisible"
+      :append-to-body="true"
+    >
+      <el-form
+        ref="dataForm"
+        :rules="rules"
+        :model="temp"
+        :disabled="dialogStatus === 'view'"
+        label-position="right"
+        label-width="110px"
+      >
+        <el-form-item label="授权类型" prop="identityType">
+          <!--<el-input v-model="temp.identityType"/>-->
+          <el-select v-model="temp.identityType" placeholder="授权类型">
+            <el-option
+              v-for="(item, index) in dicts.identityType"
+              :key="index"
+              :label="item.content"
+              :value="item.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="授权id" prop="identityId">
+          <el-input
+            v-model="temp.identityId"
+            :placeholder="placeholderIdentityId"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button icon="el-icon-close" @click="dialogFormVisible = false"
+          >取消</el-button
+        >
+        <el-button
+          v-if="dialogStatus !== 'view'"
+          icon="el-icon-check"
+          type="primary"
+          @click="createData()"
+          >确定
+        </el-button>
+      </div>
     </el-dialog>
+  </ele-modal>
 </template>
 
 <script>
-    import {deleteAction, getAction, postAction} from '@/api/flowable/manage'
-    import {Message} from 'element-ui'
+  import { deleteAction, getAction, postAction } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
 
-    export default {
-        name: 'ProcessDefinitionIdentityLink',
-        props: {
-            visible: {
-                type: Boolean,
-                default: function () {
-                    return false
-                }
-            },
-            // dicts: {
-            //     type: Object,
-            //     default: function () {
-            //         return {}
-            //     }
-            // },
-            processDefinitionId: {
-                type: String,
-                default: function () {
-                    return ''
-                }
-            },
-            processDefinitionName: {
-                type: String,
-                default: function () {
-                    return ''
-                }
-            }
-        },
-        computed: {
-            dialogProcessDefinitionIdentityLinkInChild: {
-                get() {
-                    return this.visible
-                },
-                set(val) {
-                    this.$emit('update:visible', val)
-                }
-            },
-            title: {
-                get() {
-                    return '流程授权【' + this.processDefinitionName + '】'
-                }
-            },
-            placeholderIdentityId: {
-                get() {
-                    if (this.temp.identityType == '1') {
-                        return '请输入用户id'
-                    } else if (this.temp.identityType == '2') {
-                        return '请输入岗位id'
-                    } else {
-                        return '请先选择授权类型'
-                    }
-                }
-            }
+  export default {
+    name: 'ProcessDefinitionIdentityLink',
+    props: {
+      visible: {
+        type: Boolean,
+        default: function () {
+          return false;
+        }
+      },
+      // dicts: {
+      //     type: Object,
+      //     default: function () {
+      //         return {}
+      //     }
+      // },
+      processDefinitionId: {
+        type: String,
+        default: function () {
+          return '';
+        }
+      },
+      processDefinitionName: {
+        type: String,
+        default: function () {
+          return '';
+        }
+      }
+    },
+    computed: {
+      dialogProcessDefinitionIdentityLinkInChild: {
+        get() {
+          return this.visible;
         },
-        created() {
-            this.getDicts('identityType').then(({data}) => {
-                this.dicts = data
-            })
-            this.list()
+        set(val) {
+          this.$emit('update:visible', val);
+        }
+      },
+      title: {
+        get() {
+          return '流程授权【' + this.processDefinitionName + '】';
+        }
+      },
+      placeholderIdentityId: {
+        get() {
+          if (this.temp.identityType == '1') {
+            return '请输入用户id';
+          } else if (this.temp.identityType == '2') {
+            return '请输入岗位id';
+          } else {
+            return '请先选择授权类型';
+          }
+        }
+      }
+    },
+    created() {
+      // this.getDicts('identityType').then(({data}) => {
+      //     this.dicts = data
+      // })
+      this.list();
+    },
+    data() {
+      return {
+        records: [],
+        selectedRecords: [],
+        dicts: [],
+        listQuery: {
+          processDefinitionId: this.processDefinitionId,
+          identityType: '',
+          identityId: ''
         },
-        data() {
-            return {
-                records: [],
-                selectedRecords: [],
-                dicts: [],
-                listQuery: {
-                    processDefinitionId: this.processDefinitionId,
-                    identityType: '',
-                    identityId: ''
-                },
-                dialogFormVisible: false,
-                dialogStatus: '',
-                temp: {
-                    processDefinitionId: this.processDefinitionId,
-                    identityType: '',
-                    identityId: ''
-                },
-                rules: {
-                    identityType: [{required: true, message: '该项不能为空', trigger: 'change'}],
-                    identityId: [{required: true, message: '该项不能为空', trigger: 'change'}]
-                }
-            }
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {
+          processDefinitionId: this.processDefinitionId,
+          identityType: '',
+          identityId: ''
         },
-        methods: {
-            list() {
-                getAction('/flowable/processDefinitionIdentityLink/list', this.listQuery).then(res => {
-                    const {data} = res
-                    this.records = data
-                })
-            },
-            resetTemp() {
-                this.temp = {
-                    processDefinitionId: this.processDefinitionId,
-                    identityType: '',
-                    identityId: ''
-                }
-            },
-            btnView(row) {
-                this.temp = Object.assign({}, row)
-                this.dialogStatus = 'view'
-                this.dialogFormVisible = true
-                this.$nextTick(() => {
-                    this.$refs['dataForm'].clearValidate()
-                })
-            },
-            btnCreate() {
-                this.resetTemp()
-                this.dialogStatus = 'create'
-                this.dialogFormVisible = true
-                this.$nextTick(() => {
-                    this.$refs['dataForm'].clearValidate()
-                })
-            },
-            createData() {
-                this.$refs['dataForm'].validate((valid) => {
-                    if (valid) {
-                        postAction('/flowable/processDefinitionIdentityLink/save', this.temp).then(({msg}) => {
-                            this.dialogFormVisible = false
-                            Message.success(msg)
-                            this.list()
-                        })
-                    }
-                })
-            },
-            btnDelete(row) {
-                deleteAction('/flowable/processDefinitionIdentityLink/delete', {
-                    processDefinitionId: this.processDefinitionId,
-                    identityType: row.identityType,
-                    identityId: row.identityId
-                }).then(({msg}) => {
-                    Message.success(msg)
-                    this.list()
-                })
-            },
-            selectionChange(selectedRecords) {
-                this.selectedRecords = selectedRecords
-            }
+        rules: {
+          identityType: [
+            { required: true, message: '该项不能为空', trigger: 'change' }
+          ],
+          identityId: [
+            { required: true, message: '该项不能为空', trigger: 'change' }
+          ]
         }
+      };
+    },
+    methods: {
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
+      list() {
+        getAction(
+          '/flowable/processDefinitionIdentityLink/list',
+          this.listQuery
+        ).then((res) => {
+          const { data } = res;
+          this.records = data;
+        });
+      },
+      resetTemp() {
+        this.temp = {
+          processDefinitionId: this.processDefinitionId,
+          identityType: '',
+          identityId: ''
+        };
+      },
+      btnView(row) {
+        this.temp = Object.assign({}, row);
+        this.dialogStatus = 'view';
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate();
+        });
+      },
+      btnCreate() {
+        this.resetTemp();
+        this.dialogStatus = 'create';
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate();
+        });
+      },
+      createData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            postAction(
+              '/flowable/processDefinitionIdentityLink/save',
+              this.temp
+            ).then(({ msg }) => {
+              this.dialogFormVisible = false;
+              Message.success(msg);
+              this.list();
+            });
+          }
+        });
+      },
+      btnDelete(row) {
+        deleteAction('/flowable/processDefinitionIdentityLink/delete', {
+          processDefinitionId: this.processDefinitionId,
+          identityType: row.identityType,
+          identityId: row.identityId
+        }).then(({ msg }) => {
+          Message.success(msg);
+          this.list();
+        });
+      },
+      selectionChange(selectedRecords) {
+        this.selectedRecords = selectedRecords;
+      }
     }
+  };
 </script>
-

+ 42 - 5
src/views/flowable/components/ProcessImage.vue

@@ -1,11 +1,14 @@
 <template>
-  <el-dialog
+  <ele-modal
+    width="800px"
+    :maxable="true"
+    :visible="dialogProcessImageVisibleInChild"
+    :close-on-click-modal="true"
     title="流程图"
-    :visible.sync="dialogProcessImageVisibleInChild"
-    fullscreen
+    @update:visible="updateVisible"
   >
-    <img :src="imagePath" alt="流程图" />
-  </el-dialog>
+    <img ref="img" alt="流程图" />
+  </ele-modal>
 </template>
 
 <script>
@@ -52,6 +55,38 @@
       this.init();
     },
     methods: {
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      },
+      getImage(url) {
+        let that = this;
+        that.$nextTick(() => {
+          let request = new XMLHttpRequest();
+          request.responseType = 'blob';
+          request.open('get', url, true);
+          // 添加自定义请求头
+          request.setRequestHeader(
+            'Authorization',
+            localStorage.getItem('access_token')
+          );
+          request.onreadystatechange = (e) => {
+            if (
+              request.readyState == XMLHttpRequest.DONE &&
+              request.status == 200
+            ) {
+              console.log(request);
+              that.$refs.img.src = URL.createObjectURL(request.response);
+              URL.createObjectURL(request.response);
+
+              that.$refs.img.onload = () => {
+                that.$refs.img && URL.revokeObjectURL(that.$refs.img.src);
+              };
+            }
+          };
+          request.send(null);
+        });
+      },
+
       init() {
         if (
           this.processInstanceId &&
@@ -66,6 +101,7 @@
             getToken() +
             '&time=' +
             new Date();
+          this.getImage(this.imagePath);
         } else if (
           this.processDefinitionId &&
           this.processDefinitionId != null &&
@@ -79,6 +115,7 @@
             getToken() +
             '&time=' +
             new Date();
+          this.getImage(this.imagePath);
         }
       }
     }

+ 85 - 0
src/views/flowable/form/FormDesign.vue

@@ -0,0 +1,85 @@
+<template>
+  <div>
+    <fm-making-form
+      class="form-making-height"
+      v-if="formDesignType == 'formMaking'"
+      ref="formMaking"
+      preview
+      generate-json
+    >
+      <template #action><slot name="action"></slot></template>
+    </fm-making-form>
+    <form-generator
+      v-if="formDesignType == 'formGenerator'"
+      ref="formGenerator"
+    >
+      <template #action><slot name="action"></slot></template>
+    </form-generator>
+  </div>
+</template>
+<script>
+  import FormGenerator from '@/components/FormGenerator';
+
+  export default {
+    name: 'FormDesign',
+    components: { FormGenerator },
+    data() {
+      return {
+        defaultJson: {
+          formMaking: {
+            list: [],
+            config: { labelWidth: 100, labelPosition: 'right', size: 'small' }
+          },
+          formGenerator: {
+            fields: [],
+            formRef: 'elForm',
+            formModel: 'formData',
+            size: 'medium',
+            labelPosition: 'right',
+            labelWidth: 100,
+            formRules: 'rules',
+            gutter: 15,
+            disabled: false,
+            span: 24,
+            formBtns: false
+          }
+        }
+      };
+    },
+    computed: {
+      formDesignType() {
+        // return 'formMaking'
+        return 'formGenerator';
+        // return defaultSettings.formDesignType
+      }
+    },
+    methods: {
+      setJSON(json) {
+        if (this.formDesignType == 'formMaking') {
+          this.$refs.formMaking.setJSON(
+            json ? json : this.defaultJson['formMaking']
+          );
+        } else if (this.formDesignType == 'formGenerator') {
+          this.$refs.formGenerator.setJSON(
+            json ? json : this.defaultJson['formGenerator']
+          );
+        }
+      },
+      getJSON() {
+        let returnJson;
+        if (this.formDesignType == 'formMaking') {
+          returnJson = this.$refs.formMaking.getJSON();
+        } else if (this.formDesignType == 'formGenerator') {
+          returnJson = this.$refs.formGenerator.getJSON();
+        }
+        return returnJson;
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  .form-making-height {
+    height: calc(100vh - 84px);
+  }
+</style>

+ 47 - 39
src/views/flowable/form/FormParser.vue

@@ -1,45 +1,53 @@
 <template>
-    <div>
-        <fm-generate-form v-if="formDesignType=='formMaking'" :data="data" :value="value" ref="formMaking">
-        </fm-generate-form>
-        <parser v-if="formDesignType=='formGenerator'" :form-conf="data" :value="value" ref="formGenerator"/>
-    </div>
+  <div>
+    <fm-generate-form
+      v-if="formDesignType == 'formMaking'"
+      :data="data"
+      :value="value"
+      ref="formMaking"
+    >
+    </fm-generate-form>
+    <parser
+      v-if="formDesignType == 'formGenerator'"
+      :form-conf="data"
+      :value="value"
+      ref="formGenerator"
+    />
+  </div>
 </template>
 <script>
-    import FormGenerator from "@/components/FormGenerator"
-    import Parser from '@/components/FormGenerator/components/parser'
-    // import defaultSettings from '@/settings'
+  import FormGenerator from '@/components/FormGenerator';
+  import Parser from '@/components/FormGenerator/components/parser';
 
-    export default {
-        name: 'FormParser',
-        components: {FormGenerator,Parser},
-        props: ['data', 'value'],
-        data() {
-            return {}
-        },
-        computed: {
-            formDesignType() {
-                
-                // return defaultSettings.formDesignType 
-                return 'formGenerator'
-            }
-        },
-        methods: {
-            getData() {
-                if(this.formDesignType == 'formMaking'){
-                    return this.$refs[this.formDesignType].getData()
-                }else if(this.formDesignType == 'formGenerator'){
-                    return this.$refs[this.formDesignType].getData()
-                }
-                return null
-            },
-            resetFields() {
-                if(this.formDesignType == 'formMaking'){
-                    this.$refs[this.formDesignType].reset()
-                }else if(this.formDesignType == 'formGenerator'){
-                    this.$refs[this.formDesignType].resetForm()
-                }
-            }
+  export default {
+    name: 'FormParser',
+    components: { FormGenerator, Parser },
+    props: ['data', 'value'],
+    data() {
+      return {};
+    },
+    computed: {
+      formDesignType() {
+        // return 'formMaking'
+        return 'formGenerator';
+      }
+    },
+    methods: {
+      getData() {
+        if (this.formDesignType == 'formMaking') {
+          return this.$refs[this.formDesignType].getData();
+        } else if (this.formDesignType == 'formGenerator') {
+          return this.$refs[this.formDesignType].getData();
         }
+        return null;
+      },
+      resetFields() {
+        if (this.formDesignType == 'formMaking') {
+          this.$refs[this.formDesignType].reset();
+        } else if (this.formDesignType == 'formGenerator') {
+          this.$refs[this.formDesignType].resetForm();
+        }
+      }
     }
-</script>
+  };
+</script>

+ 68 - 0
src/views/flowable/form/edit.vue

@@ -0,0 +1,68 @@
+<template>
+  <div>
+    <form-design ref="formDesign">
+      <template v-slot:action>
+        <el-button type="text" icon="el-icon-check" @click="btnSave"
+          >保存</el-button
+        >
+      </template>
+    </form-design>
+  </div>
+</template>
+<script>
+  import { getAction, putAction } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
+  import FormDesign from './FormDesign';
+
+  export default {
+    name: 'FlowableFormEdit',
+    components: { FormDesign },
+    data() {
+      return {
+        formKey: undefined,
+        formData: {
+          formKey: undefined,
+          formName: '',
+          formJson: ''
+        }
+      };
+    },
+    created() {
+      if (this.$route.query && this.$route.query.formKey) {
+        this.formKey = this.$route.query.formKey;
+      }
+      this.getFormData();
+    },
+    methods: {
+      getFormData() {
+        if (!this.formKey) {
+          Message.error('formKey is null');
+          return;
+        }
+        getAction('/flowable/form/queryById', { id: this.formKey }).then(
+          ({ data }) => {
+            this.formData = data;
+            let json = this.formData?.formJson;
+            setTimeout(
+              () =>
+                this.$refs.formDesign.setJSON(
+                  json ? JSON.parse(json) : undefined
+                ),
+              100
+            );
+          }
+        );
+      },
+      btnSave() {
+        this.formData.formJson = JSON.stringify(
+          this.$refs.formDesign.getJSON()
+        );
+        putAction('/flowable/form/update', this.formData).then(
+          ({ msg, data }) => {
+            Message.success(msg);
+          }
+        );
+      }
+    }
+  };
+</script>

+ 290 - 0
src/views/flowable/form/index.vue

@@ -0,0 +1,290 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.formKey"
+        placeholder="表单key"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="btnQuery"
+      />
+      <el-input
+        v-model="listQuery.formName"
+        placeholder="表单名称"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="btnQuery"
+      />
+      <el-dropdown
+        split-button
+        type="primary"
+        @click="btnQuery"
+        class="filter-item"
+      >
+        <i class="el-icon-search el-icon--left"></i>查询
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item icon="el-icon-zoom-out" @click.native="btnReset"
+            >重置</el-dropdown-item
+          >
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-button-group>
+        <el-button
+          icon="el-icon-plus"
+          type="primary"
+          @click="btnCreate"
+          class="filter-item"
+          >新增
+        </el-button>
+        <el-button
+          icon="el-icon-delete"
+          @click="btnDelete()"
+          class="filter-item"
+          >批量删除
+        </el-button>
+      </el-button-group>
+    </div>
+    <el-table
+      :data="records"
+      ref="multipleTable"
+      @selection-change="selectionChange"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%"
+      :cell-style="{ padding: '3px' }"
+    >
+      <el-table-column type="selection" align="center"> </el-table-column>
+      <el-table-column label="表单key" prop="formKey" align="center">
+        <template slot-scope="scope"
+          ><span>{{ scope.row.formKey }}</span></template
+        >
+      </el-table-column>
+      <el-table-column label="表单名称" prop="formName" align="center">
+        <template slot-scope="scope"
+          ><span>{{ scope.row.formName }}</span></template
+        >
+      </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{ row }">
+          <el-dropdown>
+            <span class="el-dropdown-link"
+              >操作<i class="el-icon-arrow-down el-icon--right"></i
+            ></span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item icon="el-icon-view" @click.native="btnView(row)"
+                >查看</el-dropdown-item
+              >
+              <el-dropdown-item
+                icon="el-icon-edit"
+                divided
+                @click.native="btnUpdate(row)"
+                >修改
+              </el-dropdown-item>
+              <el-dropdown-item
+                icon="el-icon-edit"
+                divided
+                @click.native="btnUpdateFormJson(row)"
+                >修改表单
+              </el-dropdown-item>
+              <el-dropdown-item
+                icon="el-icon-delete"
+                divided
+                @click.native="btnDelete(row.formKey)"
+                >删除
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :current.sync="listQuery.current"
+      :size.sync="listQuery.size"
+      @pagination="list"
+    />
+
+    <el-dialog title="流程表单" :visible.sync="dialogFormVisible">
+      <el-form
+        ref="dataForm"
+        :rules="rules"
+        :model="temp"
+        :disabled="dialogStatus === 'view'"
+        label-position="right"
+        label-width="110px"
+      >
+        <el-form-item label="表单key" prop="formKey">
+          <el-input
+            v-model="temp.formKey"
+            :readonly="dialogStatus === 'update'"
+          />
+        </el-form-item>
+        <el-form-item label="表单名称" prop="formName">
+          <el-input v-model="temp.formName" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button icon="el-icon-close" @click="dialogFormVisible = false"
+          >取消</el-button
+        >
+        <el-button
+          v-if="dialogStatus !== 'view'"
+          icon="el-icon-check"
+          type="primary"
+          @click="dialogStatus === 'create' ? createData() : updateData()"
+          >确定
+        </el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import Pagination from '@/components/Pagination';
+  import {
+    deleteAction,
+    getAction,
+    postAction,
+    putAction
+  } from '@/api/flowable/manage';
+  import { Message } from 'element-ui';
+
+  export default {
+    name: 'FlowableForm',
+    components: { Pagination },
+    data() {
+      return {
+        dicts: [],
+        records: null,
+        selectedRecords: [],
+        total: 0,
+        listQuery: {
+          current: 1,
+          size: 10,
+          formKey: undefined,
+          formName: undefined
+        },
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {
+          formKey: undefined,
+          formName: ''
+        },
+        rules: {
+          formKey: [
+            { required: true, message: '该项不能为空', trigger: 'change' }
+          ],
+          formName: [
+            { required: true, message: '该项不能为空', trigger: 'change' }
+          ]
+        }
+      };
+    },
+    created() {
+      this.list();
+    },
+    methods: {
+      list() {
+        getAction('/flowable/form/list', this.listQuery).then((res) => {
+          const { data } = res.data;
+          console.log(data);
+          this.records = data.list;
+          this.total = data.count;
+        });
+      },
+      btnQuery() {
+        this.listQuery.current = 1;
+        this.list();
+      },
+      btnReset() {
+        this.listQuery = {
+          current: 1,
+          size: 10,
+          formKey: undefined,
+          formName: undefined
+        };
+        this.list();
+      },
+      resetTemp() {
+        this.temp = {
+          formKey: undefined,
+          formName: ''
+        };
+      },
+      btnView(row) {
+        this.temp = Object.assign({}, row);
+        this.dialogStatus = 'view';
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate();
+        });
+      },
+      btnCreate() {
+        this.resetTemp();
+        this.dialogStatus = 'create';
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate();
+        });
+      },
+      createData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            postAction('/flowable/form/save', this.temp).then(({ data }) => {
+              this.dialogFormVisible = false;
+              Message.success(data.message);
+              this.list();
+            });
+          }
+        });
+      },
+      btnUpdate(row) {
+        this.temp = Object.assign({}, row);
+        this.dialogStatus = 'update';
+        this.dialogFormVisible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].clearValidate();
+        });
+      },
+      btnUpdateFormJson(row) {
+        this.$router.push({
+          path: '/flowable/form/edit',
+          query: { formKey: row.formKey }
+        });
+      },
+      updateData() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            putAction('/flowable/form/update', this.temp).then(({ msg }) => {
+              this.dialogFormVisible = false;
+              Message.success(msg);
+              this.list();
+            });
+          }
+        });
+      },
+      btnDelete(id) {
+        let ids = id
+          ? [id]
+          : this.selectedRecords.map((record) => {
+              return record.formKey;
+            });
+        if (ids.length == 0) {
+          Message.error('请选择要删除的记录');
+          return;
+        }
+        deleteAction('/flowable/form/delete', { ids: ids.toString() }).then(
+          ({ msg }) => {
+            Message.success(msg);
+            this.list();
+          }
+        );
+      },
+      selectionChange(selectedRecords) {
+        this.selectedRecords = selectedRecords;
+      }
+    }
+  };
+</script>

+ 75 - 58
src/views/flowable/processDefinition.vue

@@ -6,61 +6,76 @@
       <el-checkbox v-model="listQuery.active">激活的</el-checkbox>
     </div>
     <div class="filter-container">
-      <el-input
-        v-model="listQuery.processDefinitionId"
-        placeholder="流程定义ID"
-        style="width: 200px"
-        class="filter-item"
-        @keyup.enter.native="btnQuery"
-      />
-      <el-input
-        v-model="listQuery.processDefinitionName"
-        placeholder="流程定义名称"
-        style="width: 200px"
-        class="filter-item"
-        @keyup.enter.native="btnQuery"
-      />
-      <el-input
-        v-model="listQuery.processDefinitionKey"
-        placeholder="流程定义KEY"
-        style="width: 200px"
-        class="filter-item"
-        @keyup.enter.native="btnQuery"
-      />
-      <el-dropdown
-        split-button
-        type="primary"
-        @click="btnQuery"
-        class="filter-item"
+      <el-form
+        label-width="100px"
+        class="ele-form-search"
+        @keyup.enter.native="search"
+        @submit.native.prevent
       >
-        <i class="el-icon-search el-icon--left"></i>查询
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item icon="el-icon-zoom-out" @click.native="btnReset"
-            >重置</el-dropdown-item
-          >
-        </el-dropdown-menu>
-      </el-dropdown>
-      <el-button-group>
-        <el-button
-          icon="el-icon-plus"
-          type="primary"
-          @click="btnImport"
-          class="filter-item"
-          >导入
-        </el-button>
-      </el-button-group>
+        <el-row :gutter="15">
+          <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+            <el-form-item label="流程定义ID:">
+              <el-input
+                clearable
+                v-model="listQuery.processDefinitionId"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+            <el-form-item label="流程定义名称:">
+              <el-input
+                clearable
+                v-model="listQuery.processDefinitionName"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
+            <el-form-item label="流程定义KEY:">
+              <el-input
+                clearable
+                v-model="listQuery.processDefinitionKey"
+                placeholder="请输入"
+              />
+            </el-form-item>
+          </el-col>
+
+          <el-col v-bind="styleResponsive ? { lg: 9, md: 12 } : { span: 6 }">
+            <div class="ele-form-actions">
+              <el-button @click="btnReset">重置</el-button>
+              <el-button
+                type="primary"
+                icon="el-icon-search"
+                class="ele-btn-icon"
+                @click="btnQuery"
+              >
+                查询
+              </el-button>
+
+              <el-button
+                icon="el-icon-plus"
+                type="primary"
+                @click="btnImport"
+                class="filter-item"
+                >导入
+              </el-button>
+            </div>
+          </el-col>
+        </el-row>
+      </el-form>
     </div>
     <el-table
       :data="records"
       ref="multipleTable"
-      @selection-change="selectionChange"
       border
       fit
       highlight-current-row
       style="width: 100%"
       :cell-style="{ padding: '3px' }"
     >
-      <el-table-column type="selection" align="center"> </el-table-column>
+      <el-table-column type="index" align="center" label="序号" width="50px">
+      </el-table-column>
       <el-table-column label="流程定义名称" prop="name" align="center">
         <template slot-scope="scope"
           ><span>{{ scope.row.name }}</span></template
@@ -107,12 +122,12 @@
                 @click.native="btnImage(row.id)"
                 >流程图
               </el-dropdown-item>
-              <el-dropdown-item
+              <!-- <el-dropdown-item
                 icon="el-icon-edit"
                 divided
                 @click.native="btnProcessDefinitionIdentityLink(row)"
                 >流程授权
-              </el-dropdown-item>
+              </el-dropdown-item> -->
               <el-dropdown-item
                 icon="el-icon-edit"
                 divided
@@ -317,15 +332,17 @@
     created() {
       this.list();
     },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
     methods: {
       list() {
         getAction('/flowable/processDefinition/list', this.listQuery).then(
           (res) => {
-            // const {data} = res
-            // this.records = data.records;
-            // this.total = data.total
             if (res.data.code == 0) {
-              console.log('res.data.data', res.data.data);
               const { data } = res.data;
               this.records = data.records;
               this.total = data.total;
@@ -370,15 +387,15 @@
           Message.error('请选择要删除的记录');
           return;
         }
-        if (ids.length > 1) {
-          Message.error('只能选择一条记录');
-          return;
-        }
+        // if (ids.length > 1) {
+        //   Message.error('只能选择一条记录');
+        //   return;
+        // }
         deleteAction('/flowable/processDefinition/delete', {
           processDefinitionId: ids.toString(),
           cascade: cascade
-        }).then(({ msg }) => {
-          Message.success(msg);
+        }).then(({ data }) => {
+          Message.success('删除' + data.message);
           this.list();
         });
       },
@@ -386,8 +403,8 @@
         let suspendOrActivate = suspend ? 'activate' : 'suspend';
         putAction('/flowable/processDefinition/' + suspendOrActivate, {
           processDefinitionId
-        }).then(({ msg }) => {
-          Message.success(msg);
+        }).then((res) => {
+          Message.success((suspend ? '激活' : '挂起') + res.data.message);
           this.list();
         });
       },

+ 10 - 22
src/views/flowable/processInstance.vue

@@ -328,7 +328,7 @@
   export default {
     name: 'FlowableProcessInstance',
     components: { ProcessDetail, Pagination },
-    data () {
+    data() {
       return {
         dicts: [],
         records: null,
@@ -372,7 +372,7 @@
         dialogViewVisible: false
       };
     },
-    created () {
+    created() {
       if (this.$route.query && this.$route.query.processDefinitionId) {
         this.listQuery.processDefinitionId =
           this.$route.query.processDefinitionId;
@@ -380,33 +380,21 @@
       this.list();
     },
     methods: {
-      list () {
+      list() {
         getAction('/flowable/processInstance/list', this.listQuery).then(
           (res) => {
-            // const {data} = res
-            // console.info(data)
-            // this.records = data.records;
-            // this.total = data.total
             if (res.data.code == 0) {
-              console.log('res.data.data', res.data.data);
-              const { data } = res;
               this.records = res.data.data.list;
               this.total = res.data.data.count;
-              console.log(
-                'this.records',
-                this.records,
-                'this.total',
-                this.total
-              );
             }
           }
         );
       },
-      btnQuery () {
+      btnQuery() {
         this.listQuery.current = 1;
         this.list();
       },
-      btnReset () {
+      btnReset() {
         this.listQuery = {
           current: 1,
           size: 10,
@@ -421,7 +409,7 @@
         };
         this.list();
       },
-      btnViewProcessInstance (row) {
+      btnViewProcessInstance(row) {
         getAction('/flowable/processInstance/queryById', {
           processInstanceId: row.id
         }).then((res) => {
@@ -430,17 +418,17 @@
           this.dialogFormVisible = true;
         });
       },
-      btnView (processInstanceId) {
+      btnView(processInstanceId) {
         this.processInstanceId = processInstanceId;
         this.dialogViewVisible = true;
       },
-      btnViewTaskList (row) {
+      btnViewTaskList(row) {
         this.$router.push({
           path: '/flowable/task',
           query: { processInstanceId: row.id }
         });
       },
-      btnDelete (id, cascade) {
+      btnDelete(id, cascade) {
         if (!id) {
           Message.error('请选择要删除的记录');
           return;
@@ -453,7 +441,7 @@
           this.list();
         });
       },
-      btnSuspendOrActivate (processInstanceId, suspend) {
+      btnSuspendOrActivate(processInstanceId, suspend) {
         let suspendOrActivate = suspend ? 'activate' : 'suspend';
         putAction('/flowable/processInstance/' + suspendOrActivate, {
           processInstanceId: processInstanceId

+ 1 - 1
src/views/form/advanced/components/user-select.vue

@@ -134,7 +134,7 @@
           });
         })
         .catch((e) => {
-          this.$message.error(e.message);
+          // this.$message.error(e.message);
         });
     }
   };

+ 1 - 1
src/views/list/basic/components/edit-form.vue

@@ -211,7 +211,7 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },

+ 1 - 1
src/views/list/basic/details/index.vue

@@ -86,7 +86,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     },

+ 1 - 1
src/views/list/basic/edit/index.vue

@@ -34,7 +34,7 @@
               this.user = data;
             })
             .catch((e) => {
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         }
       }

+ 7 - 7
src/views/login/index.vue

@@ -115,7 +115,7 @@
     // eslint-disable-next-line vue/multi-word-component-names
     name: 'Login',
     components: { I18nIcon },
-    data () {
+    data() {
       return {
         // 登录框方向, 0居中, 1居右, 2居左
         direction: 0,
@@ -135,7 +135,7 @@
     },
     computed: {
       // 表单验证规则
-      rules () {
+      rules() {
         return {
           loginName: [
             {
@@ -156,14 +156,14 @@
         };
       }
     },
-    created () {
+    created() {
       if (getToken()) {
         this.goHome();
       }
     },
     methods: {
       /* 提交 */
-      submit () {
+      submit() {
         this.$refs.form.validate((valid) => {
           if (!valid) {
             return false;
@@ -186,11 +186,11 @@
         });
       },
       /* 跳转到首页 */
-      goHome () {
+      goHome() {
         this.$router.push(this.$route?.query?.from ?? '/').catch(() => {});
       },
       /* 更换图形验证码 */
-      changeCaptcha () {
+      changeCaptcha() {
         // 这里演示的验证码是后端返回base64格式的形式, 如果后端地址直接是图片请参考忘记密码页面
         getCaptcha()
           .then((data) => {
@@ -202,7 +202,7 @@
             this.$refs?.form?.clearValidate();
           })
           .catch((e) => {
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     }

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

@@ -128,13 +128,14 @@
           })
             .then((msg) => {
               this.loading = false;
+              console.log(msg);
               this.$message.success(msg);
               this.updateVisible(false);
               this.$emit('done');
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },

+ 3 - 3
src/views/system/dictionary/components/dict-data.vue

@@ -184,12 +184,12 @@
         removeDictionary(row.id)
           .then((msg) => {
             loading.close();
-            this.$message.success(msg);
+            this.$message.success('删除' + msg);
             this.reload();
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 批量删除 */
@@ -211,7 +211,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});

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

@@ -409,7 +409,7 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // // this.$message.error(e.message);
             });
         });
       },

+ 1 - 1
src/views/system/dictionary/index.vue

@@ -148,7 +148,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});

+ 3 - 3
src/views/system/file/index.vue

@@ -185,7 +185,7 @@
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 批量删除 */
@@ -207,7 +207,7 @@
               })
               .catch((e) => {
                 loading.close();
-                this.$message.error(e.message);
+                // this.$message.error(e.message);
               });
           })
           .catch(() => {});
@@ -227,7 +227,7 @@
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
         return false;
       }

+ 1 - 1
src/views/system/login-record/index.vue

@@ -214,7 +214,7 @@
             })
             .catch((e) => {
               loading.close();
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       }

+ 9 - 5
src/views/system/menu/index.vue

@@ -44,14 +44,18 @@
             type="primary"
             size="mini"
             :disable-transitions="true"
-            v-if="row.type==1"
-          > 菜单  </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>
+            v-if="row.type == 2"
+          >
+            按钮
+          </el-tag>
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
@@ -213,7 +217,7 @@
         }
         const loading = this.$loading({ lock: true });
         deleteMenu([row.id])
-          .then(res => {
+          .then((res) => {
             loading.close();
             this.$message.success('菜单删除成功');
             this.reload();

+ 1 - 1
src/views/system/operation-record/index.vue

@@ -255,7 +255,7 @@
             })
             .catch((e) => {
               loading.close();
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       }

+ 9 - 12
src/views/system/organization/components/org-edit.vue

@@ -56,7 +56,7 @@
       // 修改回显的数据
       data: Object,
       // 上级id
-      parentId: [Number,String],
+      parentId: [Number, String],
       // 机构数据
       organizationList: Array
     },
@@ -65,7 +65,7 @@
         id: null,
         parentId: null,
         name: '',
-        type:1,
+        type: 1
       };
       return {
         defaultForm,
@@ -73,7 +73,7 @@
         form: { ...defaultForm },
         // 表单验证规则
         rules: {
-          name: [{required: true,message: '请输入机构名称',trigger: 'blur'}]
+          name: [{ required: true, message: '请输入机构名称', trigger: 'blur' }]
         },
         // 提交状态
         loading: false,
@@ -99,8 +99,8 @@
             ...this.form,
             parentId: this.form.parentId || 0
           };
-          if(!this.isUpdate){
-            delete data.id
+          if (!this.isUpdate) {
+            delete data.id;
           }
           const saveOrUpdate = this.isUpdate
             ? updateOrganization
@@ -127,13 +127,10 @@
       visible(visible) {
         if (visible) {
           if (this.data) {
-            this.$util.assignObject(
-               this.form, 
-               {
-                 ...this.data,
-                 parentId: this.data.parentId == 0 ? '' : this.data.parentId ?? ''
-               }
-            );
+            this.$util.assignObject(this.form, {
+              ...this.data,
+              parentId: this.data.parentId == 0 ? '' : this.data.parentId ?? ''
+            });
             this.isUpdate = true;
           } else {
             this.form.parentId = this.parentId;

+ 72 - 51
src/views/system/organization/components/org-user-edit.vue

@@ -40,29 +40,38 @@
                 v-for="item in statusOptions"
                 :key="item.value"
                 :label="item.label"
-                :value="item.value">
+                :value="item.value"
+              >
               </el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="籍贯:" prop="city">
-             <regions-select style="width: 100%;" v-model="city" placeholder="请选择省市区"/>
+            <regions-select
+              style="width: 100%"
+              v-model="city"
+              placeholder="请选择省市区"
+            />
           </el-form-item>
           <el-form-item label="生日:" prop="age">
-            <el-date-picker style="width: 100%;"
+            <el-date-picker
+              style="width: 100%"
               clearable
               v-model="form.birthday"
               type="date"
               value-format="yyyy-MM-dd"
-              placeholder="请选择日期">
+              placeholder="请选择日期"
+            >
             </el-date-picker>
           </el-form-item>
           <el-form-item label="入职时间:" prop="joinDate">
-            <el-date-picker style="width: 100%;"
+            <el-date-picker
+              style="width: 100%"
               clearable
               v-model="form.joinDate"
               type="date"
               value-format="yyyy-MM-dd"
-              placeholder="请选择日期">
+              placeholder="请选择日期"
+            >
             </el-date-picker>
           </el-form-item>
           <el-form-item label="毕业院校:" prop="school">
@@ -106,7 +115,7 @@
               :disabled="true"
               :maxlength="11"
               v-model="form.loginName"
-              v-if="isUpdate&&data.accountId"
+              v-if="isUpdate && data.accountId"
             />
             <el-select
               clearable
@@ -119,7 +128,8 @@
                 v-for="item in accountList"
                 :key="item.id"
                 :label="item.loginName"
-                :value="item.id">
+                :value="item.id"
+              >
               </el-option>
             </el-select>
           </el-form-item>
@@ -157,7 +167,6 @@
               placeholder="请输入岗位名称"
             />
           </el-form-item>
-
         </el-col>
       </el-row>
     </el-form>
@@ -176,9 +185,13 @@
   import RoleSelect from '@/views/system/user/components/role-select.vue';
   import RegionsSelect from '@/components/RegionsSelect/index.vue';
   import { getNotBoundAccount } from '@/api/system/user';
-  import { getUserDetail , saveOrUpdateUser , checkExistence } from '@/api/system/organization'
+  import {
+    getUserDetail,
+    saveOrUpdateUser,
+    checkExistence
+  } from '@/api/system/organization';
   export default {
-    components: { OrgSelect, RoleSelect , RegionsSelect },
+    components: { OrgSelect, RoleSelect, RegionsSelect },
     props: {
       // 弹窗是否打开
       visible: Boolean,
@@ -187,7 +200,7 @@
       // 全部机构
       organizationList: Array,
       // 机构id
-      organizationId: [Number,String]
+      organizationId: [Number, String]
     },
     data() {
       const defaultForm = {
@@ -197,8 +210,8 @@
         sex: null,
         email: '',
         phone: '',
-        age:'',
-        accountId:''
+        age: '',
+        accountId: ''
       };
       return {
         defaultForm,
@@ -206,10 +219,14 @@
         form: { ...defaultForm },
         // 表单验证规则
         rules: {
-          name: [{ required: true, message: '请输入姓名',trigger: 'blur'}],
-          sex: [{required: true, message: '请选择性别',trigger: 'blur'}],
-          email: [ { pattern: emailReg,message: '邮箱格式不正确',trigger: 'blur'}],
-          phone: [ { pattern: phoneReg,message: '手机号格式不正确',trigger: 'blur'}],
+          name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
+          sex: [{ required: true, message: '请选择性别', trigger: 'blur' }],
+          email: [
+            { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
+          ],
+          phone: [
+            { pattern: phoneReg, message: '手机号格式不正确', trigger: 'blur' }
+          ],
           jobNumber: [
             {
               required: true,
@@ -219,10 +236,10 @@
                   return callback(new Error('请输入工号'));
                 }
                 checkExistence(this.form.jobNumber)
-                  .then(res => {
-                    if(res!=true&&res!=this.form.id){
+                  .then((res) => {
+                    if (res != true && res != this.form.id) {
                       callback(new Error('工号已经存在'));
-                    }else{
+                    } else {
                       callback();
                     }
                   })
@@ -232,22 +249,24 @@
               }
             }
           ],
-          status:[{ required: true, message: '请选择员工状态',trigger: 'blur'}]
+          status: [
+            { required: true, message: '请选择员工状态', trigger: 'blur' }
+          ]
         },
         // 提交状态
         loading: false,
         // 是否是修改
         isUpdate: false,
         city: '',
-        statusOptions:[
-          {value:1,label:'全职'},
-          {value:2,label:'兼职'},
-          {value:3,label:'实习'},
-          {value:4,label:'正式'},
-          {value:5,label:'试用'},
-          {value:6,label:'离职'}
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
         ],
-        accountList:[]
+        accountList: []
       };
     },
     computed: {
@@ -257,10 +276,10 @@
       }
     },
     methods: {
-      getAccountList(){
-        getNotBoundAccount().then(res=>{
-            this.accountList = res
-        })
+      getAccountList() {
+        getNotBoundAccount().then((res) => {
+          this.accountList = res;
+        });
       },
       /* 保存编辑 */
       save() {
@@ -269,20 +288,22 @@
             return false;
           }
           this.loading = true;
-          this.form.addressId = this.city?this.city[this.city.length-1]:''
+          this.form.addressId = this.city
+            ? this.city[this.city.length - 1]
+            : '';
           const data = {
-            ...this.form,
+            ...this.form
           };
-          if(!this.isUpdate){
-            delete data.id
+          if (!this.isUpdate) {
+            delete data.id;
           }
           saveOrUpdateUser(data)
             .then((msg) => {
               this.loading = false;
-              if(this.isUpdate){
-                 this.$message.success('人员信息编辑成功');
-              }else{
-                 this.$message.success('人员新增成功');
+              if (this.isUpdate) {
+                this.$message.success('人员信息编辑成功');
+              } else {
+                this.$message.success('人员新增成功');
               }
               this.updateVisible(false);
               this.$emit('done');
@@ -301,28 +322,28 @@
     watch: {
       visible(visible) {
         if (visible) {
-          this.getAccountList()
+          this.getAccountList();
           if (this.data) {
-            getUserDetail(this.data.id).then(res=>{
-               this.form = {...res}
-               this.city = res.addressId?res.addressId.toString():null
-               this.isUpdate = true;
-            })
+            getUserDetail(this.data.id).then((res) => {
+              this.form = { ...res };
+              this.city = res.addressId ? res.addressId.toString() : null;
+              this.isUpdate = true;
+            });
             // this.$util.assignObject(this.form, {
             //   ...this.data,
             //   password: ''
             // });
             // this.form = {...this.data}
             // this.form.address = ["130000","130300","130304"]
-             // this.form.address = "130304"
+            // this.form.address = "130304"
             // console.log('this.form',this.form)
           } else {
-            this.city = null
+            this.city = null;
             this.form.groupId = this.organizationId;
             this.isUpdate = false;
           }
         } else {
-          this.city = null
+          this.city = null;
           this.$refs.form.clearValidate();
           this.form = { ...this.defaultForm };
         }

+ 35 - 30
src/views/system/organization/components/org-user-list.vue

@@ -37,7 +37,7 @@
         </el-tag>
       </template>
       <!-- 状态列 -->
-<!--      <template v-slot:status="{ row }">
+      <!--      <template v-slot:status="{ row }">
         <el-switch
           :active-value="0"
           :inactive-value="1"
@@ -91,13 +91,17 @@
 <script>
   import OrgUserSearch from './org-user-search.vue';
   import OrgUserEdit from './org-user-edit.vue';
-  import { getUserPage , removePersonnel , unbindLoginName } from '@/api/system/organization';
+  import {
+    getUserPage,
+    removePersonnel,
+    unbindLoginName
+  } from '@/api/system/organization';
 
   export default {
     components: { OrgUserSearch, OrgUserEdit },
     props: {
       // 机构id
-      organizationId: [Number,String],
+      organizationId: [Number, String],
       // 全部机构
       organizationList: Array
     },
@@ -141,7 +145,7 @@
             showOverflowTooltip: true,
             minWidth: 80,
             formatter: (_row, _column, cellValue) => {
-              return cellValue==1?'男':(cellValue==2?'女':'');
+              return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
             }
           },
           {
@@ -151,10 +155,10 @@
             sortable: 'custom',
             width: 80,
             formatter: (_row, _column, cellValue) => {
-               	const dom = this.statusOptions.find(item => {
-               		return item.value == cellValue
-               	})
-                return dom?dom.label:'';
+              const dom = this.statusOptions.find((item) => {
+                return item.value == cellValue;
+              });
+              return dom ? dom.label : '';
             }
           },
           {
@@ -181,14 +185,14 @@
         current: null,
         // 是否显示编辑弹窗
         showEdit: false,
-        statusOptions:[
-          {value:1,label:'全职'},
-          {value:2,label:'兼职'},
-          {value:3,label:'实习'},
-          {value:4,label:'正式'},
-          {value:5,label:'试用'},
-          {value:6,label:'离职'}
-        ],
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ]
       };
     },
     methods: {
@@ -197,8 +201,8 @@
         return getUserPage({
           ...where,
           ...order,
-          pageNum:page,
-          size:limit,
+          pageNum: page,
+          size: limit,
           groupId: this.organizationId
         });
       },
@@ -213,17 +217,18 @@
       },
 
       // 解除绑定
-      toUnBind(row){
+      toUnBind(row) {
         const loading = this.$loading({ lock: true });
-        unbindLoginName(row.id).then(res=>{
-           loading.close();
-           this.$message.success('解绑成功');
-           this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
-        });
+        unbindLoginName(row.id)
+          .then((res) => {
+            loading.close();
+            this.$message.success('解绑成功');
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
       },
       /* 删除 */
       remove(row) {
@@ -236,7 +241,7 @@
           })
           .catch((e) => {
             loading.close();
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 更改状态 */
@@ -250,7 +255,7 @@
           .catch((e) => {
             loading.close();
             row.status = !row.status ? 1 : 0;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       }
     },

+ 2 - 2
src/views/system/role/components/role-auth.vue

@@ -98,7 +98,7 @@
           })
           .catch((e) => {
             this.authLoading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 保存权限分配 */
@@ -120,7 +120,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
       },
       /* 更新visible */

+ 3 - 3
src/views/system/role/components/role-edit.vue

@@ -21,7 +21,7 @@
           clearable
           :maxlength="20"
           v-model="form.groupId"
-          placeholder="请输入角色标识"
+          placeholder="请输入组织ID"
         />
       </el-form-item>
       <el-form-item label="启用状态:" prop="enable">
@@ -77,7 +77,7 @@
           groupId: [
             {
               required: true,
-              message: '请输入角色标识',
+              message: '请输入组织ID',
               trigger: 'blur'
             }
           ]
@@ -106,7 +106,7 @@
             })
             .catch((e) => {
               this.loading = false;
-              this.$message.error(e.message);
+              // this.$message.error(e.message);
             });
         });
       },

+ 157 - 157
src/views/system/role/index.vue

@@ -83,173 +83,173 @@
 </template>
 
 <script>
-import RoleSearch from './components/role-search.vue';
-import RoleEdit from './components/role-edit.vue';
-import RoleAuth from './components/role-auth.vue';
-import {
-  pageRoles,
-  removeRole,
-  removeRoles,
-  putRoles
-} from '@/api/system/role';
+  import RoleSearch from './components/role-search.vue';
+  import RoleEdit from './components/role-edit.vue';
+  import RoleAuth from './components/role-auth.vue';
+  import {
+    pageRoles,
+    removeRole,
+    removeRoles,
+    putRoles
+  } from '@/api/system/role';
 
-export default {
-  name: 'SystemRole',
-  components: {
-    RoleSearch,
-    RoleEdit,
-    RoleAuth
-  },
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'selection',
-          type: 'selection',
-          width: 45,
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          columnKey: 'index',
-          label: '#',
-          type: 'index',
-          width: 45,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'name',
-          label: '角色名称',
-          align: 'center',
+  export default {
+    name: 'SystemRole',
+    components: {
+      RoleSearch,
+      RoleEdit,
+      RoleAuth
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '角色名称',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'groupId',
-          label: '组织ID',
-          align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'groupId',
+            label: '组织ID',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'enable',
-          label: '启用状态',
-          align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'enable',
+            label: '启用状态',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          slot: 'enable',
+            showOverflowTooltip: true,
+            slot: 'enable',
 
-          minWidth: 110
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
 
-          showOverflowTooltip: true,
-          minWidth: 110,
-          formatter: (_row, _column, cellValue) => {
-            return this.$util.toDateString(cellValue);
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 230,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 表格选中数据
-      selection: [],
-      // 当前编辑数据
-      current: null,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      // 是否显示导入弹窗
-      showAuth: false
-    };
-  },
-  created() {},
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      console.log(where);
-      return pageRoles({ pageNum: page, size: limit, ...where });
-    },
-    async changeEnable(row) {
-      const res = await putRoles(row);
-      if (res.code == 0) {
-        this.$message({
-          type: 'success',
-          message: '修改成功',
-          customClass: 'ele-message-border'
-        });
-        this.reload();
-      }
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
-    },
-    /* 显示编辑 */
-    openEdit(row) {
-      this.current = row;
-      this.showEdit = true;
+        ],
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        // 是否显示导入弹窗
+        showAuth: false
+      };
     },
-    /* 显示分配权限 */
-    openAuth(row) {
-      this.current = row;
-      this.showAuth = true;
-    },
-    /* 删除 */
-    remove(row) {
-      const loading = this.$loading({ lock: true });
-      removeRole(row.id)
-        .then((msg) => {
-          loading.close();
-          this.$message.success(msg);
+    created() {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        console.log(where);
+        return pageRoles({ pageNum: page, size: limit, ...where });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
           this.reload();
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      /* 显示编辑 */
+      openEdit(row) {
+        this.current = row;
+        this.showEdit = true;
+      },
+      /* 显示分配权限 */
+      openAuth(row) {
+        this.current = row;
+        this.showAuth = true;
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+        removeRole(row.id)
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            this.$message.error(e.message);
+          });
+      },
+      /* 批量删除 */
+      removeBatch() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        this.$confirm('确定要删除选中的角色吗?', '提示', {
+          type: 'warning'
         })
-        .catch((e) => {
-          loading.close();
-          this.$message.error(e.message);
-        });
-    },
-    /* 批量删除 */
-    removeBatch() {
-      if (!this.selection.length) {
-        this.$message.error('请至少选择一条数据');
-        return;
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            removeRole(
+              this.selection.map((d) => d.id),
+              true
+            )
+              .then((msg) => {
+                loading.close();
+                this.$message.success(msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
       }
-      this.$confirm('确定要删除选中的角色吗?', '提示', {
-        type: 'warning'
-      })
-        .then(() => {
-          const loading = this.$loading({ lock: true });
-          removeRole(
-            this.selection.map((d) => d.id),
-            true
-          )
-            .then((msg) => {
-              loading.close();
-              this.$message.success(msg);
-              this.reload();
-            })
-            .catch((e) => {
-              loading.close();
-              this.$message.error(e.message);
-            });
-        })
-        .catch(() => {});
     }
-  }
-};
+  };
 </script>

+ 1 - 1
src/views/system/user/components/role-select.vue

@@ -38,7 +38,7 @@
     created() {
       /* 获取角色数据 */
       getlistRole()
-        .then(res => {
+        .then((res) => {
           this.data = res;
         })
         .catch((e) => {

+ 28 - 17
src/views/system/user/components/user-edit.vue

@@ -38,16 +38,16 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-           <el-form-item label="启用状态:" prop="enable">
-             <el-switch
-               v-model="form.enable"
-               active-color="#13ce66"
-               inactive-color="#ff4949"
-               :active-value="1"
-               :inactive-value="0"
-             >
-             </el-switch>
-           </el-form-item>
+          <el-form-item label="启用状态:" prop="enable">
+            <el-switch
+              v-model="form.enable"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              :active-value="1"
+              :inactive-value="0"
+            >
+            </el-switch>
+          </el-form-item>
         </el-col>
       </el-row>
     </el-form>
@@ -79,7 +79,7 @@
         loginName: '',
         roleId: [],
         loginPwd: '',
-        enable:1
+        enable: 1
       };
       return {
         defaultForm,
@@ -87,9 +87,20 @@
         form: { ...defaultForm },
         // 表单验证规则
         rules: {
-          loginName: [{required: true, message: '请输入用户账号',trigger: 'blur'}],
-          roleId: [{required: true, message: '请选择角色',trigger: 'change'}],
-          loginPwd: [{required: true, pattern: /^[\S]{5,18}$/,message: '密码必须为5-18位非空白字符',trigger: 'blur'}]
+          loginName: [
+            { required: true, message: '请输入用户账号', trigger: 'blur' }
+          ],
+          roleId: [
+            { required: true, message: '请选择角色', trigger: 'change' }
+          ],
+          loginPwd: [
+            {
+              required: true,
+              pattern: /^[\S]{5,18}$/,
+              message: '密码必须为5-18位非空白字符',
+              trigger: 'blur'
+            }
+          ]
         },
         // 提交状态
         loading: false,
@@ -111,11 +122,11 @@
             return false;
           }
           this.loading = true;
-          if(!this.isUpdate){
-            delete this.form.id
+          if (!this.isUpdate) {
+            delete this.form.id;
           }
           const data = {
-            ...this.form,
+            ...this.form
             // roleId: this.form.roleIds.map((d) => {
             //   return { roleId: d };
             // })

+ 1 - 1
src/views/system/user/components/user-import.vue

@@ -77,7 +77,7 @@
           })
           .catch((e) => {
             this.loading = false;
-            this.$message.error(e.message);
+            // this.$message.error(e.message);
           });
         return false;
       },

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

@@ -31,7 +31,7 @@
           >
             删除
           </el-button>
-<!--          <el-button
+          <!--          <el-button
             size="small"
             icon="el-icon-upload2"
             class="ele-btn-icon"
@@ -127,7 +127,7 @@
       UserEdit,
       UserImport
     },
-    data () {
+    data() {
       return {
         // 表格列配置
         columns: [
@@ -145,7 +145,7 @@
             align: 'center',
             showOverflowTooltip: true,
             fixed: 'left',
-            label: '序号',
+            label: '序号'
           },
           {
             prop: 'loginName',
@@ -203,10 +203,10 @@
     },
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
+      datasource({ page, limit, where, order }) {
         return pageUsers({ ...where, ...order, pageNum: page, size: limit });
       },
-      async changeEnable (row) {
+      async changeEnable(row) {
         let params = { ...row };
         params.roleId = row.roleList.map((d) => d.id);
         delete params.roleList;
@@ -221,21 +221,21 @@
         }
       },
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit (row) {
+      openEdit(row) {
         this.current = row;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form && this.$refs.userEdit.$refs.form.clearValidate();
       },
       /* 打开导入弹窗 */
-      openImport () {
+      openImport() {
         this.showImport = true;
       },
       /* 删除 */
-      remove (row) {
+      remove(row) {
         const loading = this.$loading({ lock: true });
         deleteUsers([row.id])
           .then((msg) => {
@@ -249,7 +249,7 @@
           });
       },
       /* 批量删除 */
-      removeBatch () {
+      removeBatch() {
         if (!this.selection.length) {
           this.$message.error('请至少选择一条数据');
           return;
@@ -273,7 +273,7 @@
           .catch(() => {});
       },
       /* 重置用户密码 */
-      resetPsw (row) {
+      resetPsw(row) {
         this.$confirm('确定要重置此用户的密码为"123456"吗?', '提示', {
           type: 'warning'
         })
@@ -292,7 +292,7 @@
           .catch(() => {});
       },
       /* 更改状态 */
-      editStatus (row) {
+      editStatus(row) {
         const loading = this.$loading({ lock: true });
         updateUserStatus(row.userId, row.status)
           .then((msg) => {

+ 1 - 1
src/views/user/message/index.vue

@@ -112,7 +112,7 @@
         //     this.unReadTodo = result.todo;
         //   })
         //   .catch((e) => {
-        //     this.$message.error(e.message);
+        //     // this.$message.error(e.message);
         //   });
         const result = await getUnReadNum();
         console.log(result);

+ 33 - 2
vue.config.js

@@ -1,5 +1,10 @@
 const CompressionWebpackPlugin = require('compression-webpack-plugin');
 const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
+const path = require('path');
+
+function resolve(dir) {
+  return path.join(__dirname, dir);
+}
 
 module.exports = {
   lintOnSave: false,
@@ -17,9 +22,9 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:86', // 测试
         // 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', // 何江鹏
-        // target: 'http://192.168.3.33:8080', // 谢一平
+        target: 'http://192.168.3.33:8080', // 谢一平
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
@@ -30,6 +35,32 @@ module.exports = {
   },
   chainWebpack (config) {
     config.plugins.delete('prefetch');
+    // set svg-sprite-loader
+    // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();
+    // config.module
+    //   .rule('icons')
+    //   .test(/\.svg$/)
+    //   .include.add(resolve('./src/icons'))
+    //   .end()
+    //   .use('svg-sprite-loader')
+    //   .loader('svg-sprite-loader')
+    //   .options({
+    //     symbolId: 'icon-[name]'
+    //   })
+    //   .end();
+    config.module.rule('svg').exclude.add(resolve('src/icons')).end();
+    config.module
+      .rule('icons')
+      .test(/\.svg$/)
+      .include.add(resolve('src/icons'))
+      .end()
+      .use('svg-sprite-loader')
+      .loader('svg-sprite-loader')
+      .options({
+        symbolId: 'icon-[name]'
+      })
+      .end();
+
     if (process.env.NODE_ENV !== 'development') {
       // gzip 压缩
       config.plugin('compressionPlugin').use(

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor