Commit 8d7f22e4 authored by caimeng's avatar caimeng

修改公告

parent d085cad4
import request from '@/utils/request'
import request from "@/utils/request";
// 登录
export default {
// 登录
login(data) {
return request({
url: '/sysUser/login',
method: 'post',
data,
})
url: "/sysUser/login",
method: "post",
data
});
},
// 登出
logout(data) {
return request({
url: "/sysUser/logout",
method: "post",
data
});
},
// 用户信息
userInfo(params) {
return request({
url: "/sysUser/getInfo",
method: "get",
params
});
},
// 发送验证码
send_msg_code(data) {
return request({
url: '/sysUser/transmitCode',
method: 'post',
data,
})
url: "/sysUser/transmitCode",
method: "post",
data
});
},
// 获取菜单列表
menu(params) {
return request({
url: '/sysUser/getRouters',
method: 'get',
params,
})
url: "/sysUser/getRouters",
method: "get",
params
});
},
// 商户列表
merchant_list(data) {
return request({
url: '/macy/selectMacyList',
method: 'post',
data,
})
url: "/macy/selectMacyList",
method: "post",
data
});
},
// 商户新增
merchant_add(data) {
return request({
url: '/macy/createdMacy',
method: 'post',
data,
})
url: "/macy/createdMacy",
method: "post",
data
});
},
// 商户更新
merchant_update(data) {
return request({
url: '/macy/editMacy',
method: 'post',
data,
})
url: "/macy/editMacy",
method: "post",
data
});
},
// 商户详情
merchant_view(params) {
return request({
url: '/macy/selectMacyByTenantNo',
method: 'get',
params,
})
url: "/macy/selectMacyByTenantNo",
method: "get",
params
});
},
// 产品列表
merchant_select(params) {
return request({
url: '/macy/selectList',
method: 'get',
params,
})
url: "/macy/selectList",
method: "get",
params
});
},
// 产品列表
prod_list(data) {
return request({
url: '/macy/selectProductPageList',
method: 'post',
data,
})
url: "/macy/selectProductPageList",
method: "post",
data
});
},
// 产品新增
prod_add(data) {
return request({
url: '/macy/createdProductInfo',
method: 'post',
data,
})
url: "/macy/createdProductInfo",
method: "post",
data
});
},
// 产品编辑
prod_update(data) {
return request({
url: '/macy/editProductInfo',
method: 'post',
data,
})
url: "/macy/editProductInfo",
method: "post",
data
});
},
// 产品查看
prod_view(params) {
return request({
url: '/macy/selectProductInfoByappNo',
method: 'get',
params,
})
url: "/macy/selectProductInfoByappNo",
method: "get",
params
});
},
// 申请列表
apply_list(data) {
return request({
url: '/zeus/pageQueryApply',
method: 'post',
data,
})
url: "/zeus/pageQueryApply",
method: "post",
data
});
},
// 推送
apply_push(params) {
return request({
url: '/zeus/applyRetryPush',
method: 'get',
params,
})
url: "/zeus/applyRetryPush",
method: "get",
params
});
},
// 公告列表
notice_list(data) {
return request({
url: '/smgw/getBackPageList',
method: 'post',
data,
})
url: "/smgw/getBackPageList",
method: "post",
data
});
},
// 公告发送
notice_add(data) {
return request({
url: '/smgw/sendZnx',
method: 'post',
data,
})
url: "/smgw/sendZnx",
method: "post",
data
});
}, // 公告编辑
notice_edit(data) {
return request({
url: "/smgw/updateNotice",
method: "post",
data
});
},
// 回现APP设置
app_setting(params) {
return request({
url: '/manage/getList',
method: 'get',
params,
})
url: "/manage/getList",
method: "get",
params
});
},
// 变更状态
app_setting_update(data) {
return request({
url: '/manage/update',
method: 'post',
data,
})
},
}
url: "/manage/update",
method: "post",
data
});
}
};
......@@ -53,7 +53,9 @@ const actions = {
const result = await API.login(userInfo);
if (result.success) {
const user = result.result;
console.log('我知道');
commit("setUser", user);
commit("setUsername", user.nickName);
}
// 设置假的token
......@@ -78,12 +80,20 @@ const actions = {
* @returns
*/
async getUserInfo({ commit, dispatch, state }) {
let { username, avatar, roles, ability } = state.user;
//if (username && avatar) {
commit("setUsername", userName);
commit("setAvatar", '');
const result = await API.userInfo();
if(result.success){
const {avatar,nickName} = result.result;
commit("setUsername", nickName);
commit("setAvatar", avatar);
// 当不传递roles或ability时,默认使用管理员权限,可查看所有路由和按钮
dispatch("acl/setFull", true, { root: true });
}
//let { username, avatar, roles, ability } = state.user;
//if (username && avatar) {
// commit("setUsername", userName);
//commit("setAvatar", '');
// 当不传递roles或ability时,默认使用管理员权限,可查看所有路由和按钮
//dispatch("acl/setFull", true, { root: true });
// 当返回数据包含roles(角色)或ability(权限),保存至vuex
// 如不使用roles权限控制,请不要传递roles,可删除以下代码
//if (roles instanceof Array) dispatch("acl/setRole", roles, { root: true });
......@@ -97,7 +107,7 @@ const actions = {
* @param {*} { dispatch }
*/
async logout({ dispatch }) {
await logout(state.accessToken);
await API.logout();
await dispatch("resetAll");
},
/**
......
<template>
<el-dropdown @command="handleCommand">
<span class="avatar-dropdown">
<img :src="avatar" alt="" class="user-avatar" />
<!--<img :src="avatar" alt="" class="user-avatar" />-->
<div class="user-name">
{{ username }}
<vab-remix-icon icon-class="arrow-down-s-line"></vab-remix-icon>
<vab-remix-icon icon-class="arrow-down-s-line" />
</div>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="logout">
<vab-remix-icon icon-class="logout-circle-r-line"></vab-remix-icon>
<vab-remix-icon icon-class="logout-circle-r-line" />
{{ translateTitle('退出登录') }}
</el-dropdown-item>
</el-dropdown-menu>
......
......@@ -39,7 +39,7 @@ router.beforeEach(async (to, from, next) => {
next();
} else {
try {
if (!loginInterception) await store.dispatch("user/getUserInfo");
if (loginInterception) await store.dispatch("user/getUserInfo");
//settings.js loginInterception为false(关闭登录拦截时)时,创建虚拟角色
else await store.dispatch("user/setVirtualRoles");
//根据路由模式添加路由
......
......@@ -81,8 +81,14 @@
type="text"
@click="handleChangeStatus(row)"
>
<span v-if="row.prop===0">下架</span>
<span v-else>下架</span>
<span v-if="row.isDelete===0">下架</span>
<span v-else>上架</span>
</el-button>
<el-button
type="text"
@click="handleView(row)"
>
<span>详情</span>
</el-button>
</template>
</el-table-column>
......@@ -109,7 +115,7 @@ export default {
name: "Fence",
data() {
return {
checkList: ["标题","标题ICON", "公告内容", "H5链接", "公告状态","创建时间",],
checkList: ["标题", "标题ICON", "公告内容", "H5链接", "公告状态", "创建时间"],
columns: [
{
order: 1,
......@@ -130,7 +136,7 @@ export default {
order: 4,
label: "H5链接",
prop: "znxHref",
overflow:true
overflow: true
},
{
order: 5,
......@@ -176,8 +182,26 @@ export default {
onSubmit() {
this.fetchData();
},
handleChangeStatus(row) {
//const {appNo} = row;
handleView(row){
const {id} = row;
this.$router.push({
path: '/notice/new',
query: { id }
})
},
async handleChangeStatus(row) {
const { id, isDelete } = row;
console.log(row, "是");
const result = await API.notice_edit({
id,
isDelete: !isDelete ? 1 :0
});
if (result.success) {
this.$baseMessage("修改成功", "success");
setTimeout(() => {
this.fetchData();
}, 1500);
}
},
handleSizeChange(val) {
......@@ -228,10 +252,12 @@ export default {
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
.action-bar-left,.action-bar-right{
flex:1;
.action-bar-left, .action-bar-right {
flex: 1;
}
.action-bar-right{
.action-bar-right {
text-align: right;
}
}
......
......@@ -86,7 +86,8 @@
<script>
import BlockHeader from "@/components/blockHeader";
import API from "@/server/api";
const $API = process.env.VUE_APP_API_PATH;
const $API = process.env.VUE_APP_API_PATH;
export default {
name: "MerchantNew",
......@@ -95,22 +96,37 @@ export default {
},
data() {
return {
uploadUrl:`${$API}/sysUser/upload`,
uploadUrl: `${$API}/sysUser/upload`,
form: {
znxTitle: "mc公告标题",
znxTitleUrl: "",
znxContent: "名称公告内容",
znxHref: "www.baidu.com",
znxHref: "www.baidu.com"
},
rules: {
znxTitle: [{ required: true, message: "请输入公告标题", trigger: "blur" }],
znxTitleUrl: [{ required: false, message: "请上传公告标题ICON", trigger: "change" }],
znxContent: [{ required: true, message: "请输入公告内容", trigger: "blur" }],
znxHref: [{ required: true, message: "请输入公告跳转链接", trigger: "blur" }],
znxHref: [{ required: true, message: "请输入公告跳转链接", trigger: "blur" }]
}
};
},
async created() {
// 再请求表单
const { query } = this.$route;
if (query && query.id) {
this.id = query.id;
await this.init();
}
},
methods: {
async init() {
const id = this.id;
const { result, success } = await API.notice_edit({ id });
if (success) {
this.form = result;
}
},
handleSuccessLogo(res) {
this.form.znxTitleUrl = res.result;
},
......
......@@ -194,7 +194,7 @@ export default {
total: 0,
queryForm: {
current: 1,
size: 8,
size: 10,
status: "",
tenantName: "",
tenantNo: ""
......
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