|
@@ -1,53 +1,58 @@
|
|
|
<template>
|
|
|
- <a-card :bordered="false">
|
|
|
- <s-table
|
|
|
- ref="tableRef"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :alert="options.alert.show"
|
|
|
- bordered
|
|
|
- :row-key="(record) => record.id"
|
|
|
- :tool-config="toolConfig"
|
|
|
- :row-selection="options.rowSelection"
|
|
|
- >
|
|
|
- <template #operator class="table-operator">
|
|
|
- <a-space>
|
|
|
- <a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizProcessNodeAdd')">
|
|
|
- <template #icon><plus-outlined /></template>
|
|
|
- 新增
|
|
|
- </a-button>
|
|
|
- <xn-batch-button
|
|
|
- v-if="hasPerm('bizProcessNodeBatchDelete')"
|
|
|
- buttonName="批量删除"
|
|
|
- icon="DeleteOutlined"
|
|
|
- :selectedRowKeys="selectedRowKeys"
|
|
|
- @batchCallBack="deleteBatchBizProcessNode"
|
|
|
- />
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
- <template v-if="column.dataIndex === 'action'">
|
|
|
+ <a-drawer :title="title" :width="850" :open="visible" :destroy-on-close="true" @close="onClose">
|
|
|
+ <a-card :bordered="false" class="mb-2">
|
|
|
+ <s-table
|
|
|
+ ref="tableRef"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ bordered
|
|
|
+ :row-key="(record) => record.id"
|
|
|
+ >
|
|
|
+ <template #operator class="table-operator">
|
|
|
<a-space>
|
|
|
- <a @click="formRef.onOpen(record)" v-if="hasPerm('bizProcessNodeEdit')">编辑</a>
|
|
|
- <a-divider type="vertical" v-if="hasPerm(['bizProcessNodeEdit', 'bizProcessNodeDelete'], 'and')" />
|
|
|
- <a-popconfirm title="确定要删除吗?" @confirm="deleteBizProcessNode(record)">
|
|
|
- <a-button type="link" danger size="small" v-if="hasPerm('bizProcessNodeDelete')">删除</a-button>
|
|
|
- </a-popconfirm>
|
|
|
+ <a-button type="primary" @click="formRef.onOpen(null, processId)" v-if="hasPerm('bizProcessNodeAdd')">
|
|
|
+ <template #icon><plus-outlined /></template> 新增
|
|
|
+ </a-button>
|
|
|
</a-space>
|
|
|
</template>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </a-card>
|
|
|
+ <template #bodyCell="{ column, record, index }">
|
|
|
+ <template v-if="column.dataIndex === 'serial'">
|
|
|
+ {{ index + 1 }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'action'">
|
|
|
+ <a-space>
|
|
|
+ <a @click="formRef.onOpen(record, processId)" v-if="hasPerm('bizProcessNodeEdit')">编辑</a>
|
|
|
+ <a-divider type="vertical" v-if="hasPerm(['bizProcessNodeEdit', 'bizProcessNodeDelete'], 'and')" />
|
|
|
+ <a-button type="link" danger size="small" v-if="hasPerm('bizProcessNodeDelete')" @click="deleteConfig(record)">删除</a-button>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ </a-drawer>
|
|
|
+
|
|
|
<Form ref="formRef" @successful="tableRef.refresh()" />
|
|
|
</template>
|
|
|
|
|
|
-<script setup name="bizprocessnode">
|
|
|
+<script setup name="bizsupplieraccount">
|
|
|
import { cloneDeep } from 'lodash-es'
|
|
|
- import Form from './form.vue'
|
|
|
+ import Form from './nodeForm.vue'
|
|
|
import bizProcessNodeApi from '@/api/biz/bizProcessNodeApi'
|
|
|
+ import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
|
|
|
+ import {Modal} from 'ant-design-vue';
|
|
|
+ import {createVNode} from 'vue';
|
|
|
+
|
|
|
+ const submitLoading = ref(false)
|
|
|
+ const toolConfig = { refresh: true, height: false, columnSetting: false, striped: false }
|
|
|
+ // 默认是关闭状态
|
|
|
+ const visible = ref(false)
|
|
|
+ const searchFormState = ref({})
|
|
|
const tableRef = ref()
|
|
|
const formRef = ref()
|
|
|
- const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
|
|
+ const recordData = ref()
|
|
|
+ const title = ref()
|
|
|
+ const processId = ref()
|
|
|
+
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '序号',
|
|
@@ -57,10 +62,12 @@
|
|
|
},
|
|
|
{
|
|
|
title: '节点名称',
|
|
|
- dataIndex: 'nodeName'
|
|
|
+ dataIndex: 'nodeName',
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
{
|
|
|
title: '创建时间',
|
|
|
+ width: 180,
|
|
|
dataIndex: 'createTime',
|
|
|
align: 'center'
|
|
|
},
|
|
@@ -74,47 +81,53 @@
|
|
|
width: 150
|
|
|
})
|
|
|
}
|
|
|
- const selectedRowKeys = ref([])
|
|
|
- // 列表选择配置
|
|
|
- const options = {
|
|
|
- // columns数字类型字段加入 needTotal: true 可以勾选自动算账
|
|
|
- alert: {
|
|
|
- show: true,
|
|
|
- clear: () => {
|
|
|
- selectedRowKeys.value = ref([])
|
|
|
- }
|
|
|
- },
|
|
|
- rowSelection: {
|
|
|
- onChange: (selectedRowKey, selectedRows) => {
|
|
|
- selectedRowKeys.value = selectedRowKey
|
|
|
- }
|
|
|
+ // 打开抽屉
|
|
|
+ const onOpen = (record) => {
|
|
|
+ recordData.value = record
|
|
|
+ title.value = "【" + record.processName + "】-节点管理"
|
|
|
+ searchFormState.value = {
|
|
|
+ processId: record.id
|
|
|
}
|
|
|
+ processId.value = record.id
|
|
|
+ visible.value = true
|
|
|
}
|
|
|
const loadData = (parameter) => {
|
|
|
- return bizProcessNodeApi.bizProcessNodePage(parameter).then((data) => {
|
|
|
+ return bizProcessNodeApi.bizProcessNodePage(Object.assign(parameter, searchFormState.value)).then((data) => {
|
|
|
return data
|
|
|
})
|
|
|
}
|
|
|
- // 重置
|
|
|
- const reset = () => {
|
|
|
- searchFormRef.value.resetFields()
|
|
|
- tableRef.value.refresh(true)
|
|
|
+ // 关闭抽屉
|
|
|
+ const onClose = () => {
|
|
|
+ visible.value = false
|
|
|
}
|
|
|
// 删除
|
|
|
- const deleteBizProcessNode = (record) => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- id: record.id
|
|
|
- }
|
|
|
- ]
|
|
|
- bizProcessNodeApi.bizProcessNodeDelete(params).then(() => {
|
|
|
- tableRef.value.refresh(true)
|
|
|
- })
|
|
|
- }
|
|
|
- // 批量删除
|
|
|
- const deleteBatchBizProcessNode = (params) => {
|
|
|
- bizProcessNodeApi.bizProcessNodeDelete(params).then(() => {
|
|
|
- tableRef.value.clearRefreshSelected()
|
|
|
+ const deleteConfig = (record) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确定删除该数据吗?',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '',
|
|
|
+ onOk() {
|
|
|
+ submitLoading.value = true
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ id: record.id
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ bizProcessNodeApi
|
|
|
+ .bizProcessNodeDelete(params)
|
|
|
+ .then(() => {
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ submitLoading.value = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {}
|
|
|
})
|
|
|
}
|
|
|
+ // 调用这个函数将子组件的一些数据和方法暴露出去
|
|
|
+ defineExpose({
|
|
|
+ onOpen
|
|
|
+ })
|
|
|
</script>
|