|
@@ -8,7 +8,8 @@
|
|
:width="1000"
|
|
:width="1000"
|
|
:min-height="0"
|
|
:min-height="0"
|
|
>
|
|
>
|
|
- <div class="pt-2px pr-3px">{{roleId}}
|
|
|
|
|
|
+ <div class="pt-2px pr-3px"
|
|
|
|
+ >{{ roleId }}
|
|
<BasicForm @register="registerForm" :model="model">
|
|
<BasicForm @register="registerForm" :model="model">
|
|
<template #text="{ model, field }">
|
|
<template #text="{ model, field }">
|
|
{{ model[field] }}
|
|
{{ model[field] }}
|
|
@@ -16,7 +17,9 @@
|
|
</BasicForm>
|
|
</BasicForm>
|
|
<BasicTable class="powesrTable" @register="registerTable">
|
|
<BasicTable class="powesrTable" @register="registerTable">
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
- <a-button type="primary" v-if="getCheckPerm('scenes-powers-add')" @click="addPowes"> 新增 </a-button>
|
|
|
|
|
|
+ <a-button type="primary" v-if="getCheckPerm('scenes-powers-add')" @click="addPowes">
|
|
|
|
+ 新增
|
|
|
|
+ </a-button>
|
|
</template>
|
|
</template>
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
<TableAction
|
|
<TableAction
|
|
@@ -67,7 +70,7 @@
|
|
setup(props, { emit }) {
|
|
setup(props, { emit }) {
|
|
const modelRef = ref({});
|
|
const modelRef = ref({});
|
|
const numRef = ref(null);
|
|
const numRef = ref(null);
|
|
- const type = ref(0)
|
|
|
|
|
|
+ const type = ref(0);
|
|
const fileFlow = reactive({
|
|
const fileFlow = reactive({
|
|
showList: true,
|
|
showList: true,
|
|
});
|
|
});
|
|
@@ -87,7 +90,11 @@
|
|
title: '查看权限',
|
|
title: '查看权限',
|
|
dataIndex: 'lookAuth',
|
|
dataIndex: 'lookAuth',
|
|
customRender: ({ record }) => {
|
|
customRender: ({ record }) => {
|
|
- return record.lookAuth == 1 ? '不限时间' : record.lookAuth == 0 ? '无权' : `${dayjs(record.lookEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
|
|
|
|
+ return record.lookAuth == 1
|
|
|
|
+ ? '不限时间'
|
|
|
|
+ : record.lookAuth == 0
|
|
|
|
+ ? '无权'
|
|
|
|
+ : `${dayjs(record.lookEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
},
|
|
},
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
@@ -95,7 +102,11 @@
|
|
title: '编辑权限',
|
|
title: '编辑权限',
|
|
dataIndex: 'editAuth',
|
|
dataIndex: 'editAuth',
|
|
customRender: ({ record }) => {
|
|
customRender: ({ record }) => {
|
|
- return record.editAuth == 1 ? '不限时间' : record.editAuth == 0 ? '无权' : `${dayjs(record.editEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
|
|
|
|
+ return record.editAuth == 1
|
|
|
|
+ ? '不限时间'
|
|
|
|
+ : record.editAuth == 0
|
|
|
|
+ ? '无权'
|
|
|
|
+ : `${dayjs(record.editEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
},
|
|
},
|
|
width: 150,
|
|
width: 150,
|
|
},
|
|
},
|
|
@@ -104,7 +115,11 @@
|
|
dataIndex: 'canLook',
|
|
dataIndex: 'canLook',
|
|
customRender: ({ record }) => {
|
|
customRender: ({ record }) => {
|
|
if (type.value == 1) return '编辑';
|
|
if (type.value == 1) return '编辑';
|
|
- return record.canEditLook == 1 ? '编辑和查看' : record.canAuthLook == 1 ? '查看' : `无权`;
|
|
|
|
|
|
+ return record.canEditLook == 1
|
|
|
|
+ ? '编辑和查看'
|
|
|
|
+ : record.canAuthLook == 1
|
|
|
|
+ ? '查看'
|
|
|
|
+ : `无权`;
|
|
},
|
|
},
|
|
width: 120,
|
|
width: 120,
|
|
},
|
|
},
|
|
@@ -194,18 +209,30 @@
|
|
modelRef.value = data;
|
|
modelRef.value = data;
|
|
numRef.value = data.num;
|
|
numRef.value = data.num;
|
|
resetFields();
|
|
resetFields();
|
|
- const { authType } = await getAuthType({num:numRef.value});;
|
|
|
|
|
|
+ const { authType } = await getAuthType({ num: numRef.value });
|
|
fileFlow.showList = authType ? false : true;
|
|
fileFlow.showList = authType ? false : true;
|
|
type.value = authType;
|
|
type.value = authType;
|
|
setFieldsValue({
|
|
setFieldsValue({
|
|
type: data.sceneName,
|
|
type: data.sceneName,
|
|
authType,
|
|
authType,
|
|
});
|
|
});
|
|
- console.log('roleId', roleId.value, (userName.value != data.userName || roleId.value != 1 || roleId.value != 45));
|
|
|
|
|
|
+ console.log(
|
|
|
|
+ 'roleId',
|
|
|
|
+ roleId.value,
|
|
|
|
+ userName.value != data.userName || roleId.value != 1 || roleId.value != 45,
|
|
|
|
+ );
|
|
|
|
+ let disabled = !(
|
|
|
|
+ userName.value == data.userName ||
|
|
|
|
+ roleId.value == 1 ||
|
|
|
|
+ roleId.value == 45
|
|
|
|
+ );
|
|
updateSchema({
|
|
updateSchema({
|
|
field: 'authType',
|
|
field: 'authType',
|
|
componentProps: {
|
|
componentProps: {
|
|
- disabled: !(userName.value == data.userName || roleId.value == 1 || roleId.value == 45),
|
|
|
|
|
|
+ options: [
|
|
|
|
+ { label: '授权用户', value: 0, disabled: disabled && authType == 1 },
|
|
|
|
+ { label: '公开浏览', value: 1, disabled: disabled && authType == 0 },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
});
|
|
});
|
|
reload();
|
|
reload();
|
|
@@ -217,9 +244,9 @@
|
|
const params = await validate();
|
|
const params = await validate();
|
|
console.log('res', params);
|
|
console.log('res', params);
|
|
const res = await setAuthType({
|
|
const res = await setAuthType({
|
|
- num:numRef.value,
|
|
|
|
|
|
+ num: numRef.value,
|
|
...params,
|
|
...params,
|
|
- lookAuth:params.authType
|
|
|
|
|
|
+ lookAuth: params.authType,
|
|
});
|
|
});
|
|
console.log('res', res);
|
|
console.log('res', res);
|
|
closeModal();
|
|
closeModal();
|
|
@@ -231,7 +258,7 @@
|
|
}
|
|
}
|
|
};
|
|
};
|
|
function addPowes() {
|
|
function addPowes() {
|
|
- openDetaileModal(true, { num: modelRef.value.num, qxType: fileFlow.showList});
|
|
|
|
|
|
+ openDetaileModal(true, { num: modelRef.value.num, qxType: fileFlow.showList });
|
|
}
|
|
}
|
|
function handleEdit(record: Recordable) {
|
|
function handleEdit(record: Recordable) {
|
|
openDetaileModal(true, record);
|
|
openDetaileModal(true, record);
|
|
@@ -241,7 +268,7 @@
|
|
title: '删除',
|
|
title: '删除',
|
|
content: `确定要删除 ${record.ryNickName} 吗?`,
|
|
content: `确定要删除 ${record.ryNickName} 吗?`,
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await delAuth({ id: record.id })
|
|
|
|
|
|
+ await delAuth({ id: record.id });
|
|
createMessage.success('删除成功');
|
|
createMessage.success('删除成功');
|
|
reload();
|
|
reload();
|
|
},
|
|
},
|