mooho-base-admin-plus 0.4.60 → 0.4.62
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.
|
@@ -23697,6 +23697,51 @@ const _sfc_main$11 = {
|
|
|
23697
23697
|
} else {
|
|
23698
23698
|
this.$refs.table.loadData();
|
|
23699
23699
|
}
|
|
23700
|
+
},
|
|
23701
|
+
beforeLoadData() {
|
|
23702
|
+
if (!(this.filter["keyword"] || "").trim()) {
|
|
23703
|
+
this.filter["parentID"] = "null";
|
|
23704
|
+
} else {
|
|
23705
|
+
this.filter["parentID"] = null;
|
|
23706
|
+
}
|
|
23707
|
+
},
|
|
23708
|
+
async onLoadData() {
|
|
23709
|
+
if (!!(this.filter["keyword"] || "").trim()) {
|
|
23710
|
+
let data2 = this.$refs.table.data;
|
|
23711
|
+
if (data2.length > 0) {
|
|
23712
|
+
let dataWithParent = [];
|
|
23713
|
+
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
23714
|
+
await this.loadParentData(data2[i2], dataWithParent);
|
|
23715
|
+
}
|
|
23716
|
+
dataWithParent.forEach((item) => {
|
|
23717
|
+
if (item.parentID) {
|
|
23718
|
+
let parent = dataWithParent.find((p) => p.id == item.parentID);
|
|
23719
|
+
if (!parent.children) {
|
|
23720
|
+
parent.children = [];
|
|
23721
|
+
}
|
|
23722
|
+
parent.children.push(item);
|
|
23723
|
+
parent._showChildren = true;
|
|
23724
|
+
}
|
|
23725
|
+
});
|
|
23726
|
+
data2.length = 0;
|
|
23727
|
+
dataWithParent.filter((item) => item.parentID == null).forEach((item) => {
|
|
23728
|
+
data2.push(item);
|
|
23729
|
+
});
|
|
23730
|
+
}
|
|
23731
|
+
}
|
|
23732
|
+
},
|
|
23733
|
+
async loadParentData(data2, dataWithParent) {
|
|
23734
|
+
dataWithParent.push(data2);
|
|
23735
|
+
if (data2.parentID && !dataWithParent.some((item) => item.id == data2.parentID)) {
|
|
23736
|
+
let res2 = await modelApi.query("Permission", {
|
|
23737
|
+
id: data2.parentID,
|
|
23738
|
+
page: 1,
|
|
23739
|
+
per: 1
|
|
23740
|
+
});
|
|
23741
|
+
await this.loadParentData(res2.data[0], dataWithParent);
|
|
23742
|
+
} else {
|
|
23743
|
+
return;
|
|
23744
|
+
}
|
|
23700
23745
|
}
|
|
23701
23746
|
}
|
|
23702
23747
|
};
|
|
@@ -23732,6 +23777,8 @@ function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
23732
23777
|
"has-children": (row) => {
|
|
23733
23778
|
return row.hasChildren;
|
|
23734
23779
|
},
|
|
23780
|
+
"before-load-data": $options.beforeLoadData,
|
|
23781
|
+
onOnLoadData: $options.onLoadData,
|
|
23735
23782
|
onCreate: _cache[1] || (_cache[1] = ($event) => $options.create()),
|
|
23736
23783
|
onEdit: _cache[2] || (_cache[2] = ({ row, index: index2 }) => $options.edit(row))
|
|
23737
23784
|
}, {
|
|
@@ -23783,7 +23830,7 @@ function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
23783
23830
|
}, toDisplayString$1(_ctx.showData(row, column)), 5)) : createCommentVNode("", true)
|
|
23784
23831
|
]),
|
|
23785
23832
|
_: 1
|
|
23786
|
-
}, 8, ["filter", "tree-load", "has-children"])
|
|
23833
|
+
}, 8, ["filter", "tree-load", "has-children", "before-load-data", "onOnLoadData"])
|
|
23787
23834
|
]),
|
|
23788
23835
|
_: 1
|
|
23789
23836
|
}),
|
|
@@ -37596,7 +37643,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
37596
37643
|
]);
|
|
37597
37644
|
}
|
|
37598
37645
|
var tableFilter = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r]]);
|
|
37599
|
-
var viewTable_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".image-group[data-v-
|
|
37646
|
+
var viewTable_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".image-group[data-v-4f485161]{display:flex}.image-group .image[data-v-4f485161]{border:solid 1px #ccc;width:75px;height:75px;margin:2px 1px;cursor:pointer}.image-group .image img[data-v-4f485161]{width:75px;height:75px}\n")();
|
|
37600
37647
|
var getColumns = (view, item) => {
|
|
37601
37648
|
let children = view.viewColumns.filter((i2) => {
|
|
37602
37649
|
return i2.parentCode == item.code;
|
|
@@ -38852,6 +38899,28 @@ const _sfc_main$q = {
|
|
|
38852
38899
|
return column.name;
|
|
38853
38900
|
}
|
|
38854
38901
|
}
|
|
38902
|
+
},
|
|
38903
|
+
up(row, index2) {
|
|
38904
|
+
let data2 = this.$refs.table.data;
|
|
38905
|
+
if (index2 > 0) {
|
|
38906
|
+
data2.splice(index2, 1);
|
|
38907
|
+
data2.splice(index2 - 1, 0, row);
|
|
38908
|
+
for (let item of data2) {
|
|
38909
|
+
delete item.id;
|
|
38910
|
+
}
|
|
38911
|
+
this.$refs.table.loadData(data2);
|
|
38912
|
+
}
|
|
38913
|
+
},
|
|
38914
|
+
down(row, index2) {
|
|
38915
|
+
let data2 = this.$refs.table.data;
|
|
38916
|
+
if (index2 < data2.length - 1) {
|
|
38917
|
+
data2.splice(index2, 1);
|
|
38918
|
+
data2.splice(index2 + 1, 0, row);
|
|
38919
|
+
for (let item of data2) {
|
|
38920
|
+
delete item.id;
|
|
38921
|
+
}
|
|
38922
|
+
this.$refs.table.loadData(data2);
|
|
38923
|
+
}
|
|
38855
38924
|
}
|
|
38856
38925
|
}
|
|
38857
38926
|
};
|
|
@@ -39436,6 +39505,22 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
39436
39505
|
"custom-icon": "fa fa-trash-alt",
|
|
39437
39506
|
onClick: ($event) => $options.remove($options.rowData(row, index2), index2)
|
|
39438
39507
|
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39508
|
+
this.static && $data.tableView.adjustEnable && !$props.readonly ? (openBlock(), createBlock(_component_Button, {
|
|
39509
|
+
key: 2,
|
|
39510
|
+
size: "small",
|
|
39511
|
+
title: _ctx.$t("Front_Btn_Up"),
|
|
39512
|
+
type: "primary",
|
|
39513
|
+
"custom-icon": "fa fa-chevron-up",
|
|
39514
|
+
onClick: ($event) => $options.up($options.rowData(row, index2), index2)
|
|
39515
|
+
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39516
|
+
this.static && $data.tableView.adjustEnable && !$props.readonly ? (openBlock(), createBlock(_component_Button, {
|
|
39517
|
+
key: 3,
|
|
39518
|
+
size: "small",
|
|
39519
|
+
title: _ctx.$t("Front_Btn_Down"),
|
|
39520
|
+
type: "primary",
|
|
39521
|
+
"custom-icon": "fa fa-chevron-down",
|
|
39522
|
+
onClick: ($event) => $options.down($options.rowData(row, index2), index2)
|
|
39523
|
+
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39439
39524
|
(openBlock(true), createElementBlock(Fragment, null, renderList($data.commandButtons, (item, index3) => {
|
|
39440
39525
|
return openBlock(), createBlock(_component_Button, {
|
|
39441
39526
|
key: index3,
|
|
@@ -39595,7 +39680,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
39595
39680
|
], 2)
|
|
39596
39681
|
], 2);
|
|
39597
39682
|
}
|
|
39598
|
-
var ViewTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-
|
|
39683
|
+
var ViewTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-4f485161"]]);
|
|
39599
39684
|
const _sfc_main$p = {
|
|
39600
39685
|
mixins: [mixinPage],
|
|
39601
39686
|
components: { columnSelect, columnEdit },
|