Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2521765be | ||
|
|
5c1b66b03d | ||
|
|
29ea0d5fe4 | ||
|
|
8c1d2eeabe | ||
|
|
24dfaac98a | ||
|
|
b5acea2e47 | ||
|
|
39bc3011dd | ||
|
|
6e42dd43f7 | ||
|
|
1b10b9aa2b | ||
|
|
8964cbe4bd | ||
|
|
de971d224e | ||
|
|
5977480404 | ||
|
|
9123149565 | ||
|
|
f1e1def32c | ||
|
|
e787128011 | ||
|
|
90f6bd344e | ||
|
|
ffc5600b9b | ||
|
|
fbae33730d | ||
|
|
64c735eb74 | ||
|
|
ed0a5e1a7d | ||
|
|
7e0a065944 | ||
|
|
2282f1c834 | ||
|
|
e418b588f6 | ||
|
|
a5a2e099a2 | ||
|
|
19822a539c | ||
|
|
0fc918b576 | ||
|
|
4c17bf7f6a | ||
|
|
878940c34b |
72
.drone.yml
72
.drone.yml
@@ -5,6 +5,8 @@ platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
steps:
|
||||
|
||||
|
||||
- name: build-package
|
||||
image: node:16.20.0
|
||||
volumes:
|
||||
@@ -23,17 +25,16 @@ steps:
|
||||
- npm -v
|
||||
- mkdir -p ./node_modules
|
||||
- export NODE_MODULES_PATH=`pwd`/node_modules
|
||||
#- npm config set registry https://registry.npm.taobao.org
|
||||
# - npm config set registry https://registry.npmmirror.com
|
||||
#- set NODE_OPTIONS=--openssl-legacy-provider
|
||||
# - npm install
|
||||
# - npm install
|
||||
- npm run build
|
||||
- ls /app/build/$DRONE_REPO_NAME/
|
||||
- echo $NODE_MODULES_PATH
|
||||
- cp -r dist /app/build/$DRONE_REPO_NAME
|
||||
|
||||
|
||||
|
||||
- name: build-docker # 制作docker镜像
|
||||
- name: build-docker-prod # 制作docker镜像
|
||||
image: docker # 使用官方docker镜像
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: docker
|
||||
@@ -55,6 +56,9 @@ steps:
|
||||
- sed -i 's/$REGISTRY_NAMESPACE/'"$REGISTRY_NAMESPACE"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_REPO_NAME/'"$DRONE_REPO_NAME"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_COMMIT/'"$DRONE_COMMIT"'/' deployment.yml
|
||||
- sed -i 's/$PORTS_NAME/'"dasdafas"'/' deployment.yml
|
||||
- sed -i 's/$PORTS_PORT/'"8081"'/' deployment.yml
|
||||
- sed -i 's/$PROFILES/'"mosr"'/' nginx.conf
|
||||
# docker登录,不能在脚本中登录,并且不能使用docker login -u -p
|
||||
- echo $DOCKER_PASSWORD | docker login $REGISTRY --username $DOCKER_USERNAME --password-stdin
|
||||
- chmod +x docker.sh
|
||||
@@ -62,9 +66,47 @@ steps:
|
||||
- sh docker.sh
|
||||
# 执行完脚本删除本次制作的docker镜像,避免多次后当前runner空间不足
|
||||
- docker rmi -f $(docker images | grep $DRONE_REPO_NAME | awk '{print $3}')
|
||||
when:
|
||||
branch:
|
||||
- prod
|
||||
|
||||
- name: build-docker-dm # 制作docker镜像
|
||||
image: docker # 使用官方docker镜像
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: docker
|
||||
path: /var/run/docker.sock # 挂载宿主机的docker
|
||||
- name: config
|
||||
path: /config
|
||||
environment: # 获取到密文的docker用户名和密码
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
REGISTRY:
|
||||
from_secret: registry
|
||||
REGISTRY_NAMESPACE:
|
||||
from_secret: registry_namespace
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
- cat Dockerfile
|
||||
- sed -i 's/$REGISTRY/'"$REGISTRY"'/' deployment.yml
|
||||
- sed -i 's/$REGISTRY_NAMESPACE/'"$REGISTRY_NAMESPACE"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_REPO_NAME/'"$DRONE_REPO_NAME"'/' deployment.yml
|
||||
- sed -i 's/$DRONE_COMMIT/'"$DRONE_COMMIT"'/' deployment.yml
|
||||
- sed -i 's/$PORTS_NAME/'"dasdafas"'/' deployment.yml
|
||||
- sed -i 's/$PORTS_PORT/'"8082"'/' deployment.yml
|
||||
- sed -i 's/$PROFILES/'"mosr-dm"'/' nginx.conf
|
||||
# docker登录,不能在脚本中登录,并且不能使用docker login -u -p
|
||||
- echo $DOCKER_PASSWORD | docker login $REGISTRY --username $DOCKER_USERNAME --password-stdin
|
||||
- chmod +x docker.sh
|
||||
- cat docker.sh
|
||||
- sh docker.sh
|
||||
# 执行完脚本删除本次制作的docker镜像,避免多次后当前runner空间不足
|
||||
- docker rmi -f $(docker images | grep $DRONE_REPO_NAME | awk '{print $3}')
|
||||
when:
|
||||
branch:
|
||||
- dm
|
||||
|
||||
- name: drone-rancher # rancher运行
|
||||
- name: drone-rancher-prod # rancher运行
|
||||
image: bitnami/kubectl:1.26.13-debian-11-r1
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: config
|
||||
@@ -72,6 +114,24 @@ steps:
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
# 将deployment中定义的变量替换为drone中的内置变量
|
||||
- kubectl apply -f deployment.yml -n mosr --kubeconfig=/app/config/base-taishan-kubectl.yml
|
||||
when:
|
||||
branch:
|
||||
- prod
|
||||
|
||||
|
||||
- name: drone-rancher-dm # rancher运行
|
||||
image: bitnami/kubectl:1.26.13-debian-11-r1
|
||||
volumes: # 将容器内目录挂载到宿主机
|
||||
- name: config
|
||||
path: /app/config # 将kubectl 配置文件挂载出来
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
# 将deployment中定义的变量替换为drone中的内置变量
|
||||
- kubectl apply -f deployment.yml -n mosr-dm --kubeconfig=/app/config/base-taishan-kubectl.yml
|
||||
when:
|
||||
branch:
|
||||
- dm
|
||||
|
||||
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
@@ -84,8 +144,10 @@ volumes:
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
load:
|
||||
trigger:
|
||||
branch:
|
||||
- prod
|
||||
- dm
|
||||
event:
|
||||
- push
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -13,7 +13,7 @@
|
||||
"axios": "^1.4.0",
|
||||
"d3": "^7.8.5",
|
||||
"echarts": "^5.4.2",
|
||||
"element-plus": "^2.3.5",
|
||||
"element-plus": "^2.6.0",
|
||||
"highlight.js": "9.18.5",
|
||||
"jquery": "^3.6.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"axios": "^1.4.0",
|
||||
"d3": "^7.8.5",
|
||||
"echarts": "^5.4.2",
|
||||
"element-plus": "^2.3.5",
|
||||
"element-plus": "^2.6.0",
|
||||
"highlight.js": "9.18.5",
|
||||
"jquery": "^3.6.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
|
||||
@@ -14,6 +14,14 @@ export const getRoleOption = () => {
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
|
||||
export const getTemRoleOption = () => {
|
||||
return request({
|
||||
url: '/admin/role/option/template',
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
|
||||
//查询角色信息
|
||||
export const getRoleDetail = (roleId) => {
|
||||
return request({
|
||||
|
||||
@@ -15,7 +15,7 @@ const props = defineProps({
|
||||
default: []
|
||||
},
|
||||
modelValue: {
|
||||
type: [Number, String],
|
||||
type: [Number, String, Boolean],
|
||||
default: ''
|
||||
},
|
||||
cacheKey: {
|
||||
|
||||
@@ -65,8 +65,6 @@ const filterConfig = computed(()=>{
|
||||
return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3)
|
||||
})
|
||||
|
||||
console.log(filterConfig.value, 'filterConfig');
|
||||
|
||||
// 搜索功能表单元素默认值
|
||||
const setDefaultFormValues = () => {
|
||||
filterConfig.value.forEach(item=>{
|
||||
|
||||
@@ -49,7 +49,7 @@ import { isVNode } from 'vue'
|
||||
if(column && column?.formatter) {
|
||||
return column.formatter(row, column, value, $index) || '--'
|
||||
}
|
||||
return value ? value.toString() : '--'
|
||||
return value !== null && value !== undefined ? value.toString() : '--'
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@ import Hamburger from './Hamburger.vue';
|
||||
import {useAuthStore} from '@/stores/userstore.js'
|
||||
import BellSocket from "./BellSocket.vue";
|
||||
import {getUserInfo} from "../../api/login";
|
||||
import {usePermisstionStroe} from '@/stores/permisstion'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const permisstionStore = usePermisstionStroe()
|
||||
const userInfo = ref({})
|
||||
const visitedP = ref(false)
|
||||
const router = useRouter()
|
||||
@@ -58,6 +60,7 @@ const handleToAuth = () => {
|
||||
const handleLogout = () => {
|
||||
visitedP.value = !visitedP.value
|
||||
authStore.userLogout()
|
||||
permisstionStore.removeMenu()
|
||||
router.push('/login')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -188,7 +188,8 @@ router.beforeEach(async (to, form, next) => {
|
||||
next()
|
||||
NProgress.done()
|
||||
} else {
|
||||
next({path: '/login'})
|
||||
sessionStorage.setItem('toView', JSON.stringify(to))
|
||||
next({path: '/cas/login'})
|
||||
}
|
||||
} else {
|
||||
if (to.path === '/login'|| to.path === '/cas/login') {
|
||||
|
||||
@@ -10,7 +10,17 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
const asyncRouters = ref([])
|
||||
//定义是否加载路由变量
|
||||
const isLoadRoutes = ref(false)
|
||||
const menuList = ref([])
|
||||
const menuList = ref([
|
||||
{
|
||||
name: 'home',
|
||||
path: '/home',
|
||||
icon: 'home',
|
||||
title: '首页',
|
||||
meta: {
|
||||
breadcrumb: true
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
const setIsLoadRoutes = (status) => {
|
||||
return isLoadRoutes.value = status
|
||||
@@ -21,7 +31,7 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
const sRouter = JSON.parse(JSON.stringify(res.data))
|
||||
const mData = JSON.parse(JSON.stringify(res.data))
|
||||
asyncRouters.value = formatAsyncRouters(sRouter)
|
||||
menuList.value = generateMenu(mData)
|
||||
menuList.value = [...menuList.value, ...generateMenu(mData)]
|
||||
addAsyncRouters(asyncRouters.value)
|
||||
isLoadRoutes.value = false
|
||||
} else {
|
||||
@@ -96,12 +106,18 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const removeMenu = () => {
|
||||
menuList.value.length = 0
|
||||
asyncRouters.value.length = 0
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
asyncRouters,
|
||||
menuList,
|
||||
isLoadRoutes,
|
||||
setAsyncRouters,
|
||||
setIsLoadRoutes
|
||||
setIsLoadRoutes,
|
||||
removeMenu
|
||||
}
|
||||
})
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from "axios";
|
||||
import { AxiosCanceler } from "./axiosCanceler";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox, ElNotification } from "element-plus";
|
||||
import { getToken, removeToken } from "./auth";
|
||||
|
||||
axios.defaults.headers['Content-Type']='application/json'
|
||||
@@ -48,21 +48,45 @@ serveice.interceptors.response.use(response=>{
|
||||
case 402:
|
||||
break;
|
||||
case 403:
|
||||
ElMessage.warning('禁止访问')
|
||||
removeToken()
|
||||
window.location = '/forbidden'
|
||||
console.log(response)
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: response.data.msg,
|
||||
type: 'warning'
|
||||
})
|
||||
break;
|
||||
case 404:
|
||||
ElMessage.warning('不存在的地址')
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: '不存在的地址',
|
||||
type: 'error'
|
||||
})
|
||||
break;
|
||||
case 405:
|
||||
ElMessage.warning('传输格式错误,请检查')
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: '传输格式错误,请检查',
|
||||
type: 'error'
|
||||
})
|
||||
break;
|
||||
case 511:
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: '禁止访问',
|
||||
type: 'error'
|
||||
})
|
||||
removeToken()
|
||||
window.location = '/forbidden'
|
||||
break;
|
||||
case 500:
|
||||
if (response.data){
|
||||
return response.data
|
||||
}else {
|
||||
ElMessage.error('系统未知错误')
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: '系统未知错误',
|
||||
type: 'error'
|
||||
})
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
import * as echarts from 'echarts'
|
||||
import homeImage from "@/assets/home/home.png"
|
||||
import coffee from "@/assets/home/coffee.png"
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const router = useRouter()
|
||||
const list=ref([
|
||||
{
|
||||
title: '在线用户量',
|
||||
@@ -172,8 +175,22 @@ const init = () => {
|
||||
data.pieCharts = echarts.init(document.getElementById('pie3')).setOption(pieOption)
|
||||
}
|
||||
|
||||
const redirectView = () => {
|
||||
const toView = sessionStorage.getItem('toView')
|
||||
console.log(toView, 'toView');
|
||||
toView ?
|
||||
router.push({
|
||||
path: JSON.parse(toView).path,
|
||||
query: {
|
||||
...JSON.parse(toView).query
|
||||
}
|
||||
}) :
|
||||
null
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
redirectView()
|
||||
})
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
|
||||
@@ -37,7 +37,7 @@ import {User, Lock, Key} from '@element-plus/icons-vue'
|
||||
const router = useRouter()
|
||||
const authStore = useAuthStore()
|
||||
const loginForm = reactive({
|
||||
username: 'admin',
|
||||
username: 'superAdmin',
|
||||
password: '123456',
|
||||
code: '',
|
||||
uuid: ''
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
@select="handleSelect"
|
||||
v-tabh
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column type="selection" width="55" fixed="left" />
|
||||
<el-table-column label="序号" type="index" align="center" width="60"/>
|
||||
<el-table-column prop="roleName" label="角色名称" align="center"/>
|
||||
<el-table-column prop="roleKey" label="角色标识符" align="center"/>
|
||||
@@ -59,7 +59,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" width="180px"/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<popover-delete :name="scope.row.roleName" :type="'角色'" :btn-text="'取消授权'"
|
||||
@delete="handleCancelAuthorization([scope.row.roleId])"/>
|
||||
@@ -98,7 +98,7 @@
|
||||
v-loading="dialogLoading"
|
||||
@select="handleDialogSelect"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column type="selection" width="55" fixed="left" />
|
||||
<el-table-column label="序号" type="index" align="center" width="60"/>
|
||||
<el-table-column prop="roleName" label="角色名称" align="center"/>
|
||||
<el-table-column prop="roleKey" label="角色标识符" align="center"/>
|
||||
@@ -117,7 +117,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" width="180px"/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="handleSubmit(scope.row.roleId)" link>添加
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="table-header-btn">
|
||||
<el-button type="primary" @click="handleAdd" :icon="Plus">新增</el-button>
|
||||
<el-button type="primary" @click="handleAdd" :icon="Plus" v-perm="['admin:menu:add']">新增</el-button>
|
||||
<el-button type="info" @click="handleExpand" :icon="Sort">{{ isExpand ? '全部收起' : '全部展开' }}</el-button>
|
||||
</div>
|
||||
|
||||
@@ -42,15 +42,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"/>
|
||||
<el-table-column label="操作" prop="operation">
|
||||
<el-table-column label="操作" prop="operation" align="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" v-if="scope.row.menuType!=='B'" size="mini" @click="handleAdd(scope.row)" link>新增
|
||||
<el-button type="primary" v-if="scope.row.menuType!=='B'" @click="handleAdd(scope.row)" link v-perm="['admin:menu:add']">新增
|
||||
</el-button>
|
||||
<div v-else style="display: inline-block">
|
||||
</div>
|
||||
<el-button type="primary" size="mini" @click="handleEdit(scope.row.menuId)" link>修改</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleAssignRoles(scope.row)" link>分配角色</el-button>
|
||||
<popover-delete :name="scope.row.menuName" :type="'菜单'" @delete="handleDel(scope.row.menuId)"/>
|
||||
<el-button type="primary" @click="handleEdit(scope.row.menuId)" link v-perm="['admin:menu:edit']">修改</el-button>
|
||||
<!-- <el-button type="primary" @click="handleAssignRoles(scope.row)" link>分配角色</el-button> -->
|
||||
<popover-delete :name="scope.row.menuName" :type="'菜单'" @delete="handleDel(scope.row.menuId)" :perm="['admin:menu:del']" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
<div v-loading="loading">
|
||||
<baseTitle title="角色信息录入"></baseTitle>
|
||||
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
||||
<baseTitle title="分配菜单"></baseTitle>
|
||||
<div class="assign-menu-title" >
|
||||
<baseTitle title="分配菜单"></baseTitle>
|
||||
<fvSelect
|
||||
:options="localData.tempRoleOpt"
|
||||
v-model="localData.tempRoleSelect"
|
||||
style="width: 200px;"
|
||||
placeholder="请选择模版角色"
|
||||
@change="roleTempChange"
|
||||
/>
|
||||
</div>
|
||||
<fvCheckbox :options="localData.checkOptions" v-model="localData.checkList" @change="checkBoxChange" />
|
||||
<el-input v-model="localData.filterText" placeholder="请输入关键词" style="width: 400px;" />
|
||||
<div class="menu-assign">
|
||||
@@ -11,7 +20,7 @@
|
||||
:data="localData.menuData"
|
||||
:filter-node-method="filterMenu"
|
||||
:props="localData.menuTreeProps"
|
||||
:check-strictly="localData.checkStrictly"
|
||||
:check-strictly="!localData.checkStrictly"
|
||||
show-checkbox
|
||||
node-key="menuId"
|
||||
@check-change="checkChange"
|
||||
@@ -30,7 +39,7 @@ import { useAuthStore } from '@/stores/userstore.js'
|
||||
import fvRadio from '@/fvcomponents/fvRadio/index.vue'
|
||||
import { ElLoading, ElNotification } from 'element-plus';
|
||||
import { getMenuList } from '@/api/system/menuman.js'
|
||||
import { getRoleDetail, operate} from "@/api/role/role";
|
||||
import { getRoleDetail, operate, getTemRoleOption } from "@/api/role/role";
|
||||
|
||||
const tagsViewStore = useTagsView()
|
||||
const authStore = useAuthStore()
|
||||
@@ -50,7 +59,7 @@ const localData = reactive({
|
||||
label: 'menuName',
|
||||
children: 'children'
|
||||
},
|
||||
checkStrictly: false,
|
||||
checkStrictly: true,
|
||||
checkList: ['3'],
|
||||
checkOptions: [
|
||||
{
|
||||
@@ -65,7 +74,9 @@ const localData = reactive({
|
||||
label: '父子联动',
|
||||
value: '3'
|
||||
},
|
||||
]
|
||||
],
|
||||
tempRoleOpt: [],
|
||||
tempRoleSelect: ''
|
||||
})
|
||||
|
||||
const schame = computed(()=>{
|
||||
@@ -115,7 +126,7 @@ const schame = computed(()=>{
|
||||
}
|
||||
},
|
||||
]
|
||||
return !authStore.roles.includes('superAdmin') ? arr.slice(-1) : arr
|
||||
return !authStore.roles.includes('superAdmin') ? arr.slice(0, arr.length - 1) : arr
|
||||
})
|
||||
|
||||
const rules = reactive({
|
||||
@@ -130,6 +141,8 @@ const getInstance = (e) => {
|
||||
|
||||
const init = async () => {
|
||||
form.value.setValues({state: '1', template: false})
|
||||
const res = await getTemRoleOption()
|
||||
localData.tempRoleOpt = res.data
|
||||
const { data } = await getMenuList()
|
||||
localData.menuData = data
|
||||
}
|
||||
@@ -140,12 +153,25 @@ const getInfo = async () => {
|
||||
data.menuIds.forEach(key=>{
|
||||
menuTree.value.setChecked(key, true, false)
|
||||
})
|
||||
if(route.query.isAdd) {
|
||||
form.value.setValues(data)
|
||||
}
|
||||
|
||||
const roleTempChange = async (val) => {
|
||||
try {
|
||||
loading.value = true
|
||||
const { data } = await getRoleDetail(val.value)
|
||||
data.menuIds.forEach(key=>{
|
||||
menuTree.value.setChecked(key, true, false)
|
||||
})
|
||||
delete data.roleId
|
||||
delete data.roleName
|
||||
delete data.roleKey
|
||||
form.value.setValues(data)
|
||||
loading.value = false
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
}
|
||||
form.value.setValues(data)
|
||||
|
||||
}
|
||||
|
||||
const filterMenu = (value, data) => {
|
||||
@@ -222,6 +248,14 @@ onMounted( async ()=>{
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.assign-menu-title {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
>div:first-child {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
.menu-assign {
|
||||
width: 400px;
|
||||
max-height: 500px;
|
||||
|
||||
@@ -129,17 +129,10 @@ const tableConfig = reactive({
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
align: 'right',
|
||||
fixed: 'right',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = [{label: '修改', auth: auths.edit, func: ()=>handleEdit(row) , type: 'primary'}]
|
||||
row.template ?
|
||||
btn.push(
|
||||
{
|
||||
label: '使用模版',
|
||||
auth: auths.edit,
|
||||
func: ()=>handleUseTemp(row),
|
||||
type: 'primary'
|
||||
}
|
||||
) :
|
||||
btn.push(
|
||||
{
|
||||
label: '分配用户',
|
||||
@@ -221,16 +214,6 @@ const handleEdit = (row) => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleUseTemp = (row) => {
|
||||
router.push({
|
||||
path: '/system/roleadd',
|
||||
query: {
|
||||
id: row.roleId,
|
||||
isAdd: 1
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleAssign = (row) => {
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export default defineConfig({
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: false, // 生产环境移除log
|
||||
drop_debugger: false // 生产环境禁用debugger
|
||||
drop_debugger: true // 生产环境禁用debugger
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user