@cmstops/pro-compo 3.9.2-alpha.21 → 3.9.2-alpha.23
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/es/contentModal/components/ViewAllColumn/MediaFilter/index.js +6 -177
- package/es/contentModal/components/ViewAllColumn/index.js +0 -1
- package/es/contentModal/script/api.js +1 -7
- package/es/selectAddTo/component.js +23 -102
- package/es/selectAddTo/components/SelectAddToView.js +91 -0
- package/es/selectAddTo/components/SelectAddToView.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
- package/es/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +1 -4
- package/es/selectAddTo/components/ViewAllColumn/index.js +21 -18
- package/es/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +31 -7
- package/es/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +3 -14
- package/es/selectAddTo/index.js +1 -10
- package/es/selectAddTo/script/api.js +1 -14
- package/es/selectAddTo/script/useSelectAddToState.js +16 -67
- package/es/selectThumb/component.js +9 -9
- package/es/style.css +24 -18
- package/lib/contentModal/components/ViewAllColumn/MediaFilter/index.js +5 -176
- package/lib/contentModal/components/ViewAllColumn/index.js +0 -1
- package/lib/contentModal/script/api.js +0 -7
- package/lib/index.js +1 -1
- package/lib/selectAddTo/component.js +22 -101
- package/lib/selectAddTo/components/SelectAddToView.js +92 -0
- package/lib/selectAddTo/components/SelectAddToView.vue_vue_type_style_index_0_scoped_true_lang.js +3 -0
- package/lib/selectAddTo/components/ViewAllColumn/MediaFilter/index.js +1 -4
- package/lib/selectAddTo/components/ViewAllColumn/index.js +20 -17
- package/lib/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +34 -6
- package/lib/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +3 -14
- package/lib/selectAddTo/index.js +2 -12
- package/lib/selectAddTo/script/api.js +0 -15
- package/lib/selectAddTo/script/useSelectAddToState.js +16 -67
- package/lib/selectThumb/component.js +9 -9
- package/package.json +1 -1
- package/es/contentModal/components/ViewAllColumn/columnTree/index.js +0 -151
- package/es/selectAddTo/components/ViewAllColumn/columnTree/index.js +0 -151
- package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +0 -152
- package/lib/selectAddTo/components/ViewAllColumn/columnTree/index.js +0 -152
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { Popover, InputSearch, Scrollbar, Tree, Button } from "@arco-design/web-vue";
|
|
3
|
-
import { IconDragDotVertical, IconCaretRight } from "@arco-design/web-vue/es/icon";
|
|
4
|
-
import { getCategoryPath } from "../../../script/api.js";
|
|
5
|
-
const _hoisted_1 = { class: "column-selection-container" };
|
|
6
|
-
const _hoisted_2 = { class: "search-column" };
|
|
7
|
-
const _sfc_main = defineComponent({
|
|
8
|
-
...{ name: "columnTree" },
|
|
9
|
-
__name: "index",
|
|
10
|
-
props: {
|
|
11
|
-
column_id: {},
|
|
12
|
-
tree: {},
|
|
13
|
-
height: {},
|
|
14
|
-
userInfo: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:column_id"],
|
|
17
|
-
setup(__props, { emit: __emit }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const emit = __emit;
|
|
20
|
-
const treeOptions = {
|
|
21
|
-
title: "alias",
|
|
22
|
-
isLeaf: "leaf"
|
|
23
|
-
};
|
|
24
|
-
const selectAlias = ref("\u5168\u90E8\u5185\u5BB9");
|
|
25
|
-
const lastSearchKey = ref(window.localStorage.getItem("lastSearchKey") || "");
|
|
26
|
-
const searchKey = ref("");
|
|
27
|
-
const aTreeRef = ref();
|
|
28
|
-
const treeData = computed(() => {
|
|
29
|
-
if (!searchKey.value)
|
|
30
|
-
return props.tree;
|
|
31
|
-
return searchData(searchKey.value);
|
|
32
|
-
});
|
|
33
|
-
const searchData = (keyword) => {
|
|
34
|
-
const loop = (data) => {
|
|
35
|
-
const result = [];
|
|
36
|
-
data.forEach((item) => {
|
|
37
|
-
var _a;
|
|
38
|
-
if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
|
|
39
|
-
result.push({ ...item });
|
|
40
|
-
} else if (item.children) {
|
|
41
|
-
const filterData = loop(item.children);
|
|
42
|
-
if (filterData.length) {
|
|
43
|
-
result.push({
|
|
44
|
-
...item,
|
|
45
|
-
children: filterData
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return result;
|
|
51
|
-
};
|
|
52
|
-
return loop(props.tree);
|
|
53
|
-
};
|
|
54
|
-
const clickLastItem = () => {
|
|
55
|
-
aTreeRef.value.selectNode(lastSearchKey.value, true);
|
|
56
|
-
};
|
|
57
|
-
watch(
|
|
58
|
-
() => props.column_id,
|
|
59
|
-
(val) => {
|
|
60
|
-
setSelectAlias(val);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const setSelectAlias = async (id) => {
|
|
64
|
-
if (id === "all") {
|
|
65
|
-
selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const { code, message } = await getCategoryPath(props.userInfo.BASE_API, {
|
|
69
|
-
repo: props.userInfo.repository_id,
|
|
70
|
-
category: id
|
|
71
|
-
});
|
|
72
|
-
if (code === 0) {
|
|
73
|
-
const pathArr = [];
|
|
74
|
-
for (const i of message) {
|
|
75
|
-
pathArr.push(i.category_alias);
|
|
76
|
-
}
|
|
77
|
-
selectAlias.value = pathArr.join("/");
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const AddColumnSelected = (selectedKeys, data) => {
|
|
81
|
-
lastSearchKey.value = selectedKeys[0];
|
|
82
|
-
window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
|
|
83
|
-
emit("update:column_id", data.node.id);
|
|
84
|
-
};
|
|
85
|
-
return (_ctx, _cache) => {
|
|
86
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
87
|
-
createVNode(unref(Popover), {
|
|
88
|
-
"content-style": { minWidth: "120px" },
|
|
89
|
-
"content-class": "column-selection-popover-content",
|
|
90
|
-
position: "bottom",
|
|
91
|
-
trigger: "click"
|
|
92
|
-
}, {
|
|
93
|
-
content: withCtx(() => [
|
|
94
|
-
createElementVNode("div", _hoisted_2, [
|
|
95
|
-
createVNode(unref(InputSearch), {
|
|
96
|
-
modelValue: searchKey.value,
|
|
97
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
|
|
98
|
-
placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
|
|
99
|
-
}, null, 8, ["modelValue"])
|
|
100
|
-
]),
|
|
101
|
-
lastSearchKey.value ? (openBlock(), createElementBlock("div", {
|
|
102
|
-
key: 0,
|
|
103
|
-
class: "last-search-key",
|
|
104
|
-
onClick: clickLastItem
|
|
105
|
-
}, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : createCommentVNode("v-if", true),
|
|
106
|
-
createElementVNode("div", {
|
|
107
|
-
style: normalizeStyle({ minHeight: props.height + "px" }),
|
|
108
|
-
class: "column-selection-main"
|
|
109
|
-
}, [
|
|
110
|
-
createElementVNode("div", {
|
|
111
|
-
style: normalizeStyle({ height: props.height + "px" }),
|
|
112
|
-
class: "column-v"
|
|
113
|
-
}, [
|
|
114
|
-
createVNode(unref(Scrollbar), {
|
|
115
|
-
"outer-class": "column-outer-scrollbar",
|
|
116
|
-
style: { "height": "100%", "overflow": "auto" }
|
|
117
|
-
}, {
|
|
118
|
-
default: withCtx(() => [
|
|
119
|
-
createVNode(unref(Tree), {
|
|
120
|
-
ref_key: "aTreeRef",
|
|
121
|
-
ref: aTreeRef,
|
|
122
|
-
data: treeData.value,
|
|
123
|
-
"default-expand-all": false,
|
|
124
|
-
"field-names": treeOptions,
|
|
125
|
-
"block-node": "",
|
|
126
|
-
"check-strictly": "",
|
|
127
|
-
onSelect: AddColumnSelected
|
|
128
|
-
}, null, 8, ["data"])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
})
|
|
132
|
-
], 4)
|
|
133
|
-
], 4)
|
|
134
|
-
]),
|
|
135
|
-
default: withCtx(() => [
|
|
136
|
-
createVNode(unref(Button), { class: "button" }, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(unref(IconDragDotVertical)),
|
|
139
|
-
createTextVNode(" " + toDisplayString(selectAlias.value) + " ", 1),
|
|
140
|
-
createVNode(unref(IconCaretRight))
|
|
141
|
-
]),
|
|
142
|
-
_: 1
|
|
143
|
-
})
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
})
|
|
147
|
-
]);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
export { _sfc_main as default };
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { Popover, InputSearch, Scrollbar, Tree, Button } from "@arco-design/web-vue";
|
|
3
|
-
import { IconDragDotVertical, IconCaretRight } from "@arco-design/web-vue/es/icon";
|
|
4
|
-
import { getCategoryPath } from "../../../script/api.js";
|
|
5
|
-
const _hoisted_1 = { class: "column-selection-container" };
|
|
6
|
-
const _hoisted_2 = { class: "search-column" };
|
|
7
|
-
const _sfc_main = defineComponent({
|
|
8
|
-
...{ name: "columnTree" },
|
|
9
|
-
__name: "index",
|
|
10
|
-
props: {
|
|
11
|
-
column_id: {},
|
|
12
|
-
tree: {},
|
|
13
|
-
height: {},
|
|
14
|
-
userInfo: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:column_id"],
|
|
17
|
-
setup(__props, { emit: __emit }) {
|
|
18
|
-
const props = __props;
|
|
19
|
-
const emit = __emit;
|
|
20
|
-
const treeOptions = {
|
|
21
|
-
title: "alias",
|
|
22
|
-
isLeaf: "leaf"
|
|
23
|
-
};
|
|
24
|
-
const selectAlias = ref("\u5168\u90E8\u5185\u5BB9");
|
|
25
|
-
const lastSearchKey = ref(window.localStorage.getItem("lastSearchKey") || "");
|
|
26
|
-
const searchKey = ref("");
|
|
27
|
-
const aTreeRef = ref();
|
|
28
|
-
const treeData = computed(() => {
|
|
29
|
-
if (!searchKey.value)
|
|
30
|
-
return props.tree;
|
|
31
|
-
return searchData(searchKey.value);
|
|
32
|
-
});
|
|
33
|
-
const searchData = (keyword) => {
|
|
34
|
-
const loop = (data) => {
|
|
35
|
-
const result = [];
|
|
36
|
-
data.forEach((item) => {
|
|
37
|
-
var _a;
|
|
38
|
-
if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
|
|
39
|
-
result.push({ ...item });
|
|
40
|
-
} else if (item.children) {
|
|
41
|
-
const filterData = loop(item.children);
|
|
42
|
-
if (filterData.length) {
|
|
43
|
-
result.push({
|
|
44
|
-
...item,
|
|
45
|
-
children: filterData
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return result;
|
|
51
|
-
};
|
|
52
|
-
return loop(props.tree);
|
|
53
|
-
};
|
|
54
|
-
const clickLastItem = () => {
|
|
55
|
-
aTreeRef.value.selectNode(lastSearchKey.value, true);
|
|
56
|
-
};
|
|
57
|
-
watch(
|
|
58
|
-
() => props.column_id,
|
|
59
|
-
(val) => {
|
|
60
|
-
setSelectAlias(val);
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const setSelectAlias = async (id) => {
|
|
64
|
-
if (id === "all") {
|
|
65
|
-
selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const { code, message } = await getCategoryPath(props.userInfo.BASE_API, {
|
|
69
|
-
repo: props.userInfo.repository_id,
|
|
70
|
-
category: id
|
|
71
|
-
});
|
|
72
|
-
if (code === 0) {
|
|
73
|
-
const pathArr = [];
|
|
74
|
-
for (const i of message) {
|
|
75
|
-
pathArr.push(i.category_alias);
|
|
76
|
-
}
|
|
77
|
-
selectAlias.value = pathArr.join("/");
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const AddColumnSelected = (selectedKeys, data) => {
|
|
81
|
-
lastSearchKey.value = selectedKeys[0];
|
|
82
|
-
window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
|
|
83
|
-
emit("update:column_id", data.node.id);
|
|
84
|
-
};
|
|
85
|
-
return (_ctx, _cache) => {
|
|
86
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
87
|
-
createVNode(unref(Popover), {
|
|
88
|
-
"content-style": { minWidth: "120px" },
|
|
89
|
-
"content-class": "column-selection-popover-content",
|
|
90
|
-
position: "bottom",
|
|
91
|
-
trigger: "click"
|
|
92
|
-
}, {
|
|
93
|
-
content: withCtx(() => [
|
|
94
|
-
createElementVNode("div", _hoisted_2, [
|
|
95
|
-
createVNode(unref(InputSearch), {
|
|
96
|
-
modelValue: searchKey.value,
|
|
97
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
|
|
98
|
-
placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
|
|
99
|
-
}, null, 8, ["modelValue"])
|
|
100
|
-
]),
|
|
101
|
-
lastSearchKey.value ? (openBlock(), createElementBlock("div", {
|
|
102
|
-
key: 0,
|
|
103
|
-
class: "last-search-key",
|
|
104
|
-
onClick: clickLastItem
|
|
105
|
-
}, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : createCommentVNode("v-if", true),
|
|
106
|
-
createElementVNode("div", {
|
|
107
|
-
style: normalizeStyle({ minHeight: props.height + "px" }),
|
|
108
|
-
class: "column-selection-main"
|
|
109
|
-
}, [
|
|
110
|
-
createElementVNode("div", {
|
|
111
|
-
style: normalizeStyle({ height: props.height + "px" }),
|
|
112
|
-
class: "column-v"
|
|
113
|
-
}, [
|
|
114
|
-
createVNode(unref(Scrollbar), {
|
|
115
|
-
"outer-class": "column-outer-scrollbar",
|
|
116
|
-
style: { "height": "100%", "overflow": "auto" }
|
|
117
|
-
}, {
|
|
118
|
-
default: withCtx(() => [
|
|
119
|
-
createVNode(unref(Tree), {
|
|
120
|
-
ref_key: "aTreeRef",
|
|
121
|
-
ref: aTreeRef,
|
|
122
|
-
data: treeData.value,
|
|
123
|
-
"default-expand-all": false,
|
|
124
|
-
"field-names": treeOptions,
|
|
125
|
-
"block-node": "",
|
|
126
|
-
"check-strictly": "",
|
|
127
|
-
onSelect: AddColumnSelected
|
|
128
|
-
}, null, 8, ["data"])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
})
|
|
132
|
-
], 4)
|
|
133
|
-
], 4)
|
|
134
|
-
]),
|
|
135
|
-
default: withCtx(() => [
|
|
136
|
-
createVNode(unref(Button), { class: "button" }, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(unref(IconDragDotVertical)),
|
|
139
|
-
createTextVNode(" " + toDisplayString(selectAlias.value) + " ", 1),
|
|
140
|
-
createVNode(unref(IconCaretRight))
|
|
141
|
-
]),
|
|
142
|
-
_: 1
|
|
143
|
-
})
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
})
|
|
147
|
-
]);
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
export { _sfc_main as default };
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var vue = require("vue");
|
|
3
|
-
var webVue = require("@arco-design/web-vue");
|
|
4
|
-
var icon = require("@arco-design/web-vue/es/icon");
|
|
5
|
-
var api = require("../../../script/api.js");
|
|
6
|
-
const _hoisted_1 = { class: "column-selection-container" };
|
|
7
|
-
const _hoisted_2 = { class: "search-column" };
|
|
8
|
-
const _sfc_main = vue.defineComponent({
|
|
9
|
-
...{ name: "columnTree" },
|
|
10
|
-
__name: "index",
|
|
11
|
-
props: {
|
|
12
|
-
column_id: {},
|
|
13
|
-
tree: {},
|
|
14
|
-
height: {},
|
|
15
|
-
userInfo: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:column_id"],
|
|
18
|
-
setup(__props, { emit: __emit }) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
const emit = __emit;
|
|
21
|
-
const treeOptions = {
|
|
22
|
-
title: "alias",
|
|
23
|
-
isLeaf: "leaf"
|
|
24
|
-
};
|
|
25
|
-
const selectAlias = vue.ref("\u5168\u90E8\u5185\u5BB9");
|
|
26
|
-
const lastSearchKey = vue.ref(window.localStorage.getItem("lastSearchKey") || "");
|
|
27
|
-
const searchKey = vue.ref("");
|
|
28
|
-
const aTreeRef = vue.ref();
|
|
29
|
-
const treeData = vue.computed(() => {
|
|
30
|
-
if (!searchKey.value)
|
|
31
|
-
return props.tree;
|
|
32
|
-
return searchData(searchKey.value);
|
|
33
|
-
});
|
|
34
|
-
const searchData = (keyword) => {
|
|
35
|
-
const loop = (data) => {
|
|
36
|
-
const result = [];
|
|
37
|
-
data.forEach((item) => {
|
|
38
|
-
var _a;
|
|
39
|
-
if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
|
|
40
|
-
result.push({ ...item });
|
|
41
|
-
} else if (item.children) {
|
|
42
|
-
const filterData = loop(item.children);
|
|
43
|
-
if (filterData.length) {
|
|
44
|
-
result.push({
|
|
45
|
-
...item,
|
|
46
|
-
children: filterData
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
};
|
|
53
|
-
return loop(props.tree);
|
|
54
|
-
};
|
|
55
|
-
const clickLastItem = () => {
|
|
56
|
-
aTreeRef.value.selectNode(lastSearchKey.value, true);
|
|
57
|
-
};
|
|
58
|
-
vue.watch(
|
|
59
|
-
() => props.column_id,
|
|
60
|
-
(val) => {
|
|
61
|
-
setSelectAlias(val);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
const setSelectAlias = async (id) => {
|
|
65
|
-
if (id === "all") {
|
|
66
|
-
selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const { code, message } = await api.getCategoryPath(props.userInfo.BASE_API, {
|
|
70
|
-
repo: props.userInfo.repository_id,
|
|
71
|
-
category: id
|
|
72
|
-
});
|
|
73
|
-
if (code === 0) {
|
|
74
|
-
const pathArr = [];
|
|
75
|
-
for (const i of message) {
|
|
76
|
-
pathArr.push(i.category_alias);
|
|
77
|
-
}
|
|
78
|
-
selectAlias.value = pathArr.join("/");
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const AddColumnSelected = (selectedKeys, data) => {
|
|
82
|
-
lastSearchKey.value = selectedKeys[0];
|
|
83
|
-
window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
|
|
84
|
-
emit("update:column_id", data.node.id);
|
|
85
|
-
};
|
|
86
|
-
return (_ctx, _cache) => {
|
|
87
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
88
|
-
vue.createVNode(vue.unref(webVue.Popover), {
|
|
89
|
-
"content-style": { minWidth: "120px" },
|
|
90
|
-
"content-class": "column-selection-popover-content",
|
|
91
|
-
position: "bottom",
|
|
92
|
-
trigger: "click"
|
|
93
|
-
}, {
|
|
94
|
-
content: vue.withCtx(() => [
|
|
95
|
-
vue.createElementVNode("div", _hoisted_2, [
|
|
96
|
-
vue.createVNode(vue.unref(webVue.InputSearch), {
|
|
97
|
-
modelValue: searchKey.value,
|
|
98
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
|
|
99
|
-
placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
|
|
100
|
-
}, null, 8, ["modelValue"])
|
|
101
|
-
]),
|
|
102
|
-
lastSearchKey.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
103
|
-
key: 0,
|
|
104
|
-
class: "last-search-key",
|
|
105
|
-
onClick: clickLastItem
|
|
106
|
-
}, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : vue.createCommentVNode("v-if", true),
|
|
107
|
-
vue.createElementVNode("div", {
|
|
108
|
-
style: vue.normalizeStyle({ minHeight: props.height + "px" }),
|
|
109
|
-
class: "column-selection-main"
|
|
110
|
-
}, [
|
|
111
|
-
vue.createElementVNode("div", {
|
|
112
|
-
style: vue.normalizeStyle({ height: props.height + "px" }),
|
|
113
|
-
class: "column-v"
|
|
114
|
-
}, [
|
|
115
|
-
vue.createVNode(vue.unref(webVue.Scrollbar), {
|
|
116
|
-
"outer-class": "column-outer-scrollbar",
|
|
117
|
-
style: { "height": "100%", "overflow": "auto" }
|
|
118
|
-
}, {
|
|
119
|
-
default: vue.withCtx(() => [
|
|
120
|
-
vue.createVNode(vue.unref(webVue.Tree), {
|
|
121
|
-
ref_key: "aTreeRef",
|
|
122
|
-
ref: aTreeRef,
|
|
123
|
-
data: treeData.value,
|
|
124
|
-
"default-expand-all": false,
|
|
125
|
-
"field-names": treeOptions,
|
|
126
|
-
"block-node": "",
|
|
127
|
-
"check-strictly": "",
|
|
128
|
-
onSelect: AddColumnSelected
|
|
129
|
-
}, null, 8, ["data"])
|
|
130
|
-
]),
|
|
131
|
-
_: 1
|
|
132
|
-
})
|
|
133
|
-
], 4)
|
|
134
|
-
], 4)
|
|
135
|
-
]),
|
|
136
|
-
default: vue.withCtx(() => [
|
|
137
|
-
vue.createVNode(vue.unref(webVue.Button), { class: "button" }, {
|
|
138
|
-
default: vue.withCtx(() => [
|
|
139
|
-
vue.createVNode(vue.unref(icon.IconDragDotVertical)),
|
|
140
|
-
vue.createTextVNode(" " + vue.toDisplayString(selectAlias.value) + " ", 1),
|
|
141
|
-
vue.createVNode(vue.unref(icon.IconCaretRight))
|
|
142
|
-
]),
|
|
143
|
-
_: 1
|
|
144
|
-
})
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
})
|
|
148
|
-
]);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
module.exports = _sfc_main;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var vue = require("vue");
|
|
3
|
-
var webVue = require("@arco-design/web-vue");
|
|
4
|
-
var icon = require("@arco-design/web-vue/es/icon");
|
|
5
|
-
var api = require("../../../script/api.js");
|
|
6
|
-
const _hoisted_1 = { class: "column-selection-container" };
|
|
7
|
-
const _hoisted_2 = { class: "search-column" };
|
|
8
|
-
const _sfc_main = vue.defineComponent({
|
|
9
|
-
...{ name: "columnTree" },
|
|
10
|
-
__name: "index",
|
|
11
|
-
props: {
|
|
12
|
-
column_id: {},
|
|
13
|
-
tree: {},
|
|
14
|
-
height: {},
|
|
15
|
-
userInfo: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:column_id"],
|
|
18
|
-
setup(__props, { emit: __emit }) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
const emit = __emit;
|
|
21
|
-
const treeOptions = {
|
|
22
|
-
title: "alias",
|
|
23
|
-
isLeaf: "leaf"
|
|
24
|
-
};
|
|
25
|
-
const selectAlias = vue.ref("\u5168\u90E8\u5185\u5BB9");
|
|
26
|
-
const lastSearchKey = vue.ref(window.localStorage.getItem("lastSearchKey") || "");
|
|
27
|
-
const searchKey = vue.ref("");
|
|
28
|
-
const aTreeRef = vue.ref();
|
|
29
|
-
const treeData = vue.computed(() => {
|
|
30
|
-
if (!searchKey.value)
|
|
31
|
-
return props.tree;
|
|
32
|
-
return searchData(searchKey.value);
|
|
33
|
-
});
|
|
34
|
-
const searchData = (keyword) => {
|
|
35
|
-
const loop = (data) => {
|
|
36
|
-
const result = [];
|
|
37
|
-
data.forEach((item) => {
|
|
38
|
-
var _a;
|
|
39
|
-
if ((_a = item.alias) == null ? void 0 : _a.includes(keyword)) {
|
|
40
|
-
result.push({ ...item });
|
|
41
|
-
} else if (item.children) {
|
|
42
|
-
const filterData = loop(item.children);
|
|
43
|
-
if (filterData.length) {
|
|
44
|
-
result.push({
|
|
45
|
-
...item,
|
|
46
|
-
children: filterData
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
};
|
|
53
|
-
return loop(props.tree);
|
|
54
|
-
};
|
|
55
|
-
const clickLastItem = () => {
|
|
56
|
-
aTreeRef.value.selectNode(lastSearchKey.value, true);
|
|
57
|
-
};
|
|
58
|
-
vue.watch(
|
|
59
|
-
() => props.column_id,
|
|
60
|
-
(val) => {
|
|
61
|
-
setSelectAlias(val);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
const setSelectAlias = async (id) => {
|
|
65
|
-
if (id === "all") {
|
|
66
|
-
selectAlias.value = "\u5168\u90E8\u5185\u5BB9";
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const { code, message } = await api.getCategoryPath(props.userInfo.BASE_API, {
|
|
70
|
-
repo: props.userInfo.repository_id,
|
|
71
|
-
category: id
|
|
72
|
-
});
|
|
73
|
-
if (code === 0) {
|
|
74
|
-
const pathArr = [];
|
|
75
|
-
for (const i of message) {
|
|
76
|
-
pathArr.push(i.category_alias);
|
|
77
|
-
}
|
|
78
|
-
selectAlias.value = pathArr.join("/");
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const AddColumnSelected = (selectedKeys, data) => {
|
|
82
|
-
lastSearchKey.value = selectedKeys[0];
|
|
83
|
-
window.localStorage.setItem("lastSearchKey", lastSearchKey.value);
|
|
84
|
-
emit("update:column_id", data.node.id);
|
|
85
|
-
};
|
|
86
|
-
return (_ctx, _cache) => {
|
|
87
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
88
|
-
vue.createVNode(vue.unref(webVue.Popover), {
|
|
89
|
-
"content-style": { minWidth: "120px" },
|
|
90
|
-
"content-class": "column-selection-popover-content",
|
|
91
|
-
position: "bottom",
|
|
92
|
-
trigger: "click"
|
|
93
|
-
}, {
|
|
94
|
-
content: vue.withCtx(() => [
|
|
95
|
-
vue.createElementVNode("div", _hoisted_2, [
|
|
96
|
-
vue.createVNode(vue.unref(webVue.InputSearch), {
|
|
97
|
-
modelValue: searchKey.value,
|
|
98
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchKey.value = $event),
|
|
99
|
-
placeholder: "\u8BF7\u8F93\u5165\u680F\u76EE\u540D\u79F0"
|
|
100
|
-
}, null, 8, ["modelValue"])
|
|
101
|
-
]),
|
|
102
|
-
lastSearchKey.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
103
|
-
key: 0,
|
|
104
|
-
class: "last-search-key",
|
|
105
|
-
onClick: clickLastItem
|
|
106
|
-
}, "\u4E0A\u4E00\u6B21\u9009\u62E9 ")) : vue.createCommentVNode("v-if", true),
|
|
107
|
-
vue.createElementVNode("div", {
|
|
108
|
-
style: vue.normalizeStyle({ minHeight: props.height + "px" }),
|
|
109
|
-
class: "column-selection-main"
|
|
110
|
-
}, [
|
|
111
|
-
vue.createElementVNode("div", {
|
|
112
|
-
style: vue.normalizeStyle({ height: props.height + "px" }),
|
|
113
|
-
class: "column-v"
|
|
114
|
-
}, [
|
|
115
|
-
vue.createVNode(vue.unref(webVue.Scrollbar), {
|
|
116
|
-
"outer-class": "column-outer-scrollbar",
|
|
117
|
-
style: { "height": "100%", "overflow": "auto" }
|
|
118
|
-
}, {
|
|
119
|
-
default: vue.withCtx(() => [
|
|
120
|
-
vue.createVNode(vue.unref(webVue.Tree), {
|
|
121
|
-
ref_key: "aTreeRef",
|
|
122
|
-
ref: aTreeRef,
|
|
123
|
-
data: treeData.value,
|
|
124
|
-
"default-expand-all": false,
|
|
125
|
-
"field-names": treeOptions,
|
|
126
|
-
"block-node": "",
|
|
127
|
-
"check-strictly": "",
|
|
128
|
-
onSelect: AddColumnSelected
|
|
129
|
-
}, null, 8, ["data"])
|
|
130
|
-
]),
|
|
131
|
-
_: 1
|
|
132
|
-
})
|
|
133
|
-
], 4)
|
|
134
|
-
], 4)
|
|
135
|
-
]),
|
|
136
|
-
default: vue.withCtx(() => [
|
|
137
|
-
vue.createVNode(vue.unref(webVue.Button), { class: "button" }, {
|
|
138
|
-
default: vue.withCtx(() => [
|
|
139
|
-
vue.createVNode(vue.unref(icon.IconDragDotVertical)),
|
|
140
|
-
vue.createTextVNode(" " + vue.toDisplayString(selectAlias.value) + " ", 1),
|
|
141
|
-
vue.createVNode(vue.unref(icon.IconCaretRight))
|
|
142
|
-
]),
|
|
143
|
-
_: 1
|
|
144
|
-
})
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
})
|
|
148
|
-
]);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
module.exports = _sfc_main;
|