添加数据日志,港口、品种、公司资质证书、LNG气源地调试
This commit is contained in:
@ -3,137 +3,132 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/mdm/port/page',
|
||||
List = '/mdm/port/list',
|
||||
Info = '/mdm/port/info',
|
||||
LngBPort = '/mdm/port',
|
||||
|
||||
|
||||
|
||||
Enable = '/mdm/port/enable',
|
||||
Disable= '/mdm/port/disable',
|
||||
|
||||
DataLog = '/mdm/port/datalog',
|
||||
Page = '/mdm/port/page',
|
||||
List = '/mdm/port/list',
|
||||
Info = '/mdm/port/info',
|
||||
LngBPort = '/mdm/port',
|
||||
|
||||
Enable = '/mdm/port/enable',
|
||||
Disable = '/mdm/port/disable',
|
||||
|
||||
DataLog = '/mdm/port/datalog'
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询LngBPort分页列表
|
||||
*/
|
||||
export async function getLngBPortPage(params: LngBPortPageParams, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngBPortPageResult>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.get<LngBPortPageResult>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取LngBPort信息
|
||||
*/
|
||||
export async function getLngBPort(id: String, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<LngBPortPageModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.get<LngBPortPageModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id }
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增LngBPort
|
||||
*/
|
||||
export async function addLngBPort(lngBPort: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 更新LngBPort
|
||||
*/
|
||||
export async function updateLngBPort(lngBPort: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.put<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.put<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除LngBPort(批量删除)
|
||||
*/
|
||||
export async function deleteLngBPort(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.delete<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.delete<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 启用数据LngBPort
|
||||
*/
|
||||
export async function enableLngBPort(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Enable,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Enable,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @description: 作废数据LngBPort
|
||||
*/
|
||||
export async function disableLngBPort(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Disable,
|
||||
data: ids,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 获取数据日志LngBPort
|
||||
*/
|
||||
export async function getDataLogLngBPort(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Datalog,
|
||||
data: id,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
{
|
||||
url: Api.Disable,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取数据日志LngBPort
|
||||
*/
|
||||
export async function getDataLogLngBPort(id: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Datalog,
|
||||
data: id
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -23,42 +23,6 @@ export const searchFormSchema: FormSchema[] = [
|
||||
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
label: '编码',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'unitCode',
|
||||
label: '数量单位',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1980562721538633730' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'coefficient',
|
||||
label: '车/数量单位',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'sort',
|
||||
label: '显示顺序',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@ -1,356 +1,368 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<CategoryModal @register="registerModal" @success="handleSuccess" />
|
||||
</PageWrapper>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow" @selection-change="selectionChange">
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<CategoryModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
|
||||
|
||||
} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBCategoryPage, deleteLngBCategory} from '/@/api/mdm/Category';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngBCategory } from '/@/api/mdm/Category';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import CategoryModal from './components/CategoryModal.vue';
|
||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBCategoryPage, deleteLngBCategory, disableLngBCategory, enableLngBCategory } from '/@/api/mdm/Category';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index';
|
||||
import { getLngBCategory } from '/@/api/mdm/Category';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import CategoryModal from './components/CategoryModal.vue';
|
||||
import { formConfig, searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/category/datalog');
|
||||
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums =ref(filterColumns);
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
return filterButtonAuth(buttons.value);
|
||||
})
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
|
||||
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums = ref(filterColumns);
|
||||
const customSearchFormSchema = ref(searchFormSchema);
|
||||
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='品种';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngBCategoryPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Category/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Category/0/createForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Category/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([
|
||||
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
|
||||
{ isUse: true, name: '编辑', code: 'edit', icon: 'ant-design:form-outlined', isDefault: true },
|
||||
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:form-outlined', isDefault: true, type: 'primary' },
|
||||
{ isUse: true, name: '作废', code: 'disable', icon: 'ant-design:stop-outlined', isDefault: true, type: 'dashed' },
|
||||
{ isUse: true, name: '刷新', code: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
|
||||
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
|
||||
{ isUse: true, name: '数据日志', code: 'datalog', icon: 'ant-design:profile-outlined', isDefault: true },
|
||||
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
|
||||
]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit', 'datalog', 'copyData', 'delete', 'startwork', 'flowRecord']);
|
||||
const buttonConfigs = computed(() => {
|
||||
return filterButtonAuth(buttons.value);
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
function handleEnable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
const selectedKeys = ref([]);
|
||||
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认启用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
enableLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认禁用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
disableLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认删除?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
deleteLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
|
||||
dbClickRow(record);
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
|
||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||
mergeCustomListRenderConfig();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
|
||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
||||
if (!record.workflowData?.processId) {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
};
|
||||
} else {
|
||||
if (button.code === 'view') {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
};
|
||||
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, refresh: handleRefresh, view: handleView, datalog: handleDatalog, delete: handleDelete };
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId;
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName = '品种';
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBCategoryPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
rowSelection: {
|
||||
type: 'checkbox'
|
||||
},
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return {};
|
||||
router.push({
|
||||
path: '/form/Category/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/Category/0/createForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
router.push({
|
||||
path: '/form/Category/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/Category',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
function handleEnable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认启用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
enableLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认禁用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
disableLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认删除?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
deleteLngBCategory(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
dbClickRow(record);
|
||||
}
|
||||
onMounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
|
||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||
mergeCustomListRenderConfig();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable): ActionItem[] {
|
||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
||||
if (!record.workflowData?.processId) {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
if (button.code === 'view') {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig() {
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId = currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols = await mergeColumns(customConfigColums.value, formId);
|
||||
customConfigColums.value = cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
|
||||
customSearchFormSchema.value = sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
}
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig(){
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId=currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||
customConfigColums.value=cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||
customSearchFormSchema.value=sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns= await mergeButtons(buttons.value,formId);
|
||||
buttons.value=btns;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
}
|
||||
.hide{
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show {
|
||||
display: flex;
|
||||
}
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
</template>
|
||||
</BasicTable>
|
||||
<CurrencyModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -43,7 +44,10 @@
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/currency/datalog');
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -293,7 +297,10 @@
|
||||
function handleView(record: Recordable) {
|
||||
dbClickRow(record);
|
||||
}
|
||||
function handleDatalog() {}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
|
||||
@ -1,224 +1,209 @@
|
||||
<template>
|
||||
<SimpleForm
|
||||
ref="systemFormRef"
|
||||
:formProps="data.formDataProps"
|
||||
:formModel="{}"
|
||||
:isWorkFlow="props.fromPage!=FromPageType.MENU"
|
||||
/>
|
||||
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
|
||||
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBDocCp, getLngBDocCp, updateLngBDocCp, deleteLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
|
||||
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
import { reactive, ref, onBeforeMount, onMounted, watch } from 'vue';
|
||||
import { formProps, formEventConfigs, formConfig } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBDocCp, getLngBDocCp, updateLngBDocCp, deleteLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { FromPageType } from '/@/enums/workflowEnum';
|
||||
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent } from '/@/hooks/web/useFormEvent';
|
||||
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: {schemas:[]} as FormDataProps,
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
});
|
||||
|
||||
let customFormEventConfigs=[];
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
if (props.fromPage == FromPageType.MENU) {
|
||||
setMenuPermission();
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
} else if (props.fromPage == FromPageType.FLOW) {
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
|
||||
} else if (props.fromPage == FromPageType.PREVIEW) {
|
||||
// 预览 无需权限,表单事件也无需执行
|
||||
} else if (props.fromPage == FromPageType.DESKTOP) {
|
||||
// 桌面设计 表单事件需要执行
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {
|
||||
const { filterFormSchemaAuth } = usePermission();
|
||||
const { mergeFormSchemas, mergeFormEventConfigs } = useFormConfig();
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
const RowKey = 'id';
|
||||
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU
|
||||
}
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: { schemas: [] } as FormDataProps
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {}
|
||||
});
|
||||
console.log(data.formDataProps, 'datadata');
|
||||
|
||||
let customFormEventConfigs = [];
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
if (props.fromPage == FromPageType.MENU) {
|
||||
setMenuPermission();
|
||||
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
} else if (props.fromPage == FromPageType.FLOW) {
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
|
||||
} else if (props.fromPage == FromPageType.PREVIEW) {
|
||||
// 预览 无需权限,表单事件也无需执行
|
||||
} else if (props.fromPage == FromPageType.DESKTOP) {
|
||||
// 桌面设计 表单事件需要执行
|
||||
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {}
|
||||
});
|
||||
|
||||
async function mergeCustomFormRenderConfig() {
|
||||
let cloneProps = cloneDeep(formProps);
|
||||
let fEventConfigs = cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
if (props.fromPage !== FromPageType.FLOW) {
|
||||
let formPath = currentRoute.value.query.formPath;
|
||||
//1.合并字段配置
|
||||
cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formPath: formPath });
|
||||
//2.合并表单事件配置
|
||||
fEventConfigs = await mergeFormEventConfigs({ formEventConfigs: fEventConfigs, formPath: formPath });
|
||||
}
|
||||
}
|
||||
data.formDataProps = cloneProps;
|
||||
customFormEventConfigs = fEventConfigs;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
async function mergeCustomFormRenderConfig() {
|
||||
let cloneProps=cloneDeep(formProps);
|
||||
let fEventConfigs=cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
if(props.fromPage !== FromPageType.FLOW){
|
||||
let formPath=currentRoute.value.query.formPath;
|
||||
//1.合并字段配置
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath});
|
||||
//2.合并表单事件配置
|
||||
fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath});
|
||||
}
|
||||
}
|
||||
data.formDataProps=cloneProps;
|
||||
customFormEventConfigs=fEventConfigs;
|
||||
}
|
||||
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
function setMenuPermission() {
|
||||
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
|
||||
}
|
||||
|
||||
// 校验form 通过返回表单数据
|
||||
async function validate() {
|
||||
let values = [];
|
||||
try {
|
||||
values = await systemFormRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (data.formDataProps.hiddenComponent?.length) {
|
||||
data.formDataProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||
function setMenuPermission() {
|
||||
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getLngBDocCp(rowId);
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
}
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
||||
// 校验form 通过返回表单数据
|
||||
async function validate() {
|
||||
let values = [];
|
||||
try {
|
||||
values = await systemFormRef.value?.validate();
|
||||
//添加隐藏组件
|
||||
if (data.formDataProps.hiddenComponent?.length) {
|
||||
data.formDataProps.hiddenComponent.forEach((component) => {
|
||||
values[component.bindField] = component.value;
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
systemFormRef.value.setFieldsValue(record);
|
||||
}
|
||||
// 重置表单数据
|
||||
async function resetFields() {
|
||||
await systemFormRef.value.resetFields();
|
||||
}
|
||||
// 设置表单数据全部为Disabled 【查看】
|
||||
async function setDisabledForm(isDisabled) {
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas),isDisabled);
|
||||
}
|
||||
// 获取行键值
|
||||
function getRowKey() {
|
||||
return RowKey;
|
||||
}
|
||||
// 更新api表单数据
|
||||
async function update({ values, rowId }) {
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 新增api表单数据
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
const cloneProps=cloneDeep(formProps);
|
||||
customFormEventConfigs=cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
const parts = obj.formConfigKey.split('_');
|
||||
const formId=parts[1];
|
||||
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
|
||||
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
|
||||
}
|
||||
|
||||
let flowData = changeWorkFlowForm(cloneProps, obj);
|
||||
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
|
||||
data.formDataProps = buildOptionJson;
|
||||
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
|
||||
if (isViewProcess) {
|
||||
setDisabledForm(); //查看
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if(formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false)
|
||||
} else {
|
||||
setFieldsValue(formModels)
|
||||
}
|
||||
} catch (error) {}
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
function getFormModel() {
|
||||
return systemFormRef.value.formModel
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
return await deleteLngBDocCp([id]);
|
||||
}
|
||||
defineExpose({
|
||||
setFieldsValue,
|
||||
resetFields,
|
||||
validate,
|
||||
add,
|
||||
update,
|
||||
setFormDataFromId,
|
||||
setDisabledForm,
|
||||
setMenuPermission,
|
||||
setWorkFlowForm,
|
||||
getRowKey,
|
||||
getFormModel,
|
||||
handleDelete
|
||||
});
|
||||
</script>
|
||||
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getLngBDocCp(rowId);
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
}
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
systemFormRef.value.setFieldsValue(record);
|
||||
}
|
||||
// 重置表单数据
|
||||
async function resetFields() {
|
||||
await systemFormRef.value.resetFields();
|
||||
}
|
||||
// 设置表单数据全部为Disabled 【查看】
|
||||
async function setDisabledForm(isDisabled) {
|
||||
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas), isDisabled);
|
||||
}
|
||||
// 获取行键值
|
||||
function getRowKey() {
|
||||
return RowKey;
|
||||
}
|
||||
// 更新api表单数据
|
||||
async function update({ values, rowId }) {
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 新增api表单数据
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||
try {
|
||||
const cloneProps = cloneDeep(formProps);
|
||||
customFormEventConfigs = cloneDeep(formEventConfigs);
|
||||
if (formConfig.useCustomConfig) {
|
||||
const parts = obj.formConfigKey.split('_');
|
||||
const formId = parts[1];
|
||||
cloneProps.schemas = await mergeFormSchemas({ formSchema: cloneProps.schemas!, formId: formId });
|
||||
customFormEventConfigs = await mergeFormEventConfigs({ formEventConfigs: customFormEventConfigs, formId: formId });
|
||||
}
|
||||
|
||||
let flowData = changeWorkFlowForm(cloneProps, obj);
|
||||
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
|
||||
data.formDataProps = buildOptionJson;
|
||||
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
|
||||
if (isViewProcess) {
|
||||
setDisabledForm(); //查看
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if (formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false);
|
||||
} else {
|
||||
setFieldsValue(formModels);
|
||||
}
|
||||
} catch (error) {}
|
||||
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
function getFormModel() {
|
||||
return systemFormRef.value.formModel;
|
||||
}
|
||||
async function handleDelete(id) {
|
||||
return await deleteLngBDocCp([id]);
|
||||
}
|
||||
// watch(
|
||||
// () => systemFormRef.value.suSign,
|
||||
// (val) => {
|
||||
// console.log(val);
|
||||
// },
|
||||
// {
|
||||
// immediate: true,
|
||||
// deep: true
|
||||
// }
|
||||
// );
|
||||
defineExpose({
|
||||
setFieldsValue,
|
||||
resetFields,
|
||||
validate,
|
||||
add,
|
||||
update,
|
||||
setFormDataFromId,
|
||||
setDisabledForm,
|
||||
setMenuPermission,
|
||||
setWorkFlowForm,
|
||||
getRowKey,
|
||||
getFormModel,
|
||||
handleDelete
|
||||
});
|
||||
</script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,356 +1,365 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DocCpModal @register="registerModal" @success="handleSuccess" />
|
||||
</PageWrapper>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow" @selection-change="selectionChange">
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
<a-button v-else :type="button.type">
|
||||
<template #icon><Icon :icon="button.icon" /></template>
|
||||
{{ button.name }}
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<DocCpModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode } from 'vue';
|
||||
|
||||
} from 'vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBDocCpPage, deleteLngBDocCp} from '/@/api/mdm/DocCp';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import DocCpModal from './components/DocCpModal.vue';
|
||||
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBDocCpPage, deleteLngBDocCp, disableLngBDocCp, enableLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index';
|
||||
import { getLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import DocCpModal from './components/DocCpModal.vue';
|
||||
import { formConfig, searchFormSchema, columns } from './components/config';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/docCp/datalog');
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||
const { mergeColumns, mergeSearchFormSchema, mergeButtons } = useFormConfig();
|
||||
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums =ref(filterColumns);
|
||||
const customSearchFormSchema =ref(searchFormSchema);
|
||||
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true}]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||
const buttonConfigs = computed(()=>{
|
||||
return filterButtonAuth(buttons.value);
|
||||
})
|
||||
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||
const customConfigColums = ref(filterColumns);
|
||||
const customSearchFormSchema = ref(searchFormSchema);
|
||||
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = {add : handleAdd,edit : handleEdit,enable : handleEnable,disable : handleDisable,refresh : handleRefresh,view : handleView,datalog : handleDatalog,delete : handleDelete,}
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName='公司资质证书';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngBDocCpPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/DocCp/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/DocCp/0/createForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/DocCp/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
const tableRef = ref();
|
||||
//所有按钮
|
||||
const buttons = ref([
|
||||
{ isUse: true, name: '新增', code: 'add', icon: 'ant-design:plus-outlined', isDefault: true, type: 'primary' },
|
||||
{ isUse: true, name: '编辑', code: 'edit', icon: 'ant-design:form-outlined', isDefault: true },
|
||||
{ isUse: true, name: '启用', code: 'enable', icon: 'ant-design:form-outlined', isDefault: true, type: 'primary' },
|
||||
{ isUse: true, name: '作废', code: 'disable', icon: 'ant-design:stop-outlined', isDefault: true, type: 'dashed' },
|
||||
{ isUse: true, name: '刷新', code: 'refresh', icon: 'ant-design:reload-outlined', isDefault: true },
|
||||
{ isUse: true, name: '查看', code: 'view', icon: 'ant-design:eye-outlined', isDefault: true },
|
||||
{ isUse: true, name: '数据日志', code: 'datalog', icon: 'ant-design:profile-outlined', isDefault: true },
|
||||
{ isUse: true, name: '删除', code: 'delete', icon: 'ant-design:delete-outlined', isDefault: true }
|
||||
]);
|
||||
//展示在列表内的按钮
|
||||
const actionButtons = ref<string[]>(['view', 'edit', 'datalog', 'copyData', 'delete', 'startwork', 'flowRecord']);
|
||||
const buttonConfigs = computed(() => {
|
||||
return filterButtonAuth(buttons.value);
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
function handleEnable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认启用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
enableLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认禁用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
disableLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认删除?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
deleteLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
});
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
|
||||
dbClickRow(record);
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||
|
||||
const actionButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||
});
|
||||
|
||||
const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, refresh: handleRefresh, view: handleView, datalog: handleDatalog, delete: handleDelete };
|
||||
const selectedKeys = ref([]);
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId;
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName = '公司资质证书';
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBDocCpPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableRef.value.setToolBarWidth();
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
rowSelection: {
|
||||
type: 'checkbox'
|
||||
},
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
|
||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||
mergeCustomListRenderConfig();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
|
||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
||||
if (!record.workflowData?.processId) {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
};
|
||||
} else {
|
||||
if (button.code === 'view') {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
};
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
if (taskIds && taskIds.length) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
query: {
|
||||
taskId: taskIds[0],
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else if (schemaId && !taskIds && processId) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return {};
|
||||
router.push({
|
||||
path: '/form/DocCp/' + record.id + '/viewForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/DocCp/0/createForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
router.push({
|
||||
path: '/form/DocCp/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'mdm/DocCp',
|
||||
formName: formName,
|
||||
formId: currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
}
|
||||
|
||||
function handleEnable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认启用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
enableLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = selectedKeys.value;
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认禁用?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
disableLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否确认删除?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
deleteLngBDocCp(ids).then((_) => {
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleRefresh() {
|
||||
reload();
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
dbClickRow(record);
|
||||
}
|
||||
onMounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
|
||||
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||
mergeCustomListRenderConfig();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
} else {
|
||||
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||
}
|
||||
});
|
||||
function getActions(record: Recordable): ActionItem[] {
|
||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
||||
if (!record.workflowData?.processId) {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
color: button.code === 'delete' ? 'error' : undefined,
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
if (button.code === 'view') {
|
||||
return {
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig() {
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId = currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols = await mergeColumns(customConfigColums.value, formId);
|
||||
customConfigColums.value = cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema = await mergeSearchFormSchema(customSearchFormSchema.value, formId);
|
||||
customSearchFormSchema.value = sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
}
|
||||
});
|
||||
return actionsList;
|
||||
}
|
||||
async function mergeCustomListRenderConfig(){
|
||||
if (formConfig.useCustomConfig) {
|
||||
let formId=currentRoute.value.meta.formId;
|
||||
//1.合并展示字段配置
|
||||
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||
customConfigColums.value=cols;
|
||||
//2.合并搜索字段配置
|
||||
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||
customSearchFormSchema.value=sFormSchema;
|
||||
//3.合并按钮配置
|
||||
let btns= await mergeButtons(buttons.value,formId);
|
||||
buttons.value=btns;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show{
|
||||
display: flex;
|
||||
}
|
||||
.hide{
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
:deep(.ant-table-selection-col) {
|
||||
width: 50px;
|
||||
}
|
||||
.show {
|
||||
display: flex;
|
||||
}
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow" @selection-change="selectionChange">
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -20,6 +20,7 @@
|
||||
</template>
|
||||
</BasicTable>
|
||||
<LngStationModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -28,7 +29,7 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBStationLngPage, deleteLngBStationLng } from '/@/api/mdm/LNGStation';
|
||||
import { getLngBStationLngPage, deleteLngBStationLng, enableLngBStationLng, disableLngBStationLng } from '/@/api/mdm/LNGStation';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -43,6 +44,10 @@
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/lNGStation/datalog');
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -83,6 +88,7 @@
|
||||
});
|
||||
|
||||
const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, refresh: handleRefresh, view: handleView, datalog: handleDatalog, delete: handleDelete };
|
||||
const selectedKeys = ref([]);
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -113,7 +119,9 @@
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
||||
rowSelection: {
|
||||
type: 'checkbox'
|
||||
},
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
@ -163,9 +171,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
btnEvent[code]();
|
||||
}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
@ -253,7 +269,6 @@
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDatalog() {}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onBeforeMount, onMounted } from 'vue';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { formProps, formEventConfigs, formConfig } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBPort, getLngBPort, updateLngBPort, deleteLngBPort } from '/@/api/mdm/Port';
|
||||
@ -110,14 +110,17 @@
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getLngBPort(rowId);
|
||||
const res = { ...record, regionCode: (record.regionCode || '').split(',') };
|
||||
if (skipUpdate) {
|
||||
return record;
|
||||
return res;
|
||||
}
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
setFieldsValue(res);
|
||||
state.formModel = res;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {}
|
||||
return res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
@ -140,7 +143,7 @@
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBPort(values);
|
||||
let saveVal = await updateLngBPort({ ...values, regionCode: (values.regionCode || []).join(',') });
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
@ -149,7 +152,8 @@
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBPort(values);
|
||||
let saveVal = await addLngBPort({ ...values, regionCode: (values.regionCode || []).join(',') });
|
||||
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-db-click="dbClickRow" @selection-change="selectionChange">
|
||||
<template #toolbar>
|
||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -20,6 +20,7 @@
|
||||
</template>
|
||||
</BasicTable>
|
||||
<PortModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -28,7 +29,7 @@
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||
import { getLngBPortPage, deleteLngBPort } from '/@/api/mdm/Port';
|
||||
import { getLngBPortPage, deleteLngBPort, enableLngBPort, disableLngBPort } from '/@/api/mdm/Port';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -43,7 +44,10 @@
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/port/datalog');
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -83,6 +87,7 @@
|
||||
});
|
||||
|
||||
const btnEvent = { add: handleAdd, edit: handleEdit, enable: handleEnable, disable: handleDisable, refresh: handleRefresh, view: handleView, datalog: handleDatalog, delete: handleDelete };
|
||||
const selectedKeys = ref([]);
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
@ -113,7 +118,9 @@
|
||||
},
|
||||
useSearchForm: true,
|
||||
showTableSetting: true,
|
||||
|
||||
rowSelection: {
|
||||
type: 'checkbox'
|
||||
},
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 160,
|
||||
@ -253,6 +260,9 @@
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
@ -278,7 +288,10 @@
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
}
|
||||
function handleDatalog() {}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
|
||||
function handleView(record: Recordable) {
|
||||
dbClickRow(record);
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
</template>
|
||||
</BasicTable>
|
||||
<PriceTermsModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible" />
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
@ -43,7 +44,10 @@
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
import { DataLog } from '/@/components/pcitc';
|
||||
const modalVisible = ref(false);
|
||||
const logId = ref('');
|
||||
const logPath = ref('/mdm/priceTerms/datalog');
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -289,7 +293,10 @@
|
||||
function handleView(record: Recordable) {
|
||||
dbClickRow(record);
|
||||
}
|
||||
function handleDatalog() {}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (schemaIdComputedRef.value) {
|
||||
|
||||
Reference in New Issue
Block a user