comp-adv3210 1.0.31 → 1.0.33
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/comp-adv3210.common.js +103 -74
- package/comp-adv3210.common.js.map +1 -1
- package/comp-adv3210.css +1 -1
- package/comp-adv3210.umd.js +103 -74
- package/comp-adv3210.umd.js.map +1 -1
- package/comp-adv3210.umd.min.js +2 -2
- package/comp-adv3210.umd.min.js.map +1 -1
- package/package.json +1 -1
package/comp-adv3210.common.js
CHANGED
|
@@ -12768,9 +12768,9 @@ var exportHelper = __webpack_require__(1241);
|
|
|
12768
12768
|
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_test_buttonvue_type_script_lang_js, [['render',render]])
|
|
12769
12769
|
|
|
12770
12770
|
/* harmony default export */ var baowu_test_button = (__exports__);
|
|
12771
|
-
;// 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=
|
|
12771
|
+
;// 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=47fc67f1&scoped=true
|
|
12772
12772
|
|
|
12773
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
12773
|
+
const _withScopeId = n => (_pushScopeId("data-v-47fc67f1"), n = n(), _popScopeId(), n);
|
|
12774
12774
|
const _hoisted_1 = {
|
|
12775
12775
|
style: {
|
|
12776
12776
|
"height": "100%"
|
|
@@ -12806,7 +12806,7 @@ const _hoisted_11 = {
|
|
|
12806
12806
|
"margin-top": "10px"
|
|
12807
12807
|
}
|
|
12808
12808
|
};
|
|
12809
|
-
function
|
|
12809
|
+
function baowu_device_treevue_type_template_id_47fc67f1_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12810
12810
|
const _component_a_input = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("a-input");
|
|
12811
12811
|
const _component_a_button = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("a-button");
|
|
12812
12812
|
const _component_a_tree = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.resolveComponent)("a-tree");
|
|
@@ -13324,7 +13324,7 @@ function baowu_device_treevue_type_template_id_7d2c5eb8_scoped_true_render(_ctx,
|
|
|
13324
13324
|
_: 1
|
|
13325
13325
|
}, 8, ["visible", "getContainer", "onOk", "onCancel"])], 512)]);
|
|
13326
13326
|
}
|
|
13327
|
-
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=
|
|
13327
|
+
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=template&id=47fc67f1&scoped=true
|
|
13328
13328
|
|
|
13329
13329
|
;// CONCATENATED MODULE: ./src/package/api/device-tree.js
|
|
13330
13330
|
|
|
@@ -15841,6 +15841,10 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
15841
15841
|
onlyLeafSelectable: {
|
|
15842
15842
|
type: Boolean,
|
|
15843
15843
|
default: false
|
|
15844
|
+
},
|
|
15845
|
+
selectedNodeInfo: {
|
|
15846
|
+
type: Object,
|
|
15847
|
+
default: () => {}
|
|
15844
15848
|
}
|
|
15845
15849
|
},
|
|
15846
15850
|
setup(props, {
|
|
@@ -15887,6 +15891,79 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
15887
15891
|
// const ifXj = true;
|
|
15888
15892
|
const treeMode = (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.ref)(localStorage.getItem("xjTreeMode") == null || localStorage.getItem("xjTreeMode") == undefined || localStorage.getItem("xjTreeMode") == "" || !localStorage.getItem("xjTreeMode") ? "actived" : localStorage.getItem("xjTreeMode")); // all全部设备 actived仅启用设备
|
|
15889
15893
|
console.log(`当前环境,测试${ifTest},邢机${ifXj}`);
|
|
15894
|
+
const checkNodeExists = (deviceCode, nodeId) => {
|
|
15895
|
+
if (deviceCode) {
|
|
15896
|
+
if (deviceCode.includes("/")) {
|
|
15897
|
+
deviceCode = deviceCode.replace(/\//g, "\\/");
|
|
15898
|
+
}
|
|
15899
|
+
return document.querySelector("#deviceCode" + deviceCode) !== null;
|
|
15900
|
+
} else {
|
|
15901
|
+
return document.querySelector("#domainId" + nodeId) !== null;
|
|
15902
|
+
}
|
|
15903
|
+
};
|
|
15904
|
+
const scrollToNode = (deviceCode, nodeId) => {
|
|
15905
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.nextTick)(() => {
|
|
15906
|
+
if (deviceCode) {
|
|
15907
|
+
if (deviceCode.includes("/")) {
|
|
15908
|
+
deviceCode = deviceCode.replace(/\//g, "\\/");
|
|
15909
|
+
}
|
|
15910
|
+
document.querySelector("#deviceCode" + deviceCode)?.scrollIntoView({
|
|
15911
|
+
behavior: "smooth",
|
|
15912
|
+
block: "center",
|
|
15913
|
+
inline: "start"
|
|
15914
|
+
});
|
|
15915
|
+
setTimeout(() => {
|
|
15916
|
+
document.querySelector("#deviceCode" + deviceCode)?.click();
|
|
15917
|
+
}, 500);
|
|
15918
|
+
} else {
|
|
15919
|
+
document.querySelector("#domainId" + nodeId)?.scrollIntoView({
|
|
15920
|
+
behavior: "smooth",
|
|
15921
|
+
block: "center",
|
|
15922
|
+
inline: "start"
|
|
15923
|
+
});
|
|
15924
|
+
setTimeout(() => {
|
|
15925
|
+
document.querySelector("#domainId" + nodeId)?.click();
|
|
15926
|
+
}, 500);
|
|
15927
|
+
}
|
|
15928
|
+
});
|
|
15929
|
+
};
|
|
15930
|
+
const waitForNodeAndScroll = (deviceCode, nodeId, maxWaitTime = 5000, checkIntervalTime = 100) => {
|
|
15931
|
+
return new Promise(resolve => {
|
|
15932
|
+
const checkInterval = setInterval(() => {
|
|
15933
|
+
if (checkNodeExists(deviceCode, nodeId)) {
|
|
15934
|
+
console.log("find");
|
|
15935
|
+
clearInterval(checkInterval);
|
|
15936
|
+
scrollToNode(deviceCode, nodeId);
|
|
15937
|
+
resolve(true);
|
|
15938
|
+
}
|
|
15939
|
+
}, checkIntervalTime);
|
|
15940
|
+
|
|
15941
|
+
// 设置最大等待时间,防止无限等待
|
|
15942
|
+
setTimeout(() => {
|
|
15943
|
+
clearInterval(checkInterval);
|
|
15944
|
+
resolve(false);
|
|
15945
|
+
}, maxWaitTime);
|
|
15946
|
+
});
|
|
15947
|
+
};
|
|
15948
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.watch)(() => props.selectedNodeInfo, newVal => {
|
|
15949
|
+
const {
|
|
15950
|
+
domainPath,
|
|
15951
|
+
deviceCode
|
|
15952
|
+
} = newVal;
|
|
15953
|
+
if (domainPath) {
|
|
15954
|
+
const domainId = domainPath.split("/").pop();
|
|
15955
|
+
const domainPathArr = domainPath.split("/");
|
|
15956
|
+
domainPathArr.unshift("0");
|
|
15957
|
+
if (!deviceCode) {
|
|
15958
|
+
domainPathArr.pop();
|
|
15959
|
+
}
|
|
15960
|
+
// 设置展开节点
|
|
15961
|
+
expandedKeys.value = domainPathArr;
|
|
15962
|
+
waitForNodeAndScroll(deviceCode, domainId);
|
|
15963
|
+
}
|
|
15964
|
+
}, {
|
|
15965
|
+
deep: true
|
|
15966
|
+
});
|
|
15890
15967
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.onMounted)(() => {
|
|
15891
15968
|
if (!props.historySelect) return;
|
|
15892
15969
|
const selectedNode = sessionStorage.getItem("treeNode");
|
|
@@ -15904,51 +15981,12 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
15904
15981
|
expandedKeys.value = domainPathArr;
|
|
15905
15982
|
|
|
15906
15983
|
// 检查节点是否存在的函数
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
}
|
|
15912
|
-
return document.querySelector("#deviceCode" + deviceCode) !== null;
|
|
15913
|
-
} else {
|
|
15914
|
-
console.log(node.name);
|
|
15915
|
-
return document.querySelector("#domainId" + node.id) !== null;
|
|
15984
|
+
// 使用提取的公共函数
|
|
15985
|
+
waitForNodeAndScroll(deviceCode, node.id).then(found => {
|
|
15986
|
+
if (!found) {
|
|
15987
|
+
console.warn("Node not found");
|
|
15916
15988
|
}
|
|
15917
|
-
};
|
|
15918
|
-
|
|
15919
|
-
// 使用轮询方式检查节点是否存在
|
|
15920
|
-
const checkInterval = setInterval(() => {
|
|
15921
|
-
if (checkNodeExists()) {
|
|
15922
|
-
console.log("find");
|
|
15923
|
-
clearInterval(checkInterval);
|
|
15924
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.nextTick)(() => {
|
|
15925
|
-
if (deviceCode) {
|
|
15926
|
-
document.querySelector("#deviceCode" + deviceCode)?.scrollIntoView({
|
|
15927
|
-
behavior: "smooth",
|
|
15928
|
-
block: "center",
|
|
15929
|
-
inline: "start"
|
|
15930
|
-
});
|
|
15931
|
-
setTimeout(() => {
|
|
15932
|
-
document.querySelector("#deviceCode" + deviceCode)?.click();
|
|
15933
|
-
}, 500);
|
|
15934
|
-
} else {
|
|
15935
|
-
document.querySelector("#domainId" + node.id)?.scrollIntoView({
|
|
15936
|
-
behavior: "smooth",
|
|
15937
|
-
block: "center",
|
|
15938
|
-
inline: "start"
|
|
15939
|
-
});
|
|
15940
|
-
setTimeout(() => {
|
|
15941
|
-
document.querySelector("#domainId" + node.id)?.click();
|
|
15942
|
-
}, 500);
|
|
15943
|
-
}
|
|
15944
|
-
});
|
|
15945
|
-
}
|
|
15946
|
-
}, 100); // 每100ms检查一次
|
|
15947
|
-
|
|
15948
|
-
// 设置最大等待时间,防止无限等待
|
|
15949
|
-
setTimeout(() => {
|
|
15950
|
-
clearInterval(checkInterval);
|
|
15951
|
-
}, 5000); // 5秒后超时
|
|
15989
|
+
});
|
|
15952
15990
|
}
|
|
15953
15991
|
});
|
|
15954
15992
|
const init = async function () {
|
|
@@ -15977,8 +16015,10 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
15977
16015
|
result.isLeaf = false;
|
|
15978
16016
|
if (props.onlyLeafSelectable) {
|
|
15979
16017
|
result.selectable = false;
|
|
15980
|
-
//
|
|
15981
|
-
|
|
16018
|
+
// 只选设备节点且没有历史选择,自动展开
|
|
16019
|
+
if (!props.historySelect || !sessionStorage.getItem("treeNode")) {
|
|
16020
|
+
expandedKeys.value = [result.id];
|
|
16021
|
+
}
|
|
15982
16022
|
}
|
|
15983
16023
|
rootNode.value = result;
|
|
15984
16024
|
treeData.value = [result];
|
|
@@ -15988,10 +16028,6 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
15988
16028
|
document.querySelector("#domainId" + id).click();
|
|
15989
16029
|
});
|
|
15990
16030
|
}
|
|
15991
|
-
|
|
15992
|
-
// setTimeout(() => {
|
|
15993
|
-
// document.querySelector("#deviceCode" + deviceCode).click();
|
|
15994
|
-
// });
|
|
15995
16031
|
};
|
|
15996
16032
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.onMounted)(() => {
|
|
15997
16033
|
init();
|
|
@@ -16168,23 +16204,16 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
16168
16204
|
a.dataRef.isLeaf = true;
|
|
16169
16205
|
}
|
|
16170
16206
|
treeData.value = [...treeData.value];
|
|
16171
|
-
//
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
// } else {
|
|
16182
|
-
// expandedKeys.value = [
|
|
16183
|
-
// ...expandedKeys.value,
|
|
16184
|
-
// a.dataRef.children[0].id,
|
|
16185
|
-
// ];
|
|
16186
|
-
// }
|
|
16187
|
-
// }
|
|
16207
|
+
// 没有历史选择,默认选到第一个设备节点
|
|
16208
|
+
if (props.onlyLeafSelectable && (!props.historySelect || !sessionStorage.getItem("treeNode"))) {
|
|
16209
|
+
if (a.dataRef.children[0].isLeaf) {
|
|
16210
|
+
setTimeout(() => {
|
|
16211
|
+
document.querySelector("#deviceCode" + a.dataRef.children[0].deviceCode)?.click();
|
|
16212
|
+
}, 500);
|
|
16213
|
+
} else {
|
|
16214
|
+
expandedKeys.value = [...expandedKeys.value, a.dataRef.children[0].id];
|
|
16215
|
+
}
|
|
16216
|
+
}
|
|
16188
16217
|
resolve();
|
|
16189
16218
|
});
|
|
16190
16219
|
});
|
|
@@ -16797,10 +16826,10 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
16797
16826
|
}));
|
|
16798
16827
|
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=script&lang=js
|
|
16799
16828
|
|
|
16800
|
-
;// 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=
|
|
16829
|
+
;// 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=47fc67f1&lang=less&scoped=true
|
|
16801
16830
|
// extracted by mini-css-extract-plugin
|
|
16802
16831
|
|
|
16803
|
-
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=
|
|
16832
|
+
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue?vue&type=style&index=0&id=47fc67f1&lang=less&scoped=true
|
|
16804
16833
|
|
|
16805
16834
|
;// CONCATENATED MODULE: ./src/package/baowu-device-tree/baowu-device-tree.vue
|
|
16806
16835
|
|
|
@@ -16810,7 +16839,7 @@ ReloadOutlined_ReloadOutlined.inheritAttrs = false;
|
|
|
16810
16839
|
;
|
|
16811
16840
|
|
|
16812
16841
|
|
|
16813
|
-
const baowu_device_tree_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_device_treevue_type_script_lang_js, [['render',
|
|
16842
|
+
const baowu_device_tree_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(baowu_device_treevue_type_script_lang_js, [['render',baowu_device_treevue_type_template_id_47fc67f1_scoped_true_render],['__scopeId',"data-v-47fc67f1"]])
|
|
16814
16843
|
|
|
16815
16844
|
/* harmony default export */ var baowu_device_tree = (baowu_device_tree_exports_);
|
|
16816
16845
|
;// CONCATENATED MODULE: ./src/package/index.js
|