|
|
@@ -2,27 +2,25 @@
|
|
|
<div>
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
- <template v-if="column.key === 'storageType'">
|
|
|
- <Tag :color="formatDictColor(storageTypeOptions, record.storageType)">
|
|
|
- {{ formatDictValue(storageTypeOptions, record.storageType) }}
|
|
|
- </Tag>
|
|
|
- </template>
|
|
|
<template v-if="column.key === 'action'">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
+ auth: 'infra:storageconfig:query',
|
|
|
icon: 'icon-eye|iconfont',
|
|
|
tooltip: '查看',
|
|
|
label: '查看',
|
|
|
onClick: handleView.bind(null, record),
|
|
|
},
|
|
|
{
|
|
|
+ auth: 'infra:storageconfig:edit',
|
|
|
icon: 'icon-edit|iconfont',
|
|
|
tooltip: '编辑',
|
|
|
label: '编辑',
|
|
|
onClick: handleEdit.bind(null, record),
|
|
|
},
|
|
|
{
|
|
|
+ auth: 'infra:storageconfig:remove',
|
|
|
icon: 'icon-delete|iconfont',
|
|
|
tooltip: '删除',
|
|
|
label: '删除',
|
|
|
@@ -38,8 +36,21 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
<template #toolbar>
|
|
|
- <Button type="primary" @click="handleCreate" preIcon="icon-plus|iconfont"> 新增 </Button>
|
|
|
- <Button type="primary" danger @click="handleDelete(null)" preIcon="icon-delete|iconfont">
|
|
|
+ <Button
|
|
|
+ v-auth="['infra:storageconfig:add']"
|
|
|
+ type="primary"
|
|
|
+ @click="handleCreate"
|
|
|
+ preIcon="icon-plus|iconfont"
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ v-auth="['infra:storageconfig:remove']"
|
|
|
+ type="primary"
|
|
|
+ danger
|
|
|
+ @click="handleDelete(null)"
|
|
|
+ preIcon="icon-delete|iconfont"
|
|
|
+ >
|
|
|
批量删除
|
|
|
</Button>
|
|
|
</template>
|
|
|
@@ -50,7 +61,6 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { onBeforeMount, ref } from 'vue';
|
|
|
- import { Tag } from 'ant-design-vue';
|
|
|
import { Button } from '/@/components/Button';
|
|
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
@@ -62,17 +72,12 @@
|
|
|
import { columns, searchFormSchema } from './data';
|
|
|
|
|
|
import {
|
|
|
- infraStorageConfigQueryPage,
|
|
|
- infraStorageConfigRemove,
|
|
|
- } from '/@/api/infra/infraStorageConfigApi';
|
|
|
- import { listDictModel } from '/@/api/common';
|
|
|
- import { formatDictColor, formatDictValue } from '/@/utils';
|
|
|
+ infraStorageconfigQueryPage,
|
|
|
+ infraStorageconfigRemove,
|
|
|
+ } from '/@/api/infra/infraStorageconfigApi';
|
|
|
import { useDrawer } from '/@/components/Drawer';
|
|
|
|
|
|
- const storageTypeOptions = ref();
|
|
|
- onBeforeMount(async () => {
|
|
|
- storageTypeOptions.value = await listDictModel({ dictCode: 'sys_storage_config' });
|
|
|
- });
|
|
|
+ onBeforeMount(async () => {});
|
|
|
|
|
|
const { createConfirm, createMessage } = useMessage();
|
|
|
// const [registerModal, { openModal }] = useModal();
|
|
|
@@ -87,8 +92,8 @@
|
|
|
]) as any;
|
|
|
|
|
|
const [registerTable, { reload, getSelectRowKeys }] = useTable({
|
|
|
- title: '门户列表 ',
|
|
|
- api: infraStorageConfigQueryPage,
|
|
|
+ title: '文件存储配置 ',
|
|
|
+ api: infraStorageconfigQueryPage,
|
|
|
rowKey: 'id',
|
|
|
columns,
|
|
|
showIndexColumn: true,
|
|
|
@@ -141,7 +146,7 @@
|
|
|
// 删除按钮事件
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
if (record) {
|
|
|
- await infraStorageConfigRemove([record.id]);
|
|
|
+ await infraStorageconfigRemove([record.id]);
|
|
|
createMessage.success('删除成功!');
|
|
|
await reload();
|
|
|
} else {
|
|
|
@@ -150,7 +155,7 @@
|
|
|
iconType: 'warning',
|
|
|
onOk: async () => {
|
|
|
const keys = getSelectRowKeys();
|
|
|
- await infraStorageConfigRemove(keys);
|
|
|
+ await infraStorageconfigRemove(keys);
|
|
|
createMessage.success('删除成功!');
|
|
|
await reload();
|
|
|
},
|