4
This commit is contained in:
@@ -125,7 +125,7 @@
|
|||||||
<!-- 操作工具栏 -->
|
<!-- 操作工具栏 -->
|
||||||
<div class="table-action-bar">
|
<div class="table-action-bar">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" @click="handleAdd">
|
<a-button v-has="'admin:sysPharmacy:add'" type="primary" @click="handleAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
新增药房
|
新增药房
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -176,9 +176,10 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 状态快捷开关 -->
|
<!-- 状态快捷开关(有权限可操作切换,无权限展示只读标签) -->
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
<a-switch
|
<a-switch
|
||||||
|
v-if="canChangeStatus"
|
||||||
:model-value="record.status === 1"
|
:model-value="record.status === 1"
|
||||||
:loading="record._statusLoading"
|
:loading="record._statusLoading"
|
||||||
type="round"
|
type="round"
|
||||||
@@ -188,20 +189,24 @@
|
|||||||
<template #checked>正常</template>
|
<template #checked>正常</template>
|
||||||
<template #unchecked>禁用</template>
|
<template #unchecked>禁用</template>
|
||||||
</a-switch>
|
</a-switch>
|
||||||
|
<a-tag v-else :color="record.status === 1 ? 'green' : 'red'" size="small">
|
||||||
|
{{ record.status === 1 ? '正常' : '禁用' }}
|
||||||
|
</a-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 操作列 -->
|
<!-- 操作列 -->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space :size="0">
|
<a-space :size="0">
|
||||||
<a-button type="text" size="small" @click="handleDetail(record)">
|
<a-button v-has="'admin:sysPharmacy:detail'" type="text" size="small" @click="handleDetail(record)">
|
||||||
<template #icon><icon-eye /></template>
|
<template #icon><icon-eye /></template>
|
||||||
详情
|
详情
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="text" size="small" @click="handleEdit(record)">
|
<a-button v-has="'admin:sysPharmacy:edit'" type="text" size="small" @click="handleEdit(record)">
|
||||||
<template #icon><icon-edit /></template>
|
<template #icon><icon-edit /></template>
|
||||||
修改
|
修改
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
|
v-has="'admin:sysPharmacy:remove'"
|
||||||
content="确定要删除此药房吗?删除后不可恢复!"
|
content="确定要删除此药房吗?删除后不可恢复!"
|
||||||
type="warning"
|
type="warning"
|
||||||
@ok="handleDelete(record)"
|
@ok="handleDelete(record)"
|
||||||
@@ -223,10 +228,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, computed } from 'vue';
|
import { ref, reactive, onMounted, computed } from 'vue';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import { usePermissionStore } from '@/store/permission';
|
||||||
import { getPharmacyPage, updatePharmacyStatus, deletePharmacy } from '@/api/basic/pharmacy';
|
import { getPharmacyPage, updatePharmacyStatus, deletePharmacy } from '@/api/basic/pharmacy';
|
||||||
import { getAdminAreaList } from '@/api/basic/list';
|
import { getAdminAreaList } from '@/api/basic/list';
|
||||||
import PharmacyModal from './components/pharmacyModal.vue';
|
import PharmacyModal from './components/pharmacyModal.vue';
|
||||||
|
|
||||||
|
const permissionStore = usePermissionStore();
|
||||||
|
|
||||||
|
// 状态切换权限检查(支持 * 超管与单独权限)
|
||||||
|
const canChangeStatus = computed(() => {
|
||||||
|
const perms = permissionStore.buttonPermissions || [];
|
||||||
|
return perms.includes('*') || perms.includes('admin:sysPharmacy:status');
|
||||||
|
});
|
||||||
|
|
||||||
const queryFormRef = ref(null);
|
const queryFormRef = ref(null);
|
||||||
const modalRef = ref(null);
|
const modalRef = ref(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user