ling-yun-custom-components 0.0.10
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/BatchImport.mjs +208 -0
- package/es/BuildComponents.mjs +190 -0
- package/es/CustomDialog.mjs +7 -0
- package/es/CustomDropdown.mjs +145 -0
- package/es/CustomPagination.mjs +7 -0
- package/es/CustomSelect.mjs +7 -0
- package/es/CustomTab.mjs +33 -0
- package/es/CustomTitle.mjs +7 -0
- package/es/FileList.mjs +7 -0
- package/es/GradientButton.mjs +120 -0
- package/es/IconEmpty.mjs +7 -0
- package/es/IconRenderer.mjs +42 -0
- package/es/IconSelect.mjs +120 -0
- package/es/PaginationTable.mjs +407 -0
- package/es/SearchBar.mjs +7 -0
- package/es/TreeSelect.mjs +406 -0
- package/es/TreeShowSelect.mjs +82 -0
- package/es/UpdatePasswordDialog.mjs +119 -0
- package/es/UploadFile.mjs +7 -0
- package/es/assets/BuildComponents.css +1 -0
- package/es/assets/CustomDropdown.css +1 -0
- package/es/assets/CustomTab.css +1 -0
- package/es/assets/GradientButton.css +1 -0
- package/es/assets/IconSelect.css +1 -0
- package/es/assets/PaginationTable.css +1 -0
- package/es/assets/TreeSelect.css +1 -0
- package/es/assets/TreeShowSelect.css +1 -0
- package/es/assets/UpdatePasswordDialog.css +1 -0
- package/es/assets/layout.css +0 -0
- package/es/assets/layout2.css +1 -0
- package/es/assets/layout3.css +1 -0
- package/es/assets/layout4.css +1 -0
- package/es/assets/layout5.css +1 -0
- package/es/assets/layout6.css +1 -0
- package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
- package/es/chunks/global.DVwnOczb.js +7828 -0
- package/es/chunks/index.D4Kbv-m1.js +8991 -0
- package/es/chunks/index.DfOANPhX.js +1729 -0
- package/es/chunks/index.DlooXR0t.js +9576 -0
- package/es/chunks/index.bCzIhWFw.js +7 -0
- package/es/chunks/layout.1y3OJ-ea.js +230 -0
- package/es/chunks/layout.2Mabaug0.js +121 -0
- package/es/chunks/layout.6MxjcpGc.js +584 -0
- package/es/chunks/layout.BJE8rMzK.js +230 -0
- package/es/chunks/layout.BKJPyxR8.js +39 -0
- package/es/chunks/layout.C0UEMbnF.js +98 -0
- package/es/chunks/layout.CTQtuC78.js +584 -0
- package/es/chunks/layout.CUOtHOHG.js +66 -0
- package/es/chunks/layout.CiNI5oQK.js +149 -0
- package/es/chunks/layout.CnANFnM1.js +584 -0
- package/es/chunks/layout.CtWHo87D.js +121 -0
- package/es/chunks/layout.Day1LJyl.js +234 -0
- package/es/chunks/layout.DeAFov0o.js +234 -0
- package/es/chunks/layout.Dvw3u-s5.js +234 -0
- package/es/chunks/layout.LCKaV7EX.js +230 -0
- package/es/chunks/layout.ZxPdKhRp.js +149 -0
- package/es/chunks/layout._A_rHZM7.js +149 -0
- package/es/chunks/layout.f58eO4Hr.js +98 -0
- package/es/chunks/layout.t3qD0LTW.js +121 -0
- package/es/chunks/layout.ypvwQzq5.js +98 -0
- package/es/index.mjs +81 -0
- package/lib/BatchImport.js +1 -0
- package/lib/BuildComponents.js +1 -0
- package/lib/CustomDialog.js +1 -0
- package/lib/CustomDropdown.js +1 -0
- package/lib/CustomPagination.js +1 -0
- package/lib/CustomSelect.js +1 -0
- package/lib/CustomTab.js +1 -0
- package/lib/CustomTitle.js +1 -0
- package/lib/FileList.js +1 -0
- package/lib/GradientButton.js +1 -0
- package/lib/IconEmpty.js +1 -0
- package/lib/IconRenderer.js +1 -0
- package/lib/IconSelect.js +1 -0
- package/lib/PaginationTable.js +1 -0
- package/lib/SearchBar.js +1 -0
- package/lib/TreeSelect.js +1 -0
- package/lib/TreeShowSelect.js +1 -0
- package/lib/UpdatePasswordDialog.js +1 -0
- package/lib/UploadFile.js +1 -0
- package/lib/assets/BuildComponents.css +1 -0
- package/lib/assets/CustomDropdown.css +1 -0
- package/lib/assets/CustomTab.css +1 -0
- package/lib/assets/GradientButton.css +1 -0
- package/lib/assets/IconSelect.css +1 -0
- package/lib/assets/PaginationTable.css +1 -0
- package/lib/assets/TreeSelect.css +1 -0
- package/lib/assets/TreeShowSelect.css +1 -0
- package/lib/assets/UpdatePasswordDialog.css +1 -0
- package/lib/assets/layout.css +0 -0
- package/lib/assets/layout2.css +1 -0
- package/lib/assets/layout3.css +1 -0
- package/lib/assets/layout4.css +1 -0
- package/lib/assets/layout5.css +1 -0
- package/lib/assets/layout6.css +1 -0
- package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
- package/lib/chunks/global.Cv8u--Cy.js +1 -0
- package/lib/chunks/index.Bixsw9fA.js +23 -0
- package/lib/chunks/index.CkihWzK6.js +1 -0
- package/lib/chunks/index.CrvqvcN9.js +23 -0
- package/lib/chunks/index.DJKAT9lI.js +1 -0
- package/lib/chunks/layout.-yZzrp74.js +1 -0
- package/lib/chunks/layout.2PAIPzYY.js +1 -0
- package/lib/chunks/layout.5iOiFlVu.js +1 -0
- package/lib/chunks/layout.B-T_NE6r.js +1 -0
- package/lib/chunks/layout.BBNd1hLQ.js +1 -0
- package/lib/chunks/layout.BNJsxQ2g.js +1 -0
- package/lib/chunks/layout.BSF3ruxz.js +1 -0
- package/lib/chunks/layout.BXdjRFbn.js +1 -0
- package/lib/chunks/layout.BhL14Rqh.js +1 -0
- package/lib/chunks/layout.BmQYiD_b.js +1 -0
- package/lib/chunks/layout.CDg3sCTi.js +1 -0
- package/lib/chunks/layout.CeVldGUL.js +1 -0
- package/lib/chunks/layout.CjJiAY0w.js +1 -0
- package/lib/chunks/layout.CoSBrO12.js +1 -0
- package/lib/chunks/layout.CwA4IJ1g.js +1 -0
- package/lib/chunks/layout.DDTIwGYp.js +1 -0
- package/lib/chunks/layout.DOS2ezSW.js +1 -0
- package/lib/chunks/layout.D_TxPvRy.js +1 -0
- package/lib/chunks/layout.DfiLurg1.js +1 -0
- package/lib/chunks/layout.gqpUcAHO.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +205 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ref as b, computed as o, onMounted as S, nextTick as C, watch as k, createBlock as j, openBlock as D, resolveDynamicComponent as F, unref as g, mergeProps as M } from "vue";
|
|
2
|
+
import { ElTreeSelect as x, ElSelectV2 as E } from "element-plus";
|
|
3
|
+
import { b as r } from "./index.DlooXR0t.js";
|
|
4
|
+
const q = /* @__PURE__ */ Object.assign({
|
|
5
|
+
name: "CustomSelect"
|
|
6
|
+
}, {
|
|
7
|
+
__name: "layout",
|
|
8
|
+
props: {
|
|
9
|
+
// 绑定值
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number, Array, Object],
|
|
12
|
+
default: () => null
|
|
13
|
+
},
|
|
14
|
+
// 是否可清空
|
|
15
|
+
clearable: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
// 是否可搜索
|
|
20
|
+
filterable: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
23
|
+
},
|
|
24
|
+
// 多选时是否将选中值按文字的形式展示
|
|
25
|
+
collapseTags: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !0
|
|
28
|
+
},
|
|
29
|
+
// 多选
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
// 接口配置
|
|
35
|
+
apiConfig: {
|
|
36
|
+
type: Function
|
|
37
|
+
},
|
|
38
|
+
// 数据映射配置
|
|
39
|
+
mapping: {
|
|
40
|
+
type: Object,
|
|
41
|
+
default: () => ({
|
|
42
|
+
label: "label",
|
|
43
|
+
value: "value",
|
|
44
|
+
disabled: "disabled",
|
|
45
|
+
children: "children"
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
// 静态数据
|
|
49
|
+
staticOptions: {
|
|
50
|
+
type: Array,
|
|
51
|
+
default: () => []
|
|
52
|
+
},
|
|
53
|
+
// 是否在组件挂载时自动加载数据
|
|
54
|
+
autoLoad: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !0
|
|
57
|
+
},
|
|
58
|
+
// 请求参数
|
|
59
|
+
params: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => ({})
|
|
62
|
+
},
|
|
63
|
+
// 是否为树形选择器
|
|
64
|
+
isTreeSelect: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
emits: [r.updateModelValue, r.change],
|
|
70
|
+
setup(l, { expose: v, emit: y }) {
|
|
71
|
+
const e = l, s = y, n = b(e.modelValue), i = b([]), c = o(() => typeof e.apiConfig == "function"), h = o(() => e.staticOptions.length > 0 ? e.staticOptions : i.value), V = o(() => e.isTreeSelect ? "data" : "options"), T = o(() => e.isTreeSelect ? "children" : "options"), B = o(() => ({
|
|
72
|
+
...e.mapping,
|
|
73
|
+
[T.value]: e.mapping.children
|
|
74
|
+
})), p = async () => {
|
|
75
|
+
c.value && e.apiConfig(e.params)?.then((a) => {
|
|
76
|
+
i.value = d(a?.data || []);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
function d(a, u = !1) {
|
|
80
|
+
return a.map((t) => {
|
|
81
|
+
const m = u || t.isEnabled === 0, f = {
|
|
82
|
+
...t,
|
|
83
|
+
disabled: m
|
|
84
|
+
};
|
|
85
|
+
return t.children && t.children.length > 0 && (f.children = d(t.children, m)), f;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const O = () => {
|
|
89
|
+
s(r.updateModelValue, n.value), s(r.change, n.value);
|
|
90
|
+
};
|
|
91
|
+
return v({
|
|
92
|
+
clear: () => {
|
|
93
|
+
i.value = [], n.value = e.multiple ? [] : null;
|
|
94
|
+
},
|
|
95
|
+
loadData: p
|
|
96
|
+
}), S(() => {
|
|
97
|
+
e.autoLoad && c.value && C(() => {
|
|
98
|
+
p();
|
|
99
|
+
});
|
|
100
|
+
}), k(
|
|
101
|
+
() => e.modelValue,
|
|
102
|
+
(a) => {
|
|
103
|
+
n.value = a;
|
|
104
|
+
},
|
|
105
|
+
{ immediate: !0 }
|
|
106
|
+
), (a, u) => (D(), j(F(l.isTreeSelect ? g(x) : g(E)), M({
|
|
107
|
+
modelValue: n.value,
|
|
108
|
+
"onUpdate:modelValue": u[0] || (u[0] = (t) => n.value = t),
|
|
109
|
+
props: B.value,
|
|
110
|
+
multiple: l.multiple,
|
|
111
|
+
"collapse-tags": l.collapseTags,
|
|
112
|
+
filterable: l.filterable,
|
|
113
|
+
clearable: l.clearable,
|
|
114
|
+
[V.value || ""]: h.value,
|
|
115
|
+
"node-key": l.mapping.value
|
|
116
|
+
}, a.$attrs, { onChange: O }), null, 16, ["modelValue", "props", "multiple", "collapse-tags", "filterable", "clearable", "node-key"]));
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
export {
|
|
120
|
+
q as default
|
|
121
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { computed as l, createBlock as f, openBlock as z, unref as y, mergeProps as S } from "vue";
|
|
2
|
+
import { ElPagination as C } from "element-plus";
|
|
3
|
+
import { d as P, e as b } from "./index.DfOANPhX.js";
|
|
4
|
+
import { b as t, c as p, v as d } from "./index.D4Kbv-m1.js";
|
|
5
|
+
const O = /* @__PURE__ */ Object.assign({
|
|
6
|
+
name: "CustomPagination"
|
|
7
|
+
}, {
|
|
8
|
+
__name: "layout",
|
|
9
|
+
props: {
|
|
10
|
+
// 当前页码
|
|
11
|
+
currentPage: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: d.pageNum
|
|
14
|
+
},
|
|
15
|
+
// 每页显示条目个数
|
|
16
|
+
pageSize: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: d.pageSize
|
|
19
|
+
},
|
|
20
|
+
// 每页显示个数选择器的选项设置
|
|
21
|
+
pageSizes: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => p.pageSizes
|
|
24
|
+
},
|
|
25
|
+
// 是否为分页按钮添加背景色
|
|
26
|
+
background: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
// 分页组件的布局,子组件名用逗号分隔
|
|
31
|
+
layout: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: p.layout
|
|
34
|
+
},
|
|
35
|
+
// 上一页的图标
|
|
36
|
+
prevIcon: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: b
|
|
39
|
+
},
|
|
40
|
+
// 下一页的图标
|
|
41
|
+
nextIcon: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: P
|
|
44
|
+
},
|
|
45
|
+
// 只有一页时是否隐藏
|
|
46
|
+
hideOnSinglePage: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !0
|
|
49
|
+
},
|
|
50
|
+
// 总数
|
|
51
|
+
total: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 0
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
emits: [
|
|
57
|
+
t.sizeChange,
|
|
58
|
+
t.currentChange,
|
|
59
|
+
t.updateCurrentPage,
|
|
60
|
+
t.updatePageSize
|
|
61
|
+
],
|
|
62
|
+
setup(a, { emit: c }) {
|
|
63
|
+
const n = c, r = a, g = l({
|
|
64
|
+
get: () => r.currentPage,
|
|
65
|
+
set: (e) => {
|
|
66
|
+
n(t.updateCurrentPage, e);
|
|
67
|
+
}
|
|
68
|
+
}), i = l({
|
|
69
|
+
get: () => r.pageSize,
|
|
70
|
+
set: (e) => {
|
|
71
|
+
n(t.updatePageSize, e);
|
|
72
|
+
}
|
|
73
|
+
}), s = (e) => {
|
|
74
|
+
n(t.sizeChange, e), n(t.updatePageSize, e);
|
|
75
|
+
}, m = (e) => {
|
|
76
|
+
n(t.currentChange, e), n(t.updateCurrentPage, e);
|
|
77
|
+
};
|
|
78
|
+
return (e, u) => (z(), f(y(C), S({
|
|
79
|
+
"current-page": g.value,
|
|
80
|
+
"onUpdate:currentPage": u[0] || (u[0] = (o) => g.value = o),
|
|
81
|
+
"page-size": i.value,
|
|
82
|
+
"onUpdate:pageSize": u[1] || (u[1] = (o) => i.value = o),
|
|
83
|
+
"page-sizes": a.pageSizes,
|
|
84
|
+
background: a.background,
|
|
85
|
+
layout: a.layout,
|
|
86
|
+
total: a.total,
|
|
87
|
+
"prev-icon": a.prevIcon,
|
|
88
|
+
"next-icon": a.nextIcon,
|
|
89
|
+
"hide-on-single-page": a.hideOnSinglePage
|
|
90
|
+
}, e.$attrs, {
|
|
91
|
+
onSizeChange: s,
|
|
92
|
+
onCurrentChange: m
|
|
93
|
+
}), null, 16, ["current-page", "page-size", "page-sizes", "background", "layout", "total", "prev-icon", "next-icon", "hide-on-single-page"]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
O as _
|
|
98
|
+
};
|
package/es/index.mjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CustomSelect as m } from "./CustomSelect.mjs";
|
|
2
|
+
import { SearchBar as e } from "./SearchBar.mjs";
|
|
3
|
+
import { PaginationTable as i } from "./PaginationTable.mjs";
|
|
4
|
+
import { UploadFile as p } from "./UploadFile.mjs";
|
|
5
|
+
import { FileList as n } from "./FileList.mjs";
|
|
6
|
+
import { BatchImport as f } from "./BatchImport.mjs";
|
|
7
|
+
import { GradientButton as a } from "./GradientButton.mjs";
|
|
8
|
+
import { CustomDialog as l } from "./CustomDialog.mjs";
|
|
9
|
+
import { CustomPagination as s } from "./CustomPagination.mjs";
|
|
10
|
+
import { CustomTitle as c } from "./CustomTitle.mjs";
|
|
11
|
+
import { CustomDropdown as S } from "./CustomDropdown.mjs";
|
|
12
|
+
import { TreeSelect as u } from "./TreeSelect.mjs";
|
|
13
|
+
import { TreeShowSelect as T } from "./TreeShowSelect.mjs";
|
|
14
|
+
import { IconEmpty as d } from "./IconEmpty.mjs";
|
|
15
|
+
import { IconRenderer as I } from "./IconRenderer.mjs";
|
|
16
|
+
import { IconSelect as _ } from "./IconSelect.mjs";
|
|
17
|
+
import { UpdatePasswordDialog as B } from "./UpdatePasswordDialog.mjs";
|
|
18
|
+
import { BUILD_BIG_TITLES as C, BUILD_STEPS as D, BUILD_TITLES as E, BUILD_TYPES as L, BuildComponents as P, STEP_ARROW_IMAGE as g } from "./BuildComponents.mjs";
|
|
19
|
+
import { CustomTab as U } from "./CustomTab.mjs";
|
|
20
|
+
import { dayjs as b } from "element-plus";
|
|
21
|
+
const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
BUILD_BIG_TITLES: C,
|
|
24
|
+
BUILD_STEPS: D,
|
|
25
|
+
BUILD_TITLES: E,
|
|
26
|
+
BUILD_TYPES: L,
|
|
27
|
+
BatchImport: f,
|
|
28
|
+
BuildComponents: P,
|
|
29
|
+
CustomDialog: l,
|
|
30
|
+
CustomDropdown: S,
|
|
31
|
+
CustomPagination: s,
|
|
32
|
+
CustomSelect: m,
|
|
33
|
+
CustomTab: U,
|
|
34
|
+
CustomTitle: c,
|
|
35
|
+
FileList: n,
|
|
36
|
+
GradientButton: a,
|
|
37
|
+
IconEmpty: d,
|
|
38
|
+
IconRenderer: I,
|
|
39
|
+
IconSelect: _,
|
|
40
|
+
PaginationTable: i,
|
|
41
|
+
STEP_ARROW_IMAGE: g,
|
|
42
|
+
SearchBar: e,
|
|
43
|
+
TreeSelect: u,
|
|
44
|
+
TreeShowSelect: T,
|
|
45
|
+
UpdatePasswordDialog: B,
|
|
46
|
+
UploadFile: p
|
|
47
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
48
|
+
b.en.weekStart = 1;
|
|
49
|
+
const w = (r) => {
|
|
50
|
+
for (const t in o)
|
|
51
|
+
o[t].install && r.use(o[t]);
|
|
52
|
+
}, Q = {
|
|
53
|
+
install: w
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
C as BUILD_BIG_TITLES,
|
|
57
|
+
D as BUILD_STEPS,
|
|
58
|
+
E as BUILD_TITLES,
|
|
59
|
+
L as BUILD_TYPES,
|
|
60
|
+
f as BatchImport,
|
|
61
|
+
P as BuildComponents,
|
|
62
|
+
l as CustomDialog,
|
|
63
|
+
S as CustomDropdown,
|
|
64
|
+
s as CustomPagination,
|
|
65
|
+
m as CustomSelect,
|
|
66
|
+
U as CustomTab,
|
|
67
|
+
c as CustomTitle,
|
|
68
|
+
n as FileList,
|
|
69
|
+
a as GradientButton,
|
|
70
|
+
d as IconEmpty,
|
|
71
|
+
I as IconRenderer,
|
|
72
|
+
_ as IconSelect,
|
|
73
|
+
i as PaginationTable,
|
|
74
|
+
g as STEP_ARROW_IMAGE,
|
|
75
|
+
e as SearchBar,
|
|
76
|
+
u as TreeSelect,
|
|
77
|
+
T as TreeShowSelect,
|
|
78
|
+
B as UpdatePasswordDialog,
|
|
79
|
+
p as UploadFile,
|
|
80
|
+
Q as default
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),r=require("./chunks/index.CrvqvcN9.js"),F=require("./chunks/layout.DDTIwGYp.js"),h=require("./chunks/index.DJKAT9lI.js"),S={__name:"ImportResultContent",props:{uploadResData:{type:Object,default:()=>({})},templateConfig:{type:Object,default:()=>({})}},setup(n){const s=n,f=()=>{const{ossUrl:p,fileName:l}=s.uploadResData;s.templateConfig.downloadErrorFile(l,p,s.templateConfig.isNeedTransform)};return(p,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("p",null," 共"+e.toDisplayString(n.uploadResData.total||0)+"条数据,其中"+e.toDisplayString(n.uploadResData.successTotal||0)+"条数据成功,"+e.toDisplayString(n.uploadResData.failureTotal||0)+"条失败 ",1),e.createElementVNode("p",{style:{color:"var(--text-color-4)"}},[l[0]||(l[0]=e.createElementVNode("span",null,"失败原因请下载",-1)),e.createElementVNode("span",{class:"pointer",style:{color:"var(--error-color-1)"},onClick:f}," 错误报告 ")])],64))}},R={key:0,class:"flex items-center"},q={key:0,class:"flex items-center flex-1 fz-12"},j={key:1},I=Object.assign({name:"BatchImport"},{__name:"layout",props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:"导入"},templateName:{type:String,default:"导入"},width:{type:Number,default:520},templateConfig:{type:Object,default:()=>({})},uploadFileConfig:{type:Object,default:()=>{}}},emits:[r.bt.updateModelValue,"success","error","cancel","uploadSuccess"],setup(n,{emit:s}){const f={templateFileName:"导入模板.xlsx"},p={uploadFileType:[r.m.xlsx,r.m.xls],isCustomRequest:!0,multiple:!1,rowCount:1,maxCount:1},l=n,v=s,i=e.ref([]),d=e.computed({get(){return l.modelValue},set(o){v(r.bt.updateModelValue,o)}}),k=e.computed(()=>u.value==="result"?"导入结果":l.title),C=e.computed(()=>({...p,...l.uploadFileConfig})),m=e.computed(()=>({...f,...l.templateConfig})),w=()=>{m.value.downloadTemplate({},m.value.templateFileName)},u=e.ref("upload"),y=e.ref({}),B=()=>{d.value=!1};function E(o,t){const a=o.name.split(".").pop(),g=`${t}.${a}`;return new File([o],g,{type:o.type,lastModified:o.lastModified})}const T=e.ref(null),D=async()=>{const o=l.uploadFileConfig?.fileName||i.value?.[0]?.raw?.name;C.value?.apiConfig({...C.value?.params,file:E(i.value?.[0]?.raw,o)}).then(t=>{const{data:a}=t;T.value=a;const{failureTotal:g,successTotal:V}=a;t.code===r.A.success&&(g?(u.value="result",y.value=a,V&&v("uploadSuccess")):(r.gt(`文件导入成功,共导入数据:${V}条`),v("uploadSuccess"),d.value=!1))})},N=()=>{d.value=!1};return(o,t)=>(e.openBlock(),e.createBlock(e.unref(c.ElDialog),{modelValue:d.value,"onUpdate:modelValue":t[1]||(t[1]=a=>d.value=a),title:k.value,width:n.width,"close-on-click-modal":!1,"close-on-press-escape":!1,onClose:N},{footer:e.withCtx(()=>[u.value==="upload"?(e.openBlock(),e.createElementBlock("div",R,[m.value?.downloadTemplate?(e.openBlock(),e.createElementBlock("div",q,[e.createVNode(e.unref(c.ElIcon),{size:14,color:"var(--text-color-4)"},{default:e.withCtx(()=>[e.createVNode(e.unref(h.icon_query_default))]),_:1}),t[2]||(t[2]=e.createElementVNode("div",{class:"text-74798c pd-l-4"},"还没有模板?点击下载",-1)),e.createElementVNode("div",{class:"text-3b64ff pointer",onClick:w}," 《"+e.toDisplayString(n.templateName)+"模板》 ",1)])):e.createCommentVNode("",!0),e.createVNode(e.unref(c.ElButton),{onClick:N},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(e.unref(c.ElButton),{type:"primary",onClick:D,disabled:!i.value?.length},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode(" 确认 ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0),u.value==="result"?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(c.ElButton),{type:"primary",onClick:B},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("我知道了",-1)])]),_:1})])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[u.value==="upload"?(e.openBlock(),e.createBlock(F.default,e.mergeProps({key:0,modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=a=>i.value=a)},C.value),null,16,["modelValue"])):e.createCommentVNode("",!0),u.value==="result"?(e.openBlock(),e.createBlock(S,{key:1,templateConfig:m.value,uploadResData:y.value},null,8,["templateConfig","uploadResData"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","width"]))}}),x=b.withInstall(I);exports.BatchImport=x;exports.default=x;
|