comp-adv3210 1.1.11 → 1.1.13

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.
@@ -13921,9 +13921,9 @@ var exportHelper = __webpack_require__(5907);
13921
13921
  const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_test_buttonvue_type_script_lang_js, [['render',render]])
13922
13922
 
13923
13923
  /* harmony default export */ var baowu_test_button = (__exports__);
13924
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=f214fea8&scoped=true
13924
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=3440af88&scoped=true
13925
13925
 
13926
- const _withScopeId = n => ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.pushScopeId)("data-v-f214fea8"), n = n(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.popScopeId)(), n);
13926
+ const _withScopeId = n => ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.pushScopeId)("data-v-3440af88"), n = n(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.popScopeId)(), n);
13927
13927
  const _hoisted_1 = {
13928
13928
  style: {
13929
13929
  "display": "flex",
@@ -14118,7 +14118,7 @@ const _hoisted_60 = {
14118
14118
  const _hoisted_61 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementVNode)("div", {
14119
14119
  class: "drawer-footer-text"
14120
14120
  }, " 设备树模式为设备树加载时的固有过滤条件,在设备树加载时会固定应用默认模式的过滤条件。该过滤条件不受用户查询条件设置的影响。 ", -1));
14121
- function baowu_device_treevue_type_template_id_f214fea8_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14121
+ function baowu_device_treevue_type_template_id_3440af88_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14122
14122
  const _component_a_input = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-input");
14123
14123
  const _component_a_button = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("a-button");
14124
14124
  const _component_star_filled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.resolveComponent)("star-filled");
@@ -14654,7 +14654,7 @@ function baowu_device_treevue_type_template_id_f214fea8_scoped_true_render(_ctx,
14654
14654
  _: 1
14655
14655
  }, 8, ["visible", "getContainer", "onOk", "onCancel"])], 512)], 2);
14656
14656
  }
14657
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=f214fea8&scoped=true
14657
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=3440af88&scoped=true
14658
14658
 
14659
14659
  // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js
14660
14660
  var esnext_set_difference_v2 = __webpack_require__(3375);
@@ -16650,7 +16650,7 @@ var TransitionEvents = {
16650
16650
  });
16651
16651
  }
16652
16652
  };
16653
- /* harmony default export */ var css_animation_Event = (TransitionEvents);
16653
+ /* harmony default export */ var Event = (TransitionEvents);
16654
16654
  ;// CONCATENATED MODULE: ./node_modules/ant-design-vue/es/_util/wave.js
16655
16655
 
16656
16656
 
@@ -16746,8 +16746,8 @@ function isNotGrey(color) {
16746
16746
  if (insertExtraNode) {
16747
16747
  node.appendChild(extraNode);
16748
16748
  }
16749
- css_animation_Event.addStartEventListener(node, onTransitionStart);
16750
- css_animation_Event.addEndEventListener(node, onTransitionEnd);
16749
+ Event.addStartEventListener(node, onTransitionStart);
16750
+ Event.addEndEventListener(node, onTransitionEnd);
16751
16751
  };
16752
16752
  var resetEffect = function resetEffect(node) {
16753
16753
  if (!node || node === extraNode || !(node instanceof Element)) {
@@ -16762,8 +16762,8 @@ function isNotGrey(color) {
16762
16762
  if (insertExtraNode && extraNode && node.contains(extraNode)) {
16763
16763
  node.removeChild(extraNode);
16764
16764
  }
16765
- css_animation_Event.removeStartEventListener(node, onTransitionStart);
16766
- css_animation_Event.removeEndEventListener(node, onTransitionEnd);
16765
+ Event.removeStartEventListener(node, onTransitionStart);
16766
+ Event.removeEndEventListener(node, onTransitionEnd);
16767
16767
  };
16768
16768
  var bindAnimationEvent = function bindAnimationEvent(node) {
16769
16769
  if (!node || !node.getAttribute || node.getAttribute('disabled') || node.className.indexOf('disabled') >= 0) {
@@ -21359,6 +21359,49 @@ dayjs_min_default().locale("zh-cn");
21359
21359
  });
21360
21360
  }
21361
21361
  });
21362
+ const queryParam = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
21363
+ authMode: props.authMode,
21364
+ deviceLabel: null,
21365
+ parentId: null,
21366
+ specificDomainId: null,
21367
+ deviceCodeOrName: null,
21368
+ careService: null,
21369
+ meteringDevice: null,
21370
+ specialDevice: null,
21371
+ collectStatus: null,
21372
+ // collectStatus:
21373
+ // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
21374
+ specialtyCodeList: [],
21375
+ importanceDegreeCodeList: [],
21376
+ ruleConfigList: [],
21377
+ limit: 9999,
21378
+ offset: 0,
21379
+ showCount: true,
21380
+ extendedAttrInfoList: null,
21381
+ // 可选,传设备扩展属性信息
21382
+ monId: null // 当前模式ID
21383
+ });
21384
+
21385
+ // 用于存储当前选择模式下的过滤条件(UI不回显,但接口需要带上)
21386
+ const activeModeFilters = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)({});
21387
+
21388
+ /**
21389
+ * 合并 UI 手动输入的过滤条件和模式自带的过滤条件
21390
+ * @returns 合并后的过滤参数
21391
+ */
21392
+ const getMergedParams = () => {
21393
+ // 模式自带条件作为底色,UI 手动输入条件覆盖同名属性
21394
+ const params = {
21395
+ ...activeModeFilters.value
21396
+ };
21397
+ console.log("gm", params);
21398
+ Object.keys(queryParam).forEach(key => {
21399
+ if (queryParam[key] !== null && queryParam[key] !== undefined && (Array.isArray(queryParam[key]) ? queryParam[key].length > 0 : true)) {
21400
+ params[key] = queryParam[key];
21401
+ }
21402
+ });
21403
+ return params;
21404
+ };
21362
21405
  const init = async function () {
21363
21406
  const {
21364
21407
  result
@@ -21370,7 +21413,7 @@ dayjs_min_default().locale("zh-cn");
21370
21413
  // 准备参数,如果 monId 是 0 则不传
21371
21414
  const getBaseParams = (extra = {}) => {
21372
21415
  const p = {
21373
- ...queryParam,
21416
+ ...getMergedParams(),
21374
21417
  ...extra,
21375
21418
  authMode: props.authMode
21376
21419
  };
@@ -21415,7 +21458,7 @@ dayjs_min_default().locale("zh-cn");
21415
21458
  }) => {
21416
21459
  plainOptions.value = result.map(item => ({
21417
21460
  label: item.name,
21418
- value: item.code
21461
+ value: item.code.toString()
21419
21462
  }));
21420
21463
  });
21421
21464
  await getDeviceLabelListFunction();
@@ -21425,28 +21468,25 @@ dayjs_min_default().locale("zh-cn");
21425
21468
  fetchFavoriteList();
21426
21469
  });
21427
21470
  let treeIdInterceptor = null;
21428
- const queryParam = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
21429
- authMode: props.authMode,
21430
- deviceLabel: null,
21431
- parentId: null,
21432
- specificDomainId: null,
21433
- deviceCodeOrName: null,
21434
- careService: null,
21435
- meteringDevice: null,
21436
- specialDevice: null,
21437
- collectStatus: null,
21438
- // collectStatus:
21439
- // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
21440
- specialtyCodeList: [],
21441
- importanceDegreeCodeList: [],
21442
- ruleConfigList: [],
21443
- limit: 9999,
21444
- offset: 0,
21445
- showCount: true,
21446
- extendedAttrInfoList: null,
21447
- // 可选,传设备扩展属性信息
21448
- monId: null // 当前模式ID
21449
- });
21471
+ const syncQueryParam = () => {
21472
+ // 同步状态
21473
+ queryParam.collectStatus = collectStatus.value;
21474
+
21475
+ // 同步扩展属性
21476
+ if (extendedAttrInfoList.value.length > 0) {
21477
+ queryParam.extendedAttrInfoList = extendedAttrInfoList.value.map(({
21478
+ id,
21479
+ valueType,
21480
+ value
21481
+ }) => ({
21482
+ id,
21483
+ valueType,
21484
+ value
21485
+ }));
21486
+ } else {
21487
+ delete queryParam.extendedAttrInfoList;
21488
+ }
21489
+ };
21450
21490
  const fetchDataContext = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
21451
21491
  tableSize: "small",
21452
21492
  stripe: false,
@@ -21489,9 +21529,7 @@ dayjs_min_default().locale("zh-cn");
21489
21529
  });
21490
21530
  // 去激活useFetchData中watch的回调
21491
21531
  queryParam.authMode = newAuthMode;
21492
- const params = {
21493
- ...queryParam
21494
- };
21532
+ const params = getMergedParams();
21495
21533
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
21496
21534
  delete params.monId;
21497
21535
  }
@@ -21522,20 +21560,21 @@ dayjs_min_default().locale("zh-cn");
21522
21560
  resolve();
21523
21561
  return;
21524
21562
  }
21563
+ const params = getMergedParams();
21525
21564
  getNextLevelNodesByPage({
21526
21565
  parentId: a.dataRef.id,
21527
- specificDomainId: queryParam.specificDomainId,
21566
+ specificDomainId: params.specificDomainId,
21528
21567
  authMode: props.authMode,
21529
- deviceCodeOrName: queryParam.deviceCodeOrName,
21530
- careService: queryParam.careService,
21531
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21532
- collectStatus: queryParam.collectStatus,
21533
- meteringDevice: queryParam.meteringDevice,
21534
- specialDevice: queryParam.specialDevice,
21535
- specialtyCodeList: queryParam.specialtyCodeList,
21536
- ruleConfigList: queryParam.ruleConfigList,
21537
- deviceLabel: queryParam.deviceLabel,
21538
- extendedAttrInfoList: queryParam.extendedAttrInfoList,
21568
+ deviceCodeOrName: params.deviceCodeOrName,
21569
+ careService: params.careService,
21570
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21571
+ collectStatus: params.collectStatus,
21572
+ meteringDevice: params.meteringDevice,
21573
+ specialDevice: params.specialDevice,
21574
+ specialtyCodeList: params.specialtyCodeList,
21575
+ ruleConfigList: params.ruleConfigList,
21576
+ deviceLabel: params.deviceLabel,
21577
+ extendedAttrInfoList: params.extendedAttrInfoList,
21539
21578
  limit: 500,
21540
21579
  offset: 0
21541
21580
  }).then(({
@@ -21564,9 +21603,10 @@ dayjs_min_default().locale("zh-cn");
21564
21603
  });
21565
21604
 
21566
21605
  // 使用 Promise.all 等待两个请求完成
21606
+ const pms = getMergedParams();
21567
21607
  Promise.all([getStateByDeviceCodeListOrDomainIdList({
21568
21608
  domains,
21569
- collectStatus: queryParam.collectStatus,
21609
+ collectStatus: pms.collectStatus,
21570
21610
  authMode: props.authMode
21571
21611
  }).then(({
21572
21612
  result: domainsInfo
@@ -21577,7 +21617,7 @@ dayjs_min_default().locale("zh-cn");
21577
21617
  }, {});
21578
21618
  }), getStateByDeviceCodeListOrDomainIdList({
21579
21619
  deviceCode,
21580
- collectStatus: queryParam.collectStatus,
21620
+ collectStatus: pms.collectStatus,
21581
21621
  authMode: props.authMode
21582
21622
  }).then(({
21583
21623
  result: devicesInfo
@@ -21676,24 +21716,26 @@ dayjs_min_default().locale("zh-cn");
21676
21716
  treeNodeList.value = [];
21677
21717
  treeNodeIdList.value = [];
21678
21718
  await recursionTree(treeData.value);
21719
+ const params = getMergedParams();
21720
+ console.log("fq", params);
21679
21721
  // 获得已显示的节点设备数量列表
21680
21722
  const {
21681
21723
  result: deviceNums
21682
21724
  } = await getDeviceNumberByDomainIdList({
21683
21725
  authMode: props.authMode,
21684
21726
  domainIdList: treeNodeIdList.value,
21685
- parentId: queryParam.parentId,
21686
- deviceCodeOrName: queryParam.deviceCodeOrName,
21687
- careService: queryParam.careService,
21688
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21689
- collectStatus: queryParam.collectStatus,
21690
- meteringDevice: queryParam.meteringDevice,
21691
- specialDevice: queryParam.specialDevice,
21692
- specialtyCodeList: queryParam.specialtyCodeList,
21693
- ruleConfigList: queryParam.ruleConfigList,
21694
- deviceLabel: queryParam.deviceLabel,
21727
+ parentId: params.parentId,
21728
+ deviceCodeOrName: params.deviceCodeOrName,
21729
+ careService: params.careService,
21730
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21731
+ collectStatus: params.collectStatus,
21732
+ meteringDevice: params.meteringDevice,
21733
+ specialDevice: params.specialDevice,
21734
+ specialtyCodeList: params.specialtyCodeList,
21735
+ ruleConfigList: params.ruleConfigList,
21736
+ deviceLabel: params.deviceLabel,
21695
21737
  // 可选,传设备标签的id
21696
- extendedAttrInfoList: queryParam.extendedAttrInfoList // 可选,传设备扩展属性信息
21738
+ extendedAttrInfoList: params.extendedAttrInfoList // 可选,传设备扩展属性信息
21697
21739
  });
21698
21740
  matchDeviceNum(treeData.value, deviceNums);
21699
21741
  };
@@ -21742,20 +21784,21 @@ dayjs_min_default().locale("zh-cn");
21742
21784
  temp = queryParam.deviceCodeOrName;
21743
21785
  queryParam.deviceCodeOrName = undefined;
21744
21786
  }
21787
+ const params = getMergedParams();
21745
21788
  Promise.all(domainPathArr.map(async parentId => {
21746
21789
  return getNextLevelNodesByPage({
21747
21790
  parentId: parentId,
21748
- specificDomainId: queryParam.specificDomainId,
21791
+ specificDomainId: params.specificDomainId,
21749
21792
  authMode: props.authMode,
21750
- deviceCodeOrName: queryParam.deviceCodeOrName,
21751
- careService: queryParam.careService,
21752
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21753
- collectStatus: queryParam.collectStatus,
21754
- meteringDevice: queryParam.meteringDevice,
21755
- specialDevice: queryParam.specialDevice,
21756
- specialtyCodeList: queryParam.specialtyCodeList,
21757
- ruleConfigList: queryParam.ruleConfigList,
21758
- deviceLabelList: queryParam.deviceLabelList,
21793
+ deviceCodeOrName: params.deviceCodeOrName,
21794
+ careService: params.careService,
21795
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21796
+ collectStatus: params.collectStatus,
21797
+ meteringDevice: params.meteringDevice,
21798
+ specialDevice: params.specialDevice,
21799
+ specialtyCodeList: params.specialtyCodeList,
21800
+ ruleConfigList: params.ruleConfigList,
21801
+ deviceLabelList: params.deviceLabelList,
21759
21802
  limit: 500,
21760
21803
  offset: 0
21761
21804
  }).then(async ({
@@ -21778,7 +21821,7 @@ dayjs_min_default().locale("zh-cn");
21778
21821
  return Promise.all([getStateByDeviceCodeListOrDomainIdList({
21779
21822
  domains,
21780
21823
  authMode: props.authMode,
21781
- collectStatus: queryParam.collectStatus
21824
+ collectStatus: params.collectStatus
21782
21825
  }).then(({
21783
21826
  result: domainsInfo
21784
21827
  }) => {
@@ -21789,7 +21832,7 @@ dayjs_min_default().locale("zh-cn");
21789
21832
  }), getStateByDeviceCodeListOrDomainIdList({
21790
21833
  deviceCode: deviceCodes,
21791
21834
  authMode: props.authMode,
21792
- collectStatus: queryParam.collectStatus
21835
+ collectStatus: params.collectStatus
21793
21836
  }).then(({
21794
21837
  result: devicesInfo
21795
21838
  }) => {
@@ -22180,13 +22223,23 @@ dayjs_min_default().locale("zh-cn");
22180
22223
  // 先移除还未保存的临时模式,避免重复
22181
22224
  mockModes.value = mockModes.value.filter(item => !String(item.id).startsWith("mode-"));
22182
22225
  const newId = "mode-" + Date.now();
22226
+
22227
+ // 同步当前UI状态到 queryParam
22228
+ syncQueryParam();
22183
22229
  const saveParams = {
22184
22230
  ...JSON.parse(JSON.stringify(queryParam)),
22185
22231
  current: 1,
22186
22232
  pageSize: 10
22187
22233
  };
22188
22234
  const filters = filterValidParams(saveParams);
22189
- const desc = await mapParamsToLabels(filters);
22235
+
22236
+ // 获取管理域名称
22237
+ let domainPathName = "";
22238
+ if (filters.parentId) {
22239
+ const opt = parentIdOptions.value.find(o => o.value === filters.parentId);
22240
+ domainPathName = opt ? opt.label : filters.parentId;
22241
+ }
22242
+ const desc = await mapParamsToLabels(filters, domainPathName);
22190
22243
  mockModes.value.unshift({
22191
22244
  id: newId,
22192
22245
  name: "新模式",
@@ -22202,13 +22255,23 @@ dayjs_min_default().locale("zh-cn");
22202
22255
  // 先移除还未保存的临时条件,避免重复
22203
22256
  savedConditions.value = savedConditions.value.filter(item => !String(item.id).startsWith("cond-"));
22204
22257
  const newId = "cond-" + Date.now();
22258
+
22259
+ // 同步当前UI状态到 queryParam
22260
+ syncQueryParam();
22205
22261
  const saveParams = {
22206
22262
  ...JSON.parse(JSON.stringify(queryParam)),
22207
22263
  current: 1,
22208
22264
  pageSize: 10
22209
22265
  };
22210
22266
  const filters = filterValidParams(saveParams);
22211
- const desc = await mapParamsToLabels(filters);
22267
+
22268
+ // 获取管理域名称
22269
+ let domainPathName = "";
22270
+ if (filters.parentId) {
22271
+ const opt = parentIdOptions.value.find(o => o.value === filters.parentId);
22272
+ domainPathName = opt ? opt.label : filters.parentId;
22273
+ }
22274
+ const desc = await mapParamsToLabels(filters, domainPathName);
22212
22275
  savedConditions.value.unshift({
22213
22276
  id: newId,
22214
22277
  name: "新建常用条件",
@@ -22319,78 +22382,77 @@ dayjs_min_default().locale("zh-cn");
22319
22382
  }
22320
22383
  });
22321
22384
  };
22322
- const handleItemClick = item => {
22385
+ const handleItemClick = async item => {
22323
22386
  if (item.isEditing) return;
22324
22387
  const filters = item.filters || {};
22325
22388
  // console.log(filters);
22326
22389
  // 1. 重置当前所有条件
22327
- // 如果切换的是模式(drawerType === 'mode'),则以目标模式作为重置的基准
22390
+ // 模式点击不回显,所以始终调用不带参数的重置,确保 UI 区域清空
22391
+ handleReset();
22392
+
22393
+ // 查询管理域关键字生成选项,共queryParam.parentId使用
22394
+ if (item.domainPathName) {
22395
+ let params = {
22396
+ keyword: item.domainPathName
22397
+ };
22398
+ let res = await getDomainListByKeyword(params);
22399
+ let data = res.result || res.data;
22400
+ if (res.code == 200) {
22401
+ if (data.length == 0) {
22402
+ message.warning("管理域数据查询为0!");
22403
+ } else {
22404
+ message.success("数据查询成功!");
22405
+ }
22406
+ } else {
22407
+ message.warning(data.message);
22408
+ return;
22409
+ }
22410
+ parentIdOptions.value = [];
22411
+ data.map(res => {
22412
+ parentIdOptions.value.push({
22413
+ value: res.domainId,
22414
+ label: res.domainNamePath
22415
+ });
22416
+ });
22417
+ }
22418
+ const filtersParams = JSON.parse(JSON.stringify(filters));
22328
22419
  if (drawerType.value === "mode") {
22329
- handleReset(item);
22330
- } else {
22331
- handleReset();
22420
+ activeModeFilters.value = {
22421
+ ...filtersParams
22422
+ }; // 将模式条件存储到影子变量
22423
+ console.log("mode", activeModeFilters.value);
22332
22424
  }
22333
-
22334
- // 2. 应用保存的过滤条件
22335
- Object.assign(queryParam, JSON.parse(JSON.stringify(filters)));
22336
22425
  const params = {
22337
- ...queryParam
22426
+ ...filtersParams
22338
22427
  };
22428
+ // 先算出 id 应该是多少,再统一赋值
22429
+ params.monId = drawerType.value === "mode" ? item.id : currentModeId.value;
22339
22430
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22340
22431
  delete params.monId;
22341
22432
  }
22433
+ console.log("bf", params);
22342
22434
  Object.assign(fetchDataContext, {
22343
22435
  requestParams: params,
22344
22436
  current: 1,
22345
22437
  pageSize: 10
22346
22438
  });
22347
22439
 
22348
- // 3. 同步管理属性 (s, c, m)
22349
- managementAttribute.value = [];
22350
- if (queryParam.specialDevice === 1 || queryParam.specialDevice === "1") managementAttribute.value.push("s");
22351
- if (queryParam.careService === 1 || queryParam.careService === "1") managementAttribute.value.push("c");
22352
- if (queryParam.meteringDevice === 1 || queryParam.meteringDevice === "1") managementAttribute.value.push("m");
22353
-
22354
- // 4. 同步状态选择框
22355
- if (queryParam.collectStatus) {
22356
- collectStatus.value = queryParam.collectStatus;
22357
- }
22358
-
22359
- // 5. 同步管理域显示 (如果 parentIdOptions 中没有该 ID,则手动添加一个项以显示 ID)
22360
- if (queryParam.parentId) {
22361
- const exists = parentIdOptions.value.some(opt => opt.value === queryParam.parentId);
22362
- if (!exists) {
22363
- parentIdOptions.value.push({
22364
- value: queryParam.parentId,
22365
- label: queryParam.parentId // 暂时显示ID,后续如果有需求可以根据ID查询名称
22366
- });
22367
- }
22368
- }
22440
+ // 2. 应用保存的过滤条件,模式不回显
22441
+ if (drawerType.value !== "mode") {
22442
+ Object.assign(queryParam, params);
22443
+ // 3. 同步 UI 状态
22444
+ syncUIState();
22369
22445
 
22370
- // 6. 同步扩展属性
22371
- if (queryParam.extendedAttrInfoList && queryParam.extendedAttrInfoList.length) {
22372
- // 同步级联选择器的值
22373
- cascaderValue.value = queryParam.extendedAttrInfoList.map(attr => {
22374
- if (attr.valueType === 1) {
22375
- return [attr.id, attr.value];
22446
+ // 5. 同步管理域显示 (如果 parentIdOptions 中没有该 ID,则手动添加一个项以显示 ID)
22447
+ if (queryParam.parentId) {
22448
+ const exists = parentIdOptions.value.some(opt => opt.value === queryParam.parentId);
22449
+ if (!exists) {
22450
+ parentIdOptions.value.push({
22451
+ value: queryParam.parentId,
22452
+ label: queryParam.parentId // 暂时显示ID,后续如果有需求可以根据ID查询名称
22453
+ });
22376
22454
  }
22377
- return [attr.id];
22378
- });
22379
-
22380
- // 同步输入框列表并激活显示,确保名称已映射
22381
- extendedAttrInfoList.value = queryParam.extendedAttrInfoList.map(attr => {
22382
- const attrDef = extendedAttrInfoOptions.value.find(o => o.value === attr.id);
22383
- return {
22384
- ...attr,
22385
- name: attrDef ? attrDef.label : attr.name || attr.id
22386
- };
22387
- });
22388
-
22389
- // 根据属性类型激活对应的输入组件显示
22390
- inputValue.value = extendedAttrInfoList.value.some(a => a.valueType === 4);
22391
- dateValue.value = extendedAttrInfoList.value.some(a => a.valueType === 2);
22392
- timeValue.value = extendedAttrInfoList.value.some(a => a.valueType === 3);
22393
- enumeration.value = extendedAttrInfoList.value.some(a => a.valueType === 1);
22455
+ }
22394
22456
  }
22395
22457
 
22396
22458
  // console.log(item);
@@ -22437,7 +22499,6 @@ dayjs_min_default().locale("zh-cn");
22437
22499
  console.log(targetOption);
22438
22500
  targetOption.loading = true;
22439
22501
  if (targetOption.valueType === 1) {
22440
- console.log("sss");
22441
22502
  let res = await getMapListByExtendedAttrId({
22442
22503
  id: targetOption.value
22443
22504
  });
@@ -22453,9 +22514,9 @@ dayjs_min_default().locale("zh-cn");
22453
22514
  extendedAttrInfoOptions.value = [...extendedAttrInfoOptions.value];
22454
22515
  };
22455
22516
  const handleCascaderChange = (value, selectedOptions) => {
22456
- console.log("Cascader Change:", value, selectedOptions);
22457
- if (value && value.length === 1 && value[0].length === 1) {
22458
- cascaderValue.value = [];
22517
+ let targetOption = selectedOptions[selectedOptions.length - 1];
22518
+ if (targetOption && targetOption.valueType == "1" && !targetOption.isLeaf) {
22519
+ cascaderValue.value.pop();
22459
22520
  loadData(selectedOptions);
22460
22521
  return;
22461
22522
  }
@@ -22527,9 +22588,7 @@ dayjs_min_default().locale("zh-cn");
22527
22588
 
22528
22589
  const handleSearch = () => {
22529
22590
  emit("fix", true);
22530
- const params = {
22531
- ...queryParam
22532
- };
22591
+ const params = getMergedParams();
22533
22592
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22534
22593
  delete params.monId;
22535
22594
  }
@@ -22548,10 +22607,8 @@ dayjs_min_default().locale("zh-cn");
22548
22607
  visible.value = true;
22549
22608
  };
22550
22609
  async function handleSeniorQuery() {
22551
- if ("extendedAttrInfoList" in queryParam) {
22552
- delete queryParam.extendedAttrInfoList;
22553
- }
22554
- if (extendedAttrInfoList.value.length > 0) {
22610
+ syncQueryParam();
22611
+ if (queryParam.extendedAttrInfoList && queryParam.extendedAttrInfoList.length > 0) {
22555
22612
  // 校验是否所有选中的属性都填写了值
22556
22613
  const incomplete = extendedAttrInfoList.value.find(item => {
22557
22614
  if (Array.isArray(item.value)) return item.value.length === 0;
@@ -22561,22 +22618,8 @@ dayjs_min_default().locale("zh-cn");
22561
22618
  message.info(`请补充扩展属性 [${incomplete.name}] 的值!`);
22562
22619
  return;
22563
22620
  }
22564
-
22565
- // 构建符合要求的列表(移除展示用的 name 字段)
22566
- queryParam.extendedAttrInfoList = extendedAttrInfoList.value.map(({
22567
- id,
22568
- valueType,
22569
- value
22570
- }) => ({
22571
- id,
22572
- valueType,
22573
- value
22574
- }));
22575
22621
  }
22576
- queryParam.collectStatus = collectStatus.value;
22577
- const params = {
22578
- ...queryParam
22579
- };
22622
+ const params = getMergedParams();
22580
22623
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22581
22624
  delete params.monId;
22582
22625
  }
@@ -22606,50 +22649,7 @@ dayjs_min_default().locale("zh-cn");
22606
22649
  emit("fix", false);
22607
22650
  visible.value = false;
22608
22651
  };
22609
- const handleReset = (targetMode = null) => {
22610
- // 如果第一个参数是事件对象(PointerEvent等),说明是通过点击重置按钮调用的,忽略该参数
22611
- const mode = targetMode && !(targetMode instanceof Event) ? targetMode : null;
22612
-
22613
- // 获取当前模式的条件
22614
- const currentMode = mode || mockModes.value.find(m => m.id === currentModeId.value);
22615
- const modeFilters = currentMode && currentMode.filters ? currentMode.filters : {};
22616
-
22617
- // 定义需要重置的字段及其默认值
22618
- const defaultState = {
22619
- deviceLabel: null,
22620
- parentId: null,
22621
- deviceCodeOrName: null,
22622
- careService: null,
22623
- meteringDevice: null,
22624
- specialDevice: null,
22625
- // collectStatus:
22626
- // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
22627
- collectStatus: null,
22628
- deviceTypeCodeList: [],
22629
- specialtyCodeList: [],
22630
- importanceDegreeCodeList: [],
22631
- ruleConfigList: [],
22632
- extendedAttrInfoList: null,
22633
- showCount: true,
22634
- monId: null
22635
- };
22636
-
22637
- // 1. 重置 queryParam
22638
- Object.keys(defaultState).forEach(key => {
22639
- // 如果当前模式包含该字段且有值,则保留模式的值;否则重置为默认值
22640
- if (key in modeFilters && modeFilters[key] !== undefined && modeFilters[key] !== null && !(Array.isArray(modeFilters[key]) && modeFilters[key].length === 0)) {
22641
- queryParam[key] = modeFilters[key];
22642
- } else {
22643
- queryParam[key] = defaultState[key];
22644
- }
22645
- });
22646
-
22647
- // 特殊处理 monId:如果当前有选中模式,确保 monId 被保留
22648
- if (currentMode && currentMode.id !== undefined && currentMode.id !== null) {
22649
- queryParam.monId = currentMode.id === 0 ? undefined : currentMode.id;
22650
- }
22651
-
22652
- // 2. 同步 UI 状态
22652
+ const syncUIState = () => {
22653
22653
  // 2.1 管理属性 (s, c, m)
22654
22654
  managementAttribute.value = [];
22655
22655
  if (queryParam.specialDevice === 1 || queryParam.specialDevice === "1") managementAttribute.value.push("s");else specialDevice.value = false;
@@ -22680,6 +22680,34 @@ dayjs_min_default().locale("zh-cn");
22680
22680
  timeValue.value = extendedAttrInfoList.value.some(a => a.valueType === 3);
22681
22681
  enumeration.value = extendedAttrInfoList.value.some(a => a.valueType === 1);
22682
22682
  };
22683
+ const handleReset = () => {
22684
+ // 1. 记录当前的 monId (如果 monId 为 0 则统一为 undefined)
22685
+ const savedMonId = currentModeId.value === 0 ? undefined : currentModeId.value;
22686
+
22687
+ // 重置模式条件缓存
22688
+ // activeModeFilters.value = {};
22689
+
22690
+ // 2. 重置 queryParam 为默认状态
22691
+ Object.assign(queryParam, {
22692
+ deviceLabel: null,
22693
+ parentId: null,
22694
+ deviceCodeOrName: null,
22695
+ careService: null,
22696
+ meteringDevice: null,
22697
+ specialDevice: null,
22698
+ collectStatus: null,
22699
+ deviceTypeCodeList: [],
22700
+ specialtyCodeList: [],
22701
+ importanceDegreeCodeList: [],
22702
+ ruleConfigList: [],
22703
+ extendedAttrInfoList: null,
22704
+ showCount: true,
22705
+ monId: savedMonId // 仅保留 monId
22706
+ });
22707
+
22708
+ // 3. 同步 UI 状态
22709
+ syncUIState();
22710
+ };
22683
22711
  const fieldNames = {
22684
22712
  key: "id"
22685
22713
  };
@@ -22974,15 +23002,15 @@ dayjs_min_default().locale("zh-cn");
22974
23002
  }));
22975
23003
  ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=script&lang=js
22976
23004
 
22977
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-74.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-74.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-74.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=f214fea8&lang=less
23005
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-74.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-74.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-74.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=3440af88&lang=less
22978
23006
  // extracted by mini-css-extract-plugin
22979
23007
 
22980
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=f214fea8&lang=less
23008
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=3440af88&lang=less
22981
23009
 
22982
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-74.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-74.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-74.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=f214fea8&lang=less&scoped=true
23010
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-74.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-74.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-74.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-74.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=3440af88&lang=less&scoped=true
22983
23011
  // extracted by mini-css-extract-plugin
22984
23012
 
22985
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=f214fea8&lang=less&scoped=true
23013
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=3440af88&lang=less&scoped=true
22986
23014
 
22987
23015
  ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue
22988
23016
 
@@ -22993,7 +23021,7 @@ dayjs_min_default().locale("zh-cn");
22993
23021
 
22994
23022
 
22995
23023
 
22996
- const baowu_device_tree_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_device_treevue_type_script_lang_js, [['render',baowu_device_treevue_type_template_id_f214fea8_scoped_true_render],['__scopeId',"data-v-f214fea8"]])
23024
+ const baowu_device_tree_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_device_treevue_type_script_lang_js, [['render',baowu_device_treevue_type_template_id_3440af88_scoped_true_render],['__scopeId',"data-v-3440af88"]])
22997
23025
 
22998
23026
  /* harmony default export */ var baowu_device_tree = (baowu_device_tree_exports_);
22999
23027
  ;// CONCATENATED MODULE: ./src/package/index.js