Browse Source

Merge branch 'master' of https://a.leanwo.com:3000/prodog-client-2023/client-base-v4

YangZhiJie 2 years ago
parent
commit
0c489d50b2

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
 {
   "name": "client-base-v4",
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.47",
+  "version": "4.0.50",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 0 - 2
src/client/Login.vue

@@ -314,8 +314,6 @@ export default {
             if (success.datas !== null && success.datas !== undefined) {
             if (success.datas !== null && success.datas !== undefined) {
               this.authSetting = success.datas;
               this.authSetting = success.datas;
             }
             }
-          } else {
-            message.warning(success.errorMessage);
           }
           }
         },
         },
         error => {
         error => {

+ 17 - 1
src/common/pushMessage.js

@@ -35,7 +35,7 @@ export default {
         notification.close(_self.notificationId);
         notification.close(_self.notificationId);
         _self.openNotification(item);
         _self.openNotification(item);
         _self.isShowNotification(item);
         _self.isShowNotification(item);
-        if (!window.opener && window.opener !== window && allowSound == 'true') {
+        if (_self.JudgmentDomain() && allowSound === 'true') {
           _self.playSound(true);
           _self.playSound(true);
         }
         }
         _self.allMessage.splice(index, 1);
         _self.allMessage.splice(index, 1);
@@ -45,6 +45,22 @@ export default {
       }
       }
     }, 5000);
     }, 5000);
   },
   },
+
+  // 判断域名是否相同如果不同才播放声音
+  JudgmentDomain: function () {
+    const prevUrl = localStorage.getItem('#prevUrl');
+    if (prevUrl) {
+      const currentUrl = window.location.hostname;
+      if (prevUrl === currentUrl) {
+        return false;
+      } else {
+        return true;
+      }
+    } else {
+      return true;
+    }
+  },
+
   // 播放声音
   // 播放声音
   playSound: async function (isPlay) {
   playSound: async function (isPlay) {
     const _self = this;
     const _self = this;

+ 101 - 58
src/customer/DataImportPanel.vue

@@ -2,7 +2,7 @@
   <div class="container-fluid">
   <div class="container-fluid">
     <Navbar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" />
     <Navbar :title="$t('lang.DataImportPanel.DataImport')" :is-go-back="true" />
 
 
-    <div style="margin-top: 2rem">
+    <div style="margin-top: 1.2rem">
       <a-steps :current="current">
       <a-steps :current="current">
         <a-step
         <a-step
           v-for="item in steps"
           v-for="item in steps"
@@ -111,11 +111,19 @@
                 >
                 >
                   {{ $t("lang.DataImportPanel.testImport") }}
                   {{ $t("lang.DataImportPanel.testImport") }}
                 </button>
                 </button>
+                <button
+                  v-if="isError"
+                  type="button"
+                  class="btn btn-primary btn-primary-1 btn-primary-import"
+                  @click="exportErrorExcel"
+                >
+                  导出Excel
+                </button>
                 <button
                 <button
                   v-if="testSuccess"
                   v-if="testSuccess"
                   type="button"
                   type="button"
                   class="btn btn-primary btn-primary-1 btn-primary-import"
                   class="btn btn-primary btn-primary-1 btn-primary-import"
-                  @click="runProcessImport(selectedDataTemplateNo)"
+                  @click="runProcessImport"
                 >
                 >
                   {{ $t("lang.DataImportPanel.formalImport") }}
                   {{ $t("lang.DataImportPanel.formalImport") }}
                 </button>
                 </button>
@@ -138,37 +146,34 @@
             </div>
             </div>
           </div>
           </div>
 
 
-          <div class="row">
+          <div v-if="selectedDataTemplate.description != null" class="row">
             <div>
             <div>
-              <div
-                v-if="selectedDataTemplate != null"
-                style="white-space: pre-wrap"
-              >
+              <div style="white-space: pre-wrap">
                 {{ selectedDataTemplate.description }}
                 {{ selectedDataTemplate.description }}
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
 
 
-          <a-table
+          <CommonTable
             v-if="current === 2"
             v-if="current === 2"
-            bordered
-            sticky
             :columns="columns"
             :columns="columns"
             :data-source="dataSource"
             :data-source="dataSource"
-            :scroll="{ x: 2200 }"
+            :extra-height="66"
           >
           >
-            <a-table-column type="index" />
             <template #bodyCell="{ column, record }">
             <template #bodyCell="{ column, record }">
               <template v-if="column.key === 'ImportResult'">
               <template v-if="column.key === 'ImportResult'">
                 {{ record.ImportResult }}
                 {{ record.ImportResult }}
               </template>
               </template>
             </template>
             </template>
-          </a-table>
+          </CommonTable>
           <Loading v-if="loading" />
           <Loading v-if="loading" />
         </div>
         </div>
       </div>
       </div>
       <div class="steps-action">
       <div class="steps-action">
-        <a-button v-if="current > 0" class="prevBtn" @click="prev">
+        <a-button v-if="current === 1" class="prevBtn" @click="prev">
+          上一步
+        </a-button>
+        <a-button v-if="current === 2" class="prevFixed" @click="prev">
           上一步
           上一步
         </a-button>
         </a-button>
         <a-button
         <a-button
@@ -186,7 +191,7 @@
 
 
 <script>
 <script>
 import Common from '../common/Common.js';
 import Common from '../common/Common.js';
-
+import CommonTable from '../common/CommonTable.vue';
 import DownloadService from '../resource/file/DownloadService.js';
 import DownloadService from '../resource/file/DownloadService.js';
 import WorkflowResource from '../api/workflow/WorkflowResource.js';
 import WorkflowResource from '../api/workflow/WorkflowResource.js';
 import { Notify, Uuid, Navbar } from 'pc-component-v3';
 import { Notify, Uuid, Navbar } from 'pc-component-v3';
@@ -206,6 +211,7 @@ export default {
     LoadingOutlined,
     LoadingOutlined,
     SmileOutlined,
     SmileOutlined,
     Navbar,
     Navbar,
+    CommonTable,
   },
   },
 
 
   data: function () {
   data: function () {
@@ -232,7 +238,7 @@ export default {
       sheetItems: [],
       sheetItems: [],
       importFields: [],
       importFields: [],
       importTable: {},
       importTable: {},
-      selectedIndex: -1,
+      selectedIndex: 0,
       dataTemplateNos: [],
       dataTemplateNos: [],
       loading: false,
       loading: false,
       selectedFile: null,
       selectedFile: null,
@@ -244,6 +250,8 @@ export default {
       lineCount: null, // 导入行数
       lineCount: null, // 导入行数
       columnCount: null, // 导入列数
       columnCount: null, // 导入列数
       testSuccess: false, // 测试导入是否成功
       testSuccess: false, // 测试导入是否成功
+      isError: false,
+      batchNo: null, //批次号
     };
     };
   },
   },
 
 
@@ -280,6 +288,7 @@ export default {
     },
     },
     prev() {
     prev() {
       this.current--;
       this.current--;
+      this.isError = false;
     },
     },
 
 
     /**
     /**
@@ -471,7 +480,7 @@ export default {
 
 
       for (var i = 0, len = data.length; i < len; i++) {
       for (var i = 0, len = data.length; i < len; i++) {
         _self.sheetItems.push(data[i]);
         _self.sheetItems.push(data[i]);
-        _self.selectedIndex = i - 1;
+        // _self.selectedIndex = i - 1;
       }
       }
     },
     },
 
 
@@ -524,17 +533,35 @@ export default {
         item.title = item.displayName;
         item.title = item.displayName;
         item.dataIndex = item.fieldName;
         item.dataIndex = item.fieldName;
         item.key = item.fieldName;
         item.key = item.fieldName;
-        item.width = 100;
+        item.width = 120;
       });
       });
-      _self.columns = columns;
-      _self.columns.push({
+      columns.push({
         title: _self.$t('lang.DataImportPanel.processingResults'),
         title: _self.$t('lang.DataImportPanel.processingResults'),
         dataIndex: 'ImportResult',
         dataIndex: 'ImportResult',
         key: 'ImportResult',
         key: 'ImportResult',
-        width: 100,
+        width: 150,
         fixed: 'right',
         fixed: 'right',
+        filters: [
+          {
+            text: '成功',
+            value: '成功',
+          },
+          {
+            text: '失败',
+            value: '失败',
+          },
+        ],
+        filterMultiple: false,
+        onFilter: (value, record) => record.ImportResult.indexOf(value) === 0,
         // scopedSlots: { customRender: 'ImportResult' },
         // scopedSlots: { customRender: 'ImportResult' },
       });
       });
+      _self.columns = columns.map(item => ({
+        ...item,
+        resizable: true,
+        mainWidth: 75,
+        maxWidth: 400,
+        ellipsis: true,
+      }));
     },
     },
 
 
     /**
     /**
@@ -588,6 +615,7 @@ export default {
       }
       }
 
 
       var importTableData = {
       var importTableData = {
+        no: _self.selectedDataTemplateNo,
         isForamlImport: isformalImport,
         isForamlImport: isformalImport,
         sheetIndex: sheetIndex,
         sheetIndex: sheetIndex,
         importTable: _self.importTable,
         importTable: _self.importTable,
@@ -612,33 +640,19 @@ export default {
           _self.showTestImportTable(data.dataList);
           _self.showTestImportTable(data.dataList);
           _self.uploadClassFile();
           _self.uploadClassFile();
           if (data.isSuccess) {
           if (data.isSuccess) {
-            if (isformalImport) {
-              Notify.info(
-                _self.$t('lang.Notify.success'),
-                _self.$t('lang.DataImportPanel.describe5'),
-                false,
-              );
-            } else {
-              Notify.info(
-                _self.$t('lang.Notify.success'),
-                _self.$t('lang.DataImportPanel.describe6'),
-                false,
-              );
-            }
+            _self.batchNo = data.batchNo;
+            Notify.info(
+              _self.$t('lang.Notify.success'),
+              _self.$t('lang.DataImportPanel.describe5'),
+              false,
+            );
           } else {
           } else {
-            if (isformalImport) {
-              Notify.error(
-                _self.$t('lang.Notify.fail'),
-                _self.$t('lang.DataImportPanel.describe7'),
-                false,
-              );
-            } else {
-              Notify.error(
-                _self.$t('lang.Notify.fail'),
-                _self.$t('lang.DataImportPanel.describe8'),
-                false,
-              );
-            }
+            Notify.error(
+              _self.$t('lang.Notify.fail'),
+              _self.$t('lang.DataImportPanel.describe7') +
+                `导入成功${data.successCount}条,导入失败${data.errorCount}条。`,
+              false,
+            );
           }
           }
         },
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
         error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -648,6 +662,32 @@ export default {
       });
       });
     },
     },
 
 
+    // 导出表格数据
+    exportErrorExcel: function () {
+      const _self = this;
+      const url = Common.getApiURL('dataImportResource/downloadTemplateExcel');
+      const xhr = new XMLHttpRequest();
+      xhr.open('get', url, true);
+      xhr.setRequestHeader('token', localStorage.getItem('#token'));
+      xhr.setRequestHeader('Content-type', 'application/json');
+      xhr.responseType = 'blob';
+      xhr.onreadystatechange = function () {
+        if (xhr.readyState === 4 && xhr.status === 200) {
+          let res = xhr.response;
+          let blob = new Blob([res]);
+          const blobUrl = URL.createObjectURL(blob);
+          const link = document.createElement('a');
+          link.download = `${_self.selectedDataTemplate.dataTemplateName}.xlsx`;
+          link.style.display = 'none';
+          link.href = blobUrl;
+          document.body.appendChild(link);
+          link.click();
+          URL.revokeObjectURL(blobUrl);
+          document.body.removeChild(link);
+        }
+      };
+      xhr.send();
+    },
     /**
     /**
      * 测试导入之后将文件上传到服务端并保存
      * 测试导入之后将文件上传到服务端并保存
      */
      */
@@ -688,24 +728,26 @@ export default {
       }
       }
 
 
       _self.dataSource = [];
       _self.dataSource = [];
-
       data.forEach(function (item) {
       data.forEach(function (item) {
         _self.dataSource.push(item.data);
         _self.dataSource.push(item.data);
       });
       });
+      // message
       const flag = _self.dataSource.every(item => {
       const flag = _self.dataSource.every(item => {
         return item.ImportResult === '成功';
         return item.ImportResult === '成功';
       });
       });
       if (flag) {
       if (flag) {
         this.testSuccess = true;
         this.testSuccess = true;
+        this.isError = false;
       } else {
       } else {
         this.testSuccess = false;
         this.testSuccess = false;
+        this.isError = true;
       }
       }
     },
     },
 
 
     /**
     /**
      * 点击正式导入、清空临时表按钮
      * 点击正式导入、清空临时表按钮
      */
      */
-    runProcessImport: function (selectedDataTemplateNo) {
+    runProcessImport: function () {
       var _self = this;
       var _self = this;
       if (_self.lineCount <= 0) {
       if (_self.lineCount <= 0) {
         message.warning('请输入正确的导入行数!');
         message.warning('请输入正确的导入行数!');
@@ -715,15 +757,10 @@ export default {
         message.warning('请输入正确的导入列数!');
         message.warning('请输入正确的导入列数!');
         return;
         return;
       }
       }
-      var no = selectedDataTemplateNo;
-      const lineCount = _self.lineCount;
-      const columnCount = _self.columnCount;
+      const no = _self.batchNo;
       _self.loading = true;
       _self.loading = true;
       $.ajax({
       $.ajax({
-        url:
-          Common.getApiURL('dataImportResource/formalDataImportByIds/') +
-          no +
-          `?lineCount=${lineCount}&columnCount=${columnCount}`,
+        url: Common.getApiURL('dataImportResource/formalDataImportByIds/') + no,
         type: 'post',
         type: 'post',
         dataType: 'json',
         dataType: 'json',
         beforeSend: function (request) {
         beforeSend: function (request) {
@@ -854,7 +891,10 @@ export default {
   position: absolute;
   position: absolute;
   right: 0px;
   right: 0px;
 }
 }
-
+.prevFixed {
+  position: fixed;
+  top: 92%;
+}
 .btn-primary-1 {
 .btn-primary-1 {
   color: #fff;
   color: #fff;
   background: #1890ff;
   background: #1890ff;
@@ -872,7 +912,10 @@ export default {
 .btn-primary-import {
 .btn-primary-import {
   margin-left: 5px;
   margin-left: 5px;
 }
 }
-:deep(.ant-table-sticky-scroll){
+:deep(.ant-table-sticky-scroll) {
   display: none !important;
   display: none !important;
 }
 }
+.ant-divider-horizontal {
+  margin: 12px 0 !important;
+}
 </style>
 </style>

+ 6 - 1
src/workflow/TaskProcessManagement.vue

@@ -77,8 +77,10 @@
                 <div class="col-sm-10">
                 <div class="col-sm-10">
                   <a-select
                   <a-select
                     v-model:value="taskDefineDto.processNo"
                     v-model:value="taskDefineDto.processNo"
-                    :options="processNos"
+                    show-search
                     style="width: 100%"
                     style="width: 100%"
+                    :options="processNos"
+                    :filter-option="filterOption"
                     @change="processNoChang"
                     @change="processNoChang"
                   />
                   />
                 </div>
                 </div>
@@ -1482,6 +1484,9 @@ export default {
         },
         },
       );
       );
     },
     },
+    filterOption:function (input, option) {
+      return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+    },
     // 深拷贝
     // 深拷贝
     deepClone: function (obj) {
     deepClone: function (obj) {
       const _self = this;
       const _self = this;