|
|
|
@ -5,6 +5,16 @@
|
|
|
|
|
<a-button type="primary" v-auth="['bpm:model:create']" :preIcon="IconEnum.ADD" @click="handleCreate"> |
|
|
|
|
{{ t('action.create') }} |
|
|
|
|
</a-button> |
|
|
|
|
<BasicUpload |
|
|
|
|
:maxSize="20" |
|
|
|
|
:maxNumber="1" |
|
|
|
|
:emptyHidePreview="true" |
|
|
|
|
@change="handleChange" |
|
|
|
|
:uploadParams="uploadParams" |
|
|
|
|
:api="importModel" |
|
|
|
|
class="my-5" |
|
|
|
|
:accept="['.bpmn', '.xml']" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
@ -31,14 +41,17 @@
|
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { ref } from 'vue' |
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n' |
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage' |
|
|
|
|
import { useModal } from '@/components/Modal' |
|
|
|
|
import ModelModal from './ModelModal.vue' |
|
|
|
|
import { IconEnum } from '@/enums/appEnum' |
|
|
|
|
import { BasicUpload } from '@/components/Upload' |
|
|
|
|
import { BasicTable, useTable, TableAction } from '@/components/Table' |
|
|
|
|
import { deleteModel, getModelPage } from '@/api/bpm/model' |
|
|
|
|
import { deleteModel, getModelPage, importModel } from '@/api/bpm/model' |
|
|
|
|
import { columns, searchFormSchema } from './model.data' |
|
|
|
|
import { getAccessToken, getTenantId } from '@/utils/auth' |
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'BpmModel' }) |
|
|
|
|
|
|
|
|
@ -46,6 +59,11 @@ const { t } = useI18n()
|
|
|
|
|
const { createMessage } = useMessage() |
|
|
|
|
const [registerModal, { openModal }] = useModal() |
|
|
|
|
|
|
|
|
|
const uploadParams = ref({ |
|
|
|
|
Authorization: 'Bearer ' + getAccessToken(), |
|
|
|
|
'tenant-id': getTenantId() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const [registerTable, { reload }] = useTable({ |
|
|
|
|
title: '流程模型图列表', |
|
|
|
|
api: getModelPage, |
|
|
|
@ -69,6 +87,10 @@ function handleEdit(record: Recordable) {
|
|
|
|
|
openModal(true, { record, isUpdate: true }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleChange() { |
|
|
|
|
reload() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleDelete(record: Recordable) { |
|
|
|
|
await deleteModel(record.id) |
|
|
|
|
createMessage.success(t('common.delSuccessText')) |
|
|
|
|