act-plus 1.1.2 → 1.1.4

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.
Files changed (42) hide show
  1. package/act-plus.js +3 -2
  2. package/act-plus.umd.cjs +17 -17
  3. package/lib/{configBtns-930e1f41.js → configBtns-3e0e1684.js} +14 -14
  4. package/lib/{configFileds-cb40d54d.js → configFileds-c1d4ce56.js} +19 -19
  5. package/lib/{configTable-dab2bbe5.js → configTable-e9118be0.js} +3 -3
  6. package/lib/dashboardTest-ff000df5.js +10 -0
  7. package/lib/{dialogAddField-2763fb68.js → dialogAddField-d3143ae7.js} +28 -28
  8. package/lib/{dialogConfigBtn-37e737c3.js → dialogConfigBtn-deb51609.js} +217 -215
  9. package/lib/enum-d971526b.js +18 -0
  10. package/lib/index-1c82879a.js +95 -0
  11. package/lib/index-4ecc8bcf.js +162 -0
  12. package/lib/{index-fe5fbd14.js → index-89b17cda.js} +1738 -2089
  13. package/lib/index-b53782e5.js +286 -0
  14. package/lib/index-c44f99dd.js +138 -0
  15. package/lib/index-efdc0568.js +89 -0
  16. package/package.json +1 -1
  17. package/style.css +1 -1
  18. package/lib/index-4c95799f.js +0 -26
  19. package/svg/btn-add-241f3e4f.js +0 -4
  20. package/svg/btn-back-93621853.js +0 -4
  21. package/svg/btn-bohui-b0a206a4.js +0 -4
  22. package/svg/btn-daochu-7b5b32e2.js +0 -4
  23. package/svg/btn-daoru-8ba48f49.js +0 -4
  24. package/svg/btn-delete-65a52caf.js +0 -4
  25. package/svg/btn-edit-e5232a18.js +0 -4
  26. package/svg/btn-fenpei-4bba16c2.js +0 -4
  27. package/svg/btn-lianjie-bdc679ea.js +0 -4
  28. package/svg/btn-lishitianbao-eb1212d2.js +0 -4
  29. package/svg/btn-liuchengtu-9591bcdb.js +0 -4
  30. package/svg/btn-mulu-0bbcf3d6.js +0 -4
  31. package/svg/btn-peizhi-d53bd4b5.js +0 -4
  32. package/svg/btn-qianshou-1acd18d0.js +0 -4
  33. package/svg/btn-quanxian-4607f51a.js +0 -4
  34. package/svg/btn-reset-1b0db495.js +0 -4
  35. package/svg/btn-rizhi-8836492c.js +0 -4
  36. package/svg/btn-search-54ecb613.js +0 -4
  37. package/svg/btn-shenpi-22b55f3c.js +0 -4
  38. package/svg/btn-start-173d3cfb.js +0 -4
  39. package/svg/btn-stop-d76fb767.js +0 -4
  40. package/svg/btn-tianbao-d57c7020.js +0 -4
  41. package/svg/btn-tianjiachengyuan-a613c5da.js +0 -4
  42. package/svg/btn-xiangqing-89b17590.js +0 -4
@@ -0,0 +1,286 @@
1
+ import { inject as q, reactive as oe, ref as L, watch as te, resolveComponent as p, openBlock as n, createBlock as u, withCtx as b, createElementVNode as B, createVNode as V, unref as a, createTextVNode as S, createElementBlock as F, Fragment as T, renderList as x, createCommentVNode as de, resolveDynamicComponent as se, isRef as ne, toDisplayString as re } from "vue";
2
+ import { a as ie, e as ue, r as ce, b as fe, E as M, _ as pe, c as me } from "./index-89b17cda.js";
3
+ import { T as $, P as ye } from "./enum-d971526b.js";
4
+ import "vue-router";
5
+ const R = ie.create({
6
+ baseURL: "",
7
+ // ""
8
+ timeout: 15e3
9
+ });
10
+ R.interceptors.request.use(
11
+ (d) => {
12
+ let m = sessionStorage.getItem("accessToken");
13
+ return m && (d.headers.Authorization = "Bearer " + m), d.headers["Content-Type"] != "application/x-www-form-urlencoded" && (d.data = { ...d.data }, Reflect.has(d.data, "dynamicFilters") && (d.data.dynamicFilters = ue(JSON.stringify(d.data.dynamicFilters)))), d;
14
+ },
15
+ (d) => Promise.reject(d)
16
+ );
17
+ R.interceptors.response.use(
18
+ (d) => {
19
+ const m = d.data;
20
+ if (m.code == 200)
21
+ return m;
22
+ if (m.code == 401)
23
+ sessionStorage.clear(), ce.replace("/"), fe(), M.error({ title: "错误", message: "登陆超时,请重新登录" });
24
+ else
25
+ return M.error({ title: "错误", message: m.msg }), Promise.reject(m.msg);
26
+ },
27
+ (d) => {
28
+ if (d.response.status != -1)
29
+ return Promise.reject(d);
30
+ }
31
+ );
32
+ const be = { class: "no-config-field" }, _e = { class: "dialog-footer" }, he = {
33
+ __name: "index",
34
+ props: {
35
+ visible: { type: Boolean, default: !1 },
36
+ title: { type: String, default: "" },
37
+ data: { type: Object, default: () => ({}) }
38
+ },
39
+ emits: ["update:visible", "refresh"],
40
+ setup(d, { emit: m }) {
41
+ const W = q("loadComponents"), z = q("formatDataType"), A = m, i = d;
42
+ let h = oe((() => ({
43
+ btnLoading: !1
44
+ }))()), w = L([]), t = L({}), D = L(null), J = {};
45
+ const G = (l) => l.formColumnCol == null || l.customFiledsComponentes[l.customFiledsComponentes.customComponentName] ? 24 : l.formColumnCol ? l.formColumnCol : 24 / l.formRow, H = (l) => {
46
+ if (["input", "textarea"].includes(l.fieldType))
47
+ return "blur";
48
+ if (["select", "multipleSelect", "datetimerange", "treeSelect", "provinceCascade"].includes(l.fieldType))
49
+ return "change";
50
+ }, Q = (l) => {
51
+ if (!["input", "textarea"].includes(l) && ["multipleSelect", "dateRange"].includes(l))
52
+ return [];
53
+ }, X = (l, c) => {
54
+ if (["string"].includes(c))
55
+ return l.join(";");
56
+ if (["number"].includes(c))
57
+ return Number(l);
58
+ if (["array"].includes(c))
59
+ return l;
60
+ }, Y = (l) => {
61
+ if (["multipleSelect"].includes(l.fieldType))
62
+ return i.data.rowData[l.fieldKey] ? i.data.rowData[l.fieldKey].split(";") : [];
63
+ if (["dateRange"].includes(l.fieldType)) {
64
+ const c = l.fieldKey.split("&");
65
+ return i.data.rowData[l.fieldKey] = c.map((r) => i.data.rowData[r]), i.data.rowData[l.fieldKey];
66
+ }
67
+ return i.data.rowData[l.fieldKey];
68
+ }, Z = (l) => R({ url: i.data.dataItem.requestUrl, method: "post", data: l });
69
+ te(
70
+ () => i.visible,
71
+ async (l, c) => {
72
+ l && (i.data.formList.forEach(async (r) => {
73
+ J[r.fieldKey] = { submitFieldType: r.fieldSubmitType, isFormSetValue: r.isFormSetValue }, t.value[r.fieldKey] = Object.keys(i.data.rowData).length && r.isFormSetValue ? Y(r) : Q(r.fieldType);
74
+ const { isFiledCustom: g, customComponentName: _, customComponentUrl: C } = r.customFiledsComponentes;
75
+ if (g && !r.customFiledsComponentes[_]) {
76
+ const f = await W(C, _);
77
+ r.customFiledsComponentes[_] = f;
78
+ }
79
+ }), w.value = i.data.formList || []);
80
+ }
81
+ );
82
+ const I = (l) => {
83
+ K(), l();
84
+ }, K = () => {
85
+ w.value = [], D.value.resetFields(), A("update:visible", !1);
86
+ }, ee = (l) => {
87
+ l && l.validate((c) => {
88
+ if (c) {
89
+ h.btnLoading = !0;
90
+ const { dataItem: r, rowData: g } = i.data, _ = r.submitFields.filter((s) => s.matchType == "default").reduce((s, y) => (y.submitFieldType === "string" && (s[y.submitFieldName] = y.matchFieldName.toString()), s), {}), C = r.submitFields.filter((s) => s.matchType == "match").reduce((s, y) => (s[y.submitFieldName] = z(y.submitFieldType, g[y.matchFieldName]), s), {});
91
+ let f = { ..._, ...C, ...t.value };
92
+ Object.keys(f).forEach((s) => {
93
+ s.includes("&") ? f[s].split("&").forEach((k, v) => {
94
+ f[k] = f[s][v];
95
+ }) : Array.isArray(f[s]) && (f[s] = X(f[s].submitFieldType));
96
+ }), Z(f).then((s) => {
97
+ me({ title: "提示", message: "创建成功", type: "success", duration: 2500 }), K(), A("refresh"), h.btnLoading = !1;
98
+ }).catch((s) => {
99
+ h.btnLoading = !1;
100
+ }), h.btnLoading = !1;
101
+ }
102
+ });
103
+ };
104
+ return (l, c) => {
105
+ var P;
106
+ const r = p("el-input"), g = p("el-option"), _ = p("el-select"), C = p("el-date-picker"), f = p("el-cascader"), s = p("el-switch"), y = p("el-form-item"), k = p("el-col"), v = p("el-row"), le = p("el-form"), E = p("el-button"), ae = p("el-dialog");
107
+ return n(), u(ae, {
108
+ "model-value": i.visible,
109
+ title: i.title,
110
+ top: "5vh",
111
+ width: (P = d.data.formConfig) == null ? void 0 : P.dialogWidth,
112
+ "append-to-body": "",
113
+ "destroy-on-close": "",
114
+ "close-on-click-modal": !1,
115
+ "before-close": I
116
+ }, {
117
+ footer: b(() => [
118
+ B("span", _e, [
119
+ V(E, {
120
+ loading: a(h).btnLoading,
121
+ onClick: K
122
+ }, {
123
+ default: b(() => [
124
+ S("取消")
125
+ ]),
126
+ _: 1
127
+ }, 8, ["loading"]),
128
+ V(E, {
129
+ type: "primary",
130
+ loading: a(h).btnLoading,
131
+ onClick: c[1] || (c[1] = (U) => ee(a(D)))
132
+ }, {
133
+ default: b(() => [
134
+ S("保存")
135
+ ]),
136
+ _: 1
137
+ }, 8, ["loading"])
138
+ ])
139
+ ]),
140
+ default: b(() => {
141
+ var U, j;
142
+ return [
143
+ V(le, {
144
+ ref_key: "formRef",
145
+ ref: D,
146
+ model: a(t),
147
+ "label-suffix": ":",
148
+ "label-width": (U = d.data.formConfig) == null ? void 0 : U.formLabelWidth,
149
+ "label-position": (j = d.data.formConfig) == null ? void 0 : j.formLabelPosition
150
+ }, {
151
+ default: b(() => [
152
+ V(v, { gutter: 40 }, {
153
+ default: b(() => [
154
+ (n(!0), F(T, null, x(a(w), (e, O) => (n(), u(k, {
155
+ span: G(e),
156
+ key: O
157
+ }, {
158
+ default: b(() => [
159
+ e.customFiledsComponentes.isFiledCustom ? (n(), F(T, { key: 1 }, [
160
+ e.customFiledsComponentes[e.customFiledsComponentes.customComponentName] ? (n(), u(se(e.customFiledsComponentes[e.customFiledsComponentes.customComponentName]), {
161
+ key: 0,
162
+ fieldCofnigItem: e,
163
+ rowData: i.data.rowData,
164
+ form: a(t),
165
+ "onUpdate:form": c[0] || (c[0] = (o) => ne(t) ? t.value = o : t = o)
166
+ }, null, 40, ["fieldCofnigItem", "rowData", "form"])) : (n(), F("div", {
167
+ class: "no-config",
168
+ key: O
169
+ }, [
170
+ B("span", be, "【" + re(e.fieldName) + "】", 1),
171
+ S("当前字段为自定义,请在项目中创建对应组件 ")
172
+ ]))
173
+ ], 64)) : (n(), u(y, {
174
+ key: 0,
175
+ label: e.fieldName,
176
+ prop: e.fieldKey,
177
+ rules: [{ required: e.isFormFieldRequired, message: "必填项", trigger: H(e) }]
178
+ }, {
179
+ default: b(() => [
180
+ e.fieldType === "input" ? (n(), u(r, {
181
+ key: 0,
182
+ modelValue: a(t)[e.fieldKey],
183
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
184
+ type: "text",
185
+ placeholder: "请输入" + e.fieldName,
186
+ disabled: e.isFormDisabled,
187
+ clearable: ""
188
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "textarea" ? (n(), u(r, {
189
+ key: 1,
190
+ modelValue: a(t)[e.fieldKey],
191
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
192
+ type: "textarea",
193
+ placeholder: `请输入${e.fieldName}`,
194
+ disabled: e.isFormDisabled,
195
+ rows: 4
196
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "multipleSelect" ? (n(), u(_, {
197
+ key: 2,
198
+ modelValue: a(t)[e.fieldKey],
199
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
200
+ placeholder: `请选择${e.fieldName}`,
201
+ disabled: e.isFormDisabled,
202
+ multiple: "",
203
+ clearable: "",
204
+ filterable: ""
205
+ }, {
206
+ default: b(() => [
207
+ (n(!0), F(T, null, x(e.dataList, (o, N) => (n(), u(g, {
208
+ key: N,
209
+ label: o.key,
210
+ value: o.value
211
+ }, null, 8, ["label", "value"]))), 128))
212
+ ]),
213
+ _: 2
214
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "select" ? (n(), u(_, {
215
+ key: 3,
216
+ modelValue: a(t)[e.fieldKey],
217
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
218
+ placeholder: `请选择${e.fieldName}`,
219
+ disabled: e.isFormDisabled,
220
+ clearable: "",
221
+ filterable: ""
222
+ }, {
223
+ default: b(() => [
224
+ (n(!0), F(T, null, x(e.dataList, (o, N) => (n(), u(g, {
225
+ key: N,
226
+ label: o.key,
227
+ value: o.value
228
+ }, null, 8, ["label", "value"]))), 128))
229
+ ]),
230
+ _: 2
231
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "date" ? (n(), u(C, {
232
+ key: 4,
233
+ modelValue: a(t)[e.fieldKey],
234
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
235
+ type: e.fieldUiType,
236
+ placeholder: "请选择时间",
237
+ "value-format": a($)[e.fieldUiType],
238
+ disabled: e.isFormDisabled
239
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "value-format", "disabled"])) : e.fieldType === "dateRange" ? (n(), u(C, {
240
+ key: 5,
241
+ modelValue: a(t)[e.fieldKey],
242
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
243
+ type: e.fieldUiType,
244
+ "start-placeholder": "开始时间",
245
+ "end-placeholder": "结束时间",
246
+ "value-format": a($)[e.fieldUiType],
247
+ disabled: e.isFormDisabled
248
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "value-format", "disabled"])) : e.fieldType === "provinceCascade" ? (n(), u(f, {
249
+ key: 6,
250
+ modelValue: a(t)[e.fieldKey],
251
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
252
+ options: e.dataList,
253
+ props: a(ye),
254
+ clearable: "",
255
+ filterable: "",
256
+ placeholder: `请选择${e.fieldName}`,
257
+ disabled: e.isFormDisabled
258
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled"])) : e.fieldType === "switch" ? (n(), u(s, {
259
+ key: 7,
260
+ modelValue: a(t)[e.fieldKey],
261
+ "onUpdate:modelValue": (o) => a(t)[e.fieldKey] = o,
262
+ "active-value": !0,
263
+ "inactive-value": !1
264
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : de("", !0)
265
+ ]),
266
+ _: 2
267
+ }, 1032, ["label", "prop", "rules"]))
268
+ ]),
269
+ _: 2
270
+ }, 1032, ["span"]))), 128))
271
+ ]),
272
+ _: 1
273
+ })
274
+ ]),
275
+ _: 1
276
+ }, 8, ["model", "label-width", "label-position"])
277
+ ];
278
+ }),
279
+ _: 1
280
+ }, 8, ["model-value", "title", "width"]);
281
+ };
282
+ }
283
+ }, we = /* @__PURE__ */ pe(he, [["__scopeId", "data-v-326c5ba6"]]);
284
+ export {
285
+ we as default
286
+ };
@@ -0,0 +1,138 @@
1
+ import { ref as I, watch as N, resolveComponent as u, resolveDirective as P, openBlock as a, createElementBlock as d, withDirectives as R, createBlock as n, withCtx as c, createTextVNode as T, toDisplayString as K, Fragment as s, renderList as O, renderSlot as h, createCommentVNode as j, nextTick as f } from "vue";
2
+ import { _ as A } from "./index-89b17cda.js";
3
+ import "vue-router";
4
+ const D = { class: "act-table" }, E = {
5
+ __name: "index",
6
+ props: {
7
+ loading: { type: Boolean, default: !1 },
8
+ maxHeight: { type: Number, default: 600 },
9
+ total: { type: Number, default: 0 },
10
+ tableQuery: { type: Object, default: () => ({ pageIndex: 1, pageSize: 10 }) },
11
+ selection: { type: Array, default: () => [] },
12
+ headers: { type: Array, default: () => [] },
13
+ data: { type: Array, default: () => [] },
14
+ showSerialNumber: { type: Boolean, default: !0 },
15
+ showPagination: { type: Boolean, default: !0 },
16
+ rowKey: { type: String, default: "id" },
17
+ treeProps: { type: Object, default: () => ({ children: "children", hasChildren: "hasChildren" }) }
18
+ },
19
+ emits: ["update:tableQuery", "update:selection", "refresh"],
20
+ setup(g, { expose: y, emit: w }) {
21
+ const i = w, t = g;
22
+ let p = I(null);
23
+ const b = (o) => t.showPagination ? o + 1 + (t.tableQuery.pageIndex - 1) * t.tableQuery.pageSize : o + 1, x = (o) => {
24
+ f(() => {
25
+ t.data.forEach((l) => {
26
+ o.includes(l[t.rowKey]) && p.value.toggleRowSelection(l, !0);
27
+ });
28
+ });
29
+ }, _ = (o) => p.value.getSelectionRows();
30
+ N(
31
+ () => t.selection,
32
+ (o, l) => {
33
+ o && o.length && x(o);
34
+ },
35
+ { deep: !0, immediate: !0 }
36
+ );
37
+ const S = (o) => {
38
+ i("update:selection", o);
39
+ }, k = (o, l) => {
40
+ o && f(() => {
41
+ t.data.forEach((r) => {
42
+ o.includes(r[t.rowKey]) && p.value.toggleRowSelection(r, !0);
43
+ });
44
+ });
45
+ }, m = (o) => {
46
+ i("update:tableQuery", { ...t.tableQuery, pageSize: o }), i("refresh", []);
47
+ }, v = (o) => {
48
+ i("update:tableQuery", { ...t.tableQuery, pageIndex: o }), i("refresh", []);
49
+ };
50
+ return y({ getSelectionRows: _, updateSelection: k }), (o, l) => {
51
+ const r = u("el-table-column"), C = u("el-table"), z = u("el-pagination"), Q = P("loading");
52
+ return a(), d("div", D, [
53
+ R((a(), n(C, {
54
+ ref_key: "tableRef",
55
+ ref: p,
56
+ data: t.data,
57
+ stripe: "",
58
+ border: "",
59
+ "highlight-current-row": "",
60
+ "max-height": t.maxHeight,
61
+ "row-key": t.rowKey,
62
+ "default-expand-all": "",
63
+ "tree-props": g.treeProps,
64
+ "header-cell-style": { backgroundColor: "#eef1f6", color: "#1f2d3d", fontSize: "14px" },
65
+ onSelectionChange: S
66
+ }, {
67
+ empty: c(() => [
68
+ T(K(t.data.length || t.data.length == 0 ? "暂无数据" : ""), 1)
69
+ ]),
70
+ default: c(() => [
71
+ (a(!0), d(s, null, O(t.headers, (e) => (a(), d(s, { key: e }, [
72
+ e.isCustomTableHeader ? h(o.$slots, e.prop, { key: 0 }, void 0, !0) : (a(), d(s, { key: 1 }, [
73
+ e.render ? (a(), n(r, {
74
+ key: 0,
75
+ label: e.label,
76
+ align: "center",
77
+ width: e.width,
78
+ "show-overflow-tooltip": e.prop == "operate" ? !1 : e.showOverflowTooltip,
79
+ fixed: e.fixed
80
+ }, {
81
+ default: c((B) => [
82
+ h(o.$slots, e.prop, { scope: B }, void 0, !0)
83
+ ]),
84
+ _: 2
85
+ }, 1032, ["label", "width", "show-overflow-tooltip", "fixed"])) : (a(), d(s, { key: 1 }, [
86
+ e.prop == "checkbox" ? (a(), n(r, {
87
+ key: 0,
88
+ type: "selection",
89
+ align: "center",
90
+ width: e.width,
91
+ fixed: ""
92
+ }, null, 8, ["width"])) : e.prop == "serialNumber" ? (a(), n(r, {
93
+ key: 1,
94
+ index: b,
95
+ type: "index",
96
+ align: "center",
97
+ width: e.width,
98
+ label: "序号",
99
+ fixed: ""
100
+ }, null, 8, ["width"])) : (a(), n(r, {
101
+ key: 2,
102
+ prop: e.prop,
103
+ label: e.label,
104
+ align: "center",
105
+ "show-overflow-tooltip": e.showOverflowTooltip,
106
+ width: e.width,
107
+ "min-width": e.minWidth,
108
+ fixed: e.fixed
109
+ }, null, 8, ["prop", "label", "show-overflow-tooltip", "width", "min-width", "fixed"]))
110
+ ], 64))
111
+ ], 64))
112
+ ], 64))), 128))
113
+ ]),
114
+ _: 3
115
+ }, 8, ["data", "max-height", "row-key", "tree-props"])), [
116
+ [Q, t.loading]
117
+ ]),
118
+ t.showPagination ? (a(), n(z, {
119
+ key: 0,
120
+ class: "table-pagination",
121
+ "current-page": t.tableQuery.pageIndex,
122
+ "onUpdate:currentPage": l[0] || (l[0] = (e) => t.tableQuery.pageIndex = e),
123
+ "page-size": t.tableQuery.pageSize,
124
+ "onUpdate:pageSize": l[1] || (l[1] = (e) => t.tableQuery.pageSize = e),
125
+ "page-sizes": [20, 50, 75, 100],
126
+ background: "",
127
+ layout: "total, sizes, prev, pager, next, jumper",
128
+ total: t.total,
129
+ onSizeChange: m,
130
+ onCurrentChange: v
131
+ }, null, 8, ["current-page", "page-size", "total"])) : j("", !0)
132
+ ]);
133
+ };
134
+ }
135
+ }, $ = /* @__PURE__ */ A(E, [["__scopeId", "data-v-0dd0357d"]]);
136
+ export {
137
+ $ as default
138
+ };
@@ -0,0 +1,89 @@
1
+ import { ref as h, watch as I, resolveComponent as _, openBlock as a, createElementBlock as d, createVNode as u, unref as p, isRef as b, withCtx as m, createElementVNode as g, createBlock as w, createCommentVNode as C, createTextVNode as N, Fragment as B, renderList as E, normalizeClass as S } from "vue";
2
+ import { _ as z } from "./index-89b17cda.js";
3
+ import "vue-router";
4
+ const A = { class: "select-icon-container" }, F = { class: "icon-list" }, L = ["onClick"], P = {
5
+ class: "icon-value",
6
+ slot: "reference"
7
+ }, R = {
8
+ __name: "index",
9
+ props: {
10
+ modelValue: { type: String, default: "" },
11
+ icons: { type: Array, default: () => [] }
12
+ },
13
+ emits: ["update:modelValue"],
14
+ setup(x, { emit: y }) {
15
+ const v = y, c = x;
16
+ let t = h(!1), e = h(-1);
17
+ const f = () => e.value == -1 ? "" : c.icons[e.value];
18
+ I(
19
+ () => c.modelValue,
20
+ (l, o) => {
21
+ if (!l) {
22
+ e.value = -1, v("update:modelValue", "");
23
+ return;
24
+ }
25
+ const s = c.icons.findIndex((i) => i === l);
26
+ e.value = s;
27
+ },
28
+ { deep: !0, immediate: !0 }
29
+ );
30
+ const k = (l, o) => {
31
+ e.value = o, v("update:modelValue", f()), t.value = !1;
32
+ };
33
+ return (l, o) => {
34
+ const s = _("a-svg-icon"), i = _("el-button"), V = _("el-popover");
35
+ return a(), d("div", A, [
36
+ u(V, {
37
+ "popper-class": "select-icon-popover",
38
+ placement: "bottom-start",
39
+ visible: p(t),
40
+ "onUpdate:visible": o[0] || (o[0] = (n) => b(t) ? t.value = n : t = n),
41
+ width: 400,
42
+ trigger: "click"
43
+ }, {
44
+ reference: m(() => [
45
+ g("div", P, [
46
+ p(e) >= 0 ? (a(), w(s, {
47
+ key: 0,
48
+ name: f(),
49
+ width: "24",
50
+ height: "24",
51
+ color: "#000"
52
+ }, null, 8, ["name"])) : C("", !0),
53
+ u(i, {
54
+ class: "icon-btn",
55
+ type: "primary"
56
+ }, {
57
+ default: m(() => [
58
+ N("选择图标")
59
+ ]),
60
+ _: 1
61
+ })
62
+ ])
63
+ ]),
64
+ default: m(() => [
65
+ g("ul", F, [
66
+ (a(!0), d(B, null, E(c.icons, (n, r) => (a(), d("li", {
67
+ class: S(["icon-item", { "icon-item-checked": p(e) == r }]),
68
+ key: r,
69
+ onClick: (T) => k(n, r)
70
+ }, [
71
+ u(s, {
72
+ class: "icon-svg",
73
+ name: n,
74
+ width: "24",
75
+ height: "24",
76
+ color: "#999"
77
+ }, null, 8, ["name"])
78
+ ], 10, L))), 128))
79
+ ])
80
+ ]),
81
+ _: 1
82
+ }, 8, ["visible"])
83
+ ]);
84
+ };
85
+ }
86
+ }, D = /* @__PURE__ */ z(R, [["__scopeId", "data-v-eac43c79"]]);
87
+ export {
88
+ D as default
89
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "act-plus",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "private": false,
5
5
  "description": "act config",
6
6
  "main": "act-plus.js",