|
|
@ -2,7 +2,7 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<BasicTable @register="registerTable"> |
|
|
|
<BasicTable @register="registerTable"> |
|
|
|
<template #toolbar> |
|
|
|
<template #toolbar> |
|
|
|
<a-button type="primary" v-auth="['system:post:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> |
|
|
|
<a-button type="primary" v-auth="['bpm:form:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> |
|
|
|
{{ t('action.create') }} |
|
|
|
{{ t('action.create') }} |
|
|
|
</a-button> |
|
|
|
</a-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -10,12 +10,13 @@ |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
<TableAction |
|
|
|
<TableAction |
|
|
|
:actions="[ |
|
|
|
:actions="[ |
|
|
|
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'system:post:update', onClick: handleEdit.bind(null, record) }, |
|
|
|
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'bpm:form:update', onClick: openForm.bind(null, record) }, |
|
|
|
|
|
|
|
{ icon: IconEnum.VIEW, label: t('action.detail'), auth: 'bpm:form:query', onClick: openDetail.bind(null, record) }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
icon: IconEnum.DELETE, |
|
|
|
icon: IconEnum.DELETE, |
|
|
|
color: 'error', |
|
|
|
color: 'error', |
|
|
|
label: t('action.delete'), |
|
|
|
label: t('action.delete'), |
|
|
|
auth: 'system:post:delete', |
|
|
|
auth: 'bpm:form:delete', |
|
|
|
popConfirm: { |
|
|
|
popConfirm: { |
|
|
|
title: t('common.delMessage'), |
|
|
|
title: t('common.delMessage'), |
|
|
|
placement: 'left', |
|
|
|
placement: 'left', |
|
|
@ -27,11 +28,15 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</BasicTable> |
|
|
|
</BasicTable> |
|
|
|
|
|
|
|
<BpmFormModal @register="registerModal" @success="reload()" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
import { useGo } from '@/hooks/web/usePage' |
|
|
|
import { useI18n } from '@/hooks/web/useI18n' |
|
|
|
import { useI18n } from '@/hooks/web/useI18n' |
|
|
|
import { useMessage } from '@/hooks/web/useMessage' |
|
|
|
import { useMessage } from '@/hooks/web/useMessage' |
|
|
|
|
|
|
|
import { useModal } from '@/components/Modal' |
|
|
|
|
|
|
|
import BpmFormModal from './FormModal.vue' |
|
|
|
import { IconEnum } from '@/enums/appEnum' |
|
|
|
import { IconEnum } from '@/enums/appEnum' |
|
|
|
import { BasicTable, useTable, TableAction } from '@/components/Table' |
|
|
|
import { BasicTable, useTable, TableAction } from '@/components/Table' |
|
|
|
import { deleteForm, getFormPage } from '@/api/bpm/form' |
|
|
|
import { deleteForm, getFormPage } from '@/api/bpm/form' |
|
|
@ -39,8 +44,10 @@ import { columns, searchFormSchema } from './form.data' |
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'BpmForm' }) |
|
|
|
defineOptions({ name: 'BpmForm' }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const go = useGo() |
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
|
const { createMessage } = useMessage() |
|
|
|
const { createMessage } = useMessage() |
|
|
|
|
|
|
|
const [registerModal, { openModal }] = useModal() |
|
|
|
|
|
|
|
|
|
|
|
const [registerTable, { reload }] = useTable({ |
|
|
|
const [registerTable, { reload }] = useTable({ |
|
|
|
title: '流程表单列表', |
|
|
|
title: '流程表单列表', |
|
|
@ -50,7 +57,7 @@ const [registerTable, { reload }] = useTable({ |
|
|
|
useSearchForm: true, |
|
|
|
useSearchForm: true, |
|
|
|
showTableSetting: true, |
|
|
|
showTableSetting: true, |
|
|
|
actionColumn: { |
|
|
|
actionColumn: { |
|
|
|
width: 140, |
|
|
|
width: 180, |
|
|
|
title: t('common.action'), |
|
|
|
title: t('common.action'), |
|
|
|
dataIndex: 'action', |
|
|
|
dataIndex: 'action', |
|
|
|
fixed: 'right' |
|
|
|
fixed: 'right' |
|
|
@ -61,11 +68,17 @@ function handleCreate() { |
|
|
|
// openModal(true, { isUpdate: false }) |
|
|
|
// openModal(true, { isUpdate: false }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function handleEdit(record: Recordable) { |
|
|
|
function openForm(record: Recordable) { |
|
|
|
console.info(record) |
|
|
|
if (typeof record.id === 'number') { |
|
|
|
|
|
|
|
go({ name: 'BpmFormEditor', query: { id: record.id } }) |
|
|
|
|
|
|
|
} |
|
|
|
// openModal(true, { record, isUpdate: true }) |
|
|
|
// openModal(true, { record, isUpdate: true }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function openDetail(record: Recordable) { |
|
|
|
|
|
|
|
openModal(true, { record }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function handleDelete(record: Recordable) { |
|
|
|
async function handleDelete(record: Recordable) { |
|
|
|
await deleteForm(record.id) |
|
|
|
await deleteForm(record.id) |
|
|
|
createMessage.success(t('common.delSuccessText')) |
|
|
|
createMessage.success(t('common.delSuccessText')) |
|
|
|