Selaa lähdekoodia

4.0.76 修改新版curd

liuyanpeng 1 vuosi sitten
vanhempi
sitoutus
1721207ff7

+ 2 - 2
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.75",
+  "version": "4.0.76",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",
@@ -18,7 +18,7 @@
     "click-outside-vue3": "^4.0.1",
     "dayjs": "^1.11.6",
     "dingtalk-jsapi": "^2.10.3",
-    "pc-component-v3": "1.0.86",
+    "pc-component-v3": "1.0.87-test",
     "uuid": "^8.3.2",
     "v-tooltip": "^4.0.0-beta.17",
     "vue-request": "^1.2.4",

+ 29 - 0
src/api/dic/CurdWindowResourceV2.js

@@ -31,6 +31,35 @@ export default {
 				
 				
 				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+
+  // 根据WindowNo获取 curd 版本号
+  uniqueByNoVersionNumber: function(curdWindowNo){
+    var requestUrl = 'CurdWindowResource/uniqueByNoVersionNumber';
+    var paramCount = 0;
+    if(curdWindowNo != null){
+      requestUrl += (paramCount > 0) ? '&' : '?';
+      requestUrl += ('no=' + curdWindowNo);
+      paramCount ++;
+    }
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'get',
+        contentType: 'application/json',
+				
         beforeSend: function(request) {
           Common.addTokenToRequest(request);
         },

+ 17 - 3
src/client/MenuNode.vue

@@ -138,11 +138,25 @@ export default {
           _self.model.curdWindowNo,
         ).then(successData => {
           if(successData.errorCode === 0){
-            _self.$router.push(
-              '/desktop/window/' +
+            CurdWindowResourceV2.uniqueByNoVersionNumber(
+              _self.model.curdWindowNo,
+            ).then(successData => {
+              if(successData === -1){
+                _self.$router.push(
+                  '/desktop/window/' +
                 _self.model.curdWindowNo +
                   '?uuid=' + Uuid.createUUID(),
-            );
+                );
+              }else{
+                _self.$router.push(
+                  '/desktop/window1/' +
+                _self.model.curdWindowNo +
+                  '?uuid=' + Uuid.createUUID(),
+                );
+              }
+            },errorData => {
+              Common.processException(errorData);
+            });
           }else{
             Notify.error(_self.$t('lang.Notify.errorOpeningCURDWindow'), successData.errorMessage, false);
           }

+ 20 - 0
src/resource/dictionary/WindowServerUtil.js

@@ -24,6 +24,26 @@ export default {
       },
     });
   },
+  // 根据windowId获取windowDto
+  uniqueByNoWithRoleNew: function (windowNo, success, error) {
+    $.ajax({
+      url: Common.getApiURL('CurdWindowResource/uniqueByNoWithRoleNew'),
+      type: 'get',
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      data: {
+        no: windowNo,
+      },
+      success: success,
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        if (error != undefined) {
+          error();
+        }
+        Common.processException(XMLHttpRequest, textStatus, errorThrown);
+      },
+    });
+  },
 
   // 查询页签数据
   queryTabData: function (tabQueryParam, success, error) {

+ 390 - 0
src/window1/tabGridView/NewTabButton.vue

@@ -0,0 +1,390 @@
+<template>
+  <div class="button_list">
+    <div v-if="leftTabButton.length === 0" />
+    <a-breadcrumb v-if="leftTabButton && leftTabButton.length" separator="|">
+      <a-breadcrumb-item v-for="(item, index) in leftTabButton" :key="index">
+        <PlusSquareTwoTone v-if="item.action === 'CREATE'" />
+        <EditTwoTone v-if="item.action === 'EDIT'" />
+        <DeleteTwoTone v-if="item.action === 'DELETE'" />
+        <ControlTwoTone v-if="item.action === 'RUN_PROCESS_REPORT'" />
+        <BookTwoTone v-if="item.action === 'OPEN_CUSTOMER_WINDOW'" />
+        <ContainerTwoTone v-if="item.action === 'OPEN_HTML_WINDOW'" />
+        <FileTextTwoTone v-if="item.action === 'EXPORT'" />
+        <BellTwoTone v-if="item.action === 'NOTICE'" />
+
+        <span v-if="item.action === 'CREATE'" @click="create">{{
+          item.name
+        }}</span>
+        <span v-else-if="item.action === 'DELETE'" @click="deleteData">{{
+          item.name
+        }}</span>
+        <span v-else-if="item.action === 'EXPORT'" @click="exportConfirm">{{
+          item.name
+        }}</span>
+        <span v-else>{{ item.name }}</span>
+      </a-breadcrumb-item>
+
+      <!-- <a-breadcrumb-item>
+        <GridColumnDef
+          :window-no="windowNo"
+          :tab-index="tabIndex"
+          :tab-grid-fields="tabGridFields"
+          @property-changed="propertyChanged($event)"
+        />
+      </a-breadcrumb-item> -->
+    </a-breadcrumb>
+    <a-breadcrumb separator="|">
+      <a-breadcrumb-item v-for="(item, index) in rightTabButton" :key="index">
+        <PlusSquareTwoTone v-if="item.action === 'CREATE'" />
+        <EditTwoTone v-if="item.action === 'EDIT'" />
+        <DeleteTwoTone v-if="item.action === 'DELETE'" />
+        <ControlTwoTone v-if="item.action === 'RUN_PROCESS_REPORT'" />
+        <BookTwoTone v-if="item.action === 'OPEN_CUSTOMER_WINDOW'" />
+        <ContainerTwoTone v-if="item.action === 'OPEN_HTML_WINDOW'" />
+        <FileTextTwoTone v-if="item.action === 'EXPORT'" />
+        <BellTwoTone v-if="item.action === 'NOTICE'" />
+        <span v-if="item.action === 'CREATE'" @click="create">{{
+          item.name
+        }}</span>
+        <span v-else-if="item.action === 'DELETE'" @click="deleteData">{{
+          item.name
+        }}</span>
+        <span v-else-if="item.action === 'EXPORT'" @click="exportConfirm">{{
+          item.name
+        }}</span>
+        <span
+          v-else-if="item.action === 'NOTICE'"
+          @click="notificationModal = true"
+        >{{ item.name }}</span>
+        <span v-else>{{ item.name }}</span>
+      </a-breadcrumb-item>
+    </a-breadcrumb>
+  </div>
+
+  <Modal
+    v-model:show="notificationModal"
+    :show-canel-button="false"
+    :show-ok-button="false"
+  >
+    <template #header>
+      {{ $t("lang.tabButton.sendNotice") }}
+    </template>
+    <NotificationPanel ref="notificationPanel" />
+    <template #footer>
+      <button type="button" class="btn btn-default" @click="sendNotification">
+        {{ $t("lang.tabButton.send") }}
+      </button>
+      <button type="button" class="btn btn-default" @click="cancelNotification">
+        {{ $t("lang.tabButton.cancel") }}
+      </button>
+    </template>
+  </Modal>
+</template>
+
+<script setup>
+import { ref, defineProps, defineEmits, watch, getCurrentInstance } from 'vue';
+import Common from '../../common/Common';
+import DownloadService from '../../resource/file/DownloadService.js';
+import NotificationPanel from '../../customer/NotificationPanel.vue';
+
+import dayjs from 'dayjs';
+import GridColumnDefUtil from '../tabGridView/GridColumnDef.js';
+import GridColumnDef from '../tabGridView/GridColumnDef.vue';
+import {
+  PlusSquareTwoTone,
+  DeleteTwoTone,
+  EditTwoTone,
+  BookTwoTone,
+  BellTwoTone,
+  FileTextTwoTone,
+  ContainerTwoTone,
+  ControlTwoTone,
+} from '@ant-design/icons-vue';
+const props = defineProps({
+  window: {
+    type: Object,
+    default: () => ({}),
+  },
+  nowTab: {
+    type: String,
+    default: '',
+  },
+  curdWindowFunctionAccess: {
+    type: Object,
+    default: function () {
+      return null;
+    },
+  },
+  modelDatas: {
+    type: Object,
+    default: function () {
+      return null;
+    },
+  },
+  showTabDto: {
+    type: Object,
+    default: function () {
+      return null;
+    },
+  },
+  simpleFilterParams: {
+    type: String,
+    default: null,
+  },
+  complexFilterParams: {
+    type: Array,
+    default: () => {
+      return [];
+    },
+  },
+  viewType: {
+    type: String,
+    default: null,
+  },
+});
+
+const emit = defineEmits(['createRecordInWindowEdit', 'deleteRecords']);
+
+const tabButtons = ref([]);
+const leftTabButton = ref([]);
+const rightTabButton = ref([]);
+const notificationModal = ref(false);
+const notificationPanel = ref(null);
+const { proxy } = getCurrentInstance(); //访问this
+// 新建数据
+const create = () => {
+  emit('createRecordInWindowEdit');
+};
+// 删除数据
+const deleteData = () => {
+  emit('deleteRecords');
+};
+
+/**
+ * 导出确认
+ */
+const exportConfirm = () => {
+  if (
+    props.curdWindowFunctionAccess.canExport != null &&
+    props.curdWindowFunctionAccess.canExport === true
+  ) {
+    BootstrapDialog.show({
+      title: proxy.$t('lang.TabButton.dataExport'), //title
+      message: proxy.$t('lang.TabButton.DataExport'),
+      buttons: [
+        {
+          label: proxy.$t('lang.TabButton.exportMasterTableData'),
+          action: function (dialog) {
+            exportData(false);
+            dialog.close();
+          },
+        },
+        {
+          label: proxy.$t('lang.TabButton.exportAllData'),
+          action: function (dialog) {
+            exportData(true);
+            dialog.close();
+          },
+        },
+        {
+          label: proxy.$t('lang.TabButton.cancel'),
+          action: function (dialog) {
+            dialog.close();
+          },
+        },
+      ],
+    });
+  } else {
+    Notify.error(
+      proxy.$t('lang.tabButton.describe4'),
+      proxy.$t('lang.tabButton.describe5'),
+      false,
+    );
+  }
+};
+const exportData = exportSubTabData => {
+  var token = localStorage.getItem('#token');
+  var windowNo = props.window.no;
+  var recordId = null;
+  if (props.modelDatas != undefined) {
+    recordId = props.modelDatas.id;
+  }
+
+  var obj = {
+    windowNo: windowNo,
+    tabIndex: props.showTabDto.tabIndex,
+    recordId: recordId,
+    token: token,
+    simpleFilterCondition: props.simpleFilterParams,
+    filterParams: props.complexFilterParams,
+  };
+
+  let url = null;
+  if (recordId == null) {
+    url = Common.getApiURL('exportResource/exportWindowData');
+  } else {
+    url = Common.getApiURL('exportResource/exportSingleWindowData');
+  }
+  url += '?exportSubTabData=' + exportSubTabData;
+
+  let formParameterName = 'exportQueryParamStr';
+  let formParameterValue = JSON.stringify(obj);
+
+  var data = formParameterName + '=' + formParameterValue;
+  var timeStr = dayjs().format('_YYYYMMDD_hhmmss');
+
+  var fileName =
+    props.showTabDto == null
+      ? '导出数据' + timeStr + '.xlsx'
+      : props.showTabDto.name + timeStr + '.xlsx';
+  DownloadService.postDownloadFile(url, data, fileName);
+};
+
+// 发送通知
+const sendNotification = () => {
+  var notification = notificationPanel.value.getNotification();
+  var recordIds = [];
+  if (props.viewType == 'Grid') {
+    if (props.modelDatas && props.modelDatas.length > 0) {
+      props.modelDatas.forEach(function (item) {
+        if (item.select) {
+          recordIds.push(item.id);
+        }
+      });
+    }
+  }
+  if (recordIds.length == 0) {
+    Notify.error(
+      proxy.$t('lang.Notify.error'),
+      proxy.$t('lang.tabButton.describe7'),
+      true,
+    );
+    return;
+  }
+  if (notification.userIds == null || notification.userIds.length == 0) {
+    Notify.error(
+      proxy.$t('lang.Notify.error'),
+      proxy.$t('lang.tabButton.describe8'),
+      true,
+    );
+    return;
+  }
+  if (notification.theme == null || notification.theme.trim() == '') {
+    Notify.error(
+      proxy.$t('lang.Notify.error'),
+      proxy.$t('lang.tabButton.describe9'),
+      true,
+    );
+    return;
+  }
+  if (notification.content == null || notification.content.trim() == '') {
+    Notify.error(
+      proxy.$t('lang.Notify.error'),
+      proxy.$t('lang.tabButton.describe10'),
+      true,
+    );
+    return;
+  }
+  var windowNo = props.window.no;
+  var tabIndex = props.showTabDto.tabIndex;
+  notification.windowNo = windowNo;
+  notification.tabIndex = tabIndex;
+  notification.recordIds = recordIds;
+  notification.className = props.showTabDto.className;
+
+  $.ajax({
+    url: Common.getApiURL('notificationResource/send'),
+    type: 'post',
+    beforeSend: function (request) {
+      Common.addTokenToRequest(request);
+    },
+    contentType: 'application/json',
+    data: JSON.stringify(notification),
+    success: function (data) {
+      notificationModal.value = false;
+      Notify.success(
+        proxy.$t('lang.tabButton.describe11'),
+        proxy.$t('lang.tabButton.describe12'),
+        true,
+      );
+    },
+    error: function (XMLHttpRequest, textStatus, errorThrown) {
+      Common.processException(XMLHttpRequest, textStatus, errorThrown);
+    },
+  });
+};
+// 取消发送
+const cancelNotification = () => {
+  notificationModal.value = false;
+};
+
+// 获取表头按钮分组值,如果没有分组则使用页签按钮
+watch(
+  () => props.window,
+  newVal => {
+    if (newVal.tabs && newVal.tabs.length) {
+      const mapTabButtonDtos = JSON.parse(
+        JSON.stringify(newVal.tabs[0].tabGridView.mapTabButtonDtos),
+      );
+      if (isEmpty(mapTabButtonDtos)) {
+        tabButtons.value = newVal.tabs[0].tabGridView.tabButtons;
+        tabButtonsHandler();
+      } else {
+        tabButtons.value = newVal.tabs[0].tabGridView.mapTabButtonDtos;
+      }
+    }
+  },
+  { deep: true, immediate: true },
+);
+watch(
+  () => props.nowTab,
+  (newVal, oldVal) => {
+    if (newVal !== oldVal) {
+      let nowTabButtons;
+      if (tabButtons.value) {
+        for (let key in tabButtons.value) {
+          if (key === newVal) {
+            nowTabButtons = tabButtons.value[key];
+            tabButtonsHandler(nowTabButtons);
+          }
+        }
+      }
+    }
+  },
+  { deep: true, immediate: true },
+);
+const tabButtonsHandler = nowTabButtons => {
+  let buttons;
+  if (nowTabButtons) {
+    buttons = JSON.parse(JSON.stringify(nowTabButtons));
+  } else {
+    buttons = JSON.parse(JSON.stringify(tabButtons.value));
+  }
+  rightTabButton.value = [];
+  leftTabButton.value = [];
+  buttons.forEach(item => {
+    if (item.buttonLocation === 'TABLE_HEADER_RIGHT') {
+      rightTabButton.value.push(item);
+    } else {
+      leftTabButton.value.push(item);
+    }
+  });
+};
+// 用来判断分组的表头按钮是否有值
+const isEmpty = obj => {
+  if (typeof obj !== 'object' || obj === null) {
+    return true;
+  }
+  if (Object.keys(obj).length === 0) {
+    return true;
+  }
+};
+</script>
+
+<style scoped>
+.button_list {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+</style>

+ 50 - 228
src/window1/tabGridView/TabGridEdit.vue

@@ -6,8 +6,13 @@
       :title="Language.getNameTrl($i18n.locale, window)"
       :is-go-back="false"
     />
-    <WindowTab @get-now-tab="getNowTab" />
-
+    <WindowTab
+      v-if="
+        tab && tab.tabDataSource && tab.tabDataSource.tabDataSourceGroupDtos
+      "
+      :tab-props="tab.tabDataSource.tabDataSourceGroupDtos"
+      @get-now-tab="getNowTab"
+    />
     <div
       class="grid-container"
       :style="{
@@ -76,188 +81,21 @@
       </div>
 
       <div class="grid-item-row2">
-        <div class="button_list">
-          <a-breadcrumb v-if="nowTab === 'waiting'" separator="|">
-            <a-breadcrumb-item
-              v-if="isShowCreateRecordButton"
-              @click="createAsset"
-            >
-              <plus-circle-two-tone />
-              <span>{{ $t("lang.tabGridEdit.create") }}</span>
-            </a-breadcrumb-item>
-            <a-breadcrumb-item
-              v-if="isShowNewPageCreateRecordButton"
-              @click="createRecordInWindowEdit"
-            >
-              <plus-square-two-tone />
-              <span>
-                {{ $t("lang.tabGridEdit.createInNewPage") }}
-              </span>
-            </a-breadcrumb-item>
-            <a-breadcrumb-item
-              v-if="isShowDeleteButton"
-              @click="deleteRecords(true)"
-            >
-              <delete-two-tone />
-              <span type="text">
-                {{ $t("lang.tabGridEdit.remove") }}
-              </span>
-            </a-breadcrumb-item>
-            <a-breadcrumb-item v-if="dataChanged" @click="saveAllTabData">
-              <save-two-tone />
-              <span>
-                {{ $t("lang.tabGridEdit.save") }}
-              </span>
-            </a-breadcrumb-item>
-
-            <a-breadcrumb-item
-              v-if="isShowEditAllButton"
-              @click="editAllTabData"
-            >
-              <edit-two-tone />
-              <span type="text">
-                {{ $t("lang.tabGridEdit.editAll") }}
-              </span>
-            </a-breadcrumb-item>
-
-            <a-breadcrumb-item @click="queryGridData(false)">
-              <wallet-two-tone />
-              <span>
-                {{
-                  dataChanged
-                    ? $t("lang.tabGridEdit.revert")
-                    : $t("lang.tabGridEdit.refresh")
-                }}
-              </span>
-            </a-breadcrumb-item>
-            <a-breadcrumb-item>
-              <GridColumnDef
-                :window-no="windowNo"
-                :tab-index="tabIndex"
-                :tab-grid-fields="tabGridFields"
-                @property-changed="propertyChanged($event)"
-              />
-            </a-breadcrumb-item>
-            <a-breadcrumb-item>
-              <idcard-two-tone />
-              <span> 添加验收人 </span>
-            </a-breadcrumb-item>
-          </a-breadcrumb>
-          <a-breadcrumb v-if="nowTab === 'running'" separator="|">
-            <a-breadcrumb-item>
-              <check-square-two-tone />
-              <span>验收通过</span>
-            </a-breadcrumb-item>
-            <a-breadcrumb-item>
-              <close-circle-two-tone two-tone-color="#ff4548" />
-              <span>取消验收</span>
-            </a-breadcrumb-item>
-          </a-breadcrumb>
-          <a-breadcrumb v-if="nowTab === 'finish'" separator="|" />
-          <TabButton
-            :window="window"
-            :simple-filter-params="searchText"
-            :complex-filter-params="complexFilterParams"
-            :uuid="uuid"
-            :show-tab-dto="tab"
-            :model-datas="modelDatas"
-            :view-type="'Grid'"
-            :tab-buttons="tab.tabGridView ? tab.tabGridView.tabButtons : null"
-            :curd-window-function-access="curdWindowFunctionAccess"
-            @save-view="backupView"
-            @process-execute-finish="queryGridData(true)"
-          />
-        </div>
+        <NewTabButton
+          :window="window"
+          :now-tab="nowTab"
+          :simple-filter-params="searchText"
+          :complex-filter-params="complexFilterParams"
+          :uuid="uuid"
+          :show-tab-dto="tab"
+          :model-datas="modelDatas"
+          :view-type="'Grid'"
+          :curd-window-function-access="curdWindowFunctionAccess"
+          @create-record-in-window-edit="createRecordInWindowEdit"
+          @delete-records="deleteRecords"
+        />
       </div>
 
-      <!-- <div class="grid-item-row2">
-        <div>
-          <div>
-            <div class="btn-group" role="group">
-              <button
-                v-if="isShowCreateRecordButton"
-                type="button"
-                class="btn btn-primary"
-                @click="createRecord"
-              >
-                {{ $t("lang.tabGridEdit.create") }}
-              </button>
-              <button
-                v-if="isShowNewPageCreateRecordButton"
-                type="button"
-                class="btn btn-primary"
-                @click="createRecordInWindowEdit"
-              >
-                {{ $t("lang.tabGridEdit.createInNewPage") }}
-              </button>
-              <button
-                v-if="dataChanged"
-                type="button"
-                class="btn btn-success"
-                @click="saveAllTabData"
-              >
-                {{ $t("lang.tabGridEdit.save") }}
-              </button>
-              <button
-                type="button"
-                class="btn btn-info"
-                @click="queryGridData(false)"
-              >
-                {{
-                  dataChanged
-                    ? $t("lang.tabGridEdit.revert")
-                    : $t("lang.tabGridEdit.refresh")
-                }}
-              </button>
-              <button
-                v-if="isShowEditAllButton"
-                type="button"
-                class="btn btn-primary"
-                @click="editAllTabData"
-              >
-                {{ $t("lang.tabGridEdit.editAll") }}
-              </button>
-              <button
-                v-if="isShowDeleteButton"
-                type="button"
-                class="btn btn-danger"
-                @click="deleteRecords(true)"
-              >
-                {{ $t("lang.tabGridEdit.remove") }}
-              </button>
-              <TabButton
-                :window="window"
-                :simple-filter-params="searchText"
-                :complex-filter-params="complexFilterParams"
-                :uuid="uuid"
-                :show-tab-dto="tab"
-                :model-datas="modelDatas"
-                :view-type="'Grid'"
-                :tab-buttons="
-                  tab.tabGridView ? tab.tabGridView.tabButtons : null
-                "
-                :curd-window-function-access="curdWindowFunctionAccess"
-                @save-view="backupView"
-                @process-execute-finish="queryGridData(true)"
-              />
-              <GridColumnDef
-                :window-no="windowNo"
-                :tab-index="tabIndex"
-                :tab-grid-fields="tabGridFields"
-                @property-changed="propertyChanged($event)"
-              />
-              <button
-                v-if="window.htmlHelpUrl != null && window.htmlHelpUrl != ''"
-                class="btn btn-default"
-                @click="openHtmlHelp(window.htmlHelpUrl)"
-              >
-                <span class="glyphicon glyphicon-question-sign" />
-              </button>
-            </div>
-          </div>
-        </div>
-      </div> -->
-
       <div class="grid-item-row3-column1 tableFixHead">
         <!-- eslint-disable-next-line -->
         <div v-html="headerHtml" />
@@ -344,40 +182,6 @@
           @complex-search="advancedSearchOk"
         />
       </a-drawer>
-
-      <!-- eslint-disable-next-line -->
-      <!-- <div class="grid-item-row4">
-        <div v-html="footerHtml" />
-
-        <div v-if="tab != null && tab.tabGridView != null">
-          <div>
-            <div class="pull-left">
-              <span>
-                {{
-                  $t("lang.tabGridEdit.pageInfo", {
-                    start:
-                      (pagination.current_page - 1) * pagination.per_page + 1,
-                    end: pagination.current_page * pagination.per_page,
-                    total: pagination.total,
-                  })
-                }}
-              </span>
-              {{ $t("lang.tabGridEdit.pageSize") }}
-              <PageSizeSelect
-                :size="pagination.per_page"
-                @page-size-changed="gridSizeSelect"
-              />
-            </div>
-
-            <div class="pull-right">
-              <VueBootstrapPagination
-                :pagination="pagination"
-                :callback="checkDataChangedQueryGridData"
-              />
-            </div>
-          </div>
-        </div>
-      </div> -->
     </div>
     <Modal v-model:show="modal1">
       <template #header>
@@ -417,8 +221,6 @@ import SimpleFilterPanel from '../filter/SimpleFilterPanel.vue';
 import ComplexFilterPanel from '../filter/ComplexFilterPanel.vue';
 import TabButton from '../tabView/TabButton.vue';
 
-import GridColumnDef from '../tabGridView/GridColumnDef.vue';
-
 import AuthImage from '../../widget/AuthImage.vue';
 import DataRecoveryResource from '../../api/base/DataRecoveryResource.js';
 import CurdWindowResourceV2 from '../../api/dic/CurdWindowResourceV2.js';
@@ -426,6 +228,7 @@ import JsUtil from '../../common/JsUtil.js';
 import { Notify, Uuid } from 'pc-component-v3';
 import WindowTab from './WindowTab.vue';
 import AddAssets from './AddAssets.vue';
+import NewTabButton from './NewTabButton.vue';
 
 import { message } from 'ant-design-vue';
 import {
@@ -448,7 +251,7 @@ export default {
     TabButton,
     GridHeader,
     GridBody,
-    GridColumnDef,
+    NewTabButton,
     ComplexFilterPanel,
     WindowTab,
     PlusCircleTwoTone,
@@ -477,9 +280,9 @@ export default {
       window: {},
       tabIndex: null,
       step: '0',
-      nowTab: 'waiting', // 当前是哪个阶段
+      nowTab: null, // 当前是哪个阶段
       nowAsset: '', // 所选资产分类名称
-      selectCategory:null, //所选资产分类数据
+      selectCategory: null, //所选资产分类数据
       tab: {},
       tabGridFields: [],
       modelDatas: [],
@@ -767,10 +570,12 @@ export default {
   methods: {
     getContext: Context,
 
-    // 获取当前tab为待验收还是验收中、验收完成
+    // 获取当前tab为哪个阶段
     getNowTab: function (tab) {
       this.nowTab = tab;
       console.log(this.nowTab);
+      this.pagination.current_page = 1;
+      this.queryGridData(true);
     },
 
     // 页数改变
@@ -797,7 +602,7 @@ export default {
     },
 
     // 获取新增步骤信息
-    getStepInfo: function (step, selected,record) {
+    getStepInfo: function (step, selected, record) {
       this.step = step;
       this.nowAsset = selected;
       this.selectCategory = record;
@@ -810,11 +615,11 @@ export default {
     },
     // 确认创建资产
     confirmCreate: function () {
-      if(!this.selectCategory){
+      if (!this.selectCategory) {
         message.warning('请您先选择资产分类!');
         return;
       }
-      if(this.selectCategory.children && this.selectCategory.children.length){
+      if (this.selectCategory.children && this.selectCategory.children.length) {
         message.warning('请您选择最后一级的资产分类!');
         return;
       }
@@ -884,7 +689,7 @@ export default {
     loadWindow: function () {
       var _self = this;
       if (_self.windowNo) {
-        WindowServerUtil.getWindowById(_self.windowNo, function (data) {
+        WindowServerUtil.uniqueByNoWithRoleNew(_self.windowNo, function (data) {
           WindowClientUtil.parseFilterSchema(data);
           _self.initWindow(data);
         });
@@ -954,7 +759,14 @@ export default {
         this.tabIndex,
         this.tabGridFields,
       );
-
+      if (
+        _self.tab.tabDataSource.tabDataSourceGroupDtos &&
+        _self.tab.tabDataSource.tabDataSourceGroupDtos.length
+      ) {
+        _self.nowTab =
+          _self.tab.tabDataSource.tabDataSourceGroupDtos[0].groupName;
+      }
+      console.log(_self.nowTab, '_self.nowTab=======================');
       _self.$nextTick(function () {
         // 设置复杂查询条件
         if (
@@ -1027,7 +839,16 @@ export default {
       } else {
         simpleFilterCondition = _self.searchText;
       }
-
+      let groupNameOne;
+      if (
+        _self.tab.tabDataSource.tabDataSourceGroupDtos &&
+        _self.tab.tabDataSource.tabDataSourceGroupDtos.length
+      ) {
+        groupNameOne =
+          _self.tab.tabDataSource.tabDataSourceGroupDtos[0].groupName;
+      } else {
+        groupNameOne = null;
+      }
       var tabQueryParam = {
         range: {
           start:
@@ -1039,6 +860,7 @@ export default {
         filterParams: filterParams,
         simpleFilterCondition: simpleFilterCondition,
         sortStr: _self.sortStr,
+        groupName: _self.nowTab ? _self.nowTab : groupNameOne,
       };
 
       _self.dataChanged = false;

+ 20 - 36
src/window1/tabGridView/WindowTab.vue

@@ -1,28 +1,14 @@
 <template>
   <ul class="nav nav-tabs m-row">
     <li
+      v-for="(item, index) in tabProps"
+      :key="index"
       role="presentation"
-      :class="{ active: currentTab === 'waiting' }"
-      @click="isWaiting"
+      :class="{ active: currentTabIndex === index }"
+      @click="changeTab(index,item)"
     >
-      <a>待验收</a>
-      <span :class="{ jt: true, active: currentTab === 'waiting' }" />
-    </li>
-    <li
-      role="presentation"
-      :class="{ active: currentTab === 'running' }"
-      @click="isRunning"
-    >
-      <a>验收中</a>
-      <span :class="{ jt: true, active: currentTab === 'running' }" />
-    </li>
-    <li
-      role="presentation"
-      :class="{ active: currentTab === 'finish' }"
-      @click="isFinish"
-    >
-      <a>验收完成</a>
-      <span :class="{ jt: true, active: currentTab === 'finish' }" />
+      <a>{{ item.groupName }}</a>
+      <span :class="{ jt: true, active: currentTabIndex === index }" />
     </li>
     <li class="help-box">
       <span>使用帮助</span>
@@ -31,26 +17,24 @@
 </template>
 
 <script setup>
-import { ref, defineEmits } from 'vue';
+import { ref, defineEmits, defineProps, watch } from 'vue';
+
+const props = defineProps({
+  tabProps: {
+    type: Array,
+    default: () => [],
+  },
+});
 
 const emits = defineEmits(['getNowTab']);
 
-const currentTab = ref('waiting');
-// 待验收
-const isWaiting = () => {
-  currentTab.value = 'waiting';
-  emits('getNowTab', 'waiting');
-};
-// 验收中
-const isRunning = () => {
-  currentTab.value = 'running';
-  emits('getNowTab', 'running');
-};
-// 验收完成
-const isFinish = () => {
-  currentTab.value = 'finish';
-  emits('getNowTab', 'finish');
+const currentTabIndex = ref(0);
+
+const changeTab = (index,record) => {
+  currentTabIndex.value = index;
+  emits('getNowTab', record.groupName);
 };
+
 </script>
 
 <style scoped>