Commit 779c252b authored by 徐一鸣's avatar 徐一鸣

新增消息提醒

parent 2e05961c
...@@ -611,6 +611,7 @@ width: 620px!important; ...@@ -611,6 +611,7 @@ width: 620px!important;
} }
.apass_table .border-active td { .apass_table .border-active td {
padding: 10px 0; padding: 10px 0;
background-color: #e6ebfe;
border-top: 2px solid #515fe7 !important; border-top: 2px solid #515fe7 !important;
border-bottom: 2px solid #515fe7 !important; border-bottom: 2px solid #515fe7 !important;
} }
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
type="textarea" type="textarea"
placeholder="请输入消息详情,最多可以输入500字。" placeholder="请输入消息详情,最多可以输入500字。"
maxlength="500" maxlength="500"
:disabled="true" :disabled="!editContent"
></el-input> ></el-input>
<p <p
class="textarea_count" class="textarea_count"
...@@ -122,6 +122,12 @@ export default { ...@@ -122,6 +122,12 @@ export default {
showMoreFilter, showMoreFilter,
apassDialog, apassDialog,
}, },
props: {
edit: {
type: Boolean,
defailt: false,
},
},
data() { data() {
return { return {
selected: null, selected: null,
...@@ -160,6 +166,7 @@ export default { ...@@ -160,6 +166,7 @@ export default {
tpl_type: "", tpl_type: "",
content: "", content: "",
}, },
editContent: false,
}; };
}, },
computed: { computed: {
...@@ -309,6 +316,9 @@ export default { ...@@ -309,6 +316,9 @@ export default {
return row.selected ? "border-active" : ""; return row.selected ? "border-active" : "";
}, },
detailAction(item) { detailAction(item) {
this.editContent =
(this.edit && this.selected && this.selected.id === item.id) || false;
this.$http this.$http
.get("/apaas/service/v3/msg/manage/tpl/info", { .get("/apaas/service/v3/msg/manage/tpl/info", {
params: { params: {
...@@ -344,6 +354,11 @@ export default { ...@@ -344,6 +354,11 @@ export default {
this.$refs.dialog.hide(); this.$refs.dialog.hide();
}, },
submitAction() { submitAction() {
this.$emit("change", {
...this.selected,
content: this.detail.content,
});
this.$refs.dialog.hide(); this.$refs.dialog.hide();
}, },
}, },
......
...@@ -29,9 +29,12 @@ ...@@ -29,9 +29,12 @@
:active-icon="require('@/assets/imgs/progress_ic_xiaoximb.png')" :active-icon="require('@/assets/imgs/progress_ic_xiaoximb.png')"
class="apaas_step" class="apaas_step"
> >
<div class="apaas_step_content apaas_scroll"> <select-template
<p style="padding: 50px;text-align: center;">选择消息模板</p> class="apaas_step_content"
</div> :edit="true"
@change="selectTemplate"
></select-template>
<div class="apaas_button apaas_step_action"> <div class="apaas_button apaas_step_action">
<el-button type="defalut" @click="backToList"> <el-button type="defalut" @click="backToList">
取消 取消
...@@ -47,9 +50,11 @@ ...@@ -47,9 +50,11 @@
:active-icon="require('@/assets/imgs/progress_ic_renyuan.png')" :active-icon="require('@/assets/imgs/progress_ic_renyuan.png')"
class="apaas_step" class="apaas_step"
> >
<div class="apaas_step_content apaas_scroll"> <select-users
<p style="padding: 50px;text-align: center;">选择目标用户</p> class="apaas_step_content"
</div> @change="selectTargetUser"
></select-users>
<div class="apaas_button apaas_step_action"> <div class="apaas_button apaas_step_action">
<el-button type="defalut" @click="backToList"> <el-button type="defalut" @click="backToList">
取消 取消
...@@ -78,16 +83,23 @@ ...@@ -78,16 +83,23 @@
<script> <script>
import Steps from "@/components/app-build-steps/app-build-steps"; import Steps from "@/components/app-build-steps/app-build-steps";
import Step from "@/components/app-build-steps/app-build-step"; import Step from "@/components/app-build-steps/app-build-step";
import SelectTemplate from "@/components/message-steps/select-template";
import SelectUsers from "@/components/message-steps/select-users";
export default { export default {
components: { components: {
Steps, Steps,
Step, Step,
SelectTemplate,
SelectUsers,
}, },
data() { data() {
return { return {
step: 0, step: 0,
done: false, done: false,
templateId: "",
templateContent:"",
targetUserIds: "",
}; };
}, },
computed: {}, computed: {},
...@@ -96,11 +108,63 @@ export default { ...@@ -96,11 +108,63 @@ export default {
backToList() { backToList() {
this.$router.push("/message/message_alert"); this.$router.push("/message/message_alert");
}, },
selectTemplate(value) {
this.templateId = (value && value.id) || "";
this.templateContent = (value && value.content) || "";
},
selectTargetUser(values) {
this.targetUserIds = values.map((item) => item.id).join(",") || "";
},
step1Action() { step1Action() {
if (this.templateId === "") {
this.$message({
message: "您尚未选择消息模板",
type: "warning",
});
return;
}
this.step = 1; this.step = 1;
}, },
step2Action() { step2Action() {
this.done = true; if (this.targetUserIds === "") {
this.$message({
message: "您尚未选择目标用户",
type: "warning",
});
return;
}
this.$http
.post("/apaas/service/v3/push/alertmsg/create", {
tpl_id: this.templateId,
contents: this.templateContent,
receive_user: this.targetUserIds,
})
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: "创建成功",
type: "success",
});
this.done = true;
} else {
this.$message({
message: data.errMsg || "创建失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "创建失败",
type: "warning",
});
});
}, },
}, },
}; };
......
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