@dt-frames/ui 1.0.44 → 1.0.45
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.
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"MULTIFY": "Batch",
|
|
29
29
|
"DELETE_SUCCESS": "Successfully Deleted!",
|
|
30
30
|
"COLUMN_CONTROL": "Column Control",
|
|
31
|
-
"COLUMN_SHOW": "
|
|
32
|
-
"INDEX": "
|
|
31
|
+
"COLUMN_SHOW": "All",
|
|
32
|
+
"INDEX": "Index",
|
|
33
33
|
"CHECKBOX": "Checkbox",
|
|
34
34
|
"FIXED_TO_LEFT": "Fixed to the Left",
|
|
35
35
|
"FIXED_TO_RIGHT": "Fixed to the Right",
|
|
@@ -6,7 +6,7 @@ export declare function useCurd(curdOpt: CrudOptType): {
|
|
|
6
6
|
}>;
|
|
7
7
|
add: () => void;
|
|
8
8
|
del: ({ row }: Recordable) => void;
|
|
9
|
-
dels: (ids
|
|
9
|
+
dels: (ids?: string[]) => void;
|
|
10
10
|
update: ({ row }: Recordable) => void;
|
|
11
11
|
closeModal: () => void;
|
|
12
12
|
openModal: (data?: {
|
package/es/index.js
CHANGED
|
@@ -5136,7 +5136,6 @@ function useDataSource(propsRef, {
|
|
|
5136
5136
|
}, false);
|
|
5137
5137
|
function updateTableDataRecord(rowKey, record) {
|
|
5138
5138
|
const row = findTableDataRecord(rowKey);
|
|
5139
|
-
console.log(row, record);
|
|
5140
5139
|
if (row) {
|
|
5141
5140
|
for (const field in record) {
|
|
5142
5141
|
row[field] = record[field];
|
|
@@ -5270,7 +5269,7 @@ var _sfc_main$I = defineComponent({
|
|
|
5270
5269
|
},
|
|
5271
5270
|
setup(props) {
|
|
5272
5271
|
let renderText = ref();
|
|
5273
|
-
watch(() => props.record, (v) => {
|
|
5272
|
+
watch(() => [props.record, props.column], (v) => {
|
|
5274
5273
|
if (v)
|
|
5275
5274
|
renderCell();
|
|
5276
5275
|
}, {
|
|
@@ -5545,7 +5544,7 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
5545
5544
|
const isFixedLeft = columns.some((item) => item.fixed === "left");
|
|
5546
5545
|
columns.unshift({
|
|
5547
5546
|
flag: INDEX_FLAG,
|
|
5548
|
-
width: unref(getIsZH) ? 50 :
|
|
5547
|
+
width: unref(getIsZH) ? 50 : 70,
|
|
5549
5548
|
title: t("NUMBER"),
|
|
5550
5549
|
align: "center",
|
|
5551
5550
|
customRender: ({ index: index2 }) => {
|
|
@@ -5683,7 +5682,6 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
5683
5682
|
return columns;
|
|
5684
5683
|
}
|
|
5685
5684
|
function setColumns(columnList = []) {
|
|
5686
|
-
console.log(columnList);
|
|
5687
5685
|
const columns = cloneDeep(columnList);
|
|
5688
5686
|
if (!isArray$1(columns))
|
|
5689
5687
|
return;
|
|
@@ -5887,7 +5885,6 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5887
5885
|
setColumns(columns);
|
|
5888
5886
|
}
|
|
5889
5887
|
function setColumns(columns) {
|
|
5890
|
-
console.log(columns, "===");
|
|
5891
5888
|
table.setColumns(columns);
|
|
5892
5889
|
const data = unref(plainSortOptions).map((col) => {
|
|
5893
5890
|
const visable = columns.findIndex((c) => c === col.value || typeof c !== "string" && c.dataIndex === col.value) !== -1;
|
|
@@ -6937,7 +6934,8 @@ function useSource(opt) {
|
|
|
6937
6934
|
onSearch: ref(false),
|
|
6938
6935
|
onReset: ref(false)
|
|
6939
6936
|
};
|
|
6940
|
-
const { baseUrl = "", api = {}, exportName = ""
|
|
6937
|
+
const { baseUrl = "", api = {}, exportName = "", clearKeys = () => {
|
|
6938
|
+
} } = opt;
|
|
6941
6939
|
const { add, deletes, update, queryById, queryPage } = api;
|
|
6942
6940
|
const { message } = useMessage();
|
|
6943
6941
|
const apiFul = {};
|
|
@@ -6973,12 +6971,14 @@ function useSource(opt) {
|
|
|
6973
6971
|
baseData.entityDTO = { ...model };
|
|
6974
6972
|
baseData.pageDTO.pageNo = 0;
|
|
6975
6973
|
loading.onSearch.value = true;
|
|
6974
|
+
clearKeys();
|
|
6976
6975
|
search();
|
|
6977
6976
|
}
|
|
6978
6977
|
function onReset(model) {
|
|
6979
6978
|
baseData.entityDTO = { ...model };
|
|
6980
6979
|
baseData.pageDTO.pageNo = 0;
|
|
6981
6980
|
loading.onReset.value = true;
|
|
6981
|
+
clearKeys();
|
|
6982
6982
|
search();
|
|
6983
6983
|
}
|
|
6984
6984
|
function onTableChange(params, needSearch = true) {
|
|
@@ -7023,15 +7023,17 @@ function useSource(opt) {
|
|
|
7023
7023
|
});
|
|
7024
7024
|
}
|
|
7025
7025
|
function onAdd(model) {
|
|
7026
|
-
if (!add)
|
|
7026
|
+
if (!add || loading.onAdd.value)
|
|
7027
7027
|
return;
|
|
7028
7028
|
const { fetch } = useFetch(add, baseUrl);
|
|
7029
|
+
loading.onAdd.value = true;
|
|
7029
7030
|
let httpFetch = fetch(model, false);
|
|
7030
7031
|
httpFetch.then((rsp) => {
|
|
7031
7032
|
if ((rsp == null ? void 0 : rsp.code) === 0) {
|
|
7032
7033
|
message.success(t("ADD_SUCCESS"));
|
|
7033
7034
|
search();
|
|
7034
7035
|
}
|
|
7036
|
+
loading.onAdd.value = false;
|
|
7035
7037
|
});
|
|
7036
7038
|
return httpFetch;
|
|
7037
7039
|
}
|
|
@@ -7042,8 +7044,9 @@ function useSource(opt) {
|
|
|
7042
7044
|
return await fetch({ id });
|
|
7043
7045
|
}
|
|
7044
7046
|
function onUpdate(model) {
|
|
7045
|
-
if (!update)
|
|
7047
|
+
if (!update || loading.onUpdate.value)
|
|
7046
7048
|
return;
|
|
7049
|
+
loading.onUpdate.value = true;
|
|
7047
7050
|
const { fetch } = useFetch(update, baseUrl);
|
|
7048
7051
|
let httpFetch = fetch(model, false);
|
|
7049
7052
|
httpFetch.then((rsp) => {
|
|
@@ -7051,18 +7054,23 @@ function useSource(opt) {
|
|
|
7051
7054
|
message.success(t("UPDATE_SUCCESS"));
|
|
7052
7055
|
search();
|
|
7053
7056
|
}
|
|
7057
|
+
loading.onUpdate.value = false;
|
|
7054
7058
|
});
|
|
7055
7059
|
return httpFetch;
|
|
7056
7060
|
}
|
|
7057
7061
|
function onDeletes(ids) {
|
|
7058
|
-
if (!deletes)
|
|
7062
|
+
if (!deletes || loading.onDeletes.value)
|
|
7059
7063
|
return;
|
|
7064
|
+
loading.onDeletes.value = true;
|
|
7060
7065
|
const { fetch } = useFetch(deletes, baseUrl);
|
|
7061
7066
|
fetch(toRaw(ids), false).then((rsp) => {
|
|
7062
7067
|
if ((rsp == null ? void 0 : rsp.code) === 0) {
|
|
7063
7068
|
message.success(`${ids.length > 1 ? t("MULTIFY") : ""} ${t("DELETE_SUCCESS")}`);
|
|
7069
|
+
if (ids.length > 1)
|
|
7070
|
+
clearKeys();
|
|
7064
7071
|
search();
|
|
7065
7072
|
}
|
|
7073
|
+
loading.onDeletes.value = false;
|
|
7066
7074
|
});
|
|
7067
7075
|
}
|
|
7068
7076
|
const { download } = useDownload(apiFul.export, exportName);
|
|
@@ -7267,7 +7275,7 @@ function useCurd(curdOpt) {
|
|
|
7267
7275
|
nextTick(() => dispatchResize());
|
|
7268
7276
|
});
|
|
7269
7277
|
}
|
|
7270
|
-
function dels(ids = []
|
|
7278
|
+
function dels(ids = []) {
|
|
7271
7279
|
if (!ids.length) {
|
|
7272
7280
|
message.error(t("EMPTY"));
|
|
7273
7281
|
return;
|
|
@@ -7282,7 +7290,6 @@ function useCurd(curdOpt) {
|
|
|
7282
7290
|
iconType: "warning",
|
|
7283
7291
|
onOk() {
|
|
7284
7292
|
curd.onDeletes(ids);
|
|
7285
|
-
cb();
|
|
7286
7293
|
}
|
|
7287
7294
|
});
|
|
7288
7295
|
} else {
|