EipUrlFormDialog.vue
3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<template>
<ht-tree-list-dialog
:single="single"
:data="data"
:table-columns="tableColumns"
:pagination="pagination"
:tree-data="treeData"
:default-expanded-keys="['7']"
selectLabel="formName"
dialog-title="选择表单"
@load="handleLoad"
@loadListData="loadListData"
@onConfirm="onConfirm"
@reset="reset"
quickSearchProps="formName,formKey"
search-placeholder="表单名称、表单key"
ref="htTreeListDialog"
:destroy-on-close="destroyOnClose"
:append-to-body="appendToBody"
/>
</template>
<script>
import req from "@/request.js";
import sysType from "@/api/sysType.js";
export default {
name: "eip-form-dialog",
props: {
value: Array,
name:String,
single: Boolean,
formType: {
type: String,
default: "pc"
},
appendToBody: {
type: Boolean,
default: false
},
destroyOnClose:{
type: Boolean,
default: false
}
},
data() {
return {
data: [],
treeData: null,
tableColumns: [
{ prop: "formKey", label: "表单key" },
{ prop: "formName", label: "表单名称" },
{ prop: "version", label: "版本号" }
],
pagination: {
page: 1,
pageSize: 50,
total: 0
},
typeIdQuery: null
};
},
mounted() {
},
methods: {
loadTreeData() {
sysType.getSysTypeByCatId("7").then(data => {
this.treeData = data;
});
},
showDialog() {
this.loadTreeData();
this.$refs.htTreeListDialog.showDialog();
},
handleLoad(param, cb) {
if (this.typeIdQuery) {
param.querys.push(this.typeIdQuery);
}
this.$set(param,"sorter",[{property: "UPDATE_TIME_", direction: "DESC"}]);
// 参数说明 url requestBodyParam requestParam
req
.post("${form}/form/formUrlForm/v1/querList", param, {
status: "deploy",
formType: this.formType,
formKey: ''
})
.then(data => {
let response = data.data;
this.data = response.rows;
this.pagination = {
page: response.page,
pageSize: response.pageSize,
total: response.total
};
})
.finally(() => cb());
},
loadListData(nodedata) {
// 根据组织获取下级组织
// 获取当前组织及下级组织
let queryFilter = {
pageBean: this.pagination,
querys: []
};
this.typeIdQuery = {
property: "typeId",
value: nodedata.id,
group: "categoryGroup",
operation: "LIKE",
relation: "AND"
};
this.handleLoad(queryFilter, () => {});
},
onConfirm(selection) {
this.$emit("onConfirm", selection,this.name);
this.$emit("input", selection);
},
reset() {
/**
* 点击重置按钮
* 1. 清空树条件 this.typeIdQuery = "";
* 2. 清空树选中状态
* */
if (this.typeIdQuery) {
this.$refs.htTreeListDialog.$refs.tree.$refs.elTree.currentNode.node.isCurrent = false;
}
this.typeIdQuery = "";
}
}
};
</script>