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.
@@ -13903,9 +13903,9 @@ var exportHelper = __webpack_require__(1241);
13903
13903
  const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_test_buttonvue_type_script_lang_js, [['render',render]])
13904
13904
 
13905
13905
  /* harmony default export */ var baowu_test_button = (__exports__);
13906
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
13906
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
13907
13907
 
13908
- const _withScopeId = n => ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.pushScopeId)("data-v-f214fea8"), n = n(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.popScopeId)(), n);
13908
+ const _withScopeId = n => ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.pushScopeId)("data-v-3440af88"), n = n(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.popScopeId)(), n);
13909
13909
  const _hoisted_1 = {
13910
13910
  style: {
13911
13911
  "display": "flex",
@@ -14100,7 +14100,7 @@ const _hoisted_60 = {
14100
14100
  const _hoisted_61 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementVNode)("div", {
14101
14101
  class: "drawer-footer-text"
14102
14102
  }, " 设备树模式为设备树加载时的固有过滤条件,在设备树加载时会固定应用默认模式的过滤条件。该过滤条件不受用户查询条件设置的影响。 ", -1));
14103
- function baowu_device_treevue_type_template_id_f214fea8_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14103
+ function baowu_device_treevue_type_template_id_3440af88_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
14104
14104
  const _component_a_input = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("a-input");
14105
14105
  const _component_a_button = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("a-button");
14106
14106
  const _component_star_filled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("star-filled");
@@ -14636,7 +14636,7 @@ function baowu_device_treevue_type_template_id_f214fea8_scoped_true_render(_ctx,
14636
14636
  _: 1
14637
14637
  }, 8, ["visible", "getContainer", "onOk", "onCancel"])], 512)], 2);
14638
14638
  }
14639
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=f214fea8&scoped=true
14639
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=3440af88&scoped=true
14640
14640
 
14641
14641
  // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js
14642
14642
  var esnext_set_difference_v2 = __webpack_require__(3375);
@@ -16632,7 +16632,7 @@ var TransitionEvents = {
16632
16632
  });
16633
16633
  }
16634
16634
  };
16635
- /* harmony default export */ var css_animation_Event = (TransitionEvents);
16635
+ /* harmony default export */ var Event = (TransitionEvents);
16636
16636
  ;// CONCATENATED MODULE: ./node_modules/ant-design-vue/es/_util/wave.js
16637
16637
 
16638
16638
 
@@ -16728,8 +16728,8 @@ function isNotGrey(color) {
16728
16728
  if (insertExtraNode) {
16729
16729
  node.appendChild(extraNode);
16730
16730
  }
16731
- css_animation_Event.addStartEventListener(node, onTransitionStart);
16732
- css_animation_Event.addEndEventListener(node, onTransitionEnd);
16731
+ Event.addStartEventListener(node, onTransitionStart);
16732
+ Event.addEndEventListener(node, onTransitionEnd);
16733
16733
  };
16734
16734
  var resetEffect = function resetEffect(node) {
16735
16735
  if (!node || node === extraNode || !(node instanceof Element)) {
@@ -16744,8 +16744,8 @@ function isNotGrey(color) {
16744
16744
  if (insertExtraNode && extraNode && node.contains(extraNode)) {
16745
16745
  node.removeChild(extraNode);
16746
16746
  }
16747
- css_animation_Event.removeStartEventListener(node, onTransitionStart);
16748
- css_animation_Event.removeEndEventListener(node, onTransitionEnd);
16747
+ Event.removeStartEventListener(node, onTransitionStart);
16748
+ Event.removeEndEventListener(node, onTransitionEnd);
16749
16749
  };
16750
16750
  var bindAnimationEvent = function bindAnimationEvent(node) {
16751
16751
  if (!node || !node.getAttribute || node.getAttribute('disabled') || node.className.indexOf('disabled') >= 0) {
@@ -21341,6 +21341,49 @@ dayjs_min_default().locale("zh-cn");
21341
21341
  });
21342
21342
  }
21343
21343
  });
21344
+ const queryParam = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.reactive)({
21345
+ authMode: props.authMode,
21346
+ deviceLabel: null,
21347
+ parentId: null,
21348
+ specificDomainId: null,
21349
+ deviceCodeOrName: null,
21350
+ careService: null,
21351
+ meteringDevice: null,
21352
+ specialDevice: null,
21353
+ collectStatus: null,
21354
+ // collectStatus:
21355
+ // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
21356
+ specialtyCodeList: [],
21357
+ importanceDegreeCodeList: [],
21358
+ ruleConfigList: [],
21359
+ limit: 9999,
21360
+ offset: 0,
21361
+ showCount: true,
21362
+ extendedAttrInfoList: null,
21363
+ // 可选,传设备扩展属性信息
21364
+ monId: null // 当前模式ID
21365
+ });
21366
+
21367
+ // 用于存储当前选择模式下的过滤条件(UI不回显,但接口需要带上)
21368
+ const activeModeFilters = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)({});
21369
+
21370
+ /**
21371
+ * 合并 UI 手动输入的过滤条件和模式自带的过滤条件
21372
+ * @returns 合并后的过滤参数
21373
+ */
21374
+ const getMergedParams = () => {
21375
+ // 模式自带条件作为底色,UI 手动输入条件覆盖同名属性
21376
+ const params = {
21377
+ ...activeModeFilters.value
21378
+ };
21379
+ console.log("gm", params);
21380
+ Object.keys(queryParam).forEach(key => {
21381
+ if (queryParam[key] !== null && queryParam[key] !== undefined && (Array.isArray(queryParam[key]) ? queryParam[key].length > 0 : true)) {
21382
+ params[key] = queryParam[key];
21383
+ }
21384
+ });
21385
+ return params;
21386
+ };
21344
21387
  const init = async function () {
21345
21388
  const {
21346
21389
  result
@@ -21352,7 +21395,7 @@ dayjs_min_default().locale("zh-cn");
21352
21395
  // 准备参数,如果 monId 是 0 则不传
21353
21396
  const getBaseParams = (extra = {}) => {
21354
21397
  const p = {
21355
- ...queryParam,
21398
+ ...getMergedParams(),
21356
21399
  ...extra,
21357
21400
  authMode: props.authMode
21358
21401
  };
@@ -21397,7 +21440,7 @@ dayjs_min_default().locale("zh-cn");
21397
21440
  }) => {
21398
21441
  plainOptions.value = result.map(item => ({
21399
21442
  label: item.name,
21400
- value: item.code
21443
+ value: item.code.toString()
21401
21444
  }));
21402
21445
  });
21403
21446
  await getDeviceLabelListFunction();
@@ -21407,28 +21450,25 @@ dayjs_min_default().locale("zh-cn");
21407
21450
  fetchFavoriteList();
21408
21451
  });
21409
21452
  let treeIdInterceptor = null;
21410
- const queryParam = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.reactive)({
21411
- authMode: props.authMode,
21412
- deviceLabel: null,
21413
- parentId: null,
21414
- specificDomainId: null,
21415
- deviceCodeOrName: null,
21416
- careService: null,
21417
- meteringDevice: null,
21418
- specialDevice: null,
21419
- collectStatus: null,
21420
- // collectStatus:
21421
- // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
21422
- specialtyCodeList: [],
21423
- importanceDegreeCodeList: [],
21424
- ruleConfigList: [],
21425
- limit: 9999,
21426
- offset: 0,
21427
- showCount: true,
21428
- extendedAttrInfoList: null,
21429
- // 可选,传设备扩展属性信息
21430
- monId: null // 当前模式ID
21431
- });
21453
+ const syncQueryParam = () => {
21454
+ // 同步状态
21455
+ queryParam.collectStatus = collectStatus.value;
21456
+
21457
+ // 同步扩展属性
21458
+ if (extendedAttrInfoList.value.length > 0) {
21459
+ queryParam.extendedAttrInfoList = extendedAttrInfoList.value.map(({
21460
+ id,
21461
+ valueType,
21462
+ value
21463
+ }) => ({
21464
+ id,
21465
+ valueType,
21466
+ value
21467
+ }));
21468
+ } else {
21469
+ delete queryParam.extendedAttrInfoList;
21470
+ }
21471
+ };
21432
21472
  const fetchDataContext = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.reactive)({
21433
21473
  tableSize: "small",
21434
21474
  stripe: false,
@@ -21471,9 +21511,7 @@ dayjs_min_default().locale("zh-cn");
21471
21511
  });
21472
21512
  // 去激活useFetchData中watch的回调
21473
21513
  queryParam.authMode = newAuthMode;
21474
- const params = {
21475
- ...queryParam
21476
- };
21514
+ const params = getMergedParams();
21477
21515
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
21478
21516
  delete params.monId;
21479
21517
  }
@@ -21504,20 +21542,21 @@ dayjs_min_default().locale("zh-cn");
21504
21542
  resolve();
21505
21543
  return;
21506
21544
  }
21545
+ const params = getMergedParams();
21507
21546
  getNextLevelNodesByPage({
21508
21547
  parentId: a.dataRef.id,
21509
- specificDomainId: queryParam.specificDomainId,
21548
+ specificDomainId: params.specificDomainId,
21510
21549
  authMode: props.authMode,
21511
- deviceCodeOrName: queryParam.deviceCodeOrName,
21512
- careService: queryParam.careService,
21513
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21514
- collectStatus: queryParam.collectStatus,
21515
- meteringDevice: queryParam.meteringDevice,
21516
- specialDevice: queryParam.specialDevice,
21517
- specialtyCodeList: queryParam.specialtyCodeList,
21518
- ruleConfigList: queryParam.ruleConfigList,
21519
- deviceLabel: queryParam.deviceLabel,
21520
- extendedAttrInfoList: queryParam.extendedAttrInfoList,
21550
+ deviceCodeOrName: params.deviceCodeOrName,
21551
+ careService: params.careService,
21552
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21553
+ collectStatus: params.collectStatus,
21554
+ meteringDevice: params.meteringDevice,
21555
+ specialDevice: params.specialDevice,
21556
+ specialtyCodeList: params.specialtyCodeList,
21557
+ ruleConfigList: params.ruleConfigList,
21558
+ deviceLabel: params.deviceLabel,
21559
+ extendedAttrInfoList: params.extendedAttrInfoList,
21521
21560
  limit: 500,
21522
21561
  offset: 0
21523
21562
  }).then(({
@@ -21546,9 +21585,10 @@ dayjs_min_default().locale("zh-cn");
21546
21585
  });
21547
21586
 
21548
21587
  // 使用 Promise.all 等待两个请求完成
21588
+ const pms = getMergedParams();
21549
21589
  Promise.all([getStateByDeviceCodeListOrDomainIdList({
21550
21590
  domains,
21551
- collectStatus: queryParam.collectStatus,
21591
+ collectStatus: pms.collectStatus,
21552
21592
  authMode: props.authMode
21553
21593
  }).then(({
21554
21594
  result: domainsInfo
@@ -21559,7 +21599,7 @@ dayjs_min_default().locale("zh-cn");
21559
21599
  }, {});
21560
21600
  }), getStateByDeviceCodeListOrDomainIdList({
21561
21601
  deviceCode,
21562
- collectStatus: queryParam.collectStatus,
21602
+ collectStatus: pms.collectStatus,
21563
21603
  authMode: props.authMode
21564
21604
  }).then(({
21565
21605
  result: devicesInfo
@@ -21658,24 +21698,26 @@ dayjs_min_default().locale("zh-cn");
21658
21698
  treeNodeList.value = [];
21659
21699
  treeNodeIdList.value = [];
21660
21700
  await recursionTree(treeData.value);
21701
+ const params = getMergedParams();
21702
+ console.log("fq", params);
21661
21703
  // 获得已显示的节点设备数量列表
21662
21704
  const {
21663
21705
  result: deviceNums
21664
21706
  } = await getDeviceNumberByDomainIdList({
21665
21707
  authMode: props.authMode,
21666
21708
  domainIdList: treeNodeIdList.value,
21667
- parentId: queryParam.parentId,
21668
- deviceCodeOrName: queryParam.deviceCodeOrName,
21669
- careService: queryParam.careService,
21670
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21671
- collectStatus: queryParam.collectStatus,
21672
- meteringDevice: queryParam.meteringDevice,
21673
- specialDevice: queryParam.specialDevice,
21674
- specialtyCodeList: queryParam.specialtyCodeList,
21675
- ruleConfigList: queryParam.ruleConfigList,
21676
- deviceLabel: queryParam.deviceLabel,
21709
+ parentId: params.parentId,
21710
+ deviceCodeOrName: params.deviceCodeOrName,
21711
+ careService: params.careService,
21712
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21713
+ collectStatus: params.collectStatus,
21714
+ meteringDevice: params.meteringDevice,
21715
+ specialDevice: params.specialDevice,
21716
+ specialtyCodeList: params.specialtyCodeList,
21717
+ ruleConfigList: params.ruleConfigList,
21718
+ deviceLabel: params.deviceLabel,
21677
21719
  // 可选,传设备标签的id
21678
- extendedAttrInfoList: queryParam.extendedAttrInfoList // 可选,传设备扩展属性信息
21720
+ extendedAttrInfoList: params.extendedAttrInfoList // 可选,传设备扩展属性信息
21679
21721
  });
21680
21722
  matchDeviceNum(treeData.value, deviceNums);
21681
21723
  };
@@ -21724,20 +21766,21 @@ dayjs_min_default().locale("zh-cn");
21724
21766
  temp = queryParam.deviceCodeOrName;
21725
21767
  queryParam.deviceCodeOrName = undefined;
21726
21768
  }
21769
+ const params = getMergedParams();
21727
21770
  Promise.all(domainPathArr.map(async parentId => {
21728
21771
  return getNextLevelNodesByPage({
21729
21772
  parentId: parentId,
21730
- specificDomainId: queryParam.specificDomainId,
21773
+ specificDomainId: params.specificDomainId,
21731
21774
  authMode: props.authMode,
21732
- deviceCodeOrName: queryParam.deviceCodeOrName,
21733
- careService: queryParam.careService,
21734
- importanceDegreeCodeList: queryParam.importanceDegreeCodeList,
21735
- collectStatus: queryParam.collectStatus,
21736
- meteringDevice: queryParam.meteringDevice,
21737
- specialDevice: queryParam.specialDevice,
21738
- specialtyCodeList: queryParam.specialtyCodeList,
21739
- ruleConfigList: queryParam.ruleConfigList,
21740
- deviceLabelList: queryParam.deviceLabelList,
21775
+ deviceCodeOrName: params.deviceCodeOrName,
21776
+ careService: params.careService,
21777
+ importanceDegreeCodeList: params.importanceDegreeCodeList,
21778
+ collectStatus: params.collectStatus,
21779
+ meteringDevice: params.meteringDevice,
21780
+ specialDevice: params.specialDevice,
21781
+ specialtyCodeList: params.specialtyCodeList,
21782
+ ruleConfigList: params.ruleConfigList,
21783
+ deviceLabelList: params.deviceLabelList,
21741
21784
  limit: 500,
21742
21785
  offset: 0
21743
21786
  }).then(async ({
@@ -21760,7 +21803,7 @@ dayjs_min_default().locale("zh-cn");
21760
21803
  return Promise.all([getStateByDeviceCodeListOrDomainIdList({
21761
21804
  domains,
21762
21805
  authMode: props.authMode,
21763
- collectStatus: queryParam.collectStatus
21806
+ collectStatus: params.collectStatus
21764
21807
  }).then(({
21765
21808
  result: domainsInfo
21766
21809
  }) => {
@@ -21771,7 +21814,7 @@ dayjs_min_default().locale("zh-cn");
21771
21814
  }), getStateByDeviceCodeListOrDomainIdList({
21772
21815
  deviceCode: deviceCodes,
21773
21816
  authMode: props.authMode,
21774
- collectStatus: queryParam.collectStatus
21817
+ collectStatus: params.collectStatus
21775
21818
  }).then(({
21776
21819
  result: devicesInfo
21777
21820
  }) => {
@@ -22162,13 +22205,23 @@ dayjs_min_default().locale("zh-cn");
22162
22205
  // 先移除还未保存的临时模式,避免重复
22163
22206
  mockModes.value = mockModes.value.filter(item => !String(item.id).startsWith("mode-"));
22164
22207
  const newId = "mode-" + Date.now();
22208
+
22209
+ // 同步当前UI状态到 queryParam
22210
+ syncQueryParam();
22165
22211
  const saveParams = {
22166
22212
  ...JSON.parse(JSON.stringify(queryParam)),
22167
22213
  current: 1,
22168
22214
  pageSize: 10
22169
22215
  };
22170
22216
  const filters = filterValidParams(saveParams);
22171
- const desc = await mapParamsToLabels(filters);
22217
+
22218
+ // 获取管理域名称
22219
+ let domainPathName = "";
22220
+ if (filters.parentId) {
22221
+ const opt = parentIdOptions.value.find(o => o.value === filters.parentId);
22222
+ domainPathName = opt ? opt.label : filters.parentId;
22223
+ }
22224
+ const desc = await mapParamsToLabels(filters, domainPathName);
22172
22225
  mockModes.value.unshift({
22173
22226
  id: newId,
22174
22227
  name: "新模式",
@@ -22184,13 +22237,23 @@ dayjs_min_default().locale("zh-cn");
22184
22237
  // 先移除还未保存的临时条件,避免重复
22185
22238
  savedConditions.value = savedConditions.value.filter(item => !String(item.id).startsWith("cond-"));
22186
22239
  const newId = "cond-" + Date.now();
22240
+
22241
+ // 同步当前UI状态到 queryParam
22242
+ syncQueryParam();
22187
22243
  const saveParams = {
22188
22244
  ...JSON.parse(JSON.stringify(queryParam)),
22189
22245
  current: 1,
22190
22246
  pageSize: 10
22191
22247
  };
22192
22248
  const filters = filterValidParams(saveParams);
22193
- const desc = await mapParamsToLabels(filters);
22249
+
22250
+ // 获取管理域名称
22251
+ let domainPathName = "";
22252
+ if (filters.parentId) {
22253
+ const opt = parentIdOptions.value.find(o => o.value === filters.parentId);
22254
+ domainPathName = opt ? opt.label : filters.parentId;
22255
+ }
22256
+ const desc = await mapParamsToLabels(filters, domainPathName);
22194
22257
  savedConditions.value.unshift({
22195
22258
  id: newId,
22196
22259
  name: "新建常用条件",
@@ -22301,78 +22364,77 @@ dayjs_min_default().locale("zh-cn");
22301
22364
  }
22302
22365
  });
22303
22366
  };
22304
- const handleItemClick = item => {
22367
+ const handleItemClick = async item => {
22305
22368
  if (item.isEditing) return;
22306
22369
  const filters = item.filters || {};
22307
22370
  // console.log(filters);
22308
22371
  // 1. 重置当前所有条件
22309
- // 如果切换的是模式(drawerType === 'mode'),则以目标模式作为重置的基准
22372
+ // 模式点击不回显,所以始终调用不带参数的重置,确保 UI 区域清空
22373
+ handleReset();
22374
+
22375
+ // 查询管理域关键字生成选项,共queryParam.parentId使用
22376
+ if (item.domainPathName) {
22377
+ let params = {
22378
+ keyword: item.domainPathName
22379
+ };
22380
+ let res = await getDomainListByKeyword(params);
22381
+ let data = res.result || res.data;
22382
+ if (res.code == 200) {
22383
+ if (data.length == 0) {
22384
+ message.warning("管理域数据查询为0!");
22385
+ } else {
22386
+ message.success("数据查询成功!");
22387
+ }
22388
+ } else {
22389
+ message.warning(data.message);
22390
+ return;
22391
+ }
22392
+ parentIdOptions.value = [];
22393
+ data.map(res => {
22394
+ parentIdOptions.value.push({
22395
+ value: res.domainId,
22396
+ label: res.domainNamePath
22397
+ });
22398
+ });
22399
+ }
22400
+ const filtersParams = JSON.parse(JSON.stringify(filters));
22310
22401
  if (drawerType.value === "mode") {
22311
- handleReset(item);
22312
- } else {
22313
- handleReset();
22402
+ activeModeFilters.value = {
22403
+ ...filtersParams
22404
+ }; // 将模式条件存储到影子变量
22405
+ console.log("mode", activeModeFilters.value);
22314
22406
  }
22315
-
22316
- // 2. 应用保存的过滤条件
22317
- Object.assign(queryParam, JSON.parse(JSON.stringify(filters)));
22318
22407
  const params = {
22319
- ...queryParam
22408
+ ...filtersParams
22320
22409
  };
22410
+ // 先算出 id 应该是多少,再统一赋值
22411
+ params.monId = drawerType.value === "mode" ? item.id : currentModeId.value;
22321
22412
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22322
22413
  delete params.monId;
22323
22414
  }
22415
+ console.log("bf", params);
22324
22416
  Object.assign(fetchDataContext, {
22325
22417
  requestParams: params,
22326
22418
  current: 1,
22327
22419
  pageSize: 10
22328
22420
  });
22329
22421
 
22330
- // 3. 同步管理属性 (s, c, m)
22331
- managementAttribute.value = [];
22332
- if (queryParam.specialDevice === 1 || queryParam.specialDevice === "1") managementAttribute.value.push("s");
22333
- if (queryParam.careService === 1 || queryParam.careService === "1") managementAttribute.value.push("c");
22334
- if (queryParam.meteringDevice === 1 || queryParam.meteringDevice === "1") managementAttribute.value.push("m");
22335
-
22336
- // 4. 同步状态选择框
22337
- if (queryParam.collectStatus) {
22338
- collectStatus.value = queryParam.collectStatus;
22339
- }
22340
-
22341
- // 5. 同步管理域显示 (如果 parentIdOptions 中没有该 ID,则手动添加一个项以显示 ID)
22342
- if (queryParam.parentId) {
22343
- const exists = parentIdOptions.value.some(opt => opt.value === queryParam.parentId);
22344
- if (!exists) {
22345
- parentIdOptions.value.push({
22346
- value: queryParam.parentId,
22347
- label: queryParam.parentId // 暂时显示ID,后续如果有需求可以根据ID查询名称
22348
- });
22349
- }
22350
- }
22422
+ // 2. 应用保存的过滤条件,模式不回显
22423
+ if (drawerType.value !== "mode") {
22424
+ Object.assign(queryParam, params);
22425
+ // 3. 同步 UI 状态
22426
+ syncUIState();
22351
22427
 
22352
- // 6. 同步扩展属性
22353
- if (queryParam.extendedAttrInfoList && queryParam.extendedAttrInfoList.length) {
22354
- // 同步级联选择器的值
22355
- cascaderValue.value = queryParam.extendedAttrInfoList.map(attr => {
22356
- if (attr.valueType === 1) {
22357
- return [attr.id, attr.value];
22428
+ // 5. 同步管理域显示 (如果 parentIdOptions 中没有该 ID,则手动添加一个项以显示 ID)
22429
+ if (queryParam.parentId) {
22430
+ const exists = parentIdOptions.value.some(opt => opt.value === queryParam.parentId);
22431
+ if (!exists) {
22432
+ parentIdOptions.value.push({
22433
+ value: queryParam.parentId,
22434
+ label: queryParam.parentId // 暂时显示ID,后续如果有需求可以根据ID查询名称
22435
+ });
22358
22436
  }
22359
- return [attr.id];
22360
- });
22361
-
22362
- // 同步输入框列表并激活显示,确保名称已映射
22363
- extendedAttrInfoList.value = queryParam.extendedAttrInfoList.map(attr => {
22364
- const attrDef = extendedAttrInfoOptions.value.find(o => o.value === attr.id);
22365
- return {
22366
- ...attr,
22367
- name: attrDef ? attrDef.label : attr.name || attr.id
22368
- };
22369
- });
22370
-
22371
- // 根据属性类型激活对应的输入组件显示
22372
- inputValue.value = extendedAttrInfoList.value.some(a => a.valueType === 4);
22373
- dateValue.value = extendedAttrInfoList.value.some(a => a.valueType === 2);
22374
- timeValue.value = extendedAttrInfoList.value.some(a => a.valueType === 3);
22375
- enumeration.value = extendedAttrInfoList.value.some(a => a.valueType === 1);
22437
+ }
22376
22438
  }
22377
22439
 
22378
22440
  // console.log(item);
@@ -22419,7 +22481,6 @@ dayjs_min_default().locale("zh-cn");
22419
22481
  console.log(targetOption);
22420
22482
  targetOption.loading = true;
22421
22483
  if (targetOption.valueType === 1) {
22422
- console.log("sss");
22423
22484
  let res = await getMapListByExtendedAttrId({
22424
22485
  id: targetOption.value
22425
22486
  });
@@ -22435,9 +22496,9 @@ dayjs_min_default().locale("zh-cn");
22435
22496
  extendedAttrInfoOptions.value = [...extendedAttrInfoOptions.value];
22436
22497
  };
22437
22498
  const handleCascaderChange = (value, selectedOptions) => {
22438
- console.log("Cascader Change:", value, selectedOptions);
22439
- if (value && value.length === 1 && value[0].length === 1) {
22440
- cascaderValue.value = [];
22499
+ let targetOption = selectedOptions[selectedOptions.length - 1];
22500
+ if (targetOption && targetOption.valueType == "1" && !targetOption.isLeaf) {
22501
+ cascaderValue.value.pop();
22441
22502
  loadData(selectedOptions);
22442
22503
  return;
22443
22504
  }
@@ -22509,9 +22570,7 @@ dayjs_min_default().locale("zh-cn");
22509
22570
 
22510
22571
  const handleSearch = () => {
22511
22572
  emit("fix", true);
22512
- const params = {
22513
- ...queryParam
22514
- };
22573
+ const params = getMergedParams();
22515
22574
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22516
22575
  delete params.monId;
22517
22576
  }
@@ -22530,10 +22589,8 @@ dayjs_min_default().locale("zh-cn");
22530
22589
  visible.value = true;
22531
22590
  };
22532
22591
  async function handleSeniorQuery() {
22533
- if ("extendedAttrInfoList" in queryParam) {
22534
- delete queryParam.extendedAttrInfoList;
22535
- }
22536
- if (extendedAttrInfoList.value.length > 0) {
22592
+ syncQueryParam();
22593
+ if (queryParam.extendedAttrInfoList && queryParam.extendedAttrInfoList.length > 0) {
22537
22594
  // 校验是否所有选中的属性都填写了值
22538
22595
  const incomplete = extendedAttrInfoList.value.find(item => {
22539
22596
  if (Array.isArray(item.value)) return item.value.length === 0;
@@ -22543,22 +22600,8 @@ dayjs_min_default().locale("zh-cn");
22543
22600
  message.info(`请补充扩展属性 [${incomplete.name}] 的值!`);
22544
22601
  return;
22545
22602
  }
22546
-
22547
- // 构建符合要求的列表(移除展示用的 name 字段)
22548
- queryParam.extendedAttrInfoList = extendedAttrInfoList.value.map(({
22549
- id,
22550
- valueType,
22551
- value
22552
- }) => ({
22553
- id,
22554
- valueType,
22555
- value
22556
- }));
22557
22603
  }
22558
- queryParam.collectStatus = collectStatus.value;
22559
- const params = {
22560
- ...queryParam
22561
- };
22604
+ const params = getMergedParams();
22562
22605
  if (params.monId === 0 || params.monId === undefined || params.monId === null) {
22563
22606
  delete params.monId;
22564
22607
  }
@@ -22588,50 +22631,7 @@ dayjs_min_default().locale("zh-cn");
22588
22631
  emit("fix", false);
22589
22632
  visible.value = false;
22590
22633
  };
22591
- const handleReset = (targetMode = null) => {
22592
- // 如果第一个参数是事件对象(PointerEvent等),说明是通过点击重置按钮调用的,忽略该参数
22593
- const mode = targetMode && !(targetMode instanceof Event) ? targetMode : null;
22594
-
22595
- // 获取当前模式的条件
22596
- const currentMode = mode || mockModes.value.find(m => m.id === currentModeId.value);
22597
- const modeFilters = currentMode && currentMode.filters ? currentMode.filters : {};
22598
-
22599
- // 定义需要重置的字段及其默认值
22600
- const defaultState = {
22601
- deviceLabel: null,
22602
- parentId: null,
22603
- deviceCodeOrName: null,
22604
- careService: null,
22605
- meteringDevice: null,
22606
- specialDevice: null,
22607
- // collectStatus:
22608
- // (ifTest || ifXj) && treeMode.value == "actived" ? "1" : null,
22609
- collectStatus: null,
22610
- deviceTypeCodeList: [],
22611
- specialtyCodeList: [],
22612
- importanceDegreeCodeList: [],
22613
- ruleConfigList: [],
22614
- extendedAttrInfoList: null,
22615
- showCount: true,
22616
- monId: null
22617
- };
22618
-
22619
- // 1. 重置 queryParam
22620
- Object.keys(defaultState).forEach(key => {
22621
- // 如果当前模式包含该字段且有值,则保留模式的值;否则重置为默认值
22622
- if (key in modeFilters && modeFilters[key] !== undefined && modeFilters[key] !== null && !(Array.isArray(modeFilters[key]) && modeFilters[key].length === 0)) {
22623
- queryParam[key] = modeFilters[key];
22624
- } else {
22625
- queryParam[key] = defaultState[key];
22626
- }
22627
- });
22628
-
22629
- // 特殊处理 monId:如果当前有选中模式,确保 monId 被保留
22630
- if (currentMode && currentMode.id !== undefined && currentMode.id !== null) {
22631
- queryParam.monId = currentMode.id === 0 ? undefined : currentMode.id;
22632
- }
22633
-
22634
- // 2. 同步 UI 状态
22634
+ const syncUIState = () => {
22635
22635
  // 2.1 管理属性 (s, c, m)
22636
22636
  managementAttribute.value = [];
22637
22637
  if (queryParam.specialDevice === 1 || queryParam.specialDevice === "1") managementAttribute.value.push("s");else specialDevice.value = false;
@@ -22662,6 +22662,34 @@ dayjs_min_default().locale("zh-cn");
22662
22662
  timeValue.value = extendedAttrInfoList.value.some(a => a.valueType === 3);
22663
22663
  enumeration.value = extendedAttrInfoList.value.some(a => a.valueType === 1);
22664
22664
  };
22665
+ const handleReset = () => {
22666
+ // 1. 记录当前的 monId (如果 monId 为 0 则统一为 undefined)
22667
+ const savedMonId = currentModeId.value === 0 ? undefined : currentModeId.value;
22668
+
22669
+ // 重置模式条件缓存
22670
+ // activeModeFilters.value = {};
22671
+
22672
+ // 2. 重置 queryParam 为默认状态
22673
+ Object.assign(queryParam, {
22674
+ deviceLabel: null,
22675
+ parentId: null,
22676
+ deviceCodeOrName: null,
22677
+ careService: null,
22678
+ meteringDevice: null,
22679
+ specialDevice: null,
22680
+ collectStatus: null,
22681
+ deviceTypeCodeList: [],
22682
+ specialtyCodeList: [],
22683
+ importanceDegreeCodeList: [],
22684
+ ruleConfigList: [],
22685
+ extendedAttrInfoList: null,
22686
+ showCount: true,
22687
+ monId: savedMonId // 仅保留 monId
22688
+ });
22689
+
22690
+ // 3. 同步 UI 状态
22691
+ syncUIState();
22692
+ };
22665
22693
  const fieldNames = {
22666
22694
  key: "id"
22667
22695
  };
@@ -22956,15 +22984,15 @@ dayjs_min_default().locale("zh-cn");
22956
22984
  }));
22957
22985
  ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=script&lang=js
22958
22986
 
22959
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.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
22987
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.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
22960
22988
  // extracted by mini-css-extract-plugin
22961
22989
 
22962
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=f214fea8&lang=less
22990
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=3440af88&lang=less
22963
22991
 
22964
- ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.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
22992
+ ;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.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
22965
22993
  // extracted by mini-css-extract-plugin
22966
22994
 
22967
- ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=f214fea8&lang=less&scoped=true
22995
+ ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=1&id=3440af88&lang=less&scoped=true
22968
22996
 
22969
22997
  ;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue
22970
22998
 
@@ -22975,7 +23003,7 @@ dayjs_min_default().locale("zh-cn");
22975
23003
 
22976
23004
 
22977
23005
 
22978
- 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"]])
23006
+ 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"]])
22979
23007
 
22980
23008
  /* harmony default export */ var baowu_device_tree = (baowu_device_tree_exports_);
22981
23009
  ;// CONCATENATED MODULE: ./src/package/index.js