Commit ce54ed22 authored by renjintao's avatar renjintao

datagrid

parent a10adea4
......@@ -15,6 +15,7 @@
</Form>
</slot>
</div>
<div class="searchBack">
<slot name="searchBack"></slot>
</div>
......@@ -298,62 +299,63 @@ export default {
this.columnsCur = curColumns;
}
}
}
});
}
this.search.pageIndex = 1;
this.search.conditions = where;
this.load();
},
pageChange(page) {
this.search.page = page;
this.search.pageIndex = page;
this.load();
},
pageSizeChange(size) {
this.search.pageSize = size;
this.search.pageIndex = 1;
this.load();
},
columnChange(item, i) {
item.hide = !item.hide;
this.$set(this.columnsCur, item, i);
this.saveUserconfig();
},
selectionChange(items) {
this.$emit("on-selection-change", items);
this.selectItems = items;
this.footerToolbar = items.length > 0;
loadUserConfig() {
var query = {
conditions: [{
fieldName: "creatorUserId",
fieldValue: this.userId,
conditionalType: "Equal",
},
onSelect(rows, row) {
this.$emit("on-change", rows, row);
{
fieldName: "component",
fieldValue: "Grid",
conditionalType: "Equal",
},
allChange(items) {
this.$emit("all-change", items);
{
fieldName: "page",
fieldValue: window.location.pathname,
conditionalType: "Equal",
},
intY() {
if (this.$refs.table != undefined) {
this.firstY = this.$refs.table.$el.getBoundingClientRect().top;
],
pageSize: 1,
};
this.$api.post(`${window.systemUrl}/config/list`, query).then((r) => {
if (r.success) {
if (r.result.length == 1) {
this.userConfig = r.result[0];
this.columnInit();
}
if (!this.configLoad) {
this.easySearch();
}
this.configLoad = true;
}
});
},
selectAll(status) {
this.$refs.table.selectAll(status);
},
//批量取消
cancelBatch() {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
},
computed: {
columnsNow() {
var cols = this.columnsCur.filter((u) => {
if (u.code) {
u.render = (h, params) => {
let values = u.key;
let type = "text";
if (u.category) {
type = u.category;
saveUserconfig() {
let url = `${window.systemUrl}/config/update`;
var content = [];
this.columnsCur.map((u) => {
content.push({
key: u.key,
hide: u.hide,
});
});
if (!this.userConfig) {
url = `${window.systemUrl}/config/create`;
var data = {
page: window.location.pathname,
component: "Grid",
key: this.$u.guid(),
content: JSON.stringify(content),
};
this.$api.post(url, data).then((r) => {
this.loadUserConfig();
});
} else {
this.userConfig.content = JSON.stringify(content);
this.$api.post(url, this.userConfig);
}
},
//展开
......@@ -442,7 +444,10 @@ computed: {
this.footerToolbar = items.length > 0;
},
onSelect(rows, row) {
this.$emit("on-selection-change", rows, row);
this.$emit("on-change", rows, row);
},
allChange(items) {
this.$emit("all-change", items);
},
intY() {
if (this.$refs.table != undefined) {
......@@ -533,7 +538,7 @@ computed: {
this.columnsCur = this.$u.clone(this.columns);
},
},
};
};
</script>
<style lang="less">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment