检测脚本
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user