@fangzhongya/fang-ui 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/array/src/index.cjs +6 -9
- package/dist/components/array/src/index.js +6 -9
- package/dist/components/box/index.css +12 -12
- package/dist/components/box/index.scss +1 -6
- package/dist/components/box-local/index.css +12 -12
- package/dist/components/cascader/index.d.ts +1 -1
- package/dist/components/cascader/src/index.d.ts +2 -2
- package/dist/components/checks/src/index.cjs +4 -4
- package/dist/components/checks/src/index.js +4 -4
- package/dist/components/common/list.cjs +2 -3
- package/dist/components/common/list.js +2 -3
- package/dist/components/common/use.cjs +11 -11
- package/dist/components/common/use.js +11 -11
- package/dist/components/cs-slot/src/index.cjs +6 -6
- package/dist/components/cs-slot/src/index.js +6 -6
- package/dist/components/dialog/src/index.cjs +7 -7
- package/dist/components/dialog/src/index.js +4 -4
- package/dist/components/dialog/style/index2.scss +1 -1
- package/dist/components/edit-float/src/index2.cjs +2 -2
- package/dist/components/edit-float/src/index2.js +2 -2
- package/dist/components/forms/index.d.ts +52 -149
- package/dist/components/forms/src/index.cjs +10 -9
- package/dist/components/forms/src/index.d.ts +102 -297
- package/dist/components/forms/src/index.js +4 -3
- package/dist/components/forms/src/setup.cjs +5 -8
- package/dist/components/forms/src/setup.js +5 -8
- package/dist/components/forms/src/util.cjs +1 -2
- package/dist/components/forms/src/util.js +1 -2
- package/dist/components/forms/style/index2.scss +6 -0
- package/dist/components/forms-div/style/index2.scss +1 -0
- package/dist/components/forms-drag/src/index.cjs +2 -2
- package/dist/components/forms-drag/src/index.js +2 -2
- package/dist/components/forms-item/src/index.cjs +7 -7
- package/dist/components/forms-item/src/index.js +2 -2
- package/dist/components/forms-item/style/index2.scss +4 -0
- package/dist/components/forms-items/src/index.cjs +2 -2
- package/dist/components/forms-items/src/index.js +2 -2
- package/dist/components/forms-items/style/index2.scss +2 -0
- package/dist/components/global-config/src/index.cjs +1 -1
- package/dist/components/global-config/src/index.js +1 -1
- package/dist/components/icon-picker/src/index.cjs +4 -6
- package/dist/components/icon-picker/src/index.js +4 -6
- package/dist/components/index.cjs +16 -14
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.js +10 -8
- package/dist/components/index.scss +6 -4
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/src/index.d.ts +2 -2
- package/dist/components/input-number/index.d.ts +1 -1
- package/dist/components/input-number/src/index.d.ts +2 -2
- package/dist/components/input-select/index.d.ts +1 -1
- package/dist/components/input-select/src/index.d.ts +2 -2
- package/dist/components/input-select/src/index2.cjs +1 -1
- package/dist/components/input-select/src/index2.js +1 -1
- package/dist/components/labels/src/index2.cjs +1 -2
- package/dist/components/labels/src/index2.js +1 -2
- package/dist/components/lists/common/img.cjs +1 -1
- package/dist/components/lists/common/img.d.ts +2 -0
- package/dist/components/lists/common/img.js +1 -1
- package/dist/components/lists/common/img2.cjs +5 -8
- package/dist/components/lists/common/img2.js +6 -9
- package/dist/components/menus/src/index.cjs +2 -2
- package/dist/components/menus/src/index.js +1 -1
- package/dist/components/menus/src/menu-ll.cjs +7 -7
- package/dist/components/menus/src/menu-ll.js +2 -2
- package/dist/components/menus/style/index2.scss +5 -0
- package/dist/components/page/index.css +245 -0
- package/dist/components/page/index.d.ts +3073 -0
- package/dist/components/page/index.scss +4 -0
- package/dist/components/page/src/index.cjs +81 -99
- package/dist/components/page/src/index.d.ts +5111 -0
- package/dist/components/page/src/index.js +70 -88
- package/dist/components/page/src/set-column2.cjs +2 -2
- package/dist/components/page/src/set-column2.js +2 -2
- package/dist/components/page/style/index2.scss +9 -0
- package/dist/components/{pagin → paging}/index.cjs +3 -3
- package/dist/components/{pagin → paging}/index.css +4 -3
- package/dist/components/{pagin → paging}/index.d.ts +2 -2
- package/dist/components/{pagin → paging}/index.js +3 -3
- package/dist/components/{pagin → paging}/index.scss +3 -2
- package/dist/components/{pagin → paging}/src/index.cjs +3 -3
- package/dist/components/{pagin → paging}/src/index.js +2 -2
- package/dist/components/paging/style/index2.scss +3 -0
- package/dist/components/right-key/index.d.ts +15 -0
- package/dist/components/right-key/src/data.cjs +4 -0
- package/dist/components/right-key/src/data.d.ts +4 -0
- package/dist/components/right-key/src/data.js +4 -0
- package/dist/components/right-key/src/index.cjs +5 -1
- package/dist/components/right-key/src/index.d.ts +9 -0
- package/dist/components/right-key/src/index.js +5 -1
- package/dist/components/role-select/src/index.cjs +1 -1
- package/dist/components/role-select/src/index.js +1 -1
- package/dist/components/selector/src/index2.cjs +2 -2
- package/dist/components/selector/src/index2.js +2 -2
- package/dist/components/selects/src/index.cjs +1 -1
- package/dist/components/selects/src/index.js +1 -1
- package/dist/components/stick-window/src/index.cjs +1 -1
- package/dist/components/stick-window/src/index.js +1 -1
- package/dist/components/switchs/src/index.cjs +4 -4
- package/dist/components/switchs/src/index.js +4 -4
- package/dist/components/table-list/src/table-list.cjs +10 -15
- package/dist/components/table-list/src/table-list.js +10 -15
- package/dist/components/tables/common/pagin.cjs +40 -57
- package/dist/components/tables/common/pagin.js +40 -57
- package/dist/components/tables/common/table-but.cjs +1 -2
- package/dist/components/tables/common/table-but.js +1 -2
- package/dist/components/tables/common/table-color.cjs +4 -5
- package/dist/components/tables/common/table-color.js +4 -5
- package/dist/components/tables/common/table-list.cjs +1 -2
- package/dist/components/tables/common/table-list.js +1 -2
- package/dist/components/tables/common/util.cjs +2 -3
- package/dist/components/tables/common/util.js +2 -3
- package/dist/components/tables/index.css +12 -15
- package/dist/components/tables/index.d.ts +1730 -0
- package/dist/components/tables/index.scss +17 -23
- package/dist/components/{el-tables → tables}/src/column.cjs +3 -3
- package/dist/components/{el-tables → tables}/src/column.js +2 -2
- package/dist/components/{el-tables → tables}/src/columns.cjs +3 -3
- package/dist/components/{el-tables → tables}/src/columns.js +3 -3
- package/dist/components/{el-tables → tables}/src/columns3.cjs +6 -6
- package/dist/components/{el-tables → tables}/src/columns3.js +3 -3
- package/dist/components/tables/src/index.cjs +158 -98
- package/dist/components/tables/src/index.d.ts +3103 -0
- package/dist/components/tables/src/index.js +158 -98
- package/dist/components/tables/style/index2.scss +5 -0
- package/dist/components/tables-form/index.cjs +1 -0
- package/dist/components/tables-form/index.js +1 -0
- package/dist/components/tables-form/index.scss +0 -0
- package/dist/components/tables-form/src/columns3.cjs +1 -1
- package/dist/components/tables-form/src/columns3.js +1 -1
- package/dist/components/tables-form/src/index.cjs +4 -7
- package/dist/components/tables-form/src/index.js +4 -7
- package/dist/components/tables-form/style/index.scss.cjs +1 -0
- package/dist/components/tables-form/style/index.scss.js +1 -0
- package/dist/components/tables-form/style/index2.scss +0 -0
- package/dist/components/{el-tables → tablesp}/index.cjs +3 -3
- package/dist/components/{tables-pagin → tablesp}/index.css +10 -9
- package/dist/components/tablesp/index.d.ts +1939 -0
- package/dist/components/{el-tables → tablesp}/index.js +3 -3
- package/dist/components/{tables-pagin → tablesp}/index.scss +5 -5
- package/dist/components/{tables-pagin → tablesp}/src/index.cjs +7 -8
- package/dist/components/tablesp/src/index.d.ts +3540 -0
- package/dist/components/{tables-pagin → tablesp}/src/index.js +7 -8
- package/dist/components/tablesp/style/index2.scss +4 -0
- package/dist/components/{vxe-tables → tabless}/index.cjs +3 -3
- package/dist/components/{el-tables → tabless}/index.css +15 -12
- package/dist/components/tabless/index.d.ts +1939 -0
- package/dist/components/{vxe-tables → tabless}/index.js +3 -3
- package/dist/components/tabless/index.scss +32 -0
- package/dist/components/tabless/src/index.cjs +118 -0
- package/dist/components/tabless/src/index.d.ts +3540 -0
- package/dist/components/tabless/src/index.js +118 -0
- package/dist/components/tabless/style/index2.scss +5 -0
- package/dist/components/{tables-pagin → tablesv}/index.cjs +3 -3
- package/dist/components/{vxe-tables → tablesv}/index.css +17 -17
- package/dist/components/{vxe-tables → tablesv}/index.d.ts +2 -2
- package/dist/components/{tables-pagin → tablesv}/index.js +3 -3
- package/dist/components/{vxe-tables → tablesv}/index.scss +2 -2
- package/dist/components/{vxe-tables → tablesv}/src/columns3.cjs +1 -1
- package/dist/components/{vxe-tables → tablesv}/src/columns3.js +1 -1
- package/dist/components/{vxe-tables → tablesv}/src/index.cjs +3 -4
- package/dist/components/{vxe-tables → tablesv}/src/index.js +3 -4
- package/dist/components/tablesv/style/index2.scss +1 -0
- package/dist/components/tablesvp/index.cjs +8 -0
- package/dist/components/tablesvp/index.css +130 -0
- package/dist/components/tablesvp/index.d.ts +480 -0
- package/dist/components/tablesvp/index.js +8 -0
- package/dist/components/tablesvp/index.scss +33 -0
- package/dist/components/tablesvp/src/data.d.ts +14 -0
- package/dist/components/tablesvp/src/index.cjs +86 -0
- package/dist/components/tablesvp/src/index.d.ts +630 -0
- package/dist/components/tablesvp/src/index.js +86 -0
- package/dist/components/tablesvp/src/index2.cjs +4 -0
- package/dist/components/tablesvp/src/index2.js +4 -0
- package/dist/components/tablesvp/style/index2.scss +4 -0
- package/dist/directives/adjust/index.cjs +1 -2
- package/dist/directives/adjust/index.js +1 -2
- package/dist/expand/{chunk-B6EXENNS.cjs → chunk-P5447R3I.cjs} +5 -4
- package/dist/expand/{chunk-Y7QESZWG.js → chunk-VZAQ2FM7.js} +5 -4
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/hooks/global-config/index.cjs +2 -5
- package/dist/hooks/global-config/index.js +2 -5
- package/dist/index.cjs +34 -32
- package/dist/index.css +130 -50
- package/dist/index.js +10 -8
- package/dist/index2.css +1 -1
- package/package.json +9 -9
- package/dist/components/el-tables/index.scss +0 -26
- package/dist/components/el-tables/src/index.cjs +0 -175
- package/dist/components/el-tables/src/index.js +0 -175
- /package/dist/components/{forms-items → forms-item}/index.css +0 -0
- /package/dist/components/{pagin → paging}/src/index.d.ts +0 -0
- /package/dist/components/{el-tables → paging}/src/index2.cjs +0 -0
- /package/dist/components/{el-tables → paging}/src/index2.js +0 -0
- /package/dist/components/{el-tables → tables}/src/column.d.ts +0 -0
- /package/dist/components/{el-tables → tables}/src/columns.d.ts +0 -0
- /package/dist/components/{el-tables → tables}/src/columns2.cjs +0 -0
- /package/dist/components/{el-tables → tables}/src/columns2.js +0 -0
- /package/dist/components/{el-tables → tables}/src/data.cjs +0 -0
- /package/dist/components/{el-tables → tables}/src/data.d.ts +0 -0
- /package/dist/components/{el-tables → tables}/src/data.js +0 -0
- /package/dist/components/{tables-pagin → tablesp}/src/data.d.ts +0 -0
- /package/dist/components/{pagin → tablesp}/src/index2.cjs +0 -0
- /package/dist/components/{pagin → tablesp}/src/index2.js +0 -0
- /package/dist/components/{tables-pagin → tabless}/src/index2.cjs +0 -0
- /package/dist/components/{tables-pagin → tabless}/src/index2.js +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/column.cjs +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/column.d.ts +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/column.js +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/columns.cjs +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/columns.d.ts +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/columns.js +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/columns2.cjs +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/columns2.js +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/data.cjs +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/data.d.ts +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/data.js +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/index.d.ts +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/index2.cjs +0 -0
- /package/dist/components/{vxe-tables → tablesv}/src/index2.js +0 -0
|
@@ -3,10 +3,12 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const index = require("../../../hooks/cssname/index.cjs");
|
|
5
5
|
const index$2 = require("../../forms/index.cjs");
|
|
6
|
-
const index$
|
|
6
|
+
const index$5 = require("../../tablesp/index.cjs");
|
|
7
7
|
const index$3 = require("../../lists/index.cjs");
|
|
8
8
|
const index$1 = require("../../dialog/index.cjs");
|
|
9
|
-
const
|
|
9
|
+
const index$4 = require("element-plus/es/components/button/index");
|
|
10
|
+
const index$6 = require("element-plus/es/components/message/index");
|
|
11
|
+
const index$7 = require("element-plus/es/components/message-box/index");
|
|
10
12
|
const setColumn = require("./set-column.cjs");
|
|
11
13
|
const urls = require("../../common/urls.cjs");
|
|
12
14
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -109,8 +111,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
109
111
|
const query = vue.ref(props.value);
|
|
110
112
|
const isSenior = vue.ref(false);
|
|
111
113
|
const getListQuery = () => {
|
|
112
|
-
|
|
113
|
-
const v = (_a = props.config.query) == null ? void 0 : _a.list;
|
|
114
|
+
const v = props.config.query?.list;
|
|
114
115
|
if (v && Array.isArray(v) && v.length > 0) {
|
|
115
116
|
return getColumnList(v);
|
|
116
117
|
} else {
|
|
@@ -123,9 +124,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
124
|
};
|
|
124
125
|
const listQuery = vue.ref([]);
|
|
125
126
|
const setListQuery = () => {
|
|
126
|
-
var _a;
|
|
127
127
|
const list2 = getListQuery();
|
|
128
|
-
if (
|
|
128
|
+
if (props.config.query?.senior) {
|
|
129
129
|
let i = 0;
|
|
130
130
|
list2.forEach((obj) => {
|
|
131
131
|
if (obj.querybasis) {
|
|
@@ -143,8 +143,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
143
143
|
listQuery.value = list2;
|
|
144
144
|
};
|
|
145
145
|
const onRefresh = () => {
|
|
146
|
-
|
|
147
|
-
(_a = tableRef.value) == null ? void 0 : _a.getList();
|
|
146
|
+
tableRef.value?.getList();
|
|
148
147
|
};
|
|
149
148
|
const onQuery = (data) => {
|
|
150
149
|
console.log("onQuery", data);
|
|
@@ -152,9 +151,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
152
151
|
onRefresh();
|
|
153
152
|
};
|
|
154
153
|
const onReset = (data) => {
|
|
155
|
-
var _a;
|
|
156
154
|
console.log("onReset", data);
|
|
157
|
-
if (
|
|
155
|
+
if (props.config.query?.reset) {
|
|
158
156
|
query.value = data;
|
|
159
157
|
onRefresh();
|
|
160
158
|
}
|
|
@@ -170,7 +168,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
170
168
|
};
|
|
171
169
|
const butQuery = vue.ref([]);
|
|
172
170
|
const getButQuery = () => {
|
|
173
|
-
var _a;
|
|
174
171
|
const arr = [
|
|
175
172
|
{
|
|
176
173
|
_id: "1",
|
|
@@ -183,7 +180,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
183
180
|
type: "default"
|
|
184
181
|
}
|
|
185
182
|
];
|
|
186
|
-
if (
|
|
183
|
+
if (props.config.query?.senior) {
|
|
187
184
|
const obj = {
|
|
188
185
|
_id: "3",
|
|
189
186
|
label: "高级",
|
|
@@ -219,9 +216,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
219
216
|
setList.value = getList();
|
|
220
217
|
};
|
|
221
218
|
const tableList = vue.computed(() => {
|
|
222
|
-
var _a;
|
|
223
219
|
const arr = [];
|
|
224
|
-
if (
|
|
220
|
+
if (props.config.table?.operation !== false) {
|
|
225
221
|
arr.push({
|
|
226
222
|
prop: "operation",
|
|
227
223
|
label: "操作",
|
|
@@ -234,9 +230,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
234
230
|
});
|
|
235
231
|
let operationColumn = [];
|
|
236
232
|
const getOperationColumn = () => {
|
|
237
|
-
var _a, _b, _c;
|
|
238
233
|
const array = [];
|
|
239
|
-
if (
|
|
234
|
+
if (props.config.edit?.is !== false) {
|
|
240
235
|
array.push({
|
|
241
236
|
prop: 2,
|
|
242
237
|
label: "编辑",
|
|
@@ -244,7 +239,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
244
239
|
text: true
|
|
245
240
|
});
|
|
246
241
|
}
|
|
247
|
-
if (
|
|
242
|
+
if (props.config.delete?.is !== false) {
|
|
248
243
|
array.push({
|
|
249
244
|
prop: 4,
|
|
250
245
|
label: "删除",
|
|
@@ -252,7 +247,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
252
247
|
text: true
|
|
253
248
|
});
|
|
254
249
|
}
|
|
255
|
-
if (
|
|
250
|
+
if (props.config.details?.is !== false) {
|
|
256
251
|
array.push({
|
|
257
252
|
prop: 9,
|
|
258
253
|
label: "详情",
|
|
@@ -264,16 +259,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
264
259
|
};
|
|
265
260
|
let operationTop = [];
|
|
266
261
|
const getOperationTop = () => {
|
|
267
|
-
var _a, _b, _c;
|
|
268
262
|
const array = [];
|
|
269
|
-
if (
|
|
263
|
+
if (props.config.add?.is !== false) {
|
|
270
264
|
array.push({
|
|
271
265
|
prop: 1,
|
|
272
266
|
label: "添加",
|
|
273
267
|
type: "primary"
|
|
274
268
|
});
|
|
275
269
|
}
|
|
276
|
-
if (
|
|
270
|
+
if (props.config.delete?.is !== false && tableConfig.value.config?.ischecked) {
|
|
277
271
|
array.push({
|
|
278
272
|
prop: 8,
|
|
279
273
|
label: "批量删除",
|
|
@@ -283,43 +277,41 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
283
277
|
return array;
|
|
284
278
|
};
|
|
285
279
|
const onDelete = (array) => {
|
|
286
|
-
var _a, _b, _c;
|
|
287
280
|
const ts = ["是否删除所选" + props.config.name + "?"];
|
|
288
|
-
const label =
|
|
289
|
-
const prop =
|
|
290
|
-
const name =
|
|
281
|
+
const label = props.config.delete?.label || "name";
|
|
282
|
+
const prop = props.config.delete?.prop || "id";
|
|
283
|
+
const name = listObj[label]?.label || "内容";
|
|
291
284
|
array.forEach((obj) => {
|
|
292
285
|
ts.push(name + ":" + (obj[label] ?? ""));
|
|
293
286
|
});
|
|
294
|
-
|
|
287
|
+
index$7.ElMessageBox.confirm(ts.join("<br>"), "提示", {
|
|
295
288
|
confirmButtonText: "确认",
|
|
296
289
|
cancelButtonText: "取消",
|
|
297
290
|
type: "warning",
|
|
298
291
|
dangerouslyUseHTMLString: true
|
|
299
292
|
}).then(() => {
|
|
300
|
-
|
|
301
|
-
const name2 = ((_a2 = props.config.delete) == null ? void 0 : _a2.name) || "ids";
|
|
293
|
+
const name2 = props.config.delete?.name || "ids";
|
|
302
294
|
const value = { [name2]: array.map((o) => o[prop]) };
|
|
303
295
|
console.log("onDelete", value);
|
|
304
|
-
const ajax =
|
|
296
|
+
const ajax = props.config.delete?.ajax;
|
|
305
297
|
if (ajax) {
|
|
306
298
|
const param = {
|
|
307
299
|
param: props.value
|
|
308
300
|
};
|
|
309
301
|
if (typeof ajax === "object") {
|
|
310
|
-
param.onRequestBefore = ajax
|
|
311
|
-
param.onRequestAfter = ajax
|
|
312
|
-
param.ajax = ajax
|
|
313
|
-
param.ajaxConfig = ajax
|
|
302
|
+
param.onRequestBefore = ajax?.onRequestBefore;
|
|
303
|
+
param.onRequestAfter = ajax?.onRequestAfter;
|
|
304
|
+
param.ajax = ajax?.url;
|
|
305
|
+
param.ajaxConfig = ajax?.config;
|
|
314
306
|
} else {
|
|
315
307
|
param.ajax = ajax;
|
|
316
308
|
}
|
|
317
309
|
urls.comHandle(param, value).then((res) => {
|
|
318
310
|
if (res.result) {
|
|
319
|
-
|
|
311
|
+
index$6.ElMessage.success(res.info || "删除成功");
|
|
320
312
|
onRefresh();
|
|
321
313
|
} else {
|
|
322
|
-
|
|
314
|
+
index$6.ElMessage.error(res.info || "删除失败");
|
|
323
315
|
}
|
|
324
316
|
}).catch((err) => {
|
|
325
317
|
console.error("删除失败", err);
|
|
@@ -333,10 +325,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
333
325
|
});
|
|
334
326
|
};
|
|
335
327
|
const onOperation = (item, row = {}) => {
|
|
336
|
-
var _a, _b;
|
|
337
328
|
if (item.prop === 1) {
|
|
338
329
|
dialog.value = {
|
|
339
|
-
...
|
|
330
|
+
...props.config.add?.value
|
|
340
331
|
};
|
|
341
332
|
dialog.type = "add";
|
|
342
333
|
dialog.visible = true;
|
|
@@ -350,23 +341,23 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
350
341
|
} else if (item.prop === 8) {
|
|
351
342
|
console.log("批量删除", selection.value);
|
|
352
343
|
if (selection.value.length === 0) {
|
|
353
|
-
|
|
344
|
+
index$6.ElMessage.warning("请至少选择一条记录");
|
|
354
345
|
return;
|
|
355
346
|
}
|
|
356
347
|
onDelete(selection.value);
|
|
357
348
|
} else if (item.prop === 9) {
|
|
358
349
|
details.value = row;
|
|
359
350
|
details.visible = true;
|
|
360
|
-
const ajax =
|
|
351
|
+
const ajax = props.config.details?.ajax;
|
|
361
352
|
if (ajax) {
|
|
362
353
|
const param = {
|
|
363
354
|
param: props.value
|
|
364
355
|
};
|
|
365
356
|
if (typeof ajax === "object") {
|
|
366
|
-
param.onRequestBefore = ajax
|
|
367
|
-
param.onRequestAfter = ajax
|
|
368
|
-
param.ajax = ajax
|
|
369
|
-
param.ajaxConfig = ajax
|
|
357
|
+
param.onRequestBefore = ajax?.onRequestBefore;
|
|
358
|
+
param.onRequestAfter = ajax?.onRequestAfter;
|
|
359
|
+
param.ajax = ajax?.url;
|
|
360
|
+
param.ajaxConfig = ajax?.config;
|
|
370
361
|
} else {
|
|
371
362
|
param.ajax = ajax;
|
|
372
363
|
}
|
|
@@ -375,7 +366,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
375
366
|
details.value = res.data || row;
|
|
376
367
|
details.visible = true;
|
|
377
368
|
} else {
|
|
378
|
-
|
|
369
|
+
index$6.ElMessage.error(res.info || "查询详情失败");
|
|
379
370
|
}
|
|
380
371
|
}).catch((err) => {
|
|
381
372
|
console.error("查询详情失败", err);
|
|
@@ -433,31 +424,30 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
433
424
|
const onConfirm = () => {
|
|
434
425
|
if (formRef.value) {
|
|
435
426
|
formRef.value.validate().then((data) => {
|
|
436
|
-
var _a, _b;
|
|
437
427
|
if (dialog.type === "add") {
|
|
438
428
|
console.log("添加", data);
|
|
439
|
-
const ajax =
|
|
429
|
+
const ajax = props.config.add?.ajax;
|
|
440
430
|
if (ajax) {
|
|
441
431
|
const param = {
|
|
442
432
|
param: props.value
|
|
443
433
|
};
|
|
444
434
|
if (typeof ajax === "object") {
|
|
445
|
-
param.onRequestBefore = ajax
|
|
446
|
-
param.onRequestAfter = ajax
|
|
447
|
-
param.ajax = ajax
|
|
448
|
-
param.ajaxConfig = ajax
|
|
435
|
+
param.onRequestBefore = ajax?.onRequestBefore;
|
|
436
|
+
param.onRequestAfter = ajax?.onRequestAfter;
|
|
437
|
+
param.ajax = ajax?.url;
|
|
438
|
+
param.ajaxConfig = ajax?.config;
|
|
449
439
|
} else {
|
|
450
440
|
param.ajax = ajax;
|
|
451
441
|
}
|
|
452
442
|
urls.comHandle(param, data).then((res) => {
|
|
453
443
|
if (res.result) {
|
|
454
|
-
|
|
444
|
+
index$6.ElMessage.success(
|
|
455
445
|
res.info || "添加成功"
|
|
456
446
|
);
|
|
457
447
|
dialog.visible = false;
|
|
458
448
|
onRefresh();
|
|
459
449
|
} else {
|
|
460
|
-
|
|
450
|
+
index$6.ElMessage.error(res.info || "添加失败");
|
|
461
451
|
}
|
|
462
452
|
}).catch((err) => {
|
|
463
453
|
console.error("添加失败", err);
|
|
@@ -470,28 +460,28 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
470
460
|
}
|
|
471
461
|
} else if (dialog.type === "edit") {
|
|
472
462
|
console.log("编辑", data);
|
|
473
|
-
const ajax =
|
|
463
|
+
const ajax = props.config.edit?.ajax;
|
|
474
464
|
if (ajax) {
|
|
475
465
|
const param = {
|
|
476
466
|
param: props.value
|
|
477
467
|
};
|
|
478
468
|
if (typeof ajax === "object") {
|
|
479
|
-
param.onRequestBefore = ajax
|
|
480
|
-
param.onRequestAfter = ajax
|
|
481
|
-
param.ajax = ajax
|
|
482
|
-
param.ajaxConfig = ajax
|
|
469
|
+
param.onRequestBefore = ajax?.onRequestBefore;
|
|
470
|
+
param.onRequestAfter = ajax?.onRequestAfter;
|
|
471
|
+
param.ajax = ajax?.url;
|
|
472
|
+
param.ajaxConfig = ajax?.config;
|
|
483
473
|
} else {
|
|
484
474
|
param.ajax = ajax;
|
|
485
475
|
}
|
|
486
476
|
urls.comHandle(param, data).then((res) => {
|
|
487
477
|
if (res.result) {
|
|
488
|
-
|
|
478
|
+
index$6.ElMessage.success(
|
|
489
479
|
res.info || "编辑成功"
|
|
490
480
|
);
|
|
491
481
|
dialog.visible = false;
|
|
492
482
|
onRefresh();
|
|
493
483
|
} else {
|
|
494
|
-
|
|
484
|
+
index$6.ElMessage.error(res.info || "编辑失败");
|
|
495
485
|
}
|
|
496
486
|
}).catch((err) => {
|
|
497
487
|
console.error("编辑失败", err);
|
|
@@ -509,9 +499,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
509
499
|
}
|
|
510
500
|
};
|
|
511
501
|
const getListForm = () => {
|
|
512
|
-
var _a, _b;
|
|
513
502
|
if (dialog.type === "edit") {
|
|
514
|
-
const v =
|
|
503
|
+
const v = props.config.edit?.list;
|
|
515
504
|
if (v && Array.isArray(v) && v.length > 0) {
|
|
516
505
|
return getColumnList(v);
|
|
517
506
|
} else {
|
|
@@ -520,7 +509,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
520
509
|
});
|
|
521
510
|
}
|
|
522
511
|
} else {
|
|
523
|
-
const v =
|
|
512
|
+
const v = props.config.add?.list;
|
|
524
513
|
if (v && Array.isArray(v) && v.length > 0) {
|
|
525
514
|
return getColumnList(v);
|
|
526
515
|
} else {
|
|
@@ -539,8 +528,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
539
528
|
value: {}
|
|
540
529
|
});
|
|
541
530
|
const getListDetails = () => {
|
|
542
|
-
|
|
543
|
-
const v = (_a = props.config.details) == null ? void 0 : _a.list;
|
|
531
|
+
const v = props.config.details?.list;
|
|
544
532
|
if (v && Array.isArray(v) && v.length > 0) {
|
|
545
533
|
return getColumnList(v);
|
|
546
534
|
} else {
|
|
@@ -554,19 +542,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
554
542
|
vue.watch(
|
|
555
543
|
() => props.config,
|
|
556
544
|
(newValue) => {
|
|
557
|
-
var _a, _b, _c, _d;
|
|
558
545
|
if (newValue) {
|
|
559
546
|
if (props.config.table) {
|
|
560
547
|
tableConfig.value = getTableConfig();
|
|
561
548
|
}
|
|
562
|
-
if (
|
|
549
|
+
if (props.config.query?.is !== false) {
|
|
563
550
|
setListQuery();
|
|
564
551
|
butQuery.value = getButQuery();
|
|
565
552
|
}
|
|
566
|
-
if (
|
|
553
|
+
if (props.config.details?.is !== false) {
|
|
567
554
|
setListDetails();
|
|
568
555
|
}
|
|
569
|
-
if (
|
|
556
|
+
if (props.config.add?.is !== false || props.config.edit?.is !== false) {
|
|
570
557
|
setListForm();
|
|
571
558
|
}
|
|
572
559
|
operationColumn = getOperationColumn();
|
|
@@ -581,16 +568,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
581
568
|
vue.watch(
|
|
582
569
|
() => props.list,
|
|
583
570
|
() => {
|
|
584
|
-
var _a, _b, _c, _d;
|
|
585
571
|
listObj = getListObj();
|
|
586
572
|
setSetList();
|
|
587
|
-
if (
|
|
573
|
+
if (props.config.query?.is !== false) {
|
|
588
574
|
setListQuery();
|
|
589
575
|
}
|
|
590
|
-
if (
|
|
576
|
+
if (props.config.details?.is !== false) {
|
|
591
577
|
setListDetails();
|
|
592
578
|
}
|
|
593
|
-
if (
|
|
579
|
+
if (props.config.add?.is !== false || props.config.edit?.is !== false) {
|
|
594
580
|
setListForm();
|
|
595
581
|
}
|
|
596
582
|
},
|
|
@@ -600,7 +586,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
600
586
|
}
|
|
601
587
|
);
|
|
602
588
|
return (_ctx, _cache) => {
|
|
603
|
-
var _a, _b, _c;
|
|
604
589
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
605
590
|
class: vue.normalizeClass(vue.unref(cs).z())
|
|
606
591
|
}, [
|
|
@@ -639,37 +624,34 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
639
624
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => details.visible = $event),
|
|
640
625
|
"no-footer": ""
|
|
641
626
|
}, {
|
|
642
|
-
default: vue.withCtx(() =>
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
]), 1040, ["value", "options", "compons", "list"])
|
|
660
|
-
];
|
|
661
|
-
}),
|
|
627
|
+
default: vue.withCtx(() => [
|
|
628
|
+
vue.createVNode(vue.unref(index$3.Lists), vue.mergeProps(props.config.details?.config, {
|
|
629
|
+
value: details.value,
|
|
630
|
+
options: props.options,
|
|
631
|
+
compons: props.compons,
|
|
632
|
+
list: list.value
|
|
633
|
+
}), vue.createSlots({ _: 2 }, [
|
|
634
|
+
vue.renderList(listSlots, (k) => {
|
|
635
|
+
return {
|
|
636
|
+
name: k,
|
|
637
|
+
fn: vue.withCtx((scope) => [
|
|
638
|
+
vue.unref(slots)["list-" + k] ? vue.renderSlot(_ctx.$slots, "list-" + k, vue.normalizeProps(vue.mergeProps({ key: 0 }, scope))) : vue.renderSlot(_ctx.$slots, k, vue.normalizeProps(vue.mergeProps({ key: 1 }, scope)))
|
|
639
|
+
])
|
|
640
|
+
};
|
|
641
|
+
})
|
|
642
|
+
]), 1040, ["value", "options", "compons", "list"])
|
|
643
|
+
]),
|
|
662
644
|
_: 3
|
|
663
645
|
}, 8, ["title", "modelValue"]),
|
|
664
646
|
vue.createElementVNode("div", {
|
|
665
647
|
class: vue.normalizeClass(vue.unref(cs).z("header"))
|
|
666
648
|
}, [
|
|
667
649
|
vue.renderSlot(_ctx.$slots, dataSlot.header),
|
|
668
|
-
|
|
650
|
+
props.config.query?.is !== false ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
669
651
|
key: 0,
|
|
670
652
|
class: vue.normalizeClass(vue.unref(cs).z("query"))
|
|
671
653
|
}, [
|
|
672
|
-
vue.createVNode(vue.unref(index$2.Forms), vue.mergeProps(
|
|
654
|
+
vue.createVNode(vue.unref(index$2.Forms), vue.mergeProps(props.config.query?.config, {
|
|
673
655
|
query: "",
|
|
674
656
|
"label-position": "auto",
|
|
675
657
|
"model-value": props.value,
|
|
@@ -705,7 +687,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
705
687
|
class: vue.normalizeClass(vue.unref(cs).z("top-operation"))
|
|
706
688
|
}, [
|
|
707
689
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(operationTop), (item, index2) => {
|
|
708
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
690
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$4.ElButton), {
|
|
709
691
|
key: index2,
|
|
710
692
|
type: item.type,
|
|
711
693
|
onClick: vue.withModifiers(($event) => onOperation(item), ["stop"])
|
|
@@ -725,10 +707,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
725
707
|
list: props.list
|
|
726
708
|
}, null, 8, ["modelValue", "list"])) : vue.createCommentVNode("", true)
|
|
727
709
|
], 2),
|
|
728
|
-
vue.createVNode(vue.unref(index$
|
|
710
|
+
vue.createVNode(vue.unref(index$5.Tablesp), {
|
|
729
711
|
ref_key: "tableRef",
|
|
730
712
|
ref: tableRef,
|
|
731
|
-
load:
|
|
713
|
+
load: props.config.query?.is === false,
|
|
732
714
|
config: tableConfig.value,
|
|
733
715
|
param: query.value,
|
|
734
716
|
options: props.options,
|
|
@@ -742,7 +724,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
742
724
|
class: vue.normalizeClass(vue.unref(cs).z("operations"))
|
|
743
725
|
}, [
|
|
744
726
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(operationColumn), (item, index2) => {
|
|
745
|
-
return vue.openBlock(), vue.createBlock(vue.unref(
|
|
727
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$4.ElButton), {
|
|
746
728
|
key: index2,
|
|
747
729
|
type: item.type,
|
|
748
730
|
text: item.text,
|