Commit be263b32 authored by 徐一鸣's avatar 徐一鸣

新建定向推送

parent 1e0abe92
...@@ -725,4 +725,45 @@ width: 620px!important; ...@@ -725,4 +725,45 @@ width: 620px!important;
.apaas_steps .apaas_step .apaas_step_action .el-button + .el-button { .apaas_steps .apaas_step .apaas_step_action .el-button + .el-button {
margin-left: 20px; margin-left: 20px;
} }
.top_fliter {
display: flex;
}
.top_fliter .filter_list {
flex-grow: 1;
min-width: 550px;
}
.filter_list > .filter_item {
display: inline-block;
vertical-align: middle;
margin-top: 15px;
}
.filter_list > .filter_item {
margin-right: 15px;
}
.filter_list > .filter_item > .filter_title {
display: inline-block;
vertical-align: middle;
width: 8em;
text-align: right;
font-size: 14px;
font-weight: 700;
color: #242c43;
margin-right: 10px;
white-space: nowrap;
}
.filter_list > .filter_item > .filter_title + * {
width: 300px;
}
.top_fliter .filter_action {
flex-shrink: 0;
margin-left: 25px;
text-align: right;
}
.filter_action > .el-button {
min-width: 90px;
margin-top: 15px;
}
.filter_action > .el-button + .el-button {
margin-left: 10px;
}
/* 详情页公共样式 by xuyiming ~~~end */ /* 详情页公共样式 by xuyiming ~~~end */
\ No newline at end of file
...@@ -281,46 +281,3 @@ export default { ...@@ -281,46 +281,3 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>
<style>
.top_fliter {
display: flex;
}
.top_fliter .filter_list {
flex-grow: 1;
}
.filter_list > .filter_item {
display: inline-block;
vertical-align: middle;
margin-top: 15px;
}
.filter_list > .filter_item {
margin-right: 15px;
}
.filter_list > .filter_item > .filter_title {
display: inline-block;
vertical-align: middle;
width: 8em;
text-align: right;
font-size: 14px;
font-weight: 700;
color: #242c43;
margin-right: 10px;
white-space: nowrap;
}
.filter_list > .filter_item > .filter_title + * {
width: 300px;
}
.top_fliter .filter_action {
flex-shrink: 0;
margin-left: 25px;
text-align: right;
}
.filter_action > .el-button {
min-width: 90px;
margin-top: 15px;
}
.filter_action > .el-button + .el-button {
margin-left: 10px;
}
</style>
<template> <template>
<div class="apass_table"> <div class="apass_table">
<el-table :data="data" @sort-change="sortChange"> <el-table :data="data" @sort-change="sortChange" @row-click="rowClick">
<el-table-column <el-table-column
v-if="paddingLeft > 10" v-if="paddingLeft > 10"
:width="paddingLeft - 10" :width="paddingLeft - 10"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
class="btn" class="btn"
:class="v.class || ''" :class="v.class || ''"
:key="'btn_' + index + '_' + i" :key="'btn_' + index + '_' + i"
@click="v.callback && v.callback(scope.row)" @click.stop="v.callback && v.callback(scope.row)"
v-text="v.getLabel ? v.getLabel(scope.row) : v.label" v-text="v.getLabel ? v.getLabel(scope.row) : v.label"
> >
</a> </a>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<a <a
class="btn" class="btn"
v-text="scope.row[item.prop]" v-text="scope.row[item.prop]"
@click="item.callback && item.callback(scope.row)" @click.stop="item.callback && item.callback(scope.row)"
></a> ></a>
</div> </div>
<div v-else-if="item.type === 'icon'"> <div v-else-if="item.type === 'icon'">
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
tag_flag_arr[scope.$index] == 0 && tag_flag_arr[scope.$index] == 0 &&
scope.row[item.prop].length > 2 scope.row[item.prop].length > 2
" "
@click="change_tag(scope.$index, 1)" @click.stop="change_tag(scope.$index, 1)"
></div> ></div>
<div <div
class="tagclo btn_up" class="tagclo btn_up"
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
tag_flag_arr[scope.$index] == 1 && tag_flag_arr[scope.$index] == 1 &&
scope.row[item.prop].length > 2 scope.row[item.prop].length > 2
" "
@click="change_tag(scope.$index, 0)" @click.stop="change_tag(scope.$index, 0)"
></div> ></div>
</div> </div>
<div v-else-if="item.type === 'chart'" class="charts"> <div v-else-if="item.type === 'chart'" class="charts">
...@@ -174,6 +174,15 @@ ...@@ -174,6 +174,15 @@
<img v-else :src="require('../assets/imgs/icon_down.png')" /> <img v-else :src="require('../assets/imgs/icon_down.png')" />
</span> </span>
</span> </span>
<span
v-else-if="item.type === 'selected-icon'"
class="selected_icon"
:class="{
selected: scope.row[item.prop],
}"
>
<span></span>
</span>
<span <span
v-else v-else
v-text=" v-text="
...@@ -241,6 +250,9 @@ export default { ...@@ -241,6 +250,9 @@ export default {
sortChange(value) { sortChange(value) {
this.$emit("sort-change", value); this.$emit("sort-change", value);
}, },
rowClick(value) {
this.$emit("row-click", value);
},
getPercent(num) { getPercent(num) {
return Math.round(num * 100) + "%"; return Math.round(num * 100) + "%";
}, },
...@@ -334,4 +346,25 @@ export default { ...@@ -334,4 +346,25 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.selected_icon {
display: inline-block;
vertical-align: middle;
width: 16px;
height: 16px;
border: 1px solid #e3e5ef;
padding: 2px;
box-sizing: border-box;
background-color: #fff;
border-radius: 50%;
}
.selected_icon > span {
display: none;
width: 100%;
height: 100%;
background-color: #e56600;
border-radius: 50%;
}
.selected_icon.selected > span {
display: block;
}
</style> </style>
<template> <template>
<div class="app_build_step" v-show="isActive"> <div class="app_build_step" v-if="isActive">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
......
...@@ -137,6 +137,9 @@ export default { ...@@ -137,6 +137,9 @@ export default {
justify-content: flex-start; justify-content: flex-start;
align-items: stretch; align-items: stretch;
} }
.service_fliter {
padding: 15px 0;
}
.service_list { .service_list {
flex-grow: 1; flex-grow: 1;
margin-top: 19px; margin-top: 19px;
......
<template>
<div class="select_template">
<div class="top_fliter template_fliter">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板搜索:</span>
<el-input
v-model="keyword"
placeholder="请输入消息模板名称/id"
></el-input>
</div>
<div class="filter_item">
<span class="filter_title">最后更新时间:</span>
<el-date-picker
v-model="updateTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
</show-more-filter>
<div class="filter_action apaas_button">
<el-button type="primary" @click="topFilterAction">
查询
</el-button>
<el-button type="defalut" @click="topFilterClear">
重置
</el-button>
</div>
</div>
<div class="template_list apaas_scroll">
<list-table
class="selected_table"
:header="listHeader"
:data="listData"
:padding-left="0"
@row-click="selectTemplate"
></list-table>
<list-pagination
:total="listTotal"
:page-sizes="pageSizes"
:page-size="pageSize"
:current-page="currentPage"
@size-change="changePageSize"
@current-change="changeCurrentPage"
style="margin-top: 20px;"
></list-pagination>
</div>
</div>
</template>
<script>
import helper from "@/services/helper.js";
import listTable from "@/components/apass-table";
import ListPagination from "@/components/comments-pagination";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
listTable,
ListPagination,
showMoreFilter,
},
data() {
return {
selected: null,
listHeader: [],
listData: [],
listTotal: 0,
pageSizes: [10, 20, 50],
pageSize: 10,
currentPage: 1,
keyword: "",
updateTime: "",
types: [
{
name: "全部",
value: "",
},
{
name: "服务推送",
value: 1,
},
{
name: "平台维护",
value: 2,
},
{
name: "版本更新",
value: 3,
},
{
name: "自动消息",
value: 4,
},
],
};
},
created() {
let _self = this;
_self.listHeader = [
{
label: "",
type: "selected-icon",
prop: "selected",
align: "center",
width: 60,
},
{
label: "模板ID",
prop: "id",
width: 240,
},
{
label: "消息模板名称",
prop: "name",
type: "button",
callback: _self.detailAction,
width: 240,
},
{
label: "模板类型",
prop: "tpl_type",
getText(item) {
let types = [..._self.types];
types[0] = {
name: "-",
value: "",
};
return types[item.tpl_type || 0].name;
},
width: 160,
align: "center",
},
{
label: "模板详情",
prop: "content",
},
{
label: "最后更新时间",
prop: "update_time",
getText(item) {
let date = item.update_time || "";
return helper.dateStringTransform(date);
},
align: "center",
width: 180,
},
];
this.getTemplateList();
},
methods: {
getTemplateList() {
let params = {
page: this.currentPage,
size: this.pageSize,
keyword: this.keyword,
update_time_s: (this.updateTime && this.updateTime[0]) || "",
update_time_e: (this.updateTime && this.updateTime[1]) || "",
};
this.$http
.get("/apaas/service/v3/msg/manage/tpl/list", { params })
.then(({ data }) => {
if (data.success == 1) {
let listData = (data.data && data.data.list) || [];
listData.forEach((item) => {
item.selected =
(this.selected && this.selected.id === item.id) || false;
});
this.listTotal = (data.data && data.data.total) || 0;
this.listData = listData;
} else {
this.$message({
message: data.errMsg || "获取消息模板列表失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "获取消息模板列表失败",
type: "warning",
});
});
},
changePageSize(value) {
this.pageSize = value;
this.currentPage = 1;
this.getTemplateList();
},
changeCurrentPage(value) {
this.currentPage = value;
this.getTemplateList();
},
topFilterAction() {
this.getTemplateList();
},
topFilterClear() {
this.keyword = "";
this.updateTime = "";
this.getTemplateList();
},
detailAction(item) {
console.log(item);
},
selectTemplate(item) {
this.listData.forEach((v) => {
if (v.id === item.id) {
if (this.selected && this.selected.id === v.id) {
this.$set(v, "selected", false);
this.selected = null;
} else {
this.$set(v, "selected", true);
this.selected = v;
}
} else {
this.$set(v, "selected", false);
}
});
this.$emit("change", this.selected);
},
},
};
</script>
<style scoped>
.select_template {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
}
.template_fliter {
padding: 0 0 14px;
border-bottom: 1px solid #e9ecf3;
}
.template_list {
flex-grow: 1;
margin-top: 19px;
overflow-x: hidden;
overflow-y: auto;
}
.selected_table {
min-height: calc(100% - 60px);
}
</style>
<style>
.selected_table .el-table__body-wrapper .el-table__row {
cursor: pointer;
}
</style>
...@@ -61,7 +61,6 @@ export default { ...@@ -61,7 +61,6 @@ export default {
this.btnLeft = totalWidth - filterWidth + 5 + "px"; this.btnLeft = totalWidth - filterWidth + 5 + "px";
wrapFlag = true; wrapFlag = true;
} }
console.log(totalWidth, containerWidth, this.btnLeft);
filter.style.display = this.showMore ? "inline-block" : "none"; filter.style.display = this.showMore ? "inline-block" : "none";
} else { } else {
......
...@@ -49,9 +49,11 @@ ...@@ -49,9 +49,11 @@
: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> @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">
取消 取消
...@@ -72,9 +74,11 @@ ...@@ -72,9 +74,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">
取消 取消
...@@ -119,23 +123,59 @@ export default { ...@@ -119,23 +123,59 @@ export default {
return { return {
step: 0, step: 0,
done: false, done: false,
serviceIds: "",
templateId: "",
targetUserIds: "",
}; };
}, },
created() {}, created() {},
methods: { methods: {
selectService(values) { selectService(values) {
console.log(values.map((item) => item.id).join(",")); this.serviceIds = values.map((item) => item.id).join(",");
},
selectTemplate(value) {
this.templateId = (value && value.id) || "";
},
selectTargetUser(values) {
this.targetUserIds = values.map((item) => item.user_id).join(",");;
}, },
backToList() { backToList() {
this.$router.push("/message/directed_push"); this.$router.push("/message/directed_push");
}, },
step1Action() { step1Action() {
if (this.serviceIds === "") {
this.$message({
message: "您尚未选择要推送的服务",
type: "warning",
});
return;
}
this.step = 1; this.step = 1;
}, },
step2Action() { step2Action() {
if (this.templateId === "") {
this.$message({
message: "您尚未选择消息模板",
type: "warning",
});
return;
}
this.step = 2; this.step = 2;
}, },
step3Action() { step3Action() {
if (this.targetUserIds === "") {
this.$message({
message: "您尚未选择目标用户",
type: "warning",
});
return;
}
this.done = true; this.done = true;
}, },
}, },
......
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