@ctzy-web-client/plugin-component-vue 1.0.38 → 1.0.39
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/advance-select/advance-option.mjs +2 -2
- package/es/make-installer.css +1 -0
- package/es/pct-filter-panel/pct-compents/index.mjs +1 -1
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +2 -2
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +77 -131
- package/lib/advance-select/advance-option.js +2 -2
- package/lib/make-installer.css +1 -0
- package/lib/pct-filter-panel/pct-compents/index.js +2 -2
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +2 -2
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +76 -130
- package/package.json +1 -1
- package/src/advance-select/advance-option.vue +4 -4
- package/src/pct-filter-panel/pct-compents/index.js +1 -1
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +4 -4
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +96 -148
- package/style/index.css +1 -1
- package/style/src/var.scss +0 -2
- package/style/var.css +1 -1
- package/es/index.css +0 -1
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_0a08184f_lang.mjs +0 -13
- package/lib/index.css +0 -1
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_0a08184f_lang.js +0 -17
- /package/es/advance-select/{advance-option.vue_vue_type_style_index_0_scoped_9ba46efc_lang.mjs → advance-option.vue_vue_type_style_index_0_scoped_1e505c71_lang.mjs} +0 -0
- /package/lib/advance-select/{advance-option.vue_vue_type_style_index_0_scoped_9ba46efc_lang.js → advance-option.vue_vue_type_style_index_0_scoped_1e505c71_lang.js} +0 -0
|
@@ -4,7 +4,7 @@ import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
|
|
|
4
4
|
import { useEvent } from './events-helpers.mjs';
|
|
5
5
|
import { useAdvanceOption } from './use-advance-option.mjs';
|
|
6
6
|
import { pinyin } from 'pinyin-pro';
|
|
7
|
-
import './advance-option.
|
|
7
|
+
import './advance-option.vue_vue_type_style_index_0_scoped_1e505c71_lang.mjs';
|
|
8
8
|
import _export_sfc from '../_virtual/_plugin-vue_export-helper.mjs';
|
|
9
9
|
|
|
10
10
|
// Inject __name helper
|
|
@@ -159,6 +159,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
159
159
|
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
160
160
|
], 2);
|
|
161
161
|
}
|
|
162
|
-
var BwaAdvanceOption = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
162
|
+
var BwaAdvanceOption = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1e505c71"], ["__file", "advance-option.vue"]]);
|
|
163
163
|
|
|
164
164
|
export { BwaAdvanceOption as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.letter-circle[data-v-1e505c71]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withInstall } from 'element-plus/es/utils/vue/install';
|
|
2
|
-
import PctMultipleMenuCondition from './pct-multiple-menu-
|
|
2
|
+
import PctMultipleMenuCondition from './pct-multiple-menu-condition.mjs';
|
|
3
3
|
import PctInputCondition from './pct-Input-condition.mjs';
|
|
4
4
|
import PctDateRangeCondition from './pct-date-range-condition.mjs';
|
|
5
5
|
|
|
@@ -391,6 +391,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
|
-
var
|
|
394
|
+
var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "pct-multiple-menu-condition.vue"]]);
|
|
395
395
|
|
|
396
|
-
export {
|
|
396
|
+
export { PctMultipleMenuCondition as default };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { defineComponent, useAttrs, computed, ref, inject, unref, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx,
|
|
1
|
+
import { defineComponent, useAttrs, computed, ref, inject, unref, openBlock, createElementBlock, Fragment, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx, renderList, createBlock } from 'vue';
|
|
2
2
|
import { ElSelect, ElOption } from 'element-plus';
|
|
3
3
|
import { useService, HttpRequest, useNamespace, filterPanelItemKey } from '@ctzy-web-client/web-base-client-vue';
|
|
4
4
|
import { dataProps } from '../../hooks/use-data/index.mjs';
|
|
5
|
-
import { pinyin } from 'pinyin-pro';
|
|
6
|
-
import './pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_0a08184f_lang.mjs';
|
|
7
5
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
|
|
8
6
|
|
|
9
7
|
// Inject __name helper
|
|
@@ -15,37 +13,53 @@ if (typeof __name === 'undefined') {
|
|
|
15
13
|
});
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
19
|
-
const _hoisted_2 = { style: { "margin-left": "8px" } };
|
|
20
16
|
const __default__ = defineComponent({
|
|
21
17
|
name: "BwaPctMultipleMenuCondition",
|
|
22
|
-
__conditionTitle__: "\u591A\u9009\u83DC\u5355",
|
|
18
|
+
__conditionTitle__: "\u591A\u9009\u83DC\u5355-PZ",
|
|
23
19
|
__conditionDefault__: () => []
|
|
24
20
|
});
|
|
25
21
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
26
22
|
props: {
|
|
27
23
|
...dataProps,
|
|
28
|
-
modelValue: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: null
|
|
26
|
+
},
|
|
27
|
+
options: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
labelProp: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "label"
|
|
34
|
+
},
|
|
35
|
+
valueProp: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "value"
|
|
38
|
+
},
|
|
39
|
+
multiple: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
filterable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "\u8BF7\u9009\u62E9"
|
|
50
|
+
},
|
|
51
|
+
remote: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
size: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: "small"
|
|
58
|
+
}
|
|
45
59
|
},
|
|
46
60
|
emits: ["update:modelValue", "search", "visible-change"],
|
|
47
61
|
setup(__props, { emit: __emit }) {
|
|
48
|
-
var _a;
|
|
62
|
+
var _a, _b;
|
|
49
63
|
const httpRequest = useService(HttpRequest);
|
|
50
64
|
;
|
|
51
65
|
const props = __props;
|
|
@@ -60,103 +74,48 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
60
74
|
var _a2;
|
|
61
75
|
return (_a2 = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a2 : null;
|
|
62
76
|
});
|
|
63
|
-
|
|
64
|
-
column.value.componentProps = {
|
|
65
|
-
itfInfo: props.itfInfo,
|
|
66
|
-
labelAttr: props.labelAttr,
|
|
67
|
-
valueAttr: props.valueAttr,
|
|
68
|
-
searchAttr: props.searchAttr,
|
|
69
|
-
showLetterAvatar: props.showLetterAvatar
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const placeholderStr = computed(
|
|
73
|
-
() => {
|
|
74
|
-
var _a2;
|
|
75
|
-
return showTitle.value ? props.placeholder : (_a2 = column.value) == null ? void 0 : _a2.title;
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
const labelPropStr = computed(
|
|
79
|
-
() => {
|
|
80
|
-
var _a2, _b;
|
|
81
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.labelAttr) || props.labelProp;
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
const valuePropStr = computed(
|
|
85
|
-
() => {
|
|
86
|
-
var _a2, _b;
|
|
87
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.valueAttr) || props.valueProp;
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
const showLetterAvatarStatus = computed(
|
|
91
|
-
() => {
|
|
92
|
-
var _a2, _b;
|
|
93
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.showLetterAvatar) || props.showLetterAvatar;
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
const COLOR_POOL = ["#2DC86D", "#19BBFF", "#FFA901"];
|
|
97
|
-
function processLabel(label = "") {
|
|
98
|
-
const match = (label + "").match(/^(.*)\(/);
|
|
99
|
-
const txt = match ? match[1] : label;
|
|
100
|
-
const first = txt.charAt(0);
|
|
101
|
-
let letter = "#";
|
|
102
|
-
if (/[\u4e00-\u9fa5]/.test(first)) {
|
|
103
|
-
letter = pinyin(first, { pattern: "first" }).toUpperCase();
|
|
104
|
-
} else if (/[a-zA-Z]/.test(first)) {
|
|
105
|
-
letter = first.toUpperCase();
|
|
106
|
-
}
|
|
107
|
-
let color = COLOR_POOL[0];
|
|
108
|
-
if (/[A-Z]/.test(letter)) {
|
|
109
|
-
color = COLOR_POOL[(letter.charCodeAt(0) - 65) % 3];
|
|
110
|
-
}
|
|
111
|
-
return { firstLetter: letter, color };
|
|
112
|
-
}
|
|
77
|
+
const placeholderStr = computed(() => showTitle.value ? props.placeholder : column.value.title);
|
|
113
78
|
const getData = async (query) => {
|
|
114
|
-
var _a2
|
|
115
|
-
if (!((_a2 = column.value) == null ? void 0 : _a2.componentProps)) {
|
|
116
|
-
data.value = (_b = props.options) != null ? _b : [];
|
|
117
|
-
loading.value = false;
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
79
|
+
var _a2;
|
|
120
80
|
loading.value = true;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
} catch (err) {
|
|
131
|
-
data.value = [];
|
|
132
|
-
} finally {
|
|
133
|
-
loading.value = false;
|
|
134
|
-
}
|
|
81
|
+
const { itfInfo, searchAttr } = column.value.componentProps;
|
|
82
|
+
const { url, method, options, params } = {
|
|
83
|
+
url: unref(itfInfo).url,
|
|
84
|
+
method: unref(itfInfo).method || "POST",
|
|
85
|
+
options: unref(itfInfo).options || {},
|
|
86
|
+
params: { ...unref(itfInfo).params, [searchAttr]: query || "" }
|
|
87
|
+
};
|
|
88
|
+
data.value = (_a2 = await unref(httpRequest)[method.toLowerCase()](url, params, options)) == null ? void 0 : _a2.data;
|
|
89
|
+
loading.value = false;
|
|
135
90
|
};
|
|
136
|
-
|
|
91
|
+
if ((_a = column.value) == null ? void 0 : _a.componentProps) {
|
|
92
|
+
} else {
|
|
93
|
+
data.value = (_b = props.options) != null ? _b : [];
|
|
94
|
+
}
|
|
137
95
|
const visibleChange = (val) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
emit("search", "");
|
|
142
|
-
if (val && ((_a2 = column.value) == null ? void 0 : _a2.componentProps))
|
|
143
|
-
getData();
|
|
96
|
+
if (!val || !column.value.componentProps)
|
|
97
|
+
return;
|
|
98
|
+
getData();
|
|
144
99
|
};
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
100
|
+
const remoteMethod = (query) => {
|
|
101
|
+
if (column.value.componentProps) {
|
|
102
|
+
getData(query);
|
|
103
|
+
} else {
|
|
104
|
+
emit("search", query);
|
|
105
|
+
}
|
|
148
106
|
};
|
|
149
107
|
const modelValue = computed({
|
|
150
108
|
get: () => {
|
|
151
|
-
|
|
152
|
-
|
|
109
|
+
if (props.multiple) {
|
|
110
|
+
return Array.isArray(props.modelValue) ? props.modelValue.map((item) => item + "") : [];
|
|
111
|
+
} else {
|
|
112
|
+
return props.modelValue == null ? "" : props.modelValue + "";
|
|
113
|
+
}
|
|
153
114
|
},
|
|
154
115
|
set: (v) => emit("update:modelValue", v)
|
|
155
116
|
});
|
|
156
117
|
return (_ctx, _cache) => {
|
|
157
|
-
return openBlock(), createElementBlock(
|
|
158
|
-
class: normalizeClass(unref(ns).e("conditbox"))
|
|
159
|
-
}, [
|
|
118
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
160
119
|
showTitle.value ? (openBlock(), createElementBlock("span", {
|
|
161
120
|
key: 0,
|
|
162
121
|
class: normalizeClass(unref(ns).e("title"))
|
|
@@ -171,7 +130,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
171
130
|
loading: loading.value,
|
|
172
131
|
onVisibleChange: visibleChange,
|
|
173
132
|
remote: __props.remote,
|
|
174
|
-
"remote-method":
|
|
133
|
+
"remote-method": remoteMethod,
|
|
175
134
|
size: __props.size,
|
|
176
135
|
class: normalizeClass(unref(ns).e("multiple")),
|
|
177
136
|
"collapse-tags": "",
|
|
@@ -179,33 +138,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
179
138
|
"no-data-text": "\u6682\u65E0\u6570\u636E"
|
|
180
139
|
}, {
|
|
181
140
|
default: withCtx(() => [
|
|
182
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(data.value, (item) => {
|
|
141
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(data.value, (item, index) => {
|
|
183
142
|
return openBlock(), createBlock(unref(ElOption), {
|
|
184
|
-
key: item[
|
|
185
|
-
value: item[
|
|
186
|
-
label: item[
|
|
187
|
-
},
|
|
188
|
-
default: withCtx(() => [
|
|
189
|
-
createCommentVNode(" \u6587\u5B57\u5934\u50CF "),
|
|
190
|
-
createElementVNode("div", _hoisted_1, [
|
|
191
|
-
showLetterAvatarStatus.value ? (openBlock(), createElementBlock("div", {
|
|
192
|
-
key: 0,
|
|
193
|
-
class: "letter-circle",
|
|
194
|
-
style: normalizeStyle({ backgroundColor: processLabel(item[labelPropStr.value]).color })
|
|
195
|
-
}, toDisplayString(processLabel(item[labelPropStr.value]).firstLetter), 5)) : createCommentVNode("v-if", true),
|
|
196
|
-
createElementVNode("span", _hoisted_2, toDisplayString(item[labelPropStr.value]), 1)
|
|
197
|
-
])
|
|
198
|
-
]),
|
|
199
|
-
_: 2
|
|
200
|
-
}, 1032, ["value", "label"]);
|
|
143
|
+
key: item[__props.valueProp] + index,
|
|
144
|
+
value: item[__props.valueProp] + "",
|
|
145
|
+
label: item[__props.labelProp]
|
|
146
|
+
}, null, 8, ["value", "label"]);
|
|
201
147
|
}), 128))
|
|
202
148
|
]),
|
|
203
149
|
_: 1
|
|
204
150
|
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote", "size", "class"])
|
|
205
|
-
],
|
|
151
|
+
], 64);
|
|
206
152
|
};
|
|
207
153
|
}
|
|
208
154
|
});
|
|
209
|
-
var
|
|
155
|
+
var pctMultipleMenuCondition2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "pct-multiple-menu-condition2.vue"]]);
|
|
210
156
|
|
|
211
|
-
export {
|
|
157
|
+
export { pctMultipleMenuCondition2 as default };
|
|
@@ -8,7 +8,7 @@ var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
|
|
|
8
8
|
var eventsHelpers = require('./events-helpers.js');
|
|
9
9
|
var useAdvanceOption = require('./use-advance-option.js');
|
|
10
10
|
var pinyinPro = require('pinyin-pro');
|
|
11
|
-
require('./advance-option.
|
|
11
|
+
require('./advance-option.vue_vue_type_style_index_0_scoped_1e505c71_lang.js');
|
|
12
12
|
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
13
13
|
|
|
14
14
|
// Inject __name helper
|
|
@@ -163,6 +163,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
163
163
|
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
164
164
|
], 2);
|
|
165
165
|
}
|
|
166
|
-
var BwaAdvanceOption = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
166
|
+
var BwaAdvanceOption = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1e505c71"], ["__file", "advance-option.vue"]]);
|
|
167
167
|
|
|
168
168
|
exports["default"] = BwaAdvanceOption;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.letter-circle[data-v-1e505c71]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var install = require('element-plus/es/utils/vue/install');
|
|
6
|
-
var
|
|
6
|
+
var pctMultipleMenuCondition = require('./pct-multiple-menu-condition.js');
|
|
7
7
|
var pctInputCondition = require('./pct-Input-condition.js');
|
|
8
8
|
var pctDateRangeCondition = require('./pct-date-range-condition.js');
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ if (typeof __name === 'undefined') {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
const BwaPctInputCondition = install.withInstall(pctInputCondition["default"], {});
|
|
20
|
-
const BwaPctMultipleMenuCondition = install.withInstall(
|
|
20
|
+
const BwaPctMultipleMenuCondition = install.withInstall(pctMultipleMenuCondition["default"], {});
|
|
21
21
|
const BwaPctDateRangeCondition = install.withInstall(pctDateRangeCondition["default"], {});
|
|
22
22
|
|
|
23
23
|
exports.BwaPctDateRangeCondition = BwaPctDateRangeCondition;
|
|
@@ -395,6 +395,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
|
-
var
|
|
398
|
+
var PctMultipleMenuCondition = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "pct-multiple-menu-condition.vue"]]);
|
|
399
399
|
|
|
400
|
-
exports["default"] =
|
|
400
|
+
exports["default"] = PctMultipleMenuCondition;
|
|
@@ -6,8 +6,6 @@ var vue = require('vue');
|
|
|
6
6
|
var ElementPlus = require('element-plus');
|
|
7
7
|
var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
|
|
8
8
|
var index = require('../../hooks/use-data/index.js');
|
|
9
|
-
var pinyinPro = require('pinyin-pro');
|
|
10
|
-
require('./pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_0a08184f_lang.js');
|
|
11
9
|
var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
|
|
12
10
|
|
|
13
11
|
// Inject __name helper
|
|
@@ -19,37 +17,53 @@ if (typeof __name === 'undefined') {
|
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
23
|
-
const _hoisted_2 = { style: { "margin-left": "8px" } };
|
|
24
20
|
const __default__ = vue.defineComponent({
|
|
25
21
|
name: "BwaPctMultipleMenuCondition",
|
|
26
|
-
__conditionTitle__: "\u591A\u9009\u83DC\u5355",
|
|
22
|
+
__conditionTitle__: "\u591A\u9009\u83DC\u5355-PZ",
|
|
27
23
|
__conditionDefault__: () => []
|
|
28
24
|
});
|
|
29
25
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
30
26
|
props: {
|
|
31
27
|
...index.dataProps,
|
|
32
|
-
modelValue: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: null
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => []
|
|
34
|
+
},
|
|
35
|
+
labelProp: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "label"
|
|
38
|
+
},
|
|
39
|
+
valueProp: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "value"
|
|
42
|
+
},
|
|
43
|
+
multiple: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
filterable: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
placeholder: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "\u8BF7\u9009\u62E9"
|
|
54
|
+
},
|
|
55
|
+
remote: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
size: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "small"
|
|
62
|
+
}
|
|
49
63
|
},
|
|
50
64
|
emits: ["update:modelValue", "search", "visible-change"],
|
|
51
65
|
setup(__props, { emit: __emit }) {
|
|
52
|
-
var _a;
|
|
66
|
+
var _a, _b;
|
|
53
67
|
const httpRequest = webBaseClientVue.useService(webBaseClientVue.HttpRequest);
|
|
54
68
|
;
|
|
55
69
|
const props = __props;
|
|
@@ -64,103 +78,48 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
64
78
|
var _a2;
|
|
65
79
|
return (_a2 = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a2 : null;
|
|
66
80
|
});
|
|
67
|
-
|
|
68
|
-
column.value.componentProps = {
|
|
69
|
-
itfInfo: props.itfInfo,
|
|
70
|
-
labelAttr: props.labelAttr,
|
|
71
|
-
valueAttr: props.valueAttr,
|
|
72
|
-
searchAttr: props.searchAttr,
|
|
73
|
-
showLetterAvatar: props.showLetterAvatar
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const placeholderStr = vue.computed(
|
|
77
|
-
() => {
|
|
78
|
-
var _a2;
|
|
79
|
-
return showTitle.value ? props.placeholder : (_a2 = column.value) == null ? void 0 : _a2.title;
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
const labelPropStr = vue.computed(
|
|
83
|
-
() => {
|
|
84
|
-
var _a2, _b;
|
|
85
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.labelAttr) || props.labelProp;
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
const valuePropStr = vue.computed(
|
|
89
|
-
() => {
|
|
90
|
-
var _a2, _b;
|
|
91
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.valueAttr) || props.valueProp;
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
const showLetterAvatarStatus = vue.computed(
|
|
95
|
-
() => {
|
|
96
|
-
var _a2, _b;
|
|
97
|
-
return ((_b = (_a2 = column.value) == null ? void 0 : _a2.componentProps) == null ? void 0 : _b.showLetterAvatar) || props.showLetterAvatar;
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
const COLOR_POOL = ["#2DC86D", "#19BBFF", "#FFA901"];
|
|
101
|
-
function processLabel(label = "") {
|
|
102
|
-
const match = (label + "").match(/^(.*)\(/);
|
|
103
|
-
const txt = match ? match[1] : label;
|
|
104
|
-
const first = txt.charAt(0);
|
|
105
|
-
let letter = "#";
|
|
106
|
-
if (/[\u4e00-\u9fa5]/.test(first)) {
|
|
107
|
-
letter = pinyinPro.pinyin(first, { pattern: "first" }).toUpperCase();
|
|
108
|
-
} else if (/[a-zA-Z]/.test(first)) {
|
|
109
|
-
letter = first.toUpperCase();
|
|
110
|
-
}
|
|
111
|
-
let color = COLOR_POOL[0];
|
|
112
|
-
if (/[A-Z]/.test(letter)) {
|
|
113
|
-
color = COLOR_POOL[(letter.charCodeAt(0) - 65) % 3];
|
|
114
|
-
}
|
|
115
|
-
return { firstLetter: letter, color };
|
|
116
|
-
}
|
|
81
|
+
const placeholderStr = vue.computed(() => showTitle.value ? props.placeholder : column.value.title);
|
|
117
82
|
const getData = async (query) => {
|
|
118
|
-
var _a2
|
|
119
|
-
if (!((_a2 = column.value) == null ? void 0 : _a2.componentProps)) {
|
|
120
|
-
data.value = (_b = props.options) != null ? _b : [];
|
|
121
|
-
loading.value = false;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
83
|
+
var _a2;
|
|
124
84
|
loading.value = true;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} catch (err) {
|
|
135
|
-
data.value = [];
|
|
136
|
-
} finally {
|
|
137
|
-
loading.value = false;
|
|
138
|
-
}
|
|
85
|
+
const { itfInfo, searchAttr } = column.value.componentProps;
|
|
86
|
+
const { url, method, options, params } = {
|
|
87
|
+
url: vue.unref(itfInfo).url,
|
|
88
|
+
method: vue.unref(itfInfo).method || "POST",
|
|
89
|
+
options: vue.unref(itfInfo).options || {},
|
|
90
|
+
params: { ...vue.unref(itfInfo).params, [searchAttr]: query || "" }
|
|
91
|
+
};
|
|
92
|
+
data.value = (_a2 = await vue.unref(httpRequest)[method.toLowerCase()](url, params, options)) == null ? void 0 : _a2.data;
|
|
93
|
+
loading.value = false;
|
|
139
94
|
};
|
|
140
|
-
|
|
95
|
+
if ((_a = column.value) == null ? void 0 : _a.componentProps) {
|
|
96
|
+
} else {
|
|
97
|
+
data.value = (_b = props.options) != null ? _b : [];
|
|
98
|
+
}
|
|
141
99
|
const visibleChange = (val) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
emit("search", "");
|
|
146
|
-
if (val && ((_a2 = column.value) == null ? void 0 : _a2.componentProps))
|
|
147
|
-
getData();
|
|
100
|
+
if (!val || !column.value.componentProps)
|
|
101
|
+
return;
|
|
102
|
+
getData();
|
|
148
103
|
};
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
104
|
+
const remoteMethod = (query) => {
|
|
105
|
+
if (column.value.componentProps) {
|
|
106
|
+
getData(query);
|
|
107
|
+
} else {
|
|
108
|
+
emit("search", query);
|
|
109
|
+
}
|
|
152
110
|
};
|
|
153
111
|
const modelValue = vue.computed({
|
|
154
112
|
get: () => {
|
|
155
|
-
|
|
156
|
-
|
|
113
|
+
if (props.multiple) {
|
|
114
|
+
return Array.isArray(props.modelValue) ? props.modelValue.map((item) => item + "") : [];
|
|
115
|
+
} else {
|
|
116
|
+
return props.modelValue == null ? "" : props.modelValue + "";
|
|
117
|
+
}
|
|
157
118
|
},
|
|
158
119
|
set: (v) => emit("update:modelValue", v)
|
|
159
120
|
});
|
|
160
121
|
return (_ctx, _cache) => {
|
|
161
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
162
|
-
class: vue.normalizeClass(vue.unref(ns).e("conditbox"))
|
|
163
|
-
}, [
|
|
122
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
164
123
|
showTitle.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
165
124
|
key: 0,
|
|
166
125
|
class: vue.normalizeClass(vue.unref(ns).e("title"))
|
|
@@ -175,7 +134,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
175
134
|
loading: loading.value,
|
|
176
135
|
onVisibleChange: visibleChange,
|
|
177
136
|
remote: __props.remote,
|
|
178
|
-
"remote-method":
|
|
137
|
+
"remote-method": remoteMethod,
|
|
179
138
|
size: __props.size,
|
|
180
139
|
class: vue.normalizeClass(vue.unref(ns).e("multiple")),
|
|
181
140
|
"collapse-tags": "",
|
|
@@ -183,33 +142,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
183
142
|
"no-data-text": "\u6682\u65E0\u6570\u636E"
|
|
184
143
|
}, {
|
|
185
144
|
default: vue.withCtx(() => [
|
|
186
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(data.value, (item) => {
|
|
145
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(data.value, (item, index) => {
|
|
187
146
|
return vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElOption), {
|
|
188
|
-
key: item[
|
|
189
|
-
value: item[
|
|
190
|
-
label: item[
|
|
191
|
-
},
|
|
192
|
-
default: vue.withCtx(() => [
|
|
193
|
-
vue.createCommentVNode(" \u6587\u5B57\u5934\u50CF "),
|
|
194
|
-
vue.createElementVNode("div", _hoisted_1, [
|
|
195
|
-
showLetterAvatarStatus.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
196
|
-
key: 0,
|
|
197
|
-
class: "letter-circle",
|
|
198
|
-
style: vue.normalizeStyle({ backgroundColor: processLabel(item[labelPropStr.value]).color })
|
|
199
|
-
}, vue.toDisplayString(processLabel(item[labelPropStr.value]).firstLetter), 5)) : vue.createCommentVNode("v-if", true),
|
|
200
|
-
vue.createElementVNode("span", _hoisted_2, vue.toDisplayString(item[labelPropStr.value]), 1)
|
|
201
|
-
])
|
|
202
|
-
]),
|
|
203
|
-
_: 2
|
|
204
|
-
}, 1032, ["value", "label"]);
|
|
147
|
+
key: item[__props.valueProp] + index,
|
|
148
|
+
value: item[__props.valueProp] + "",
|
|
149
|
+
label: item[__props.labelProp]
|
|
150
|
+
}, null, 8, ["value", "label"]);
|
|
205
151
|
}), 128))
|
|
206
152
|
]),
|
|
207
153
|
_: 1
|
|
208
154
|
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote", "size", "class"])
|
|
209
|
-
],
|
|
155
|
+
], 64);
|
|
210
156
|
};
|
|
211
157
|
}
|
|
212
158
|
});
|
|
213
|
-
var
|
|
159
|
+
var pctMultipleMenuCondition2 = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "pct-multiple-menu-condition2.vue"]]);
|
|
214
160
|
|
|
215
|
-
exports["default"] =
|
|
161
|
+
exports["default"] = pctMultipleMenuCondition2;
|