@web-utils/component 4.0.13 → 4.0.15
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/address-input/index.mjs +15 -13
- package/card/index.mjs +20 -18
- package/carousel/index.mjs +12 -10
- package/chat/index.mjs +56 -45
- package/chunk-file-uploader/index.mjs +378 -36
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/{ElementTaskConfig.Bko0kgTp.mjs → ElementTaskConfig.AvBOzAni.mjs} +63 -55
- package/chunks/FormItem.Bhsy_O2B.mjs +372 -0
- package/chunks/FyForm.DriwCJ7b.mjs +765 -0
- package/chunks/SignalAndMessage.BpjOoKhK.mjs +92 -0
- package/chunks/SubTablePlus.BH0IIv3X.mjs +270 -0
- package/chunks/TableColumn.BzivvXMF.mjs +337 -0
- package/chunks/{confirmable-mixin.B2TtLAdk.mjs → confirmable-mixin.BFZb6pcK.mjs} +1 -1
- package/chunks/{dataformat.CpqOeGBl.mjs → dataformat.DJoNBlmI.mjs} +6 -6
- package/chunks/{dic.Dkl-leRW.mjs → dic.BinnDitI.mjs} +9 -9
- package/chunks/{event.9aDS6jcw.mjs → event.DSlcqYHL.mjs} +2 -2
- package/chunks/{form-input.CvFdwlEV.mjs → form-input.BtS_J5a2.mjs} +2 -2
- package/chunks/{index.9OxHjTIE.mjs → index.CIfe3UB3.mjs} +2 -2
- package/chunks/{index.B2TRddqf.mjs → index.Cn7aq-Et.mjs} +8 -8
- package/chunks/{init.DAsXSoLW.mjs → init.xOlFpTyZ.mjs} +2 -2
- package/chunks/{util.DqFv_pWg.mjs → util.DI42t5GU.mjs} +22 -22
- package/color-picker/index.mjs +101 -22
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/data-box/index.mjs +15 -12
- package/data-card/index.mjs +12 -10
- package/data-card-text/index.mjs +12 -10
- package/data-display/index.mjs +17 -15
- package/data-icons/index.mjs +16 -13
- package/data-imgtext/index.mjs +18 -15
- package/data-operatext/index.mjs +16 -14
- package/data-panel/index.mjs +16 -13
- package/data-pay/index.mjs +20 -16
- package/data-price/index.mjs +16 -14
- package/data-progress/index.mjs +17 -13
- package/data-rotate/index.mjs +15 -12
- package/data-table-picker/index.mjs +18 -15
- package/data-tabs/index.mjs +15 -12
- package/dialog-form/index.mjs +18 -16
- package/dynamic-table/index.mjs +30 -25
- package/editable-progress/index.mjs +11 -9
- package/editable-tree/index.mjs +56 -52
- package/egd-collapse-item/index.mjs +9 -9
- package/element-dialog/index.mjs +23 -22
- package/flex-column/index.mjs +1 -1
- package/flex-item/index.mjs +1 -1
- package/flex-row/index.mjs +1 -1
- package/flow/index.mjs +11 -10
- package/flow-designer/index.mjs +1973 -699
- package/flow-designer/style.css +1 -1
- package/flow-node/index.mjs +1 -1
- package/flow-viewer/index.mjs +9 -9
- package/form-block/index.mjs +34 -32
- package/form-cascader/index.mjs +24 -23
- package/form-checkbox/index.mjs +17 -16
- package/form-checkbox-group/index.mjs +23 -20
- package/form-checkbox-group/style.css +1 -1
- package/form-date-picker/index.mjs +20 -18
- package/form-holder/index.mjs +14 -13
- package/form-input/index.mjs +15 -14
- package/form-input-cron-expression/index.mjs +22 -19
- package/form-input-email/index.mjs +16 -15
- package/form-input-id-card/index.mjs +13 -12
- package/form-input-number/index.mjs +17 -16
- package/form-input-phone-number/index.mjs +22 -21
- package/form-input-tag/index.mjs +15 -14
- package/form-input-time/index.mjs +15 -14
- package/form-item/index.mjs +3 -140
- package/form-item-group/index.mjs +31 -28
- package/form-radio-group/index.mjs +28 -27
- package/form-radio-group/style.css +1 -1
- package/form-select/index.mjs +23 -21
- package/form-switch/index.mjs +17 -16
- package/form-table/index.mjs +17 -16
- package/form-table-plus/index.mjs +22 -21
- package/form-textarea/index.mjs +16 -15
- package/form-tree-select/index.mjs +15 -14
- package/form-tree-select-multiple/index.mjs +15 -14
- package/form-view/index.mjs +39 -35
- package/fy-array/index.mjs +37 -33
- package/fy-cascader/index.mjs +17 -16
- package/fy-checkbox/index.mjs +13 -11
- package/fy-code/index.mjs +10 -10
- package/fy-curd/index.mjs +1147 -1123
- package/fy-date/index.mjs +11 -10
- package/fy-draggable/index.mjs +10 -9
- package/fy-dynamic/index.mjs +25 -22
- package/fy-empty/index.mjs +1 -1
- package/fy-form/index.mjs +15 -638
- package/fy-form-design/index.mjs +1165 -1127
- package/fy-input/index.mjs +14 -12
- package/fy-input-color/index.mjs +15 -13
- package/fy-input-icon/index.mjs +23 -20
- package/fy-input-map/index.mjs +31 -28
- package/fy-input-number/index.mjs +10 -9
- package/fy-input-table/index.mjs +22 -18
- package/fy-input-tree/index.mjs +37 -33
- package/fy-progress/index.mjs +10 -9
- package/fy-radio/index.mjs +16 -15
- package/fy-rate/index.mjs +11 -10
- package/fy-select/index.mjs +29 -25
- package/fy-slider/index.mjs +12 -11
- package/fy-switch/index.mjs +10 -9
- package/fy-tabs/index.mjs +17 -15
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +24 -18
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +76 -74
- package/guide-steps/index.mjs +13 -11
- package/iframe-window/index.mjs +10 -9
- package/image-cropper/index.mjs +30 -28
- package/image-preview/index.mjs +14 -12
- package/index.mjs +72 -72
- package/input-number/index.mjs +14 -13
- package/input-number-range/index.mjs +12 -11
- package/license/index.mjs +1 -1
- package/login/index.mjs +26 -21
- package/nav-bar/index.mjs +10 -9
- package/notice/index.mjs +10 -9
- package/package.json +1 -1
- package/page-index/index.mjs +13 -12
- package/page-index-top/index.mjs +28 -23
- package/page-skeleton/index.mjs +14 -14
- package/page-skeleton-new/index.mjs +9 -8
- package/pageable-table/index.mjs +182 -172
- package/pageable-table/style.css +1 -1
- package/pageable-view/index.mjs +16 -15
- package/picker-table-view/index.mjs +58 -49
- package/present-view/index.mjs +39 -35
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +1 -1
- package/search/index.mjs +22 -20
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/skeleton-panel/index.mjs +10 -9
- package/split-pane/index.mjs +37 -36
- package/static-pageable-table/index.mjs +13 -11
- package/sub-table/index.mjs +49 -36
- package/sub-table-plus/index.mjs +18 -229
- package/swiper/index.mjs +12 -11
- package/table-column/index.mjs +3 -223
- package/table-view/index.mjs +60 -52
- package/tabs-view/index.mjs +19 -17
- package/tag-render/index.mjs +18 -16
- package/text-ellipsis/index.mjs +10 -9
- package/toolbar/index.mjs +14 -13
- package/toolbar-button/index.mjs +14 -13
- package/verify/index.mjs +1 -1
- package/vue-cron/index.mjs +267 -259
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +24 -21
- package/chunks/ElementBaseInfo.ZADwixb5.mjs +0 -125
- package/chunks/ElementForm.CQ3PN5qj.mjs +0 -223
- package/chunks/ElementListeners.De_PRuIm.mjs +0 -215
- package/chunks/ElementMultiInstance.DQo2wuAQ.mjs +0 -181
- package/chunks/ElementOtherConfig.B1NfMTYh.mjs +0 -60
- package/chunks/ElementProperties.CosfDrlW.mjs +0 -112
- package/chunks/FlowCondition.Y6qEYi1T.mjs +0 -102
- package/chunks/FormTemp.BQxO5IQq.mjs +0 -123
- package/chunks/SignalAndMessage.Bb5PFX0N.mjs +0 -85
- package/chunks/UserTaskListeners.Bv3BDfEI.mjs +0 -169
- package/chunks/core.0Exl13Mz.mjs +0 -54
- package/chunks/dictionary.DGt59Ir7.mjs +0 -68
- package/chunks/form-item.LWjePsPa.mjs +0 -233
- package/chunks/sub-table-plus-props.BVsD71hT.mjs +0 -30
- package/chunks/utilSelf.Csq1766E.mjs +0 -48
- package/chunks/utils.DRcxC1Fb.mjs +0 -60
- package/element-listeners/style.css +0 -1
- package/element-multi-instance/style.css +0 -1
package/fy-curd/index.mjs
CHANGED
|
@@ -1,16 +1,318 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
1
|
+
import l from "element-ui/lib/button";
|
|
2
|
+
import F from "element-ui/lib/col";
|
|
3
|
+
import q from "../fy-input/index.mjs";
|
|
4
|
+
import k from "../fy-select/index.mjs";
|
|
5
|
+
import X from "element-ui/lib/button-group";
|
|
6
|
+
import J from "element-ui/lib/row";
|
|
7
|
+
import I from "element-ui/lib/drawer";
|
|
8
|
+
import { d as c, u as P, o as m, i as S, k as b, c as Q, v as Y, x as Z, s as ee } from "../chunks/util.DI42t5GU.mjs";
|
|
9
|
+
import { n as g } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
10
|
+
import { F as O, d as D, _ as z } from "../chunks/FyForm.DriwCJ7b.mjs";
|
|
11
|
+
import te from "../element-dialog/index.mjs";
|
|
12
|
+
import ie from "element-ui/lib/checkbox";
|
|
13
|
+
import _ from "element-ui/lib/table-column";
|
|
14
|
+
import M from "element-ui/lib/table";
|
|
15
|
+
import { isBlank as u } from "@web-utils/core";
|
|
16
|
+
import ne from "element-ui/lib/pagination";
|
|
17
|
+
import T from "element-ui/lib/card";
|
|
18
|
+
import x from "element-ui/lib/dropdown-item";
|
|
19
|
+
import re from "element-ui/lib/dropdown-menu";
|
|
20
|
+
import se from "element-ui/lib/dropdown";
|
|
21
|
+
import { p as B } from "../chunks/permission.CO31YIkD.mjs";
|
|
22
|
+
import E from "../icon-temp/index.mjs";
|
|
23
|
+
import oe from "../fy-rate/index.mjs";
|
|
24
|
+
import le from "element-ui/lib/link";
|
|
25
|
+
import ae from "element-ui/lib/tooltip";
|
|
26
|
+
import ce from "element-ui/lib/form-item";
|
|
27
|
+
import { s as ue } from "../chunks/dic.BinnDitI.mjs";
|
|
12
28
|
import "../icon-temp/style.css";
|
|
13
|
-
|
|
29
|
+
import de from "element-ui/lib/empty";
|
|
30
|
+
import pe from "element-ui/lib/form";
|
|
31
|
+
import he from "element-ui/lib/tag";
|
|
32
|
+
import me from "../fy-date/index.mjs";
|
|
33
|
+
import { s as fe } from "../chunks/slot.DXIbhGat.mjs";
|
|
34
|
+
import { d as ge, f as _e, t as be, b as ve } from "../chunks/dataformat.DJoNBlmI.mjs";
|
|
35
|
+
import { p as ye } from "../chunks/packages.ByyangTp.mjs";
|
|
36
|
+
import { i as xe } from "../chunks/init.xOlFpTyZ.mjs";
|
|
37
|
+
const $e = {
|
|
38
|
+
name: "DialogFilter",
|
|
39
|
+
inject: ["crud"],
|
|
40
|
+
data() {
|
|
41
|
+
return {
|
|
42
|
+
box: !1,
|
|
43
|
+
columnObj: {},
|
|
44
|
+
symbolDic: [
|
|
45
|
+
{
|
|
46
|
+
label: "=",
|
|
47
|
+
value: "="
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "≠",
|
|
51
|
+
value: "≠"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "like",
|
|
55
|
+
value: "like"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: ">",
|
|
59
|
+
value: ">"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "≥",
|
|
63
|
+
value: "≥"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "<",
|
|
67
|
+
value: "<"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "≤",
|
|
71
|
+
value: "≤"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "∈",
|
|
75
|
+
value: "∈"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
list: [],
|
|
79
|
+
columnOption: {}
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
methods: {
|
|
83
|
+
handleShow() {
|
|
84
|
+
this.getColumnOption(), this.box = !0;
|
|
85
|
+
},
|
|
86
|
+
getColumnOption() {
|
|
87
|
+
const t = [];
|
|
88
|
+
c(this.crud.propOption).forEach((i) => {
|
|
89
|
+
i.showColumn !== !1 && t.push(
|
|
90
|
+
Object.assign(i, {
|
|
91
|
+
value: i.prop
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}), this.columnOption = t, this.columnObj = this.columnOption[0];
|
|
95
|
+
},
|
|
96
|
+
handleDelete(t) {
|
|
97
|
+
this.list.splice(t, 1);
|
|
98
|
+
},
|
|
99
|
+
handleClear() {
|
|
100
|
+
this.list = [];
|
|
101
|
+
},
|
|
102
|
+
handleValueClear() {
|
|
103
|
+
this.list.forEach((t) => {
|
|
104
|
+
t.value = "";
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
handleSubmit() {
|
|
108
|
+
const t = [];
|
|
109
|
+
this.list.forEach((e) => {
|
|
110
|
+
t.push([e.text, e.symbol, e.value]);
|
|
111
|
+
}), this.crud.$emit("filter", t), this.box = !1;
|
|
112
|
+
},
|
|
113
|
+
handleChange(t) {
|
|
114
|
+
this.list[t].value = "";
|
|
115
|
+
},
|
|
116
|
+
handleAdd() {
|
|
117
|
+
const t = this.columnObj.prop;
|
|
118
|
+
this.list.push({
|
|
119
|
+
text: t,
|
|
120
|
+
value: "",
|
|
121
|
+
symbol: this.symbolDic[0].value
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var Ce = function() {
|
|
127
|
+
var e = this, i = e._self._c;
|
|
128
|
+
return e.box ? i("div", [i(I, { staticClass: "avue-dialog", class: ["avue-crud__dialog", "avue-crud__filter"], attrs: { "lock-scroll": "", "append-to-body": "", title: "过滤条件", size: e.crud.isMobile ? "100%" : "60%", visible: e.box }, on: { "update:visible": function(n) {
|
|
129
|
+
e.box = n;
|
|
130
|
+
} } }, [i(J, { attrs: { span: 24 } }, [i("div", { staticClass: "avue-crud__filter-menu" }, [i(X, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleAdd } }, [e._v(" 新增条件 ")]), i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleClear } }, [e._v(" 清空条件 ")]), i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleValueClear } }, [e._v(" 清空数据 ")])], 1)], 1), e._l(e.list, function(n, r) {
|
|
131
|
+
return i(F, { key: r, staticClass: "avue-crud__filter-item", attrs: { md: 12, xs: 24, sm: 12 } }, [i(k, { staticClass: "avue-crud__filter-label", attrs: { dic: e.columnOption, clearable: !1, size: e.crud.isMediumSize }, on: { change: function(s) {
|
|
132
|
+
return e.handleChange(r);
|
|
133
|
+
} }, model: { value: n.text, callback: function(s) {
|
|
134
|
+
e.$set(n, "text", s);
|
|
135
|
+
}, expression: "column.text" } }), i(k, { staticClass: "avue-crud__filter-symbol", attrs: { dic: e.symbolDic, clearable: !1, size: e.crud.isMediumSize }, model: { value: n.symbol, callback: function(s) {
|
|
136
|
+
e.$set(n, "symbol", s);
|
|
137
|
+
}, expression: "column.symbol" } }), i(q, { staticClass: "avue-crud__filter-value", attrs: { size: e.crud.isMediumSize }, model: { value: n.value, callback: function(s) {
|
|
138
|
+
e.$set(n, "value", s);
|
|
139
|
+
}, expression: "column.value" } }), i(l, { staticClass: "avue-crud__filter-icon", attrs: { type: "danger", size: "mini", circle: "", icon: "el-icon-minus" }, on: { click: function(s) {
|
|
140
|
+
return e.handleDelete(r);
|
|
141
|
+
} } })], 1);
|
|
142
|
+
}), i(F, { staticClass: "avue-form__menu avue-form__menu--right", attrs: { span: 24 } }, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleSubmit } }, [e._v(" 确 定 ")]), i(l, { attrs: { size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
143
|
+
e.box = !1;
|
|
144
|
+
} } }, [e._v(" 取 消 ")])], 1)], 2)], 1)], 1) : e._e();
|
|
145
|
+
}, we = [], Se = /* @__PURE__ */ g(
|
|
146
|
+
$e,
|
|
147
|
+
Ce,
|
|
148
|
+
we,
|
|
149
|
+
!1,
|
|
150
|
+
null,
|
|
151
|
+
null
|
|
152
|
+
);
|
|
153
|
+
const L = Se.exports, Oe = {
|
|
154
|
+
name: "DialogExcel",
|
|
155
|
+
inject: ["crud"],
|
|
156
|
+
data() {
|
|
157
|
+
return {
|
|
158
|
+
option: {},
|
|
159
|
+
columnOption: {},
|
|
160
|
+
box: !1,
|
|
161
|
+
form: {
|
|
162
|
+
name: this.crud.tableOption.title
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
methods: {
|
|
167
|
+
handleShow() {
|
|
168
|
+
this.getColumnOption(), this.getOption(), this.box = !0;
|
|
169
|
+
},
|
|
170
|
+
handleSubmit() {
|
|
171
|
+
this.$Export.excel({
|
|
172
|
+
title: this.form.name,
|
|
173
|
+
columns: this.getColumn(),
|
|
174
|
+
data: this.handleSum()
|
|
175
|
+
}), this.box = !1;
|
|
176
|
+
},
|
|
177
|
+
// 计算统计
|
|
178
|
+
handleSum() {
|
|
179
|
+
const t = this.crud.tableOption, e = this.crud.propOption, i = this.form.type ? this.crud.list : this.crud.tableSelect, n = [];
|
|
180
|
+
return this.form.params.includes("data") && i.forEach((r) => {
|
|
181
|
+
const s = c(r);
|
|
182
|
+
e.forEach((o) => {
|
|
183
|
+
const a = o.parentProp ? (this.crud.cascaderDIC[o.$index] || {})[o.prop] : this.crud.DIC[o.prop];
|
|
184
|
+
s[o.prop] = D(s, o, t, a);
|
|
185
|
+
}), n.push(s);
|
|
186
|
+
}), this.form.params.includes("sum") && t.showSummary && n.push(this.crud.sumsList), n;
|
|
187
|
+
},
|
|
188
|
+
getOption() {
|
|
189
|
+
this.option = {
|
|
190
|
+
submitBtn: !1,
|
|
191
|
+
emptyBtn: !1,
|
|
192
|
+
column: [
|
|
193
|
+
{
|
|
194
|
+
label: "文件名",
|
|
195
|
+
prop: "name",
|
|
196
|
+
span: 24
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: "选择数据",
|
|
200
|
+
prop: "type",
|
|
201
|
+
span: 24,
|
|
202
|
+
type: "select",
|
|
203
|
+
dicData: [
|
|
204
|
+
{
|
|
205
|
+
label: "当前数据(当前页全部的数据)",
|
|
206
|
+
value: !0
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
label: "选中的数据(当前页选中的数据)",
|
|
210
|
+
disabled: this.crud.tableOption.selection !== !0,
|
|
211
|
+
value: !1
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
label: "选择字段",
|
|
217
|
+
prop: "prop",
|
|
218
|
+
type: "tree",
|
|
219
|
+
multiple: !0,
|
|
220
|
+
checkStrictly: !0,
|
|
221
|
+
span: 24,
|
|
222
|
+
props: {
|
|
223
|
+
value: "prop"
|
|
224
|
+
},
|
|
225
|
+
dicData: this.columnOption
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
label: "参数设置",
|
|
229
|
+
prop: "params",
|
|
230
|
+
type: "checkbox",
|
|
231
|
+
span: 24,
|
|
232
|
+
value: ["header", "data"].concat(
|
|
233
|
+
(() => {
|
|
234
|
+
const t = [];
|
|
235
|
+
return this.crud.isHeader && t.push("headers"), this.crud.isShowSummary && t.push("sum"), t;
|
|
236
|
+
})()
|
|
237
|
+
),
|
|
238
|
+
dicData: [
|
|
239
|
+
{
|
|
240
|
+
label: "表头",
|
|
241
|
+
disabled: !0,
|
|
242
|
+
value: "header"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
label: "数据源",
|
|
246
|
+
value: "data"
|
|
247
|
+
}
|
|
248
|
+
].concat(
|
|
249
|
+
(() => {
|
|
250
|
+
const t = [];
|
|
251
|
+
return t.push({
|
|
252
|
+
label: "复杂表头",
|
|
253
|
+
value: "headers",
|
|
254
|
+
disabled: !this.crud.isHeader
|
|
255
|
+
}), t.push({
|
|
256
|
+
label: "合计统计",
|
|
257
|
+
value: "sum",
|
|
258
|
+
disabled: !this.crud.isShowSummary
|
|
259
|
+
}), t;
|
|
260
|
+
})()
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}, this.form.type = this.crud.selectLen === 0;
|
|
265
|
+
},
|
|
266
|
+
getColumnOption() {
|
|
267
|
+
const t = c(this.crud.columnOption), e = [], i = (n = []) => {
|
|
268
|
+
n.forEach((r, s) => {
|
|
269
|
+
const o = r.children;
|
|
270
|
+
o && !Array.isArray(o) ? delete r.children : r.showColumn === !1 ? n.splice(s, 1) : (e.push(r.prop), r.children && i(o));
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
i(t), this.columnOption = t, this.form.prop = e;
|
|
274
|
+
},
|
|
275
|
+
getColumn() {
|
|
276
|
+
const t = c(this.columnOption), e = this.$refs.form.getPropRef("prop").$refs.temp.getHalfList();
|
|
277
|
+
if (!this.form.params) return [];
|
|
278
|
+
if (this.form.params.includes("headers")) {
|
|
279
|
+
const i = (n = []) => {
|
|
280
|
+
n.forEach((r, s) => {
|
|
281
|
+
e.includes(r.prop) ? r.children && i(r.children) : n.splice(s, 1);
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
return i(t), t;
|
|
285
|
+
} else {
|
|
286
|
+
const i = [], n = (r = []) => {
|
|
287
|
+
r.forEach((s) => {
|
|
288
|
+
s.children ? n(s.children) : e.includes(s.prop) && i.push(s);
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
return n(t), i;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
var Be = function() {
|
|
297
|
+
var e = this, i = e._self._c;
|
|
298
|
+
return e.box ? i("div", [i(te, { staticClass: "avue-dialog", attrs: { title: "导出", "lock-scroll": "", visible: e.box, width: e.crud.isMobile ? "100%" : "30%" }, on: { "update:visible": function(n) {
|
|
299
|
+
e.box = n;
|
|
300
|
+
} }, scopedSlots: e._u([{ key: "footer", fn: function() {
|
|
301
|
+
return [i("span", { staticClass: "dialog-footer" }, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleSubmit } }, [e._v("确定")]), i(l, { attrs: { size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
302
|
+
e.box = !1;
|
|
303
|
+
} } }, [e._v("取消")])], 1)];
|
|
304
|
+
}, proxy: !0 }], null, !1, 2375905330) }, [i(O, { attrs: { option: e.option }, model: { value: e.form, callback: function(n) {
|
|
305
|
+
e.form = n;
|
|
306
|
+
}, expression: "form" } })], 1)], 1) : e._e();
|
|
307
|
+
}, Fe = [], ke = /* @__PURE__ */ g(
|
|
308
|
+
Oe,
|
|
309
|
+
Be,
|
|
310
|
+
Fe,
|
|
311
|
+
!1,
|
|
312
|
+
null,
|
|
313
|
+
null
|
|
314
|
+
);
|
|
315
|
+
const V = ke.exports, h = {
|
|
14
316
|
menuWidth: 220,
|
|
15
317
|
menuFixed: "right",
|
|
16
318
|
menuXsWidth: 100,
|
|
@@ -79,633 +381,254 @@ const p = {
|
|
|
79
381
|
dropRowClass: ".el-table__body-wrapper > table > tbody",
|
|
80
382
|
dropColClass: ".el-table__header-wrapper tr",
|
|
81
383
|
ghostClass: "avue-crud__ghost"
|
|
82
|
-
},
|
|
83
|
-
name: "
|
|
84
|
-
mixins: [M],
|
|
384
|
+
}, Ie = {
|
|
385
|
+
name: "DialogColumn",
|
|
85
386
|
inject: ["crud"],
|
|
86
|
-
props: {
|
|
87
|
-
search: Object
|
|
88
|
-
},
|
|
89
387
|
data() {
|
|
90
388
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
searchShow: !0
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
|
-
computed: {
|
|
97
|
-
searchForm: {
|
|
98
|
-
get() {
|
|
99
|
-
return this.crud.search;
|
|
100
|
-
},
|
|
101
|
-
set(t) {
|
|
102
|
-
this.crud.$emit("update:search", t);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
option() {
|
|
106
|
-
const t = this.crud.option, e = (n = []) => {
|
|
107
|
-
n = a(n);
|
|
108
|
-
const r = [];
|
|
109
|
-
let s = 0;
|
|
110
|
-
return n = n.sort((l, o) => (o.searchOrder || 0) - (l.searchOrder || 0)), n.forEach((l) => {
|
|
111
|
-
if (l.search) {
|
|
112
|
-
const o = s < this.searchIndex, m = {};
|
|
113
|
-
Object.keys(l).forEach((u) => {
|
|
114
|
-
const g = "search";
|
|
115
|
-
if (u !== "searchProp" && u.includes(g)) {
|
|
116
|
-
let d = u.replace(g, "");
|
|
117
|
-
if (d.length === 0) return;
|
|
118
|
-
d = d.replace(d[0], d[0].toLowerCase()), m[d] = l[u];
|
|
119
|
-
}
|
|
120
|
-
}), l = Object.assign(l, m, {
|
|
121
|
-
type: F(l),
|
|
122
|
-
detail: !1,
|
|
123
|
-
dicFlag: l.cascader ? !0 : h(l.dicFlag, !1),
|
|
124
|
-
span: l.searchSpan || t.searchSpan || p.searchSpan,
|
|
125
|
-
control: l.searchControl,
|
|
126
|
-
gutter: l.searchGutter || t.searchGutter || p.searchGutter,
|
|
127
|
-
labelWidth: l.searchLabelWidth || t.searchLabelWidth || p.searchLabelWidth,
|
|
128
|
-
labelPosition: l.searchLabelPosition || t.searchLabelPosition,
|
|
129
|
-
size: l.searchSize || t.searchSize,
|
|
130
|
-
value: l.searchValue,
|
|
131
|
-
rules: l.searchRules,
|
|
132
|
-
row: l.searchRow,
|
|
133
|
-
bind: l.searchBin,
|
|
134
|
-
disabled: l.searchDisabled,
|
|
135
|
-
readonly: l.searchReadonly,
|
|
136
|
-
display: this.isSearchIcon ? this.show ? !0 : o : !0
|
|
137
|
-
}), r.push(l), s = s + 1;
|
|
138
|
-
}
|
|
139
|
-
}), r;
|
|
140
|
-
};
|
|
141
|
-
return ((n) => {
|
|
142
|
-
let r = a(n);
|
|
143
|
-
return r.column = e(this.crud.propOption), r = Object.assign(r, {
|
|
144
|
-
rowKey: t.searchRowKey || "null",
|
|
145
|
-
tabs: !1,
|
|
146
|
-
group: !1,
|
|
147
|
-
printBtn: !1,
|
|
148
|
-
mockBtn: !1,
|
|
149
|
-
filterDic: t.searchFilterDic,
|
|
150
|
-
filterNull: t.searchFilterNull,
|
|
151
|
-
filterParam: t.searchFilterParam,
|
|
152
|
-
enter: t.searchEnter,
|
|
153
|
-
size: t.searchSize,
|
|
154
|
-
submitText: t.searchBtnText || "搜 索",
|
|
155
|
-
submitBtn: h(t.searchBtn, p.searchSubBtn),
|
|
156
|
-
submitIcon: this.crud.getBtnIcon("searchBtn"),
|
|
157
|
-
emptyText: t.emptyBtnText || "清 空",
|
|
158
|
-
emptyBtn: h(t.emptyBtn, p.emptyBtn),
|
|
159
|
-
emptyIcon: this.crud.getBtnIcon("emptyBtn"),
|
|
160
|
-
menuSpan: this.show || !this.isSearchIcon || t.searchMenuSpan < 6 ? t.searchMenuSpan : 6,
|
|
161
|
-
menuPosition: t.searchMenuPosition || "center",
|
|
162
|
-
dicFlag: !1,
|
|
163
|
-
dicData: this.crud.DIC
|
|
164
|
-
}), r;
|
|
165
|
-
})(t);
|
|
166
|
-
},
|
|
167
|
-
isSearchIcon() {
|
|
168
|
-
return h(this.crud.option.searchIcon, this.$AVUE.searchIcon) && this.searchLen > this.searchIndex;
|
|
169
|
-
},
|
|
170
|
-
searchLen() {
|
|
171
|
-
let t = 0;
|
|
172
|
-
return this.crud.propOption.forEach((e) => {
|
|
173
|
-
e.search && t++;
|
|
174
|
-
}), t;
|
|
175
|
-
},
|
|
176
|
-
searchFlag() {
|
|
177
|
-
return !!this.crud.$scopedSlots.search || this.searchLen !== 0;
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
watch: {
|
|
181
|
-
"crud.propOption": {
|
|
182
|
-
handler() {
|
|
183
|
-
this.dataFormat();
|
|
184
|
-
},
|
|
185
|
-
deep: !0
|
|
186
|
-
},
|
|
187
|
-
show() {
|
|
188
|
-
this.crud.getTableHeight();
|
|
189
|
-
},
|
|
190
|
-
searchShow() {
|
|
191
|
-
this.crud.getTableHeight();
|
|
192
|
-
},
|
|
193
|
-
option: {
|
|
194
|
-
immediate: !0,
|
|
195
|
-
deep: !0,
|
|
196
|
-
handler() {
|
|
197
|
-
var t;
|
|
198
|
-
this.searchIndex = ((t = this.option) == null ? void 0 : t.searchIndex) || 2;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
created() {
|
|
203
|
-
this.initFun(), this.dataFormat();
|
|
204
|
-
},
|
|
205
|
-
methods: {
|
|
206
|
-
initFun() {
|
|
207
|
-
["searchReset", "searchChange"].forEach((t) => {
|
|
208
|
-
this.crud[t] = this[t];
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
getSlotName(t) {
|
|
212
|
-
return t.replace("Search", "");
|
|
213
|
-
},
|
|
214
|
-
// 搜索回调
|
|
215
|
-
searchChange(t, e) {
|
|
216
|
-
t = C(t), this.crud.propOption.forEach((i) => {
|
|
217
|
-
i.searchProp && (t[i.searchProp] = t[i.prop], delete t[i.prop]);
|
|
218
|
-
}), this.crud.$emit("search-change", t, e);
|
|
219
|
-
},
|
|
220
|
-
// 搜索清空
|
|
221
|
-
resetChange() {
|
|
222
|
-
this.crud.$emit("search-reset", this.searchForm);
|
|
223
|
-
},
|
|
224
|
-
// 搜索清空
|
|
225
|
-
searchReset() {
|
|
226
|
-
this.$refs.form.resetForm();
|
|
227
|
-
},
|
|
228
|
-
handleSearchShow() {
|
|
229
|
-
this.searchShow = !this.searchShow;
|
|
230
|
-
},
|
|
231
|
-
dataFormat() {
|
|
232
|
-
const t = this.crud.option;
|
|
233
|
-
this.searchShow = h(t.searchShow, p.searchShow);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
var H = function() {
|
|
238
|
-
var e = this, i = e._self._c;
|
|
239
|
-
return e.searchFlag ? i("ElCard", { directives: [{ name: "show", rawName: "v-show", value: e.searchShow && e.searchFlag, expression: "searchShow && searchFlag" }], staticClass: "avue-crud__search", attrs: { shadow: e.crud.isCard } }, [e._t("search", null, { row: e.searchForm, search: e.searchForm, size: e.crud.controlSize }), i("FyForm", { ref: "form", attrs: { option: e.option }, on: { submit: e.searchChange, "reset-change": e.resetChange }, scopedSlots: e._u([{ key: "menuForm", fn: function(n) {
|
|
240
|
-
return [e._t(
|
|
241
|
-
"searchMenu",
|
|
242
|
-
null,
|
|
243
|
-
null,
|
|
244
|
-
Object.assign(n, {
|
|
245
|
-
search: e.searchForm,
|
|
246
|
-
row: e.searchForm
|
|
247
|
-
})
|
|
248
|
-
), e.isSearchIcon ? [e.show === !1 ? i("ElButton", { attrs: { type: "text", icon: "el-icon-arrow-down" }, on: { click: function(r) {
|
|
249
|
-
e.show = !0;
|
|
250
|
-
} } }, [e._v(" 展 开 ")]) : e._e(), e.show === !0 ? i("ElButton", { attrs: { type: "text", icon: "el-icon-arrow-up" }, on: { click: function(r) {
|
|
251
|
-
e.show = !1;
|
|
252
|
-
} } }, [e._v(" 收 缩 ")]) : e._e()] : e._e()];
|
|
253
|
-
} }, e._l(e.crud.searchSlot, function(n) {
|
|
254
|
-
return { key: e.getSlotName(n), fn: function(r) {
|
|
255
|
-
return [e._t(
|
|
256
|
-
n,
|
|
257
|
-
null,
|
|
258
|
-
null,
|
|
259
|
-
Object.assign(r, {
|
|
260
|
-
search: e.searchForm,
|
|
261
|
-
row: e.searchForm
|
|
262
|
-
})
|
|
263
|
-
)];
|
|
264
|
-
} };
|
|
265
|
-
})], null, !0), model: { value: e.searchForm, callback: function(n) {
|
|
266
|
-
e.searchForm = n;
|
|
267
|
-
}, expression: "searchForm" } })], 2) : e._e();
|
|
268
|
-
}, N = [], j = /* @__PURE__ */ f(
|
|
269
|
-
A,
|
|
270
|
-
H,
|
|
271
|
-
N,
|
|
272
|
-
!1,
|
|
273
|
-
null,
|
|
274
|
-
null
|
|
275
|
-
);
|
|
276
|
-
const W = j.exports, K = {
|
|
277
|
-
name: "HeaderMenu",
|
|
278
|
-
directives: {
|
|
279
|
-
permission: x
|
|
280
|
-
},
|
|
281
|
-
inject: ["crud"],
|
|
282
|
-
data() {
|
|
283
|
-
return {
|
|
284
|
-
dateCreate: !1,
|
|
285
|
-
pickerOptions: {
|
|
286
|
-
shortcuts: [
|
|
287
|
-
{
|
|
288
|
-
text: "今日",
|
|
289
|
-
onClick(t) {
|
|
290
|
-
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
291
|
-
i.setTime(i.getTime()), t.$emit("pick", [i, e]);
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
text: "昨日",
|
|
296
|
-
onClick(t) {
|
|
297
|
-
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
298
|
-
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 1), t.$emit("pick", [i, e]);
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
text: "最近一周",
|
|
303
|
-
onClick(t) {
|
|
304
|
-
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
305
|
-
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 7), t.$emit("pick", [i, e]);
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
text: "最近一个月",
|
|
310
|
-
onClick(t) {
|
|
311
|
-
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
312
|
-
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 30), t.$emit("pick", [i, e]);
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
text: "最近三个月",
|
|
317
|
-
onClick(t) {
|
|
318
|
-
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
319
|
-
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 90), t.$emit("pick", [i, e]);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
},
|
|
324
|
-
config: p
|
|
325
|
-
};
|
|
326
|
-
},
|
|
327
|
-
created() {
|
|
328
|
-
this.initFun();
|
|
329
|
-
},
|
|
330
|
-
methods: {
|
|
331
|
-
optVal: h,
|
|
332
|
-
// 日期组件回调
|
|
333
|
-
dateChange(t) {
|
|
334
|
-
this.dateCreate ? this.crud.$emit("date-change", t) : this.dateCreate = !0;
|
|
335
|
-
},
|
|
336
|
-
initFun() {
|
|
337
|
-
this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
|
|
338
|
-
},
|
|
339
|
-
rowExcel() {
|
|
340
|
-
this.crud.$refs.dialogExcel.handleShow();
|
|
341
|
-
},
|
|
342
|
-
rowPrint() {
|
|
343
|
-
this.$Print(this.crud.$refs.table);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
var U = function() {
|
|
348
|
-
var e = this, i = e._self._c;
|
|
349
|
-
return i("div", { staticClass: "avue-crud__menu" }, [e.optVal(e.crud.tableOption.menuLeft, !0) ? i("div", { staticClass: "avue-crud__left" }, [e.optVal(e.crud.tableOption.addBtn, e.config.addBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addBtn"), expression: "crud.getPermission('addBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.addRowBtn, e.config.addRowBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addRowBtn"), expression: "crud.getPermission('addRowBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowCellAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e._t("menuLeft", null, { size: e.crud.isMediumSize })], 2) : e._e(), e.optVal(e.crud.tableOption.menuRight, !0) ? i("div", { staticClass: "avue-crud__right" }, [e.optVal(e.crud.tableOption.dateBtn, e.config.dateBtn) ? i("FyDate", { staticStyle: { display: "inline-block", "margin-right": "20px" }, attrs: { type: "datetimerange", "value-format": "yyyy-MM-dd HH:mm:ss", format: "yyyy-MM-dd HH:mm:ss", "picker-options": e.pickerOptions, size: e.crud.isMediumSize }, on: { change: e.dateChange } }) : e._e(), e._t("menuRight", null, { size: e.crud.isMediumSize }), e.optVal(e.crud.tableOption.excelBtn, e.config.excelBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("excelBtn"), expression: "crud.getPermission('excelBtn')" }], attrs: { icon: e.crud.getBtnIcon("excelBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowExcel } }) : e._e(), e.optVal(e.crud.tableOption.printBtn, e.config.printBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("printBtn"), expression: "crud.getPermission('printBtn')" }], attrs: { icon: e.crud.getBtnIcon("printBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowPrint } }) : e._e(), e.optVal(e.crud.tableOption.refreshBtn, e.config.refreshBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("refreshBtn"), expression: "crud.getPermission('refreshBtn')" }], attrs: { icon: e.crud.getBtnIcon("refreshBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.crud.refreshChange } }) : e._e(), e.optVal(e.crud.tableOption.columnBtn, e.config.columnBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("columnBtn"), expression: "crud.getPermission('columnBtn')" }], attrs: { icon: e.crud.getBtnIcon("columnBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
350
|
-
return e.crud.$refs.dialogColumn.handleShow();
|
|
351
|
-
} } }) : e._e(), (e.crud.$refs.headerSearch || {}).searchFlag && e.optVal(e.crud.tableOption.searchShowBtn, !0) ? i("ElButton", { attrs: { icon: e.crud.getBtnIcon("searchBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
352
|
-
return e.crud.$refs.headerSearch.handleSearchShow();
|
|
353
|
-
} } }) : e._e(), e.optVal(e.crud.tableOption.filterBtn, e.config.filterBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("filterBtn"), expression: "crud.getPermission('filterBtn')" }], attrs: { icon: e.crud.getBtnIcon("filterBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
354
|
-
return e.crud.$refs.dialogFilter.handleShow();
|
|
355
|
-
} } }) : e._e()], 2) : e._e()]);
|
|
356
|
-
}, G = [], q = /* @__PURE__ */ f(
|
|
357
|
-
K,
|
|
358
|
-
U,
|
|
359
|
-
G,
|
|
360
|
-
!1,
|
|
361
|
-
null,
|
|
362
|
-
null
|
|
363
|
-
);
|
|
364
|
-
const X = q.exports, y = {}, J = {
|
|
365
|
-
name: "ColumnSlot",
|
|
366
|
-
components: { IconTemp: R, FormTemp: L },
|
|
367
|
-
inject: ["dynamic", "crud"],
|
|
368
|
-
props: {
|
|
369
|
-
column: Object,
|
|
370
|
-
columnOption: Array
|
|
371
|
-
},
|
|
372
|
-
created() {
|
|
373
|
-
const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
|
|
374
|
-
Object.keys(this.dynamic).forEach((e) => {
|
|
375
|
-
t.includes(e) && (this[e] = this.dynamic[e]);
|
|
376
|
-
});
|
|
377
|
-
},
|
|
378
|
-
methods: {
|
|
379
|
-
isBlank: c,
|
|
380
|
-
optVal: h,
|
|
381
|
-
uploadFun: B,
|
|
382
|
-
isMediaType(t, e) {
|
|
383
|
-
return D(t, e);
|
|
384
|
-
},
|
|
385
|
-
vaildLabel(t, e, i) {
|
|
386
|
-
if (t.rules && e.$cellEdit)
|
|
387
|
-
return i;
|
|
388
|
-
},
|
|
389
|
-
columnChange(t, e, i) {
|
|
390
|
-
const n = `${i}-${e.prop}`;
|
|
391
|
-
y[n] || (this.handleChange(e, t), typeof e.change == "function" && e.cell === !0 && e.change({ row: t, column: e, index: i, value: t[e.prop] })), y[n] = !0, this.$nextTick(() => {
|
|
392
|
-
y[n] = !1;
|
|
393
|
-
});
|
|
394
|
-
},
|
|
395
|
-
handleChange(t, e) {
|
|
396
|
-
t.cascader && this.$nextTick(() => {
|
|
397
|
-
const i = t.cascader;
|
|
398
|
-
i.forEach((n) => {
|
|
399
|
-
const r = n, s = e[t.prop], l = e.$index, o = this.findObject(this.columnOption, r);
|
|
400
|
-
c(o) || (c(this.crud.cascaderDIC[l]) && this.$set(this.crud.cascaderDIC, l, {}), this.crud.cascaderIndexList.includes(l) && i.forEach((m) => {
|
|
401
|
-
this.$set(this.crud.cascaderDIC[l], m.prop, []), i.forEach((u) => e[u] = "");
|
|
402
|
-
}), !(c(i) || c(s) || c(o)) && V({
|
|
403
|
-
column: o,
|
|
404
|
-
value: s,
|
|
405
|
-
form: e
|
|
406
|
-
}).then((m) => {
|
|
407
|
-
const u = m || [];
|
|
408
|
-
this.crud.cascaderIndexList.includes(l) || this.crud.cascaderIndexList.push(l), this.crud.cascaderDicList[l] || this.$set(this.crud.cascaderDicList, l, {}), this.crud.cascaderDicList[l][r] || this.$set(this.crud.cascaderDicList[l], r, u), this.$set(this.crud.cascaderDIC[l], r, u), !c(u[o.cascaderIndex]) && !c(u) && !c(o.cascaderIndex) && (e[r] = u[o.cascaderIndex][(o.props || {}).value || b.value]);
|
|
409
|
-
}));
|
|
410
|
-
});
|
|
411
|
-
});
|
|
412
|
-
},
|
|
413
|
-
handleDetail(t, e) {
|
|
414
|
-
const i = e.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[e.prop] : this.crud.DIC[e.prop], n = w(t, e, this.crud.tableOption, i);
|
|
415
|
-
return !c(i) && this.crud.tableOption.filterDic !== !0 && (t[`$${e.prop}`] = n), n;
|
|
416
|
-
},
|
|
417
|
-
corArray(t, e) {
|
|
418
|
-
let i = this.handleDetail(t, e);
|
|
419
|
-
return Array.isArray(i) || (i = c(i) ? [] : i.split(P)), a(i);
|
|
420
|
-
},
|
|
421
|
-
openImg(t, e, i) {
|
|
422
|
-
let n = this.getImgList(t, e);
|
|
423
|
-
n = n.map((r) => ({ thumbUrl: r, url: r, type: e.fileType })), this.$ImagePreview(n, i);
|
|
424
|
-
},
|
|
425
|
-
getImgList(t, e) {
|
|
426
|
-
var s, l;
|
|
427
|
-
const i = ((s = e.propsHttp) == null ? void 0 : s.home) || "", n = ((l = e.props) == null ? void 0 : l.value) || b.value, r = this.corArray(t, e);
|
|
428
|
-
return r.forEach((o, m) => {
|
|
429
|
-
r[m] = i + (o[n] ? o[n] : o);
|
|
430
|
-
}), r;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
var Q = function() {
|
|
435
|
-
var e = this, i = e._self._c;
|
|
436
|
-
return e.getColumnProp(e.column, "hide") ? i("ElTableColumn", { key: e.column.prop, attrs: { prop: e.column.prop, label: e.column.label, "column-key": e.column.prop, "filter-placement": "bottom-end", filters: e.getColumnProp(e.column, "filters"), "filter-method": e.getColumnProp(e.column, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.column.filterMultiple, !0), "show-overflow-tooltip": e.column.overHidden, "min-width": e.column.minWidth, sortable: e.getColumnProp(e.column, "sortable"), "sort-method": e.column.sortMethod, "sort-orders": e.column.sortOrders, "sort-by": e.column.sortBy, resizable: e.column.resizable, "render-header": e.column.renderHeader, align: e.column.align || e.crud.tableOption.align, "header-align": e.column.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.column, "width"), fixed: e.getColumnProp(e.column, "fixed") }, scopedSlots: e._u([{ key: "header", fn: function({ $index: n }) {
|
|
437
|
-
return [e.crud.getSlotName(e.column, "H", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "H"), null, null, { column: e.column, $index: n }) : i("span", [e._v(e._s(e.column.label))])];
|
|
438
|
-
} }, { key: "default", fn: function({ row: n, $index: r }) {
|
|
439
|
-
return [n.$cellEdit && e.column.cell ? i("ElFormItem", { attrs: { prop: e.crud.isTree ? "" : `list.${r}.${e.column.prop}`, label: e.vaildLabel(e.column, n, " "), "label-width": e.vaildLabel(e.column, n, "1px"), rules: e.column.rules } }, [i("ElTooltip", { attrs: { content: (e.crud.listError[`list.${r}.${e.column.prop}`] || {}).msg, disabled: !(e.crud.listError[`list.${r}.${e.column.prop}`] || {}).valid, placement: "top" } }, [e.crud.getSlotName(e.column, "F", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "F"), null, null, {
|
|
440
|
-
row: n,
|
|
441
|
-
dic: e.crud.DIC[e.column.prop],
|
|
442
|
-
size: e.crud.isMediumSize,
|
|
443
|
-
index: r,
|
|
444
|
-
disabled: e.crud.btnDisabledList[r],
|
|
445
|
-
label: e.handleDetail(n, e.column),
|
|
446
|
-
$cell: n.$cellEdit
|
|
447
|
-
}) : i("FormTemp", e._b({ attrs: { column: e.column, size: e.crud.isMediumSize, "table-data": { index: r, row: n, label: e.handleDetail(n, e.column) }, dic: (e.crud.cascaderDIC[r] || {})[e.column.prop] || e.crud.DIC[e.column.prop], props: e.column.props || e.crud.tableOption.props, readonly: e.column.readonly, disabled: e.crud.disabled || e.crud.tableOption.disabled || e.column.disabled || e.crud.btnDisabledList[r], clearable: e.optVal(e.column.clearable, !1), "column-slot": e.crud.mainSlot }, on: { change: function(s) {
|
|
448
|
-
return e.columnChange(n, e.column, r);
|
|
449
|
-
} }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(s) {
|
|
450
|
-
return { key: s, fn: function(l) {
|
|
451
|
-
return [e._t(s, null, null, l)];
|
|
452
|
-
} };
|
|
453
|
-
})], null, !0), model: { value: n[e.column.prop], callback: function(s) {
|
|
454
|
-
e.$set(n, e.column.prop, s);
|
|
455
|
-
}, expression: "row[column.prop]" } }, "FormTemp", e.uploadFun(e.column, e.crud), !1))], 2)], 1) : e.crud.$scopedSlots[e.column.prop] ? e._t(e.column.prop, null, { row: n, index: r, dic: e.crud.DIC[e.column.prop], size: e.crud.isMediumSize, label: e.handleDetail(n, e.column) }) : [["img", "upload"].includes(e.column.type) ? i("span", { staticClass: "avue-crud__img" }, [e._l(e.getImgList(n, e.column), function(s, l) {
|
|
456
|
-
return [e.isMediaType(s, e.column.fileType) ? i(e.isMediaType(s, e.column.fileType), { key: l, tag: "Component", attrs: { src: s }, on: { click: function(o) {
|
|
457
|
-
return o.stopPropagation(), e.openImg(n, e.column, l);
|
|
458
|
-
} } }) : i("i", { key: l, staticClass: "el-icon-document", attrs: { src: s }, on: { click: function(o) {
|
|
459
|
-
return o.stopPropagation(), e.openImg(n, e.column, l);
|
|
460
|
-
} } })];
|
|
461
|
-
})], 2) : e.column.type === "url" ? i("span", e._l(e.corArray(n, e.column), function(s, l) {
|
|
462
|
-
return i("ElLink", { key: l, attrs: { type: "primary", href: s, target: e.column.target || "_blank" } }, [e._v(e._s(s))]);
|
|
463
|
-
}), 1) : e.column.type === "rate" ? i("span", [i("FyRate", { attrs: { disabled: "" }, model: { value: n[e.column.prop], callback: function(s) {
|
|
464
|
-
e.$set(n, e.column.prop, s);
|
|
465
|
-
}, expression: "row[column.prop]" } })], 1) : e.column.type === "color" ? i("i", { staticClass: "avue-crud__color", style: { backgroundColor: n[e.column.prop] } }) : e.column.type === "icon" ? i("IconTemp", { attrs: { text: n[e.column.prop] } }) : e.column.html ? i("span", { domProps: { innerHTML: e._s(e.handleDetail(n, e.column)) } }) : i("span", { domProps: { textContent: e._s(e.handleDetail(n, e.column)) } })]];
|
|
466
|
-
} }], null, !0) }) : e._e();
|
|
467
|
-
}, Y = [], Z = /* @__PURE__ */ f(
|
|
468
|
-
J,
|
|
469
|
-
Q,
|
|
470
|
-
Y,
|
|
471
|
-
!1,
|
|
472
|
-
null,
|
|
473
|
-
null
|
|
474
|
-
);
|
|
475
|
-
const S = Z.exports, ee = {
|
|
476
|
-
name: "ColumnDynamic",
|
|
477
|
-
components: { ColumnSlot: S },
|
|
478
|
-
inject: ["dynamic", "crud"],
|
|
479
|
-
props: {
|
|
480
|
-
columnOption: Object
|
|
481
|
-
},
|
|
482
|
-
created() {
|
|
483
|
-
const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
|
|
484
|
-
Object.keys(this.dynamic).forEach((e) => {
|
|
485
|
-
t.includes(e) && (this[e] = this.dynamic[e]);
|
|
486
|
-
});
|
|
487
|
-
},
|
|
488
|
-
methods: {
|
|
489
|
-
optVal: h
|
|
490
|
-
}
|
|
491
|
-
};
|
|
492
|
-
var te = function() {
|
|
493
|
-
var e = this, i = e._self._c;
|
|
494
|
-
return e.getColumnProp(e.columnOption, "hide") ? i("ElTableColumn", { key: e.columnOption.prop, attrs: { prop: e.columnOption.prop, label: e.columnOption.label, "filter-placement": "bottom-end", filters: e.getColumnProp(e.columnOption, "filters"), "filter-method": e.getColumnProp(e.columnOption, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.columnOption.filterMultiple, !0), "show-overflow-tooltip": e.columnOption.overHidden, "min-width": e.columnOption.minWidth, sortable: e.getColumnProp(e.columnOption, "sortable"), "render-header": e.columnOption.renderHeader, align: e.columnOption.align || e.crud.tableOption.align, "header-align": e.columnOption.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.columnOption, "width"), fixed: e.getColumnProp(e.columnOption, "fixed") } }, [e._l(e.columnOption.children, function(n) {
|
|
495
|
-
return [n.children && n.children.length > 0 ? i("ColumnDynamic", { key: n.prop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
496
|
-
return { key: r, fn: function(s) {
|
|
497
|
-
return [e._t(r, null, null, s)];
|
|
498
|
-
} };
|
|
499
|
-
})], null, !0) }) : i("ColumnSlot", { key: n.prop, attrs: { column: n, "column-option": e.columnOption.children }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
500
|
-
return { key: r, fn: function(s) {
|
|
501
|
-
return [e._t(r, null, null, s)];
|
|
502
|
-
} };
|
|
503
|
-
})], null, !0) })];
|
|
504
|
-
})], 2) : e._e();
|
|
505
|
-
}, ie = [], ne = /* @__PURE__ */ f(
|
|
506
|
-
ee,
|
|
507
|
-
te,
|
|
508
|
-
ie,
|
|
509
|
-
!1,
|
|
510
|
-
null,
|
|
511
|
-
null
|
|
512
|
-
);
|
|
513
|
-
const re = ne.exports, se = {
|
|
514
|
-
name: "Column",
|
|
515
|
-
components: { ColumnDynamic: re, ColumnSlot: S },
|
|
516
|
-
inject: ["crud"],
|
|
517
|
-
provide() {
|
|
518
|
-
return {
|
|
519
|
-
crud: this.crud,
|
|
520
|
-
dynamic: this
|
|
521
|
-
};
|
|
522
|
-
},
|
|
523
|
-
props: {
|
|
524
|
-
columnOption: Array
|
|
525
|
-
},
|
|
526
|
-
computed: {
|
|
527
|
-
list() {
|
|
528
|
-
let t = [...this.columnOption];
|
|
529
|
-
return t = T(t, "index", (e, i) => {
|
|
530
|
-
var n, r;
|
|
531
|
-
return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[i.prop]) == null ? void 0 : r.index);
|
|
532
|
-
}), t;
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
methods: {
|
|
536
|
-
// 表格筛选逻辑
|
|
537
|
-
handleFilterMethod(t, e, i) {
|
|
538
|
-
const n = this.columnOption.filter((r) => r.prop === i.property)[0];
|
|
539
|
-
return typeof n.filterMethod == "function" ? n.filterMethod(t, e, n) : e[n.prop] === t;
|
|
540
|
-
},
|
|
541
|
-
// 表格筛选字典
|
|
542
|
-
handleFilters(t, e) {
|
|
543
|
-
if (e !== !0) return;
|
|
544
|
-
const i = this.crud.DIC[t.prop] || [], n = [];
|
|
545
|
-
return c(i) ? this.crud.cellForm.list.forEach((r) => {
|
|
546
|
-
n.map((s) => s.text).includes(r[t.prop]) || n.push({
|
|
547
|
-
text: r[t.prop],
|
|
548
|
-
value: r[t.prop]
|
|
549
|
-
});
|
|
550
|
-
}) : i.forEach((r) => {
|
|
551
|
-
const s = t.props || this.crud.tableOption.props || {};
|
|
552
|
-
n.push({
|
|
553
|
-
text: r[s.label || b.label],
|
|
554
|
-
value: r[s.value || b.value]
|
|
555
|
-
});
|
|
556
|
-
}), n;
|
|
557
|
-
},
|
|
558
|
-
getColumnProp(t, e) {
|
|
559
|
-
const i = this.crud.objectOption[t.prop] || {};
|
|
560
|
-
if (e === "filterMethod") return i == null ? void 0 : i.filters;
|
|
561
|
-
if (this.crud.isMobile && ["fixed"].includes(e)) return !1;
|
|
562
|
-
const n = i == null ? void 0 : i[e];
|
|
563
|
-
if (!(e === "width" && n === 0))
|
|
564
|
-
return e === "filters" ? this.handleFilters(t, n) : e === "hide" ? (i == null ? void 0 : i.hide) !== !0 : n;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
var le = function() {
|
|
569
|
-
var e = this, i = e._self._c;
|
|
570
|
-
return i("div", [e._t("header"), e._l(e.list, function(n) {
|
|
571
|
-
return [n.children && n.children.length > 0 ? i("ColumnDynamic", { key: n.pop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
572
|
-
return { key: r, fn: function(s) {
|
|
573
|
-
return [e._t(r, null, null, s)];
|
|
574
|
-
} };
|
|
575
|
-
})], null, !0) }) : i("ColumnSlot", { key: n.prop, attrs: { column: n, "column-option": e.columnOption }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
576
|
-
return { key: r, fn: function(s) {
|
|
577
|
-
return [e._t(r, null, null, s)];
|
|
578
|
-
} };
|
|
579
|
-
})], null, !0) })];
|
|
580
|
-
}), e._t("footer")], 2);
|
|
581
|
-
}, oe = [], ae = /* @__PURE__ */ f(
|
|
582
|
-
se,
|
|
583
|
-
le,
|
|
584
|
-
oe,
|
|
585
|
-
!1,
|
|
586
|
-
null,
|
|
587
|
-
null
|
|
588
|
-
);
|
|
589
|
-
const ce = ae.exports, ue = {
|
|
590
|
-
name: "ColumnDefault",
|
|
591
|
-
inject: ["crud"],
|
|
592
|
-
data() {
|
|
593
|
-
return {
|
|
594
|
-
config: p
|
|
389
|
+
data: [],
|
|
390
|
+
columnBox: !1
|
|
595
391
|
};
|
|
596
392
|
},
|
|
597
|
-
|
|
598
|
-
|
|
393
|
+
computed: {
|
|
394
|
+
defaultColumn() {
|
|
395
|
+
return [
|
|
396
|
+
{
|
|
397
|
+
label: "隐藏",
|
|
398
|
+
prop: "hide"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
label: "冻结",
|
|
402
|
+
prop: "fixed"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
label: "过滤",
|
|
406
|
+
prop: "filters"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
label: "排序",
|
|
410
|
+
prop: "sortable"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
label: "序号",
|
|
414
|
+
prop: "index",
|
|
415
|
+
hide: !0
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
label: "宽度",
|
|
419
|
+
prop: "width",
|
|
420
|
+
hide: !0
|
|
421
|
+
}
|
|
422
|
+
];
|
|
423
|
+
}
|
|
599
424
|
},
|
|
600
425
|
methods: {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
426
|
+
handleShow() {
|
|
427
|
+
this.data = [], this.crud.propOption.forEach((t) => {
|
|
428
|
+
t.showColumn !== !1 && this.data.push(t);
|
|
429
|
+
}), this.columnBox = !0, this.$nextTick(() => this.rowDrop());
|
|
604
430
|
},
|
|
605
|
-
|
|
606
|
-
|
|
431
|
+
handleChange(t) {
|
|
432
|
+
["hide", "filters"].includes(t) && this.crud.refreshTable();
|
|
607
433
|
},
|
|
608
434
|
rowDrop() {
|
|
609
|
-
const t = this
|
|
610
|
-
this.crud.tableDrop("
|
|
611
|
-
const i = e.oldIndex, n = e.newIndex
|
|
612
|
-
this.crud.
|
|
613
|
-
});
|
|
614
|
-
},
|
|
615
|
-
columnDrop() {
|
|
616
|
-
const t = this.crud.$refs.table.$el.querySelector(this.config.dropColClass);
|
|
617
|
-
let e = 0;
|
|
618
|
-
["selection", "index", "expand"].forEach((i) => {
|
|
619
|
-
this.crud.tableOption[i] && (e += 1);
|
|
620
|
-
}), this.crud.tableDrop("column", t, (i) => {
|
|
621
|
-
this.crud.headerSort(i.oldIndex - e, i.newIndex - e), this.columnDrop();
|
|
435
|
+
const t = this.$refs.table.$el.querySelectorAll(h.dropRowClass)[0];
|
|
436
|
+
this.crud.tableDrop("column", t, (e) => {
|
|
437
|
+
const i = e.oldIndex, n = e.newIndex;
|
|
438
|
+
this.crud.headerSort(i, n), this.crud.refreshTable(() => this.rowDrop());
|
|
622
439
|
});
|
|
623
440
|
}
|
|
624
441
|
}
|
|
625
442
|
};
|
|
626
|
-
var
|
|
443
|
+
var Pe = function() {
|
|
627
444
|
var e = this, i = e._self._c;
|
|
628
|
-
return i("div", [i(
|
|
629
|
-
|
|
630
|
-
} }
|
|
631
|
-
},
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
445
|
+
return e.columnBox ? i("div", [i(I, { staticClass: "avue-crud__dialog avue-crud__column avue-dialog", attrs: { "lock-scroll": "", "append-to-body": "", title: "列显隐", size: e.crud.isMobile ? "100%" : "40%", visible: e.columnBox }, on: { "update:visible": function(n) {
|
|
446
|
+
e.columnBox = n;
|
|
447
|
+
} } }, [i(M, { ref: "table", attrs: { data: e.data, height: "100%", size: "small", border: "" } }, [i(_, { key: "label", attrs: { align: "center", width: "100", "header-align": "center", prop: "label", label: "列名" } }), e._l(e.defaultColumn, function(n, r) {
|
|
448
|
+
return [n.hide !== !0 ? i(_, { key: r, attrs: { label: n.label, prop: n.prop, align: "center", "header-align": "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
|
|
449
|
+
return [i(ie, { on: { change: function(o) {
|
|
450
|
+
return e.handleChange(n.prop);
|
|
451
|
+
} }, model: { value: e.crud.objectOption[s.prop][n.prop], callback: function(o) {
|
|
452
|
+
e.$set(e.crud.objectOption[s.prop], n.prop, o);
|
|
453
|
+
}, expression: "crud.objectOption[row.prop][item.prop]" } })];
|
|
454
|
+
} }], null, !0) }) : e._e()];
|
|
455
|
+
})], 2)], 1)], 1) : e._e();
|
|
456
|
+
}, De = [], ze = /* @__PURE__ */ g(
|
|
457
|
+
Ie,
|
|
458
|
+
Pe,
|
|
459
|
+
De,
|
|
635
460
|
!1,
|
|
636
461
|
null,
|
|
637
462
|
null
|
|
638
463
|
);
|
|
639
|
-
const
|
|
640
|
-
name: "
|
|
641
|
-
directives: {
|
|
642
|
-
permission: x
|
|
643
|
-
},
|
|
464
|
+
const R = ze.exports, Me = {
|
|
465
|
+
name: "FyDialogForm",
|
|
644
466
|
inject: ["crud"],
|
|
645
467
|
data() {
|
|
646
468
|
return {
|
|
647
|
-
|
|
469
|
+
disabled: !1,
|
|
470
|
+
boxType: "",
|
|
471
|
+
fullscreen: !1,
|
|
472
|
+
size: null,
|
|
473
|
+
boxVisible: !1
|
|
648
474
|
};
|
|
649
475
|
},
|
|
650
476
|
computed: {
|
|
651
|
-
|
|
652
|
-
|
|
477
|
+
option() {
|
|
478
|
+
const t = c(this.crud.tableOption);
|
|
479
|
+
return t.boxType = this.boxType, t.column = c(this.crud.propOption), t.menuBtn = !1, this.isAdd ? (t.submitBtn = t.saveBtn, t.submitText = this.crud.menuIcon("saveBtn"), t.submitIcon = this.crud.getBtnIcon("saveBtn")) : this.isEdit ? (t.submitBtn = t.updateBtn, t.submitText = this.crud.menuIcon("updateBtn"), t.submitIcon = this.crud.getBtnIcon("updateBtn")) : this.isView && (t.detail = !0), t.emptyBtn = t.cancelBtn, t.emptyText = this.crud.menuIcon("cancelBtn"), t.emptyIcon = this.crud.getBtnIcon("cancelBtn"), this.crud.isGroup || (t.dicFlag = !1, t.dicData = this.crud.DIC), u(t.dicFlag) || t.column.forEach((e) => {
|
|
480
|
+
e.boxType = this.boxType, e.dicFlag = e.dicFlag || t.dicFlag;
|
|
481
|
+
}), t;
|
|
653
482
|
},
|
|
654
|
-
|
|
655
|
-
return this.
|
|
483
|
+
isView() {
|
|
484
|
+
return this.boxType === "view";
|
|
656
485
|
},
|
|
657
|
-
|
|
658
|
-
return this.
|
|
486
|
+
isAdd() {
|
|
487
|
+
return this.boxType === "add";
|
|
659
488
|
},
|
|
660
|
-
|
|
661
|
-
return this.
|
|
489
|
+
isEdit() {
|
|
490
|
+
return this.boxType === "edit";
|
|
491
|
+
},
|
|
492
|
+
direction() {
|
|
493
|
+
return this.crud.tableOption.dialogDirection;
|
|
494
|
+
},
|
|
495
|
+
width() {
|
|
496
|
+
return m(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${h.dialogWidth}`);
|
|
497
|
+
},
|
|
498
|
+
dialogType() {
|
|
499
|
+
return this.isDrawer ? "ElDrawer" : "ElementDialog";
|
|
500
|
+
},
|
|
501
|
+
dialogTop() {
|
|
502
|
+
return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
|
|
503
|
+
},
|
|
504
|
+
isDrawer() {
|
|
505
|
+
return this.crud.tableOption.dialogType === "drawer";
|
|
506
|
+
},
|
|
507
|
+
params() {
|
|
508
|
+
return this.isDrawer ? {
|
|
509
|
+
size: this.fullscreen ? "100%" : this.width,
|
|
510
|
+
direction: this.crud.tableOption.dialogDirection
|
|
511
|
+
} : {
|
|
512
|
+
width: this.width,
|
|
513
|
+
fullscreen: this.fullscreen
|
|
514
|
+
};
|
|
515
|
+
},
|
|
516
|
+
dialogTitle() {
|
|
517
|
+
const t = `${this.boxType}`;
|
|
518
|
+
if (!u(this.boxType)) {
|
|
519
|
+
const e = {
|
|
520
|
+
tipStartTitle: "当前表格已选择",
|
|
521
|
+
tipEndTitle: "项",
|
|
522
|
+
editTitle: "编 辑",
|
|
523
|
+
copyTitle: "复 制",
|
|
524
|
+
addTitle: "新 增",
|
|
525
|
+
viewTitle: "查 看",
|
|
526
|
+
filterTitle: "过滤条件",
|
|
527
|
+
showTitle: "列显隐"
|
|
528
|
+
};
|
|
529
|
+
return this.crud.tableOption[`${t}Title`] || e[`${t}Title`];
|
|
530
|
+
}
|
|
531
|
+
return "";
|
|
532
|
+
},
|
|
533
|
+
dialogMenuPosition() {
|
|
534
|
+
return this.crud.option.dialogMenuPosition || "right";
|
|
662
535
|
}
|
|
663
536
|
},
|
|
664
537
|
methods: {
|
|
665
|
-
optVal:
|
|
666
|
-
|
|
667
|
-
|
|
538
|
+
optVal: m,
|
|
539
|
+
uploadFun: P,
|
|
540
|
+
submit() {
|
|
541
|
+
this.$refs.tableForm.submit();
|
|
542
|
+
},
|
|
543
|
+
reset() {
|
|
544
|
+
this.$refs.tableForm.resetForm(!1);
|
|
545
|
+
},
|
|
546
|
+
getSlotName(t) {
|
|
547
|
+
return t.replace("Form", "");
|
|
548
|
+
},
|
|
549
|
+
initFun() {
|
|
550
|
+
["clearValidate", "validate", "resetForm", "validateField"].forEach((t) => {
|
|
551
|
+
this.crud[t] = this.$refs.tableForm[t];
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
handleChange() {
|
|
555
|
+
this.crud.setVal();
|
|
556
|
+
},
|
|
557
|
+
handleTabClick(t, e) {
|
|
558
|
+
this.crud.$emit("tab-click", t, e);
|
|
559
|
+
},
|
|
560
|
+
handleFullScreen() {
|
|
561
|
+
this.isDrawer && (u(this.size) ? this.size = "100%" : this.size = ""), this.fullscreen = !this.fullscreen;
|
|
562
|
+
},
|
|
563
|
+
handleError(t) {
|
|
564
|
+
this.crud.$emit("error", t);
|
|
565
|
+
},
|
|
566
|
+
handleSubmit(t, e) {
|
|
567
|
+
this.isAdd ? this.rowSave(e) : this.isEdit && this.rowUpdate(e);
|
|
568
|
+
},
|
|
569
|
+
// 保存
|
|
570
|
+
rowSave(t) {
|
|
571
|
+
this.crud.$emit("row-save", S(this.crud.tableForm, ["$"]), this.closeDialog, t);
|
|
572
|
+
},
|
|
573
|
+
// 更新
|
|
574
|
+
rowUpdate(t) {
|
|
575
|
+
this.crud.$emit("row-update", S(this.crud.tableForm, ["$"]), this.crud.tableIndex, this.closeDialog, t);
|
|
576
|
+
},
|
|
577
|
+
closeDialog(t) {
|
|
578
|
+
t = c(t), t && (() => {
|
|
579
|
+
if (this.isEdit) {
|
|
580
|
+
const { parentList: i, index: n } = this.crud.findData(t[this.crud.rowKey]);
|
|
581
|
+
if (i) {
|
|
582
|
+
const r = i.splice(n, 1)[0];
|
|
583
|
+
t[this.crud.childrenKey] = r[this.crud.childrenKey], i.splice(n, 0, t);
|
|
584
|
+
}
|
|
585
|
+
} else if (this.isAdd) {
|
|
586
|
+
const { item: i } = this.crud.findData(t[this.crud.rowParentKey]);
|
|
587
|
+
i ? (i[this.crud.childrenKey] || this.$set(i, this.crud.childrenKey, []), this.crud.tableOption.lazy && this.$set(i, this.crud.hasChildrenKey, !0), i[this.crud.childrenKey].push(t)) : this.crud.list.push(t);
|
|
588
|
+
}
|
|
589
|
+
})(), this.hide();
|
|
590
|
+
},
|
|
591
|
+
// 隐藏表单
|
|
592
|
+
hide(t) {
|
|
593
|
+
const e = () => {
|
|
594
|
+
t == null || t(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
|
|
595
|
+
};
|
|
596
|
+
typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(e, this.boxType) : e();
|
|
597
|
+
},
|
|
598
|
+
// 显示表单
|
|
599
|
+
show(t) {
|
|
600
|
+
this.boxType = t;
|
|
601
|
+
const e = () => {
|
|
602
|
+
this.fullscreen = this.crud.tableOption.dialogFullscreen, this.boxVisible = !0, this.$nextTick(() => {
|
|
603
|
+
this.initFun();
|
|
604
|
+
});
|
|
605
|
+
};
|
|
606
|
+
typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(e, this.boxType) : e();
|
|
668
607
|
}
|
|
669
608
|
}
|
|
670
609
|
};
|
|
671
|
-
var
|
|
610
|
+
var Te = function() {
|
|
672
611
|
var e = this, i = e._self._c;
|
|
673
|
-
return e.
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("saveBtn")) + " ")]], 2) : e._e(), n.$cellEdit ? i("ElButton", { attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("cancelBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
|
|
689
|
-
return s.stopPropagation(), e.crud.rowCancel(n, r);
|
|
690
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("cancelBtn")) + " ")]], 2) : e._e()] : e._e(), e.optVal(e.crud.tableOption.viewBtn, e.config.viewBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("viewBtn", n, r), expression: "crud.getPermission('viewBtn', row, $index)" }], attrs: { type: e.menuText("success"), icon: e.crud.getBtnIcon("viewBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
691
|
-
return s.stopPropagation(), e.crud.rowView(n, r);
|
|
692
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("viewBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) && !e.crud.tableOption.cellBtn ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("editBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
693
|
-
return s.stopPropagation(), e.crud.rowEdit(n, r);
|
|
694
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.copyBtn, e.config.copyBtn) ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("copyBtn", n, r), expression: "crud.getPermission('copyBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("copyBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
695
|
-
return s.stopPropagation(), e.crud.rowCopy(n);
|
|
696
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("copyBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.delBtn, e.config.delBtn) && !n.$cellEdit ? i("ElButton", { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("delBtn", n, r), expression: "crud.getPermission('delBtn', row, $index)" }], attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("delBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
697
|
-
return s.stopPropagation(), e.crud.rowDel(n, r);
|
|
698
|
-
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("delBtn")) + " ")]], 2) : e._e()] : e._e(), e._t("menu", null, { row: n, type: e.menuText("primary"), disabled: e.crud.btnDisabled, size: e.crud.isMediumSize, index: r })];
|
|
699
|
-
} }], null, !0) }) : e._e();
|
|
700
|
-
}, ge = [], _e = /* @__PURE__ */ f(
|
|
701
|
-
fe,
|
|
702
|
-
be,
|
|
703
|
-
ge,
|
|
612
|
+
return e.boxVisible ? i(e.dialogType, e._b({ tag: "Component", staticClass: "dialog-form", attrs: { "lock-scroll": "", "show-full-screen": "", "destroy-on-close": e.crud.tableOption.dialogDestroy, "wrapper-closable": e.crud.tableOption.dialogClickModal, direction: e.direction, "custom-class": e.crud.tableOption.dialogCustomClass, "modal-append-to-body": "", "append-to-body": "", top: e.dialogTop, title: e.dialogTitle, "close-on-press-escape": e.crud.tableOption.dialogEscape, "close-on-click-modal": e.optVal(e.crud.tableOption.dialogClickModal, !1), modal: e.crud.tableOption.dialogModal, "show-close": e.crud.tableOption.dialogCloseBtn, visible: e.boxVisible, "before-close": e.hide }, on: { "update:visible": function(n) {
|
|
613
|
+
e.boxVisible = n;
|
|
614
|
+
} } }, "Component", e.params, !1), [i(O, e._b({ ref: "tableForm", attrs: { status: e.disabled, option: e.option }, on: { "update:status": function(n) {
|
|
615
|
+
e.disabled = n;
|
|
616
|
+
}, change: e.handleChange, submit: e.handleSubmit, "reset-change": e.hide, "tab-click": e.handleTabClick, error: e.handleError }, scopedSlots: e._u([e._l(e.crud.formSlot, function(n) {
|
|
617
|
+
return { key: e.getSlotName(n), fn: function(r) {
|
|
618
|
+
return [e._t(n, null, null, Object.assign(r, { type: e.boxType }))];
|
|
619
|
+
} };
|
|
620
|
+
})], null, !0), model: { value: e.crud.tableForm, callback: function(n) {
|
|
621
|
+
e.$set(e.crud, "tableForm", n);
|
|
622
|
+
}, expression: "crud.tableForm" } }, "FyForm", e.uploadFun({}, e.crud), !1)), i("span", { staticClass: "avue-dialog__footer", class: `avue-dialog__footer--${e.dialogMenuPosition}` }, [e.optVal(e.option.submitBtn, !0) && !e.isView ? i(l, { attrs: { loading: e.disabled, size: e.crud.controlSize, icon: e.option.submitIcon, type: "primary" }, on: { click: e.submit } }, [e._v(" " + e._s(e.option.submitText) + " ")]) : e._e(), e.optVal(e.option.emptyBtn, !0) && !e.isView ? i(l, { attrs: { disabled: e.disabled, size: e.crud.controlSize, icon: e.option.emptyIcon }, on: { click: e.reset } }, [e._v(" " + e._s(e.option.emptyText) + " ")]) : e._e(), e._t("menuForm", null, { disabled: e.disabled, size: e.crud.controlSize, type: e.boxType })], 2)], 1) : e._e();
|
|
623
|
+
}, Ee = [], Le = /* @__PURE__ */ g(
|
|
624
|
+
Me,
|
|
625
|
+
Te,
|
|
626
|
+
Ee,
|
|
704
627
|
!1,
|
|
705
628
|
null,
|
|
706
629
|
null
|
|
707
630
|
);
|
|
708
|
-
const
|
|
631
|
+
const A = Le.exports, Ve = {
|
|
709
632
|
name: "TablePage",
|
|
710
633
|
inject: ["crud"],
|
|
711
634
|
data() {
|
|
@@ -751,7 +674,7 @@ const ve = _e.exports, ye = {
|
|
|
751
674
|
this.crud.isMobile && (this.defaultPage.layout = "total, sizes, prev, pager, next"), this.pageInit(), this.crud.$emit("on-load", this.defaultPage);
|
|
752
675
|
},
|
|
753
676
|
methods: {
|
|
754
|
-
optVal:
|
|
677
|
+
optVal: m,
|
|
755
678
|
pageInit() {
|
|
756
679
|
this.defaultPage = Object.assign(this.defaultPage, this.crud.page), this.updateValue();
|
|
757
680
|
},
|
|
@@ -766,574 +689,675 @@ const ve = _e.exports, ye = {
|
|
|
766
689
|
prevClick(t) {
|
|
767
690
|
this.crud.$emit("prev-click", t);
|
|
768
691
|
},
|
|
769
|
-
// 页大小回调
|
|
770
|
-
sizeChange(t) {
|
|
771
|
-
this.defaultPage.currentPage = 1, this.defaultPage.pageSize = t, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", t);
|
|
692
|
+
// 页大小回调
|
|
693
|
+
sizeChange(t) {
|
|
694
|
+
this.defaultPage.currentPage = 1, this.defaultPage.pageSize = t, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", t);
|
|
695
|
+
},
|
|
696
|
+
// 页码回调
|
|
697
|
+
currentChange(t) {
|
|
698
|
+
this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("current-change", t);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
var Re = function() {
|
|
703
|
+
var e = this, i = e._self._c;
|
|
704
|
+
return e.pageFlag && e.optVal(e.crud.tableOption.page, !0) ? i(T, { staticClass: "avue-pagination", attrs: { shadow: e.crud.isCard } }, [e._t("page"), i(ne, { staticStyle: { "margin-top": "25px" }, attrs: { small: e.crud.size === "mini", disabled: e.defaultPage.disabled, "hide-on-single-page": e.defaultPage.single, "pager-count": e.defaultPage.pagerCount, "current-page": e.defaultPage.currentPage, background: e.defaultPage.background, "page-size": e.defaultPage.pageSize, "page-sizes": e.defaultPage.pageSizes, layout: e.defaultPage.layout, total: e.defaultPage.total }, on: { "update:currentPage": function(n) {
|
|
705
|
+
return e.$set(e.defaultPage, "currentPage", n);
|
|
706
|
+
}, "update:current-page": function(n) {
|
|
707
|
+
return e.$set(e.defaultPage, "currentPage", n);
|
|
708
|
+
}, "size-change": e.sizeChange, "prev-click": e.prevClick, "next-click": e.nextClick, "current-change": e.currentChange } })], 2) : e._e();
|
|
709
|
+
}, Ae = [], He = /* @__PURE__ */ g(
|
|
710
|
+
Ve,
|
|
711
|
+
Re,
|
|
712
|
+
Ae,
|
|
713
|
+
!1,
|
|
714
|
+
null,
|
|
715
|
+
null
|
|
716
|
+
);
|
|
717
|
+
const H = He.exports, Ne = {
|
|
718
|
+
name: "ColumnMenu",
|
|
719
|
+
directives: {
|
|
720
|
+
permission: B
|
|
721
|
+
},
|
|
722
|
+
inject: ["crud"],
|
|
723
|
+
data() {
|
|
724
|
+
return {
|
|
725
|
+
config: h
|
|
726
|
+
};
|
|
727
|
+
},
|
|
728
|
+
computed: {
|
|
729
|
+
menuType() {
|
|
730
|
+
return this.crud.tableOption.menuType || this.$AVUE.menuType || "button";
|
|
731
|
+
},
|
|
732
|
+
isIconMenu() {
|
|
733
|
+
return this.menuType === "icon";
|
|
772
734
|
},
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
735
|
+
isTextMenu() {
|
|
736
|
+
return this.menuType === "text";
|
|
737
|
+
},
|
|
738
|
+
isMenu() {
|
|
739
|
+
return this.menuType === "menu";
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
methods: {
|
|
743
|
+
optVal: m,
|
|
744
|
+
menuText(t) {
|
|
745
|
+
return ["text", "menu"].includes(this.menuType) ? "text" : t;
|
|
776
746
|
}
|
|
777
747
|
}
|
|
778
748
|
};
|
|
779
|
-
var
|
|
749
|
+
var je = function() {
|
|
780
750
|
var e = this, i = e._self._c;
|
|
781
|
-
return e.
|
|
782
|
-
return e
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
751
|
+
return e.optVal(e.crud.tableOption.menu, e.config.menu) && e.crud.getPermission("menu") ? i(_, { key: "menu", staticClass: "avue-crud__btn", attrs: { prop: "menu", fixed: e.optVal(e.crud.tableOption.menuFixed, e.config.menuFixed), label: e.crud.tableOption.menuTitle || "操作", align: e.crud.tableOption.menuAlign || e.config.menuAlign, "header-align": e.crud.tableOption.menuHeaderAlign || e.config.menuHeaderAlign, width: e.crud.isMobile ? e.crud.tableOption.menuXsWidth || e.config.menuXsWidth : e.crud.tableOption.menuWidth || e.config.menuWidth }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: r }) {
|
|
752
|
+
return [e.isMenu ? i(se, { attrs: { size: e.crud.isMediumSize }, scopedSlots: e._u([{ key: "dropdown", fn: function() {
|
|
753
|
+
return [i(re, [e.optVal(e.crud.tableOption.viewBtn, e.config.viewBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("viewBtn", n, r), expression: "crud.getPermission('viewBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("viewBtn") }, nativeOn: { click: function(s) {
|
|
754
|
+
return e.crud.rowView(n, r);
|
|
755
|
+
} } }, [e._v(" " + e._s(e.crud.menuIcon("viewBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("editBtn") }, nativeOn: { click: function(s) {
|
|
756
|
+
return e.crud.rowEdit(n, r);
|
|
757
|
+
} } }, [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.copyBtn, e.config.copyBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("copyBtn", n, r), expression: "crud.getPermission('copyBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("copyBtn") }, nativeOn: { click: function(s) {
|
|
758
|
+
return e.crud.rowCopy(n);
|
|
759
|
+
} } }, [e._v(" " + e._s(e.crud.menuIcon("copyBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.delBtn, e.config.delBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("delBtn", n, r), expression: "crud.getPermission('delBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("delBtn") }, nativeOn: { click: function(s) {
|
|
760
|
+
return e.crud.rowDel(n, r);
|
|
761
|
+
} } }, [e._v(" " + e._s(e.crud.menuIcon("delBtn")) + " ")]) : e._e(), e._t("menuBtn", null, { row: n, type: e.menuText("primary"), disabled: e.crud.btnDisabled, size: e.crud.isMediumSize, index: r })], 2)];
|
|
762
|
+
}, proxy: !0 }], null, !0) }, [i(l, { attrs: { type: "text", size: e.crud.isMediumSize } }, [e._v(" " + e._s(e.crud.tableOption.menuBtnTitle || "按钮") + " "), i("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1) : ["button", "text", "icon"].includes(e.menuType) ? [e.optVal(e.crud.tableOption.cellBtn, e.config.cellBtn) ? [e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) && !n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("editBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
|
|
763
|
+
return s.stopPropagation(), e.crud.rowCell(n, r);
|
|
764
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]], 2) : e.optVal(e.crud.tableOption.saveBtn, e.config.saveBtn) && n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("saveBtn", n, r), expression: "crud.getPermission('saveBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("saveBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
|
|
765
|
+
return s.stopPropagation(), e.crud.rowCell(n, r);
|
|
766
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("saveBtn")) + " ")]], 2) : e._e(), n.$cellEdit ? i(l, { attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("cancelBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
|
|
767
|
+
return s.stopPropagation(), e.crud.rowCancel(n, r);
|
|
768
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("cancelBtn")) + " ")]], 2) : e._e()] : e._e(), e.optVal(e.crud.tableOption.viewBtn, e.config.viewBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("viewBtn", n, r), expression: "crud.getPermission('viewBtn', row, $index)" }], attrs: { type: e.menuText("success"), icon: e.crud.getBtnIcon("viewBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
769
|
+
return s.stopPropagation(), e.crud.rowView(n, r);
|
|
770
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("viewBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) && !e.crud.tableOption.cellBtn ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("editBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
771
|
+
return s.stopPropagation(), e.crud.rowEdit(n, r);
|
|
772
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.copyBtn, e.config.copyBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("copyBtn", n, r), expression: "crud.getPermission('copyBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("copyBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
773
|
+
return s.stopPropagation(), e.crud.rowCopy(n);
|
|
774
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("copyBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.delBtn, e.config.delBtn) && !n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("delBtn", n, r), expression: "crud.getPermission('delBtn', row, $index)" }], attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("delBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
|
|
775
|
+
return s.stopPropagation(), e.crud.rowDel(n, r);
|
|
776
|
+
} } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("delBtn")) + " ")]], 2) : e._e()] : e._e(), e._t("menu", null, { row: n, type: e.menuText("primary"), disabled: e.crud.btnDisabled, size: e.crud.isMediumSize, index: r })];
|
|
777
|
+
} }], null, !0) }) : e._e();
|
|
778
|
+
}, We = [], Ke = /* @__PURE__ */ g(
|
|
779
|
+
Ne,
|
|
780
|
+
je,
|
|
781
|
+
We,
|
|
790
782
|
!1,
|
|
791
783
|
null,
|
|
792
784
|
null
|
|
793
785
|
);
|
|
794
|
-
const
|
|
795
|
-
name: "
|
|
786
|
+
const N = Ke.exports, Ue = {
|
|
787
|
+
name: "ColumnDefault",
|
|
796
788
|
inject: ["crud"],
|
|
797
789
|
data() {
|
|
798
790
|
return {
|
|
799
|
-
|
|
800
|
-
boxType: "",
|
|
801
|
-
fullscreen: !1,
|
|
802
|
-
size: null,
|
|
803
|
-
boxVisible: !1
|
|
791
|
+
config: h
|
|
804
792
|
};
|
|
805
793
|
},
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
isView() {
|
|
814
|
-
return this.boxType === "view";
|
|
815
|
-
},
|
|
816
|
-
isAdd() {
|
|
817
|
-
return this.boxType === "add";
|
|
818
|
-
},
|
|
819
|
-
isEdit() {
|
|
820
|
-
return this.boxType === "edit";
|
|
821
|
-
},
|
|
822
|
-
direction() {
|
|
823
|
-
return this.crud.tableOption.dialogDirection;
|
|
824
|
-
},
|
|
825
|
-
width() {
|
|
826
|
-
return h(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${p.dialogWidth}`);
|
|
827
|
-
},
|
|
828
|
-
dialogType() {
|
|
829
|
-
return this.isDrawer ? "ElDrawer" : "ElementDialog";
|
|
830
|
-
},
|
|
831
|
-
dialogTop() {
|
|
832
|
-
return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
|
|
833
|
-
},
|
|
834
|
-
isDrawer() {
|
|
835
|
-
return this.crud.tableOption.dialogType === "drawer";
|
|
794
|
+
mounted() {
|
|
795
|
+
this.setSort();
|
|
796
|
+
},
|
|
797
|
+
methods: {
|
|
798
|
+
optVal: m,
|
|
799
|
+
indexMethod(t) {
|
|
800
|
+
return t + 1 + ((this.crud.page.currentPage || 1) - 1) * (this.crud.page.pageSize || 10);
|
|
836
801
|
},
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
size: this.fullscreen ? "100%" : this.width,
|
|
840
|
-
direction: this.crud.tableOption.dialogDirection
|
|
841
|
-
} : {
|
|
842
|
-
width: this.width,
|
|
843
|
-
fullscreen: this.fullscreen
|
|
844
|
-
};
|
|
802
|
+
setSort() {
|
|
803
|
+
this.rowDrop(), this.columnDrop();
|
|
845
804
|
},
|
|
846
|
-
|
|
847
|
-
const t =
|
|
848
|
-
|
|
849
|
-
const e =
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
editTitle: "编 辑",
|
|
853
|
-
copyTitle: "复 制",
|
|
854
|
-
addTitle: "新 增",
|
|
855
|
-
viewTitle: "查 看",
|
|
856
|
-
filterTitle: "过滤条件",
|
|
857
|
-
showTitle: "列显隐"
|
|
858
|
-
};
|
|
859
|
-
return this.crud.tableOption[`${t}Title`] || e[`${t}Title`];
|
|
860
|
-
}
|
|
861
|
-
return "";
|
|
805
|
+
rowDrop() {
|
|
806
|
+
const t = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0];
|
|
807
|
+
this.crud.tableDrop("row", t, (e) => {
|
|
808
|
+
const i = e.oldIndex, n = e.newIndex, r = this.crud.list.splice(i, 1)[0];
|
|
809
|
+
this.crud.list.splice(n, 0, r), this.crud.$emit("sortable-change", i, n), this.crud.refreshTable(() => this.rowDrop());
|
|
810
|
+
});
|
|
862
811
|
},
|
|
863
|
-
|
|
864
|
-
|
|
812
|
+
columnDrop() {
|
|
813
|
+
const t = this.crud.$refs.table.$el.querySelector(this.config.dropColClass);
|
|
814
|
+
let e = 0;
|
|
815
|
+
["selection", "index", "expand"].forEach((i) => {
|
|
816
|
+
this.crud.tableOption[i] && (e += 1);
|
|
817
|
+
}), this.crud.tableDrop("column", t, (i) => {
|
|
818
|
+
this.crud.headerSort(i.oldIndex - e, i.newIndex - e), this.columnDrop();
|
|
819
|
+
});
|
|
865
820
|
}
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
var Ge = function() {
|
|
824
|
+
var e = this, i = e._self._c;
|
|
825
|
+
return i("div", [i(_, { attrs: { width: "1px" } }), e.crud.tableOption.expand ? i(_, { key: "expand", attrs: { type: "expand", width: e.crud.tableOption.expandWidth || e.config.expandWidth, fixed: e.optVal(e.crud.tableOption.expandFixed, e.config.expandFixed), align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n }) {
|
|
826
|
+
return [e._t("expand", null, { row: n, index: n.$index })];
|
|
827
|
+
} }], null, !0) }) : e._e(), e.crud.tableOption.selection ? i(_, { key: "selection", attrs: { fixed: e.optVal(e.crud.tableOption.selectionFixed, e.config.selectionFixed), type: "selection", selectable: e.crud.tableOption.selectable, "reserve-selection": e.optVal(e.crud.tableOption.reserveSelection), width: e.crud.tableOption.selectionWidth || e.config.selectionWidth, align: "center" } }) : e._e(), e.optVal(e.crud.tableOption.index) ? i(_, { key: "index", attrs: { fixed: e.optVal(e.crud.tableOption.indexFixed, e.config.indexFixed), label: e.crud.tableOption.indexLabel || e.config.indexLabel, type: "index", width: e.crud.tableOption.indexWidth || e.config.indexWidth, index: e.indexMethod, align: "center" } }) : e._e()], 1);
|
|
828
|
+
}, qe = [], Xe = /* @__PURE__ */ g(
|
|
829
|
+
Ue,
|
|
830
|
+
Ge,
|
|
831
|
+
qe,
|
|
832
|
+
!1,
|
|
833
|
+
null,
|
|
834
|
+
null
|
|
835
|
+
);
|
|
836
|
+
const j = Xe.exports, w = {}, Je = {
|
|
837
|
+
name: "ColumnSlot",
|
|
838
|
+
components: { IconTemp: E, FormTemp: z },
|
|
839
|
+
inject: ["dynamic", "crud"],
|
|
840
|
+
props: {
|
|
841
|
+
column: Object,
|
|
842
|
+
columnOption: Array
|
|
843
|
+
},
|
|
844
|
+
created() {
|
|
845
|
+
const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
|
|
846
|
+
Object.keys(this.dynamic).forEach((e) => {
|
|
847
|
+
t.includes(e) && (this[e] = this.dynamic[e]);
|
|
848
|
+
});
|
|
866
849
|
},
|
|
867
850
|
methods: {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
reset() {
|
|
874
|
-
this.$refs.tableForm.resetForm(!1);
|
|
851
|
+
isBlank: u,
|
|
852
|
+
optVal: m,
|
|
853
|
+
uploadFun: P,
|
|
854
|
+
isMediaType(t, e) {
|
|
855
|
+
return Y(t, e);
|
|
875
856
|
},
|
|
876
|
-
|
|
877
|
-
|
|
857
|
+
vaildLabel(t, e, i) {
|
|
858
|
+
if (t.rules && e.$cellEdit)
|
|
859
|
+
return i;
|
|
878
860
|
},
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
861
|
+
columnChange(t, e, i) {
|
|
862
|
+
const n = `${i}-${e.prop}`;
|
|
863
|
+
w[n] || (this.handleChange(e, t), typeof e.change == "function" && e.cell === !0 && e.change({ row: t, column: e, index: i, value: t[e.prop] })), w[n] = !0, this.$nextTick(() => {
|
|
864
|
+
w[n] = !1;
|
|
882
865
|
});
|
|
883
866
|
},
|
|
884
|
-
handleChange() {
|
|
885
|
-
this
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.crud.$emit("row-save", C(this.crud.tableForm, ["$"]), this.closeDialog, t);
|
|
867
|
+
handleChange(t, e) {
|
|
868
|
+
t.cascader && this.$nextTick(() => {
|
|
869
|
+
const i = t.cascader;
|
|
870
|
+
i.forEach((n) => {
|
|
871
|
+
const r = n, s = e[t.prop], o = e.$index, a = this.findObject(this.columnOption, r);
|
|
872
|
+
u(a) || (u(this.crud.cascaderDIC[o]) && this.$set(this.crud.cascaderDIC, o, {}), this.crud.cascaderIndexList.includes(o) && i.forEach((f) => {
|
|
873
|
+
this.$set(this.crud.cascaderDIC[o], f.prop, []), i.forEach((d) => e[d] = "");
|
|
874
|
+
}), !(u(i) || u(s) || u(a)) && ue({
|
|
875
|
+
column: a,
|
|
876
|
+
value: s,
|
|
877
|
+
form: e
|
|
878
|
+
}).then((f) => {
|
|
879
|
+
const d = f || [];
|
|
880
|
+
this.crud.cascaderIndexList.includes(o) || this.crud.cascaderIndexList.push(o), this.crud.cascaderDicList[o] || this.$set(this.crud.cascaderDicList, o, {}), this.crud.cascaderDicList[o][r] || this.$set(this.crud.cascaderDicList[o], r, d), this.$set(this.crud.cascaderDIC[o], r, d), !u(d[a.cascaderIndex]) && !u(d) && !u(a.cascaderIndex) && (e[r] = d[a.cascaderIndex][(a.props || {}).value || b.value]);
|
|
881
|
+
}));
|
|
882
|
+
});
|
|
883
|
+
});
|
|
902
884
|
},
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
885
|
+
handleDetail(t, e) {
|
|
886
|
+
const i = e.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[e.prop] : this.crud.DIC[e.prop], n = D(t, e, this.crud.tableOption, i);
|
|
887
|
+
return !u(i) && this.crud.tableOption.filterDic !== !0 && (t[`$${e.prop}`] = n), n;
|
|
906
888
|
},
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
const { parentList: i, index: n } = this.crud.findData(t[this.crud.rowKey]);
|
|
911
|
-
if (i) {
|
|
912
|
-
const r = i.splice(n, 1)[0];
|
|
913
|
-
t[this.crud.childrenKey] = r[this.crud.childrenKey], i.splice(n, 0, t);
|
|
914
|
-
}
|
|
915
|
-
} else if (this.isAdd) {
|
|
916
|
-
const { item: i } = this.crud.findData(t[this.crud.rowParentKey]);
|
|
917
|
-
i ? (i[this.crud.childrenKey] || this.$set(i, this.crud.childrenKey, []), this.crud.tableOption.lazy && this.$set(i, this.crud.hasChildrenKey, !0), i[this.crud.childrenKey].push(t)) : this.crud.list.push(t);
|
|
918
|
-
}
|
|
919
|
-
})(), this.hide();
|
|
889
|
+
corArray(t, e) {
|
|
890
|
+
let i = this.handleDetail(t, e);
|
|
891
|
+
return Array.isArray(i) || (i = u(i) ? [] : i.split(Q)), c(i);
|
|
920
892
|
},
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
t == null || t(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
|
|
925
|
-
};
|
|
926
|
-
typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(e, this.boxType) : e();
|
|
893
|
+
openImg(t, e, i) {
|
|
894
|
+
let n = this.getImgList(t, e);
|
|
895
|
+
n = n.map((r) => ({ thumbUrl: r, url: r, type: e.fileType })), this.$ImagePreview(n, i);
|
|
927
896
|
},
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
});
|
|
935
|
-
};
|
|
936
|
-
typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(e, this.boxType) : e();
|
|
897
|
+
getImgList(t, e) {
|
|
898
|
+
var s, o;
|
|
899
|
+
const i = ((s = e.propsHttp) == null ? void 0 : s.home) || "", n = ((o = e.props) == null ? void 0 : o.value) || b.value, r = this.corArray(t, e);
|
|
900
|
+
return r.forEach((a, f) => {
|
|
901
|
+
r[f] = i + (a[n] ? a[n] : a);
|
|
902
|
+
}), r;
|
|
937
903
|
}
|
|
938
904
|
}
|
|
939
905
|
};
|
|
940
|
-
var
|
|
906
|
+
var Qe = function() {
|
|
907
|
+
var e = this, i = e._self._c;
|
|
908
|
+
return e.getColumnProp(e.column, "hide") ? i(_, { key: e.column.prop, attrs: { prop: e.column.prop, label: e.column.label, "column-key": e.column.prop, "filter-placement": "bottom-end", filters: e.getColumnProp(e.column, "filters"), "filter-method": e.getColumnProp(e.column, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.column.filterMultiple, !0), "show-overflow-tooltip": e.column.overHidden, "min-width": e.column.minWidth, sortable: e.getColumnProp(e.column, "sortable"), "sort-method": e.column.sortMethod, "sort-orders": e.column.sortOrders, "sort-by": e.column.sortBy, resizable: e.column.resizable, "render-header": e.column.renderHeader, align: e.column.align || e.crud.tableOption.align, "header-align": e.column.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.column, "width"), fixed: e.getColumnProp(e.column, "fixed") }, scopedSlots: e._u([{ key: "header", fn: function({ $index: n }) {
|
|
909
|
+
return [e.crud.getSlotName(e.column, "H", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "H"), null, null, { column: e.column, $index: n }) : i("span", [e._v(e._s(e.column.label))])];
|
|
910
|
+
} }, { key: "default", fn: function({ row: n, $index: r }) {
|
|
911
|
+
return [n.$cellEdit && e.column.cell ? i(ce, { attrs: { prop: e.crud.isTree ? "" : `list.${r}.${e.column.prop}`, label: e.vaildLabel(e.column, n, " "), "label-width": e.vaildLabel(e.column, n, "1px"), rules: e.column.rules } }, [i(ae, { attrs: { content: (e.crud.listError[`list.${r}.${e.column.prop}`] || {}).msg, disabled: !(e.crud.listError[`list.${r}.${e.column.prop}`] || {}).valid, placement: "top" } }, [e.crud.getSlotName(e.column, "F", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "F"), null, null, {
|
|
912
|
+
row: n,
|
|
913
|
+
dic: e.crud.DIC[e.column.prop],
|
|
914
|
+
size: e.crud.isMediumSize,
|
|
915
|
+
index: r,
|
|
916
|
+
disabled: e.crud.btnDisabledList[r],
|
|
917
|
+
label: e.handleDetail(n, e.column),
|
|
918
|
+
$cell: n.$cellEdit
|
|
919
|
+
}) : i(z, e._b({ attrs: { column: e.column, size: e.crud.isMediumSize, "table-data": { index: r, row: n, label: e.handleDetail(n, e.column) }, dic: (e.crud.cascaderDIC[r] || {})[e.column.prop] || e.crud.DIC[e.column.prop], props: e.column.props || e.crud.tableOption.props, readonly: e.column.readonly, disabled: e.crud.disabled || e.crud.tableOption.disabled || e.column.disabled || e.crud.btnDisabledList[r], clearable: e.optVal(e.column.clearable, !1), "column-slot": e.crud.mainSlot }, on: { change: function(s) {
|
|
920
|
+
return e.columnChange(n, e.column, r);
|
|
921
|
+
} }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(s) {
|
|
922
|
+
return { key: s, fn: function(o) {
|
|
923
|
+
return [e._t(s, null, null, o)];
|
|
924
|
+
} };
|
|
925
|
+
})], null, !0), model: { value: n[e.column.prop], callback: function(s) {
|
|
926
|
+
e.$set(n, e.column.prop, s);
|
|
927
|
+
}, expression: "row[column.prop]" } }, "FormTemp", e.uploadFun(e.column, e.crud), !1))], 2)], 1) : e.crud.$scopedSlots[e.column.prop] ? e._t(e.column.prop, null, { row: n, index: r, dic: e.crud.DIC[e.column.prop], size: e.crud.isMediumSize, label: e.handleDetail(n, e.column) }) : [["img", "upload"].includes(e.column.type) ? i("span", { staticClass: "avue-crud__img" }, [e._l(e.getImgList(n, e.column), function(s, o) {
|
|
928
|
+
return [e.isMediaType(s, e.column.fileType) ? i(e.isMediaType(s, e.column.fileType), { key: o, tag: "Component", attrs: { src: s }, on: { click: function(a) {
|
|
929
|
+
return a.stopPropagation(), e.openImg(n, e.column, o);
|
|
930
|
+
} } }) : i("i", { key: o, staticClass: "el-icon-document", attrs: { src: s }, on: { click: function(a) {
|
|
931
|
+
return a.stopPropagation(), e.openImg(n, e.column, o);
|
|
932
|
+
} } })];
|
|
933
|
+
})], 2) : e.column.type === "url" ? i("span", e._l(e.corArray(n, e.column), function(s, o) {
|
|
934
|
+
return i(le, { key: o, attrs: { type: "primary", href: s, target: e.column.target || "_blank" } }, [e._v(e._s(s))]);
|
|
935
|
+
}), 1) : e.column.type === "rate" ? i("span", [i(oe, { attrs: { disabled: "" }, model: { value: n[e.column.prop], callback: function(s) {
|
|
936
|
+
e.$set(n, e.column.prop, s);
|
|
937
|
+
}, expression: "row[column.prop]" } })], 1) : e.column.type === "color" ? i("i", { staticClass: "avue-crud__color", style: { backgroundColor: n[e.column.prop] } }) : e.column.type === "icon" ? i(E, { attrs: { text: n[e.column.prop] } }) : e.column.html ? i("span", { domProps: { innerHTML: e._s(e.handleDetail(n, e.column)) } }) : i("span", { domProps: { textContent: e._s(e.handleDetail(n, e.column)) } })]];
|
|
938
|
+
} }], null, !0) }) : e._e();
|
|
939
|
+
}, Ye = [], Ze = /* @__PURE__ */ g(
|
|
940
|
+
Je,
|
|
941
|
+
Qe,
|
|
942
|
+
Ye,
|
|
943
|
+
!1,
|
|
944
|
+
null,
|
|
945
|
+
null
|
|
946
|
+
);
|
|
947
|
+
const $ = Ze.exports, et = {
|
|
948
|
+
name: "ColumnDynamic",
|
|
949
|
+
components: { ColumnSlot: $ },
|
|
950
|
+
inject: ["dynamic", "crud"],
|
|
951
|
+
props: {
|
|
952
|
+
columnOption: Object
|
|
953
|
+
},
|
|
954
|
+
created() {
|
|
955
|
+
const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
|
|
956
|
+
Object.keys(this.dynamic).forEach((e) => {
|
|
957
|
+
t.includes(e) && (this[e] = this.dynamic[e]);
|
|
958
|
+
});
|
|
959
|
+
},
|
|
960
|
+
methods: {
|
|
961
|
+
optVal: m
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
var tt = function() {
|
|
941
965
|
var e = this, i = e._self._c;
|
|
942
|
-
return e.
|
|
943
|
-
e.
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
return
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
966
|
+
return e.getColumnProp(e.columnOption, "hide") ? i(_, { key: e.columnOption.prop, attrs: { prop: e.columnOption.prop, label: e.columnOption.label, "filter-placement": "bottom-end", filters: e.getColumnProp(e.columnOption, "filters"), "filter-method": e.getColumnProp(e.columnOption, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.columnOption.filterMultiple, !0), "show-overflow-tooltip": e.columnOption.overHidden, "min-width": e.columnOption.minWidth, sortable: e.getColumnProp(e.columnOption, "sortable"), "render-header": e.columnOption.renderHeader, align: e.columnOption.align || e.crud.tableOption.align, "header-align": e.columnOption.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.columnOption, "width"), fixed: e.getColumnProp(e.columnOption, "fixed") } }, [e._l(e.columnOption.children, function(n) {
|
|
967
|
+
return [n.children && n.children.length > 0 ? i("ColumnDynamic", { key: n.prop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
968
|
+
return { key: r, fn: function(s) {
|
|
969
|
+
return [e._t(r, null, null, s)];
|
|
970
|
+
} };
|
|
971
|
+
})], null, !0) }) : i($, { key: n.prop, attrs: { column: n, "column-option": e.columnOption.children }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
972
|
+
return { key: r, fn: function(s) {
|
|
973
|
+
return [e._t(r, null, null, s)];
|
|
974
|
+
} };
|
|
975
|
+
})], null, !0) })];
|
|
976
|
+
})], 2) : e._e();
|
|
977
|
+
}, it = [], nt = /* @__PURE__ */ g(
|
|
978
|
+
et,
|
|
979
|
+
tt,
|
|
980
|
+
it,
|
|
957
981
|
!1,
|
|
958
982
|
null,
|
|
959
983
|
null
|
|
960
984
|
);
|
|
961
|
-
const
|
|
962
|
-
name: "
|
|
985
|
+
const W = nt.exports, rt = {
|
|
986
|
+
name: "Column",
|
|
987
|
+
components: { ColumnDynamic: W, ColumnSlot: $ },
|
|
963
988
|
inject: ["crud"],
|
|
964
|
-
|
|
989
|
+
provide() {
|
|
965
990
|
return {
|
|
966
|
-
|
|
967
|
-
|
|
991
|
+
crud: this.crud,
|
|
992
|
+
dynamic: this
|
|
968
993
|
};
|
|
969
994
|
},
|
|
995
|
+
props: {
|
|
996
|
+
columnOption: Array
|
|
997
|
+
},
|
|
970
998
|
computed: {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
{
|
|
978
|
-
label: "冻结",
|
|
979
|
-
prop: "fixed"
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
label: "过滤",
|
|
983
|
-
prop: "filters"
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
label: "排序",
|
|
987
|
-
prop: "sortable"
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
label: "序号",
|
|
991
|
-
prop: "index",
|
|
992
|
-
hide: !0
|
|
993
|
-
},
|
|
994
|
-
{
|
|
995
|
-
label: "宽度",
|
|
996
|
-
prop: "width",
|
|
997
|
-
hide: !0
|
|
998
|
-
}
|
|
999
|
-
];
|
|
999
|
+
list() {
|
|
1000
|
+
let t = [...this.columnOption];
|
|
1001
|
+
return t = Z(t, "index", (e, i) => {
|
|
1002
|
+
var n, r;
|
|
1003
|
+
return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[i.prop]) == null ? void 0 : r.index);
|
|
1004
|
+
}), t;
|
|
1000
1005
|
}
|
|
1001
1006
|
},
|
|
1002
1007
|
methods: {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1008
|
+
// 表格筛选逻辑
|
|
1009
|
+
handleFilterMethod(t, e, i) {
|
|
1010
|
+
const n = this.columnOption.filter((r) => r.prop === i.property)[0];
|
|
1011
|
+
return typeof n.filterMethod == "function" ? n.filterMethod(t, e, n) : e[n.prop] === t;
|
|
1007
1012
|
},
|
|
1008
|
-
|
|
1009
|
-
|
|
1013
|
+
// 表格筛选字典
|
|
1014
|
+
handleFilters(t, e) {
|
|
1015
|
+
if (e !== !0) return;
|
|
1016
|
+
const i = this.crud.DIC[t.prop] || [], n = [];
|
|
1017
|
+
return u(i) ? this.crud.cellForm.list.forEach((r) => {
|
|
1018
|
+
n.map((s) => s.text).includes(r[t.prop]) || n.push({
|
|
1019
|
+
text: r[t.prop],
|
|
1020
|
+
value: r[t.prop]
|
|
1021
|
+
});
|
|
1022
|
+
}) : i.forEach((r) => {
|
|
1023
|
+
const s = t.props || this.crud.tableOption.props || {};
|
|
1024
|
+
n.push({
|
|
1025
|
+
text: r[s.label || b.label],
|
|
1026
|
+
value: r[s.value || b.value]
|
|
1027
|
+
});
|
|
1028
|
+
}), n;
|
|
1010
1029
|
},
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1030
|
+
getColumnProp(t, e) {
|
|
1031
|
+
const i = this.crud.objectOption[t.prop] || {};
|
|
1032
|
+
if (e === "filterMethod") return i == null ? void 0 : i.filters;
|
|
1033
|
+
if (this.crud.isMobile && ["fixed"].includes(e)) return !1;
|
|
1034
|
+
const n = i == null ? void 0 : i[e];
|
|
1035
|
+
if (!(e === "width" && n === 0))
|
|
1036
|
+
return e === "filters" ? this.handleFilters(t, n) : e === "hide" ? (i == null ? void 0 : i.hide) !== !0 : n;
|
|
1017
1037
|
}
|
|
1018
1038
|
}
|
|
1019
1039
|
};
|
|
1020
|
-
var
|
|
1040
|
+
var st = function() {
|
|
1021
1041
|
var e = this, i = e._self._c;
|
|
1022
|
-
return
|
|
1023
|
-
e.
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
e
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
})
|
|
1033
|
-
},
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1042
|
+
return i("div", [e._t("header"), e._l(e.list, function(n) {
|
|
1043
|
+
return [n.children && n.children.length > 0 ? i(W, { key: n.pop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
1044
|
+
return { key: r, fn: function(s) {
|
|
1045
|
+
return [e._t(r, null, null, s)];
|
|
1046
|
+
} };
|
|
1047
|
+
})], null, !0) }) : i($, { key: n.prop, attrs: { column: n, "column-option": e.columnOption }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
|
|
1048
|
+
return { key: r, fn: function(s) {
|
|
1049
|
+
return [e._t(r, null, null, s)];
|
|
1050
|
+
} };
|
|
1051
|
+
})], null, !0) })];
|
|
1052
|
+
}), e._t("footer")], 2);
|
|
1053
|
+
}, ot = [], lt = /* @__PURE__ */ g(
|
|
1054
|
+
rt,
|
|
1055
|
+
st,
|
|
1056
|
+
ot,
|
|
1037
1057
|
!1,
|
|
1038
1058
|
null,
|
|
1039
1059
|
null
|
|
1040
1060
|
);
|
|
1041
|
-
const
|
|
1042
|
-
name: "
|
|
1061
|
+
const K = lt.exports, at = {
|
|
1062
|
+
name: "HeaderMenu",
|
|
1063
|
+
directives: {
|
|
1064
|
+
permission: B
|
|
1065
|
+
},
|
|
1043
1066
|
inject: ["crud"],
|
|
1044
1067
|
data() {
|
|
1045
1068
|
return {
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
form: {
|
|
1050
|
-
name: this.crud.tableOption.title
|
|
1051
|
-
}
|
|
1052
|
-
};
|
|
1053
|
-
},
|
|
1054
|
-
methods: {
|
|
1055
|
-
handleShow() {
|
|
1056
|
-
this.getColumnOption(), this.getOption(), this.box = !0;
|
|
1057
|
-
},
|
|
1058
|
-
handleSubmit() {
|
|
1059
|
-
this.$Export.excel({
|
|
1060
|
-
title: this.form.name,
|
|
1061
|
-
columns: this.getColumn(),
|
|
1062
|
-
data: this.handleSum()
|
|
1063
|
-
}), this.box = !1;
|
|
1064
|
-
},
|
|
1065
|
-
// 计算统计
|
|
1066
|
-
handleSum() {
|
|
1067
|
-
const t = this.crud.tableOption, e = this.crud.propOption, i = this.form.type ? this.crud.list : this.crud.tableSelect, n = [];
|
|
1068
|
-
return this.form.params.includes("data") && i.forEach((r) => {
|
|
1069
|
-
const s = a(r);
|
|
1070
|
-
e.forEach((l) => {
|
|
1071
|
-
const o = l.parentProp ? (this.crud.cascaderDIC[l.$index] || {})[l.prop] : this.crud.DIC[l.prop];
|
|
1072
|
-
s[l.prop] = w(s, l, t, o);
|
|
1073
|
-
}), n.push(s);
|
|
1074
|
-
}), this.form.params.includes("sum") && t.showSummary && n.push(this.crud.sumsList), n;
|
|
1075
|
-
},
|
|
1076
|
-
getOption() {
|
|
1077
|
-
this.option = {
|
|
1078
|
-
submitBtn: !1,
|
|
1079
|
-
emptyBtn: !1,
|
|
1080
|
-
column: [
|
|
1069
|
+
dateCreate: !1,
|
|
1070
|
+
pickerOptions: {
|
|
1071
|
+
shortcuts: [
|
|
1081
1072
|
{
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1073
|
+
text: "今日",
|
|
1074
|
+
onClick(t) {
|
|
1075
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1076
|
+
i.setTime(i.getTime()), t.$emit("pick", [i, e]);
|
|
1077
|
+
}
|
|
1085
1078
|
},
|
|
1086
1079
|
{
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
{
|
|
1093
|
-
label: "当前数据(当前页全部的数据)",
|
|
1094
|
-
value: !0
|
|
1095
|
-
},
|
|
1096
|
-
{
|
|
1097
|
-
label: "选中的数据(当前页选中的数据)",
|
|
1098
|
-
disabled: this.crud.tableOption.selection !== !0,
|
|
1099
|
-
value: !1
|
|
1100
|
-
}
|
|
1101
|
-
]
|
|
1080
|
+
text: "昨日",
|
|
1081
|
+
onClick(t) {
|
|
1082
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1083
|
+
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 1), t.$emit("pick", [i, e]);
|
|
1084
|
+
}
|
|
1102
1085
|
},
|
|
1103
1086
|
{
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
span: 24,
|
|
1110
|
-
props: {
|
|
1111
|
-
value: "prop"
|
|
1112
|
-
},
|
|
1113
|
-
dicData: this.columnOption
|
|
1087
|
+
text: "最近一周",
|
|
1088
|
+
onClick(t) {
|
|
1089
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1090
|
+
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 7), t.$emit("pick", [i, e]);
|
|
1091
|
+
}
|
|
1114
1092
|
},
|
|
1115
1093
|
{
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
label: "表头",
|
|
1129
|
-
disabled: !0,
|
|
1130
|
-
value: "header"
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
label: "数据源",
|
|
1134
|
-
value: "data"
|
|
1135
|
-
}
|
|
1136
|
-
].concat(
|
|
1137
|
-
(() => {
|
|
1138
|
-
const t = [];
|
|
1139
|
-
return t.push({
|
|
1140
|
-
label: "复杂表头",
|
|
1141
|
-
value: "headers",
|
|
1142
|
-
disabled: !this.crud.isHeader
|
|
1143
|
-
}), t.push({
|
|
1144
|
-
label: "合计统计",
|
|
1145
|
-
value: "sum",
|
|
1146
|
-
disabled: !this.crud.isShowSummary
|
|
1147
|
-
}), t;
|
|
1148
|
-
})()
|
|
1149
|
-
)
|
|
1094
|
+
text: "最近一个月",
|
|
1095
|
+
onClick(t) {
|
|
1096
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1097
|
+
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 30), t.$emit("pick", [i, e]);
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
text: "最近三个月",
|
|
1102
|
+
onClick(t) {
|
|
1103
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1104
|
+
i.setTime(i.getTime() - 3600 * 1e3 * 24 * 90), t.$emit("pick", [i, e]);
|
|
1105
|
+
}
|
|
1150
1106
|
}
|
|
1151
1107
|
]
|
|
1152
|
-
},
|
|
1108
|
+
},
|
|
1109
|
+
config: h
|
|
1110
|
+
};
|
|
1111
|
+
},
|
|
1112
|
+
created() {
|
|
1113
|
+
this.initFun();
|
|
1114
|
+
},
|
|
1115
|
+
methods: {
|
|
1116
|
+
optVal: m,
|
|
1117
|
+
// 日期组件回调
|
|
1118
|
+
dateChange(t) {
|
|
1119
|
+
this.dateCreate ? this.crud.$emit("date-change", t) : this.dateCreate = !0;
|
|
1153
1120
|
},
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
n.forEach((r, s) => {
|
|
1157
|
-
const l = r.children;
|
|
1158
|
-
l && !Array.isArray(l) ? delete r.children : r.showColumn === !1 ? n.splice(s, 1) : (e.push(r.prop), r.children && i(l));
|
|
1159
|
-
});
|
|
1160
|
-
};
|
|
1161
|
-
i(t), this.columnOption = t, this.form.prop = e;
|
|
1121
|
+
initFun() {
|
|
1122
|
+
this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
|
|
1162
1123
|
},
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
n.forEach((r, s) => {
|
|
1169
|
-
e.includes(r.prop) ? r.children && i(r.children) : n.splice(s, 1);
|
|
1170
|
-
});
|
|
1171
|
-
};
|
|
1172
|
-
return i(t), t;
|
|
1173
|
-
} else {
|
|
1174
|
-
const i = [], n = (r = []) => {
|
|
1175
|
-
r.forEach((s) => {
|
|
1176
|
-
s.children ? n(s.children) : e.includes(s.prop) && i.push(s);
|
|
1177
|
-
});
|
|
1178
|
-
};
|
|
1179
|
-
return n(t), i;
|
|
1180
|
-
}
|
|
1124
|
+
rowExcel() {
|
|
1125
|
+
this.crud.$refs.dialogExcel.handleShow();
|
|
1126
|
+
},
|
|
1127
|
+
rowPrint() {
|
|
1128
|
+
this.$Print(this.crud.$refs.table);
|
|
1181
1129
|
}
|
|
1182
1130
|
}
|
|
1183
1131
|
};
|
|
1184
|
-
var
|
|
1132
|
+
var ct = function() {
|
|
1185
1133
|
var e = this, i = e._self._c;
|
|
1186
|
-
return e.
|
|
1187
|
-
e.
|
|
1188
|
-
} }
|
|
1189
|
-
return
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
Me,
|
|
1198
|
-
Le,
|
|
1134
|
+
return i("div", { staticClass: "avue-crud__menu" }, [e.optVal(e.crud.tableOption.menuLeft, !0) ? i("div", { staticClass: "avue-crud__left" }, [e.optVal(e.crud.tableOption.addBtn, e.config.addBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addBtn"), expression: "crud.getPermission('addBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.addRowBtn, e.config.addRowBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addRowBtn"), expression: "crud.getPermission('addRowBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowCellAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e._t("menuLeft", null, { size: e.crud.isMediumSize })], 2) : e._e(), e.optVal(e.crud.tableOption.menuRight, !0) ? i("div", { staticClass: "avue-crud__right" }, [e.optVal(e.crud.tableOption.dateBtn, e.config.dateBtn) ? i(me, { staticStyle: { display: "inline-block", "margin-right": "20px" }, attrs: { type: "datetimerange", "value-format": "yyyy-MM-dd HH:mm:ss", format: "yyyy-MM-dd HH:mm:ss", "picker-options": e.pickerOptions, size: e.crud.isMediumSize }, on: { change: e.dateChange } }) : e._e(), e._t("menuRight", null, { size: e.crud.isMediumSize }), e.optVal(e.crud.tableOption.excelBtn, e.config.excelBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("excelBtn"), expression: "crud.getPermission('excelBtn')" }], attrs: { icon: e.crud.getBtnIcon("excelBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowExcel } }) : e._e(), e.optVal(e.crud.tableOption.printBtn, e.config.printBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("printBtn"), expression: "crud.getPermission('printBtn')" }], attrs: { icon: e.crud.getBtnIcon("printBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowPrint } }) : e._e(), e.optVal(e.crud.tableOption.refreshBtn, e.config.refreshBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("refreshBtn"), expression: "crud.getPermission('refreshBtn')" }], attrs: { icon: e.crud.getBtnIcon("refreshBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.crud.refreshChange } }) : e._e(), e.optVal(e.crud.tableOption.columnBtn, e.config.columnBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("columnBtn"), expression: "crud.getPermission('columnBtn')" }], attrs: { icon: e.crud.getBtnIcon("columnBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
1135
|
+
return e.crud.$refs.dialogColumn.handleShow();
|
|
1136
|
+
} } }) : e._e(), (e.crud.$refs.headerSearch || {}).searchFlag && e.optVal(e.crud.tableOption.searchShowBtn, !0) ? i(l, { attrs: { icon: e.crud.getBtnIcon("searchBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
1137
|
+
return e.crud.$refs.headerSearch.handleSearchShow();
|
|
1138
|
+
} } }) : e._e(), e.optVal(e.crud.tableOption.filterBtn, e.config.filterBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("filterBtn"), expression: "crud.getPermission('filterBtn')" }], attrs: { icon: e.crud.getBtnIcon("filterBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
|
|
1139
|
+
return e.crud.$refs.dialogFilter.handleShow();
|
|
1140
|
+
} } }) : e._e()], 2) : e._e()]);
|
|
1141
|
+
}, ut = [], dt = /* @__PURE__ */ g(
|
|
1142
|
+
at,
|
|
1143
|
+
ct,
|
|
1144
|
+
ut,
|
|
1199
1145
|
!1,
|
|
1200
1146
|
null,
|
|
1201
1147
|
null
|
|
1202
1148
|
);
|
|
1203
|
-
const
|
|
1204
|
-
name: "
|
|
1149
|
+
const U = dt.exports, pt = {
|
|
1150
|
+
name: "HeaderSearch",
|
|
1151
|
+
mixins: [fe],
|
|
1205
1152
|
inject: ["crud"],
|
|
1153
|
+
props: {
|
|
1154
|
+
search: Object
|
|
1155
|
+
},
|
|
1206
1156
|
data() {
|
|
1207
1157
|
return {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
{
|
|
1212
|
-
label: "=",
|
|
1213
|
-
value: "="
|
|
1214
|
-
},
|
|
1215
|
-
{
|
|
1216
|
-
label: "≠",
|
|
1217
|
-
value: "≠"
|
|
1218
|
-
},
|
|
1219
|
-
{
|
|
1220
|
-
label: "like",
|
|
1221
|
-
value: "like"
|
|
1222
|
-
},
|
|
1223
|
-
{
|
|
1224
|
-
label: ">",
|
|
1225
|
-
value: ">"
|
|
1226
|
-
},
|
|
1227
|
-
{
|
|
1228
|
-
label: "≥",
|
|
1229
|
-
value: "≥"
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
label: "<",
|
|
1233
|
-
value: "<"
|
|
1234
|
-
},
|
|
1235
|
-
{
|
|
1236
|
-
label: "≤",
|
|
1237
|
-
value: "≤"
|
|
1238
|
-
},
|
|
1239
|
-
{
|
|
1240
|
-
label: "∈",
|
|
1241
|
-
value: "∈"
|
|
1242
|
-
}
|
|
1243
|
-
],
|
|
1244
|
-
list: [],
|
|
1245
|
-
columnOption: {}
|
|
1158
|
+
show: !1,
|
|
1159
|
+
searchIndex: 2,
|
|
1160
|
+
searchShow: !0
|
|
1246
1161
|
};
|
|
1247
1162
|
},
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1163
|
+
computed: {
|
|
1164
|
+
searchForm: {
|
|
1165
|
+
get() {
|
|
1166
|
+
return this.crud.search;
|
|
1167
|
+
},
|
|
1168
|
+
set(t) {
|
|
1169
|
+
this.crud.$emit("update:search", t);
|
|
1170
|
+
}
|
|
1251
1171
|
},
|
|
1252
|
-
|
|
1253
|
-
const t = []
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1172
|
+
option() {
|
|
1173
|
+
const t = this.crud.option, e = (n = []) => {
|
|
1174
|
+
n = c(n);
|
|
1175
|
+
const r = [];
|
|
1176
|
+
let s = 0;
|
|
1177
|
+
return n = n.sort((o, a) => (a.searchOrder || 0) - (o.searchOrder || 0)), n.forEach((o) => {
|
|
1178
|
+
if (o.search) {
|
|
1179
|
+
const a = s < this.searchIndex, f = {};
|
|
1180
|
+
Object.keys(o).forEach((d) => {
|
|
1181
|
+
const v = "search";
|
|
1182
|
+
if (d !== "searchProp" && d.includes(v)) {
|
|
1183
|
+
let p = d.replace(v, "");
|
|
1184
|
+
if (p.length === 0) return;
|
|
1185
|
+
p = p.replace(p[0], p[0].toLowerCase()), f[p] = o[d];
|
|
1186
|
+
}
|
|
1187
|
+
}), o = Object.assign(o, f, {
|
|
1188
|
+
type: ge(o),
|
|
1189
|
+
detail: !1,
|
|
1190
|
+
dicFlag: o.cascader ? !0 : m(o.dicFlag, !1),
|
|
1191
|
+
span: o.searchSpan || t.searchSpan || h.searchSpan,
|
|
1192
|
+
control: o.searchControl,
|
|
1193
|
+
gutter: o.searchGutter || t.searchGutter || h.searchGutter,
|
|
1194
|
+
labelWidth: o.searchLabelWidth || t.searchLabelWidth || h.searchLabelWidth,
|
|
1195
|
+
labelPosition: o.searchLabelPosition || t.searchLabelPosition,
|
|
1196
|
+
size: o.searchSize || t.searchSize,
|
|
1197
|
+
value: o.searchValue,
|
|
1198
|
+
rules: o.searchRules,
|
|
1199
|
+
row: o.searchRow,
|
|
1200
|
+
bind: o.searchBin,
|
|
1201
|
+
disabled: o.searchDisabled,
|
|
1202
|
+
readonly: o.searchReadonly,
|
|
1203
|
+
display: this.isSearchIcon ? this.show ? !0 : a : !0
|
|
1204
|
+
}), r.push(o), s = s + 1;
|
|
1205
|
+
}
|
|
1206
|
+
}), r;
|
|
1207
|
+
};
|
|
1208
|
+
return ((n) => {
|
|
1209
|
+
let r = c(n);
|
|
1210
|
+
return r.column = e(this.crud.propOption), r = Object.assign(r, {
|
|
1211
|
+
rowKey: t.searchRowKey || "null",
|
|
1212
|
+
tabs: !1,
|
|
1213
|
+
group: !1,
|
|
1214
|
+
printBtn: !1,
|
|
1215
|
+
mockBtn: !1,
|
|
1216
|
+
filterDic: t.searchFilterDic,
|
|
1217
|
+
filterNull: t.searchFilterNull,
|
|
1218
|
+
filterParam: t.searchFilterParam,
|
|
1219
|
+
enter: t.searchEnter,
|
|
1220
|
+
size: t.searchSize,
|
|
1221
|
+
submitText: t.searchBtnText || "搜 索",
|
|
1222
|
+
submitBtn: m(t.searchBtn, h.searchSubBtn),
|
|
1223
|
+
submitIcon: this.crud.getBtnIcon("searchBtn"),
|
|
1224
|
+
emptyText: t.emptyBtnText || "清 空",
|
|
1225
|
+
emptyBtn: m(t.emptyBtn, h.emptyBtn),
|
|
1226
|
+
emptyIcon: this.crud.getBtnIcon("emptyBtn"),
|
|
1227
|
+
menuSpan: this.show || !this.isSearchIcon || t.searchMenuSpan < 6 ? t.searchMenuSpan : 6,
|
|
1228
|
+
menuPosition: t.searchMenuPosition || "center",
|
|
1229
|
+
dicFlag: !1,
|
|
1230
|
+
dicData: this.crud.DIC
|
|
1231
|
+
}), r;
|
|
1232
|
+
})(t);
|
|
1261
1233
|
},
|
|
1262
|
-
|
|
1263
|
-
this.
|
|
1234
|
+
isSearchIcon() {
|
|
1235
|
+
return m(this.crud.option.searchIcon, this.$AVUE.searchIcon) && this.searchLen > this.searchIndex;
|
|
1264
1236
|
},
|
|
1265
|
-
|
|
1266
|
-
|
|
1237
|
+
searchLen() {
|
|
1238
|
+
let t = 0;
|
|
1239
|
+
return this.crud.propOption.forEach((e) => {
|
|
1240
|
+
e.search && t++;
|
|
1241
|
+
}), t;
|
|
1267
1242
|
},
|
|
1268
|
-
|
|
1269
|
-
this.
|
|
1270
|
-
|
|
1271
|
-
|
|
1243
|
+
searchFlag() {
|
|
1244
|
+
return !!this.crud.$scopedSlots.search || this.searchLen !== 0;
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
watch: {
|
|
1248
|
+
"crud.propOption": {
|
|
1249
|
+
handler() {
|
|
1250
|
+
this.dataFormat();
|
|
1251
|
+
},
|
|
1252
|
+
deep: !0
|
|
1272
1253
|
},
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
this.list.forEach((e) => {
|
|
1276
|
-
t.push([e.text, e.symbol, e.value]);
|
|
1277
|
-
}), this.crud.$emit("filter", t), this.box = !1;
|
|
1254
|
+
show() {
|
|
1255
|
+
this.crud.getTableHeight();
|
|
1278
1256
|
},
|
|
1279
|
-
|
|
1280
|
-
this.
|
|
1257
|
+
searchShow() {
|
|
1258
|
+
this.crud.getTableHeight();
|
|
1281
1259
|
},
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1260
|
+
option: {
|
|
1261
|
+
immediate: !0,
|
|
1262
|
+
deep: !0,
|
|
1263
|
+
handler() {
|
|
1264
|
+
var t;
|
|
1265
|
+
this.searchIndex = ((t = this.option) == null ? void 0 : t.searchIndex) || 2;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
created() {
|
|
1270
|
+
this.initFun(), this.dataFormat();
|
|
1271
|
+
},
|
|
1272
|
+
methods: {
|
|
1273
|
+
initFun() {
|
|
1274
|
+
["searchReset", "searchChange"].forEach((t) => {
|
|
1275
|
+
this.crud[t] = this[t];
|
|
1288
1276
|
});
|
|
1277
|
+
},
|
|
1278
|
+
getSlotName(t) {
|
|
1279
|
+
return t.replace("Search", "");
|
|
1280
|
+
},
|
|
1281
|
+
// 搜索回调
|
|
1282
|
+
searchChange(t, e) {
|
|
1283
|
+
t = S(t), this.crud.propOption.forEach((i) => {
|
|
1284
|
+
i.searchProp && (t[i.searchProp] = t[i.prop], delete t[i.prop]);
|
|
1285
|
+
}), this.crud.$emit("search-change", t, e);
|
|
1286
|
+
},
|
|
1287
|
+
// 搜索清空
|
|
1288
|
+
resetChange() {
|
|
1289
|
+
this.crud.$emit("search-reset", this.searchForm);
|
|
1290
|
+
},
|
|
1291
|
+
// 搜索清空
|
|
1292
|
+
searchReset() {
|
|
1293
|
+
this.$refs.form.resetForm();
|
|
1294
|
+
},
|
|
1295
|
+
handleSearchShow() {
|
|
1296
|
+
this.searchShow = !this.searchShow;
|
|
1297
|
+
},
|
|
1298
|
+
dataFormat() {
|
|
1299
|
+
const t = this.crud.option;
|
|
1300
|
+
this.searchShow = m(t.searchShow, h.searchShow);
|
|
1289
1301
|
}
|
|
1290
1302
|
}
|
|
1291
1303
|
};
|
|
1292
|
-
var
|
|
1304
|
+
var ht = function() {
|
|
1293
1305
|
var e = this, i = e._self._c;
|
|
1294
|
-
return e.
|
|
1295
|
-
e.
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
e
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
} } })]
|
|
1308
|
-
}
|
|
1309
|
-
e.
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1306
|
+
return e.searchFlag ? i(T, { directives: [{ name: "show", rawName: "v-show", value: e.searchShow && e.searchFlag, expression: "searchShow && searchFlag" }], staticClass: "avue-crud__search", attrs: { shadow: e.crud.isCard } }, [e._t("search", null, { row: e.searchForm, search: e.searchForm, size: e.crud.controlSize }), i(O, { ref: "form", attrs: { option: e.option }, on: { submit: e.searchChange, "reset-change": e.resetChange }, scopedSlots: e._u([{ key: "menuForm", fn: function(n) {
|
|
1307
|
+
return [e._t(
|
|
1308
|
+
"searchMenu",
|
|
1309
|
+
null,
|
|
1310
|
+
null,
|
|
1311
|
+
Object.assign(n, {
|
|
1312
|
+
search: e.searchForm,
|
|
1313
|
+
row: e.searchForm
|
|
1314
|
+
})
|
|
1315
|
+
), e.isSearchIcon ? [e.show === !1 ? i(l, { attrs: { type: "text", icon: "el-icon-arrow-down" }, on: { click: function(r) {
|
|
1316
|
+
e.show = !0;
|
|
1317
|
+
} } }, [e._v(" 展 开 ")]) : e._e(), e.show === !0 ? i(l, { attrs: { type: "text", icon: "el-icon-arrow-up" }, on: { click: function(r) {
|
|
1318
|
+
e.show = !1;
|
|
1319
|
+
} } }, [e._v(" 收 缩 ")]) : e._e()] : e._e()];
|
|
1320
|
+
} }, e._l(e.crud.searchSlot, function(n) {
|
|
1321
|
+
return { key: e.getSlotName(n), fn: function(r) {
|
|
1322
|
+
return [e._t(
|
|
1323
|
+
n,
|
|
1324
|
+
null,
|
|
1325
|
+
null,
|
|
1326
|
+
Object.assign(r, {
|
|
1327
|
+
search: e.searchForm,
|
|
1328
|
+
row: e.searchForm
|
|
1329
|
+
})
|
|
1330
|
+
)];
|
|
1331
|
+
} };
|
|
1332
|
+
})], null, !0), model: { value: e.searchForm, callback: function(n) {
|
|
1333
|
+
e.searchForm = n;
|
|
1334
|
+
}, expression: "searchForm" } })], 2) : e._e();
|
|
1335
|
+
}, mt = [], ft = /* @__PURE__ */ g(
|
|
1336
|
+
pt,
|
|
1337
|
+
ht,
|
|
1338
|
+
mt,
|
|
1315
1339
|
!1,
|
|
1316
1340
|
null,
|
|
1317
1341
|
null
|
|
1318
1342
|
);
|
|
1319
|
-
const
|
|
1343
|
+
const G = ft.exports, gt = {
|
|
1320
1344
|
name: "FyCurd",
|
|
1321
1345
|
components: {
|
|
1322
|
-
DialogFilter:
|
|
1323
|
-
DialogExcel:
|
|
1324
|
-
DialogColumn:
|
|
1325
|
-
FyDialogForm:
|
|
1326
|
-
TablePage:
|
|
1327
|
-
ColumnMenu:
|
|
1328
|
-
ColumnDefault:
|
|
1329
|
-
Column:
|
|
1330
|
-
HeaderMenu:
|
|
1331
|
-
HeaderSearch:
|
|
1346
|
+
DialogFilter: L,
|
|
1347
|
+
DialogExcel: V,
|
|
1348
|
+
DialogColumn: R,
|
|
1349
|
+
FyDialogForm: A,
|
|
1350
|
+
TablePage: H,
|
|
1351
|
+
ColumnMenu: N,
|
|
1352
|
+
ColumnDefault: j,
|
|
1353
|
+
Column: K,
|
|
1354
|
+
HeaderMenu: U,
|
|
1355
|
+
HeaderSearch: G
|
|
1332
1356
|
},
|
|
1333
1357
|
directives: {
|
|
1334
|
-
permission:
|
|
1358
|
+
permission: B
|
|
1335
1359
|
},
|
|
1336
|
-
mixins: [
|
|
1360
|
+
mixins: [xe],
|
|
1337
1361
|
provide() {
|
|
1338
1362
|
return {
|
|
1339
1363
|
crud: this
|
|
@@ -1394,7 +1418,7 @@ const We = je.exports, Ke = {
|
|
|
1394
1418
|
cellForm: {
|
|
1395
1419
|
list: []
|
|
1396
1420
|
},
|
|
1397
|
-
config:
|
|
1421
|
+
config: h,
|
|
1398
1422
|
list: [],
|
|
1399
1423
|
listError: {},
|
|
1400
1424
|
tableForm: {},
|
|
@@ -1460,7 +1484,7 @@ const We = je.exports, Ke = {
|
|
|
1460
1484
|
Array.isArray(n.children) ? e(n.children) : t.push(n);
|
|
1461
1485
|
});
|
|
1462
1486
|
}
|
|
1463
|
-
return e(this.columnOption), t =
|
|
1487
|
+
return e(this.columnOption), t = ve(t), t;
|
|
1464
1488
|
},
|
|
1465
1489
|
isShowSummary() {
|
|
1466
1490
|
return this.option.showSummary;
|
|
@@ -1524,13 +1548,13 @@ const We = je.exports, Ke = {
|
|
|
1524
1548
|
this.dataInit(), this.getTableHeight(), this.refreshTable();
|
|
1525
1549
|
},
|
|
1526
1550
|
methods: {
|
|
1527
|
-
setPx:
|
|
1528
|
-
optVal:
|
|
1551
|
+
setPx: ee,
|
|
1552
|
+
optVal: m,
|
|
1529
1553
|
handleValidate(t, e, i) {
|
|
1530
1554
|
this.listError[t] || this.$set(this.listError, t, { valid: !1, msg: "" }), this.listError[t].valid = !e, this.listError[t].msg = i;
|
|
1531
1555
|
},
|
|
1532
1556
|
getPermission(t, e, i) {
|
|
1533
|
-
return typeof this.permission == "function" ? this.permission(t, e, i) :
|
|
1557
|
+
return typeof this.permission == "function" ? this.permission(t, e, i) : u(this.permission[t]) ? !0 : this.permission[t];
|
|
1534
1558
|
},
|
|
1535
1559
|
getTableHeight() {
|
|
1536
1560
|
this.isAutoHeight ? this.$nextTick(() => {
|
|
@@ -1555,18 +1579,18 @@ const We = je.exports, Ke = {
|
|
|
1555
1579
|
});
|
|
1556
1580
|
},
|
|
1557
1581
|
menuIcon(t) {
|
|
1558
|
-
return
|
|
1582
|
+
return m(this.tableOption[`${t}Text`], be(`crud.${t}`));
|
|
1559
1583
|
},
|
|
1560
1584
|
getBtnIcon(t) {
|
|
1561
1585
|
const e = `${t}Icon`;
|
|
1562
|
-
return this.tableOption[e] ||
|
|
1586
|
+
return this.tableOption[e] || h[e];
|
|
1563
1587
|
},
|
|
1564
1588
|
// 对部分表单字段进行校验的方法
|
|
1565
1589
|
validateField(t) {
|
|
1566
1590
|
return this.$refs.dialogForm.$refs.tableForm.validateField(t);
|
|
1567
1591
|
},
|
|
1568
1592
|
selectClear() {
|
|
1569
|
-
this.$emit("selection-clear",
|
|
1593
|
+
this.$emit("selection-clear", c(this.tableSelect)), this.$refs.table.clearSelection();
|
|
1570
1594
|
},
|
|
1571
1595
|
toggleRowSelection(t, e) {
|
|
1572
1596
|
this.$refs.table.toggleRowSelection(t, e);
|
|
@@ -1579,7 +1603,7 @@ const We = je.exports, Ke = {
|
|
|
1579
1603
|
},
|
|
1580
1604
|
dataInit() {
|
|
1581
1605
|
this.list = this.data, this.list.forEach((t, e) => {
|
|
1582
|
-
t.$cellEdit && !this.cascaderFormList[e] && (this.cascaderFormList[e] =
|
|
1606
|
+
t.$cellEdit && !this.cascaderFormList[e] && (this.cascaderFormList[e] = c(t)), this.$set(t, "$cellEdit", t.$cellEdit || !1), this.$set(t, "$index", e);
|
|
1583
1607
|
});
|
|
1584
1608
|
},
|
|
1585
1609
|
// 拖动表头事件
|
|
@@ -1674,8 +1698,8 @@ const We = je.exports, Ke = {
|
|
|
1674
1698
|
},
|
|
1675
1699
|
// 单元格新增
|
|
1676
1700
|
rowCellAdd(t = {}) {
|
|
1677
|
-
const e = this.list.length, i =
|
|
1678
|
-
t =
|
|
1701
|
+
const e = this.list.length, i = _e(this.propOption).tableForm;
|
|
1702
|
+
t = c({
|
|
1679
1703
|
$cellEdit: !0,
|
|
1680
1704
|
$index: e,
|
|
1681
1705
|
...i,
|
|
@@ -1684,24 +1708,24 @@ const We = je.exports, Ke = {
|
|
|
1684
1708
|
},
|
|
1685
1709
|
// 行取消
|
|
1686
1710
|
rowCancel(t, e) {
|
|
1687
|
-
|
|
1711
|
+
u(t[this.rowKey]) ? (this.list.splice(e, 1), delete this.cascaderDIC[e]) : (this.cascaderFormList[e].$cellEdit = !1, this.$set(this.cascaderDIC, e, this.cascaderDicList[e]), this.$set(this.list, e, this.cascaderFormList[e])), delete this.cascaderDicList[e], delete this.cascaderFormList[e], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1);
|
|
1688
1712
|
},
|
|
1689
1713
|
// 行编辑点击
|
|
1690
1714
|
rowCell(t, e) {
|
|
1691
1715
|
t.$cellEdit ? this.rowCellUpdate(t, e) : this.rowCellEdit(t, e);
|
|
1692
1716
|
},
|
|
1693
1717
|
rowCellUpdate(t, e) {
|
|
1694
|
-
t =
|
|
1718
|
+
t = c(t);
|
|
1695
1719
|
const i = this.validateCellField(e), n = () => {
|
|
1696
1720
|
this.btnDisabledList[e] = !1, this.btnDisabled = !1, this.list[e].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1), delete this.cascaderFormList[e];
|
|
1697
1721
|
}, r = () => {
|
|
1698
1722
|
this.btnDisabledList[e] = !1, this.btnDisabled = !1;
|
|
1699
1723
|
};
|
|
1700
|
-
i && (this.btnDisabledList[e] = !0, this.btnDisabled = !0,
|
|
1724
|
+
i && (this.btnDisabledList[e] = !0, this.btnDisabled = !0, u(t[this.rowKey]) ? this.$emit("row-save", t, n, r) : this.$emit("row-update", t, e, n, r));
|
|
1701
1725
|
},
|
|
1702
1726
|
// 单元格编辑
|
|
1703
1727
|
rowCellEdit(t, e) {
|
|
1704
|
-
t.$cellEdit = !0, this.cascaderFormList[e] =
|
|
1728
|
+
t.$cellEdit = !0, this.cascaderFormList[e] = c(t), this.cascaderDicList[e] = c(this.cascaderDIC[e]);
|
|
1705
1729
|
},
|
|
1706
1730
|
// 对部分表单字段进行校验
|
|
1707
1731
|
validateCellForm() {
|
|
@@ -1739,15 +1763,15 @@ const We = je.exports, Ke = {
|
|
|
1739
1763
|
},
|
|
1740
1764
|
// 编辑
|
|
1741
1765
|
rowEdit(t, e) {
|
|
1742
|
-
this.tableForm =
|
|
1766
|
+
this.tableForm = c(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("edit");
|
|
1743
1767
|
},
|
|
1744
1768
|
// 复制
|
|
1745
1769
|
rowCopy(t) {
|
|
1746
|
-
this.tableForm =
|
|
1770
|
+
this.tableForm = c(t), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
|
|
1747
1771
|
},
|
|
1748
1772
|
// 查看
|
|
1749
1773
|
rowView(t, e) {
|
|
1750
|
-
this.tableForm =
|
|
1774
|
+
this.tableForm = c(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("view");
|
|
1751
1775
|
},
|
|
1752
1776
|
// 删除
|
|
1753
1777
|
rowDel(t, e) {
|
|
@@ -1766,31 +1790,31 @@ const We = je.exports, Ke = {
|
|
|
1766
1790
|
if (typeof this.summaryMethod == "function")
|
|
1767
1791
|
return this.summaryMethod(t);
|
|
1768
1792
|
const { columns: i, data: n } = t, r = [];
|
|
1769
|
-
return i.length > 0 && i.forEach((s,
|
|
1770
|
-
const
|
|
1771
|
-
if (
|
|
1772
|
-
const
|
|
1773
|
-
let
|
|
1774
|
-
switch (
|
|
1793
|
+
return i.length > 0 && i.forEach((s, o) => {
|
|
1794
|
+
const a = this.sumColumnList.find((f) => f.name === s.property);
|
|
1795
|
+
if (a) {
|
|
1796
|
+
const f = a.decimals || 2, d = a.label || "";
|
|
1797
|
+
let v = 1;
|
|
1798
|
+
switch (a.type) {
|
|
1775
1799
|
case "count":
|
|
1776
|
-
r[
|
|
1800
|
+
r[o] = d + n.length;
|
|
1777
1801
|
break;
|
|
1778
1802
|
case "avg":
|
|
1779
|
-
r[
|
|
1780
|
-
const
|
|
1781
|
-
return isNaN(
|
|
1782
|
-
}, 0), r[
|
|
1803
|
+
r[o] = n.map((p) => Number(p[s.property])).reduce((p, y) => {
|
|
1804
|
+
const C = Number(y);
|
|
1805
|
+
return isNaN(C) ? p : (p * (v - 1) + y) / v++;
|
|
1806
|
+
}, 0), r[o] = d + r[o].toFixed(f);
|
|
1783
1807
|
break;
|
|
1784
1808
|
case "sum":
|
|
1785
|
-
r[
|
|
1786
|
-
const
|
|
1787
|
-
return isNaN(
|
|
1788
|
-
}, 0), r[
|
|
1809
|
+
r[o] = n.map((p) => Number(p[s.property])).reduce((p, y) => {
|
|
1810
|
+
const C = Number(y);
|
|
1811
|
+
return isNaN(C) ? p : p + y;
|
|
1812
|
+
}, 0), r[o] = d + r[o].toFixed(f);
|
|
1789
1813
|
break;
|
|
1790
1814
|
}
|
|
1791
|
-
e[s.property] = r[
|
|
1815
|
+
e[s.property] = r[o];
|
|
1792
1816
|
} else
|
|
1793
|
-
r[
|
|
1817
|
+
r[o] = "";
|
|
1794
1818
|
}), this.sumsList = e, r;
|
|
1795
1819
|
},
|
|
1796
1820
|
tableDrop(t, e, i) {
|
|
@@ -1801,12 +1825,12 @@ const We = je.exports, Ke = {
|
|
|
1801
1825
|
return;
|
|
1802
1826
|
}
|
|
1803
1827
|
if (!window.Sortable) {
|
|
1804
|
-
|
|
1828
|
+
ye.logs("Sortable");
|
|
1805
1829
|
return;
|
|
1806
1830
|
}
|
|
1807
1831
|
window.Sortable.create(e, {
|
|
1808
|
-
ghostClass:
|
|
1809
|
-
chosenClass:
|
|
1832
|
+
ghostClass: h.ghostClass,
|
|
1833
|
+
chosenClass: h.ghostClass,
|
|
1810
1834
|
animation: 500,
|
|
1811
1835
|
delay: 0,
|
|
1812
1836
|
onEnd: (n) => i(n)
|
|
@@ -1815,10 +1839,10 @@ const We = je.exports, Ke = {
|
|
|
1815
1839
|
findData(t) {
|
|
1816
1840
|
let e = {};
|
|
1817
1841
|
const i = (n, r) => {
|
|
1818
|
-
n.forEach((s,
|
|
1842
|
+
n.forEach((s, o) => {
|
|
1819
1843
|
s[this.rowKey] === t && (e = {
|
|
1820
1844
|
item: s,
|
|
1821
|
-
index:
|
|
1845
|
+
index: o,
|
|
1822
1846
|
parentList: n,
|
|
1823
1847
|
parent: r
|
|
1824
1848
|
}), s[this.childrenKey] && i(s[this.childrenKey], s);
|
|
@@ -1828,9 +1852,9 @@ const We = je.exports, Ke = {
|
|
|
1828
1852
|
}
|
|
1829
1853
|
}
|
|
1830
1854
|
};
|
|
1831
|
-
var
|
|
1855
|
+
var _t = function() {
|
|
1832
1856
|
var e = this, i = e._self._c;
|
|
1833
|
-
return i("div", { staticClass: "avue-crud avue-crud--card" }, [e.tableOption.title ? i(e.tableOption.titleSize || "h2", { tag: "Component", style: e.tableOption.titleStyle }, [e._v(" " + e._s(e.tableOption.title) + " ")]) : e._e(), i(
|
|
1857
|
+
return i("div", { staticClass: "avue-crud avue-crud--card" }, [e.tableOption.title ? i(e.tableOption.titleSize || "h2", { tag: "Component", style: e.tableOption.titleStyle }, [e._v(" " + e._s(e.tableOption.title) + " ")]) : e._e(), i(G, { ref: "headerSearch", scopedSlots: e._u([{ key: "search", fn: function(n) {
|
|
1834
1858
|
return [e._t("search", null, null, n)];
|
|
1835
1859
|
} }, { key: "searchMenu", fn: function(n) {
|
|
1836
1860
|
return [e._t("searchMenu", null, null, n)];
|
|
@@ -1838,14 +1862,14 @@ var Ue = function() {
|
|
|
1838
1862
|
return { key: n, fn: function(r) {
|
|
1839
1863
|
return [e._t(n, null, null, r)];
|
|
1840
1864
|
} };
|
|
1841
|
-
})], null, !0) }), e.optVal(e.tableOption.header, !0) ? i(
|
|
1865
|
+
})], null, !0) }), e.optVal(e.tableOption.header, !0) ? i(U, { ref: "headerMenu", scopedSlots: e._u([{ key: "menuLeft", fn: function(n) {
|
|
1842
1866
|
return [e._t("menuLeft", null, null, n)];
|
|
1843
1867
|
} }, { key: "menuRight", fn: function(n) {
|
|
1844
1868
|
return [e._t("menuRight", null, null, n)];
|
|
1845
|
-
} }], null, !0) }) : e._e(), e.optVal(e.tableOption.tip, e.config.tip) && e.tableOption.selection ? i(
|
|
1846
|
-
return [e.$slots.empty ? e._t("empty") : i(
|
|
1847
|
-
}, proxy: !0 }], null, !0) }, [i(
|
|
1848
|
-
return [i(
|
|
1869
|
+
} }], null, !0) }) : e._e(), e.optVal(e.tableOption.tip, e.config.tip) && e.tableOption.selection ? i(he, { staticClass: "avue-crud__tip" }, [i("span", { staticClass: "avue-crud__tip-name" }, [e._v(" 当前表格已选择 "), i("span", { staticClass: "avue-crud__tip-count" }, [e._v(e._s(e.selectLen))]), e._v(" 项 ")]), e.optVal(e.tableOption.selectClearBtn, e.config.selectClearBtn) && e.tableOption.selection ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.getPermission("selectClearBtn"), expression: "getPermission('selectClearBtn')" }], attrs: { type: "text", size: "small" }, on: { click: e.selectClear } }, [e._v(" 清 空 ")]) : e._e(), e._t("tip")], 2) : e._e(), e._t("header"), i(pe, { ref: "cellForm", attrs: { model: e.cellForm, "show-message": !1 }, on: { validate: e.handleValidate } }, [i(M, { directives: [{ name: "loading", rawName: "v-loading", value: e.tableLoading, expression: "tableLoading" }], key: e.reload, ref: "table", class: { "avue-crud--indeterminate": e.optVal(e.tableOption.indeterminate, !1) }, attrs: { data: e.cellForm.list, "row-key": e.rowKey, size: e.$AVUE.tableSize || e.controlSize, lazy: e.optVal(e.tableOption.lazy, !1), load: e.treeLoad, "tree-props": e.treeProps, "expand-row-keys": e.tableOption.expandRowKeys, "default-expand-all": e.tableOption.defaultExpandAll, "highlight-current-row": e.tableOption.highlightCurrentRow, "show-summary": e.tableOption.showSummary, "summary-method": e.tableSummaryMethod, "span-method": e.tableSpanMethod, stripe: e.tableOption.stripe, "show-header": e.tableOption.showHeader, "default-sort": e.tableOption.defaultSort, "row-class-name": e.rowClassName, "cell-class-name": e.cellClassName, "row-style": e.rowStyle, "cell-style": e.cellStyle, fit: e.tableOption.fit, "header-cell-class-name": e.headerCellClassName, "max-height": e.isAutoHeight ? e.tableHeight : e.tableOption.maxHeight, height: e.tableHeight, width: e.setPx(e.tableOption.width, e.config.width), border: e.tableOption.border }, on: { "current-change": e.currentRowChange, "expand-change": e.expandChange, "header-dragend": e.headerDragend, "row-click": e.rowClick, "row-dblclick": e.rowDblclick, "cell-mouse-enter": e.cellMouseEnter, "cell-mouse-leave": e.cellMouseLeave, "cell-click": e.cellClick, "header-click": e.headerClick, "row-contextmenu": e.rowContextmenu, "header-contextmenu": e.headerContextmenu, "cell-dblclick": e.cellDblclick, "filter-change": e.filterChange, "selection-change": e.selectionChange, select: e.select, "select-all": e.selectAll, "sort-change": e.sortChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
|
|
1870
|
+
return [e.$slots.empty ? e._t("empty") : i(de, { staticClass: "avue-crud__empty", attrs: { "image-size": 100, description: e.tableOption.emptyText } })];
|
|
1871
|
+
}, proxy: !0 }], null, !0) }, [i(K, { attrs: { "column-option": e.columnOption }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
1872
|
+
return [i(j, { ref: "columnDefault", scopedSlots: e._u([{ key: "expand", fn: function({ row: n, index: r }) {
|
|
1849
1873
|
return [e._t("expand", null, { row: n, index: r })];
|
|
1850
1874
|
} }], null, !0) })];
|
|
1851
1875
|
}, proxy: !0 }, e._l(e.mainSlot, function(n) {
|
|
@@ -1853,27 +1877,27 @@ var Ue = function() {
|
|
|
1853
1877
|
return [e._t(n, null, null, r)];
|
|
1854
1878
|
} };
|
|
1855
1879
|
}), { key: "footer", fn: function() {
|
|
1856
|
-
return [i(
|
|
1880
|
+
return [i(N, { scopedSlots: e._u([{ key: "menu", fn: function(n) {
|
|
1857
1881
|
return [e._t("menu", null, null, n)];
|
|
1858
1882
|
} }, { key: "menuBtn", fn: function(n) {
|
|
1859
1883
|
return [e._t("menuBtn", null, null, n)];
|
|
1860
1884
|
} }], null, !0) })];
|
|
1861
|
-
}, proxy: !0 }], null, !0) })], 1)], 1), e._t("footer"), i(
|
|
1885
|
+
}, proxy: !0 }], null, !0) })], 1)], 1), e._t("footer"), i(H, { ref: "tablePage" }), i(A, { ref: "dialogForm", scopedSlots: e._u([e._l(e.formSlot, function(n) {
|
|
1862
1886
|
return { key: n, fn: function(r) {
|
|
1863
1887
|
return [e._t(n, null, null, r)];
|
|
1864
1888
|
} };
|
|
1865
1889
|
}), { key: "menuForm", fn: function(n) {
|
|
1866
1890
|
return [e._t("menuForm", null, null, n)];
|
|
1867
|
-
} }], null, !0) }), i(
|
|
1868
|
-
},
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1891
|
+
} }], null, !0) }), i(R, { ref: "dialogColumn" }), i(V, { ref: "dialogExcel" }), i(L, { ref: "dialogFilter" })], 2);
|
|
1892
|
+
}, bt = [], vt = /* @__PURE__ */ g(
|
|
1893
|
+
gt,
|
|
1894
|
+
_t,
|
|
1895
|
+
bt,
|
|
1872
1896
|
!1,
|
|
1873
1897
|
null,
|
|
1874
1898
|
null
|
|
1875
1899
|
);
|
|
1876
|
-
const
|
|
1900
|
+
const ii = vt.exports;
|
|
1877
1901
|
export {
|
|
1878
|
-
|
|
1902
|
+
ii as default
|
|
1879
1903
|
};
|