diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 35679ec..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/api/index.js b/src/api/index.js index 2be92aa..581cf17 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -25,14 +25,7 @@ export function EditContent(params) { export function exportAdminAll(params) { return request.post('/admin/admin_all', params) } -// 用户权限修改 -export function PermissUpdate(params) { - return request.post('/UpdatePermission', params) -} -// 用户权限读取 -export function PermissRead(params) { - return request.post('/UpdatePermission', params) -} + /** * 订单 @@ -373,24 +366,74 @@ export function ShowAppointmentTime(params) { export function ModifyAppointmentTime(params) { return request.post('/ModifyAppointmentTime', params) } - -// 活动 +/** + * 活动发布 + */ +// 活动列表 export function getEventList(params) { - return request.post('/eventList2', params) + return request.get('/getEventList', { params }) +} +// 活动新增 +export function addEvent(params) { + return request.post('/addEvent', params) +} +// 活动详情 +export function getEvent(params) { + return request.get('/getEvent', { params }) +} +// 活动更新 +export function getEventUpdate(params) { + return request.post('/getEventUpdate', params) +} +// 活动删除 +export function getEventDelete(params) { + return request.post('/getEventDelete', params) +} +// 富文本上传 +export function upload(data) { + return request.post('/upload', data, { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }) } // 退款订单 export function getRefundOrder(params) { return request.get('/getRefundOrder', { params }) } -// 权限 +// 用户权限修改 +export function PermissUpdate(params) { + return request.post('/UpdatePermission', params) +} +// 用户权限读取 +export function PermissRead(params) { + return request.post('/UpdatePermission', params) +} +// 获取角色列表 export function getRoleList(params) { return request.get('/getRoleList', { params }) } +// 新增角色 +export function addRole(params) { + return request.post('/addRole', params) +} +// 修改角色 +export function getRoleUpdate(params) { + return request.post('/getRoleUpdate', params) +} +// 角色详情 +export function getRoleRead(params) { + return request.get('/getRoleRead', { params }) +} +// 删除角色 +export function getRoleDelete(params) { + return request.post('/getRoleDelete', params) +} // 权限 export function GetRole(params) { return request.get('/getRoleList', { params }) } -// 权限 +// 菜单 export function getMenuList(params) { return request.get('/getMenuList', { params }) } @@ -455,6 +498,52 @@ export function getUserMoneyLog(params) { export function orderTotal(params) { return request.get('/orderTotal', { params }) } +/** + * 优惠券 + */ +// 优惠券列表 +export function getCouponList(params) { + return request.get('/getCouponList', { params }) +} +// 新增优惠券 +export function addCoupon(params) { + return request.post('/addCoupon', params) +} +// 优惠券详情 +export function getCoupon(params) { + return request.get('/getCoupon', { params }) +} +// 更新优惠券 +export function getCouponUpdate(params) { + return request.post('/getCouponUpdate', params) +} +// 删除优惠券 +export function getCouponDelete(params) { + return request.post('/getCouponDelete', params) +} +/** + * 会员 + */ +// 会员列表 +export function getVipList(params) { + return request.get('/getVipList', { params }) +} +// 新增会员 +export function addVip(params) { + return request.post('/addVip', params) +} +// 会员详情 +export function getVip(params) { + return request.get('/getVip', { params }) +} +// 更新会员 +export function getVipUpdate(params) { + return request.post('/getVipUpdate', params) +} +// 删除会员 +export function getVipDelete(params) { + return request.post('/getVipDelete', params) +} /** * 用户 */ @@ -477,4 +566,8 @@ export function getAdminUpdate(params) { // 用户删除 export function getAdminDelete(params) { return request.post('/getAdminDelete', params) +} +// 充电桩分析 +export function getChargePile(params) { + return request.get('/getChargePile', params) } \ No newline at end of file diff --git a/src/components/RichEditor.vue b/src/components/RichEditor.vue new file mode 100644 index 0000000..251e265 --- /dev/null +++ b/src/components/RichEditor.vue @@ -0,0 +1,280 @@ + + + + diff --git a/src/permission.js b/src/permission.js index 5023f7a..9f6f6da 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,7 +3,7 @@ import router from './router' import store from './store' import createRoutes from '@/utils/createRoutes' import { getDocumentTitle, resetTokenAndClearUser } from './utils' - +// import { getMenuList } from './api' // 是否有菜单数据 let hasMenus = false router.beforeEach(async (to, from, next) => { @@ -16,10 +16,22 @@ router.beforeEach(async (to, from, next) => { next() } else { try { + let menuItems = store.state.menuItems + // let apiMenu = [] + // await getMenuList({ token: localStorage.getItem('token') }).then((res) => { + // res.forEach((i) => { + // apiMenu.push({ + // text: i.text, + // type: i.type, + // children: i.children, + // }) + // }) + // menuItems = apiMenu + // }) // 这里可以用 await 配合请求后台数据来生成路由 // const data = await axios.get('xxx') // const routes = createRoutes(data) - const routes = createRoutes(store.state.menuItems) + const routes = createRoutes(menuItems) // 动态添加路由 router.addRoutes(routes) hasMenus = true diff --git a/src/store/index.js b/src/store/index.js index 5f6d242..5de011a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -67,11 +67,11 @@ const store = new Vuex.Store({ // url: 'https://www.baidu.com', // isExternal: true, // 外链 跳到一个外部的 URL 页面 }, - { - size: 18, - text: '钱包账户', - type: 'ios-paper', - }, + // { + // size: 18, + // text: '钱包账户', + // type: 'ios-paper', + // }, { size: 18, text: '车辆管理', diff --git a/src/views/operations_center/activity.vue b/src/views/operations_center/activity.vue index bb6153d..a0df908 100644 --- a/src/views/operations_center/activity.vue +++ b/src/views/operations_center/activity.vue @@ -1,261 +1,413 @@ \ No newline at end of file diff --git a/src/views/operations_center/coupon.vue b/src/views/operations_center/coupon.vue index 923b23c..edb11a6 100644 --- a/src/views/operations_center/coupon.vue +++ b/src/views/operations_center/coupon.vue @@ -1,261 +1,608 @@ \ No newline at end of file + diff --git a/src/views/operations_center/user_vip.vue b/src/views/operations_center/user_vip.vue index 4620047..571fb8f 100644 --- a/src/views/operations_center/user_vip.vue +++ b/src/views/operations_center/user_vip.vue @@ -1,9 +1,451 @@ - \ No newline at end of file + diff --git a/src/views/order/charge_order.vue b/src/views/order/charge_order.vue index 517056d..784d2f4 100644 --- a/src/views/order/charge_order.vue +++ b/src/views/order/charge_order.vue @@ -1,17 +1,21 @@ \ No newline at end of file diff --git a/src/views/reports/caiwu_reports.vue.vue b/src/views/reports/caiwu_reports.vue.vue index 1348c4b..f4c8bee 100644 --- a/src/views/reports/caiwu_reports.vue.vue +++ b/src/views/reports/caiwu_reports.vue.vue @@ -2,17 +2,26 @@
- - + + - - + + - - + + + + + - + +
@@ -30,7 +39,9 @@ diff --git a/src/views/reports/rate.vue b/src/views/reports/rate.vue index a2b4703..8411741 100644 --- a/src/views/reports/rate.vue +++ b/src/views/reports/rate.vue @@ -1,9 +1,309 @@ - \ No newline at end of file diff --git a/src/views/reports/yunying_reports.vue b/src/views/reports/yunying_reports.vue index f52e53d..3a4785c 100644 --- a/src/views/reports/yunying_reports.vue +++ b/src/views/reports/yunying_reports.vue @@ -2,17 +2,40 @@
+
+ + + + 充电桩分类运营统计 + 充电桩单桩统计 + VIN充电统计 + 二维码充电统计 + 充电订单流水 + + + +
- + - - + + - + - + + +
@@ -30,7 +53,11 @@ diff --git a/src/views/system/admin.vue b/src/views/system/admin.vue index fb57d86..1c410b2 100644 --- a/src/views/system/admin.vue +++ b/src/views/system/admin.vue @@ -196,17 +196,10 @@ const pageHeight = 32 // 分页组件大约高度 const margins = 40 // 上下边距总和 this.tableHeight = window.innerHeight - searchHeight - pageHeight - margins - 230 - console.log(this.tableHeight) }, async fetchRoles() { - // 角色列表仅需偶尔变动,进入页面时加载一次即可 - try { - const res = await getRoleList() - const list = res.data || res - this.roleOptions = Array.isArray(list) ? list : [] - } catch (error) { - this.roleOptions = [] - } + const res = await getRoleList() + this.roleOptions = res.data.data }, async getList() { this.tableLoading = true diff --git a/src/views/system/auth.vue b/src/views/system/auth.vue index 924ed5a..be31635 100644 --- a/src/views/system/auth.vue +++ b/src/views/system/auth.vue @@ -17,11 +17,13 @@
- +
@@ -33,12 +35,12 @@ - +
@@ -53,6 +55,10 @@ import { GetRole, getMenuList, + addRole, + getRoleRead, + getRoleUpdate, + getRoleDelete, } from '@/api' export default { @@ -60,6 +66,8 @@ data() { return { show_modal: false, + page: 1, + pageSize: 10, total: 100, tableHeight: 500, formInline: { @@ -84,6 +92,7 @@ ], data: [], formValidate: { + id: '', name: '', pid: 0, roles: '', @@ -103,38 +112,13 @@ value: 'New York', label: 'New York', }], - menu_data: [{ - title: 'parent 1', - expand: false, - children: [{ - title: 'parent 1-1', - expand: true, - children: [{ - title: 'leaf 1-1-1', - id: 1, - }, - { - title: 'leaf 1-1-2', - }, - ], - }, - { - title: 'parent 1-2', - expand: true, - children: [{ - title: 'leaf 1-2-1', - }, - { - title: 'leaf 1-2-1', - }, - ], - }, - ], - }], + menu_data: [], + defaultCheckedKeys: [], } }, mounted() { this.getList() + this.getMenuList() this.calculateTableHeight() window.addEventListener('resize', this.calculateTableHeight) }, @@ -152,11 +136,11 @@ }, async getList() { await GetRole({ - page: 1, + page: this.page, + pageSize: this.pageSize, }).then((res) => { - this.total = res.total - this.data = res.data - this.page = res.current_page + this.total = res.data.total + this.data = res.data.data }) }, handleSubmit(name) { @@ -168,14 +152,36 @@ } }) }, - show(index) { - this.$Modal.info({ - title: 'User Info', - content: `Name:${this.data[index].name}
Age:${this.data[index].age}
Address:${this.data[index].address}`, + async show(id) { + await getRoleRead({ + id, + }).then((res) => { + this.show_modal = true + this.formValidate = { + ...res.data, + } + this.getMenuList() }) }, - remove(index) { - this.data.splice(index, 1) + async remove(id) { + const confirm = await new Promise(resolve => { + this.$Modal.confirm({ + title: '确认删除', + content: '您确定要删除此项吗?', + onOk: () => resolve(true), + onCancel: () => resolve(false), + }) + }) + if (!confirm) { + this.$Message.info('已取消删除') + return + } + await getRoleDelete({ + id, + }).then((res) => { + this.$Message.success(res.msg) + this.getList() + }) }, async ok() { let menuIds = this.$refs.tree.getCheckedAndIndeterminateNodes() @@ -185,22 +191,58 @@ this.$Message.error('请正确填写表单') return } - // if (this.formValidate.id) { } else { } - this.$Message.info('Clicked ok') + if (this.formValidate.id) { + await getRoleUpdate(this.formValidate).then((res) => { + this.$Message.success(res.msg) + this.getList() + this.cancel() + }) + } else { + await addRole(this.formValidate).then((res) => { + this.$Message.success(res.msg) + this.getList() + this.cancel() + }) + } }, cancel() { this.show_modal = false - this.$refs.formValidate.resetFields() + this.formValidate = { + id: '', + name: '', + pid: 0, + roles: '', + } }, async add() { this.show_modal = true - await this.getMenuList() + this.formValidate = { + id: '', + name: '', + pid: 0, + roles: '', + } }, async getMenuList() { - await getMenuList().then((res) => { + await getMenuList({ + roles: this.formValidate.roles, + }).then((res) => { this.menu_data = res }) }, + onChangePage(e) { + if (this.page != e) { + this.page = e + this.getList() + } + }, + onChangePageSize(e) { + if (this.pageSize != e) { + this.page = 1 + this.pageSize = e + this.getList() + } + }, }, }