From ea36d858ab12f45f32da8210d7c03c0f9a53b1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Tue, 18 Mar 2025 18:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bst/model.js | 44 ++ src/api/bst/suit.js | 44 ++ src/assets/icons/svg/car.svg | 1 + .../Business/Area/AreaRemoteSelect.vue | 141 ++++++ src/main.js | 3 + src/store/getters.js | 1 + src/store/modules/user.js | 5 + src/utils/enums.js | 25 +- src/utils/index.js | 12 + src/views/bst/area/edit/edit.vue | 69 ++- src/views/bst/area/index.vue | 11 +- src/views/bst/areaSub/index.vue | 26 +- src/views/bst/model/index.vue | 403 ++++++++++++++++++ .../bst/suit/components/SuitEditDialog.vue | 384 +++++++++++++++++ src/views/bst/suit/index.vue | 296 +++++++++++++ 15 files changed, 1412 insertions(+), 53 deletions(-) create mode 100644 src/api/bst/model.js create mode 100644 src/api/bst/suit.js create mode 100644 src/assets/icons/svg/car.svg create mode 100644 src/components/Business/Area/AreaRemoteSelect.vue create mode 100644 src/views/bst/model/index.vue create mode 100644 src/views/bst/suit/components/SuitEditDialog.vue create mode 100644 src/views/bst/suit/index.vue diff --git a/src/api/bst/model.js b/src/api/bst/model.js new file mode 100644 index 0000000..e80ea35 --- /dev/null +++ b/src/api/bst/model.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询车辆型号列表 +export function listModel(query) { + return request({ + url: '/bst/model/list', + method: 'get', + params: query + }) +} + +// 查询车辆型号详细 +export function getModel(id) { + return request({ + url: '/bst/model/' + id, + method: 'get' + }) +} + +// 新增车辆型号 +export function addModel(data) { + return request({ + url: '/bst/model', + method: 'post', + data: data + }) +} + +// 修改车辆型号 +export function updateModel(data) { + return request({ + url: '/bst/model', + method: 'put', + data: data + }) +} + +// 删除车辆型号 +export function delModel(id) { + return request({ + url: '/bst/model/' + id, + method: 'delete' + }) +} diff --git a/src/api/bst/suit.js b/src/api/bst/suit.js new file mode 100644 index 0000000..2303b02 --- /dev/null +++ b/src/api/bst/suit.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询套餐列表 +export function listSuit(query) { + return request({ + url: '/bst/suit/list', + method: 'get', + params: query + }) +} + +// 查询套餐详细 +export function getSuit(id) { + return request({ + url: '/bst/suit/' + id, + method: 'get' + }) +} + +// 新增套餐 +export function addSuit(data) { + return request({ + url: '/bst/suit', + method: 'post', + data: data + }) +} + +// 修改套餐 +export function updateSuit(data) { + return request({ + url: '/bst/suit', + method: 'put', + data: data + }) +} + +// 删除套餐 +export function delSuit(id) { + return request({ + url: '/bst/suit/' + id, + method: 'delete' + }) +} diff --git a/src/assets/icons/svg/car.svg b/src/assets/icons/svg/car.svg new file mode 100644 index 0000000..702b697 --- /dev/null +++ b/src/assets/icons/svg/car.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Business/Area/AreaRemoteSelect.vue b/src/components/Business/Area/AreaRemoteSelect.vue new file mode 100644 index 0000000..4dc4b5e --- /dev/null +++ b/src/components/Business/Area/AreaRemoteSelect.vue @@ -0,0 +1,141 @@ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index b962284..7b61d10 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,7 @@ import store from './store'; import { getConfigKey } from '@/api/system/config'; import { getDicts } from '@/api/system/dict/data'; +import { checkPermi, checkRole } from '@/utils/permission'; import { addDateRange, handleTree, parseTime, resetForm, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'; import './assets/icons'; // icon import './permission'; // permission control @@ -55,6 +56,8 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree +Vue.prototype.checkPermi = checkPermi +Vue.prototype.checkRole = checkRole // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/src/store/getters.js b/src/store/getters.js index 8340672..74490a9 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -13,6 +13,7 @@ const getters = { introduction: state => state.user.introduction, roles: state => state.user.roles, permissions: state => state.user.permissions, + userType: state => state.user.userType, deptId: state => state.user.deptId, permission_routes: state => state.permission.routes, topbarRouters:state => state.permission.topbarRouters, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index ba15fa5..972d1bd 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -14,6 +14,7 @@ const user = { roles: [], permissions: [], deptId: null, + userType: null, }, mutations: { @@ -62,6 +63,9 @@ const user = { // zIndex: 9999, // opacity: 0.1, // }) + }, + SET_USER_TYPE: (state, userType) => { + state.userType = userType; } }, @@ -100,6 +104,7 @@ const user = { commit('SET_NICK_NAME', user.nickName) commit('SET_AVATAR', avatar) commit('SET_DEPT_ID', user.deptId) + commit('SET_USER_TYPE', user.userType) resolve(res) }).catch(error => { reject(error) diff --git a/src/utils/enums.js b/src/utils/enums.js index 2cb5218..c813481 100644 --- a/src/utils/enums.js +++ b/src/utils/enums.js @@ -2,14 +2,18 @@ export const UserType = { ADMIN: '1', // 系统用户 USER: '2', // 普通用户 + + // 判断是否是管理员 + isAdminType(userType) { + return userType === UserType.ADMIN; + } } // 角色 export const RoleKeys = { ADMIN: "admin", // 超级管理员 AGENT: "agent", // 代理商 - BIZ: "biz", // 运营商 - USER: "user", // 普通用户 + MCH: "mch", // 运营商 } // 应用类型 @@ -53,4 +57,21 @@ export const AreaSubType = { NO_RIDE: "3", // 禁行区 } +// 套餐状态 +export const SuitStatus = { + NORMAL: "0", // 正常 + DISABLED: "1", // 禁用 +} +// 套餐租赁单位 +export const SuitRentalUnit = { + MINUTE: "minutes", // 分钟 + HOUR: "hours", // 小时 + DAY: "day", // 天 +} + +// 计费方式 +export const SuitRidingRule = { + START: "1", // 起步价 + INTERVAL: "2", // 区间计费 +} \ No newline at end of file diff --git a/src/utils/index.js b/src/utils/index.js index 3eb0eed..a17ad90 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -612,4 +612,16 @@ export function getOriginName(name) { } else { return name; } +} + +// 获取字典的label +export function dictLabel(dict, value) { + if (!dict) { + return ''; + } + const dictItem = dict.find(item => item.value === value); + if (!dictItem) { + return ''; + } + return dictItem.label; } \ No newline at end of file diff --git a/src/views/bst/area/edit/edit.vue b/src/views/bst/area/edit/edit.vue index d663699..53dff32 100644 --- a/src/views/bst/area/edit/edit.vue +++ b/src/views/bst/area/edit/edit.vue @@ -1,15 +1,15 @@