EipMsgTemplateDialog.vue
1.96 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
<template>
<ht-dialog
single
name="name"
:data="data"
:table-columns="tableColumns"
:pagination="pagination"
search-placeholder="模板编码,模板内容"
dialog-title="消息模板对话框"
quick-search-props="code,name"
:append-to-body="appendToBody"
:destroy-on-close="destroyOnClose"
@load="handleLoad"
@onConfirm="onConfirm"
ref="htDialog"
/>
</template>
<script>
import req from "@/request.js";
export default {
name: "eip-msg-template-dialog",
data() {
return {
data: [],
tableColumns: [
{ prop: "key", label: "模板编码" },
{ prop: "name", label: "模板名称"},
{ prop: "subject", label: "模板内容" }
],
pagination: {
page: 1,
pageSize: 50,
total: 0,
showTotal: true
}
}
},
props: {
value: String,
name: String,
appendToBody: {
type: Boolean,
default: false
},
destroyOnClose: {
type: Boolean,
default: false
},
script: {
type: String,
default: ""
}
},
methods: {
showDialog() {
this.$refs.htDialog.showDialog();
},
handleLoad(queryFilter, cb) {
req
.post("${portal}/flow/MsgTemplate/v1/listJson", queryFilter)
.then(response => {
this.data = response.data.rows;
this.pagination.page = response.data.page;
this.pagination.pageSize = response.data.pageSize;
this.pagination.total = response.data.total;
}).finally(()=> cb());
},
onConfirm(selection) {
this.$emit("onConfirm", selection[0].plain,this.name);
if (this.value) {
this.$emit("input", this.value + selection[0].plain);
}else{
this.$emit("input", selection[0].plain);
}
}
}
}
</script>
<style scoped>
</style>