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

新增消息提醒

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