Commit 53b65c45 authored by 徐一鸣's avatar 徐一鸣

Merge branch 'xym' into dev

parents f0cd4954 f63f75ce
......@@ -75,12 +75,10 @@ export default {
},
mounted() {
window.onresize = ()=>{
this.pageResize();
}
window.addEventListener("resize", this.pageResize);
},
destroyed(){
window.onresize = null;
window.removeEventListener("resize", this.pageResize);
},
methods: {
openflag_func(){
......
<template>
<div ref="container" class="show_more_filter">
<slot></slot>
<a
v-if="showBtn"
class="show_more_btn"
:style="{
left: btnLeft,
}"
@click="toggle"
>
更多检索
<i
data-v-3b31b76f=""
:class="showMore ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
></i>
</a>
</div>
</template>
<script>
export default {
data() {
return {
showBtn: false,
showMore: false,
btnLeft: 0,
};
},
mounted() {
this.resize();
window.addEventListener("resize", this.resize);
},
destroyed() {
window.removeEventListener("resize", this.resize);
},
methods: {
resize() {
this.$nextTick(() => {
let container = this.$refs.container;
let containerWidth = container.getBoundingClientRect().width - 80;
let filters = container.querySelectorAll(".filter_item");
let totalWidth = 0;
let wrapFlag = false;
this.showBtn = false;
filters.forEach((filter, index) => {
filter.style.display = "inline-block";
let filterWidth =
Math.ceil(filter.getBoundingClientRect().width) + 15;
totalWidth += filterWidth;
if (totalWidth > containerWidth) {
this.showBtn = true;
if (!wrapFlag) {
this.btnLeft = totalWidth - filterWidth + 5 + "px";
wrapFlag = true;
}
console.log(totalWidth, containerWidth, this.btnLeft);
filter.style.display = this.showMore ? "inline-block" : "none";
} else {
filter.style.display = "inline-block";
}
});
});
},
toggle() {
this.showMore = !this.showMore;
this.resize();
},
},
};
</script>
<style scoped>
.show_more_filter {
position: relative;
padding-right: 80px;
}
.show_more_btn {
position: absolute;
top: 25px;
font-size: 14px;
line-height: 20px;
color: #8890a7;
cursor: pointer;
user-select: none;
}
</style>
......@@ -20,7 +20,7 @@
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">banner搜索:</span>
<el-input
......@@ -61,7 +61,7 @@
>
</el-date-picker>
</div>
</div>
</show-more-filter>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
......@@ -90,11 +90,13 @@
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
apassList,
apassDialog,
showMoreFilter,
},
data: () => ({
listHeader: [],
......
......@@ -20,7 +20,7 @@
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板名称:</span>
<el-input
......@@ -32,8 +32,9 @@
<span class="filter_title">状态:</span>
<el-select v-model="topFilter.state" placeholder="请选择">
<el-option label="全部" value=""> </el-option>
<el-option label="推送成功" value="1"> </el-option>
<el-option label="推送失败" value="0"> </el-option>
<el-option label="推送成功" value="success"> </el-option>
<el-option label="推送失败" value="fail"> </el-option>
<el-option label="推送中" value="pushing"> </el-option>
</el-select>
</div>
<div class="filter_item">
......@@ -48,7 +49,7 @@
>
</el-date-picker>
</div>
</div>
</show-more-filter>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
......@@ -67,13 +68,80 @@
<apass-dialog
ref="dialog"
:msg="dialogInfo.msg"
:cancel-text="dialogInfo.cancelText"
:cancel-type="dialogInfo.cancelType"
:cancel="dialogInfo.cancel"
:sunbmit-text="dialogInfo.sunbmitText"
:submit="dialogInfo.submit"
></apass-dialog>
width="800"
title="查看"
@cancel="cancelAction"
@submit="submitAction"
>
<div class="detail_dialog" slot="content">
<div class="detail_item">
<p class="item_title">
消息模板名称:
</p>
<p class="item_content">
服务定向推送的消息
</p>
</div>
<div class="detail_item">
<p class="item_title">
模板类型:
</p>
<p class="item_content">
服务推送
</p>
</div>
<div class="detail_item full_line">
<p class="item_title">
消息详情:
</p>
<div class="full_content">
<div class="apass_scroll">
<p class="item_content">
亲爱的用户,根据您最近的服务调用情况,我们向您推荐
地图视频融合服务,贵州应急资源地图微服务,欢迎使用!
产品说这里最多可以输入500字。
</p>
</div>
</div>
</div>
<div class="detail_item full_line">
<p class="item_title">
目标用户:
</p>
<div class="full_content">
<div class="apass_scroll">
<p class="item_content">
贵阳市公安局,贵阳市水利局,内马尔,勒布朗詹姆斯
</p>
</div>
</div>
</div>
<div class="detail_item">
<p class="item_title">
推送时间:
</p>
<p class="item_content">
2020-04-30 12:34:56
</p>
</div>
<div class="detail_item">
<p class="item_title">
推送状态:
</p>
<p class="item_content">
推送成功
</p>
</div>
<div class="detail_item">
<p class="item_title">
推送流水号:
</p>
<p class="item_content">
propelling2020001
</p>
</div>
</div>
</apass-dialog>
</div>
</template>
......@@ -81,11 +149,13 @@
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
apassList,
apassDialog,
showMoreFilter,
},
data: () => ({
listHeader: [],
......@@ -105,6 +175,7 @@ export default {
push_time: "",
},
tempFilter: null,
templateDetail: null,
}),
created() {
this.listHeader = [
......@@ -113,40 +184,37 @@ export default {
prop: "state",
type: "image-tooltip",
getImage(item) {
return item.state == 1
? require("@/assets/imgs/ic_true.png")
: require("@/assets/imgs/ic_failed.png");
return [
require("@/assets/imgs/ic_failed.png"),
require("@/assets/imgs/ic_true.png"),
require("@/assets/imgs/ic_pushing.png"),
][item.state || 0];
},
getTooltip(item) {
return item.state == 1 ? "推送成功" : "推送失败";
return ["推送失败", "推送成功", "推送中"][item.state || 0];
},
align: "center",
width: 60,
},
{
label: "推送流水号",
prop: "push_num",
prop: "id",
width: 240,
},
{
label: "消息模板名称",
prop: "name",
prop: "tpl_name",
type: "button",
callback: this.detailAction,
width: 300,
},
{
label: "消息详情",
prop: "detail",
prop: "contents",
},
{
label: "接收用户",
prop: "users",
getText(item) {
let users = item.users || [];
return users.join("");
},
prop: "receive_user",
width: 300,
},
{
......@@ -163,122 +231,25 @@ export default {
},
methods: {
initList(filter) {
let fullFilter = {
...filter,
...this.topFilter,
let params = {
page: filter.page,
size: filter.size,
tplname: this.topFilter.name,
state: this.topFilter.state,
time_s: (this.topFilter.push_time && this.topFilter.push_time[0]) || "",
time_e: (this.topFilter.push_time && this.topFilter.push_time[1]) || "",
};
this.tempFilter = filter; // filter存档,用于页面刷新
console.log(fullFilter);
// console.log(params);
this.listTotal = 55;
this.listData = [
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["张三", "李四", "王五"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["张三", "李四", "王五"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["张三", "李四", "王五"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["张三", "李四", "王五"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
push_num: "propelling2020001",
name: "服务定向推送的消息",
detail:
"亲爱的用户,根据您的服务调用情况,我们向您推荐地图视频融合服务,欢迎使用!",
users: ["杨过", "小龙女", "冯宝宝"],
push_time: "2020-07-18T14:25:09+08:00",
},
];
this.tempFilter = filter; // filter存档,用于页面刷新
/* this.$http
.get("/apaas/service/v3/resource/apply/approveList", {
params: {
search: filter.keyword,
page: filter.page,
limit: filter.size,
state: filter.state,
},
})
this.$http
.get("/apaas/service/v3/push/directmsg/list", { params })
.then(({ data }) => {
if (data.success == 1) {
this.listTotal = data.total;
this.listData = data.data;
this.listTotal = (data.data && data.data.total) || 0;
this.listData = (data.data && data.data.data) || [];
} else {
this.$message({
message: data.errMsg || "获取列表失败",
......@@ -288,8 +259,13 @@ export default {
})
.catch((error) => {
console.log(error);
}); */
}, // TODO: 列表待调试
this.$message({
message: "获取列表失败",
type: "warning",
});
});
},
topFilterAction() {
this.initList(this.tempFilter);
},
......@@ -309,7 +285,46 @@ export default {
console.log("新建模板");
},
detailAction(item) {
console.log(`查看${item.name}`);
this.$http
.get(`/apaas/service/v3/push/directmsg/view/${item.id}`)
.then(({ data }) => {
if (data.success == 1) {
let detail = data.data;
this.templateDetail = {
tpl_name: detail.tpl_name,
tpl_type: ["", "服务推送", "平台维护", "版本更新", "自动消息"][
detail.tpl_type || 0
],
contents: "",
create_user: "",
id: "",
push_time: "",
receive_user: "",
state: "",
tpl_id: "",
};
this.$refs.dialog.show();
} else {
this.$message({
message: data.errMsg || "获取详情失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "获取详情失败",
type: "warning",
});
});
},
cancelAction() {
this.$refs.dialog.hide();
},
submitAction() {
this.$refs.dialog.hide();
},
},
};
......@@ -319,4 +334,40 @@ export default {
.list_container {
height: 100%;
}
.detail_dialog {
display: flex;
flex-wrap: wrap;
text-align: left;
}
.detail_dialog .detail_item {
flex: 1 1 auto;
width: 50%;
margin-top: 20px;
}
.detail_dialog .detail_item.full_line {
width: 100%;
}
.detail_dialog .detail_item p {
padding: 0 15px;
font-size: 14px;
line-height: 22px;
color: #8890a7;
}
.detail_dialog .detail_item .item_content {
color: #000;
margin-top: 10px;
}
.detail_dialog .detail_item .full_content {
padding: 10px 0;
border-radius: 8px;
background-color: #f8f9fd;
margin-top: 5px;
}
.detail_dialog .detail_item .full_content > .apass_scroll {
height: 176px;
overflow: auto;
}
.detail_dialog .detail_item .full_content .item_content {
margin: 0;
}
</style>
......@@ -20,7 +20,7 @@
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板名称:</span>
<el-input
......@@ -48,7 +48,7 @@
>
</el-date-picker>
</div>
</div>
</show-more-filter>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
......@@ -77,11 +77,13 @@
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
apassList,
apassDialog,
showMoreFilter,
},
data: () => ({
listHeader: [],
......
......@@ -20,7 +20,7 @@
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板搜索:</span>
<el-input
......@@ -49,7 +49,7 @@
>
</el-date-picker>
</div>
</div>
</show-more-filter>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
......@@ -78,11 +78,13 @@
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
apassList,
apassDialog,
showMoreFilter,
},
data: () => ({
listHeader: [],
......
......@@ -20,7 +20,7 @@
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<show-more-filter class="filter_list">
<div class="filter_item">
<span class="filter_title">推荐位名称:</span>
<el-input
......@@ -48,7 +48,7 @@
>
</el-date-picker>
</div>
</div>
</show-more-filter>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
......@@ -66,10 +66,12 @@
<script>
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import showMoreFilter from "@/components/show-more-filter";
export default {
components: {
apassList,
showMoreFilter,
},
data: () => ({
listHeader: [],
......
......@@ -985,7 +985,7 @@ export default {
pic: require("@/assets/imgs/home_tool_ic_lcsj.png"),
bg: "#e6ebfe",
color: "#515fe7",
url: "https://apaas.wodcloud.com/lcgl/index.html#/",
url: "https://apaas-nologo.wodcloud.com/lcgl/index.html#/",
target: 1
},
{
......
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