Commit 8d7f22e4 authored by caimeng's avatar caimeng

修改公告

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