Ver Fonte

修改页签按钮的显示逻辑。

YangZhiJie há 1 ano atrás
pai
commit
8200268a3d

Diff do ficheiro suprimidas por serem muito extensas
+ 21 - 414
package-lock.json


+ 6 - 2
src/main.js

@@ -9,6 +9,8 @@ import { createApp, defineAsyncComponent } from 'vue';
 import Antd from 'ant-design-vue';
 // import 'ant-design-vue/dist/antd.css';
 import 'ant-design-vue/dist/reset.css';
+window.Antd = Antd;
+
 
 import './assets/common.css';
 import './assets/common1.css';
@@ -18,8 +20,10 @@ import { createRouter, createWebHashHistory } from 'vue-router';
 //import { createI18n } from 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js';
 //import { createI18n } from 'vue-i18n/dist/vue-i18n.runtime.esm-browser.js';
 
-import * as PcClientComponent from 'pc-component-v3';
+import * as PcComponentV3 from 'pc-component-v3';
 import 'pc-component-v3/dist/pc-component-v3.css';
+window.PcComponentV3 = PcComponentV3;
+
 
 import App from '../src/App.vue';
 
@@ -117,7 +121,7 @@ app.use(router);
 app.use(VTooltip);
 app.use(store);
 // PC Client 组件
-app.use(PcClientComponent);
+app.use(PcComponentV3);
 app.mount('#app');
 
 

+ 0 - 470
src/window1/tabGridView/AddAssets.vue

@@ -1,470 +0,0 @@
-<template>
-  <div v-if="step === '0'" class="select_asset">
-    <p>选择待验收资产类型</p>
-    <ul>
-      <li>
-        <img src="./commonAsset.gif" />
-        <a><span>新增同类型资产</span></a>
-      </li>
-      <li @click="addNewAssets">
-        <img src="./newAsset.gif" />
-        <a><span>新增资产</span></a>
-      </li>
-    </ul>
-  </div>
-  <div v-if="step === '1'">
-    <a-layout>
-      <a-layout-header :style="headerStyle">
-        <div class="tab_select">
-          <a-radio-group v-model:value="nowSelect">
-            <a-radio-button value="commonUse">
-              <StarTwoTone /> 常用资产分类
-            </a-radio-button>
-            <a-radio-button value="detail">
-              <WalletTwoTone /> 明细资产分类
-            </a-radio-button>
-          </a-radio-group>
-          <div style="display: flex; align-items: center">
-            <a-select
-              v-model:value="searchName"
-              show-search
-              :allow-clear="true"
-              :options="options"
-              placeholder="请选择分类"
-              style="width: 380px"
-            />
-            <span style="margin: 0 16px 0 8px">类目搜索</span>
-          </div>
-        </div>
-      </a-layout-header>
-      <a-layout style="height: 430px">
-        <a-layout-sider width="180px">
-          <div style="width: 180px">
-            <a-menu
-              v-if="nowSelect === 'commonUse'"
-              v-model:selectedKeys="selectedKeys"
-              mode="inline"
-              class="menu_style"
-              :items="assetItems"
-              @click="(record) => changeAssets(record.key)"
-            />
-
-            <a-menu
-              v-else
-              v-model:openKeys="openKeys"
-              v-model:selectedKeys="selectedKeys1"
-              mode="inline"
-              class="menu_style"
-              @click="(record) => changeDetailAsset(record.key)"
-            >
-              <SubMenu :menu-info="menuList" />
-            </a-menu>
-          </div>
-        </a-layout-sider>
-        <a-layout-content :style="contentStyle">
-          <div v-if="nowSelect === 'commonUse'" class="item-list">
-            <ul class="ul_list">
-              <template v-if="secondMenu && secondMenu.length > 0">
-                <li
-                  v-for="(item, index) in secondMenu"
-                  :key="index"
-                  class="list-item"
-                >
-                  <div class="left fl">
-                    <span class="parent_name">{{ item.parent }}</span>
-                    <span class="jt_icon"> > </span>
-                  </div>
-                  <div class="right fl">
-                    <ul>
-                      <template v-if="item.children && item.children.length">
-                        <li
-                          v-for="(asset, index1) in item.children"
-                          :key="index1"
-                          @click="selectAsset(asset)"
-                        >
-                          {{ asset.text }}
-                        </li>
-                      </template>
-                      <template v-else>
-                        <li><span>&nbsp;</span></li>
-                      </template>
-                    </ul>
-                  </div>
-                </li>
-              </template>
-            </ul>
-          </div>
-          <div v-else>
-            <AssetList :tree-data="list" @get-asset-name="getAssetName" />
-          </div>
-        </a-layout-content>
-      </a-layout>
-    </a-layout>
-  </div>
-</template>
-
-<script setup>
-import { ref, watch, defineProps, defineEmits } from 'vue';
-import Common from '../../common/Common';
-import { StarTwoTone, WalletTwoTone } from '@ant-design/icons-vue';
-import { message } from 'ant-design-vue';
-import SubMenu from './SubMenu.vue';
-import AssetList from './AssetList.vue';
-
-const list = ref([]);
-
-const openKeys = ref([]);
-const selectedKeys1 = ref([]);
-const menuList = ref([]);
-const searchName = ref([]);
-const options = ref([]);
-
-const emit = defineEmits(['getStepInfo', 'getAllName']);
-const props = defineProps({
-  step: {
-    type: String,
-    default: '0',
-  },
-});
-// 当前操作的步骤是选择还是添加
-const step = ref('0');
-
-// 是常用还是明细切换标识
-const nowSelect = ref('commonUse');
-
-// 展示的菜单
-const selectedKeys = ref([]);
-
-// 菜单一级目录
-const assetItems = ref([]);
-
-// 通用资产分类数据
-const assetCommonCategorys = ref([]);
-
-// 明细资产分类数据
-const assetDetailCategorys = ref([]);
-
-const secondMenu = ref([]);
-
-const isFirst = ref(true);
-
-// 所选资产分类名
-const assetName = ref('');
-const allName = ref('');
-
-// 传递当前进行到选择类别的步骤
-const addNewAssets = () => {
-  step.value = '1';
-  emit('getStepInfo', '1');
-  getCommonAssetCategorys();
-  getDetailAssetCategorys();
-};
-
-// 当通用资产切换类别时获取对应的子分类
-const changeAssets = key => {
-  secondMenu.value = [];
-  assetCommonCategorys.value.forEach(item => {
-    if (item.id === key) {
-      if (item.children && item.children.length > 0) {
-        item.children.forEach((child, index) => {
-          if (child.children && child.children.length > 0) {
-            secondMenu.value.push({ parent: child.text });
-            secondMenu.value[index].children = child.children;
-          } else {
-            secondMenu.value.push({ parent: child.text });
-          }
-        });
-      }
-    }
-  });
-  const parentDiv = document.querySelector('.item-list');
-  const childDiv = parentDiv.querySelector('.ul_list');
-  childDiv.scrollIntoView({ behavior: 'smooth', block: 'start' });
-};
-
-// 处理明细资产分类数据
-const getDetailData = datas => {
-  openKeys.value = [];
-  selectedKeys1.value = [];
-  const assetDatas = JSON.parse(JSON.stringify(datas));
-  assetDatas.forEach((item, index) => {
-    menuList.value[index] = {};
-    menuList.value[index].key = item.id;
-    menuList.value[index].name = item.text;
-    menuList.value[index].children = item.children;
-    if (item.children && item.children.length > 0) {
-      item.children.forEach(child => {
-        child.key = child.id;
-        child.name = child.text;
-        delete child.children;
-      });
-    }
-  });
-  //  默认展开选择第一个
-  openKeys.value.push(datas[0].id);
-  selectedKeys1.value.push(menuList.value[0].children[0].id);
-  changeDetailAsset(menuList.value[0].children[0].id);
-};
-
-// 当明细资产切换类别时获取对应的子分类
-const changeDetailAsset = key => {
-  let listMenu = [];
-  assetName.value = '';
-  allName.value = '';
-  assetDetailCategorys.value.forEach(item => {
-    if (item.children && item.children.length) {
-      item.children.forEach(child => {
-        if (child.id === key) {
-          assetName.value = child.text;
-          if (!isFirst.value) {
-            allName.value = child.text;
-          }
-          if (child.children && child.children.length) {
-            listMenu.push(child.children);
-          }
-        }
-      });
-    }
-  });
-  list.value = listMenu.flat();
-  emit('getStepInfo', step.value, allName.value);
-  isFirst.value = false;
-};
-
-// 获取通用所选资产
-const selectAsset = record => {
-  console.log(record, '通用资产所选数据------');
-  emit('getStepInfo', step.value, record.text, record);
-};
-
-// 获取明细所选资产
-const getAssetName = (name,record) => {
-  if (name) {
-    allName.value = '';
-    allName.value = assetName.value + '->' + name;
-  }
-  console.log(record, '明细资产所选数据------');
-  emit('getStepInfo', step.value, allName.value, record);
-};
-
-// 获取通用分类数据
-const getCommonAssetCategorys = () => {
-  $.ajax({
-    url: Common.getApiURL(
-      'AssetCategoryResource/listAssetCategorysByCategory?type=CommonlyUsedClassifications',
-    ),
-    type: 'get',
-
-    dataType: 'json',
-    beforeSend: function (request) {
-      Common.addTokenToRequest(request);
-    },
-    success: function (data) {
-      if (data.errorCode === 0 && data.datas.length > 0) {
-        assetItems.value = [];
-        selectedKeys.value = [];
-        data.datas.forEach((item, index) => {
-          assetItems.value[index] = {};
-          assetItems.value[index].key = item.id;
-          assetItems.value[index].label = item.text;
-          assetItems.value[index].title = item.text;
-        });
-        selectedKeys.value.push(data.datas[0].id);
-        assetCommonCategorys.value = data.datas;
-        changeAssets(data.datas[0].id);
-      } else {
-        message.warning(data.errorMessage);
-      }
-    },
-    error: function (XMLHttpRequest, textStatus, errorThrown) {
-      Common.processException(XMLHttpRequest, textStatus, errorThrown);
-    },
-  });
-};
-// 获取明细分类数据
-const getDetailAssetCategorys = () => {
-  $.ajax({
-    url: Common.getApiURL(
-      'AssetCategoryResource/listAssetCategorysByCategory?type=ItemizedClassification',
-    ),
-    type: 'get',
-
-    dataType: 'json',
-    beforeSend: function (request) {
-      Common.addTokenToRequest(request);
-    },
-    success: function (data) {
-      if (data.errorCode === 0 && data.datas.length > 0) {
-        assetDetailCategorys.value = data.datas;
-        getDetailData(data.datas);
-      } else {
-        message.warning(data.errorMessage);
-      }
-    },
-    error: function (XMLHttpRequest, textStatus, errorThrown) {
-      Common.processException(XMLHttpRequest, textStatus, errorThrown);
-    },
-  });
-};
-
-const headerStyle = {
-  backgroundColor: '#f0f0f0',
-};
-const contentStyle = {
-  color: '#fff',
-  backgroundColor: '#fafafa',
-};
-
-watch(
-  () => props.step,
-  newValue => {
-    step.value = newValue;
-    if (newValue === '0') {
-      nowSelect.value = 'commonUse';
-    }
-  },
-  { deep: true, immediate: true },
-);
-</script>
-
-<style scoped>
-.select_asset {
-  position: relative;
-  overflow: auto;
-  height: 294px;
-}
-.select_asset > p {
-  position: relative;
-  height: 38px;
-  line-height: 38px;
-  text-align: center;
-  margin: 16px 0 36px;
-  font-size: 20px;
-}
-.select_asset > ul {
-  overflow: hidden;
-  list-style: none;
-  display: flex;
-  justify-content: space-around;
-  align-items: center;
-  margin-left: -38px !important;
-}
-.select_asset > li {
-  height: 165px;
-  padding-left: 65px;
-  float: left;
-}
-.select_asset li img {
-  margin: 0 auto;
-  cursor: pointer;
-}
-.select_asset li a {
-  display: block;
-  text-align: center;
-  position: relative;
-  margin: 0;
-  bottom: 36px;
-  font-size: 13px;
-  color: #333;
-  cursor: pointer;
-  text-align: center;
-}
-.select_asset a span {
-  cursor: pointer;
-  padding: 0 6px;
-  line-height: 32px;
-  background: #277fd0;
-  color: #fff;
-  display: inline-block;
-  text-align: center;
-}
-.select_asset a span:hover {
-  background: #3e9aef;
-}
-
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h).ant-layout .ant-layout-header
-  ) {
-  height: 40px;
-  line-height: 0;
-  padding-inline: 0px;
-}
-.tab_select {
-  height: 40px;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-
-.item-list {
-  width: 610px;
-  height: 437px;
-  overflow-y: auto;
-  float: left;
-  color: #333;
-}
-
-.ul_list {
-  list-style-type: none;
-  padding: 0;
-}
-.ul_list.active {
-  display: block;
-}
-.ul_list > li {
-  height: 40px;
-  line-height: 40px;
-}
-.ul_list li .left {
-  width: 160px;
-  padding: 0 10px 0 16px;
-  color: #777;
-  display: flex;
-}
-.left > .parent_name {
-  width: 150px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-}
-.ul_list li .right {
-  width: 440px;
-  display: inline-block;
-  margin-left: -36px;
-}
-.ul_list li .right ul {
-  list-style: none;
-}
-.ul_list li .right li {
-  float: left;
-  margin-right: 15px;
-  cursor: pointer;
-}
-.fl {
-  float: left;
-}
-
-.jt_icon {
-  float: right;
-}
-
-.menu_style {
-  background-color: #e5f2fd;
-  height: 430px;
-  overflow: auto;
-}
-:deep(.ant-menu-light .ant-menu-submenu-selected > .ant-menu-submenu-title) {
-  color: #277fd0;
-}
-:deep(.ant-menu-item) {
-  height: 24px;
-  line-height: 24px;
-  border-radius: 4px;
-  /* text-align: center;
-  padding-left: 12px !important; */
-}
-:deep(.ant-menu-item-selected) {
-  color: #fff;
-  background-color: #3e9aef !important;
-}
-</style>

+ 0 - 165
src/window1/tabGridView/AssetList.vue

@@ -1,165 +0,0 @@
-<template>
-  <div>
-    <div class="asset_list">
-      <ul class="name_list">
-        <li
-          v-for="(item, index) in treeData"
-          :key="index"
-          :class="{ active: currentIndex1 === index }"
-          @click="setCurrentIndex(index, item, 1)"
-        >
-          {{ item.text }}
-          <a v-if="item.children">></a>
-        </li>
-      </ul>
-    </div>
-    <div class="asset_list">
-      <ul class="name_list">
-        <li
-          v-for="(item, index) in menu1"
-          :key="index"
-          :class="{ active: currentIndex2 === index }"
-          @click="setCurrentIndex(index, item, 2)"
-        >
-          {{ item.text }}
-          <a v-if="item.children">></a>
-        </li>
-      </ul>
-    </div>
-    <div class="asset_list">
-      <ul class="name_list">
-        <li
-          v-for="(item, index) in menu2"
-          :key="index"
-          :class="{ active: currentIndex3 === index }"
-          @click="setCurrentIndex(index, item, 3)"
-        >
-          {{ item.text }}
-        </li>
-      </ul>
-    </div>
-  </div>
-</template>
-
-<script setup>
-import { ref, defineProps, watch, defineEmits } from 'vue';
-
-const emits = defineEmits(['getAssetName']);
-const props = defineProps({
-  treeData: {
-    type: Array,
-    default: () => [],
-  },
-});
-const currentIndex1 = ref(null);
-const currentIndex2 = ref(null);
-const currentIndex3 = ref(null);
-const menu1 = ref([]);
-const menu2 = ref([]);
-
-const assetName1 = ref('');
-const assetName2 = ref('');
-const assetName3 = ref('');
-
-const setCurrentIndex = (index, record, flag) => {
-  if (flag === 1) {
-    currentIndex2.value = null;
-    currentIndex3.value = null;
-    currentIndex1.value = index;
-    menu1.value = record.children;
-    assetName1.value = record.text;
-    assetName2.value = '';
-    assetName3.value = '';
-  } else if (flag === 2) {
-    currentIndex3.value = null;
-    currentIndex2.value = index;
-    menu2.value = record.children;
-    assetName2.value = record.text;
-    assetName3.value = '';
-  } else {
-    currentIndex3.value = index;
-    assetName3.value = record.text;
-  }
-  let name = '';
-  if (!assetName2.value) {
-    name = `${assetName1.value}`;
-  }
-  if (assetName2.value && !assetName3.value) {
-    name = `${assetName1.value}->${assetName2.value}`;
-  }
-  if (assetName2.value && assetName3.value) {
-    name = `${assetName1.value}->${assetName2.value}->${assetName3.value}`;
-  }
-  emits('getAssetName', name, record);
-};
-const clearData = () => {
-  menu1.value = [];
-  menu2.value = [];
-  assetName1.value = '';
-  assetName2.value = '';
-  assetName3.value = '';
-  currentIndex1.value = null;
-  currentIndex2.value = null;
-  currentIndex3.value = null;
-};
-watch(
-  () => props.treeData,
-  (newVal, oldVal) => {
-    if (newVal !== oldVal || newVal.length === 0) {
-      clearData();
-      const parentDiv = document.querySelector('.asset_list');
-      const childDiv = parentDiv.querySelector('.name_list');
-      childDiv.scrollIntoView({ behavior: 'smooth', block: 'start' });
-    }
-  },
-);
-</script>
-
-<style scoped>
-.asset_list {
-  width: 33.3%;
-  height: 430px;
-  float: left;
-  border-right: 1px solid #ccc;
-  -webkit-box-sizing: border-box;
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-  overflow-x: hidden;
-  overflow: auto;
-}
-.asset_list > ul {
-  height: 430px;
-  padding: 0;
-  margin: 0;
-  list-style: none;
-}
-.asset_list li {
-  color: #333;
-  height: 30px;
-  line-height: 30px;
-  padding-left: 16px;
-  background-color: #fff;
-  text-overflow: ellipsis;
-  overflow: hidden;
-  white-space: nowrap;
-  cursor: pointer;
-}
-.asset_list li:hover {
-  background-color: #c6e0f8;
-}
-li.active {
-  color: #fff;
-  background-color: #3e9aef;
-  border-radius: 2px;
-}
-.asset_list li a {
-  width: 18px;
-  height: 18px;
-  float: right;
-  margin-right: 8px;
-  /* display: inline-block; */
-  font-size: 13px;
-  color: #333;
-  cursor: pointer;
-}
-</style>

+ 97 - 1
src/window1/tabGridView/NewTabButton.vue

@@ -11,6 +11,7 @@
         <ContainerTwoTone v-if="item.action === 'OPEN_HTML_WINDOW'" />
         <FileTextTwoTone v-if="item.action === 'EXPORT'" />
         <BellTwoTone v-if="item.action === 'NOTICE'" />
+        <HddOutlined v-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" />
 
         <span v-if="item.action === 'CREATE'" @click="create">{{
           item.name
@@ -21,6 +22,12 @@
         <span v-else-if="item.action === 'EXPORT'" @click="exportConfirm">{{
           item.name
         }}</span>
+        <span
+          v-else-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" 
+          @click="openRemotCompoentModule(item)"
+        >{{
+          item.name
+        }}</span>
         <span v-else>{{ item.name }}</span>
       </a-breadcrumb-item>
 
@@ -43,6 +50,7 @@
         <ContainerTwoTone v-if="item.action === 'OPEN_HTML_WINDOW'" />
         <FileTextTwoTone v-if="item.action === 'EXPORT'" />
         <BellTwoTone v-if="item.action === 'NOTICE'" />
+        <HddOutlined v-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" />
         <span v-if="item.action === 'CREATE'" @click="create">{{
           item.name
         }}</span>
@@ -52,6 +60,9 @@
         <span v-else-if="item.action === 'EXPORT'" @click="exportConfirm">{{
           item.name
         }}</span>
+        <span v-else-if="item.action === 'OPEN_REMOTE_COMPONENT_MODULE_IN_MODAL'" @click="openRemotCompoentModule(item)">{{
+          item.name
+        }}</span>
         <span
           v-else-if="item.action === 'NOTICE'"
           @click="notificationModal = true"
@@ -79,10 +90,15 @@
       </button>
     </template>
   </Modal>
+
+  
+  <a-modal v-model:open="modal1Open">
+    <component :is="modal1Component" />
+  </a-modal>
 </template>
 
 <script setup>
-import { ref, defineProps, defineEmits, watch, getCurrentInstance } from 'vue';
+import { ref, defineProps, defineEmits, watch, getCurrentInstance, defineAsyncComponent } from 'vue';
 import Common from '../../common/Common';
 import DownloadService from '../../resource/file/DownloadService.js';
 import NotificationPanel from '../../customer/NotificationPanel.vue';
@@ -90,12 +106,16 @@ import NotificationPanel from '../../customer/NotificationPanel.vue';
 import dayjs from 'dayjs';
 import GridColumnDefUtil from '../tabGridView/GridColumnDef.js';
 import GridColumnDef from '../tabGridView/GridColumnDef.vue';
+
+import { Spin as ASpin, Empty as AEmpty } from 'ant-design-vue';
+import { CssUtil } from 'pc-component-v3';
 import {
   PlusSquareTwoTone,
   DeleteTwoTone,
   EditTwoTone,
   BookTwoTone,
   BellTwoTone,
+  HddOutlined,
   FileTextTwoTone,
   ContainerTwoTone,
   ControlTwoTone,
@@ -150,6 +170,14 @@ const leftTabButton = ref([]);
 const rightTabButton = ref([]);
 const notificationModal = ref(false);
 const notificationPanel = ref(null);
+// 模态框的打开状态
+const modal1Open = ref(false);
+// 模态框的组件
+const modal1Component = ref(null);
+
+
+
+
 const { proxy } = getCurrentInstance(); //访问this
 // 新建数据
 const create = () => {
@@ -379,6 +407,74 @@ const isEmpty = obj => {
     return true;
   }
 };
+
+
+/**
+ * 获取字符串的哈希值
+ * @param input 
+ */
+const getHash = function (input) {
+  let hash = 0;
+  if (input.length === 0) {
+    return hash;
+  }
+  for (let i = 0; i < input.length; i++) {
+    const char = input.charCodeAt(i);
+    hash = ((hash << 5) - hash) + char;
+    hash = hash & hash; // 确保返回值是一个32位有符号整数
+  }
+  return Math.abs(hash).toString();
+};
+
+
+/**
+     * 远程加载ES VUE组件模块,并在模态框中打开。
+     * @param jsUrl js路径
+     * @param cssUrl css路径
+     */
+const openRemotCompoentModule = async function(tabButton){
+
+  let jsUrl = tabButton.remoteComponentModuleJsUrl;
+  
+  let cssUrl = tabButton.remoteComponentModuleCssUrl;
+
+  // 显示模态框
+  // 异步的加载js组件
+  //let jsUrl = './module/client-eam-module-v3/dist/AssetCheckCreate.js';
+  //let cssUrl = './module/client-eam-module-v3/dist/AssetCheckCreate.css';
+
+  if(cssUrl != null && cssUrl.length > 0){
+    let cssUrlHash = getHash(cssUrl);
+    CssUtil.dynamicLoadCss(cssUrl, cssUrlHash);
+  }
+  // webpackIgnore:设置为 true 时,禁用动态导入解析。
+  // const testAsyncRemoteComponent  = await import(/* webpackIgnore: true */ jsUrl);
+
+  // console.log(testAsyncRemoteComponent);
+  if(jsUrl != null && jsUrl.length > 0){
+    const testAsyncRemoteComponent = defineAsyncComponent({
+    // 加载函数
+      loader: () => {
+        return import(/* webpackIgnore: true */ jsUrl);
+      },
+      // 加载异步组件时使用的组件
+      loadingComponent: ASpin,
+      // 展示加载组件前的延迟时间,默认为 200ms
+      delay: 200,
+      // 加载失败后展示的组件
+      errorComponent: AEmpty,
+      // 如果提供了一个 timeout 时间限制,并超时了
+      // 也会显示这里配置的报错组件,默认值是:Infinity
+      timeout: 3000,
+    });
+
+    modal1Component.value = testAsyncRemoteComponent;
+    modal1Open.value = true;
+  }
+  
+};
+
+
 </script>
 
 <style scoped>

+ 0 - 27
src/window1/tabGridView/SubMenu.vue

@@ -1,27 +0,0 @@
-<template>
-  <template v-for="item in menuInfo" :key="item.key">
-    <a-sub-menu v-if="item.children" :key="item.key">
-      <template #title>{{ item.name }}</template>
-      <sub-menu :key="item.key" :menu-info="item.children" />
-    </a-sub-menu>
-    <a-menu-item v-else :key="item.id" @click="getAsset(item)">
-      {{ item.name }}
-    </a-menu-item>
-  </template>
-</template>
-<script setup>
-import { defineProps } from 'vue';
-const props = defineProps({
-  menuInfo: {
-    type: Object,
-    default: () => ({}),
-  },
-});
-
-const getAsset = item => {
-  console.log(item);
-};
-</script>
-
-<style scoped>
-</style>

+ 142 - 235
src/window1/tabGridView/TabGridEdit.vue

@@ -2,58 +2,39 @@
 
 <template>
   <div>
-    <Navbar
-      :title="Language.getNameTrl($i18n.locale, window)"
-      :is-go-back="false"
-    />
+    <Navbar :title="Language.getNameTrl($i18n.locale, window)" :is-go-back="false" />
     <WindowTab
       v-if="
         tab && tab.tabDataSource && tab.tabDataSource.tabDataSourceGroupDtos
-      "
-      :tab-props="tab.tabDataSource.tabDataSourceGroupDtos"
-      @get-now-tab="getNowTab"
+      " :tab-props="tab.tabDataSource.tabDataSourceGroupDtos" @get-now-tab="getNowTab"
     />
     <div
-      class="grid-container"
-      :style="{
+      class="grid-container" :style="{
         'padding-right': showComplexFilterPanel == true ? '360px' : '0px',
       }"
     >
       <div class="operationClass">
         <div class="grid-item-row1" style="width: 400px">
           <SimpleFilterPanel
-            :key="'simple-filter-panel-' + windowNo"
-            v-model:searchText="searchText"
-            :disabled="complexFilterParams != null"
-            :window-no="windowNo"
-            :tab-index="tabIndex"
-            :filter-schema="tab.filterSchema"
-            @simple-search="simpleSearch"
+            :key="'simple-filter-panel-' + windowNo" v-model:searchText="searchText"
+            :disabled="complexFilterParams != null" :window-no="windowNo" :tab-index="tabIndex"
+            :filter-schema="tab.filterSchema" @simple-search="simpleSearch"
             @show-complex-filter-panel="showComplexFilterPanel = true"
           />
         </div>
         <div>
           <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>
 
       <div ref="zc" class="zc">
         <a-modal
-          v-model:open="createModal"
-          :mask-closable="false"
-          :width="step === '1' ? '800px' : '500px'"
-          class="custom-modal"
-          :get-container="() => $refs.zc"
-          @cancel="cancelCreate"
+          v-model:open="createModal" :mask-closable="false" :width="step === '1' ? '800px' : '500px'"
+          class="custom-modal" :get-container="() => $refs.zc" @cancel="cancelCreate"
         >
           <template #title>
             <div class="modal_title">
@@ -61,7 +42,6 @@
               <span style="padding-left: 10px">资产分类</span>
             </div>
           </template>
-          <AddAssets :step="step" @get-step-info="getStepInfo" />
           <template #footer>
             <a-button v-if="step === '0'" type="primary" @click="cancelCreate">
               取消
@@ -82,17 +62,10 @@
 
       <div class="grid-item-row2">
         <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"
+          :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>
 
@@ -101,58 +74,29 @@
         <div v-html="headerHtml" />
         <!-- table -->
         <div v-if="tab != null && tab.tabGridView != null">
-          <div
-            :id="scrollObject.tableOutDivUuid1"
-            ref="tableContainer1"
-            style="padding-left: 0px"
-          >
+          <div :id="scrollObject.tableOutDivUuid1" ref="tableContainer1" style="padding-left: 0px">
             <div :id="scrollObject.tableOutDivUuid2" ref="tableContainer2">
-              <table
-                id="fixedTbody"
-                class="fixed-table table-striped table-bordered"
-                :width="tableWidth"
-              >
+              <table id="fixedTbody" class="fixed-table table-striped table-bordered" :width="tableWidth">
                 <thead>
                   <GridHeader
-                    :is-show-edit="!tab.tabDataSource.readOnly"
-                    :tab-grid-fields="tabGridFields"
-                    :window-no="windowNo"
-                    :tab-index="tabIndex"
-                    :is-chinese-english="window.isChineseEnglish"
-                    height="40px"
-                    @on-sort="onSort($event)"
-                    @property-changed="propertyChanged($event)"
-                    @select-all="selectAll($event)"
-                    @multiple-select="changeSelectMode($event)"
+                    :is-show-edit="!tab.tabDataSource.readOnly" :tab-grid-fields="tabGridFields"
+                    :window-no="windowNo" :tab-index="tabIndex" :is-chinese-english="window.isChineseEnglish"
+                    height="40px" @on-sort="onSort($event)" @property-changed="propertyChanged($event)"
+                    @select-all="selectAll($event)" @multiple-select="changeSelectMode($event)"
                   />
                 </thead>
                 <tbody>
-                  <template
-                    v-for="(modelData, index) in modelDatas"
-                    :key="modelData.id"
-                  >
+                  <template v-for="(modelData, index) in modelDatas" :key="modelData.id">
                     <GridBody
-                      ref="gridBody"
-                      :window-no="windowNo"
-                      :tab-index="tabIndex"
-                      :serial-number="
-                        index +
-                          1 +
-                          (pagination.current_page - 1) * pagination.per_page
-                      "
-                      :is-show-edit="!tab.tabDataSource.readOnly"
-                      :tab-grid-fields="tabGridFields"
-                      :model-data="modelData"
-                      height="40px"
-                      :class-name="tab.tabDataSource.className"
-                      :scroll-object="scrollObject"
-                      :js-url="jsUrl"
-                      @delete-record="deleteRecord(modelData, true)"
-                      @edit-record="editRecord(modelData, index)"
-                      @click-model-data="clickModelData(modelData)"
+                      ref="gridBody" :window-no="windowNo" :tab-index="tabIndex" :serial-number="index +
+                        1 +
+                        (pagination.current_page - 1) * pagination.per_page
+                      " :is-show-edit="!tab.tabDataSource.readOnly" :tab-grid-fields="tabGridFields"
+                      :model-data="modelData" height="40px" :class-name="tab.tabDataSource.className"
+                      :scroll-object="scrollObject" :js-url="jsUrl" @delete-record="deleteRecord(modelData, true)"
+                      @edit-record="editRecord(modelData, index)" @click-model-data="clickModelData(modelData)"
                       @read-record="readRecord(modelData, index)"
-                      @value-changed="valueChanged($event, modelData, index)"
-                      @execute-callout="
+                      @value-changed="valueChanged($event, modelData, index)" @execute-callout="
                         executeCallout($event, modelData, index)
                       "
                     />
@@ -165,20 +109,13 @@
       </div>
 
       <a-drawer
-        v-model:open="showComplexFilterPanel"
-        :title="$t('lang.tabGridEdit.advancedSearch')"
-        :width="400"
-        :footer-style="{ textAlign: 'right' }"
-        :mask="false"
-        :mask-closable="false"
+        v-model:open="showComplexFilterPanel" :title="$t('lang.tabGridEdit.advancedSearch')" :width="400"
+        :footer-style="{ textAlign: 'right' }" :mask="false" :mask-closable="false"
         @close="showComplexFilterPanel = false"
       >
         <ComplexFilterPanel
-          ref="complexFilterPanel"
-          :key="'complex-filter-panel-' + windowNo + '-' + tabIndex"
-          :window-no="windowNo"
-          :tab-index="tabIndex"
-          :filter-schema="tab.filterSchema"
+          ref="complexFilterPanel" :key="'complex-filter-panel-' + windowNo + '-' + tabIndex"
+          :window-no="windowNo" :tab-index="tabIndex" :filter-schema="tab.filterSchema"
           @complex-search="advancedSearchOk"
         />
       </a-drawer>
@@ -225,12 +162,10 @@ import AuthImage from '../../widget/AuthImage.vue';
 import DataRecoveryResource from '../../api/base/DataRecoveryResource.js';
 import CurdWindowResourceV2 from '../../api/dic/CurdWindowResourceV2.js';
 import JsUtil from '../../common/JsUtil.js';
-import { Notify, Uuid } from 'pc-component-v3';
+import { Notify, Uuid, CssUtil } 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 {
   PlusCircleTwoTone,
   PlusSquareTwoTone,
@@ -244,6 +179,8 @@ import {
   IdcardTwoTone,
 } from '@ant-design/icons-vue';
 
+import { defineAsyncComponent } from 'vue';
+
 export default {
   components: {
     AuthImage,
@@ -264,7 +201,6 @@ export default {
     CheckSquareTwoTone,
     CloseCircleTwoTone,
     IdcardTwoTone,
-    AddAssets,
   },
   props: {
     windowNo: {
@@ -328,6 +264,7 @@ export default {
       modal2: false,
 
       searchText: '', // 简单过滤条件
+
     };
   },
   computed: {
@@ -556,16 +493,16 @@ export default {
 
     // 组装查询条件,然后放到后台数据库当中
     UserStorageResource.uploadUserStorage(userStorageDtos).then(
-      successData => {},
+      successData => { },
       errorData => {
         Common.processException(errorData);
       },
     );
   },
 
-  beforeMount: function () {},
+  beforeMount: function () { },
 
-  mounted: function () {},
+  mounted: function () { },
 
   methods: {
     getContext: Context,
@@ -595,35 +532,6 @@ export default {
       localStorage.setItem(`CurdWindowPageSize${this.windowNo}`, size);
     },
 
-    // 点击新建进入资产选择
-    createAsset: function () {
-      this.createModal = true;
-      this.step = '0';
-    },
-
-    // 获取新增步骤信息
-    getStepInfo: function (step, selected, record) {
-      this.step = step;
-      this.nowAsset = selected;
-      this.selectCategory = record;
-    },
-
-    // 取消创建资产
-    cancelCreate: function () {
-      this.createModal = false;
-      // this.step = '0';
-    },
-    // 确认创建资产
-    confirmCreate: function () {
-      if (!this.selectCategory) {
-        message.warning('请您先选择资产分类!');
-        return;
-      }
-      if (this.selectCategory.children && this.selectCategory.children.length) {
-        message.warning('请您选择最后一级的资产分类!');
-        return;
-      }
-    },
     /**
      * 删除草稿数据
      * @author GuoZhiBo 20211008
@@ -968,11 +876,11 @@ export default {
           var currPage = _self.pagination.current_page;
           this.$router.push(
             'window-edit/create/' +
-              this.windowNo +
-              '/' +
-              this.tabIndex +
-              '?currPage=' +
-              currPage,
+            this.windowNo +
+            '/' +
+            this.tabIndex +
+            '?currPage=' +
+            currPage,
           );
         } else {
           // 如果不存在子页签,则可以直接在当前的界面上新建数据
@@ -998,11 +906,13 @@ export default {
       }
     },
 
+
+
     /**
      * 在WindowEdit界面中新增数据
      *
      */
-    createRecordInWindowEdit: function () {
+    createRecordInWindowEdit: async function () {
       var _self = this;
       var currPage = _self.pagination.current_page;
       var totalCount = _self.pagination.total;
@@ -1019,27 +929,31 @@ export default {
           false,
         );
       } else {
-        if (customerWindowUrl != undefined && customerWindowUrl != '') {
-          this.$router.push(
-            customerWindowUrl + '/create/' + this.windowNo + '/' + this.tabIndex,
-          );
-        } else {
-          this.$router.push(
-            'window-edit/create/' +
-              this.windowNo +
-              '/' +
-              this.tabIndex +
-              '?currPage=' +
-              currPage +
-              '&totalCount=' +
-              totalCount +
-              '&uuid=' +
-              this.uuid,
-          );
-        }
+        
+
+
+        // if (customerWindowUrl != undefined && customerWindowUrl != '') {
+        //   this.$router.push(
+        //     customerWindowUrl + '/create/' + this.windowNo + '/' + this.tabIndex,
+        //   );
+        // } else {
+        //   this.$router.push(
+        //     'window-edit/create/' +
+        //     this.windowNo +
+        //     '/' +
+        //     this.tabIndex +
+        //     '?currPage=' +
+        //     currPage +
+        //     '&totalCount=' +
+        //     totalCount +
+        //     '&uuid=' +
+        //     this.uuid,
+        //   );
+        // }
       }
     },
 
+
     /**
      * 点击编辑全部按钮
      */
@@ -1083,21 +997,21 @@ export default {
           var totalCount = _self.pagination.total;
           this.$router.push(
             'window-edit/edit/' +
-              this.windowNo +
-              '/' +
-              this.tabIndex +
-              '/' +
-              modelData.id +
-              '?currPage=' +
-              currPage +
-              '&currIndex=' +
-              currIndex +
-              '&totalCount=' +
-              totalCount +
-              '&uuid=' +
-              this.uuid +
-              '&isRestoreData=' +
-              _self.isRestoreData,
+            this.windowNo +
+            '/' +
+            this.tabIndex +
+            '/' +
+            modelData.id +
+            '?currPage=' +
+            currPage +
+            '&currIndex=' +
+            currIndex +
+            '&totalCount=' +
+            totalCount +
+            '&uuid=' +
+            this.uuid +
+            '&isRestoreData=' +
+            _self.isRestoreData,
           );
         } else {
           if (!modelData.editMode) {
@@ -1136,37 +1050,37 @@ export default {
       if (customerWindowUrl != undefined && customerWindowUrl != '') {
         this.$router.push(
           customerWindowUrl +
-            '/view/' +
-            this.windowNo +
-            '/' +
-            this.tabIndex +
-            '/' +
-            modelData.id +
-            '?currPage=' +
-            currPage +
-            '&currIndex=' +
-            currIndex +
-            '&totalCount=' +
-            totalCount +
-            '&uuid=' +
-            this.uuid,
+          '/view/' +
+          this.windowNo +
+          '/' +
+          this.tabIndex +
+          '/' +
+          modelData.id +
+          '?currPage=' +
+          currPage +
+          '&currIndex=' +
+          currIndex +
+          '&totalCount=' +
+          totalCount +
+          '&uuid=' +
+          this.uuid,
         );
       } else {
         this.$router.push(
           'window-read/view/' +
-            this.windowNo +
-            '/' +
-            this.tabIndex +
-            '/' +
-            modelData.id +
-            '?currPage=' +
-            currPage +
-            '&currIndex=' +
-            currIndex +
-            '&totalCount=' +
-            totalCount +
-            '&uuid=' +
-            this.uuid,
+          this.windowNo +
+          '/' +
+          this.tabIndex +
+          '/' +
+          modelData.id +
+          '?currPage=' +
+          currPage +
+          '&currIndex=' +
+          currIndex +
+          '&totalCount=' +
+          totalCount +
+          '&uuid=' +
+          this.uuid,
         );
       }
     },
@@ -1519,8 +1433,8 @@ export default {
           Notify.error(
             '数据字典定义异常',
             '【' +
-              scriptText +
-              '】Callout前端逻辑定义异常,请联系管理员检查数据字典的定义。',
+            scriptText +
+            '】Callout前端逻辑定义异常,请联系管理员检查数据字典的定义。',
             false,
           );
         }
@@ -1532,8 +1446,8 @@ export default {
           Notify.error(
             '数据字典定义异常',
             '【' +
-              scriptText +
-              '】Callout前端逻辑的JS文件不存在,请联系管理员检查数据字典是否存在JS文件。',
+            scriptText +
+            '】Callout前端逻辑的JS文件不存在,请联系管理员检查数据字典是否存在JS文件。',
             false,
           );
           return;
@@ -1545,8 +1459,8 @@ export default {
               Notify.error(
                 '数据字典定义异常',
                 '【' +
-                  scriptText +
-                  '】Callout前端逻辑定义异常,请联系管理员检查数据字典的定义。',
+                scriptText +
+                '】Callout前端逻辑定义异常,请联系管理员检查数据字典的定义。',
                 false,
               );
               return;
@@ -1790,7 +1704,7 @@ export default {
         },
       ];
       UserStorageResource.uploadUserStorage(userStorageDtos).then(
-        successData => {},
+        successData => { },
         errorData => {
           Common.processException(errorData);
         },
@@ -1851,55 +1765,43 @@ export default {
   grid-column-start: 1;
   grid-column-end: 4;
 }
+
 .operationClass,
 .button_list {
   display: flex;
   justify-content: space-between;
   align-items: center;
 }
+
 .tableFixHead {
   margin-top: -16px;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb
-      .ant-breadcrumb-link
-      > .anticon
-      + span,
-    :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb
-      .ant-breadcrumb-link
-      > .anticon
-      + a
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb .ant-breadcrumb-link > .anticon + span,
+  :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb .ant-breadcrumb-link > .anticon + a) {
   color: black;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h)[class^="ant-breadcrumb"]
-      [class^="ant-breadcrumb"]
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h)[class^="ant-breadcrumb"] [class^="ant-breadcrumb"]) {
   padding: 3px 10px;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h)[class^="ant-breadcrumb"]
-      [class^="ant-breadcrumb"]:hover
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h)[class^="ant-breadcrumb"] [class^="ant-breadcrumb"]:hover) {
   border: 1px solid #ddd;
   border-radius: 4px;
   cursor: pointer;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb
-      .ant-breadcrumb-separator
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb .ant-breadcrumb-separator) {
   padding: 0px !important;
   margin-inline: 2px !important;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb
-      .ant-breadcrumb-separator:hover
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h).ant-breadcrumb .ant-breadcrumb-separator:hover) {
   border: none;
   cursor: none;
 }
+
 .modal_title {
   background: #267fcf;
   height: 32px;
@@ -1909,31 +1811,36 @@ export default {
   border: 0;
   padding-left: 8px;
 }
+
 .modal_footer {
   display: flex;
   justify-content: space-between;
   align-items: center;
   text-align: unset;
 }
+
 :deep(.zc .ant-modal-content) {
   padding: 0 0 8px 0;
 }
-:deep(
-    :where(.css-dev-only-do-not-override-16pw25h).ant-modal .ant-modal-close
-  ) {
+
+:deep( :where(.css-dev-only-do-not-override-16pw25h).ant-modal .ant-modal-close) {
   top: 6px;
   color: #fff;
 }
+
 :deep(.zc .ant-modal-header) {
   margin-bottom: 0px;
 }
+
 :deep(.ant-modal-footer) {
   padding-right: 8px;
   padding-left: 8px;
 }
+
 :deep(.ant-breadcrumb-link > .btn-group) {
   margin-top: -2px;
 }
+
 :deep(.ant-pagination-options-quick-jumper) {
   margin-right: -18px !important;
 }

BIN
src/window1/tabGridView/commonAsset.gif


BIN
src/window1/tabGridView/newAsset.gif


+ 13 - 13
webpack.dev.js

@@ -62,71 +62,71 @@ module.exports = WebpackMerge.merge(baseConfig, {
     
     proxy: {
       '/api': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/static': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/content': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/dashboard': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/assets': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/mock': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/authApi': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/Dictionary': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/Files': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: false,
         changeOrigin: true,
         secure:true,
       },
       '/WebSocket': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: true,
         changeOrigin: true,
       },
       '/TrainVideo': {
-        target: 'http://127.0.0.1:10022/',
+        target: 'http://192.168.1.5:10023/',
         ws: true,
         changeOrigin: true,
       },
-      '/gateway-api': {
-        target: 'http://127.0.0.1:10022/',
+      '/module': {
+        target: 'http://192.168.1.5:10023/',
         ws: true,
         changeOrigin: true,
         secure:true,

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff