Commit 772afae3 authored by 张俊's avatar 张俊

Merge branch 'dev' of https://cloud.wodcloud.com/git/apaas/apaas-v3-ui into dev

parents 4dc3e3b6 99253cfb
clone:
git:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-git-arm64:1.0
pipeline:
read-cache:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache-arm64:1.0
restore: true
check: yarn.lock
mount:
- ./node_modules
- ./yarn.lock
volumes:
- /data/cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-node-arm64:12.18.2-buster
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn
commands:
- yarn install
- yarn run build
store-cache:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache-arm64:1.0
rebuild: true
mount:
- ./node_modules
- ./yarn.lock
volumes:
- /data/cache:/cache
docker-dev:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-arm64:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod-k8s/node-arm64:14.5.0-buster-slim
repo: wod/apaas/apaas-v3-ui-arm64
version: "v3.0.0"
channel: alpha
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch: dev
docker-master:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-arm64:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod-k8s/node-arm64:14.5.0-buster-slim
repo: wod/apaas/apaas-v3-ui-arm64
version: "v3.0.0"
registry: registry.cn-qingdao.aliyuncs.com
secrets:
- source: REGISTRY_USER_ALIYUN
target: REGISTRY_USER
- source: REGISTRY_PASSWORD_ALIYUN
target: REGISTRY_PASSWORD
when:
branch: master
branches: [master,dev]
......@@ -15,7 +15,7 @@ pipeline:
volumes:
- /data/cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/node:8.15.0-onbuild
image: registry.cn-qingdao.aliyuncs.com/wod/devops-node:12.18.0-stretch
dns: 223.5.5.5
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn
......
FROM {{ BASEIMAGE }}
MAINTAINER {{ AUTHOR }}
LABEL Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
ADD ./dist /www
ADD ./build/conf.yaml /www/conf.yaml
\ No newline at end of file
......@@ -511,7 +511,7 @@ width: 620px!important;
/* common */
.apass_breadcrumb > .el-breadcrumb {
margin: 15px 0;
padding: 15px 0;
}
.apass_breadcrumb > .el-breadcrumb .el-breadcrumb__inner {
font-size: 14px;
......@@ -638,4 +638,59 @@ width: 620px!important;
/* background: #f4f4f4; */
box-shadow: 8px 0 0 #f4f4f4 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
\ No newline at end of file
}
/* 详情页公共样式 by xuyiming */
.apaas_detail_container {
padding: 0 20px;
}
.apaas_detail_container .main_contaner {
min-height: calc(100vh - 84px - 83px);
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
padding: 30px;
background-color: #fff;
border-radius: 10px;
margin-bottom: 30px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.apaas_detail_container .detail_action {
text-align: right;
margin-top: 50px;
}
.apaas_detail_container .detail_action .el-button + .el-button {
margin-left: 30px;
}
.apaas_detail_container .detail_form {
max-width: 970px;
}
.apaas_detail_container .detail_form .el-input__inner,
.apaas_detail_container .detail_form .el-textarea__inner {
width: 100%;
background-color: #f7f8f9;
}
.apaas_detail_container .detail_form .el-select {
width: 100%;
}
.apaas_detail_container .detail_form.el-form--label-top .el-form-item__label {
padding: 0 0 15px;
font-size: 14px;
line-height: 1;
color: #58617a;
}
.apaas_detail_container .detail_form .el-form-item {
margin-bottom: 30px;
}
.apaas_detail_container .detail_form .textarea_count {
font-size: 14px;
line-height: 1;
color: #a9aec0;
text-align: right;
margin-top: 10px;
}
/* 详情页公共样式 by xuyiming ~~~end */
\ No newline at end of file
src/assets/imgs/ic_guoqi.png

1.37 KB | W: | H:

src/assets/imgs/ic_guoqi.png

1.37 KB | W: | H:

src/assets/imgs/ic_guoqi.png
src/assets/imgs/ic_guoqi.png
src/assets/imgs/ic_guoqi.png
src/assets/imgs/ic_guoqi.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -286,7 +286,7 @@ export default {
.top_fliter {
display: flex;
}
.top_fliter > .filter_list {
.top_fliter .filter_list {
flex-grow: 1;
}
.filter_list > .filter_item {
......@@ -294,10 +294,14 @@ export default {
vertical-align: middle;
margin-top: 15px;
}
.filter_list > .filter_item + .filter_item {
margin-left: 25px;
.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;
......@@ -307,7 +311,7 @@ export default {
.filter_list > .filter_item > .filter_title + * {
width: 300px;
}
.top_fliter > .filter_action {
.top_fliter .filter_action {
flex-shrink: 0;
margin-left: 25px;
text-align: right;
......
<template>
<div class="apass_table">
<el-table :data="data" @sort-change="sortChange">
<el-table-column v-if="paddingLeft > 10" :width="paddingLeft - 10"></el-table-column>
<el-table-column
v-if="paddingLeft > 10"
:width="paddingLeft - 10"
></el-table-column>
<el-table-column
v-for="(item, index) in header"
:label="item.label"
......@@ -123,7 +126,9 @@
<div v-else-if="item.type === 'image-tooltip'" class="img_content">
<el-tooltip
effect="dark"
:content="item.getTooltip ? item.getTooltip(scope.row) : item.tooltip"
:content="
item.getTooltip ? item.getTooltip(scope.row) : item.tooltip
"
placement="top"
>
<img
......
......@@ -255,7 +255,7 @@
v-for="(item, index) in workSpaceOptions"
:key="index"
:label="item.namespace"
:value="id"
:value="index"
></el-option>
</el-select>
</div>
......@@ -338,7 +338,7 @@
:stripe="true"
:datas="dataDiskList"
@primary-del="delItem"
height="260"
max-height="260"
></table-um>
</el-form-item>
</el-col>
......@@ -823,6 +823,7 @@ export default {
{ value: 2, label: "" }
],
workSpace: "",
workSpaceId: "",
workSpaceOptions: [],
optionsCPU: [
{ value: "8", label: "8" },
......@@ -950,9 +951,11 @@ export default {
},
handleChange() {},
getForm(val) {
console.log(val)
if (val !== "") {
let paramsOld = this.workSpaceOptions[val];
this.paramsOld = paramsOld;
this.workSpaceId = paramsOld.Id;
this.formOld.namespace = paramsOld.namespace;
this.formOld.workplace = paramsOld.workplace;
this.formOld.workplacedesc = paramsOld.workplacedesc;
......@@ -1046,7 +1049,7 @@ export default {
});
} else {
let query = {
resource_id: this.workSpace,
resource_id: this.workSpaceId,
resource_apply: {
apply_file: this.formOld.apply_file,
cpu: Number(this.formOld.cpu),
......
......@@ -106,6 +106,61 @@ export default {
},
tempFilter: null,
}),
created() {
this.listHeader = [
{
label: "",
prop: "state",
type: "image-tooltip",
getImage(item) {
return item.state == 1
? require("@/assets/imgs/ic_true.png")
: require("@/assets/imgs/ic_failed.png");
},
getTooltip(item) {
return item.state == 1 ? "推送成功" : "推送失败";
},
align: "center",
width: 60,
},
{
label: "推送流水号",
prop: "push_num",
width: 240,
},
{
label: "消息模板名称",
prop: "name",
type: "button",
callback: this.detailAction,
width: 300,
},
{
label: "消息详情",
prop: "detail",
},
{
label: "接收用户",
prop: "users",
getText(item) {
let users = item.users || [];
return users.join("");
},
width: 300,
},
{
label: "推送时间",
prop: "push_time",
getText(item) {
let date = item.push_time || "";
return helper.dateStringTransform(date);
},
align: "center",
width: 180,
},
];
},
methods: {
initList(filter) {
let fullFilter = {
......@@ -234,7 +289,7 @@ export default {
.catch((error) => {
console.log(error);
}); */
},
}, // TODO: 列表待调试
topFilterAction() {
this.initList(this.tempFilter);
},
......@@ -257,61 +312,6 @@ export default {
console.log(`查看${item.name}`);
},
},
created() {
this.listHeader = [
{
label: "",
prop: "state",
type: "image-tooltip",
getImage(item) {
return item.state == 1
? require("@/assets/imgs/ic_true.png")
: require("@/assets/imgs/ic_failed.png");
},
getTooltip(item) {
return item.state == 1 ? "推送成功" : "推送失败";
},
align: "center",
width: 60,
},
{
label: "推送流水号",
prop: "push_num",
width: 240,
},
{
label: "消息模板名称",
prop: "name",
type: "button",
callback: this.detailAction,
width: 300,
},
{
label: "消息详情",
prop: "detail",
},
{
label: "接收用户",
prop: "users",
getText(item) {
let users = item.users || [];
return users.join("");
},
width: 300,
},
{
label: "推送时间",
prop: "push_time",
getText(item) {
let date = item.push_time || "";
return helper.dateStringTransform(date);
},
align: "center",
width: 180,
},
];
},
};
</script>
......
<template>
<div>
<el-breadcrumb separator="/" class="bread_crumb1 bread_left">
<el-breadcrumb-item :to="{ path: '/message' }">{{ $t("lang.message") }}</el-breadcrumb-item>
<el-breadcrumb-item>{{ $t("lang.message_alert") }}</el-breadcrumb-item>
</el-breadcrumb>
<div class="list_container">
<apass-list
ref="list"
:list-header="listHeader"
:list-data="listData"
:list-total="listTotal"
:hide-search="true"
:list-padding-left="0"
@list-action="initList"
>
<el-breadcrumb separator="/" slot="breadcrumb">
<el-breadcrumb-item :to="{ path: '/message' }">
{{ $t("lang.message") }}
</el-breadcrumb-item>
<el-breadcrumb-item>
{{ $t("lang.message_alert") }}
</el-breadcrumb-item>
</el-breadcrumb>
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板名称:</span>
<el-input
v-model="topFilter.name"
placeholder="请输入消息模板名称"
></el-input>
</div>
<div class="filter_item">
<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-select>
</div>
<div class="filter_item">
<span class="filter_title">推送时间:</span>
<el-date-picker
v-model="topFilter.push_time"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
</div>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
</el-button>
<el-button type="defalut" @click="topFilterClear">
重置
</el-button>
</div>
</div>
</template>
<el-button type="primary" @click="addNew" slot="header-left">
新建
</el-button>
</apass-list>
<apass-dialog
ref="dialog"
:msg="dialogInfo.msg"
:submit="dialogInfo.submit"
></apass-dialog>
</div>
</template>
<script>
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
export default {
components: {},
data: () => ({}),
mounted() {},
methods: {}
components: {
apassList,
apassDialog,
},
data: () => ({
listHeader: [],
listData: [],
listTotal: 0,
dialogInfo: {
msg: "",
submit: null,
},
topFilter: {
name: "",
state: "",
push_time: "",
},
tempFilter: null,
}),
created() {
this.listHeader = [
{
label: "",
prop: "state",
type: "image-tooltip",
getImage(item) {
return item.state == 1
? require("@/assets/imgs/ic_true.png")
: require("@/assets/imgs/ic_failed.png");
},
getTooltip(item) {
return item.state == 1 ? "推送成功" : "推送失败";
},
align: "center",
width: 60,
},
{
label: "推送流水号",
prop: "push_num",
width: 240,
},
{
label: "消息模板名称",
prop: "name",
type: "button",
callback: this.detailAction,
width: 300,
},
{
label: "消息详情",
prop: "detail",
},
{
label: "接收用户",
prop: "users",
getText(item) {
let users = item.users || [];
return users.join("");
},
width: 300,
},
{
label: "推送时间",
prop: "push_time",
getText(item) {
let date = item.push_time || "";
return helper.dateStringTransform(date);
},
align: "center",
width: 180,
},
];
},
methods: {
initList(filter) {
let fullFilter = {
...filter,
...this.topFilter,
};
this.tempFilter = filter; // filter存档,用于页面刷新
console.log(fullFilter);
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.$http
.get("/apaas/service/v3/resource/apply/approveList", {
params: {
search: filter.keyword,
page: filter.page,
limit: filter.size,
state: filter.state,
},
})
.then(({ data }) => {
if (data.success == 1) {
this.listTotal = data.total;
this.listData = data.data;
} else {
this.$message({
message: data.errMsg || "获取列表失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
}); */
}, // TODO: 列表待调试
topFilterAction() {
this.initList(this.tempFilter);
},
topFilterClear() {
this.topFilter = {
name: "",
state: "",
push_time: "",
};
this.initList(this.tempFilter);
},
showDialog() {
this.$refs.dialog.show();
},
addNew() {
console.log("新建模板");
},
detailAction(item) {
console.log(`查看${item.name}`);
},
},
};
</script>
<style scoped>
</style>
\ No newline at end of file
.list_container {
height: 100%;
}
</style>
<template>
<div class="apaas_detail_container">
<div class="apass_breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/message' }">
{{ $t("lang.message") }}
</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/message/message_template' }">
{{ $t("lang.message_template") }}
</el-breadcrumb-item>
<el-breadcrumb-item>
{{ pageName }}
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="main_contaner">
<el-form
ref="detail_form"
class="detail_form"
label-position="top"
:model="detail"
:rules="detail_rules"
>
<el-form-item label="消息模板名称:" prop="name">
<el-input
v-model="detail.name"
placeholder="请输入消息模板名称"
:disabled="disabled"
></el-input>
</el-form-item>
<el-form-item label="模板类型:" prop="tpl_type">
<el-select
v-model="detail.tpl_type"
placeholder="请选择模板类型"
:disabled="disabled"
>
<el-option
v-for="item in types"
:label="item.name"
:value="item.value"
:key="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="消息详情:" prop="content">
<el-input
v-model="detail.content"
type="textarea"
placeholder="请输入消息详情,最多可以输入500字。"
maxlength="500"
:disabled="disabled"
></el-input>
<p
class="textarea_count"
v-text="`还可以输入${500 - detail.content.length}字`"
v-if="!disabled"
></p>
</el-form-item>
</el-form>
<div class="apass_button detail_action">
<el-button
type="default"
@click="cancelAction"
:loading="submitLoading"
>
取消
</el-button>
<el-button
type="primary"
@click="primaryAction"
:loading="submitLoading"
>
确定
</el-button>
</div>
</div>
</div>
</template>
<script>
import helper from "@/services/helper.js";
export default {
data: () => ({
pageType: 0, // 0:新增,1:编辑,2:详情
detail: {
name: "",
tpl_type: "",
content: "",
},
detail_rules: {
name: [
{
required: true,
message: "请输入消息模板名称",
trigger: "blur",
},
{
max: 16,
message: "长度小于16个字符",
trigger: "blur",
},
],
tpl_type: [
{
required: true,
message: "请选择模板类型",
trigger: "blur",
},
],
content: [
{
required: true,
message: "请输入消息详情,最多可以输入500字。",
trigger: "blur",
},
],
},
types: [
{
name: "服务推送",
value: 1,
},
{
name: "平台维护",
value: 2,
},
{
name: "版本更新",
value: 3,
},
{
name: "自动消息",
value: 4,
},
],
submitLoading: false,
}),
computed: {
pageName() {
return ["新增", "编辑", "详情"][this.pageType];
},
disabled() {
return this.pageType === 2;
},
},
created() {
if (this.$route.name === "message_template_edit") {
this.pageType = 1;
} else if (this.$route.name === "message_template_detail") {
this.pageType = 2;
}
if (this.pageType !== 0) {
this.getDetail();
}
},
methods: {
getDetail() {
this.$http
.get("/apaas/service/v3/msg/manage/tpl/info", {
params: {
id: this.$route.params.id,
},
})
.then(({ data }) => {
if (data.success == 1) {
let detail = data.data;
this.detail.name = detail.name;
this.detail.tpl_type = detail.tpl_type;
this.detail.content = detail.content;
} else {
this.$message({
message: data.errMsg || "获取详情失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "获取详情失败",
type: "warning",
});
});
},
addTemplate() {
this.$http
.post("/apaas/service/v3/msg/manage/tpl/add", this.detail)
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: "新增消息模板成功",
type: "success",
});
setTimeout(() => {
this.$router.push("/message/message_template");
}, 500);
} else {
this.$message({
message: data.errMsg || "新增消息模板失败",
type: "warning",
});
}
this.submitLoading = true;
})
.catch((error) => {
console.log(error);
this.$message({
message: "新增消息模板失败",
type: "warning",
});
this.submitLoading = true;
});
},
editTemplate() {
this.$http
.post("/apaas/service/v3/msg/manage/tpl/update", {
id: this.$route.params.id,
...this.detail,
})
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: "编辑消息模板成功",
type: "success",
});
setTimeout(() => {
this.$router.push("/message/message_template");
}, 200);
} else {
this.$message({
message: data.errMsg || "编辑消息模板失败",
type: "warning",
});
}
this.submitLoading = true;
})
.catch((error) => {
console.log(error);
this.$message({
message: "编辑消息模板失败",
type: "warning",
});
this.submitLoading = true;
});
},
cancelAction() {
this.$router.push("/message/message_template");
},
primaryAction() {
if (this.pageType === 2) {
this.$router.push("/message/message_template");
} else {
this.$refs.detail_form.validate((valid) => {
if (valid) {
this.submitLoading = true;
this.pageType === 1 ? this.editTemplate() : this.addTemplate();
} else {
return false;
}
});
}
},
},
};
</script>
<template>
<div>
<el-breadcrumb separator="/" class="bread_crumb1 bread_left">
<el-breadcrumb-item :to="{ path: '/message' }">{{ $t("lang.message") }}</el-breadcrumb-item>
<el-breadcrumb-item>{{ $t("lang.message_template") }}</el-breadcrumb-item>
</el-breadcrumb>
<div class="list_container">
<apass-list
ref="list"
:list-header="listHeader"
:list-data="listData"
:list-total="listTotal"
:hide-search="true"
:list-padding-left="0"
@list-action="initList"
>
<el-breadcrumb separator="/" slot="breadcrumb">
<el-breadcrumb-item :to="{ path: '/message' }">
{{ $t("lang.message") }}
</el-breadcrumb-item>
<el-breadcrumb-item>
{{ $t("lang.message_template") }}
</el-breadcrumb-item>
</el-breadcrumb>
<template slot="top">
<div class="top_fliter">
<div class="filter_list">
<div class="filter_item">
<span class="filter_title">消息模板搜索:</span>
<el-input
v-model="topFilter.name"
placeholder="请输入消息模板名称/id"
></el-input>
</div>
<div class="filter_item">
<span class="filter_title">模板类型:</span>
<el-select v-model="topFilter.type" placeholder="请选择">
<el-option label="服务推送" value="0"> </el-option>
<el-option label="平台维护" value="1"> </el-option>
<el-option label="版本更新" value="2"> </el-option>
<el-option label="自动消息" value="3"> </el-option>
</el-select>
</div>
<div class="filter_item">
<span class="filter_title">最后更新时间:</span>
<el-date-picker
v-model="topFilter.update_time"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
</div>
<div class="filter_action apass_button">
<el-button type="primary" @click="topFilterAction">
查询
</el-button>
<el-button type="defalut" @click="topFilterClear">
重置
</el-button>
</div>
</div>
</template>
<el-button type="primary" @click="addNew" slot="header-left">
新建
</el-button>
</apass-list>
<apass-dialog
ref="dialog"
:msg="dialogInfo.msg"
:submit="dialogInfo.submit"
></apass-dialog>
</div>
</template>
<script>
import helper from "@/services/helper.js";
import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
export default {
components: {},
data: () => ({}),
mounted() {},
methods: {}
components: {
apassList,
apassDialog,
},
data: () => ({
listHeader: [],
listData: [],
listTotal: 0,
dialogInfo: {
msg: "",
submit: null,
},
topFilter: {
name: "",
type: "",
update_time: "",
},
tempFilter: null,
types: [
{
name: "全部",
value: "",
},
{
name: "服务推送",
value: 1,
},
{
name: "平台维护",
value: 2,
},
{
name: "版本更新",
value: 3,
},
{
name: "自动消息",
value: 4,
},
],
}),
created() {
let _self = this;
_self.listHeader = [
{
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,
},
{
label: "操作",
type: "buttons",
align: "center",
width: 160,
actionList: [
{
label: "编辑",
callback: this.editAction,
},
{
label: "删除",
class: "warn",
callback: this.deleteAction,
},
],
},
];
},
methods: {
initList(filter) {
let params = {
page: filter.page,
size: filter.size,
keyword: this.topFilter.name,
tpl_type: this.topFilter.type,
update_time_s:
(this.topFilter.update_time && this.topFilter.update_time[0]) || "",
update_time_e:
(this.topFilter.update_time && this.topFilter.update_time[1]) || "",
};
// console.log(params);
this.tempFilter = filter; // filter存档,用于页面刷新
this.$http
.get("/apaas/service/v3/msg/manage/tpl/list", { params })
.then(({ data }) => {
if (data.success == 1) {
this.listTotal = (data.data && data.data.total) || 0;
this.listData = (data.data && data.data.list) || [];
} else {
this.$message({
message: data.errMsg || "获取列表失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "获取列表失败",
type: "warning",
});
});
},
topFilterAction() {
this.initList(this.tempFilter);
},
topFilterClear() {
this.topFilter = {
name: "",
type: "",
update_time: "",
};
this.initList(this.tempFilter);
},
showDialog() {
this.$refs.dialog.show();
},
addNew() {
this.$router.push("/message/message_template/add");
},
detailAction(item) {
this.$router.push(`/message/message_template/detail/${item.id}`);
},
editAction(item) {
this.$router.push(`/message/message_template/edit/${item.id}`);
},
deleteAction(item) {
this.dialogInfo.msg = `
您确认删除这条数据吗?</br>
<span style='color: #e15260;'>删除后无法撤销</span>,您还要继续吗?
`;
this.dialogInfo.submit = () => {
this.$http
.post(`/apaas/service/v3/msg/manage/tpl/delete/${item.id}`)
.then(({ data }) => {
if (data.success == 1) {
this.$message({
message: data.errMsg || `删除${item.name}成功`,
type: "success",
});
this.initList(this.tempFilter);
} else {
this.$message({
message: data.errMsg || `删除${item.name}失败`,
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: `删除${item.name}失败`,
type: "warning",
});
});
};
this.$refs.dialog.show();
},
},
};
</script>
<style scoped>
</style>
\ No newline at end of file
.list_container {
height: 100%;
}
</style>
......@@ -34,7 +34,7 @@ export default {
path: `/message/message_alert`
},
{
name: "benner管理",
name: "banner管理",
path: `/message/banner`
},
{
......
......@@ -32,8 +32,8 @@
<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="1"> </el-option>
<el-option label="异常" value="2"> </el-option>
</el-select>
</div>
<div class="filter_item">
......@@ -82,109 +82,6 @@ export default {
},
tempFilter: null,
}),
methods: {
initList(filter) {
let fullFilter = {
...filter,
...this.topFilter,
};
this.tempFilter = filter; // filter存档,用于页面刷新
console.log(fullFilter);
this.listTotal = 5;
this.listData = [
{
state: 1,
name: "热门数据",
service_count: 5,
detail:
"水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况",
person: "罗治翔",
updata_time: "2020-07-18T14:25:09+08:00",
},
{
state: 1,
name: "热门数据",
service_count: 5,
detail:
"水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况",
person: "罗治翔",
updata_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
name: "热门数据",
service_count: 5,
detail:
"水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况",
person: "罗治翔",
updata_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
name: "热门数据",
service_count: 5,
detail:
"水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况",
person: "罗治翔",
updata_time: "2020-07-18T14:25:09+08:00",
},
{
state: 0,
name: "热门数据",
service_count: 5,
detail:
"水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况,水路货物周转量情况",
person: "罗治翔",
updata_time: "2020-07-18T14:25:09+08:00",
},
];
/* this.$http
.get("/apaas/service/v3/resource/apply/approveList", {
params: {
search: filter.keyword,
page: filter.page,
limit: filter.size,
state: filter.state,
},
})
.then(({ data }) => {
if (data.success == 1) {
this.listTotal = data.total;
this.listData = data.data;
} else {
this.$message({
message: data.errMsg || "获取列表失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
}); */
},
topFilterAction() {
this.initList(this.tempFilter);
},
topFilterClear() {
this.topFilter = {
name: "",
state: "",
time: "",
};
this.initList(this.tempFilter);
},
detailAction(item) {
console.log(`查看${item.name}`);
},
editAction(item) {
console.log(`编辑${item.name}`);
},
},
created() {
this.listHeader = [
{
......@@ -197,14 +94,14 @@ export default {
: require("@/assets/imgs/ic_failed.png");
},
getTooltip(item) {
return item.state == 1 ? "推送成功" : "推送失败";
return item.state == 1 ? "状态正常" : "状态异常";
},
align: "center",
width: 60,
},
{
label: "推荐位名称",
prop: "name",
prop: "ad_name",
type: "button",
callback: this.detailAction,
align: "center",
......@@ -212,25 +109,30 @@ export default {
},
{
label: "服务个数",
prop: "service_count",
prop: "serv_count",
align: "center",
width: 160,
},
{
label: "服务详情",
prop: "detail",
prop: "service_names",
getText(item) {
let services = item.service_names || [];
return services.map((item) => item.name).join("");
},
},
{
label: "操作人",
prop: "person",
prop: "update_user",
align: "center",
width: 120,
},
{
label: "最后更新 时间",
prop: "updata_time",
prop: "update_time",
getText(item) {
let date = item.updata_time || "";
let date = item.update_time || "";
return helper.dateStringTransform(date);
},
align: "center",
......@@ -250,6 +152,64 @@ export default {
},
];
},
methods: {
initList(filter) {
let params = {
page: filter.page,
size: filter.size,
name: this.topFilter.name,
state: this.topFilter.state,
uptime_s:
(this.topFilter.update_time && this.topFilter.update_time[0]) || "",
uptime_e:
(this.topFilter.update_time && this.topFilter.update_time[1]) || "",
};
// console.log(params);
this.tempFilter = filter; // filter存档,用于页面刷新
this.$http
.get("/apaas/service/v3/recommend/manage/featured/list", { params })
.then(({ data }) => {
if (data.success == 1) {
this.listTotal = (data.data && data.data.total) || 0;
this.listData = (data.data && data.data.data) || [];
} else {
this.$message({
message: data.errMsg || "获取列表失败",
type: "warning",
});
}
})
.catch((error) => {
console.log(error);
this.$message({
message: "获取列表失败",
type: "warning",
});
});
},
topFilterAction() {
this.initList(this.tempFilter);
},
topFilterClear() {
this.topFilter = {
name: "",
state: "",
time: "",
};
this.initList(this.tempFilter);
},
detailAction(item) {
console.log(`查看${item.ad_name}`);
},
editAction(item) {
console.log(`编辑${item.ad_name}`);
},
},
};
</script>
......
......@@ -1036,7 +1036,7 @@ export default {
},
callback(item) {
if (item.state == 2) {
return soldUpItem(item);
return _self.soldUpItem(item);
} else if (item.state == 3) {
return _self.soldOutItem(item);
} else {
......
......@@ -35,7 +35,7 @@ const user = {
return axios.get(`/apaas/serviceapp/v3/order/approval?apply_id=${params.apply_id}&kind=${params.kind}`);
},
cancelOrder(params) {
return axios.get(`/order/cancel?order_id=${params.order_id}`);
return axios.delete(`/order/cancel?order_id=${params.order_id}`);
},
// user info
......
......@@ -404,6 +404,21 @@ export default new Router({
name: "message_template",
component: () => import("@/pages/message-management/message-template/message-template-list"),
},
{
path: "/message/message_template/add", // 新增消息模板
name: "message_template_add",
component: () => import("@/pages/message-management/message-template/message-template-detail"),
},
{
path: "/message/message_template/edit/:id", // 编辑消息模板
name: "message_template_edit",
component: () => import("@/pages/message-management/message-template/message-template-detail"),
},
{
path: "/message/message_template/detail/:id", // 查看消息模板详情
name: "message_template_detail",
component: () => import("@/pages/message-management/message-template/message-template-detail"),
},
],
}, // 消息与推送管理
],
......
This diff is collapsed.
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