mooho-base-admin-plus 0.4.60 → 0.4.61
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-730c0bd7]{display:flex}.image-group .image[data-v-730c0bd7]{border:solid 1px #ccc;width:75px;height:75px;margin:2px 1px;cursor:pointer}.image-group .image img[data-v-730c0bd7]{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,22 @@ 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
|
+
this.$refs.table.loadData(data2);
|
|
38909
|
+
}
|
|
38910
|
+
},
|
|
38911
|
+
down(row, index2) {
|
|
38912
|
+
let data2 = this.$refs.table.data;
|
|
38913
|
+
if (index2 < data2.length - 1) {
|
|
38914
|
+
data2.splice(index2, 1);
|
|
38915
|
+
data2.splice(index2 + 1, 0, row);
|
|
38916
|
+
this.$refs.table.loadData(data2);
|
|
38917
|
+
}
|
|
38855
38918
|
}
|
|
38856
38919
|
}
|
|
38857
38920
|
};
|
|
@@ -39436,6 +39499,22 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
39436
39499
|
"custom-icon": "fa fa-trash-alt",
|
|
39437
39500
|
onClick: ($event) => $options.remove($options.rowData(row, index2), index2)
|
|
39438
39501
|
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39502
|
+
this.static && $data.tableView.adjustEnable && !$props.readonly ? (openBlock(), createBlock(_component_Button, {
|
|
39503
|
+
key: 2,
|
|
39504
|
+
size: "small",
|
|
39505
|
+
title: _ctx.$t("Front_Btn_Up"),
|
|
39506
|
+
type: "primary",
|
|
39507
|
+
"custom-icon": "fa fa-chevron-up",
|
|
39508
|
+
onClick: ($event) => $options.up($options.rowData(row, index2), index2)
|
|
39509
|
+
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39510
|
+
this.static && $data.tableView.adjustEnable && !$props.readonly ? (openBlock(), createBlock(_component_Button, {
|
|
39511
|
+
key: 3,
|
|
39512
|
+
size: "small",
|
|
39513
|
+
title: _ctx.$t("Front_Btn_Down"),
|
|
39514
|
+
type: "primary",
|
|
39515
|
+
"custom-icon": "fa fa-chevron-down",
|
|
39516
|
+
onClick: ($event) => $options.down($options.rowData(row, index2), index2)
|
|
39517
|
+
}, null, 8, ["title", "onClick"])) : createCommentVNode("", true),
|
|
39439
39518
|
(openBlock(true), createElementBlock(Fragment, null, renderList($data.commandButtons, (item, index3) => {
|
|
39440
39519
|
return openBlock(), createBlock(_component_Button, {
|
|
39441
39520
|
key: index3,
|
|
@@ -39595,7 +39674,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
39595
39674
|
], 2)
|
|
39596
39675
|
], 2);
|
|
39597
39676
|
}
|
|
39598
|
-
var ViewTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-
|
|
39677
|
+
var ViewTable = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-730c0bd7"]]);
|
|
39599
39678
|
const _sfc_main$p = {
|
|
39600
39679
|
mixins: [mixinPage],
|
|
39601
39680
|
components: { columnSelect, columnEdit },
|