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