Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -12,12 +12,12 @@ export const loginApi = (params: Login.ReqLoginForm) => {
|
||||
}
|
||||
// 获取菜单列表
|
||||
export const getAuthMenuListApi = () => {
|
||||
return http.get<Menu.MenuOptions[]>(`${rePrefix}/menu/list`, {}, { loading: false })
|
||||
return http.get<Menu.MenuOptions[]>(`/sysFunction/getMenu`, {}, { loading: false })
|
||||
// return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
|
||||
}
|
||||
// 获取按钮权限
|
||||
export const getAuthButtonListApi = () => {
|
||||
return http.get<Login.ResAuthButtons>(`${rePrefix}/auth/buttons`, {}, { loading: false })
|
||||
return http.get<Login.ResAuthButtons>(`/sysFunction/getButton`, {}, { loading: false })
|
||||
// return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
|
||||
}
|
||||
// 用户退出登录
|
||||
|
||||
@@ -10,6 +10,8 @@ const auth: Directive = {
|
||||
const { value } = binding
|
||||
const authStore = useAuthStore()
|
||||
const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
|
||||
console.log('1234',authStore.routeName)
|
||||
console.log('123',currentPageRoles)
|
||||
if (value instanceof Array && value.length) {
|
||||
const hasPermission = value.every(item => currentPageRoles.includes(item))
|
||||
if (!hasPermission) el.remove()
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
<el-dropdown-item @click="title = '数字式模块'"
|
||||
>数字式模块</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click="title = '对比式模块'"
|
||||
>对比式模块</el-dropdown-item
|
||||
<el-dropdown-item @click="title = '比对式模块'"
|
||||
>比对式模块</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
|
||||
@@ -69,7 +69,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
await initDynamicRouter()
|
||||
return next({ ...to, replace: true })
|
||||
}
|
||||
|
||||
console.log(to)
|
||||
// 7.存储 routerName 做按钮权限筛选
|
||||
authStore.setRouteName(to.name as string)
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -192,6 +192,8 @@ const displayPid = computed({
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: Function.ResFunction) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
const response = await getFunctionListNoButton()
|
||||
functionList.value = response.data as unknown as Function.ResFunction[]
|
||||
titleType.value = sign
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
{
|
||||
prop: 'code',
|
||||
label: '编码',
|
||||
minWidth: 100,
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
@@ -75,7 +75,7 @@
|
||||
{
|
||||
prop: 'icon',
|
||||
label: '图标',
|
||||
minWidth: 100,
|
||||
minWidth: 80,
|
||||
render: scope => {
|
||||
const customIcons: { [key: string]: any } = Icons
|
||||
const iconKey = scope.row.icon; //
|
||||
|
||||
@@ -133,6 +133,8 @@ const close = () => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: Role.RoleBO) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
|
||||
@@ -98,15 +98,20 @@ const close = () => {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (formContent.value.id) {
|
||||
// 获取勾选的节点 ID
|
||||
// 获取半选中的节点 ID
|
||||
const halfCheckedKeys = treeRef.value?.getHalfCheckedKeys() || [];
|
||||
// 获取全选中的节点 ID
|
||||
const checkedKeys = treeRef.value?.getCheckedKeys() || [];
|
||||
// 将两个数组合并
|
||||
const allCheckedKeys = [...halfCheckedKeys, ...checkedKeys];
|
||||
|
||||
// 将 checkedKeys 转换为字符串数组
|
||||
const checkedKeysAsString: string[] = checkedKeys.map(key => String(key));
|
||||
const checkedKeysAsString: string[] = allCheckedKeys.map(key => String(key));
|
||||
// 假设 RoleFunctionId 是一个对象,且需要 id 属性
|
||||
const roleFunctionIdObject: Role.RoleFunctionId = {
|
||||
id: checkedKeysAsString
|
||||
};
|
||||
|
||||
const result = await assignFunction(formContent.value,roleFunctionIdObject);
|
||||
if(result.code != 'A0000'){
|
||||
ElMessage.error({ message: result.message})
|
||||
@@ -128,6 +133,8 @@ const close = () => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFunction[]) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
// 重置树状结构
|
||||
functionList.value = []
|
||||
checkedKeysRef.value = []
|
||||
|
||||
@@ -121,6 +121,8 @@ const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
|
||||
// 打开弹窗是编辑
|
||||
const open = async ( data: User.ResPassWordUser) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
formContent.value = { ...data }
|
||||
|
||||
@@ -151,6 +151,8 @@
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: User.ResUser,roleParams: Role.RoleBO[]) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
// 获取角色列表
|
||||
roleList.value = roleParams
|
||||
titleType.value = sign
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<!-- :data='userData' -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
|
||||
@@ -45,19 +45,22 @@ const router = useRouter();
|
||||
const modeList = [
|
||||
{
|
||||
name: "模拟式模式",
|
||||
code:"模拟式",
|
||||
subName: "未启用模拟式检测计划",
|
||||
img: "/src/assets/images/dashboard/1.svg",
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
name: "数字式模式",
|
||||
code:"数字式",
|
||||
subName: "启用数字检测计划",
|
||||
img: "/src/assets/images/dashboard/2.svg",
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
name: "对比式模式",
|
||||
subName: "启用对比式检测计划",
|
||||
name: "比对式模式",
|
||||
code:"比对式",
|
||||
subName: "启用比对式检测计划",
|
||||
img: "/src/assets/images/dashboard/3.svg",
|
||||
isActive: false,
|
||||
},
|
||||
|
||||
@@ -52,8 +52,8 @@ const modeList = [
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
name: "对比式模块",
|
||||
subName: "启用对比式检测计划",
|
||||
name: "比对式模块",
|
||||
subName: "启用比对式检测计划",
|
||||
img: "/src/assets/images/dashboard/3.svg",
|
||||
isActive: false,
|
||||
},
|
||||
|
||||
@@ -395,6 +395,8 @@ const disabledDate = (time: Date) => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Device.ResPqDev) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<!-- :data='testScriptData' 如果要显示静态数据,就切换该配置 -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.testScript="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.testScript="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
@@ -18,7 +18,7 @@
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' :model-value="false" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button type='primary' v-if="scope.row.type !== 1" link :icon='Share' @click='updateType(scope.row)'>升级</el-button>
|
||||
<el-button v-auth.testScript="'upgrade'" type='primary' v-if="scope.row.type !== 1" link :icon='Share' @click='updateType(scope.row)'>升级</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
|
||||
@@ -274,7 +274,7 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
return scope.row.checkMode == 0
|
||||
? "模拟式"
|
||||
: scope.row.checkMode == 1
|
||||
? "对比式"
|
||||
? "比对式"
|
||||
: scope.row.checkMode == 2
|
||||
? "数字式"
|
||||
: scope.row.checkMode;
|
||||
|
||||
@@ -96,6 +96,8 @@ const close = () => {
|
||||
dialogFormRef.value?.resetFields()
|
||||
}
|
||||
const open = (sign: string, typeId: string, name: string, data: Dict.ResDictData) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
resetFormContent()
|
||||
|
||||
titleType.value = sign
|
||||
|
||||
@@ -245,6 +245,8 @@
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Dict.ResDictPq) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
selectedStatMethods.value = data.statMethod ? data.statMethod.split(',') : []
|
||||
|
||||
@@ -117,6 +117,8 @@
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Dict.ResDictTree) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
|
||||
@@ -124,6 +124,8 @@ const save = () => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Dict.ResDictType) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="程序激活" width="500px" draggable>
|
||||
<el-dialog v-model="dialogVisible" title="程序激活" v-bind="dialogSmall">
|
||||
<el-form :model="formContent">
|
||||
<el-form-item label="程序版本号" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="程序版本号" prop="id" :label-width="100">
|
||||
<el-input v-model='formContent.id' disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模拟式模块" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="模拟式模块" prop="type" :label-width="100">
|
||||
<el-checkbox v-model="formContent.type" label="已激活"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数字式模块" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="数字式模块" prop="type" :label-width="100">
|
||||
<el-checkbox v-model="formContent.type" label="未激活"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="比对式模块" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="比对式模块" prop="type" :label-width="100">
|
||||
<el-checkbox v-model="formContent.type" label="未激活"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="序列号" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="序列号" prop="code" :label-width="100">
|
||||
<el-input v-model='formContent.code' placeholder="请输入序列号" :rows="2" type="textarea"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="注册码" prop="pid" :label-width="100">
|
||||
|
||||
<el-form-item label="注册码" prop="licenseKey" :label-width="100">
|
||||
<el-input v-model='formContent.licenseKey' placeholder="请输入注册码" :rows="2" type="textarea"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -30,20 +30,20 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type VersionRegister } from "@/api/system/versionRegister/interface";
|
||||
import { ref } from "vue";
|
||||
const formContent = ref<Function.ResFunction>({
|
||||
id: '',//资源表Id
|
||||
pid:'',//节点(0为根节点)
|
||||
pids:'',//节点上层所有节点
|
||||
name: '',//名称
|
||||
code:'',//资源标识
|
||||
path:'',//路径
|
||||
component:'',
|
||||
icon:undefined as string | undefined, // 图标
|
||||
sort:100,//排序
|
||||
type:0,//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
remark: '',//权限资源描述
|
||||
state:1,//权限资源状态
|
||||
import { dialogSmall } from '@/utils/elementBind'
|
||||
const formContent = ref<VersionRegister.ResSys_Reg_Res>({
|
||||
id: '', //版本注册表Id
|
||||
type: '', //版本类型(模拟式、数字式、比对式)
|
||||
code: '', //注册码
|
||||
licenseKey: '', //密钥
|
||||
expireDate: '', //到期时间
|
||||
waveRecord: 0,
|
||||
realTime: 20,
|
||||
statistics: 5,
|
||||
flicker: 1,
|
||||
state: 1, //状态
|
||||
})
|
||||
const dialogVisible = ref(false);
|
||||
const openDialog = () => {
|
||||
|
||||
Reference in New Issue
Block a user