@epie/bi-crud 2.0.17 → 2.0.23
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/lib/bi-crud.esm.js +575 -127
- package/lib/bi-crud.umd.js +574 -124
- package/lib/components/add-btn.d.ts +1 -1
- package/lib/components/adv-btn.d.ts +1 -1
- package/lib/components/adv-search.d.ts +2 -2
- package/lib/components/context-menu/index.d.ts +1 -1
- package/lib/components/crud/index.d.ts +1 -10
- package/lib/components/descriptions/descriptions.d.ts +2 -2
- package/lib/components/error-message.d.ts +1 -1
- package/lib/components/export-btn.d.ts +2 -2
- package/lib/components/filter-group.d.ts +1 -1
- package/lib/components/filter.d.ts +1 -1
- package/lib/components/flex1.d.ts +1 -1
- package/lib/components/form/form.d.ts +2 -2
- package/lib/components/form/index.d.ts +1 -1
- package/lib/components/inline-search/inlinesearch.d.ts +2 -2
- package/lib/components/multi-delete-btn.d.ts +1 -1
- package/lib/components/pagination.d.ts +1 -1
- package/lib/components/refresh-btn.d.ts +1 -1
- package/lib/components/upsert/index.d.ts +2 -2
- package/lib/hooks/core.d.ts +3 -0
- package/lib/hooks/i18n.d.ts +1 -0
- package/lib/locales/en-US.d.ts +73 -0
- package/lib/locales/zh-CN.d.ts +73 -0
- package/lib/types/base/crud.d.ts +11 -10
- package/lib/types/base/render.d.ts +3 -6
- package/lib/types/base/table.d.ts +1 -1
- package/lib/utils/form.d.ts +7 -0
- package/package.json +3 -2
package/lib/bi-crud.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, getCurrentInstance, inject, reactive, provide, onMounted, createVNode, ref, watch, nextTick as nextTick$1, resolveComponent, openBlock, createElementBlock, createElementVNode, h, toRaw, mergeProps, withDirectives, vShow,
|
|
2
|
-
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
1
|
+
import { computed, defineComponent, getCurrentInstance, inject, reactive, provide, onMounted, createVNode, ref, watch, nextTick as nextTick$1, resolveComponent, openBlock, createElementBlock, createElementVNode, h, toRaw, mergeProps, withDirectives, vShow, resolveDirective, isVNode, Fragment, render, useSlots, isRef } from 'vue';
|
|
2
|
+
import { useGlobalConfig, buildLocaleContext, ElMessage, ElMessageBox } from 'element-plus';
|
|
3
3
|
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
5
|
|
|
@@ -8778,6 +8778,257 @@ const emitter$1 = {
|
|
|
8778
8778
|
|
|
8779
8779
|
};
|
|
8780
8780
|
|
|
8781
|
+
var en = {};
|
|
8782
|
+
|
|
8783
|
+
(function (exports) {
|
|
8784
|
+
|
|
8785
|
+
Object.defineProperty(exports, '__esModule', {
|
|
8786
|
+
value: true
|
|
8787
|
+
});
|
|
8788
|
+
var English = {
|
|
8789
|
+
name: "en",
|
|
8790
|
+
el: {
|
|
8791
|
+
colorpicker: {
|
|
8792
|
+
confirm: "OK",
|
|
8793
|
+
clear: "Clear",
|
|
8794
|
+
defaultLabel: "color picker",
|
|
8795
|
+
description: "current color is {color}. press enter to select a new color."
|
|
8796
|
+
},
|
|
8797
|
+
datepicker: {
|
|
8798
|
+
now: "Now",
|
|
8799
|
+
today: "Today",
|
|
8800
|
+
cancel: "Cancel",
|
|
8801
|
+
clear: "Clear",
|
|
8802
|
+
confirm: "OK",
|
|
8803
|
+
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
|
|
8804
|
+
monthTablePrompt: "Use the arrow keys and enter to select the month",
|
|
8805
|
+
yearTablePrompt: "Use the arrow keys and enter to select the year",
|
|
8806
|
+
selectedDate: "Selected date",
|
|
8807
|
+
selectDate: "Select date",
|
|
8808
|
+
selectTime: "Select time",
|
|
8809
|
+
startDate: "Start Date",
|
|
8810
|
+
startTime: "Start Time",
|
|
8811
|
+
endDate: "End Date",
|
|
8812
|
+
endTime: "End Time",
|
|
8813
|
+
prevYear: "Previous Year",
|
|
8814
|
+
nextYear: "Next Year",
|
|
8815
|
+
prevMonth: "Previous Month",
|
|
8816
|
+
nextMonth: "Next Month",
|
|
8817
|
+
year: "",
|
|
8818
|
+
month1: "January",
|
|
8819
|
+
month2: "February",
|
|
8820
|
+
month3: "March",
|
|
8821
|
+
month4: "April",
|
|
8822
|
+
month5: "May",
|
|
8823
|
+
month6: "June",
|
|
8824
|
+
month7: "July",
|
|
8825
|
+
month8: "August",
|
|
8826
|
+
month9: "September",
|
|
8827
|
+
month10: "October",
|
|
8828
|
+
month11: "November",
|
|
8829
|
+
month12: "December",
|
|
8830
|
+
week: "week",
|
|
8831
|
+
weeks: {
|
|
8832
|
+
sun: "Sun",
|
|
8833
|
+
mon: "Mon",
|
|
8834
|
+
tue: "Tue",
|
|
8835
|
+
wed: "Wed",
|
|
8836
|
+
thu: "Thu",
|
|
8837
|
+
fri: "Fri",
|
|
8838
|
+
sat: "Sat"
|
|
8839
|
+
},
|
|
8840
|
+
weeksFull: {
|
|
8841
|
+
sun: "Sunday",
|
|
8842
|
+
mon: "Monday",
|
|
8843
|
+
tue: "Tuesday",
|
|
8844
|
+
wed: "Wednesday",
|
|
8845
|
+
thu: "Thursday",
|
|
8846
|
+
fri: "Friday",
|
|
8847
|
+
sat: "Saturday"
|
|
8848
|
+
},
|
|
8849
|
+
months: {
|
|
8850
|
+
jan: "Jan",
|
|
8851
|
+
feb: "Feb",
|
|
8852
|
+
mar: "Mar",
|
|
8853
|
+
apr: "Apr",
|
|
8854
|
+
may: "May",
|
|
8855
|
+
jun: "Jun",
|
|
8856
|
+
jul: "Jul",
|
|
8857
|
+
aug: "Aug",
|
|
8858
|
+
sep: "Sep",
|
|
8859
|
+
oct: "Oct",
|
|
8860
|
+
nov: "Nov",
|
|
8861
|
+
dec: "Dec"
|
|
8862
|
+
}
|
|
8863
|
+
},
|
|
8864
|
+
inputNumber: {
|
|
8865
|
+
decrease: "decrease number",
|
|
8866
|
+
increase: "increase number"
|
|
8867
|
+
},
|
|
8868
|
+
select: {
|
|
8869
|
+
loading: "Loading",
|
|
8870
|
+
noMatch: "No matching data",
|
|
8871
|
+
noData: "No data",
|
|
8872
|
+
placeholder: "Select"
|
|
8873
|
+
},
|
|
8874
|
+
dropdown: {
|
|
8875
|
+
toggleDropdown: "Toggle Dropdown"
|
|
8876
|
+
},
|
|
8877
|
+
cascader: {
|
|
8878
|
+
noMatch: "No matching data",
|
|
8879
|
+
loading: "Loading",
|
|
8880
|
+
placeholder: "Select",
|
|
8881
|
+
noData: "No data"
|
|
8882
|
+
},
|
|
8883
|
+
pagination: {
|
|
8884
|
+
goto: "Go to",
|
|
8885
|
+
pagesize: "/page",
|
|
8886
|
+
total: "Total {total}",
|
|
8887
|
+
pageClassifier: "",
|
|
8888
|
+
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
|
|
8889
|
+
},
|
|
8890
|
+
dialog: {
|
|
8891
|
+
close: "Close this dialog"
|
|
8892
|
+
},
|
|
8893
|
+
drawer: {
|
|
8894
|
+
close: "Close this dialog"
|
|
8895
|
+
},
|
|
8896
|
+
messagebox: {
|
|
8897
|
+
title: "Message",
|
|
8898
|
+
confirm: "OK",
|
|
8899
|
+
cancel: "Cancel",
|
|
8900
|
+
error: "Illegal input",
|
|
8901
|
+
close: "Close this dialog"
|
|
8902
|
+
},
|
|
8903
|
+
upload: {
|
|
8904
|
+
deleteTip: "press delete to remove",
|
|
8905
|
+
delete: "Delete",
|
|
8906
|
+
preview: "Preview",
|
|
8907
|
+
continue: "Continue"
|
|
8908
|
+
},
|
|
8909
|
+
slider: {
|
|
8910
|
+
defaultLabel: "slider between {min} and {max}",
|
|
8911
|
+
defaultRangeStartLabel: "pick start value",
|
|
8912
|
+
defaultRangeEndLabel: "pick end value"
|
|
8913
|
+
},
|
|
8914
|
+
table: {
|
|
8915
|
+
emptyText: "No Data",
|
|
8916
|
+
confirmFilter: "Confirm",
|
|
8917
|
+
resetFilter: "Reset",
|
|
8918
|
+
clearFilter: "All",
|
|
8919
|
+
sumText: "Sum"
|
|
8920
|
+
},
|
|
8921
|
+
tree: {
|
|
8922
|
+
emptyText: "No Data"
|
|
8923
|
+
},
|
|
8924
|
+
transfer: {
|
|
8925
|
+
noMatch: "No matching data",
|
|
8926
|
+
noData: "No data",
|
|
8927
|
+
titles: ["List 1", "List 2"],
|
|
8928
|
+
filterPlaceholder: "Enter keyword",
|
|
8929
|
+
noCheckedFormat: "{total} items",
|
|
8930
|
+
hasCheckedFormat: "{checked}/{total} checked"
|
|
8931
|
+
},
|
|
8932
|
+
image: {
|
|
8933
|
+
error: "FAILED"
|
|
8934
|
+
},
|
|
8935
|
+
pageHeader: {
|
|
8936
|
+
title: "Back"
|
|
8937
|
+
},
|
|
8938
|
+
popconfirm: {
|
|
8939
|
+
confirmButtonText: "Yes",
|
|
8940
|
+
cancelButtonText: "No"
|
|
8941
|
+
}
|
|
8942
|
+
}
|
|
8943
|
+
};
|
|
8944
|
+
exports["default"] = English;
|
|
8945
|
+
})(en);
|
|
8946
|
+
|
|
8947
|
+
var English = /*@__PURE__*/getDefaultExportFromCjs(en);
|
|
8948
|
+
|
|
8949
|
+
var EnglishEpie = {
|
|
8950
|
+
epie: {
|
|
8951
|
+
crud: {
|
|
8952
|
+
add: "add",
|
|
8953
|
+
refresh: "refresh",
|
|
8954
|
+
edit: "edit",
|
|
8955
|
+
delete: "delete",
|
|
8956
|
+
multidelete: "multi-delete",
|
|
8957
|
+
select: "select",
|
|
8958
|
+
unselect: "unselect",
|
|
8959
|
+
action: "action",
|
|
8960
|
+
nomethodinservice: "no {name} method in service",
|
|
8961
|
+
responseformaterror: "reponse format error",
|
|
8962
|
+
order: {
|
|
8963
|
+
desc: "{name} - desc",
|
|
8964
|
+
asc: "{name} - asc"
|
|
8965
|
+
},
|
|
8966
|
+
actiondel: {
|
|
8967
|
+
tip: "tip",
|
|
8968
|
+
prompt: "This operation will permanently delete the selected data, continue?",
|
|
8969
|
+
cancel: "cancel",
|
|
8970
|
+
ok: "ok",
|
|
8971
|
+
success: "success"
|
|
8972
|
+
},
|
|
8973
|
+
descriptions: {
|
|
8974
|
+
title: "{title} - info"
|
|
8975
|
+
},
|
|
8976
|
+
form: {
|
|
8977
|
+
show: "show more",
|
|
8978
|
+
hide: "hide",
|
|
8979
|
+
title: "custom form",
|
|
8980
|
+
save: "save",
|
|
8981
|
+
cancel: "cancel",
|
|
8982
|
+
cannotbeempty: "{name} is required"
|
|
8983
|
+
},
|
|
8984
|
+
inlinesearch: {
|
|
8985
|
+
search: "search",
|
|
8986
|
+
reset: "reset"
|
|
8987
|
+
},
|
|
8988
|
+
upsert: {
|
|
8989
|
+
success: "save success",
|
|
8990
|
+
invalid: "[invalid] epie-upsert compoment not exists",
|
|
8991
|
+
edit: "edit",
|
|
8992
|
+
add: "add"
|
|
8993
|
+
},
|
|
8994
|
+
advsearch: {
|
|
8995
|
+
title: "adv search",
|
|
8996
|
+
search: "search",
|
|
8997
|
+
reset: "reset",
|
|
8998
|
+
clear: "clear",
|
|
8999
|
+
close: "close"
|
|
9000
|
+
},
|
|
9001
|
+
export: {
|
|
9002
|
+
label: "export",
|
|
9003
|
+
success: "export success",
|
|
9004
|
+
failed: "export failed, {msg}",
|
|
9005
|
+
ok: "ok",
|
|
9006
|
+
cancel: "cancel",
|
|
9007
|
+
prompt: "Will be exported according to the latest query criteria"
|
|
9008
|
+
},
|
|
9009
|
+
filtergroup: {
|
|
9010
|
+
search: "search",
|
|
9011
|
+
reset: "reset"
|
|
9012
|
+
},
|
|
9013
|
+
searchkey: {
|
|
9014
|
+
pleaseinput: "please input",
|
|
9015
|
+
pleaseinputkey: "please input keyword",
|
|
9016
|
+
search: "search"
|
|
9017
|
+
}
|
|
9018
|
+
}
|
|
9019
|
+
}
|
|
9020
|
+
};
|
|
9021
|
+
|
|
9022
|
+
const useLocale = () => {
|
|
9023
|
+
const locale = useGlobalConfig('locale');
|
|
9024
|
+
return buildLocaleContext(computed(() => locale.value || { ...English,
|
|
9025
|
+
...EnglishEpie
|
|
9026
|
+
}));
|
|
9027
|
+
};
|
|
9028
|
+
|
|
9029
|
+
const {
|
|
9030
|
+
t: t$e
|
|
9031
|
+
} = useLocale();
|
|
8781
9032
|
function useHelper({
|
|
8782
9033
|
mitt,
|
|
8783
9034
|
props,
|
|
@@ -8858,7 +9109,9 @@ function useHelper({
|
|
|
8858
9109
|
|
|
8859
9110
|
if (!crud.service[reqName]) {
|
|
8860
9111
|
done();
|
|
8861
|
-
return reject(
|
|
9112
|
+
return reject(t$e("epie.crud.nomethodinservice", {
|
|
9113
|
+
name: reqName
|
|
9114
|
+
}));
|
|
8862
9115
|
}
|
|
8863
9116
|
|
|
8864
9117
|
await crud.service[reqName](params).then(res => {
|
|
@@ -8867,7 +9120,7 @@ function useHelper({
|
|
|
8867
9120
|
}
|
|
8868
9121
|
|
|
8869
9122
|
if (isString(res)) {
|
|
8870
|
-
return reject("
|
|
9123
|
+
return reject(t$e("epie.crud.responseformaterror"));
|
|
8871
9124
|
}
|
|
8872
9125
|
|
|
8873
9126
|
if (isArray(res)) {
|
|
@@ -8949,22 +9202,24 @@ function useHelper({
|
|
|
8949
9202
|
|
|
8950
9203
|
function next(params) {
|
|
8951
9204
|
return new Promise((resolve, reject) => {
|
|
8952
|
-
ElMessageBox.confirm("
|
|
9205
|
+
ElMessageBox.confirm(t$e("epie.crud.actiondel.prompt"), t$e("epie.crud.actiondel.tip"), {
|
|
8953
9206
|
type: "warning",
|
|
8954
|
-
cancelButtonText: "
|
|
8955
|
-
confirmButtonText: "
|
|
9207
|
+
cancelButtonText: t$e("epie.crud.actiondel.cancel"),
|
|
9208
|
+
confirmButtonText: t$e("epie.crud.actiondel.ok")
|
|
8956
9209
|
}).then(res => {
|
|
8957
9210
|
if (res === "confirm") {
|
|
8958
9211
|
// 验证方法
|
|
8959
9212
|
if (!crud.service[reqName]) {
|
|
8960
|
-
return reject(
|
|
9213
|
+
return reject(t$e("epie.crud.nomethodinservice", {
|
|
9214
|
+
name: reqName
|
|
9215
|
+
}));
|
|
8961
9216
|
} // 发送请求
|
|
8962
9217
|
|
|
8963
9218
|
|
|
8964
9219
|
crud.service[reqName](params).then(res => {
|
|
8965
9220
|
// 重新刷新
|
|
8966
9221
|
refresh();
|
|
8967
|
-
ElMessage.success("
|
|
9222
|
+
ElMessage.success(t$e("epie.crud.actiondel.success"));
|
|
8968
9223
|
resolve(res);
|
|
8969
9224
|
}).catch(err => {
|
|
8970
9225
|
ElMessage.error(err.msg);
|
|
@@ -9141,26 +9396,25 @@ var Crud$1 = defineComponent({
|
|
|
9141
9396
|
sort: {
|
|
9142
9397
|
order: "order",
|
|
9143
9398
|
prop: "prop"
|
|
9144
|
-
}
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9399
|
+
} //label: {
|
|
9400
|
+
// add: "新增",
|
|
9401
|
+
// delete: "删除",
|
|
9402
|
+
// multiDelete: "删除",
|
|
9403
|
+
// update: "编辑",
|
|
9404
|
+
// refresh: "刷新",
|
|
9405
|
+
// advSearch: "高级搜索",
|
|
9406
|
+
// export: "导出"
|
|
9407
|
+
//}
|
|
9408
|
+
|
|
9154
9409
|
},
|
|
9155
9410
|
// 权限
|
|
9156
|
-
permission: {
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
export: true
|
|
9411
|
+
permission: {// update: true,
|
|
9412
|
+
// page: true,
|
|
9413
|
+
// info: true,
|
|
9414
|
+
// list: true,
|
|
9415
|
+
// add: true,
|
|
9416
|
+
// delete: true,
|
|
9417
|
+
// export: true,
|
|
9164
9418
|
}
|
|
9165
9419
|
}, global?.crud)); // 集合
|
|
9166
9420
|
|
|
@@ -9225,6 +9479,7 @@ function useCrud(options, cb) {
|
|
|
9225
9479
|
} = options || {};
|
|
9226
9480
|
const Crud = ref();
|
|
9227
9481
|
useParent("epie-crud", Crud);
|
|
9482
|
+
const allPermission = usePermission();
|
|
9228
9483
|
watch(() => Crud.value, val => {
|
|
9229
9484
|
if (val) {
|
|
9230
9485
|
if (options) {
|
|
@@ -9234,7 +9489,27 @@ function useCrud(options, cb) {
|
|
|
9234
9489
|
});
|
|
9235
9490
|
val.set("dict", dict);
|
|
9236
9491
|
val.set("service", service);
|
|
9237
|
-
|
|
9492
|
+
|
|
9493
|
+
if (permission !== undefined) {
|
|
9494
|
+
const permToSet = {};
|
|
9495
|
+
|
|
9496
|
+
for (let key in permission) {
|
|
9497
|
+
permToSet[key] = allPermission.indexOf(permission[key]) > 0;
|
|
9498
|
+
}
|
|
9499
|
+
|
|
9500
|
+
val.set("permission", permToSet);
|
|
9501
|
+
} else {
|
|
9502
|
+
const permToSet = {
|
|
9503
|
+
update: true,
|
|
9504
|
+
page: true,
|
|
9505
|
+
info: true,
|
|
9506
|
+
list: true,
|
|
9507
|
+
add: true,
|
|
9508
|
+
delete: true,
|
|
9509
|
+
export: true
|
|
9510
|
+
};
|
|
9511
|
+
val.set("permission", permToSet);
|
|
9512
|
+
}
|
|
9238
9513
|
}
|
|
9239
9514
|
|
|
9240
9515
|
if (cb && Crud.value) {
|
|
@@ -9335,6 +9610,14 @@ function useCore() {
|
|
|
9335
9610
|
crud,
|
|
9336
9611
|
mitt
|
|
9337
9612
|
};
|
|
9613
|
+
} // 设置权限
|
|
9614
|
+
|
|
9615
|
+
function useSetPermission(app, permissions) {
|
|
9616
|
+
app.provide("epie-permission", permissions);
|
|
9617
|
+
}
|
|
9618
|
+
function usePermission() {
|
|
9619
|
+
const permissions = inject("epie-permission");
|
|
9620
|
+
return permissions;
|
|
9338
9621
|
}
|
|
9339
9622
|
|
|
9340
9623
|
function useBrowser(app) {
|
|
@@ -9395,6 +9678,9 @@ function useProxy(ret) {
|
|
|
9395
9678
|
});
|
|
9396
9679
|
}
|
|
9397
9680
|
|
|
9681
|
+
const {
|
|
9682
|
+
t: t$d
|
|
9683
|
+
} = useLocale();
|
|
9398
9684
|
var AddBtn = defineComponent({
|
|
9399
9685
|
name: "epie-add-btn",
|
|
9400
9686
|
|
|
@@ -9413,7 +9699,7 @@ var AddBtn = defineComponent({
|
|
|
9413
9699
|
"size": style.size,
|
|
9414
9700
|
"onClick": crud.rowAdd
|
|
9415
9701
|
}, {
|
|
9416
|
-
default: () => [slots.default ? slots.default() : crud.
|
|
9702
|
+
default: () => [slots.default ? slots.default() : t$d("epie.crud.add")]
|
|
9417
9703
|
});
|
|
9418
9704
|
};
|
|
9419
9705
|
}
|
|
@@ -9506,6 +9792,9 @@ function _sfc_render220(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9506
9792
|
|
|
9507
9793
|
var search_default = /* @__PURE__ */export_helper_default(_sfc_main220, [["render", _sfc_render220], ["__file", "search.vue"]]); // src/components/select.vue
|
|
9508
9794
|
|
|
9795
|
+
const {
|
|
9796
|
+
t: t$c
|
|
9797
|
+
} = useLocale();
|
|
9509
9798
|
var AdvBtn = defineComponent({
|
|
9510
9799
|
name: "epie-adv-btn",
|
|
9511
9800
|
components: {
|
|
@@ -9532,13 +9821,23 @@ var AdvBtn = defineComponent({
|
|
|
9532
9821
|
"style": "margin-right: 5px"
|
|
9533
9822
|
}, {
|
|
9534
9823
|
default: () => [createVNode(resolveComponent("search"), null, null)]
|
|
9535
|
-
}), slots.default ? slots.default() : crud.
|
|
9824
|
+
}), slots.default ? slots.default() : t$c("epie.crud.advsearch.title")]
|
|
9536
9825
|
});
|
|
9537
9826
|
};
|
|
9538
9827
|
}
|
|
9539
9828
|
|
|
9540
9829
|
});
|
|
9541
9830
|
|
|
9831
|
+
const getLabel = src => {
|
|
9832
|
+
if (isString(src)) {
|
|
9833
|
+
return {
|
|
9834
|
+
text: src
|
|
9835
|
+
};
|
|
9836
|
+
}
|
|
9837
|
+
|
|
9838
|
+
return src;
|
|
9839
|
+
};
|
|
9840
|
+
|
|
9542
9841
|
const Regs = new Map();
|
|
9543
9842
|
/**
|
|
9544
9843
|
* 解析节点
|
|
@@ -9578,18 +9877,19 @@ function parseNode(vnode, options) {
|
|
|
9578
9877
|
|
|
9579
9878
|
Regs.set(vnode.name, { ...vnode.vm
|
|
9580
9879
|
});
|
|
9581
|
-
}
|
|
9880
|
+
}
|
|
9582
9881
|
|
|
9882
|
+
let vnodeProps = vnode.props; // 处理 props
|
|
9583
9883
|
|
|
9584
9884
|
if (isFunction(vnode.props)) {
|
|
9585
|
-
|
|
9885
|
+
vnodeProps = vnode.props({
|
|
9586
9886
|
scope,
|
|
9587
9887
|
...options._data
|
|
9588
9888
|
});
|
|
9589
9889
|
} // 组件参数
|
|
9590
9890
|
|
|
9591
9891
|
|
|
9592
|
-
const props = { ...
|
|
9892
|
+
const props = { ...vnodeProps,
|
|
9593
9893
|
..._data,
|
|
9594
9894
|
scope
|
|
9595
9895
|
}; // 添加双向绑定
|
|
@@ -9665,7 +9965,7 @@ function renderNode(vnode, options) {
|
|
|
9665
9965
|
|
|
9666
9966
|
if (placeholder) {
|
|
9667
9967
|
if (!item.component.props.placeholder) {
|
|
9668
|
-
item.component.props.placeholder = placeholder + item.label;
|
|
9968
|
+
item.component.props.placeholder = placeholder + getLabel(item.label).text;
|
|
9669
9969
|
}
|
|
9670
9970
|
}
|
|
9671
9971
|
}
|
|
@@ -9720,6 +10020,12 @@ function renderNode(vnode, options) {
|
|
|
9720
10020
|
|
|
9721
10021
|
if (isArray(vnode.options)) {
|
|
9722
10022
|
list = vnode.options;
|
|
10023
|
+
}
|
|
10024
|
+
|
|
10025
|
+
if (scope[prop] !== undefined || scope[prop] !== null) {
|
|
10026
|
+
if (!isArray(scope[prop]) && list.filter(item => item.value === scope[prop]).length == 0) {
|
|
10027
|
+
delete scope[prop];
|
|
10028
|
+
}
|
|
9723
10029
|
} // 设置内容
|
|
9724
10030
|
|
|
9725
10031
|
|
|
@@ -9853,10 +10159,13 @@ function Parse (method, {
|
|
|
9853
10159
|
}
|
|
9854
10160
|
}
|
|
9855
10161
|
|
|
9856
|
-
function _isSlot$
|
|
10162
|
+
function _isSlot$7(s) {
|
|
9857
10163
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
9858
10164
|
}
|
|
9859
10165
|
|
|
10166
|
+
const {
|
|
10167
|
+
t: t$b
|
|
10168
|
+
} = useLocale();
|
|
9860
10169
|
function useAction({
|
|
9861
10170
|
conf,
|
|
9862
10171
|
form,
|
|
@@ -10030,35 +10339,62 @@ function useRender$3(ctx) {
|
|
|
10030
10339
|
function renderForm() {
|
|
10031
10340
|
// 表单项列表
|
|
10032
10341
|
const children = ctx.conf.items.map(e => {
|
|
10342
|
+
// 是否隐藏
|
|
10343
|
+
e._hidden = Parse("hidden", {
|
|
10344
|
+
value: e.hidden,
|
|
10345
|
+
scope: ctx.form,
|
|
10346
|
+
data: ctx.conf._data
|
|
10347
|
+
}); // 隐藏
|
|
10348
|
+
|
|
10349
|
+
if (e._hidden) {
|
|
10350
|
+
return null;
|
|
10351
|
+
}
|
|
10352
|
+
|
|
10033
10353
|
if (e.type == "tabs") {
|
|
10034
10354
|
return createVNode(resolveComponent("epie-form-tabs"), mergeProps({
|
|
10035
10355
|
"modelValue": ctx.tabActive,
|
|
10036
10356
|
"onUpdate:modelValue": $event => ctx.tabActive = $event
|
|
10037
10357
|
}, e.props), null);
|
|
10038
|
-
}
|
|
10039
|
-
|
|
10358
|
+
} else if (e.type == "divider") {
|
|
10359
|
+
return createVNode(resolveComponent("el-divider"), mergeProps(e.props, {
|
|
10360
|
+
"content-position": "left"
|
|
10361
|
+
}), {
|
|
10362
|
+
default: () => [e.label]
|
|
10363
|
+
});
|
|
10364
|
+
}
|
|
10040
10365
|
|
|
10041
|
-
|
|
10042
|
-
value: e.hidden,
|
|
10043
|
-
scope: ctx.form,
|
|
10044
|
-
data: ctx.conf._data
|
|
10045
|
-
}); // 分组显示
|
|
10366
|
+
let label = getLabel(e.label); // 分组显示
|
|
10046
10367
|
|
|
10047
10368
|
const inGroup = isEmpty(ctx.tabActive) || isEmpty(e.group) ? true : e.group === ctx.tabActive; // 表单项
|
|
10048
10369
|
|
|
10049
10370
|
const FormItem = e.component ? h(withDirectives(createVNode(resolveComponent("el-form-item"), {
|
|
10050
10371
|
"label-width": ctx.inline ? "auto" : "",
|
|
10051
|
-
"label":
|
|
10372
|
+
"label": label.text,
|
|
10052
10373
|
"prop": e.prop,
|
|
10053
10374
|
"rules": e.rules
|
|
10054
10375
|
}, null), [[vShow, inGroup]]), e.props, {
|
|
10055
10376
|
label() {
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10377
|
+
let _slot;
|
|
10378
|
+
|
|
10379
|
+
return createVNode(resolveComponent("el-tooltip"), {
|
|
10380
|
+
"effect": "dark",
|
|
10381
|
+
"placement": "top",
|
|
10382
|
+
"content": label.tip,
|
|
10383
|
+
"disabled": !label.tip
|
|
10384
|
+
}, {
|
|
10385
|
+
default: () => [createVNode("span", {
|
|
10386
|
+
"style": "vertical-align: middle"
|
|
10387
|
+
}, [label.text, label.icon && createVNode(resolveComponent("el-icon"), {
|
|
10388
|
+
"class": "el-icon--right"
|
|
10389
|
+
}, _isSlot$7(_slot = h(label.icon, {})) ? _slot : {
|
|
10390
|
+
default: () => [_slot]
|
|
10391
|
+
})])]
|
|
10392
|
+
}); // return renderNode(e.label, {
|
|
10393
|
+
// scope: ctx.form,
|
|
10394
|
+
// render: "slot",
|
|
10395
|
+
// slots: ctx.$slots,
|
|
10396
|
+
// _data: ctx.conf._data
|
|
10397
|
+
// });
|
|
10062
10398
|
},
|
|
10063
10399
|
|
|
10064
10400
|
default() {
|
|
@@ -10084,9 +10420,9 @@ function useRender$3(ctx) {
|
|
|
10084
10420
|
}, [createVNode(resolveComponent("el-divider"), {
|
|
10085
10421
|
"content-position": "center"
|
|
10086
10422
|
}, {
|
|
10087
|
-
default: () => [e.collapse ? createVNode("span", null, [
|
|
10423
|
+
default: () => [e.collapse ? createVNode("span", null, [t$b('epie.crud.form.show'), createVNode("i", {
|
|
10088
10424
|
"class": "el-icon-arrow-down"
|
|
10089
|
-
}, null)]) : createVNode("span", null, [
|
|
10425
|
+
}, null)]) : createVNode("span", null, [t$b('epie.crud.form.hide'), createVNode("i", {
|
|
10090
10426
|
"class": "el-icon-arrow-up"
|
|
10091
10427
|
}, null)])]
|
|
10092
10428
|
})])]);
|
|
@@ -10105,7 +10441,7 @@ function useRender$3(ctx) {
|
|
|
10105
10441
|
|
|
10106
10442
|
return createVNode(resolveComponent("el-col"), mergeProps({
|
|
10107
10443
|
"span": baseSpan
|
|
10108
|
-
}, e), _isSlot$
|
|
10444
|
+
}, e), _isSlot$7(FormItem) ? FormItem : {
|
|
10109
10445
|
default: () => [FormItem]
|
|
10110
10446
|
});
|
|
10111
10447
|
}); // el-form
|
|
@@ -10124,7 +10460,7 @@ function useRender$3(ctx) {
|
|
|
10124
10460
|
default: () => {
|
|
10125
10461
|
return ctx.inline ? children : withDirectives(createVNode(resolveComponent("el-row"), {
|
|
10126
10462
|
"gutter": 10
|
|
10127
|
-
}, _isSlot$
|
|
10463
|
+
}, _isSlot$7(children) ? children : {
|
|
10128
10464
|
default: () => [children]
|
|
10129
10465
|
}), [[resolveDirective("loading"), ctx.loading]]);
|
|
10130
10466
|
}
|
|
@@ -10152,14 +10488,14 @@ function useRender$3(ctx) {
|
|
|
10152
10488
|
"onClick": () => {
|
|
10153
10489
|
ctx.submit();
|
|
10154
10490
|
}
|
|
10155
|
-
}, _isSlot$
|
|
10491
|
+
}, _isSlot$7(saveButtonText) ? saveButtonText : {
|
|
10156
10492
|
default: () => [saveButtonText]
|
|
10157
10493
|
});
|
|
10158
10494
|
} else if (vnode == "close") {
|
|
10159
10495
|
return createVNode(resolveComponent("el-button"), {
|
|
10160
10496
|
"size": style.size,
|
|
10161
10497
|
"onClick": ctx.close
|
|
10162
|
-
}, _isSlot$
|
|
10498
|
+
}, _isSlot$7(closeButtonText) ? closeButtonText : {
|
|
10163
10499
|
default: () => [closeButtonText]
|
|
10164
10500
|
});
|
|
10165
10501
|
} else {
|
|
@@ -10203,6 +10539,9 @@ function useRender$3(ctx) {
|
|
|
10203
10539
|
};
|
|
10204
10540
|
}
|
|
10205
10541
|
|
|
10542
|
+
const {
|
|
10543
|
+
t: t$a
|
|
10544
|
+
} = useLocale();
|
|
10206
10545
|
var AdvSearch = defineComponent({
|
|
10207
10546
|
name: "epie-adv-search",
|
|
10208
10547
|
components: {
|
|
@@ -10217,7 +10556,7 @@ var AdvSearch = defineComponent({
|
|
|
10217
10556
|
// 标题
|
|
10218
10557
|
title: {
|
|
10219
10558
|
type: String,
|
|
10220
|
-
default: "
|
|
10559
|
+
default: ""
|
|
10221
10560
|
},
|
|
10222
10561
|
// 窗体大小
|
|
10223
10562
|
size: {
|
|
@@ -10333,10 +10672,10 @@ var AdvSearch = defineComponent({
|
|
|
10333
10672
|
|
|
10334
10673
|
function renderFooter() {
|
|
10335
10674
|
const btns = {
|
|
10336
|
-
search: "
|
|
10337
|
-
reset: "
|
|
10338
|
-
clear: "
|
|
10339
|
-
close: "
|
|
10675
|
+
search: t$a("epie.crud.advsearch.search"),
|
|
10676
|
+
reset: t$a("epie.crud.advsearch.reset"),
|
|
10677
|
+
clear: t$a("epie.crud.advsearch.clear"),
|
|
10678
|
+
close: t$a("epie.crud.advsearch.close")
|
|
10340
10679
|
};
|
|
10341
10680
|
return ctx.op.map(e => {
|
|
10342
10681
|
if (btns[e]) {
|
|
@@ -10523,6 +10862,9 @@ var FormHook = {
|
|
|
10523
10862
|
|
|
10524
10863
|
};
|
|
10525
10864
|
|
|
10865
|
+
const {
|
|
10866
|
+
t: t$9
|
|
10867
|
+
} = useLocale();
|
|
10526
10868
|
var Form = defineComponent({
|
|
10527
10869
|
name: "epie-form",
|
|
10528
10870
|
props: {
|
|
@@ -10542,7 +10884,7 @@ var Form = defineComponent({
|
|
|
10542
10884
|
const tabActive = ref(null); // 表单配置
|
|
10543
10885
|
|
|
10544
10886
|
const conf = reactive({
|
|
10545
|
-
title: "
|
|
10887
|
+
title: t$9("epie.crud.form.title"),
|
|
10546
10888
|
width: "50%",
|
|
10547
10889
|
props: {
|
|
10548
10890
|
labelWidth: 100
|
|
@@ -10551,8 +10893,8 @@ var Form = defineComponent({
|
|
|
10551
10893
|
on: {},
|
|
10552
10894
|
op: {
|
|
10553
10895
|
hidden: false,
|
|
10554
|
-
saveButtonText: "
|
|
10555
|
-
closeButtonText: "
|
|
10896
|
+
saveButtonText: t$9("epie.crud.form.save"),
|
|
10897
|
+
closeButtonText: t$9("epie.crud.form.cancel"),
|
|
10556
10898
|
buttons: ["close", "save"]
|
|
10557
10899
|
},
|
|
10558
10900
|
dialog: {
|
|
@@ -10760,8 +11102,31 @@ var Form = defineComponent({
|
|
|
10760
11102
|
conf.items.map(e => {
|
|
10761
11103
|
if (e.prop) {
|
|
10762
11104
|
// 解析 prop
|
|
11105
|
+
// 先不处理
|
|
11106
|
+
const oldProp = e.prop;
|
|
11107
|
+
e.origProp = e.prop;
|
|
11108
|
+
|
|
10763
11109
|
if (e.prop.includes(".")) {
|
|
10764
11110
|
e.prop = e.prop.replace(/\./g, "-");
|
|
11111
|
+
let lastScope = form;
|
|
11112
|
+
let lastKey = oldProp;
|
|
11113
|
+
|
|
11114
|
+
if (oldProp.indexOf(".") > 0) {
|
|
11115
|
+
const keys = oldProp.split(".");
|
|
11116
|
+
lastKey = keys.pop();
|
|
11117
|
+
keys.forEach(sec => {
|
|
11118
|
+
lastScope[sec] = isObject(lastScope[sec]) ? lastScope[sec] : {};
|
|
11119
|
+
lastScope = lastScope[sec];
|
|
11120
|
+
});
|
|
11121
|
+
} else {
|
|
11122
|
+
lastScope = form;
|
|
11123
|
+
lastKey = oldProp;
|
|
11124
|
+
}
|
|
11125
|
+
|
|
11126
|
+
form[e.prop] = lastScope[lastKey]; // props.modelValue = lastScope[lastKey];
|
|
11127
|
+
//props["onUpdate:modelValue"] = function (val: any) {
|
|
11128
|
+
// lastScope[lastKey] = val;
|
|
11129
|
+
//};
|
|
10765
11130
|
} // prop 合并
|
|
10766
11131
|
|
|
10767
11132
|
|
|
@@ -10782,7 +11147,9 @@ var Form = defineComponent({
|
|
|
10782
11147
|
if (e.required) {
|
|
10783
11148
|
e.rules = {
|
|
10784
11149
|
required: true,
|
|
10785
|
-
message:
|
|
11150
|
+
message: t$9("epie.crud.form.cannotbeempty", {
|
|
11151
|
+
name: getLabel(e.label).text || ""
|
|
11152
|
+
})
|
|
10786
11153
|
};
|
|
10787
11154
|
}
|
|
10788
11155
|
} // 设置 tabs 默认值
|
|
@@ -10809,10 +11176,29 @@ var Form = defineComponent({
|
|
|
10809
11176
|
function bindForm(data) {
|
|
10810
11177
|
const d = {};
|
|
10811
11178
|
conf.items.forEach(e => {
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
11179
|
+
if (e.prop) {
|
|
11180
|
+
let lastScope = data;
|
|
11181
|
+
let lastKey = e.origProp;
|
|
11182
|
+
|
|
11183
|
+
if ((e.origProp || e.prop).indexOf(".") > 0) {
|
|
11184
|
+
const keys = e.origProp.split(".");
|
|
11185
|
+
lastKey = keys.pop();
|
|
11186
|
+
keys.forEach(sec => {
|
|
11187
|
+
lastScope[sec] = isObject(lastScope[sec]) ? lastScope[sec] : {};
|
|
11188
|
+
lastScope = lastScope[sec];
|
|
11189
|
+
});
|
|
11190
|
+
} else {
|
|
11191
|
+
lastScope = data;
|
|
11192
|
+
lastKey = e.origProp || e.prop;
|
|
11193
|
+
}
|
|
11194
|
+
|
|
11195
|
+
data[e.prop] = lastScope[lastKey];
|
|
11196
|
+
d[e.prop] = e.hook ? FormHook.bind({
|
|
11197
|
+
hook: e.hook,
|
|
11198
|
+
value: data[e.prop],
|
|
11199
|
+
form: data
|
|
11200
|
+
}) : data[e.prop];
|
|
11201
|
+
}
|
|
10816
11202
|
});
|
|
10817
11203
|
Object.assign(form, data, d);
|
|
10818
11204
|
} // 切换 epie-form-tab
|
|
@@ -11030,6 +11416,9 @@ var FormTabs = defineComponent({
|
|
|
11030
11416
|
|
|
11031
11417
|
});
|
|
11032
11418
|
|
|
11419
|
+
const {
|
|
11420
|
+
t: t$8
|
|
11421
|
+
} = useLocale();
|
|
11033
11422
|
var MultiDeleteBtn = defineComponent({
|
|
11034
11423
|
name: "epie-multi-delete-btn",
|
|
11035
11424
|
|
|
@@ -11051,7 +11440,7 @@ var MultiDeleteBtn = defineComponent({
|
|
|
11051
11440
|
crud.rowDelete(...crud.selection);
|
|
11052
11441
|
}
|
|
11053
11442
|
}, {
|
|
11054
|
-
default: () => [slots.default ? slots.default() : crud.
|
|
11443
|
+
default: () => [slots.default ? slots.default() : t$8("epie.crud.multidelete")]
|
|
11055
11444
|
});
|
|
11056
11445
|
};
|
|
11057
11446
|
}
|
|
@@ -11241,6 +11630,9 @@ var Query = defineComponent({
|
|
|
11241
11630
|
|
|
11242
11631
|
});
|
|
11243
11632
|
|
|
11633
|
+
const {
|
|
11634
|
+
t: t$7
|
|
11635
|
+
} = useLocale();
|
|
11244
11636
|
var RefreshBtn = defineComponent({
|
|
11245
11637
|
name: "epie-refresh-btn",
|
|
11246
11638
|
|
|
@@ -11260,13 +11652,20 @@ var RefreshBtn = defineComponent({
|
|
|
11260
11652
|
crud.refresh();
|
|
11261
11653
|
}
|
|
11262
11654
|
}, {
|
|
11263
|
-
default: () => [slots.default ? slots.default() : crud.
|
|
11655
|
+
default: () => [slots.default ? slots.default() : t$7("epie.crud.refresh")]
|
|
11264
11656
|
});
|
|
11265
11657
|
};
|
|
11266
11658
|
}
|
|
11267
11659
|
|
|
11268
11660
|
});
|
|
11269
11661
|
|
|
11662
|
+
function _isSlot$6(s) {
|
|
11663
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
11664
|
+
}
|
|
11665
|
+
|
|
11666
|
+
const {
|
|
11667
|
+
t: t$6
|
|
11668
|
+
} = useLocale();
|
|
11270
11669
|
var ExportBtn = defineComponent({
|
|
11271
11670
|
name: "epie-export-btn",
|
|
11272
11671
|
props: {
|
|
@@ -11331,13 +11730,15 @@ var ExportBtn = defineComponent({
|
|
|
11331
11730
|
if (res && res.code === 0) {
|
|
11332
11731
|
ElMessage({
|
|
11333
11732
|
type: 'success',
|
|
11334
|
-
message:
|
|
11733
|
+
message: t$6("epie.crud.export.success")
|
|
11335
11734
|
});
|
|
11336
11735
|
window.open(res.data);
|
|
11337
11736
|
} else {
|
|
11338
11737
|
ElMessage({
|
|
11339
11738
|
type: 'error',
|
|
11340
|
-
message:
|
|
11739
|
+
message: t$6("epie.crud.export.failed", {
|
|
11740
|
+
msg: res.msg
|
|
11741
|
+
})
|
|
11341
11742
|
});
|
|
11342
11743
|
}
|
|
11343
11744
|
|
|
@@ -11350,7 +11751,9 @@ var ExportBtn = defineComponent({
|
|
|
11350
11751
|
|
|
11351
11752
|
if (!crud.service[reqName]) {
|
|
11352
11753
|
done();
|
|
11353
|
-
return reject(
|
|
11754
|
+
return reject(t$6("epie.crud.nomethodinservice", {
|
|
11755
|
+
name: reqName
|
|
11756
|
+
}));
|
|
11354
11757
|
}
|
|
11355
11758
|
|
|
11356
11759
|
const data = paramsReplaceExport(crud.getParams()); // 发送请求
|
|
@@ -11383,7 +11786,7 @@ var ExportBtn = defineComponent({
|
|
|
11383
11786
|
exportVisible,
|
|
11384
11787
|
exportLoading,
|
|
11385
11788
|
onExport,
|
|
11386
|
-
label: crud.
|
|
11789
|
+
label: t$6("epie.crud.export.label"),
|
|
11387
11790
|
slots: slots
|
|
11388
11791
|
};
|
|
11389
11792
|
},
|
|
@@ -11398,24 +11801,28 @@ var ExportBtn = defineComponent({
|
|
|
11398
11801
|
}, null), {
|
|
11399
11802
|
visible: ctx.exportVisible
|
|
11400
11803
|
}, {
|
|
11401
|
-
default: () =>
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
"
|
|
11405
|
-
|
|
11406
|
-
"
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
"
|
|
11412
|
-
|
|
11413
|
-
"
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11804
|
+
default: () => {
|
|
11805
|
+
let _slot, _slot2;
|
|
11806
|
+
|
|
11807
|
+
return createVNode(Fragment, null, [createVNode("p", null, [t$6("epie.crud.export.prompt")]), createVNode("div", {
|
|
11808
|
+
"style": "text-align: right; margin-top: 8px;"
|
|
11809
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
11810
|
+
"size": "small",
|
|
11811
|
+
"type": "primary",
|
|
11812
|
+
"link": true,
|
|
11813
|
+
"onClick": () => ctx.exportVisible = false
|
|
11814
|
+
}, _isSlot$6(_slot = t$6("epie.crud.export.cancel")) ? _slot : {
|
|
11815
|
+
default: () => [_slot]
|
|
11816
|
+
}), createVNode(resolveComponent("el-button"), mergeProps({
|
|
11817
|
+
"size": "small",
|
|
11818
|
+
"type": "primary",
|
|
11819
|
+
"onClick": ctx.onExport
|
|
11820
|
+
}, {
|
|
11821
|
+
loading: ctx.exportLoading
|
|
11822
|
+
}), _isSlot$6(_slot2 = t$6("epie.crud.export.ok")) ? _slot2 : {
|
|
11823
|
+
default: () => [_slot2]
|
|
11824
|
+
})])]);
|
|
11825
|
+
},
|
|
11419
11826
|
reference: () => createVNode(resolveComponent("el-button"), {
|
|
11420
11827
|
"type": "primary",
|
|
11421
11828
|
"size": style.size,
|
|
@@ -11427,10 +11834,13 @@ var ExportBtn = defineComponent({
|
|
|
11427
11834
|
}
|
|
11428
11835
|
});
|
|
11429
11836
|
|
|
11430
|
-
function _isSlot$
|
|
11837
|
+
function _isSlot$5(s) {
|
|
11431
11838
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
11432
11839
|
}
|
|
11433
11840
|
|
|
11841
|
+
const {
|
|
11842
|
+
t: t$5
|
|
11843
|
+
} = useLocale();
|
|
11434
11844
|
var SearchKey = defineComponent({
|
|
11435
11845
|
name: "epie-search-key",
|
|
11436
11846
|
props: {
|
|
@@ -11467,9 +11877,9 @@ var SearchKey = defineComponent({
|
|
|
11467
11877
|
return props.placeholder;
|
|
11468
11878
|
} else {
|
|
11469
11879
|
if (props.fieldList.length > 0) {
|
|
11470
|
-
return "
|
|
11880
|
+
return t$5("epie.crud.searchkey.pleaseinput");
|
|
11471
11881
|
} else {
|
|
11472
|
-
return "
|
|
11882
|
+
return t$5("epie.crud.searchkey.pleaseinputkey");
|
|
11473
11883
|
}
|
|
11474
11884
|
}
|
|
11475
11885
|
}); // 搜索内容
|
|
@@ -11539,7 +11949,7 @@ var SearchKey = defineComponent({
|
|
|
11539
11949
|
},
|
|
11540
11950
|
|
|
11541
11951
|
render(ctx) {
|
|
11542
|
-
let _slot;
|
|
11952
|
+
let _slot, _slot2;
|
|
11543
11953
|
|
|
11544
11954
|
const {
|
|
11545
11955
|
style
|
|
@@ -11553,7 +11963,7 @@ var SearchKey = defineComponent({
|
|
|
11553
11963
|
"modelValue": ctx.selectField,
|
|
11554
11964
|
"onUpdate:modelValue": $event => ctx.selectField = $event,
|
|
11555
11965
|
"onChange": ctx.onFieldChange
|
|
11556
|
-
}, _isSlot$
|
|
11966
|
+
}, _isSlot$5(_slot = ctx.fieldList.map((e, i) => createVNode(resolveComponent("el-option"), {
|
|
11557
11967
|
"key": i,
|
|
11558
11968
|
"label": e.label,
|
|
11559
11969
|
"value": e.value
|
|
@@ -11573,8 +11983,8 @@ var SearchKey = defineComponent({
|
|
|
11573
11983
|
"size": style.size,
|
|
11574
11984
|
"type": "primary",
|
|
11575
11985
|
"onClick": ctx.search
|
|
11576
|
-
}, {
|
|
11577
|
-
default: () => [
|
|
11986
|
+
}, _isSlot$5(_slot2 = t$5("epie.crud.searchkey.search")) ? _slot2 : {
|
|
11987
|
+
default: () => [_slot2]
|
|
11578
11988
|
})]);
|
|
11579
11989
|
}
|
|
11580
11990
|
|
|
@@ -11805,10 +12215,13 @@ const ContextMenu = {
|
|
|
11805
12215
|
|
|
11806
12216
|
};
|
|
11807
12217
|
|
|
11808
|
-
function _isSlot$
|
|
12218
|
+
function _isSlot$4(s) {
|
|
11809
12219
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
11810
12220
|
}
|
|
11811
12221
|
|
|
12222
|
+
const {
|
|
12223
|
+
t: t$4
|
|
12224
|
+
} = useLocale();
|
|
11812
12225
|
function useElTable({
|
|
11813
12226
|
Table
|
|
11814
12227
|
}) {
|
|
@@ -11937,7 +12350,7 @@ function useRow({
|
|
|
11937
12350
|
switch (e) {
|
|
11938
12351
|
case "refresh":
|
|
11939
12352
|
return {
|
|
11940
|
-
label: "
|
|
12353
|
+
label: t$4("epie.crud.refresh"),
|
|
11941
12354
|
|
|
11942
12355
|
callback(done) {
|
|
11943
12356
|
crud.refresh();
|
|
@@ -11949,7 +12362,7 @@ function useRow({
|
|
|
11949
12362
|
case "edit":
|
|
11950
12363
|
case "update":
|
|
11951
12364
|
return {
|
|
11952
|
-
label: "
|
|
12365
|
+
label: t$4("epie.crud.edit"),
|
|
11953
12366
|
hidden: !crud.getPermission("update"),
|
|
11954
12367
|
|
|
11955
12368
|
callback(done) {
|
|
@@ -11961,7 +12374,7 @@ function useRow({
|
|
|
11961
12374
|
|
|
11962
12375
|
case "delete":
|
|
11963
12376
|
return {
|
|
11964
|
-
label: "
|
|
12377
|
+
label: t$4("epie.crud.delete"),
|
|
11965
12378
|
hidden: !crud.getPermission("delete"),
|
|
11966
12379
|
|
|
11967
12380
|
callback(done) {
|
|
@@ -11973,7 +12386,7 @@ function useRow({
|
|
|
11973
12386
|
|
|
11974
12387
|
case "check":
|
|
11975
12388
|
return {
|
|
11976
|
-
label: crud.selection.find(e => e.id == row.id) ? "
|
|
12389
|
+
label: crud.selection.find(e => e.id == row.id) ? t$4("epie.crud.unselect") : t$4("epie.crud.select"),
|
|
11977
12390
|
hidden: !props.columns.find(e => e.type === "selection"),
|
|
11978
12391
|
|
|
11979
12392
|
callback(done) {
|
|
@@ -11985,7 +12398,9 @@ function useRow({
|
|
|
11985
12398
|
|
|
11986
12399
|
case "order-desc":
|
|
11987
12400
|
return {
|
|
11988
|
-
label:
|
|
12401
|
+
label: t$4("epie.crud.order.desc", {
|
|
12402
|
+
name: column.label
|
|
12403
|
+
}),
|
|
11989
12404
|
hidden: !column.sortable,
|
|
11990
12405
|
|
|
11991
12406
|
callback(done) {
|
|
@@ -11997,7 +12412,9 @@ function useRow({
|
|
|
11997
12412
|
|
|
11998
12413
|
case "order-asc":
|
|
11999
12414
|
return {
|
|
12000
|
-
label:
|
|
12415
|
+
label: t$4("epie.crud.order.asc", {
|
|
12416
|
+
name: column.label
|
|
12417
|
+
}),
|
|
12001
12418
|
hidden: !column.sortable,
|
|
12002
12419
|
|
|
12003
12420
|
callback(done) {
|
|
@@ -12111,7 +12528,7 @@ function useRender$2({
|
|
|
12111
12528
|
|
|
12112
12529
|
if (item.type === "op") {
|
|
12113
12530
|
return h(ElTableColumn, {
|
|
12114
|
-
label: "
|
|
12531
|
+
label: t$4("epie.crud.action"),
|
|
12115
12532
|
width: "160px",
|
|
12116
12533
|
fixed: browser.isMini ? null : "right",
|
|
12117
12534
|
...item
|
|
@@ -12121,6 +12538,8 @@ function useRender$2({
|
|
|
12121
12538
|
"class": "epie-table__op"
|
|
12122
12539
|
}, [(item.buttons || ["edit", "delete"]).map(vnode => {
|
|
12123
12540
|
if (vnode === "edit") {
|
|
12541
|
+
let _slot;
|
|
12542
|
+
|
|
12124
12543
|
return withDirectives(createVNode(resolveComponent("el-button"), {
|
|
12125
12544
|
"text": true,
|
|
12126
12545
|
"bg": true,
|
|
@@ -12129,10 +12548,12 @@ function useRender$2({
|
|
|
12129
12548
|
"onClick": () => {
|
|
12130
12549
|
crud.rowEdit(scope.row);
|
|
12131
12550
|
}
|
|
12132
|
-
}, {
|
|
12133
|
-
default: () => [
|
|
12551
|
+
}, _isSlot$4(_slot = t$4("epie.crud.edit")) ? _slot : {
|
|
12552
|
+
default: () => [_slot]
|
|
12134
12553
|
}), [[vShow, crud.getPermission("update")]]);
|
|
12135
12554
|
} else if (vnode === "delete") {
|
|
12555
|
+
let _slot2;
|
|
12556
|
+
|
|
12136
12557
|
return withDirectives(createVNode(resolveComponent("el-button"), {
|
|
12137
12558
|
"text": true,
|
|
12138
12559
|
"bg": true,
|
|
@@ -12141,8 +12562,8 @@ function useRender$2({
|
|
|
12141
12562
|
"onClick": () => {
|
|
12142
12563
|
crud.rowDelete(scope.row);
|
|
12143
12564
|
}
|
|
12144
|
-
}, {
|
|
12145
|
-
default: () => [
|
|
12565
|
+
}, _isSlot$4(_slot2 = t$4("epie.crud.delete")) ? _slot2 : {
|
|
12566
|
+
default: () => [_slot2]
|
|
12146
12567
|
}), [[vShow, crud.getPermission("delete")]]);
|
|
12147
12568
|
} else {
|
|
12148
12569
|
return renderNode(vnode, {
|
|
@@ -12227,6 +12648,8 @@ function useRender$2({
|
|
|
12227
12648
|
return h(ElTag, d, {
|
|
12228
12649
|
default: () => d.label
|
|
12229
12650
|
});
|
|
12651
|
+
} else if (isVNode(d?.label)) {
|
|
12652
|
+
return h(d?.label);
|
|
12230
12653
|
} else if (d) {
|
|
12231
12654
|
return createVNode(resolveComponent("el-tag"), {
|
|
12232
12655
|
"style": "margin: 0 2px"
|
|
@@ -12236,7 +12659,7 @@ function useRender$2({
|
|
|
12236
12659
|
} else if (!!v) {
|
|
12237
12660
|
return createVNode(resolveComponent("el-tag"), {
|
|
12238
12661
|
"style": "margin: 0 2px"
|
|
12239
|
-
}, _isSlot$
|
|
12662
|
+
}, _isSlot$4(v) ? v : {
|
|
12240
12663
|
default: () => [v]
|
|
12241
12664
|
});
|
|
12242
12665
|
} else {
|
|
@@ -12484,6 +12907,9 @@ var Table = defineComponent({
|
|
|
12484
12907
|
|
|
12485
12908
|
});
|
|
12486
12909
|
|
|
12910
|
+
const {
|
|
12911
|
+
t: t$3
|
|
12912
|
+
} = useLocale();
|
|
12487
12913
|
var Upsert = defineComponent({
|
|
12488
12914
|
name: "epie-upsert",
|
|
12489
12915
|
props: {
|
|
@@ -12563,13 +12989,15 @@ var Upsert = defineComponent({
|
|
|
12563
12989
|
|
|
12564
12990
|
if (!crud.service[reqName]) {
|
|
12565
12991
|
done();
|
|
12566
|
-
return reject(
|
|
12992
|
+
return reject(t$3("epie.crud.nomethodinservice", {
|
|
12993
|
+
name: reqName
|
|
12994
|
+
}));
|
|
12567
12995
|
} // 发送请求
|
|
12568
12996
|
|
|
12569
12997
|
|
|
12570
12998
|
crud.service[reqName](data).then(res => {
|
|
12571
12999
|
if (res && res.code === 0) {
|
|
12572
|
-
ElMessage.success("
|
|
13000
|
+
ElMessage.success(t$3("epie.crud.upsert.success"));
|
|
12573
13001
|
done();
|
|
12574
13002
|
close();
|
|
12575
13003
|
crud.refresh();
|
|
@@ -12601,11 +13029,11 @@ var Upsert = defineComponent({
|
|
|
12601
13029
|
function open() {
|
|
12602
13030
|
return new Promise(resolve => {
|
|
12603
13031
|
if (!Form.value) {
|
|
12604
|
-
return console.error("
|
|
13032
|
+
return console.error(t$3("epie.crud.upsert.invalid"));
|
|
12605
13033
|
}
|
|
12606
13034
|
|
|
12607
13035
|
Form.value?.open({
|
|
12608
|
-
title: isEdit.value ? "
|
|
13036
|
+
title: isEdit.value ? t$3("epie.crud.upsert.edit") : t$3("epie.crud.upsert.add"),
|
|
12609
13037
|
props: props.props,
|
|
12610
13038
|
op: props.op,
|
|
12611
13039
|
dialog: props.dialog,
|
|
@@ -12696,14 +13124,15 @@ var Upsert = defineComponent({
|
|
|
12696
13124
|
|
|
12697
13125
|
if (!crud.service[reqName]) {
|
|
12698
13126
|
done();
|
|
12699
|
-
return reject(
|
|
13127
|
+
return reject(t$3("epie.crud.nomethodinservice", {
|
|
13128
|
+
name: reqName
|
|
13129
|
+
}));
|
|
12700
13130
|
} // 发送请求
|
|
12701
13131
|
|
|
12702
13132
|
|
|
12703
13133
|
await crud.service[reqName]({
|
|
12704
13134
|
id: data.id
|
|
12705
13135
|
}).then(res => {
|
|
12706
|
-
done(res.data);
|
|
12707
13136
|
resolve(res.data);
|
|
12708
13137
|
}).catch(err => {
|
|
12709
13138
|
ElMessage.error(err.msg);
|
|
@@ -12722,7 +13151,9 @@ var Upsert = defineComponent({
|
|
|
12722
13151
|
done
|
|
12723
13152
|
});
|
|
12724
13153
|
} else {
|
|
12725
|
-
next(data)
|
|
13154
|
+
next(data).then(newdata => {
|
|
13155
|
+
done(newdata);
|
|
13156
|
+
});
|
|
12726
13157
|
}
|
|
12727
13158
|
} // 返回值
|
|
12728
13159
|
|
|
@@ -13015,6 +13446,13 @@ var Filter = defineComponent({
|
|
|
13015
13446
|
|
|
13016
13447
|
});
|
|
13017
13448
|
|
|
13449
|
+
function _isSlot$3(s) {
|
|
13450
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
13451
|
+
}
|
|
13452
|
+
|
|
13453
|
+
const {
|
|
13454
|
+
t: t$2
|
|
13455
|
+
} = useLocale();
|
|
13018
13456
|
var FilterGroup = defineComponent({
|
|
13019
13457
|
name: "epie-filter-group",
|
|
13020
13458
|
props: {
|
|
@@ -13092,6 +13530,8 @@ var FilterGroup = defineComponent({
|
|
|
13092
13530
|
},
|
|
13093
13531
|
|
|
13094
13532
|
render(ctx) {
|
|
13533
|
+
let _slot, _slot2;
|
|
13534
|
+
|
|
13095
13535
|
const {
|
|
13096
13536
|
style
|
|
13097
13537
|
} = useTools();
|
|
@@ -13110,13 +13550,13 @@ var FilterGroup = defineComponent({
|
|
|
13110
13550
|
"loading": ctx.loading,
|
|
13111
13551
|
"size": style.size,
|
|
13112
13552
|
"onClick": ctx.search
|
|
13113
|
-
}, {
|
|
13114
|
-
default: () => [
|
|
13553
|
+
}, _isSlot$3(_slot = t$2("epie.crud.filtergroup.search")) ? _slot : {
|
|
13554
|
+
default: () => [_slot]
|
|
13115
13555
|
}), ctx.resetBtn && createVNode(resolveComponent("el-button"), {
|
|
13116
13556
|
"size": style.size,
|
|
13117
13557
|
"onClick": ctx.reset
|
|
13118
|
-
}, {
|
|
13119
|
-
default: () => [
|
|
13558
|
+
}, _isSlot$3(_slot2 = t$2("epie.crud.filtergroup.reset")) ? _slot2 : {
|
|
13559
|
+
default: () => [_slot2]
|
|
13120
13560
|
})])]);
|
|
13121
13561
|
}
|
|
13122
13562
|
|
|
@@ -13143,6 +13583,9 @@ function _isSlot$2(s) {
|
|
|
13143
13583
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
13144
13584
|
}
|
|
13145
13585
|
|
|
13586
|
+
const {
|
|
13587
|
+
t: t$1
|
|
13588
|
+
} = useLocale();
|
|
13146
13589
|
function useRender$1(ctx) {
|
|
13147
13590
|
const {
|
|
13148
13591
|
browser,
|
|
@@ -13259,8 +13702,8 @@ function useRender$1(ctx) {
|
|
|
13259
13702
|
|
|
13260
13703
|
function renderOp() {
|
|
13261
13704
|
const ButtonText = {
|
|
13262
|
-
search: "
|
|
13263
|
-
reset: "
|
|
13705
|
+
search: t$1("epie.crud.inlinesearch.search"),
|
|
13706
|
+
reset: t$1("epie.crud.inlinesearch.reset")
|
|
13264
13707
|
};
|
|
13265
13708
|
return ctx.op?.map(e => {
|
|
13266
13709
|
if (ButtonText[e]) {
|
|
@@ -13502,6 +13945,9 @@ function _isSlot(s) {
|
|
|
13502
13945
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
13503
13946
|
}
|
|
13504
13947
|
|
|
13948
|
+
const {
|
|
13949
|
+
t
|
|
13950
|
+
} = useLocale();
|
|
13505
13951
|
const epieDescriptionsProps = () => ({
|
|
13506
13952
|
border: {
|
|
13507
13953
|
type: Boolean,
|
|
@@ -13698,7 +14144,9 @@ var EpieDescriptions = defineComponent({
|
|
|
13698
14144
|
"onUpdate:modelValue": $event => ctx.show = $event,
|
|
13699
14145
|
"direction": "rtl",
|
|
13700
14146
|
"with-header": true,
|
|
13701
|
-
"title":
|
|
14147
|
+
"title": t("epie.crud.descriptions.title", {
|
|
14148
|
+
title: ctx.title || ""
|
|
14149
|
+
}),
|
|
13702
14150
|
"size": browser.isMini ? "100%" : ctx.size
|
|
13703
14151
|
}, null), {}, {
|
|
13704
14152
|
default: () => {
|
|
@@ -13948,4 +14396,4 @@ const Crud = {
|
|
|
13948
14396
|
};
|
|
13949
14397
|
// export { ContextMenu } from "./components/context-menu";
|
|
13950
14398
|
|
|
13951
|
-
export { EpieDescriptions, EpieInlineSearch, components, crudList, Crud as default, emitter$1 as emitter, epieDescriptionsProps, epieInlineSearchProps, useAdvSearch, useBrowser, useComponent, useCore, useCrud, useDescriptions, useDialog, useForm, useProxy, useRefs, useTable, useTools, useUpsert };
|
|
14399
|
+
export { EpieDescriptions, EpieInlineSearch, components, crudList, Crud as default, emitter$1 as emitter, epieDescriptionsProps, epieInlineSearchProps, useAdvSearch, useBrowser, useComponent, useCore, useCrud, useDescriptions, useDialog, useForm, usePermission, useProxy, useRefs, useSetPermission, useTable, useTools, useUpsert };
|