提交 62208212 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 93e4e3c3
......@@ -2,6 +2,7 @@
import type { Label } from '../types'
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
import { useUserStore } from '@/stores/user'
import { useMapStore } from '@/stores/map'
import { getNameByValue, updateStatusRuleList } from '@/utils/dictionary'
import { getLabelRule, updateLabelRule } from '../api'
......@@ -17,6 +18,10 @@ const emit = defineEmits<{
(e: 'update:modelValue', visible: boolean): void
}>()
const userStore = useUserStore()
const disabled = computed(() => userStore.status)
const statusList = useMapStore().getMapValuesByKey('system_status')
const formRef = $ref<FormInstance>()
......@@ -93,7 +98,7 @@ function handleUpdate() {
</el-col>
</el-row>
</el-form>
<el-form :model="form" :rules="rules" inline ref="formRef">
<el-form :model="form" :rules="rules" inline ref="formRef" :disabled="disabled">
<!-- 用户属性规则 -->
<UserRule></UserRule>
<!-- 事件属性规则 -->
......@@ -102,7 +107,7 @@ function handleUpdate() {
<template #footer>
<el-row justify="center">
<el-button plain auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
<el-button type="primary" auto-insert-space @click="handleSubmit">保存</el-button>
<el-button type="primary" auto-insert-space @click="handleSubmit" :disabled="disabled">保存</el-button>
</el-row>
</template>
</el-dialog>
......
......@@ -132,7 +132,7 @@ const deleteMembers = function (ids: string) {
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)'
})
deleteMember({ ids: ids }).then(res => {
deleteMember({ ids: ids }).then(() => {
loading.close()
ElMessage({ message: '删除成功', type: 'success' })
handleRefresh()
......@@ -218,7 +218,9 @@ const downloadMember = function (isAll?: boolean) {
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button type="primary" @click="progressVisible = true">数据导入进度</el-button>
<el-button type="primary" @click="progressVisible = true" v-permission="'v1-experiment-member-tasks'"
>数据导入进度</el-button
>
<el-button
type="danger"
plain
......
......@@ -5,7 +5,7 @@ import type { DirectiveBinding } from 'vue'
export function checkPermission(value: string | string[]): boolean {
const userStore = useUserStore()
// true 是学员且使用公共数据(学员不能自己创建数据) false 学员可以自己创建数据
if (userStore.status) return true
if (!userStore.status) return true
const permissions = userStore.permissions
if (Array.isArray(value)) {
return permissions.some(item => value.includes(item.tag))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论