Ver código fonte

1.0.90 查询窗口执行流程的时候,根据数据字典的定义,确认是否弹出提示框。根据数据字典的定义,判断是否要提醒选择数据。

YangZhiJie 1 ano atrás
pai
commit
6dfa15f3d6
2 arquivos alterados com 97 adições e 108 exclusões
  1. 1 1
      package.json
  2. 96 107
      packages/info/src/QueryPage.vue

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "pc-component-v3",
   "name": "pc-component-v3",
-  "version": "1.0.89",
+  "version": "1.0.90",
   "description": "",
   "description": "",
   "main": "dist/pc-component-v3.js",
   "main": "dist/pc-component-v3.js",
   "scripts": {
   "scripts": {

+ 96 - 107
packages/info/src/QueryPage.vue

@@ -1,7 +1,6 @@
 <template>
 <template>
   <div
   <div
-    class="flex-container"
-    :class="{
+    class="flex-container" :class="{
       'flex-container-modal': isSearchWidget == true,
       'flex-container-modal': isSearchWidget == true,
       'flex-container': isSearchWidget == null || isSearchWidget == false,
       'flex-container': isSearchWidget == null || isSearchWidget == false,
     }"
     }"
@@ -13,36 +12,25 @@
             :html-help-url="infoWindowDto.htmlHelpUrl"
             :html-help-url="infoWindowDto.htmlHelpUrl"
             :info-grid-fields="infoGridFieldsInstance.infoGridFields"
             :info-grid-fields="infoGridFieldsInstance.infoGridFields"
             :header-name="Language.getNameTrl($i18n.locale, infoWindowDto)"
             :header-name="Language.getNameTrl($i18n.locale, infoWindowDto)"
-            :sub-header-name="Language.getHelpTrl($i18n.locale, infoWindowDto)"
-            :info-filter-fields="infoFilterFields"
-            :info-window-no="infoWindowDto.no"
-            @filter-field-property-changed="filterFieldPropertyChanged($event)"
+            :sub-header-name="Language.getHelpTrl($i18n.locale, infoWindowDto)" :info-filter-fields="infoFilterFields"
+            :info-window-no="infoWindowDto.no" @filter-field-property-changed="filterFieldPropertyChanged($event)"
             @grid-field-property-changed="gridFieldPropertyChanged($event)"
             @grid-field-property-changed="gridFieldPropertyChanged($event)"
           />
           />
         </div>
         </div>
         <div>
         <div>
           <a-flex justify="space-between" align="center">
           <a-flex justify="space-between" align="center">
             <QueryCondition
             <QueryCondition
-              ref="queryCondition"
-              :info-filter-fields="infoFilterFields"
-              :info-buttons="infoWindowDto.infoButtons"
-              :is-search-widget="isSearchWidget"
-              :info-window-no="infoWindowDto.no"
-              :search-condition-instance="searchConditionInstance"
-              @simple-search="simpleSearch"
-              @complex-search="complexSearch"
+              ref="queryCondition" :info-filter-fields="infoFilterFields"
+              :info-buttons="infoWindowDto.infoButtons" :is-search-widget="isSearchWidget"
+              :info-window-no="infoWindowDto.no" :search-condition-instance="searchConditionInstance"
+              @simple-search="simpleSearch" @complex-search="complexSearch"
             />
             />
 
 
             <div>
             <div>
               <a-pagination
               <a-pagination
-                v-model:current="pagination.current_page"
-                v-model:pageSize="pagination.per_page"
-                show-quick-jumper
-                size="small"
-                :total="pagination.total"
-                :page-size-options="pageSizeOptions"
-                @change="handlePageChange"
-                @show-size-change="handleShowSizeChange"
+                v-model:current="pagination.current_page" v-model:pageSize="pagination.per_page"
+                show-quick-jumper size="small" :total="pagination.total" :page-size-options="pageSizeOptions"
+                @change="handlePageChange" @show-size-change="handleShowSizeChange"
               />
               />
             </div>
             </div>
           </a-flex>
           </a-flex>
@@ -66,22 +54,16 @@
       </a-space>
       </a-space>
 
 
       <div v-if="!isSearchWidget" style="display: inline-block">
       <div v-if="!isSearchWidget" style="display: inline-block">
-        <template
-          v-for="infoButton in infoWindowDto.infoButtons"
-          :key="infoButton.name"
-        >
+        <template v-for="infoButton in infoWindowDto.infoButtons" :key="infoButton.name">
           <a-button
           <a-button
             v-if="infoButton.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'"
             v-if="infoButton.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'"
-            v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)"
-            type="link"
+            v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)" type="link"
             @click="openRemoteComponentModule(infoButton)"
             @click="openRemoteComponentModule(infoButton)"
           >
           >
             {{ Language.getNameTrl($i18n.locale, infoButton) }}
             {{ Language.getNameTrl($i18n.locale, infoButton) }}
           </a-button>
           </a-button>
           <a-button
           <a-button
-            v-else
-            v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)"
-            type="link"
+            v-else v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)" type="link"
             @click="executeProcess(infoButton)"
             @click="executeProcess(infoButton)"
           >
           >
             {{ Language.getNameTrl($i18n.locale, infoButton) }}
             {{ Language.getNameTrl($i18n.locale, infoButton) }}
@@ -89,27 +71,16 @@
         </template>
         </template>
       </div>
       </div>
 
 
-      <a-segmented
-        v-model:value="selectedView"
-        :options="views"
-        class="m-segmented"
-        size="small"
-      >
+      <a-segmented v-model:value="selectedView" :options="views" class="m-segmented" size="small">
         <template #label="{ value: val, payload = {} }">
         <template #label="{ value: val, payload = {} }">
           <div style="padding: 2px 2px">
           <div style="padding: 2px 2px">
             <a-tooltip :title="payload.name" placement="top">
             <a-tooltip :title="payload.name" placement="top">
               <a-avatar
               <a-avatar
-                :src="payload.src"
-                :style="payload.icon ? payload.style : null"
-                :alt="val"
-                size="small"
+                :src="payload.src" :style="payload.icon ? payload.style : null" :alt="val" size="small"
                 shape="square"
                 shape="square"
               >
               >
                 <template #icon>
                 <template #icon>
-                  <component
-                    :is="payload.icon"
-                    style="font-size: 22px; color: #1677ff; background: #f5f5f5"
-                  />
+                  <component :is="payload.icon" style="font-size: 22px; color: #1677ff; background: #f5f5f5" />
                 </template>
                 </template>
                 {{ payload.content }}
                 {{ payload.content }}
               </a-avatar>
               </a-avatar>
@@ -130,21 +101,14 @@
     />
     />
     <div class="flex-content">
     <div class="flex-content">
       <component
       <component
-        :is="selectedView"
-        v-if="
+        :is="selectedView" v-if="
           selectedView != null &&
           selectedView != null &&
             selectedView != '' &&
             selectedView != '' &&
             componentLoadedCount == views.length
             componentLoadedCount == views.length
-        "
-        :info-grid-fields-instance="infoGridFieldsInstance"
-        :sort-instance="sortInstance"
-        :info-window-data-instance="infoWindowDataInstance"
-        :pagination="pagination"
-        :multiple="multiple"
-        :call-out-js-url="infoWindowDto.callOutJsUrl"
-        @data-selected="$emit('dataSelected', $event)"
-        @info-selected="infoSelected"
-        @delete-selected="$emit('deleteSelected', $event)"
+        " :info-grid-fields-instance="infoGridFieldsInstance" :sort-instance="sortInstance"
+        :info-window-data-instance="infoWindowDataInstance" :pagination="pagination" :multiple="multiple"
+        :call-out-js-url="infoWindowDto.callOutJsUrl" @data-selected="$emit('dataSelected', $event)"
+        @info-selected="infoSelected" @delete-selected="$emit('deleteSelected', $event)"
       />
       />
     </div>
     </div>
     <div class="flex-footer" style="margin-top: 10px">
     <div class="flex-footer" style="margin-top: 10px">
@@ -169,26 +133,16 @@
       </div>
       </div>
     </div>
     </div>
     <Loading v-if="loading" />
     <Loading v-if="loading" />
-    <Modal v-model:show="modal">
-      <template #default>
-        <ProcessReportResult
-          :process-report-result="processReportResult"
-          :pdf-only="pdfOnly"
-          :excel-only="excelOnly"
-        />
-      </template>
-      <template #header>
-        <div>{{ $t("lang.QueryPage.resultsOfEnforcement") }}</div>
-      </template>
-    </Modal>
+    <a-modal v-model:open="modal" :title="$t('lang.QueryPage.resultsOfEnforcement')" @ok="modal = false">
+      <ProcessReportResult :process-report-result="processReportResult" :pdf-only="pdfOnly" :excel-only="excelOnly" />
+    </a-modal>
   </div>
   </div>
   <component :is="modal1Component" v-model:open="modal1Open" :model-data="selectInfoData" @refresh-data="pageSearch" />
   <component :is="modal1Component" v-model:open="modal1Open" :model-data="selectInfoData" @refresh-data="pageSearch" />
 </template>
 </template>
 
 
 <script>
 <script>
 import Common from '../../common/Common.js';
 import Common from '../../common/Common.js';
-import Modal from '../../modal/src/Modal.vue';
-import { defineAsyncComponent,reactive } from 'vue';
+import { defineAsyncComponent, reactive, createVNode } from 'vue';
 import PageSizeSelect from '../../page-size-select/src/PageSizeSelect.vue';
 import PageSizeSelect from '../../page-size-select/src/PageSizeSelect.vue';
 // import Pagination from '../../vue-bootstrap-pagination/src/vue-bootstrap-pagination.vue';
 // import Pagination from '../../vue-bootstrap-pagination/src/vue-bootstrap-pagination.vue';
 
 
@@ -214,6 +168,7 @@ import dayjs from 'dayjs';
 
 
 import QueryPageTable from './QueryPageTable.vue';
 import QueryPageTable from './QueryPageTable.vue';
 import QueryPageDashboard from './QueryPageDashboard.vue';
 import QueryPageDashboard from './QueryPageDashboard.vue';
+import { Modal } from 'ant-design-vue';
 
 
 import {
 import {
   useSort,
   useSort,
@@ -225,10 +180,12 @@ import {
   SyncOutlined,
   SyncOutlined,
   DownloadOutlined,
   DownloadOutlined,
   TableOutlined,
   TableOutlined,
+  ExclamationCircleOutlined,
 } from '@ant-design/icons-vue';
 } from '@ant-design/icons-vue';
 
 
 import CssUtil from '../../common/CssUtil.js';
 import CssUtil from '../../common/CssUtil.js';
 import { Spin as ASpin, Empty as AEmpty, message } from 'ant-design-vue';
 import { Spin as ASpin, Empty as AEmpty, message } from 'ant-design-vue';
+
 export default {
 export default {
   name: 'QueryPage',
   name: 'QueryPage',
 
 
@@ -244,6 +201,7 @@ export default {
     QueryPageDashboard,
     QueryPageDashboard,
     SyncOutlined,
     SyncOutlined,
     DownloadOutlined,
     DownloadOutlined,
+    ExclamationCircleOutlined,
   },
   },
 
 
   props: {
   props: {
@@ -327,7 +285,7 @@ export default {
       infoButtons: [],
       infoButtons: [],
       modal1Component: null,
       modal1Component: null,
       modal1Open: false,
       modal1Open: false,
-      selectInfoData:null,
+      selectInfoData: null,
       searchConditionInstance: useSearchCondition(),
       searchConditionInstance: useSearchCondition(),
       infoGridFieldsInstance: useInfoGridFields(),
       infoGridFieldsInstance: useInfoGridFields(),
       infoWindowDataInstance: useInfoWindowData(),
       infoWindowDataInstance: useInfoWindowData(),
@@ -378,7 +336,7 @@ export default {
     }
     }
   },
   },
 
 
-  mounted: function () {},
+  mounted: function () { },
 
 
   methods: {
   methods: {
     /**
     /**
@@ -779,41 +737,72 @@ export default {
       ) {
       ) {
         var processReportNo = infoButton.processReportNo;
         var processReportNo = infoButton.processReportNo;
         if (processReportNo != undefined && processReportNo != '') {
         if (processReportNo != undefined && processReportNo != '') {
+
+          const tipsTitle = infoButton.tipsTitle;
+          const tipsContent = infoButton.tipsContent;
+          const notNeedSelectData = infoButton.notNeedSelectData;
+
           var ids = _self.getSelectedRecordIds();
           var ids = _self.getSelectedRecordIds();
-          if (ids.length < 1) {
+          if (notNeedSelectData !== true && ids.length < 1) {
             Notify.error('错误', '未选择可操作的数据', true);
             Notify.error('错误', '未选择可操作的数据', true);
             return;
             return;
           }
           }
 
 
-          _self.loading = true;
-          ProcessReportResource.uniqueByNo(infoButton.processReportNo).then(
-            successData => {
-              _self.processReportDto = successData;
-              if (successData) {
-                _self.pdfOnly = successData.pdfOnly;
-                _self.excelOnly = successData.excelOnly;
-              }
-              ProcessReportResource.runProcessByIds(
-                infoButton.processReportNo,
-                ids,
-              ).then(
-                successData => {
-                  _self.modal = true;
-                  _self.loading = false;
-                  _self.processReportResult = successData;
-                  _self.$emit('processExecuteFinish');
-                },
-                errorData => {
-                  _self.loading = false;
-                  Common.processException(errorData);
-                },
-              );
-            },
-            errorData => {
-              _self.loading = false;
-              Common.processException(errorData);
-            },
-          );
+
+          const executeProcess = function(){
+            _self.loading = true;
+            ProcessReportResource.uniqueByNo(infoButton.processReportNo).then(
+              successData => {
+                _self.processReportDto = successData;
+                if (successData) {
+                  _self.pdfOnly = successData.pdfOnly;
+                  _self.excelOnly = successData.excelOnly;
+                }
+                ProcessReportResource.runProcessByIds(
+                  infoButton.processReportNo,
+                  ids,
+                ).then(
+                  successData => {
+                    _self.modal = true;
+                    _self.loading = false;
+                    _self.processReportResult = successData;
+                    _self.$emit('processExecuteFinish');
+                    // 流程执行完毕,调用刷新的按钮
+                    _self.pageSearch();
+                  },
+                  errorData => {
+                    _self.loading = false;
+                    Common.processException(errorData);
+                  },
+                );
+              },
+              errorData => {
+                _self.loading = false;
+                Common.processException(errorData);
+              },
+            );
+          };
+
+
+          
+          if (tipsTitle != null && tipsTitle.length > 0 && tipsContent != null && tipsContent.length > 0) {
+            Modal.confirm({
+              title: tipsTitle,
+              icon: createVNode(ExclamationCircleOutlined),
+              content: tipsContent,
+              okText: '确认',
+              cancelText: '取消',
+              onOk() {
+                executeProcess();
+              },
+              onCancel() {
+                console.log('Cancel');
+              },
+            });
+          }else{
+            executeProcess();
+          }
+          
         }
         }
       } else if (
       } else if (
         infoButton.curdWindowNo != null &&
         infoButton.curdWindowNo != null &&
@@ -1025,7 +1014,7 @@ export default {
     },
     },
 
 
     // 获取表格选择的数据
     // 获取表格选择的数据
-    infoSelected: function (selected){
+    infoSelected: function (selected) {
       this.selectInfoData = selected;
       this.selectInfoData = selected;
     },
     },
 
 
@@ -1054,7 +1043,7 @@ export default {
     openRemoteComponentModule: async function (tabButton) {
     openRemoteComponentModule: async function (tabButton) {
       const _self = this;
       const _self = this;
 
 
-      if(!_self.selectInfoData || _self.selectInfoData.length === 0){
+      if (!_self.selectInfoData || _self.selectInfoData.length === 0) {
         message.warning('请您至少选择一条数据。');
         message.warning('请您至少选择一条数据。');
         return;
         return;
       }
       }
@@ -1154,7 +1143,7 @@ export default {
 
 
 <style scoped>
 <style scoped>
 /** 修复分页的样式 By YangZhiJie 2021-07-06 11:23 */
 /** 修复分页的样式 By YangZhiJie 2021-07-06 11:23 */
-nav >>> ul.pagination {
+nav>>>ul.pagination {
   margin: 0 !important;
   margin: 0 !important;
 }
 }
 </style>
 </style>
@@ -1173,7 +1162,7 @@ nav >>> ul.pagination {
   margin-top: 4px;
   margin-top: 4px;
 }
 }
 
 
-.m-segmented >>> .ant-segmented-item {
+.m-segmented>>>.ant-segmented-item {
   margin-bottom: 0px;
   margin-bottom: 0px;
 }
 }
 </style>
 </style>