微调
This commit is contained in:
@@ -10,8 +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)
|
||||
// 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()
|
||||
|
||||
@@ -56,11 +56,14 @@ import Message from "./components/Message.vue";
|
||||
import Fullscreen from "./components/Fullscreen.vue";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import {useDictStore} from "@/stores/modules/dict";
|
||||
import { useModeStore } from "@/stores/modules/mode";
|
||||
const userStore = useUserStore();
|
||||
const dictStore = useDictStore();
|
||||
const username = computed(() => userStore.userInfo.name);
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore();
|
||||
|
||||
// 退出登录
|
||||
const logout = () => {
|
||||
ElMessageBox.confirm("您是否确认退出登录?", "温馨提示", {
|
||||
@@ -74,6 +77,7 @@ const logout = () => {
|
||||
userStore.setToken("");
|
||||
userStore.setUserInfo({name: ""});
|
||||
dictStore.setDictData([]);
|
||||
modeStore.setCurrentMode('');
|
||||
// 3.重定向到登陆页
|
||||
router.replace(LOGIN_URL);
|
||||
ElMessage.success("退出登录成功!");
|
||||
|
||||
@@ -69,7 +69,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
await initDynamicRouter()
|
||||
return next({ ...to, replace: true })
|
||||
}
|
||||
console.log(to)
|
||||
//console.log(to)
|
||||
// 7.存储 routerName 做按钮权限筛选
|
||||
authStore.setRouteName(to.name as string)
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="图标" prop="icon" :label-width="100">
|
||||
<IconSelect
|
||||
v-model="formContent.icon"
|
||||
:iconValue="formContent.icon"
|
||||
@update:icon-value="iconValue => formContent.icon = iconValue"
|
||||
placeholder="选择一个图标"
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
<!-- :data='userData' -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.resource="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.testScript="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.resource="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
|
||||
|
||||
@@ -146,10 +146,14 @@ const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFu
|
||||
const allIds = getAllIds(AllFunction);
|
||||
// 匹配 roleFunctions 中的 id 并设置 checkedKeys
|
||||
const checkedKeys = allIds.filter(id => roleFunctions.some(roleFunc => roleFunc.id === id));
|
||||
|
||||
// 过滤出叶子节点
|
||||
const leafCheckedKeys = filterLeafNodes(AllFunction, checkedKeys);
|
||||
|
||||
// 设置 functionList 和 checkedKeys
|
||||
functionList.value = AllFunction;
|
||||
checkedKeysRef.value = checkedKeys;
|
||||
|
||||
checkedKeysRef.value = leafCheckedKeys;
|
||||
|
||||
// nextTick(() => {
|
||||
// // 触发一次更新,确保表单中的数据被更新
|
||||
// dialogFormRef.value?.validate();
|
||||
@@ -166,14 +170,32 @@ const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFu
|
||||
}
|
||||
}
|
||||
|
||||
const filterLeafNodes = (functions: Function.ResFunction[], checkedKeys: string[]): string[] => {
|
||||
const leafNodes: string[] = [];
|
||||
const isLeafNode = (func: Function.ResFunction) => !func.children || func.children.length === 0;
|
||||
|
||||
const traverse = (funcs: Function.ResFunction[]) => {
|
||||
for (const func of funcs) {
|
||||
if (isLeafNode(func)) {
|
||||
if (checkedKeys.includes(func.id)) {
|
||||
leafNodes.push(func.id);
|
||||
}
|
||||
} else {
|
||||
traverse(func.children);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
traverse(functions);
|
||||
return leafNodes;
|
||||
};
|
||||
const getAllIds = (functions: Function.ResFunction[]): string[] => {
|
||||
const ids: string[] = [];
|
||||
|
||||
const traverse = (func: Function.ResFunction) => {
|
||||
ids.push(func.id);
|
||||
if (func.children && func.children.length > 0) {
|
||||
func.children.forEach(child => traverse(child));
|
||||
func.children.forEach((child: any) => traverse(child));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
<!-- :requestApi="getRoleList" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.role="'add'" type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增</el-button>
|
||||
<el-button v-auth.role="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑角色', scope.row)">编辑</el-button>
|
||||
<el-button v-if="scope.row.type !== 0 && scope.row.type !== 1" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
|
||||
<el-button type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button>
|
||||
<el-button v-auth.role="'edit'" type='primary' link :icon='EditPen' @click="openDrawer('编辑角色', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.role="'delete'" v-if="scope.row.type !== 0 && scope.row.type !== 1" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.role="'SetPermissions'" type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
<!-- :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 v-auth.user="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.user="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' @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='EditPassWord(scope.row)'>修改密码</el-button>
|
||||
<el-button v-auth.user="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.user="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.user="'editPassWord'" type='primary' link :icon='Delete' @click='EditPassWord(scope.row)'>修改密码</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
|
||||
@@ -41,27 +41,30 @@ 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,
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
name: "比对式模块",
|
||||
code:"比对式",
|
||||
subName: "启用比对式检测计划",
|
||||
img: "/src/assets/images/dashboard/3.svg",
|
||||
isActive: false,
|
||||
isActive: true,
|
||||
},
|
||||
];
|
||||
const handelOpen = async (item: any) => {
|
||||
|
||||
await authStore.setShowMenu();
|
||||
modeStore.setCurrentMode(item.name); // 将模式名称存入 store
|
||||
modeStore.setCurrentMode(item.code); // 将模式code存入 store
|
||||
return;
|
||||
if (isActive) {
|
||||
router.push({ path: "/static" });
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
<!-- :requestApi="getRoleList" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click='importFile()'>导入</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.device="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.device="'export'" type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
|
||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()'>导入</el-button>
|
||||
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<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 v-auth.device="'edit'" type='primary' link :icon='EditPen' :model-value="false" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<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 v-auth.testScript="'edit'" type='primary' link :icon='EditPen' :model-value="false" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.testScript="'delete'" type='primary' link :icon='Delete' @click='handleDelete(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>
|
||||
|
||||
@@ -66,7 +66,7 @@ const columns = reactive<ColumnProps<TestScript.ResTestScript>[]>([
|
||||
},
|
||||
{
|
||||
prop: 'standardTime',
|
||||
label: '标准推行时间',
|
||||
label: '标准推行年份',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-divider >检测配置</el-divider>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='一键检测方式' prop='autoGenerate' :label-width="125">
|
||||
<el-form-item label='一键检测方式' prop='autoGenerate' :label-width="140">
|
||||
<el-select v-model="TestConfigForm.autoGenerate" clearable placeholder="请选择一键检测方式" >
|
||||
<el-option label="只检测,报告后续手动生成" :value="0"></el-option>
|
||||
<el-option label="检测和生成报告同时进行" :value="1"></el-option>
|
||||
@@ -14,12 +14,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='复检最大次数' prop='maxTime' >
|
||||
<el-form-item label='复检最大次数' prop='maxTime' :label-width="110">
|
||||
<el-input-number v-model='TestConfigForm.maxTime' :min='1' :max='999' />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='数据处理原则' prop='dataRule' :label-width="125">
|
||||
<el-form-item label='数据处理原则' prop='dataRule' :label-width="140">
|
||||
<el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则" >
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Data_Rule')"
|
||||
@@ -36,22 +36,22 @@
|
||||
<el-divider >有效数据配置</el-divider>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="录波数据有效组数" prop="waveRecord" :label-width="125">
|
||||
<el-input v-model.number='RegResForm.waveRecord' placeholder="/" disabled/>
|
||||
<el-form-item label="录波数据有效组数" prop="waveRecord" :label-width="140">
|
||||
<el-input v-model.number='RegResForm.waveRecord' placeholder="/" :disabled="IsMode"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实时数据有效组数" prop="realTime" :label-width="125" >
|
||||
<el-form-item label="实时数据有效组数" prop="realTime" :label-width="140" >
|
||||
<el-input number v-model.number='RegResForm.realTime' placeholder="请输入实时数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="统计数据有效组数" prop="statistics" :label-width="125" >
|
||||
<el-form-item label="统计数据有效组数" prop="statistics" :label-width="140" >
|
||||
<el-input number v-model.number='RegResForm.statistics' placeholder="请输入统计数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="闪变数据有效组数" prop="flicker" :label-width="125" >
|
||||
<el-form-item label="闪变数据有效组数" prop="flicker" :label-width="140" >
|
||||
<el-input number v-model.number='RegResForm.flicker' placeholder="请输入闪变数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -63,10 +63,117 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="日志配置">
|
||||
|
||||
<div class="form-grid">
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='调试日志配置' :label-width="140">
|
||||
<el-select clearable placeholder="请选择调试日志配置" >
|
||||
<el-option label="开启" :value="0"></el-option>
|
||||
<el-option label="关闭" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='调试日志记录等级' :label-width="140">
|
||||
<el-select clearable placeholder="请选择日志记录等" >
|
||||
<el-option label="FATAL(致命错误)及以上" :value="0"></el-option>
|
||||
<el-option label="ERROR(一般错误)及以上" :value="1"></el-option>
|
||||
<el-option label="WARN(警告)及以上" :value="2"></el-option>
|
||||
<el-option label="INFO(一般信息)及以上" :value="3"></el-option>
|
||||
<el-option label="DEBUG(调试信息)及以上" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='操作日志配置' :label-width="140">
|
||||
<el-select clearable placeholder="请选择操作日志配置" >
|
||||
<el-option label="开启" :value="0"></el-option>
|
||||
<el-option label="关闭" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary">保存配置</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据删除备份配置">
|
||||
|
||||
<div class="form-grid">
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='原始数据备份频率' :label-width="140">
|
||||
<el-select clearable placeholder="请选择原始数据备份频率" >
|
||||
<el-option label="每月" :value="0"></el-option>
|
||||
<el-option label="每三月" :value="1"></el-option>
|
||||
<el-option label="每年" :value="1"></el-option>
|
||||
<el-option label="从不" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='原始数据备份路径' :label-width="140">
|
||||
<el-col :span="16">
|
||||
<el-input />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button type='primary'>立即进行备份</el-button>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='原始数据备份时间' :label-width="140">
|
||||
<el-select clearable placeholder="请选择原始数据备份时间" >
|
||||
<el-option label="03:00" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='原始数据删除配置' :label-width="140">
|
||||
<el-select clearable placeholder="请选择原始数据删除配置" >
|
||||
<el-option label="从不" :value="0"></el-option>
|
||||
<el-option label="大于半年进行删除" :value="1"></el-option>
|
||||
<el-option label="大于一年进行删除" :value="2"></el-option>
|
||||
<el-option label="大于两年进行删除" :value="3"></el-option>
|
||||
<el-option label="大于五年进行删除" :value="4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='原始数据删除时间' :label-width="140">
|
||||
<el-select clearable placeholder="请选择原始数据删除时间" >
|
||||
<el-option label="05:00" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='调试日志保存策略' :label-width="140">
|
||||
<el-select clearable placeholder="请选择调试日志保存策略" >
|
||||
<el-option label="一个月" :value="0"></el-option>
|
||||
<el-option label="三个月" :value="1"></el-option>
|
||||
<el-option label="六个月" :value="2"></el-option>
|
||||
<el-option label="从不删除" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='操作日志保存策略' :label-width="140">
|
||||
<el-select clearable placeholder="请选择操作日志保存策略" >
|
||||
<el-option label="三个月" :value="0"></el-option>
|
||||
<el-option label="六个月或大于100万条" :value="1"></el-option>
|
||||
<el-option label="从不" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary">保存配置</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -78,7 +185,7 @@
|
||||
import PqPopup from '@/views/system/dictionary/dictPq/components/pqPopup.vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { computed, onMounted, reactive, Ref, ref } from 'vue'
|
||||
import { computed, onMounted, reactive, Ref, ref, watch } from 'vue'
|
||||
import {type Base } from '@/api/system/base/interface'
|
||||
import {type VersionRegister } from '@/api/system/versionRegister/interface'
|
||||
import {getTestConfig,updateTestConfig } from '@/api/system/base/index'
|
||||
@@ -86,10 +193,33 @@
|
||||
import { ElMessage, FormItemRule } from 'element-plus'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
const dialogFormRef = ref()
|
||||
const mode = ref()
|
||||
const IsMode = ref(false)
|
||||
const TestConfigList = ref<Base.ResTestConfig>()
|
||||
const RegResList = ref<VersionRegister.ResSys_Reg_Res>()
|
||||
|
||||
|
||||
// 初始化时获取
|
||||
onMounted(async () => {
|
||||
mode.value =modeStore.currentMode;//pinia中获取当前是那个模块进来的
|
||||
const response = await getTestConfig()
|
||||
TestConfigForm.value = response.data as unknown as Base.ResTestConfig
|
||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== mode.value)?.id//获取数据字典中对应的id
|
||||
RegResForm.value.type = patternId || '';
|
||||
const response2 = await getRegRes(RegResForm.value)
|
||||
RegResForm.value = response2.data as unknown as VersionRegister.ResSys_Reg_Res
|
||||
//只有比对式有录波
|
||||
if(mode.value == '比对式'){
|
||||
IsMode.value = false
|
||||
}else{
|
||||
IsMode.value = true
|
||||
}
|
||||
})
|
||||
|
||||
const TestConfigForm = ref<Base.ResTestConfig>({
|
||||
id: '',
|
||||
autoGenerate: 0,
|
||||
@@ -119,7 +249,6 @@
|
||||
flicker: 1,
|
||||
})
|
||||
|
||||
|
||||
// 定义弹出组件元信息
|
||||
const rules = computed(() =>{
|
||||
const baseRules : Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
@@ -149,20 +278,8 @@
|
||||
})
|
||||
|
||||
|
||||
const TestConfigList = ref<Base.ResTestConfig>()
|
||||
const RegResList = ref<VersionRegister.ResSys_Reg_Res>()
|
||||
// 初始化时获取
|
||||
onMounted(async () => {
|
||||
mode.value =modeStore.currentMode.replace('模块', '');//pinia中获取当前是那个模块进来的,临时处理去除模块两字
|
||||
const response = await getTestConfig()
|
||||
TestConfigForm.value = response.data as unknown as Base.ResTestConfig
|
||||
//console.log(mode)
|
||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== mode.value)?.id//获取数据字典中对应的id
|
||||
RegResForm.value.type = patternId || '';
|
||||
const response2 = await getRegRes(RegResForm.value)
|
||||
RegResForm.value = response2.data as unknown as VersionRegister.ResSys_Reg_Res
|
||||
|
||||
})
|
||||
|
||||
|
||||
const submitForm = async () => {
|
||||
try {
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
<div class='table-box' :style="{height:(height-64)+'px',maxHeight:(height-64)+'px',overflow:'hidden'}">
|
||||
<ProTable ref='proTable' :columns="columns" :request-api='getDictDataListByTypeId' :initParam="initParam">
|
||||
<template #tableHeader="scope">
|
||||
<el-button type="primary" :icon="CirclePlus" @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click="downloadFile">导出</el-button>
|
||||
<el-button type="danger" :icon="Delete" plain :disabled="!scope.isSelected"
|
||||
<el-button v-auth.dict="'show_add'" type="primary" :icon="CirclePlus" @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.dict="'show_export'" type='primary' :icon='Download' plain @click="downloadFile">导出</el-button>
|
||||
<el-button v-auth.dict="'show_batchDelete'" type="danger" :icon="Delete" plain :disabled="!scope.isSelected"
|
||||
@click="batchDelete(scope.selectedListIds)">
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #operation="scope">
|
||||
<el-button type="primary" link :icon="EditPen" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type="primary" link :icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-auth.dict="'show_edit'" type="primary" link :icon="EditPen" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.dict="'show_delete'" type="primary" link :icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
@@ -265,4 +265,5 @@
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
:request-api='getDictPqList'
|
||||
>
|
||||
<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.dictPq="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.dictPq="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.dictPq="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.dictPq="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
>
|
||||
<template #tableHeader>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.dictTree="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
</template>
|
||||
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='CirclePlus' @click="openDialog('add',scope.row)">新增</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.dictTree="'add'" type='primary' link :icon='CirclePlus' @click="openDialog('add',scope.row)">新增</el-button>
|
||||
<el-button v-auth.dictTree="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.dictTree="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
:request-api='getDictTypeList'
|
||||
>
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click='downloadFile()'>导出</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.dict="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.dict="'export'" type='primary' :icon='Download' plain @click='downloadFile()'>导出</el-button>
|
||||
<el-button v-auth.dict="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='View' @click='toDictData(scope.row)'>查看</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.dict="'show'" type='primary' link :icon='View' @click='toDictData(scope.row)'>查看</el-button>
|
||||
<el-button v-auth.dict="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.dict="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user