|
|
@ -6,38 +6,38 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<template #toolbar> |
|
|
|
<template #toolbar> |
|
|
|
<a-button |
|
|
|
<a-button |
|
|
|
v-auth="['client_add']" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="handleAdd()" |
|
|
|
@click="handleAdd()" |
|
|
|
>新增客户端</a-button> |
|
|
|
>新增</a-button> |
|
|
|
<a-button |
|
|
|
<a-button |
|
|
|
v-auth="['client_edit']" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
:disabled="state.single" |
|
|
|
:disabled="state.single" |
|
|
|
@click="handleEdit()" |
|
|
|
@click="handleEdit()" |
|
|
|
>修改客户端</a-button> |
|
|
|
>修改</a-button> |
|
|
|
<a-button |
|
|
|
<a-button |
|
|
|
v-auth="['client_del']" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
:disabled="state.multiple" |
|
|
|
:disabled="state.multiple" |
|
|
|
@click="handleDel()" |
|
|
|
@click="handleDel()" |
|
|
|
>删除客户端</a-button> |
|
|
|
>删除</a-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<TableAction |
|
|
|
<TableAction |
|
|
|
:actions="[ |
|
|
|
:actions="[ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '查看', |
|
|
|
|
|
|
|
icon: 'fa-regular:eye', |
|
|
|
|
|
|
|
onClick: handleViewEdit.bind(null, record) |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '编辑', |
|
|
|
label: '编辑', |
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
auth: ['client_edit'], |
|
|
|
|
|
|
|
onClick: handleEdit.bind(null, record) |
|
|
|
onClick: handleEdit.bind(null, record) |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: '删除', |
|
|
|
label: '删除', |
|
|
|
icon: 'ant-design:delete-outlined', |
|
|
|
icon: 'ant-design:delete-outlined', |
|
|
|
color: 'error', |
|
|
|
color: 'error', |
|
|
|
auth: ['client_del'], |
|
|
|
|
|
|
|
onClick: handleDel.bind(null, record) |
|
|
|
onClick: handleDel.bind(null, record) |
|
|
|
}]" |
|
|
|
}]" |
|
|
|
/> |
|
|
|
/> |
|
|
@ -45,17 +45,17 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</BasicTable> |
|
|
|
</BasicTable> |
|
|
|
<!--弹出窗体区域--> |
|
|
|
<!--弹出窗体区域--> |
|
|
|
<ClientModal @register="registerModal" @success="handleRefreshTable"/> |
|
|
|
<GenShowTypeModal @register="registerModal" @success="handleRefreshTable"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { reactive, toRaw } from 'vue'; |
|
|
|
import { reactive, toRaw } from 'vue'; |
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
import { listClient, delClient } from '/@/api/platform/system/controller/client'; |
|
|
|
import { listGenShowType, delGenShowType } from '/@/api/platform/system/controller/genShowType'; |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
import ClientModal from './ClientModal.vue'; |
|
|
|
import GenShowTypeModal from './GenShowTypeModal.vue'; |
|
|
|
import { columns, searchFormSchema } from './client.data'; |
|
|
|
import { columns, searchFormSchema } from './genShowType.data'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
|
|
|
|
|
|
|
interface TableState { |
|
|
|
interface TableState { |
|
|
@ -73,9 +73,8 @@ |
|
|
|
const { createConfirm, createMessage } = useMessage(); |
|
|
|
const { createConfirm, createMessage } = useMessage(); |
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
|
|
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
|
|
title: '客户端列表', |
|
|
|
api: listGenShowType, |
|
|
|
api: listClient, |
|
|
|
rowKey: 'id', |
|
|
|
rowKey: 'clientId', |
|
|
|
|
|
|
|
columns, |
|
|
|
columns, |
|
|
|
formConfig: { |
|
|
|
formConfig: { |
|
|
|
compact: true, |
|
|
|
compact: true, |
|
|
@ -83,8 +82,7 @@ |
|
|
|
schemas: searchFormSchema, |
|
|
|
schemas: searchFormSchema, |
|
|
|
autoSubmitOnEnter: true, |
|
|
|
autoSubmitOnEnter: true, |
|
|
|
showAdvancedButton: true, |
|
|
|
showAdvancedButton: true, |
|
|
|
autoAdvancedLine: 3, |
|
|
|
autoAdvancedLine: 3 |
|
|
|
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
rowSelection: { type: 'checkbox' }, |
|
|
|
rowSelection: { type: 'checkbox' }, |
|
|
|
useSearchForm: true, |
|
|
|
useSearchForm: true, |
|
|
@ -96,7 +94,6 @@ |
|
|
|
width: 220, |
|
|
|
width: 220, |
|
|
|
title: '操作', |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
dataIndex: 'action', |
|
|
|
//slots: { customRender: 'action' }, |
|
|
|
|
|
|
|
fixed: false |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSearchInfoFn: () => clearSelectedRowKeys() |
|
|
|
handleSearchInfoFn: () => clearSelectedRowKeys() |
|
|
@ -109,35 +106,37 @@ |
|
|
|
state.multiple = !rowSelection.length; |
|
|
|
state.multiple = !rowSelection.length; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
|
|
|
|
|
|
|
function handleAdd() { |
|
|
|
function handleAdd() { |
|
|
|
openModal(true,{ _tag: 'add' }); |
|
|
|
openModal(true,{ _tag: 'add' }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 编辑按钮操作,行内编辑 */ |
|
|
|
function handleViewEdit(record?: Recordable) { |
|
|
|
|
|
|
|
record = record || { id: getSelectRowKeys() }; |
|
|
|
|
|
|
|
openModal(true, { _tag: 'view', record }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function handleEdit(record?: Recordable) { |
|
|
|
function handleEdit(record?: Recordable) { |
|
|
|
record = record || { clientId: getSelectRowKeys() }; |
|
|
|
record = record || { id: getSelectRowKeys() }; |
|
|
|
openModal(true, { _tag: 'edit', record }); |
|
|
|
openModal(true, { _tag: 'edit', record }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作,行内删除 */ |
|
|
|
|
|
|
|
async function handleDel(record?: Recordable) { |
|
|
|
async function handleDel(record?: Recordable) { |
|
|
|
const clientIds = record?.clientId || getSelectRowKeys(); |
|
|
|
const ids = record?.id || getSelectRowKeys(); |
|
|
|
createConfirm({ |
|
|
|
createConfirm({ |
|
|
|
iconType: 'warning', |
|
|
|
iconType: 'warning', |
|
|
|
title: '警告', |
|
|
|
title: '警告', |
|
|
|
content: `是否确认删除客户端编号为${clientIds}客户端吗?`, |
|
|
|
content: `是否确认删除id编号为${ids}的数据吗?`, |
|
|
|
onOk: async () => { |
|
|
|
onOk: async () => { |
|
|
|
await delClient(clientIds); |
|
|
|
await delGenShowType(ids); |
|
|
|
createMessage.success('删除成功!'); |
|
|
|
createMessage.success('删除成功!'); |
|
|
|
handleRefreshTable(); |
|
|
|
handleRefreshTable(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 处理表格刷新 */ |
|
|
|
|
|
|
|
function handleRefreshTable() { |
|
|
|
function handleRefreshTable() { |
|
|
|
clearSelectedRowKeys(); |
|
|
|
clearSelectedRowKeys(); |
|
|
|
reload(); |
|
|
|
reload(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|