@ctzy-web-client/plugin-component-vue 1.0.43 → 1.0.45
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/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +60 -18
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue_vue_type_style_index_1_lang.mjs +13 -0
- package/es/plugins.css +1 -1
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +58 -16
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue_vue_type_style_index_1_lang.js +17 -0
- package/lib/plugins.css +1 -1
- package/package.json +44 -44
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +68 -23
- /package/es/pct-filter-panel/pct-compents/{pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_a6cdfcd8_lang.mjs → pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_cb2d8ca5_lang.mjs} +0 -0
- /package/lib/pct-filter-panel/pct-compents/{pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_a6cdfcd8_lang.js → pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_cb2d8ca5_lang.js} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useAttrs, computed,
|
|
2
|
-
import { ElSelect, ElOption } from 'element-plus';
|
|
1
|
+
import { defineComponent, ref, nextTick, useAttrs, computed, inject, onMounted, unref, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createVNode, withCtx, renderSlot, Fragment, renderList, createBlock, createElementVNode, normalizeStyle } from 'vue';
|
|
2
|
+
import { ElSelect, ElOption, ElTooltip } 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
5
|
import { pinyin } from 'pinyin-pro';
|
|
6
6
|
import '../../advance-select/advance-option.mjs';
|
|
7
|
-
import './pct-multiple-menu-condition2.
|
|
7
|
+
import './pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_cb2d8ca5_lang.mjs';
|
|
8
|
+
import './pct-multiple-menu-condition2.vue_vue_type_style_index_1_lang.mjs';
|
|
8
9
|
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
|
|
9
10
|
|
|
10
11
|
// Inject __name helper
|
|
@@ -16,8 +17,6 @@ if (typeof __name === 'undefined') {
|
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
20
|
-
const _hoisted_2 = { style: { "margin-left": "8px" } };
|
|
21
20
|
const __default__ = defineComponent({
|
|
22
21
|
name: "BwaPctMultipleMenuCondition",
|
|
23
22
|
__conditionTitle__: "\u591A\u9009\u83DC\u5355",
|
|
@@ -49,7 +48,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
49
48
|
emits: ["update:modelValue", "search", "visible-change"],
|
|
50
49
|
setup(__props, { emit: __emit }) {
|
|
51
50
|
const httpRequest = useService(HttpRequest);
|
|
52
|
-
;
|
|
51
|
+
const textRef = ref(null);
|
|
52
|
+
const isOverflow = ref(false);
|
|
53
|
+
const checkOverflow = () => {
|
|
54
|
+
nextTick(() => {
|
|
55
|
+
if (!textRef.value)
|
|
56
|
+
return;
|
|
57
|
+
isOverflow.value = textRef.value.scrollWidth > textRef.value.clientWidth;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
53
60
|
const props = __props;
|
|
54
61
|
const ns = useNamespace("pctfilterpanel-item");
|
|
55
62
|
const attrs = useAttrs();
|
|
@@ -92,7 +99,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
92
99
|
const valuePropStr = computed(
|
|
93
100
|
() => {
|
|
94
101
|
var _a, _b;
|
|
95
|
-
return ((_b = (_a = column.value) == null ? void 0 : _a.componentProps) == null ? void 0 : _b.valueAttr) || props.
|
|
102
|
+
return ((_b = (_a = column.value) == null ? void 0 : _a.componentProps) == null ? void 0 : _b.valueAttr) || props.labelProp;
|
|
96
103
|
}
|
|
97
104
|
);
|
|
98
105
|
const showLetterAvatarStatus = computed(
|
|
@@ -191,7 +198,24 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
191
198
|
class: normalizeClass(unref(ns).e("multiple")),
|
|
192
199
|
"collapse-tags": "",
|
|
193
200
|
"collapse-tags-tooltip": "",
|
|
194
|
-
"no-data-text": "\u6682\u65E0\u6570\u636E"
|
|
201
|
+
"no-data-text": "\u6682\u65E0\u6570\u636E",
|
|
202
|
+
"popper-class": "pct-select-ellipsis",
|
|
203
|
+
"popper-options": {
|
|
204
|
+
modifiers: [
|
|
205
|
+
{
|
|
206
|
+
name: "sameWidth",
|
|
207
|
+
enabled: true,
|
|
208
|
+
phase: "beforeWrite",
|
|
209
|
+
requires: ["computeStyles"],
|
|
210
|
+
fn: ({ state }) => {
|
|
211
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
212
|
+
},
|
|
213
|
+
effect: ({ state }) => {
|
|
214
|
+
state.elements.popper.style.width = `${state.elements.reference.offsetWidth}px`;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
195
219
|
}, {
|
|
196
220
|
default: withCtx(() => [
|
|
197
221
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -202,14 +226,32 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
202
226
|
label: item[labelPropStr.value]
|
|
203
227
|
}, {
|
|
204
228
|
default: withCtx(() => [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
229
|
+
createVNode(unref(ElTooltip), {
|
|
230
|
+
content: item[labelPropStr.value],
|
|
231
|
+
disabled: !isOverflow.value,
|
|
232
|
+
placement: "top",
|
|
233
|
+
effect: "light"
|
|
234
|
+
}, {
|
|
235
|
+
default: withCtx(() => [
|
|
236
|
+
createElementVNode("div", {
|
|
237
|
+
class: "option-container",
|
|
238
|
+
onMouseenter: checkOverflow
|
|
239
|
+
}, [
|
|
240
|
+
showLetterAvatarStatus.value ? (openBlock(), createElementBlock("div", {
|
|
241
|
+
key: 0,
|
|
242
|
+
class: "letter-circle",
|
|
243
|
+
style: normalizeStyle({ backgroundColor: processLabel(item[labelPropStr.value]).color })
|
|
244
|
+
}, toDisplayString(processLabel(item[labelPropStr.value]).firstLetter), 5)) : createCommentVNode("v-if", true),
|
|
245
|
+
createElementVNode("span", {
|
|
246
|
+
class: "option-text",
|
|
247
|
+
ref_for: true,
|
|
248
|
+
ref_key: "textRef",
|
|
249
|
+
ref: textRef
|
|
250
|
+
}, toDisplayString(item[labelPropStr.value]), 513)
|
|
251
|
+
], 32)
|
|
252
|
+
]),
|
|
253
|
+
_: 2
|
|
254
|
+
}, 1032, ["content", "disabled"])
|
|
213
255
|
]),
|
|
214
256
|
_: 2
|
|
215
257
|
}, 1032, ["value", "label"]);
|
|
@@ -217,11 +259,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
217
259
|
], true)
|
|
218
260
|
]),
|
|
219
261
|
_: 3
|
|
220
|
-
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote-show-suffix", "remote", "reserve-keyword", "size", "class"])
|
|
262
|
+
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote-show-suffix", "remote", "reserve-keyword", "size", "class", "popper-options"])
|
|
221
263
|
], 2);
|
|
222
264
|
};
|
|
223
265
|
}
|
|
224
266
|
});
|
|
225
|
-
var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
267
|
+
var PctMultipleMenuCondition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cb2d8ca5"], ["__file", "pct-multiple-menu-condition2.vue"]]);
|
|
226
268
|
|
|
227
269
|
export { PctMultipleMenuCondition as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Inject __name helper
|
|
2
|
+
if (typeof __name === 'undefined') {
|
|
3
|
+
function __name(obj, name) {
|
|
4
|
+
Object.defineProperty(obj, "name", {
|
|
5
|
+
value: name,
|
|
6
|
+
configurable: true
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var undefined$1 = undefined;
|
|
12
|
+
|
|
13
|
+
export { undefined$1 as default };
|
package/es/plugins.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.letter-circle[data-v-9ba46efc]{font-size:14px;height:24px;margin-right:8px;width:24px}.
|
|
1
|
+
.letter-circle[data-v-9ba46efc]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-size:12px;height:22px;justify-content:center;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -8,7 +8,8 @@ var webBaseClientVue = require('@ctzy-web-client/web-base-client-vue');
|
|
|
8
8
|
var index = require('../../hooks/use-data/index.js');
|
|
9
9
|
var pinyinPro = require('pinyin-pro');
|
|
10
10
|
require('../../advance-select/advance-option.js');
|
|
11
|
-
require('./pct-multiple-menu-condition2.
|
|
11
|
+
require('./pct-multiple-menu-condition2.vue_vue_type_style_index_0_scoped_cb2d8ca5_lang.js');
|
|
12
|
+
require('./pct-multiple-menu-condition2.vue_vue_type_style_index_1_lang.js');
|
|
12
13
|
var _pluginVue_exportHelper = require('../../_virtual/_plugin-vue_export-helper.js');
|
|
13
14
|
|
|
14
15
|
// Inject __name helper
|
|
@@ -20,8 +21,6 @@ if (typeof __name === 'undefined') {
|
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
const _hoisted_1 = { style: { "display": "flex", "align-items": "center" } };
|
|
24
|
-
const _hoisted_2 = { style: { "margin-left": "8px" } };
|
|
25
24
|
const __default__ = vue.defineComponent({
|
|
26
25
|
name: "BwaPctMultipleMenuCondition",
|
|
27
26
|
__conditionTitle__: "\u591A\u9009\u83DC\u5355",
|
|
@@ -53,7 +52,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
53
52
|
emits: ["update:modelValue", "search", "visible-change"],
|
|
54
53
|
setup(__props, { emit: __emit }) {
|
|
55
54
|
const httpRequest = webBaseClientVue.useService(webBaseClientVue.HttpRequest);
|
|
56
|
-
;
|
|
55
|
+
const textRef = vue.ref(null);
|
|
56
|
+
const isOverflow = vue.ref(false);
|
|
57
|
+
const checkOverflow = () => {
|
|
58
|
+
vue.nextTick(() => {
|
|
59
|
+
if (!textRef.value)
|
|
60
|
+
return;
|
|
61
|
+
isOverflow.value = textRef.value.scrollWidth > textRef.value.clientWidth;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
57
64
|
const props = __props;
|
|
58
65
|
const ns = webBaseClientVue.useNamespace("pctfilterpanel-item");
|
|
59
66
|
const attrs = vue.useAttrs();
|
|
@@ -96,7 +103,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
103
|
const valuePropStr = vue.computed(
|
|
97
104
|
() => {
|
|
98
105
|
var _a, _b;
|
|
99
|
-
return ((_b = (_a = column.value) == null ? void 0 : _a.componentProps) == null ? void 0 : _b.valueAttr) || props.
|
|
106
|
+
return ((_b = (_a = column.value) == null ? void 0 : _a.componentProps) == null ? void 0 : _b.valueAttr) || props.labelProp;
|
|
100
107
|
}
|
|
101
108
|
);
|
|
102
109
|
const showLetterAvatarStatus = vue.computed(
|
|
@@ -195,7 +202,24 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
195
202
|
class: vue.normalizeClass(vue.unref(ns).e("multiple")),
|
|
196
203
|
"collapse-tags": "",
|
|
197
204
|
"collapse-tags-tooltip": "",
|
|
198
|
-
"no-data-text": "\u6682\u65E0\u6570\u636E"
|
|
205
|
+
"no-data-text": "\u6682\u65E0\u6570\u636E",
|
|
206
|
+
"popper-class": "pct-select-ellipsis",
|
|
207
|
+
"popper-options": {
|
|
208
|
+
modifiers: [
|
|
209
|
+
{
|
|
210
|
+
name: "sameWidth",
|
|
211
|
+
enabled: true,
|
|
212
|
+
phase: "beforeWrite",
|
|
213
|
+
requires: ["computeStyles"],
|
|
214
|
+
fn: ({ state }) => {
|
|
215
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
216
|
+
},
|
|
217
|
+
effect: ({ state }) => {
|
|
218
|
+
state.elements.popper.style.width = `${state.elements.reference.offsetWidth}px`;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
199
223
|
}, {
|
|
200
224
|
default: vue.withCtx(() => [
|
|
201
225
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -206,14 +230,32 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
206
230
|
label: item[labelPropStr.value]
|
|
207
231
|
}, {
|
|
208
232
|
default: vue.withCtx(() => [
|
|
209
|
-
vue.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
vue.
|
|
216
|
-
|
|
233
|
+
vue.createVNode(vue.unref(ElementPlus.ElTooltip), {
|
|
234
|
+
content: item[labelPropStr.value],
|
|
235
|
+
disabled: !isOverflow.value,
|
|
236
|
+
placement: "top",
|
|
237
|
+
effect: "light"
|
|
238
|
+
}, {
|
|
239
|
+
default: vue.withCtx(() => [
|
|
240
|
+
vue.createElementVNode("div", {
|
|
241
|
+
class: "option-container",
|
|
242
|
+
onMouseenter: checkOverflow
|
|
243
|
+
}, [
|
|
244
|
+
showLetterAvatarStatus.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "letter-circle",
|
|
247
|
+
style: vue.normalizeStyle({ backgroundColor: processLabel(item[labelPropStr.value]).color })
|
|
248
|
+
}, vue.toDisplayString(processLabel(item[labelPropStr.value]).firstLetter), 5)) : vue.createCommentVNode("v-if", true),
|
|
249
|
+
vue.createElementVNode("span", {
|
|
250
|
+
class: "option-text",
|
|
251
|
+
ref_for: true,
|
|
252
|
+
ref_key: "textRef",
|
|
253
|
+
ref: textRef
|
|
254
|
+
}, vue.toDisplayString(item[labelPropStr.value]), 513)
|
|
255
|
+
], 32)
|
|
256
|
+
]),
|
|
257
|
+
_: 2
|
|
258
|
+
}, 1032, ["content", "disabled"])
|
|
217
259
|
]),
|
|
218
260
|
_: 2
|
|
219
261
|
}, 1032, ["value", "label"]);
|
|
@@ -221,11 +263,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
221
263
|
], true)
|
|
222
264
|
]),
|
|
223
265
|
_: 3
|
|
224
|
-
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote-show-suffix", "remote", "reserve-keyword", "size", "class"])
|
|
266
|
+
}, 8, ["modelValue", "multiple", "filterable", "placeholder", "loading", "remote-show-suffix", "remote", "reserve-keyword", "size", "class", "popper-options"])
|
|
225
267
|
], 2);
|
|
226
268
|
};
|
|
227
269
|
}
|
|
228
270
|
});
|
|
229
|
-
var PctMultipleMenuCondition = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__scopeId", "data-v-
|
|
271
|
+
var PctMultipleMenuCondition = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__scopeId", "data-v-cb2d8ca5"], ["__file", "pct-multiple-menu-condition2.vue"]]);
|
|
230
272
|
|
|
231
273
|
exports["default"] = PctMultipleMenuCondition;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
// Inject __name helper
|
|
6
|
+
if (typeof __name === 'undefined') {
|
|
7
|
+
function __name(obj, name) {
|
|
8
|
+
Object.defineProperty(obj, "name", {
|
|
9
|
+
value: name,
|
|
10
|
+
configurable: true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var undefined$1 = undefined;
|
|
16
|
+
|
|
17
|
+
exports["default"] = undefined$1;
|
package/lib/plugins.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.letter-circle[data-v-9ba46efc]{font-size:14px;height:24px;margin-right:8px;width:24px}.
|
|
1
|
+
.letter-circle[data-v-9ba46efc]{align-items:center;border-radius:50%;color:#fff;display:flex;font-size:14px;height:24px;justify-content:center;margin-right:8px;width:24px}.pct-select-ellipsis .el-select-dropdown__item{box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}.letter-circle[data-v-cb2d8ca5]{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-size:12px;height:22px;justify-content:center;width:22px}.option-container[data-v-cb2d8ca5]{align-items:center;display:flex;width:100%}.option-text[data-v-cb2d8ca5]{flex:1;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ctzy-web-client/plugin-component-vue",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "lib/index.js",
|
|
5
|
-
"module": "es/index.mjs",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"require": "./lib/index.js",
|
|
9
|
-
"import": "./es/index.mjs"
|
|
10
|
-
},
|
|
11
|
-
"./src": "./src/index.js",
|
|
12
|
-
"./src/*": "./src/*",
|
|
13
|
-
"./es": "./es/index.mjs",
|
|
14
|
-
"./lib": "./lib/index.js",
|
|
15
|
-
"./es/*": "./es/*",
|
|
16
|
-
"./lib/*": "./lib/*",
|
|
17
|
-
"./style": "./style/index.css",
|
|
18
|
-
"./style/*": "./style/*",
|
|
19
|
-
"./style/src": "./style/src/index.scss",
|
|
20
|
-
"./style/src/*": "./style/src/*"
|
|
21
|
-
},
|
|
22
|
-
"style": "./style/index.css",
|
|
23
|
-
"author": "tommy",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"description": "web client 通用ui库",
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@element-plus/icons": "^0.0.11",
|
|
28
|
-
"@tinymce/tinymce-vue": "^5",
|
|
29
|
-
"dayjs": "^1.11.6",
|
|
30
|
-
"dexie": "^3.2.3",
|
|
31
|
-
"element-plus": "^2.10.2",
|
|
32
|
-
"lodash": "^4.17.21",
|
|
33
|
-
"quill": "^1.3.7",
|
|
34
|
-
"rxjs": "^7.6.0",
|
|
35
|
-
"tinymce": "^6.4.2",
|
|
36
|
-
"pinyin-pro": "^3.28.0",
|
|
37
|
-
"@ctzy-web-client/web-base-client-vue": "^1.0.0"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@vueuse/core": "^9.6.0",
|
|
41
|
-
"vue": "^3.2.41",
|
|
42
|
-
"vue-router": "^4.1.6"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ctzy-web-client/plugin-component-vue",
|
|
3
|
+
"version": "1.0.45",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"module": "es/index.mjs",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"require": "./lib/index.js",
|
|
9
|
+
"import": "./es/index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"./src": "./src/index.js",
|
|
12
|
+
"./src/*": "./src/*",
|
|
13
|
+
"./es": "./es/index.mjs",
|
|
14
|
+
"./lib": "./lib/index.js",
|
|
15
|
+
"./es/*": "./es/*",
|
|
16
|
+
"./lib/*": "./lib/*",
|
|
17
|
+
"./style": "./style/index.css",
|
|
18
|
+
"./style/*": "./style/*",
|
|
19
|
+
"./style/src": "./style/src/index.scss",
|
|
20
|
+
"./style/src/*": "./style/src/*"
|
|
21
|
+
},
|
|
22
|
+
"style": "./style/index.css",
|
|
23
|
+
"author": "tommy",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"description": "web client 通用ui库",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@element-plus/icons": "^0.0.11",
|
|
28
|
+
"@tinymce/tinymce-vue": "^5",
|
|
29
|
+
"dayjs": "^1.11.6",
|
|
30
|
+
"dexie": "^3.2.3",
|
|
31
|
+
"element-plus": "^2.10.2",
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
|
+
"quill": "^1.3.7",
|
|
34
|
+
"rxjs": "^7.6.0",
|
|
35
|
+
"tinymce": "^6.4.2",
|
|
36
|
+
"pinyin-pro": "^3.28.0",
|
|
37
|
+
"@ctzy-web-client/web-base-client-vue": "^1.0.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@vueuse/core": "^9.6.0",
|
|
41
|
+
"vue": "^3.2.41",
|
|
42
|
+
"vue-router": "^4.1.6"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -19,6 +19,23 @@
|
|
|
19
19
|
collapse-tags
|
|
20
20
|
collapse-tags-tooltip
|
|
21
21
|
no-data-text="暂无数据"
|
|
22
|
+
popper-class="pct-select-ellipsis"
|
|
23
|
+
:popper-options="{
|
|
24
|
+
modifiers: [
|
|
25
|
+
{
|
|
26
|
+
name: 'sameWidth',
|
|
27
|
+
enabled: true,
|
|
28
|
+
phase: 'beforeWrite',
|
|
29
|
+
requires: ['computeStyles'],
|
|
30
|
+
fn: ({ state }) => {
|
|
31
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
32
|
+
},
|
|
33
|
+
effect: ({ state }) => {
|
|
34
|
+
state.elements.popper.style.width = `${state.elements.reference.offsetWidth}px`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}"
|
|
22
39
|
>
|
|
23
40
|
<slot>
|
|
24
41
|
<ElOption
|
|
@@ -27,27 +44,33 @@
|
|
|
27
44
|
:value="item[valuePropStr]"
|
|
28
45
|
:label="item[labelPropStr]"
|
|
29
46
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
<ElTooltip
|
|
48
|
+
:content="item[labelPropStr]"
|
|
49
|
+
:disabled="!isOverflow"
|
|
50
|
+
placement="top"
|
|
51
|
+
effect="light"
|
|
52
|
+
>
|
|
53
|
+
<div class="option-container" @mouseenter="checkOverflow">
|
|
54
|
+
<div
|
|
55
|
+
v-if="showLetterAvatarStatus"
|
|
56
|
+
class="letter-circle"
|
|
57
|
+
:style="{ backgroundColor: processLabel(item[labelPropStr]).color }"
|
|
58
|
+
>
|
|
59
|
+
{{ processLabel(item[labelPropStr]).firstLetter }}
|
|
60
|
+
</div>
|
|
61
|
+
<span class="option-text" ref="textRef">{{ item[labelPropStr] }}</span>
|
|
37
62
|
</div>
|
|
38
|
-
|
|
39
|
-
</div>
|
|
63
|
+
</ElTooltip>
|
|
40
64
|
</ElOption>
|
|
41
65
|
</slot>
|
|
42
|
-
|
|
43
66
|
</ElSelect>
|
|
44
67
|
</div>
|
|
45
68
|
</template>
|
|
46
69
|
|
|
47
70
|
<script setup>
|
|
48
|
-
import { ElOption, ElSelect } from 'element-plus';
|
|
71
|
+
import { ElOption, ElSelect, ElTooltip } from 'element-plus';
|
|
49
72
|
import { useNamespace } from '@ctzy-web-client/web-base-client-vue';
|
|
50
|
-
import { computed, unref, defineEmits, inject, ref, useAttrs, watch, onMounted } from 'vue';
|
|
73
|
+
import { computed, unref, defineEmits, inject, ref, useAttrs, watch, onMounted, nextTick } from 'vue';
|
|
51
74
|
import { dataProps } from '../../hooks/use-data';
|
|
52
75
|
import {
|
|
53
76
|
useService,
|
|
@@ -58,6 +81,16 @@ import { pinyin } from 'pinyin-pro';
|
|
|
58
81
|
import BwaAdvanceOption from "../../advance-select/advance-option.vue";
|
|
59
82
|
|
|
60
83
|
const httpRequest = useService(HttpRequest);
|
|
84
|
+
const textRef = ref(null)
|
|
85
|
+
const isOverflow = ref(false)
|
|
86
|
+
|
|
87
|
+
// 判断文本是否溢出
|
|
88
|
+
const checkOverflow = () => {
|
|
89
|
+
nextTick(() => {
|
|
90
|
+
if (!textRef.value) return
|
|
91
|
+
isOverflow.value = textRef.value.scrollWidth > textRef.value.clientWidth
|
|
92
|
+
})
|
|
93
|
+
}
|
|
61
94
|
|
|
62
95
|
defineOptions({
|
|
63
96
|
name: 'BwaPctMultipleMenuCondition',
|
|
@@ -97,7 +130,6 @@ const emit = defineEmits(['update:modelValue', 'search', 'visible-change']);
|
|
|
97
130
|
const filterPanelItem = inject(filterPanelItemKey, null);
|
|
98
131
|
const column = computed(() => filterPanelItem?.column ?? null);
|
|
99
132
|
|
|
100
|
-
// 修复1:在 onMounted 中赋值 itfInfo,此时 column 已初始化
|
|
101
133
|
onMounted(() => {
|
|
102
134
|
if (props.itfInfo && column.value) {
|
|
103
135
|
column.value.componentProps = {
|
|
@@ -108,7 +140,6 @@ onMounted(() => {
|
|
|
108
140
|
showLetterAvatar: props.showLetterAvatar,
|
|
109
141
|
};
|
|
110
142
|
}
|
|
111
|
-
// 初始化数据
|
|
112
143
|
if (!column.value?.componentProps?.itfInfo) {
|
|
113
144
|
data.value = props.options ?? [];
|
|
114
145
|
}
|
|
@@ -121,13 +152,12 @@ const labelPropStr = computed(
|
|
|
121
152
|
() => column.value?.componentProps?.labelAttr || props.labelProp
|
|
122
153
|
);
|
|
123
154
|
const valuePropStr = computed(
|
|
124
|
-
() => column.value?.componentProps?.valueAttr || props.
|
|
155
|
+
() => column.value?.componentProps?.valueAttr || props.labelProp
|
|
125
156
|
);
|
|
126
157
|
const showLetterAvatarStatus = computed(
|
|
127
158
|
() => column.value?.componentProps?.showLetterAvatar || props.showLetterAvatar
|
|
128
159
|
);
|
|
129
160
|
|
|
130
|
-
// 文字头像逻辑
|
|
131
161
|
const COLOR_POOL = ['#2DC86D', '#19BBFF', '#FFA901'];
|
|
132
162
|
function processLabel(label = '') {
|
|
133
163
|
const match = (label + '').match(/^(.*)\(/);
|
|
@@ -146,7 +176,6 @@ function processLabel(label = '') {
|
|
|
146
176
|
return { firstLetter: letter, color };
|
|
147
177
|
}
|
|
148
178
|
|
|
149
|
-
// 修复2:getData 函数,处理 URL 拼接,避免 404
|
|
150
179
|
const getData = async (query = '') => {
|
|
151
180
|
if (!column.value?.componentProps?.itfInfo) {
|
|
152
181
|
data.value = props.options ?? [];
|
|
@@ -158,8 +187,6 @@ const getData = async (query = '') => {
|
|
|
158
187
|
const method = unref(itfInfo).method || 'POST';
|
|
159
188
|
const url = unref(itfInfo).url;
|
|
160
189
|
const params = { ...unref(itfInfo).params, [searchAttr]: query };
|
|
161
|
-
|
|
162
|
-
// 关键修复:移除多余的 baseURL 选项,避免重复拼接
|
|
163
190
|
const res = await unref(httpRequest)[method.toLowerCase()](url, params);
|
|
164
191
|
data.value = res?.data || [];
|
|
165
192
|
} catch (err) {
|
|
@@ -170,15 +197,12 @@ const getData = async (query = '') => {
|
|
|
170
197
|
}
|
|
171
198
|
};
|
|
172
199
|
|
|
173
|
-
// 修复3:visibleChange 逻辑,确保请求能正常触发
|
|
174
200
|
const visibleChange = (val) => {
|
|
175
201
|
emit('visible-change', val);
|
|
176
202
|
if (val) {
|
|
177
|
-
// 展开时触发空搜索
|
|
178
203
|
if (props.isRequiredByVisibleChange) {
|
|
179
204
|
emit('search', '');
|
|
180
205
|
}
|
|
181
|
-
// 只有配置了 itfInfo 才请求接口
|
|
182
206
|
if (column.value?.componentProps?.itfInfo) {
|
|
183
207
|
getData('');
|
|
184
208
|
}
|
|
@@ -193,7 +217,6 @@ const handleFieldSearch = (query) => {
|
|
|
193
217
|
}
|
|
194
218
|
};
|
|
195
219
|
|
|
196
|
-
// 双向绑定
|
|
197
220
|
const modelValue = computed({
|
|
198
221
|
get: () => props.multiple
|
|
199
222
|
? (Array.isArray(props.modelValue) ? props.modelValue : [])
|
|
@@ -214,4 +237,26 @@ const modelValue = computed({
|
|
|
214
237
|
font-size: 12px;
|
|
215
238
|
flex-shrink: 0;
|
|
216
239
|
}
|
|
240
|
+
.option-container {
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
width: 100%;
|
|
244
|
+
}
|
|
245
|
+
.option-text {
|
|
246
|
+
margin-left: 8px;
|
|
247
|
+
flex: 1;
|
|
248
|
+
white-space: nowrap;
|
|
249
|
+
overflow: hidden;
|
|
250
|
+
text-overflow: ellipsis;
|
|
251
|
+
}
|
|
252
|
+
</style>
|
|
253
|
+
|
|
254
|
+
<style>
|
|
255
|
+
.pct-select-ellipsis .el-select-dropdown__item {
|
|
256
|
+
width: 100% !important;
|
|
257
|
+
box-sizing: border-box !important;
|
|
258
|
+
white-space: nowrap !important;
|
|
259
|
+
overflow: hidden !important;
|
|
260
|
+
text-overflow: ellipsis !important;
|
|
261
|
+
}
|
|
217
262
|
</style>
|
|
File without changes
|