Commit 8e9b5db2 authored by 徐一鸣's avatar 徐一鸣

消息管理模板选择组件fixed

parent fc9208c5
...@@ -9,6 +9,18 @@ ...@@ -9,6 +9,18 @@
placeholder="请输入消息模板名称/id" placeholder="请输入消息模板名称/id"
></el-input> ></el-input>
</div> </div>
<div class="filter_item" v-if="tpl_types.length > 1">
<span class="filter_title">模板类型:</span>
<el-select v-model="type" placeholder="请选择">
<el-option
v-for="item in tpl_types"
:label="item.name"
:value="item.value"
:key="item.value"
>
</el-option>
</el-select>
</div>
<div class="filter_item"> <div class="filter_item">
<span class="filter_title">最后更新时间:</span> <span class="filter_title">最后更新时间:</span>
<el-date-picker <el-date-picker
...@@ -127,6 +139,10 @@ export default { ...@@ -127,6 +139,10 @@ export default {
type: Boolean, type: Boolean,
defailt: false, defailt: false,
}, },
tmpTypes: {
type: Array,
defailt: [],
},
}, },
data() { data() {
return { return {
...@@ -138,6 +154,7 @@ export default { ...@@ -138,6 +154,7 @@ export default {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
keyword: "", keyword: "",
type: "",
updateTime: "", updateTime: "",
types: [ types: [
{ {
...@@ -161,6 +178,7 @@ export default { ...@@ -161,6 +178,7 @@ export default {
value: 4, value: 4,
}, },
], ],
tpl_types: [],
detail: { detail: {
name: "", name: "",
tpl_type: "", tpl_type: "",
...@@ -234,12 +252,36 @@ export default { ...@@ -234,12 +252,36 @@ export default {
}, },
]; ];
if (this.tmpTypes.length > 0) {
let tpl_types = [];
this.types.forEach((item) => {
if (this.tmpTypes.indexOf(item.value) > -1) {
tpl_types.push(item);
}
});
if (this.tmpTypes.length > 1) {
tpl_types = [
{
name: "全部",
value: this.tmpTypes.join(","),
},
...tpl_types,
];
}
this.tpl_types = tpl_types;
this.type = tpl_types[0].value;
}
this.getTemplateList(); this.getTemplateList();
}, },
methods: { methods: {
getTemplateList() { getTemplateList() {
let params = { let params = {
page: this.currentPage, page: this.currentPage,
tpl_type: this.type,
size: this.pageSize, size: this.pageSize,
keyword: this.keyword, keyword: this.keyword,
update_time_s: (this.updateTime && this.updateTime[0]) || "", update_time_s: (this.updateTime && this.updateTime[0]) || "",
...@@ -358,7 +400,7 @@ export default { ...@@ -358,7 +400,7 @@ export default {
...this.selected, ...this.selected,
content: this.detail.content, content: this.detail.content,
}); });
this.$refs.dialog.hide(); this.$refs.dialog.hide();
}, },
}, },
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
> >
<select-template <select-template
class="apaas_step_content" class="apaas_step_content"
:tmp-types="[1]"
@change="selectTemplate" @change="selectTemplate"
></select-template> ></select-template>
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<select-template <select-template
class="apaas_step_content" class="apaas_step_content"
:edit="true" :edit="true"
:tmp-types="[2, 3]"
@change="selectTemplate" @change="selectTemplate"
></select-template> ></select-template>
...@@ -98,7 +99,7 @@ export default { ...@@ -98,7 +99,7 @@ export default {
step: 0, step: 0,
done: false, done: false,
templateId: "", templateId: "",
templateContent:"", templateContent: "",
targetUserIds: "", targetUserIds: "",
}; };
}, },
......
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