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