@fangzhongya/fang-ui 0.1.48 → 0.1.49
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/dist/components/common/compons/components.cjs +15 -15
- package/dist/components/common/compons/components.js +15 -15
- package/dist/components/dates-picker/src/util.cjs +4 -55
- package/dist/components/dates-picker/src/util.js +4 -55
- package/dist/components/double/src/index2.cjs +39 -36
- package/dist/components/double/src/index2.js +39 -36
- package/dist/components/forms-div/src/index2.cjs +3 -5
- package/dist/components/forms-div/src/index2.js +3 -5
- package/dist/components/index.cjs +72 -88
- package/dist/components/index.d.ts +0 -8
- package/dist/components/index.js +0 -16
- package/dist/components/list/src/index2.cjs +2 -3
- package/dist/components/list/src/index2.js +2 -3
- package/dist/components/list/src/util.cjs +14 -10
- package/dist/components/list/src/util.d.ts +2 -7
- package/dist/components/list/src/util.js +6 -2
- package/dist/expand/{chunk-PBGPF77Y.cjs → chunk-A7IW6WRD.cjs} +0 -8
- package/dist/expand/{chunk-S57QISTZ.js → chunk-L4FI5HCY.js} +0 -8
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/hooks/compons/index.cjs +1 -1
- package/dist/hooks/compons/index.d.ts +1 -1
- package/dist/hooks/compons/index.js +1 -1
- package/dist/hooks/compons/load.d.ts +1 -0
- package/dist/hooks/event-aliass/index.cjs +1 -1
- package/dist/hooks/event-aliass/index.js +1 -1
- package/dist/icons/index.json +1 -1
- package/dist/index.cjs +94 -110
- package/dist/index.js +0 -16
- package/package.json +2 -2
- package/dist/components/choice-select/index.cjs +0 -8
- package/dist/components/choice-select/index.d.ts +0 -5
- package/dist/components/choice-select/index.js +0 -8
- package/dist/components/choice-select/src/data.cjs +0 -26
- package/dist/components/choice-select/src/data.d.ts +0 -34
- package/dist/components/choice-select/src/data.js +0 -26
- package/dist/components/choice-select/src/index.cjs +0 -4
- package/dist/components/choice-select/src/index.js +0 -4
- package/dist/components/choice-select/src/index2.cjs +0 -30
- package/dist/components/choice-select/src/index2.js +0 -30
- package/dist/components/company-select/index.cjs +0 -8
- package/dist/components/company-select/index.d.ts +0 -5
- package/dist/components/company-select/index.js +0 -8
- package/dist/components/company-select/src/data.cjs +0 -76
- package/dist/components/company-select/src/data.d.ts +0 -109
- package/dist/components/company-select/src/data.js +0 -76
- package/dist/components/company-select/src/index.cjs +0 -4
- package/dist/components/company-select/src/index.js +0 -4
- package/dist/components/company-select/src/index2.cjs +0 -201
- package/dist/components/company-select/src/index2.js +0 -201
- package/dist/components/department-select/index.cjs +0 -8
- package/dist/components/department-select/index.d.ts +0 -5
- package/dist/components/department-select/index.js +0 -8
- package/dist/components/department-select/src/data.cjs +0 -88
- package/dist/components/department-select/src/data.d.ts +0 -128
- package/dist/components/department-select/src/data.js +0 -88
- package/dist/components/department-select/src/index.cjs +0 -4
- package/dist/components/department-select/src/index.js +0 -4
- package/dist/components/department-select/src/index2.cjs +0 -60
- package/dist/components/department-select/src/index2.js +0 -60
- package/dist/components/role-select/index.cjs +0 -8
- package/dist/components/role-select/index.d.ts +0 -5
- package/dist/components/role-select/index.js +0 -8
- package/dist/components/role-select/src/data.cjs +0 -79
- package/dist/components/role-select/src/data.d.ts +0 -107
- package/dist/components/role-select/src/data.js +0 -79
- package/dist/components/role-select/src/index.cjs +0 -4
- package/dist/components/role-select/src/index.js +0 -4
- package/dist/components/role-select/src/index2.cjs +0 -215
- package/dist/components/role-select/src/index2.js +0 -215
- package/dist/components/select-dialog/index.cjs +0 -8
- package/dist/components/select-dialog/index.d.ts +0 -5
- package/dist/components/select-dialog/index.js +0 -8
- package/dist/components/select-dialog/src/data.cjs +0 -92
- package/dist/components/select-dialog/src/data.d.ts +0 -131
- package/dist/components/select-dialog/src/data.js +0 -92
- package/dist/components/select-dialog/src/index.cjs +0 -4
- package/dist/components/select-dialog/src/index.js +0 -4
- package/dist/components/select-dialog/src/index2.cjs +0 -226
- package/dist/components/select-dialog/src/index2.js +0 -226
- package/dist/components/select-popover/index.cjs +0 -8
- package/dist/components/select-popover/index.d.ts +0 -5
- package/dist/components/select-popover/index.js +0 -8
- package/dist/components/select-popover/src/data.cjs +0 -38
- package/dist/components/select-popover/src/data.d.ts +0 -41
- package/dist/components/select-popover/src/data.js +0 -38
- package/dist/components/select-popover/src/index.cjs +0 -4
- package/dist/components/select-popover/src/index.js +0 -4
- package/dist/components/select-popover/src/index2.cjs +0 -177
- package/dist/components/select-popover/src/index2.js +0 -177
- package/dist/components/tree-select-box/index.cjs +0 -8
- package/dist/components/tree-select-box/index.d.ts +0 -5
- package/dist/components/tree-select-box/index.js +0 -8
- package/dist/components/tree-select-box/src/data.cjs +0 -100
- package/dist/components/tree-select-box/src/data.d.ts +0 -143
- package/dist/components/tree-select-box/src/data.js +0 -100
- package/dist/components/tree-select-box/src/index.cjs +0 -4
- package/dist/components/tree-select-box/src/index.js +0 -4
- package/dist/components/tree-select-box/src/index2.cjs +0 -255
- package/dist/components/tree-select-box/src/index2.js +0 -255
- package/dist/components/user-select/index.cjs +0 -8
- package/dist/components/user-select/index.d.ts +0 -5
- package/dist/components/user-select/index.js +0 -8
- package/dist/components/user-select/src/data.cjs +0 -99
- package/dist/components/user-select/src/data.d.ts +0 -144
- package/dist/components/user-select/src/data.js +0 -99
- package/dist/components/user-select/src/index.cjs +0 -4
- package/dist/components/user-select/src/index.js +0 -4
- package/dist/components/user-select/src/index2.cjs +0 -381
- package/dist/components/user-select/src/index2.js +0 -381
- /package/dist/components/{keep-com → texts}/index.css +0 -0
- /package/dist/css/{keep-com.css → texts.css} +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { buildProps } from "../../../utils/vues/buildProps.js";
|
|
2
|
-
import { definePropType } from "../../../utils/vues/definePropType.js";
|
|
3
|
-
const roleSelect = {
|
|
4
|
-
searchPlaceholder: "请输入字段进行查询",
|
|
5
|
-
value: "value",
|
|
6
|
-
//指定选项标签为选项对象的某个属性值
|
|
7
|
-
label: "label",
|
|
8
|
-
//指定选项的子选项为选项对象的某个属性值
|
|
9
|
-
children: "children",
|
|
10
|
-
//指定选项的禁用为选项对象的某个属性值
|
|
11
|
-
disabled: "disabled",
|
|
12
|
-
// 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组
|
|
13
|
-
// 若设置 false,则只返回该节点的值
|
|
14
|
-
emitPath: true,
|
|
15
|
-
// 是否严格的遵守父子节点不互相关联
|
|
16
|
-
checkStrictly: true,
|
|
17
|
-
// 是否动态加载子节点,需与 lazyLoad 方法结合使用
|
|
18
|
-
lazy: false
|
|
19
|
-
// // 是否多选
|
|
20
|
-
// multiple: false,
|
|
21
|
-
};
|
|
22
|
-
const name = "role-select";
|
|
23
|
-
const dataProps = buildProps({
|
|
24
|
-
/**
|
|
25
|
-
* @props { Array} modelValue=
|
|
26
|
-
* 值
|
|
27
|
-
*/
|
|
28
|
-
modelValue: {
|
|
29
|
-
type: [Array]
|
|
30
|
-
},
|
|
31
|
-
appendToBody: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: true
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* @props { String, Number} width= ( )
|
|
37
|
-
* 弹框宽度
|
|
38
|
-
*/
|
|
39
|
-
width: {
|
|
40
|
-
type: [String, Number]
|
|
41
|
-
},
|
|
42
|
-
title: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "选择角色"
|
|
45
|
-
},
|
|
46
|
-
placeholder: {
|
|
47
|
-
type: String
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* @props { Boolean } disabled= ( )
|
|
51
|
-
* 是否禁用
|
|
52
|
-
*/
|
|
53
|
-
disabled: {
|
|
54
|
-
type: [Boolean]
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* @props { Object } props={} ( )
|
|
58
|
-
* 配置选项
|
|
59
|
-
*/
|
|
60
|
-
props: {
|
|
61
|
-
type: definePropType(Object),
|
|
62
|
-
default() {
|
|
63
|
-
return {};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
const dataEmits = ["change", "update:modelValue"];
|
|
68
|
-
const dataSlot = {
|
|
69
|
-
default: "default"
|
|
70
|
-
};
|
|
71
|
-
const dataExpose = {};
|
|
72
|
-
export {
|
|
73
|
-
dataEmits,
|
|
74
|
-
dataExpose,
|
|
75
|
-
dataProps,
|
|
76
|
-
dataSlot,
|
|
77
|
-
name,
|
|
78
|
-
roleSelect
|
|
79
|
-
};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const vue = require("vue");
|
|
4
|
-
const data = require("./data.cjs");
|
|
5
|
-
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
6
|
-
const index = require("../../../hooks/locale/index.cjs");
|
|
7
|
-
const index$6 = require("../../table-column/index.cjs");
|
|
8
|
-
const index$5 = require("../../table/index.cjs");
|
|
9
|
-
const index$3 = require("../../input/index.cjs");
|
|
10
|
-
const index$4 = require("../../checkbox-group/index.cjs");
|
|
11
|
-
const index$7 = require("../../checkbox/index.cjs");
|
|
12
|
-
const index$2 = require("../../select-dialog/index.cjs");
|
|
13
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
14
|
-
__name: "index",
|
|
15
|
-
props: data.dataProps,
|
|
16
|
-
emits: data.dataEmits,
|
|
17
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18
|
-
const { getLocale } = index.useLocale();
|
|
19
|
-
const cs = index$1.useCssName(data.name);
|
|
20
|
-
const propss = __props;
|
|
21
|
-
const emit = __emit;
|
|
22
|
-
const refSelectDialog = vue.ref();
|
|
23
|
-
const psprops = vue.computed(() => {
|
|
24
|
-
return {
|
|
25
|
-
...data.roleSelect,
|
|
26
|
-
...propss.props
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
const search = vue.ref("");
|
|
30
|
-
function onInput() {
|
|
31
|
-
const prop = psprops.value.value;
|
|
32
|
-
if (psprops.value.lazyLoad) {
|
|
33
|
-
psprops.value.lazyLoad(search.value, (v) => {
|
|
34
|
-
for (const o of v) {
|
|
35
|
-
const id = o[prop];
|
|
36
|
-
nodes.value[id] = o;
|
|
37
|
-
}
|
|
38
|
-
listData.value = v;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
const list = vue.ref([]);
|
|
43
|
-
vue.watch(
|
|
44
|
-
() => propss.modelValue,
|
|
45
|
-
() => {
|
|
46
|
-
if (propss.modelValue) {
|
|
47
|
-
list.value = [...propss.modelValue];
|
|
48
|
-
} else {
|
|
49
|
-
list.value = [];
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{ immediate: true, deep: true }
|
|
53
|
-
);
|
|
54
|
-
const nodes = vue.ref({});
|
|
55
|
-
const listData = vue.ref([]);
|
|
56
|
-
function onChange(obj) {
|
|
57
|
-
const prop = psprops.value.value;
|
|
58
|
-
if (!psprops.value.multiple) {
|
|
59
|
-
list.value = [obj[prop]];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function getName(key) {
|
|
63
|
-
const name2 = psprops.value.label;
|
|
64
|
-
let obj = nodes.value[key] || {};
|
|
65
|
-
return obj[name2];
|
|
66
|
-
}
|
|
67
|
-
function getNameExplain(key) {
|
|
68
|
-
const name2 = psprops.value.explain;
|
|
69
|
-
if (name2) {
|
|
70
|
-
let obj = nodes.value[key] || {};
|
|
71
|
-
return obj[name2];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function onDialog(is) {
|
|
75
|
-
if (is) {
|
|
76
|
-
if (propss.modelValue) {
|
|
77
|
-
list.value = [...propss.modelValue];
|
|
78
|
-
} else {
|
|
79
|
-
list.value = [];
|
|
80
|
-
}
|
|
81
|
-
search.value = "";
|
|
82
|
-
onInput();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function onDialogffirm(val) {
|
|
86
|
-
emit("update:modelValue", val);
|
|
87
|
-
emit("change", val);
|
|
88
|
-
}
|
|
89
|
-
onInput();
|
|
90
|
-
function setNodesObj(node) {
|
|
91
|
-
if (node) {
|
|
92
|
-
if (Array.isArray(node)) {
|
|
93
|
-
const prop = psprops.value.value;
|
|
94
|
-
for (const o of node) {
|
|
95
|
-
const id = o[prop];
|
|
96
|
-
nodes.value[id] = o;
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
for (const key of Object.keys(node)) {
|
|
100
|
-
nodes.value[key] = node[key];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
__expose({
|
|
106
|
-
...data.dataExpose,
|
|
107
|
-
setNodesObj,
|
|
108
|
-
getInputName() {
|
|
109
|
-
return refSelectDialog.value.inputName;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
return (_ctx, _cache) => {
|
|
113
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
114
|
-
class: vue.normalizeClass(vue.unref(cs).z())
|
|
115
|
-
}, [
|
|
116
|
-
vue.createVNode(vue.unref(index$2.SelectDialog), {
|
|
117
|
-
"get-name": getName,
|
|
118
|
-
"get-name-explain": getNameExplain,
|
|
119
|
-
disabled: propss.disabled,
|
|
120
|
-
placeholder: propss.placeholder,
|
|
121
|
-
appendToBody: propss.appendToBody,
|
|
122
|
-
ref_key: "refSelectDialog",
|
|
123
|
-
ref: refSelectDialog,
|
|
124
|
-
modelValue: list.value,
|
|
125
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => list.value = $event),
|
|
126
|
-
value: propss.modelValue,
|
|
127
|
-
width: propss.width,
|
|
128
|
-
title: propss.title,
|
|
129
|
-
onDialog,
|
|
130
|
-
onConfirm: onDialogffirm
|
|
131
|
-
}, {
|
|
132
|
-
suffix: vue.withCtx(() => [
|
|
133
|
-
vue.renderSlot(_ctx.$slots, "suffix")
|
|
134
|
-
]),
|
|
135
|
-
default: vue.withCtx(() => [
|
|
136
|
-
vue.createElementVNode("div", {
|
|
137
|
-
class: vue.normalizeClass(vue.unref(cs).z("dialog-li"))
|
|
138
|
-
}, [
|
|
139
|
-
vue.createElementVNode("div", {
|
|
140
|
-
class: vue.normalizeClass(vue.unref(cs).z("dialog-li-top"))
|
|
141
|
-
}, [
|
|
142
|
-
vue.createVNode(vue.unref(index$3.Input), {
|
|
143
|
-
placeholder: psprops.value.searchPlaceholder,
|
|
144
|
-
clearable: "",
|
|
145
|
-
modelValue: search.value,
|
|
146
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
147
|
-
onKeyup: vue.withKeys(onInput, ["enter", "native"])
|
|
148
|
-
}, null, 8, ["placeholder", "modelValue"])
|
|
149
|
-
], 2),
|
|
150
|
-
vue.createElementVNode("div", {
|
|
151
|
-
class: vue.normalizeClass(vue.unref(cs).z("dialog-gap"))
|
|
152
|
-
}, null, 2),
|
|
153
|
-
vue.createElementVNode("div", {
|
|
154
|
-
class: vue.normalizeClass([vue.unref(cs).z("dialog-li-div"), vue.unref(cs).z("dialog-li-tree")])
|
|
155
|
-
}, [
|
|
156
|
-
vue.createElementVNode("div", {
|
|
157
|
-
class: vue.normalizeClass([vue.unref(cs).z("dialog-div-tree")])
|
|
158
|
-
}, [
|
|
159
|
-
vue.createVNode(vue.unref(index$4.CheckboxGroup), {
|
|
160
|
-
modelValue: list.value,
|
|
161
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => list.value = $event)
|
|
162
|
-
}, {
|
|
163
|
-
default: vue.withCtx(() => [
|
|
164
|
-
vue.createVNode(vue.unref(index$5.Table), {
|
|
165
|
-
data: listData.value,
|
|
166
|
-
height: "100%",
|
|
167
|
-
style: { "width": "100%" }
|
|
168
|
-
}, {
|
|
169
|
-
default: vue.withCtx(() => [
|
|
170
|
-
vue.createVNode(vue.unref(index$6.TableColumn), {
|
|
171
|
-
type: "index",
|
|
172
|
-
label: "序号",
|
|
173
|
-
width: "60"
|
|
174
|
-
}),
|
|
175
|
-
vue.createVNode(vue.unref(index$6.TableColumn), {
|
|
176
|
-
prop: psprops.value.label,
|
|
177
|
-
label: "角色名称"
|
|
178
|
-
}, null, 8, ["prop"]),
|
|
179
|
-
vue.createVNode(vue.unref(index$6.TableColumn), {
|
|
180
|
-
width: "60",
|
|
181
|
-
label: "选择"
|
|
182
|
-
}, {
|
|
183
|
-
default: vue.withCtx(({ row }) => [
|
|
184
|
-
vue.createVNode(vue.unref(index$7.Checkbox), {
|
|
185
|
-
onChange: () => {
|
|
186
|
-
onChange(row);
|
|
187
|
-
},
|
|
188
|
-
disabled: row[psprops.value.disabled],
|
|
189
|
-
label: row[psprops.value.value]
|
|
190
|
-
}, {
|
|
191
|
-
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
192
|
-
vue.createTextVNode(vue.toDisplayString(""), -1)
|
|
193
|
-
])]),
|
|
194
|
-
_: 1
|
|
195
|
-
}, 8, ["onChange", "disabled", "label"])
|
|
196
|
-
]),
|
|
197
|
-
_: 1
|
|
198
|
-
})
|
|
199
|
-
]),
|
|
200
|
-
_: 1
|
|
201
|
-
}, 8, ["data"])
|
|
202
|
-
]),
|
|
203
|
-
_: 1
|
|
204
|
-
}, 8, ["modelValue"])
|
|
205
|
-
], 2)
|
|
206
|
-
], 2)
|
|
207
|
-
], 2)
|
|
208
|
-
]),
|
|
209
|
-
_: 3
|
|
210
|
-
}, 8, ["disabled", "placeholder", "appendToBody", "modelValue", "value", "width", "title"])
|
|
211
|
-
], 2);
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
exports.default = _sfc_main;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, normalizeClass, unref, createVNode, withCtx, createElementVNode, withKeys, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
-
import { name, roleSelect, dataExpose, dataEmits, dataProps } from "./data.js";
|
|
3
|
-
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
4
|
-
import { useLocale } from "../../../hooks/locale/index.js";
|
|
5
|
-
import { TableColumn } from "../../table-column/index.js";
|
|
6
|
-
import { Table } from "../../table/index.js";
|
|
7
|
-
import { Input } from "../../input/index.js";
|
|
8
|
-
import { CheckboxGroup } from "../../checkbox-group/index.js";
|
|
9
|
-
import { Checkbox } from "../../checkbox/index.js";
|
|
10
|
-
import { SelectDialog } from "../../select-dialog/index.js";
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
__name: "index",
|
|
13
|
-
props: dataProps,
|
|
14
|
-
emits: dataEmits,
|
|
15
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
16
|
-
const { getLocale } = useLocale();
|
|
17
|
-
const cs = useCssName(name);
|
|
18
|
-
const propss = __props;
|
|
19
|
-
const emit = __emit;
|
|
20
|
-
const refSelectDialog = ref();
|
|
21
|
-
const psprops = computed(() => {
|
|
22
|
-
return {
|
|
23
|
-
...roleSelect,
|
|
24
|
-
...propss.props
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
const search = ref("");
|
|
28
|
-
function onInput() {
|
|
29
|
-
const prop = psprops.value.value;
|
|
30
|
-
if (psprops.value.lazyLoad) {
|
|
31
|
-
psprops.value.lazyLoad(search.value, (v) => {
|
|
32
|
-
for (const o of v) {
|
|
33
|
-
const id = o[prop];
|
|
34
|
-
nodes.value[id] = o;
|
|
35
|
-
}
|
|
36
|
-
listData.value = v;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const list = ref([]);
|
|
41
|
-
watch(
|
|
42
|
-
() => propss.modelValue,
|
|
43
|
-
() => {
|
|
44
|
-
if (propss.modelValue) {
|
|
45
|
-
list.value = [...propss.modelValue];
|
|
46
|
-
} else {
|
|
47
|
-
list.value = [];
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{ immediate: true, deep: true }
|
|
51
|
-
);
|
|
52
|
-
const nodes = ref({});
|
|
53
|
-
const listData = ref([]);
|
|
54
|
-
function onChange(obj) {
|
|
55
|
-
const prop = psprops.value.value;
|
|
56
|
-
if (!psprops.value.multiple) {
|
|
57
|
-
list.value = [obj[prop]];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function getName(key) {
|
|
61
|
-
const name2 = psprops.value.label;
|
|
62
|
-
let obj = nodes.value[key] || {};
|
|
63
|
-
return obj[name2];
|
|
64
|
-
}
|
|
65
|
-
function getNameExplain(key) {
|
|
66
|
-
const name2 = psprops.value.explain;
|
|
67
|
-
if (name2) {
|
|
68
|
-
let obj = nodes.value[key] || {};
|
|
69
|
-
return obj[name2];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function onDialog(is) {
|
|
73
|
-
if (is) {
|
|
74
|
-
if (propss.modelValue) {
|
|
75
|
-
list.value = [...propss.modelValue];
|
|
76
|
-
} else {
|
|
77
|
-
list.value = [];
|
|
78
|
-
}
|
|
79
|
-
search.value = "";
|
|
80
|
-
onInput();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function onDialogffirm(val) {
|
|
84
|
-
emit("update:modelValue", val);
|
|
85
|
-
emit("change", val);
|
|
86
|
-
}
|
|
87
|
-
onInput();
|
|
88
|
-
function setNodesObj(node) {
|
|
89
|
-
if (node) {
|
|
90
|
-
if (Array.isArray(node)) {
|
|
91
|
-
const prop = psprops.value.value;
|
|
92
|
-
for (const o of node) {
|
|
93
|
-
const id = o[prop];
|
|
94
|
-
nodes.value[id] = o;
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
for (const key of Object.keys(node)) {
|
|
98
|
-
nodes.value[key] = node[key];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
__expose({
|
|
104
|
-
...dataExpose,
|
|
105
|
-
setNodesObj,
|
|
106
|
-
getInputName() {
|
|
107
|
-
return refSelectDialog.value.inputName;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return (_ctx, _cache) => {
|
|
111
|
-
return openBlock(), createElementBlock("div", {
|
|
112
|
-
class: normalizeClass(unref(cs).z())
|
|
113
|
-
}, [
|
|
114
|
-
createVNode(unref(SelectDialog), {
|
|
115
|
-
"get-name": getName,
|
|
116
|
-
"get-name-explain": getNameExplain,
|
|
117
|
-
disabled: propss.disabled,
|
|
118
|
-
placeholder: propss.placeholder,
|
|
119
|
-
appendToBody: propss.appendToBody,
|
|
120
|
-
ref_key: "refSelectDialog",
|
|
121
|
-
ref: refSelectDialog,
|
|
122
|
-
modelValue: list.value,
|
|
123
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => list.value = $event),
|
|
124
|
-
value: propss.modelValue,
|
|
125
|
-
width: propss.width,
|
|
126
|
-
title: propss.title,
|
|
127
|
-
onDialog,
|
|
128
|
-
onConfirm: onDialogffirm
|
|
129
|
-
}, {
|
|
130
|
-
suffix: withCtx(() => [
|
|
131
|
-
renderSlot(_ctx.$slots, "suffix")
|
|
132
|
-
]),
|
|
133
|
-
default: withCtx(() => [
|
|
134
|
-
createElementVNode("div", {
|
|
135
|
-
class: normalizeClass(unref(cs).z("dialog-li"))
|
|
136
|
-
}, [
|
|
137
|
-
createElementVNode("div", {
|
|
138
|
-
class: normalizeClass(unref(cs).z("dialog-li-top"))
|
|
139
|
-
}, [
|
|
140
|
-
createVNode(unref(Input), {
|
|
141
|
-
placeholder: psprops.value.searchPlaceholder,
|
|
142
|
-
clearable: "",
|
|
143
|
-
modelValue: search.value,
|
|
144
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
145
|
-
onKeyup: withKeys(onInput, ["enter", "native"])
|
|
146
|
-
}, null, 8, ["placeholder", "modelValue"])
|
|
147
|
-
], 2),
|
|
148
|
-
createElementVNode("div", {
|
|
149
|
-
class: normalizeClass(unref(cs).z("dialog-gap"))
|
|
150
|
-
}, null, 2),
|
|
151
|
-
createElementVNode("div", {
|
|
152
|
-
class: normalizeClass([unref(cs).z("dialog-li-div"), unref(cs).z("dialog-li-tree")])
|
|
153
|
-
}, [
|
|
154
|
-
createElementVNode("div", {
|
|
155
|
-
class: normalizeClass([unref(cs).z("dialog-div-tree")])
|
|
156
|
-
}, [
|
|
157
|
-
createVNode(unref(CheckboxGroup), {
|
|
158
|
-
modelValue: list.value,
|
|
159
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => list.value = $event)
|
|
160
|
-
}, {
|
|
161
|
-
default: withCtx(() => [
|
|
162
|
-
createVNode(unref(Table), {
|
|
163
|
-
data: listData.value,
|
|
164
|
-
height: "100%",
|
|
165
|
-
style: { "width": "100%" }
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [
|
|
168
|
-
createVNode(unref(TableColumn), {
|
|
169
|
-
type: "index",
|
|
170
|
-
label: "序号",
|
|
171
|
-
width: "60"
|
|
172
|
-
}),
|
|
173
|
-
createVNode(unref(TableColumn), {
|
|
174
|
-
prop: psprops.value.label,
|
|
175
|
-
label: "角色名称"
|
|
176
|
-
}, null, 8, ["prop"]),
|
|
177
|
-
createVNode(unref(TableColumn), {
|
|
178
|
-
width: "60",
|
|
179
|
-
label: "选择"
|
|
180
|
-
}, {
|
|
181
|
-
default: withCtx(({ row }) => [
|
|
182
|
-
createVNode(unref(Checkbox), {
|
|
183
|
-
onChange: () => {
|
|
184
|
-
onChange(row);
|
|
185
|
-
},
|
|
186
|
-
disabled: row[psprops.value.disabled],
|
|
187
|
-
label: row[psprops.value.value]
|
|
188
|
-
}, {
|
|
189
|
-
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
190
|
-
createTextVNode(toDisplayString(""), -1)
|
|
191
|
-
])]),
|
|
192
|
-
_: 1
|
|
193
|
-
}, 8, ["onChange", "disabled", "label"])
|
|
194
|
-
]),
|
|
195
|
-
_: 1
|
|
196
|
-
})
|
|
197
|
-
]),
|
|
198
|
-
_: 1
|
|
199
|
-
}, 8, ["data"])
|
|
200
|
-
]),
|
|
201
|
-
_: 1
|
|
202
|
-
}, 8, ["modelValue"])
|
|
203
|
-
], 2)
|
|
204
|
-
], 2)
|
|
205
|
-
], 2)
|
|
206
|
-
]),
|
|
207
|
-
_: 3
|
|
208
|
-
}, 8, ["disabled", "placeholder", "appendToBody", "modelValue", "value", "width", "title"])
|
|
209
|
-
], 2);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
export {
|
|
214
|
-
_sfc_main as default
|
|
215
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
require("./src/index.cjs");
|
|
4
|
-
const withInstall = require("../../utils/vues/withInstall.cjs");
|
|
5
|
-
const index_vue_vue_type_script_setup_true_lang = require("./src/index2.cjs");
|
|
6
|
-
const SelectDialog = withInstall.withInstall(index_vue_vue_type_script_setup_true_lang.default, "SelectDialog");
|
|
7
|
-
exports.SelectDialog = SelectDialog;
|
|
8
|
-
exports.default = SelectDialog;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const buildProps = require("../../../utils/vues/buildProps.cjs");
|
|
4
|
-
const name = "select-dialog";
|
|
5
|
-
const dataProps = buildProps.buildProps({
|
|
6
|
-
/**
|
|
7
|
-
* @props { String, Number} width= ( )
|
|
8
|
-
* 弹框宽度
|
|
9
|
-
*/
|
|
10
|
-
width: {
|
|
11
|
-
type: [String, Number]
|
|
12
|
-
},
|
|
13
|
-
/**
|
|
14
|
-
* @props { String} title= ( )
|
|
15
|
-
* 弹框标题
|
|
16
|
-
*/
|
|
17
|
-
title: {
|
|
18
|
-
type: [String]
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* @props { Array} modelValue=
|
|
22
|
-
* 值
|
|
23
|
-
*/
|
|
24
|
-
modelValue: {
|
|
25
|
-
type: [Array]
|
|
26
|
-
},
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* @props { Array} value=
|
|
32
|
-
* 设置的值
|
|
33
|
-
*/
|
|
34
|
-
value: {
|
|
35
|
-
type: [Array]
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* @props { String} separator=','
|
|
39
|
-
* 分隔选项的字符
|
|
40
|
-
*/
|
|
41
|
-
separator: {
|
|
42
|
-
type: [String],
|
|
43
|
-
default: ","
|
|
44
|
-
},
|
|
45
|
-
appendToBody: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: true
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* @props { Function } getName= ( )
|
|
51
|
-
* 对应展示名称
|
|
52
|
-
*/
|
|
53
|
-
getName: {
|
|
54
|
-
type: [Function],
|
|
55
|
-
default() {
|
|
56
|
-
return (v) => {
|
|
57
|
-
return v;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* @props { Function } getInputName= ( )
|
|
63
|
-
* 选择框上展示名称
|
|
64
|
-
*/
|
|
65
|
-
setInputName: {
|
|
66
|
-
type: [Function]
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* @props { Function } getNameExplain= ( )
|
|
70
|
-
* 对应展示详情名称
|
|
71
|
-
*/
|
|
72
|
-
getNameExplain: {
|
|
73
|
-
type: [Function]
|
|
74
|
-
},
|
|
75
|
-
/**
|
|
76
|
-
* @props { Boolean } disabled= ( )
|
|
77
|
-
* 是否禁用
|
|
78
|
-
*/
|
|
79
|
-
disabled: {
|
|
80
|
-
type: [Boolean]
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
const dataEmits = ["change", "confirm", "dialog", "update:modelValue"];
|
|
84
|
-
const dataSlot = {
|
|
85
|
-
default: "default"
|
|
86
|
-
};
|
|
87
|
-
const dataExpose = {};
|
|
88
|
-
exports.dataEmits = dataEmits;
|
|
89
|
-
exports.dataExpose = dataExpose;
|
|
90
|
-
exports.dataProps = dataProps;
|
|
91
|
-
exports.dataSlot = dataSlot;
|
|
92
|
-
exports.name = name;
|