tx-sider 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/TXUI.mjs CHANGED
@@ -24314,9 +24314,8 @@ var lib = {
24314
24314
  const qs = /* @__PURE__ */ getDefaultExportFromCjs(lib);
24315
24315
  const hostname = window.location.hostname.split(".");
24316
24316
  const protocol = window.location.protocol;
24317
- const isLocalhost = () => hostname[0] === "localhost";
24318
24317
  const request2 = new Request({
24319
- baseURL: isLocalhost ? "/api" : "/",
24318
+ baseURL: process.env.NODE_ENV == "development" ? "/api" : "/",
24320
24319
  timeout: TIME_OUT,
24321
24320
  headers: {
24322
24321
  "Content-Type": "application/json;charset=UTF-8",
@@ -24328,16 +24327,16 @@ const request2 = new Request({
24328
24327
  requestInterceptors: (config2) => {
24329
24328
  config2.headers.authorization = localStorage.getItem("token") ? "Bearer " + localStorage.getItem("token") : null;
24330
24329
  if (config2.requestBase == "USER_BASE_URL") {
24331
- config2.baseURL = isLocalhost ? "/user" : `${protocol}//basis.${hostname[1]}.${hostname[2]}`;
24330
+ config2.baseURL = process.env.NODE_ENV == "development" ? "/user" : `${protocol}//basis.${hostname[1]}.${hostname[2]}`;
24332
24331
  }
24333
24332
  if (config2.requestBase == "MRP2_BASE_URL") {
24334
- config2.baseURL = isLocalhost ? "/mrp2" : `${protocol}//mrp2.${hostname[1]}.${hostname[2]}`;
24333
+ config2.baseURL = process.env.NODE_ENV == "development" ? "/mrp2" : `${protocol}//mrp2.${hostname[1]}.${hostname[2]}`;
24335
24334
  }
24336
24335
  if (config2.requestBase == "ROOT_BASE_URL") {
24337
- config2.baseURL = isLocalhost ? "/root" : `${protocol}//basis.${hostname[1]}.${hostname[2]}`;
24336
+ config2.baseURL = process.env.NODE_ENV == "development" ? "/root" : `${protocol}//basis.${hostname[1]}.${hostname[2]}`;
24338
24337
  }
24339
24338
  if (config2.requestBase == "GATEWAY_URL") {
24340
- config2.baseURL = isLocalhost ? "/gateway" : `${protocol}//gateway.${hostname[1]}.${hostname[2]}`;
24339
+ config2.baseURL = process.env.NODE_ENV == "development" ? "/gateway" : `${protocol}//gateway.${hostname[1]}.${hostname[2]}`;
24341
24340
  }
24342
24341
  return config2;
24343
24342
  },
@@ -24415,13 +24414,6 @@ const baseOptions = (data3) => {
24415
24414
  data: data3
24416
24415
  });
24417
24416
  };
24418
- const systemmenus = () => {
24419
- return cwRequest({
24420
- url: "/api/permission-management/permissions/systemmenus",
24421
- method: "get",
24422
- requestBase: "ROOT_BASE_URL"
24423
- });
24424
- };
24425
24417
  const setHeadImg = (data3) => {
24426
24418
  return cwRequest({
24427
24419
  url: "/api/identity/users/setHeadImg",
@@ -27657,8 +27649,7 @@ const _sfc_main = {
27657
27649
  const changePWDref = ref();
27658
27650
  const moduleTestS = ref();
27659
27651
  const isSystems = ref(props.isSystems);
27660
- const menuTitle = ref(props.menuTitle);
27661
- const modeuleType = ref(props.modeuleType);
27652
+ const modeuleType = computed(() => props.modeuleType);
27662
27653
  const selectedSystems = ref();
27663
27654
  const gjTest = ref();
27664
27655
  const gjId = ref();
@@ -27681,8 +27672,8 @@ const _sfc_main = {
27681
27672
  userInfo: {}
27682
27673
  });
27683
27674
  const refData = toRefs(data3);
27684
- const AccessData = ref(JSON.parse(localStorage.getItem("AccessData")));
27685
- const iconUrl = process.env.NODE_ENV == "development" ? "https://localhost:7110" : "https://basis.nacho.cn";
27675
+ ref(JSON.parse(localStorage.getItem("AccessData")));
27676
+ process.env.NODE_ENV == "development" ? "https://localhost:7110" : "https://basis.nacho.cn";
27686
27677
  const [ccflowData, onClickTodo] = useCcflowCall();
27687
27678
  watch(
27688
27679
  () => props.isSystems,
@@ -27702,26 +27693,6 @@ const _sfc_main = {
27702
27693
  }
27703
27694
  }
27704
27695
  );
27705
- watch(
27706
- () => props.menuTitle,
27707
- () => {
27708
- menuTitle.value = props.menuTitle;
27709
- }
27710
- );
27711
- watch(
27712
- () => props.modeuleType,
27713
- () => {
27714
- var _a, _b;
27715
- modeuleType.value = props.modeuleType;
27716
- console.log(modeuleType.value, "props.modeuleType");
27717
- console.log(
27718
- modeuleInfos.value,
27719
- modeuleType.value,
27720
- (_b = (_a = modeuleInfos.value) == null ? void 0 : _a.productionBases) == null ? void 0 : _b.includes(modeuleType.value),
27721
- "modeuleInfos.value.productionBases.includes(modeuleType.value)"
27722
- );
27723
- }
27724
- );
27725
27696
  const modeuleInfos = ref();
27726
27697
  const getModeuleInfoData = async () => {
27727
27698
  modeuleInfos.value = await getModeuleInfo();
@@ -27741,27 +27712,24 @@ const _sfc_main = {
27741
27712
  permissionModuleList.value = await getPermissionModuleList();
27742
27713
  };
27743
27714
  onBeforeMount(async () => {
27744
- var _a;
27715
+ var _a, _b;
27716
+ console.log(props);
27717
+ selectedSystems.value = isSystems.value;
27745
27718
  await getPermissionModuleListData();
27746
27719
  getModeuleInfoDataHandle = await getModeuleInfoData();
27747
27720
  isShowAllProductionBases.value = (_a = getModeuleInfoDataHandle(
27748
27721
  window.location.hostname.split(".")[0]
27749
27722
  )) == null ? void 0 : _a.isAllProductionBases;
27750
- const userInfos = JSON.parse(localStorage.getItem("userInfos") || "{}");
27751
- data3.userInfo = userInfos;
27752
- var height = document.documentElement.clientHeight;
27753
- var width = document.documentElement.clientWidth;
27754
- data3.contentHeight = height;
27755
- data3.contentWidth = width;
27723
+ data3.userInfo = JSON.parse(localStorage.getItem("userInfos") || "{}");
27724
+ data3.contentHeight = document.documentElement.clientHeight;
27725
+ data3.contentWidth = document.documentElement.clientWidth;
27756
27726
  window.onresize = function() {
27757
- var height2 = document.documentElement.clientHeight;
27758
- var width2 = document.documentElement.clientWidth;
27759
- data3.contentHeight = height2;
27760
- data3.contentWidth = width2;
27727
+ data3.contentHeight = document.documentElement.clientHeight;
27728
+ data3.contentWidth = document.documentElement.clientWidth;
27761
27729
  };
27762
27730
  data3.selectModule = JSON.parse(
27763
27731
  localStorage.getItem("selectModule") || "{}"
27764
- ).key;
27732
+ ).key ?? props.isModules;
27765
27733
  gjId.value = localStorage.getItem("gjId");
27766
27734
  if (data3.selectModule == "BussinessCenter.WDMModule") {
27767
27735
  console.log("当前所选模块为储运,显示弹窗");
@@ -27771,22 +27739,21 @@ const _sfc_main = {
27771
27739
  data3.dgVisible = true;
27772
27740
  }
27773
27741
  }
27742
+ if (isSystems.value) {
27743
+ moduleTestS.value = ((_b = permissionModuleList.value.find((_x) => _x.permissionModuleName === selectedSystems.value)) == null ? void 0 : _b.childGroups) ?? [];
27744
+ }
27774
27745
  });
27775
- const newSystemTest = ref();
27776
27746
  const sysShow = ref(true);
27777
27747
  const ModuleShow = ref(true);
27778
- const systemsList = ref();
27779
- const systems = ref();
27748
+ ref();
27780
27749
  const menuList = ref();
27781
27750
  const goUrl = ref();
27782
27751
  onMounted(async () => {
27783
- var _a, _b, _c, _d, _e, _f, _g;
27784
- selectedSystems.value = isSystems.value;
27752
+ var _a, _b;
27785
27753
  if (permissionModuleList.value.length == 1) {
27786
27754
  sysShow.value = false;
27787
27755
  }
27788
27756
  if (isSystems.value) {
27789
- moduleTestS.value = ((_a = permissionModuleList.value.find((_x) => _x.permissionModuleName === selectedSystems.value)) == null ? void 0 : _a.childGroups) ?? [];
27790
27757
  if (moduleTestS.value.length == 1) {
27791
27758
  ModuleShow.value = false;
27792
27759
  }
@@ -27809,12 +27776,6 @@ const _sfc_main = {
27809
27776
  shortName: item.shortName
27810
27777
  };
27811
27778
  });
27812
- console.log(
27813
- modeuleInfos.value,
27814
- modeuleType.value,
27815
- (_c = (_b = modeuleInfos.value) == null ? void 0 : _b.productionBases) == null ? void 0 : _c.includes(modeuleType.value),
27816
- "modeuleInfos.value.productionBases.includes(modeuleType.value)"
27817
- );
27818
27779
  if (modeuleInfos.value.productionBases.includes(modeuleType.value)) {
27819
27780
  const curSetofBook = await currentGet();
27820
27781
  let baseRes = await baseOptions({ setOfBookId: curSetofBook });
@@ -27830,13 +27791,7 @@ const _sfc_main = {
27830
27791
  };
27831
27792
  });
27832
27793
  }
27833
- console.log(
27834
- modeuleInfos.value,
27835
- modeuleType.value,
27836
- (_e = (_d = modeuleInfos.value) == null ? void 0 : _d.projects) == null ? void 0 : _e.includes(modeuleType.value),
27837
- "modeuleInfos.value.projects.includes(modeuleType.value)"
27838
- );
27839
- if ((_g = (_f = modeuleInfos.value) == null ? void 0 : _f.projects) == null ? void 0 : _g.includes(modeuleType.value)) {
27794
+ if ((_b = (_a = modeuleInfos.value) == null ? void 0 : _a.projects) == null ? void 0 : _b.includes(modeuleType.value)) {
27840
27795
  let dgRes = await getdungouList();
27841
27796
  if (!dgRes) {
27842
27797
  gjTest.value = [];
@@ -27897,7 +27852,6 @@ const _sfc_main = {
27897
27852
  const changeModule = async (i2) => {
27898
27853
  var _a, _b;
27899
27854
  let { permissionModuleName, routerUrl, location: location2, moduleName } = i2;
27900
- console.log("🚀 ~ changeModule ~ location:", location2);
27901
27855
  if (!getModeuleInfoDataHandle) {
27902
27856
  getModeuleInfoDataHandle = await getModeuleInfoData();
27903
27857
  }
@@ -27910,12 +27864,6 @@ const _sfc_main = {
27910
27864
  ctx.emit("changeSystemOrModule", moduleName, name);
27911
27865
  if (!location2) {
27912
27866
  data3.moduleVisible = false;
27913
- console.log(
27914
- routerUrl,
27915
- permissionModuleName,
27916
- name,
27917
- "routerUrl,key,name++++++++++++++++++++++++++++++++++"
27918
- );
27919
27867
  ctx.emit("routerReplace", routerUrl);
27920
27868
  return;
27921
27869
  }
@@ -27983,7 +27931,6 @@ const _sfc_main = {
27983
27931
  const changesystem = (i2) => {
27984
27932
  selectedSystems.value = i2.permissionModuleName;
27985
27933
  data3.systemVisible = false;
27986
- console.log(i2, "cw1");
27987
27934
  moduleTestS.value = i2.childGroups ?? [];
27988
27935
  if (i2.childGroups === 1) {
27989
27936
  changeModule(moduleTestS.value[0]);
@@ -28223,38 +28170,6 @@ const _sfc_main = {
28223
28170
  const routerPush = (url2) => {
28224
28171
  ctx.emit("routerPush", url2);
28225
28172
  };
28226
- const systemVisibleTrue = async () => {
28227
- AccessData.value = JSON.parse(localStorage.getItem("AccessData"));
28228
- let systemmenusList = await systemmenus();
28229
- systems.value = systemmenusList.systems;
28230
- systemsList.value = systemmenusList.systems;
28231
- newSystemTest.value = systems.value.map((itemV) => {
28232
- const AccessSys = AccessData.value.find(
28233
- (item) => item.name == itemV.id
28234
- );
28235
- return {
28236
- title: AccessSys == null ? void 0 : AccessSys.displayName,
28237
- id: itemV.id,
28238
- icon: iconUrl + itemV.icon,
28239
- isSelect: itemV.id == isSystems.value ? true : false,
28240
- children: itemV.modules.map((childrenItem) => {
28241
- var _a, _b;
28242
- return {
28243
- icon: iconUrl + childrenItem.icon,
28244
- id: childrenItem.id,
28245
- title: (_a = AccessSys == null ? void 0 : AccessSys.permissions.find(
28246
- (item) => item.name == childrenItem.id
28247
- )) == null ? void 0 : _a.displayName,
28248
- isGranted: (_b = AccessSys == null ? void 0 : AccessSys.permissions.find(
28249
- (item) => item.name == childrenItem.id
28250
- )) == null ? void 0 : _b.isGranted
28251
- };
28252
- }),
28253
- isGranted: AccessSys == null ? void 0 : AccessSys.isGranted
28254
- };
28255
- });
28256
- data3.systemVisible = true;
28257
- };
28258
28173
  const fileList = ref([]);
28259
28174
  const beforeUpload = (file) => {
28260
28175
  const MINI_TYPE = ["image/png", "image/jpeg", "image/gif"];
@@ -28306,7 +28221,6 @@ const _sfc_main = {
28306
28221
  baseTest,
28307
28222
  setofbooksTest,
28308
28223
  gjTest,
28309
- newSystemTest,
28310
28224
  openChangePWDHandle,
28311
28225
  changePWDOKHandle,
28312
28226
  changePWDCancelHandle,
@@ -28325,9 +28239,7 @@ const _sfc_main = {
28325
28239
  moduleTest3,
28326
28240
  moduleHandle,
28327
28241
  routerPush,
28328
- systemVisibleTrue,
28329
28242
  menuList,
28330
- menuTitle,
28331
28243
  modeuleType,
28332
28244
  selectedSystems,
28333
28245
  oneModule,
@@ -28347,7 +28259,7 @@ const _sfc_main = {
28347
28259
  };
28348
28260
  }
28349
28261
  };
28350
- const _withScopeId = (n2) => (pushScopeId("data-v-08fe511b"), n2 = n2(), popScopeId(), n2);
28262
+ const _withScopeId = (n2) => (pushScopeId("data-v-3112d17e"), n2 = n2(), popScopeId(), n2);
28351
28263
  const _hoisted_1 = {
28352
28264
  class: "bg-white defaultTS funcTC relative",
28353
28265
  style: { "padding-bottom": "10px", "margin-bottom": "10px" }
@@ -28848,7 +28760,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
28848
28760
  onRouterPush: $setup.routerPush,
28849
28761
  noBaseTwoMenu: $props.noBaseTwoMenu,
28850
28762
  module: _ctx.selectModule,
28851
- menuTitle: $setup.menuTitle,
28763
+ menuTitle: $props.menuTitle,
28852
28764
  ccflow: $props.ccflow,
28853
28765
  ccflowData: $setup.ccflowData
28854
28766
  }, null, 8, ["onRouterPush", "noBaseTwoMenu", "module", "menuTitle", "ccflow", "ccflowData"])
@@ -29296,7 +29208,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
29296
29208
  }, 8, ["show"])
29297
29209
  ], 64);
29298
29210
  }
29299
- const TSider = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-08fe511b"]]);
29211
+ const TSider = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3112d17e"]]);
29300
29212
  const components = [TSider];
29301
29213
  installComponents();
29302
29214
  function installComponents() {