完善优化

This commit is contained in:
KangKang0928 2024-08-23 16:29:43 +08:00
parent eb370cd4ed
commit b691702778
1 changed files with 31 additions and 15 deletions

View File

@ -110,31 +110,41 @@ export default {
}
});
const findLabelsByCode = (tree, codes) => {
const labels = [];
// console.log("row.cityCodes",row.cityCodes);
//
//
let paths = [];
if (codes == "0") {
return "中国";
return ["中国"];
}
function searchTree(node) {
// code codes label
if (codes?.includes(node.code)) {
labels.push(node.name);
//
function searchTree(node, currentPath) {
//
currentPath.push(node.name);
// code codes
if (codes.includes(node.code)) {
paths.push([...currentPath]); //
}
//
if (node.children) {
for (let child of node.children) {
searchTree(child);
searchTree(child, currentPath);
}
}
//
currentPath.pop();
}
// searchTree
for (let node of tree) {
searchTree(node);
searchTree(node, []);
}
return labels.join(",");
//
return paths.map((path) =><p>{path.join("/")}</p>);
};
const appointMapper = {
@ -176,10 +186,16 @@ export default {
};
//
const openPreview = (str) => {
this.$confirm(str, "详情", {
showCancelButton: false,
confirmButtonText:"好的"
});
this.$confirm(
<div style="max-height:50vh;overflow-y:auto;line-height:1.5rem;">
{str}
</div>,
"详情",
{
showCancelButton: false,
confirmButtonText: "好的",
}
);
};
return (
<div class="mb-5">