@cmstops/pro-compo 3.9.1-rc.14 → 3.9.1-rc.15
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 -103
- 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 +0 -3
- package/es/selectAddTo/components/ViewAllColumn/index.js +17 -16
- package/es/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +1 -1
- package/es/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +0 -13
- package/es/selectAddTo/script/api.js +1 -8
- package/es/selectAddTo/script/useSelectAddToState.js +16 -67
- package/es/style.css +18 -12
- 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/selectAddTo/component.js +22 -102
- 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 +0 -3
- package/lib/selectAddTo/components/ViewAllColumn/index.js +16 -15
- package/lib/selectAddTo/components/ViewAllColumn/script/useTableColumns.js +1 -1
- package/lib/selectAddTo/components/ViewAllColumn/script/useViewAllColumnState.js +0 -13
- package/lib/selectAddTo/script/api.js +0 -8
- package/lib/selectAddTo/script/useSelectAddToState.js +16 -67
- package/package.json +1 -1
- package/es/contentModal/components/ViewAllColumn/columnTree/index.js +0 -151
- package/lib/contentModal/components/ViewAllColumn/columnTree/index.js +0 -152
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var vue = require("vue");
|
|
3
|
+
var webVue = require("@arco-design/web-vue");
|
|
4
|
+
var index = require("./ViewAllColumn/index.js");
|
|
5
|
+
var index$1 = require("../../contentModal/components/storeBox/index.js");
|
|
6
|
+
require("./SelectAddToView.vue_vue_type_style_index_0_scoped_true_lang.js");
|
|
7
|
+
var pluginVue_exportHelper = require("../../_virtual/plugin-vue_export-helper.js");
|
|
8
|
+
const _sfc_main = vue.defineComponent({
|
|
9
|
+
__name: "SelectAddToView",
|
|
10
|
+
props: {
|
|
11
|
+
visible: { type: Boolean },
|
|
12
|
+
rid: {},
|
|
13
|
+
selectedData: {},
|
|
14
|
+
maxSelect: {},
|
|
15
|
+
typeKey: {}
|
|
16
|
+
},
|
|
17
|
+
emits: [
|
|
18
|
+
"cancel",
|
|
19
|
+
"close",
|
|
20
|
+
"ok",
|
|
21
|
+
"open",
|
|
22
|
+
"selected-change",
|
|
23
|
+
"comfirm"
|
|
24
|
+
],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const emit = __emit;
|
|
28
|
+
const hasSelected = vue.computed(
|
|
29
|
+
() => props.selectedData && props.selectedData.length > 0
|
|
30
|
+
);
|
|
31
|
+
function handleComfirm() {
|
|
32
|
+
emit("comfirm");
|
|
33
|
+
}
|
|
34
|
+
function handleSelectedDataChange(val) {
|
|
35
|
+
emit("selected-change", val);
|
|
36
|
+
}
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Modal), {
|
|
39
|
+
footer: false,
|
|
40
|
+
"mask-closable": false,
|
|
41
|
+
visible: _ctx.visible,
|
|
42
|
+
"body-style": { maxHeight: "700px" },
|
|
43
|
+
"body-class": "add-content-modal-body",
|
|
44
|
+
"modal-class": "add-content-modal-wrapper",
|
|
45
|
+
"title-align": "start",
|
|
46
|
+
"unmount-on-close": "",
|
|
47
|
+
width: "1020px",
|
|
48
|
+
onCancel: _cache[1] || (_cache[1] = () => emit("cancel")),
|
|
49
|
+
onClose: _cache[2] || (_cache[2] = () => emit("close")),
|
|
50
|
+
onOk: _cache[3] || (_cache[3] = () => emit("ok"))
|
|
51
|
+
}, {
|
|
52
|
+
title: vue.withCtx(() => _cache[4] || (_cache[4] = [
|
|
53
|
+
vue.createTextVNode("\u9009\u62E9\u6DFB\u52A0")
|
|
54
|
+
])),
|
|
55
|
+
default: vue.withCtx(() => [
|
|
56
|
+
_ctx.rid ? (vue.openBlock(), vue.createBlock(index, {
|
|
57
|
+
key: 0,
|
|
58
|
+
rid: _ctx.rid,
|
|
59
|
+
"default-selected-data": _ctx.selectedData,
|
|
60
|
+
"max-select": _ctx.maxSelect,
|
|
61
|
+
"type-key": _ctx.typeKey || "",
|
|
62
|
+
onChange: handleSelectedDataChange
|
|
63
|
+
}, {
|
|
64
|
+
store: vue.withCtx(() => [
|
|
65
|
+
vue.createVNode(index$1, {
|
|
66
|
+
selectData: _ctx.selectedData,
|
|
67
|
+
"onUpdate:selectData": _cache[0] || (_cache[0] = (val) => emit("selected-change", val))
|
|
68
|
+
}, null, 8, ["selectData"])
|
|
69
|
+
]),
|
|
70
|
+
options: vue.withCtx(() => [
|
|
71
|
+
vue.createVNode(vue.unref(webVue.Button), {
|
|
72
|
+
disabled: !hasSelected.value,
|
|
73
|
+
type: "primary",
|
|
74
|
+
onClick: handleComfirm
|
|
75
|
+
}, {
|
|
76
|
+
default: vue.withCtx(() => _cache[5] || (_cache[5] = [
|
|
77
|
+
vue.createTextVNode(" \u6DFB\u52A0 ")
|
|
78
|
+
])),
|
|
79
|
+
_: 1,
|
|
80
|
+
__: [5]
|
|
81
|
+
}, 8, ["disabled"])
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["rid", "default-selected-data", "max-select", "type-key"])) : vue.createCommentVNode("v-if", true)
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["visible"]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var SelectAddToView = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["__scopeId", "data-v-00adfb7c"]]);
|
|
92
|
+
module.exports = SelectAddToView;
|
|
@@ -14,10 +14,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
14
14
|
props: {
|
|
15
15
|
groupId: {},
|
|
16
16
|
tree: { default: () => [] },
|
|
17
|
-
series: { default: "all" },
|
|
18
|
-
banner: { default: "all" },
|
|
19
17
|
height: {},
|
|
20
|
-
userInfo: {},
|
|
21
18
|
typeKey: {}
|
|
22
19
|
},
|
|
23
20
|
emits: ["update:group_id", "search"],
|
|
@@ -33,11 +33,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
33
33
|
...{ name: "ViewAllColumn" },
|
|
34
34
|
__name: "index",
|
|
35
35
|
props: {
|
|
36
|
-
maxSelect: {},
|
|
37
36
|
defaultSelectedData: {},
|
|
38
|
-
typeData: {},
|
|
39
|
-
series: {},
|
|
40
|
-
banner: {},
|
|
41
37
|
userInfo: {},
|
|
42
38
|
typeKey: {},
|
|
43
39
|
rid: {}
|
|
@@ -97,17 +93,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
97
93
|
onCellMouseEnter: vue.unref(tableCellMouseEnter),
|
|
98
94
|
onCellMouseLeave: vue.unref(tableCellMouseLeave),
|
|
99
95
|
onRowClick: vue.unref(selectTableCell)
|
|
100
|
-
}, {
|
|
96
|
+
}, vue.createSlots({
|
|
101
97
|
"expand-icon": vue.withCtx(({ expanded }) => [
|
|
102
98
|
!expanded ? (vue.openBlock(), vue.createBlock(vue.unref(icon.IconRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(icon.IconDown), { key: 1 }))
|
|
103
99
|
]),
|
|
104
|
-
selectTitle: vue.withCtx(() => [
|
|
105
|
-
vue.createVNode(vue.unref(webVue.Checkbox), {
|
|
106
|
-
"model-value": vue.unref(selectedData).length === vue.unref(mediaFileData).length,
|
|
107
|
-
class: "icon",
|
|
108
|
-
onChange: vue.unref(selectTableAll)
|
|
109
|
-
}, null, 8, ["model-value", "onChange"])
|
|
110
|
-
]),
|
|
111
100
|
select: vue.withCtx(({ record }) => [
|
|
112
101
|
vue.createVNode(vue.unref(webVue.Checkbox), {
|
|
113
102
|
"model-value": vue.unref(isItemChecked)(vue.unref(selectedData), record),
|
|
@@ -137,8 +126,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
137
126
|
vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(index$1.timeFormat)(record.pub_time)), 1)
|
|
138
127
|
])
|
|
139
128
|
]),
|
|
140
|
-
_:
|
|
141
|
-
},
|
|
129
|
+
_: 2
|
|
130
|
+
}, [
|
|
131
|
+
_ctx.typeKey !== "series:special_v3" ? {
|
|
132
|
+
name: "selectTitle",
|
|
133
|
+
fn: vue.withCtx(() => [
|
|
134
|
+
vue.createVNode(vue.unref(webVue.Checkbox), {
|
|
135
|
+
"model-value": vue.unref(selectedData).length === vue.unref(mediaFileData).length,
|
|
136
|
+
class: "icon",
|
|
137
|
+
onChange: vue.unref(selectTableAll)
|
|
138
|
+
}, null, 8, ["model-value", "onChange"])
|
|
139
|
+
]),
|
|
140
|
+
key: "0"
|
|
141
|
+
} : void 0
|
|
142
|
+
]), 1032, ["columns", "data", "loading", "load-more", "onCellMouseEnter", "onCellMouseLeave", "onRowClick"])
|
|
142
143
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
|
|
143
144
|
vue.createVNode(vue.unref(webVue.Table), {
|
|
144
145
|
bordered: false,
|
|
@@ -208,5 +209,5 @@ const _sfc_main = vue.defineComponent({
|
|
|
208
209
|
};
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
|
-
var ViewAllColumn = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["__scopeId", "data-v-
|
|
212
|
+
var ViewAllColumn = /* @__PURE__ */ pluginVue_exportHelper(_sfc_main, [["__scopeId", "data-v-01c2d0b8"]]);
|
|
212
213
|
module.exports = ViewAllColumn;
|
|
@@ -10,7 +10,7 @@ var dayjs__default = /* @__PURE__ */ _interopDefaultLegacy(dayjs);
|
|
|
10
10
|
const useTableColumns = (props, selectedData, isItemChecked, filter) => {
|
|
11
11
|
const columns = vue.ref([
|
|
12
12
|
{
|
|
13
|
-
title: "
|
|
13
|
+
title: "",
|
|
14
14
|
dataIndex: "select",
|
|
15
15
|
slotName: "select",
|
|
16
16
|
width: 40,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
var vue = require("vue");
|
|
4
|
-
var webVue = require("@arco-design/web-vue");
|
|
5
4
|
var config = require("../../../../config.js");
|
|
6
5
|
var api = require("../../../script/api.js");
|
|
7
6
|
var batch = require("../../../../hooks/batch.js");
|
|
@@ -24,11 +23,6 @@ const useViewAllColumnState = (props, emit) => {
|
|
|
24
23
|
selectedData.value = val;
|
|
25
24
|
}
|
|
26
25
|
);
|
|
27
|
-
const importantBanner = vue.computed(() => {
|
|
28
|
-
if (!props.banner || props.banner === "all")
|
|
29
|
-
return false;
|
|
30
|
-
return !!props.banner;
|
|
31
|
-
});
|
|
32
26
|
const { isItemChecked, tableCellMouseEnter, tableCellMouseLeave } = batch();
|
|
33
27
|
const selectTableCell = (record) => {
|
|
34
28
|
if (props.typeKey === "series:special_v3" ? record.isLeaf && record.parentId : true) {
|
|
@@ -45,12 +39,6 @@ const useViewAllColumnState = (props, emit) => {
|
|
|
45
39
|
emitChange();
|
|
46
40
|
};
|
|
47
41
|
const selectData = (record) => {
|
|
48
|
-
if (importantBanner.value) {
|
|
49
|
-
const { cover } = record;
|
|
50
|
-
if (!(cover == null ? void 0 : cover.banner)) {
|
|
51
|
-
return webVue.Message.warning({ content: "\u8BE5\u5185\u5BB9\u4E0D\u5177\u5907\u72EC\u7ACB\u8F6E\u64AD\u56FE" });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
42
|
addDataToSelectedList(record);
|
|
55
43
|
return true;
|
|
56
44
|
};
|
|
@@ -172,7 +160,6 @@ const useViewAllColumnState = (props, emit) => {
|
|
|
172
160
|
);
|
|
173
161
|
}, 2e3);
|
|
174
162
|
} catch (error) {
|
|
175
|
-
console.error("Failed to load more data:", error);
|
|
176
163
|
done([]);
|
|
177
164
|
}
|
|
178
165
|
};
|
|
@@ -22,14 +22,6 @@ function getMlists(BASE_API, params) {
|
|
|
22
22
|
params
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function getConfigurationNew(BASE_API, params) {
|
|
26
|
-
return request(BASE_API, {
|
|
27
|
-
url: "/poplar/v2/configuration",
|
|
28
|
-
method: "get",
|
|
29
|
-
params
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
25
|
exports.getCategoryMediaNew = getCategoryMediaNew;
|
|
33
|
-
exports.getConfigurationNew = getConfigurationNew;
|
|
34
26
|
exports.getMlists = getMlists;
|
|
35
27
|
exports.getPoliticals = getPoliticals;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
var vue = require("vue");
|
|
4
|
-
var api = require("./api.js");
|
|
5
4
|
var config = require("../../config.js");
|
|
6
|
-
var user = require("../../hooks/user.js");
|
|
7
5
|
const useSelectAddToState = (props, emit) => {
|
|
8
|
-
|
|
6
|
+
props.BASE_API || config.DEFAULT_BASE_API;
|
|
9
7
|
const visible = vue.computed({
|
|
10
8
|
get() {
|
|
11
9
|
return props.visible;
|
|
12
10
|
},
|
|
13
11
|
set(value) {
|
|
14
|
-
|
|
12
|
+
emit("update:visible", value);
|
|
15
13
|
}
|
|
16
14
|
});
|
|
17
15
|
const selectedData = vue.ref([]);
|
|
18
|
-
const configData = vue.ref({});
|
|
19
|
-
const { userInfo, getUserInfoHandle } = user["default"](BASE_API);
|
|
20
16
|
const title = vue.computed(() => {
|
|
21
17
|
const titleMap = {
|
|
22
18
|
"series:video_album": "\u6DFB\u52A0\u81F3\u89C6\u9891\u5408\u96C6",
|
|
@@ -27,82 +23,35 @@ const useSelectAddToState = (props, emit) => {
|
|
|
27
23
|
return titleMap[props.typeKey || ""] || "";
|
|
28
24
|
});
|
|
29
25
|
const hasSelected = vue.computed(() => selectedData.value.length > 0);
|
|
30
|
-
const
|
|
31
|
-
if (!props.typeData)
|
|
32
|
-
return {};
|
|
33
|
-
try {
|
|
34
|
-
return JSON.parse(JSON.stringify(props.typeData));
|
|
35
|
-
} catch (e) {
|
|
36
|
-
console.warn("Failed to parse typeData:", e);
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const setVisible = (bool) => {
|
|
41
|
-
emit("update:visible", bool);
|
|
42
|
-
};
|
|
43
|
-
const selectedDataChangeHandle = (data) => {
|
|
26
|
+
const onSelectedDataChange = (data) => {
|
|
44
27
|
selectedData.value = data;
|
|
45
28
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
29
|
+
const onOk = () => {
|
|
30
|
+
visible.value = false;
|
|
48
31
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
32
|
+
const onCancel = () => {
|
|
33
|
+
visible.value = false;
|
|
51
34
|
};
|
|
52
|
-
const
|
|
35
|
+
const onComfirm = () => {
|
|
53
36
|
emit("comfirm", JSON.parse(JSON.stringify(selectedData.value)));
|
|
54
37
|
};
|
|
55
|
-
const
|
|
56
|
-
selectedData.value = props.defaultSelectedData || [];
|
|
57
|
-
};
|
|
58
|
-
const HandleClose = () => {
|
|
38
|
+
const onClose = () => {
|
|
59
39
|
selectedData.value = [];
|
|
60
40
|
};
|
|
61
|
-
const
|
|
41
|
+
const onTabChange = () => {
|
|
62
42
|
selectedData.value = [];
|
|
63
43
|
};
|
|
64
|
-
const loadConfig = async () => {
|
|
65
|
-
var _a;
|
|
66
|
-
try {
|
|
67
|
-
const res = await api.getConfigurationNew(BASE_API, {
|
|
68
|
-
module: "third_party_services"
|
|
69
|
-
});
|
|
70
|
-
if (res.code === 0 && ((_a = res.message) == null ? void 0 : _a.length)) {
|
|
71
|
-
res.message.forEach((item) => {
|
|
72
|
-
configData.value[item.key] = JSON.parse(item.value);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error("Failed to load configuration:", error);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const checkServiceEnable = (key) => {
|
|
80
|
-
const data = configData.value[key];
|
|
81
|
-
if (!data)
|
|
82
|
-
return false;
|
|
83
|
-
if (!data.enable && typeof data.enable !== "undefined")
|
|
84
|
-
return false;
|
|
85
|
-
return true;
|
|
86
|
-
};
|
|
87
44
|
return {
|
|
88
45
|
visible,
|
|
89
46
|
title,
|
|
90
47
|
selectedData,
|
|
91
48
|
hasSelected,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
handleCancel,
|
|
99
|
-
comfirm,
|
|
100
|
-
HandleOpen,
|
|
101
|
-
HandleClose,
|
|
102
|
-
tabsChange,
|
|
103
|
-
loadConfig,
|
|
104
|
-
checkServiceEnable,
|
|
105
|
-
getUserInfoHandle
|
|
49
|
+
onSelectedDataChange,
|
|
50
|
+
onOk,
|
|
51
|
+
onCancel,
|
|
52
|
+
onComfirm,
|
|
53
|
+
onClose,
|
|
54
|
+
onTabChange
|
|
106
55
|
};
|
|
107
56
|
};
|
|
108
57
|
exports.useSelectAddToState = useSelectAddToState;
|
package/package.json
CHANGED
|
@@ -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;
|