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