添加数据日志,港口、品种、公司资质证书、LNG气源地调试
This commit is contained in:
@ -8,12 +8,10 @@ enum Api {
|
||||
Info = '/mdm/port/info',
|
||||
LngBPort = '/mdm/port',
|
||||
|
||||
|
||||
|
||||
Enable = '/mdm/port/enable',
|
||||
Disable = '/mdm/port/disable',
|
||||
|
||||
DataLog = '/mdm/port/datalog',
|
||||
DataLog = '/mdm/port/datalog'
|
||||
}
|
||||
|
||||
/**
|
||||
@ -23,11 +21,11 @@ export async function getLngBPortPage(params: LngBPortPageParams, mode: ErrorMes
|
||||
return defHttp.get<LngBPortPageResult>(
|
||||
{
|
||||
url: Api.Page,
|
||||
params,
|
||||
params
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -38,11 +36,11 @@ export async function getLngBPort(id: String, mode: ErrorMessageMode = 'modal')
|
||||
return defHttp.get<LngBPortPageModel>(
|
||||
{
|
||||
url: Api.Info,
|
||||
params: { id },
|
||||
params: { id }
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -53,11 +51,11 @@ export async function addLngBPort(lngBPort: Recordable, mode: ErrorMessageMode =
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort,
|
||||
params: lngBPort
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -68,11 +66,11 @@ export async function updateLngBPort(lngBPort: Recordable, mode: ErrorMessageMod
|
||||
return defHttp.put<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
params: lngBPort,
|
||||
params: lngBPort
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -83,15 +81,14 @@ export async function deleteLngBPort(ids: string[], mode: ErrorMessageMode = 'mo
|
||||
return defHttp.delete<boolean>(
|
||||
{
|
||||
url: Api.LngBPort,
|
||||
data: ids,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 启用数据LngBPort
|
||||
*/
|
||||
@ -99,11 +96,11 @@ export async function enableLngBPort(ids: string[], mode: ErrorMessageMode = 'mo
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Enable,
|
||||
data: ids,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
/**
|
||||
@ -113,16 +110,14 @@ export async function disableLngBPort(ids: string[], mode: ErrorMessageMode = 'm
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Disable,
|
||||
data: ids,
|
||||
data: ids
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
errorMessageMode: mode
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 获取数据日志LngBPort
|
||||
*/
|
||||
@ -130,10 +125,10 @@ export async function disableLngBPort(ids: string[], mode: ErrorMessageMode = 'm
|
||||
return defHttp.post<boolean>(
|
||||
{
|
||||
url: Api.Datalog,
|
||||
data: id,
|
||||
data: id
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
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,7 +1,6 @@
|
||||
<template>
|
||||
<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 v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -21,24 +20,23 @@
|
||||
</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,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode } 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 { 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 { setIndexFlowStatus } from '/@/utils/flow/index';
|
||||
import { getLngBCategory } from '/@/api/mdm/Category';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import CategoryModal from './components/CategoryModal.vue';
|
||||
@ -46,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/category/datalog');
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -61,12 +63,22 @@
|
||||
|
||||
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 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 selectedKeys = ref([]);
|
||||
|
||||
const tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
@ -76,55 +88,55 @@
|
||||
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 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
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId;
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName = '品种';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBCategoryPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
gutter: 16
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
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' },
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
@ -160,10 +172,13 @@
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
@ -182,7 +197,6 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/Category/' + record.id + '/updateForm',
|
||||
query: {
|
||||
@ -200,7 +214,7 @@
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -217,19 +231,18 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -245,11 +258,11 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function deleteList(ids) {
|
||||
@ -264,28 +277,28 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
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);
|
||||
@ -305,21 +318,20 @@
|
||||
}
|
||||
});
|
||||
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),
|
||||
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),
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
@ -341,7 +353,7 @@
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
|
||||
@ -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,13 +1,8 @@
|
||||
<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 { 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';
|
||||
@ -16,7 +11,7 @@
|
||||
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 { 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';
|
||||
@ -30,16 +25,17 @@
|
||||
const props = defineProps({
|
||||
fromPage: {
|
||||
type: Number,
|
||||
default: FromPageType.MENU,
|
||||
},
|
||||
default: FromPageType.MENU
|
||||
}
|
||||
});
|
||||
const systemFormRef = ref();
|
||||
const data: { formDataProps: FormDataProps } = reactive({
|
||||
formDataProps: {schemas:[]} as FormDataProps,
|
||||
formDataProps: { schemas: [] } as FormDataProps
|
||||
});
|
||||
const state = reactive({
|
||||
formModel: {},
|
||||
formModel: {}
|
||||
});
|
||||
console.log(data.formDataProps, 'datadata');
|
||||
|
||||
let customFormEventConfigs = [];
|
||||
|
||||
@ -50,12 +46,8 @@
|
||||
|
||||
if (props.fromPage == FromPageType.MENU) {
|
||||
setMenuPermission();
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
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方法
|
||||
@ -64,20 +56,13 @@
|
||||
} 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); //表单事件:加载表单
|
||||
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
emits('form-mounted', formProps);
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
});
|
||||
|
||||
|
||||
async function mergeCustomFormRenderConfig() {
|
||||
let cloneProps = cloneDeep(formProps);
|
||||
let fEventConfigs = cloneDeep(formEventConfigs);
|
||||
@ -125,9 +110,7 @@
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
// 辅助设置表单数据
|
||||
function setFieldsValue(record) {
|
||||
@ -151,9 +134,7 @@
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
@ -162,9 +143,7 @@
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBDocCp(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:提交表单
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
}
|
||||
@ -189,24 +168,30 @@
|
||||
}
|
||||
state.formModel = formModels;
|
||||
if (formModels[RowKey]) {
|
||||
setFormDataFromId(formModels[RowKey], false)
|
||||
setFormDataFromId(formModels[RowKey], false);
|
||||
} else {
|
||||
setFieldsValue(formModels)
|
||||
setFieldsValue(formModels);
|
||||
}
|
||||
} catch (error) {}
|
||||
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||
systemFormRef.value,
|
||||
formProps.schemas); //表单事件:加载表单
|
||||
await createFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:初始化表单
|
||||
await loadFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:加载表单
|
||||
}
|
||||
function getFormModel() {
|
||||
return systemFormRef.value.formModel
|
||||
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,
|
||||
|
||||
@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
|
||||
export const formConfig = {
|
||||
useCustomConfig: false,
|
||||
useCustomConfig: false
|
||||
};
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'fullName',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
component: 'Input'
|
||||
},
|
||||
{
|
||||
field: 'valid',
|
||||
@ -21,71 +21,9 @@ export const searchFormSchema: FormSchema[] = [
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
label: '编码',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
field: 'suSign',
|
||||
label: '供应商适用',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1676483934342787074' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'suNecSign',
|
||||
label: '供应商必须提供',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1676831752869834753' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cuSign',
|
||||
label: '客户适用',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1679007059387240450' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'cuNecSign',
|
||||
label: '供应商必须提供',
|
||||
component: 'XjrSelect',
|
||||
componentProps: {
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1679010661178691585' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
|
||||
getPopupContainer: () => document.body,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'note',
|
||||
label: '备注',
|
||||
component: 'Input',
|
||||
},
|
||||
getPopupContainer: () => document.body
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export const columns: BasicColumn[] = [
|
||||
@ -95,7 +33,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -104,7 +42,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -113,7 +51,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -122,7 +60,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -131,7 +69,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -140,7 +78,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -149,7 +87,7 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'select',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
sorter: true
|
||||
},
|
||||
|
||||
{
|
||||
@ -158,8 +96,8 @@ export const columns: BasicColumn[] = [
|
||||
componentType: 'textarea',
|
||||
align: 'left',
|
||||
|
||||
sorter: true,
|
||||
},
|
||||
sorter: true
|
||||
}
|
||||
];
|
||||
//表单事件
|
||||
export const formEventConfigs = {
|
||||
@ -170,7 +108,7 @@ export const formEventConfigs = {
|
||||
text: '开始节点',
|
||||
icon: '#icon-kaishi',
|
||||
bgcColor: '#D8E5FF',
|
||||
isUserDefined: false,
|
||||
isUserDefined: false
|
||||
},
|
||||
{
|
||||
color: '#F6AB01',
|
||||
@ -178,8 +116,8 @@ export const formEventConfigs = {
|
||||
text: '初始化表单',
|
||||
bgcColor: '#f9f5ea',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
1: [
|
||||
{
|
||||
@ -189,8 +127,8 @@ export const formEventConfigs = {
|
||||
detail: '(新增无此操作)',
|
||||
bgcColor: '#F8F2FC',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
2: [
|
||||
{
|
||||
@ -199,8 +137,8 @@ export const formEventConfigs = {
|
||||
text: '加载表单',
|
||||
bgcColor: '#FFF1F1',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
3: [
|
||||
{
|
||||
@ -209,8 +147,8 @@ export const formEventConfigs = {
|
||||
text: '提交表单',
|
||||
bgcColor: '#F5F4FF',
|
||||
isUserDefined: false,
|
||||
nodeInfo: { processEvent: [] },
|
||||
},
|
||||
nodeInfo: { processEvent: [] }
|
||||
}
|
||||
],
|
||||
4: [
|
||||
{
|
||||
@ -220,9 +158,9 @@ export const formEventConfigs = {
|
||||
icon: '#icon-jieshuzhiliao',
|
||||
bgcColor: '#FFD6D6',
|
||||
isLast: true,
|
||||
isUserDefined: false,
|
||||
},
|
||||
],
|
||||
isUserDefined: false
|
||||
}
|
||||
]
|
||||
};
|
||||
export const formProps: FormProps = {
|
||||
labelCol: { span: 3, offset: 0 },
|
||||
@ -261,8 +199,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'df68cc4350f542f7b3a8c7b55c39927c',
|
||||
@ -295,8 +233,8 @@ export const formProps: FormProps = {
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '4d924c23bfd84b22ac683240bae16929',
|
||||
@ -318,30 +256,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1676483934342787074' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1676483934342787074',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'f60587f7bb5c482ba5afca76fec9916a',
|
||||
@ -363,30 +301,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1676831752869834753' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1676831752869834753',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '5e8a28c2704c431cbf5f9cb9be19edc7',
|
||||
@ -408,30 +346,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1679007059387240450' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1679007059387240450',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'e2a327ac6aa249a5b5eb66199e263131',
|
||||
@ -453,30 +391,30 @@ export const formProps: FormProps = {
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
params: { itemId: '1679010661178691585' },
|
||||
params: { itemId: '1978056598125330433' },
|
||||
labelField: 'name',
|
||||
valueField: 'value',
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1679010661178691585',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
itemId: '1978056598125330433',
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '5b805c85cd284ddf88ff0025273f7939',
|
||||
@ -497,12 +435,12 @@ export const formProps: FormProps = {
|
||||
showLabel: true,
|
||||
showSearch: false,
|
||||
clearable: false,
|
||||
disabled: false,
|
||||
mode: 'multiple',
|
||||
disabled: true,
|
||||
mode: '',
|
||||
staticOptions: [
|
||||
{ key: 1, label: 'Option 1', value: 'Option 1' },
|
||||
{ key: 2, label: 'Option 2', value: 'Option 2' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' },
|
||||
{ key: 3, label: 'Option 3', value: 'Option 3' }
|
||||
],
|
||||
defaultSelect: null,
|
||||
datasourceType: 'dic',
|
||||
@ -512,7 +450,7 @@ export const formProps: FormProps = {
|
||||
apiConfig: {
|
||||
path: 'CodeGeneration/selection',
|
||||
method: 'GET',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7',
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
@ -520,8 +458,8 @@ export const formProps: FormProps = {
|
||||
events: {},
|
||||
isShow: true,
|
||||
itemId: '1978057078528327681',
|
||||
style: { width: '100%' },
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'd74fd39918f043e5992b2fbe119b5725',
|
||||
@ -551,14 +489,14 @@ export const formProps: FormProps = {
|
||||
isShow: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
style: { width: '100%' }
|
||||
}
|
||||
}
|
||||
],
|
||||
showActionButtonGroup: false,
|
||||
buttonLocation: 'center',
|
||||
actionColOptions: { span: 24 },
|
||||
showResetButton: false,
|
||||
showSubmitButton: false,
|
||||
hiddenComponent: [],
|
||||
hiddenComponent: []
|
||||
};
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<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 v-for="button in tableButtonConfig" :key="button.code">
|
||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||
@ -21,24 +20,23 @@
|
||||
</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,
|
||||
|
||||
} from 'vue';
|
||||
import { ref, computed, onMounted, onUnmounted, createVNode } 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 { 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 { setIndexFlowStatus } from '/@/utils/flow/index';
|
||||
import { getLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import DocCpModal from './components/DocCpModal.vue';
|
||||
@ -46,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/docCp/datalog');
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -61,12 +62,21 @@
|
||||
|
||||
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 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 tableButtonConfig = computed(() => {
|
||||
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||
@ -76,55 +86,58 @@
|
||||
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 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
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId;
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const formName = '公司资质证书';
|
||||
const [registerTable, { reload, }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
const [registerTable, { reload }] = useTable({
|
||||
title: '' || formName + '列表',
|
||||
api: getLngBDocCpPage,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
rowProps: {
|
||||
gutter: 16,
|
||||
gutter: 16
|
||||
},
|
||||
schemas: customSearchFormSchema,
|
||||
fieldMapToTime: [],
|
||||
showResetButton: false,
|
||||
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' },
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
},
|
||||
|
||||
setting: false
|
||||
}
|
||||
});
|
||||
|
||||
function selectionChange(selected) {
|
||||
selectedKeys.value = selected.keys;
|
||||
}
|
||||
function dbClickRow(record) {
|
||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||
if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
|
||||
return;
|
||||
}
|
||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||
@ -160,7 +173,6 @@
|
||||
}
|
||||
|
||||
function buttonClick(code) {
|
||||
|
||||
btnEvent[code]();
|
||||
}
|
||||
|
||||
@ -182,7 +194,6 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/DocCp/' + record.id + '/updateForm',
|
||||
query: {
|
||||
@ -200,7 +211,7 @@
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要启用的数据'),
|
||||
description: t('请选择需要启用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -217,19 +228,18 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('启用成功!'),
|
||||
description: t('启用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
function handleDisable() {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要禁用的数据'),
|
||||
description: t('请选择需要禁用的数据')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -245,13 +255,17 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('禁用成功!'),
|
||||
description: t('禁用成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
onCancel() {}
|
||||
});
|
||||
}
|
||||
function handleDatalog(record: Recordable) {
|
||||
modalVisible.value = true;
|
||||
logId.value = record.id;
|
||||
}
|
||||
function deleteList(ids) {
|
||||
Modal.confirm({
|
||||
title: '提示信息',
|
||||
@ -264,28 +278,24 @@
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('删除成功!'),
|
||||
description: t('删除成功!')
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel() {},
|
||||
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);
|
||||
@ -305,21 +315,20 @@
|
||||
}
|
||||
});
|
||||
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),
|
||||
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),
|
||||
onClick: btnEvent[button.code].bind(null, record)
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
@ -341,7 +350,7 @@
|
||||
let btns = await mergeButtons(buttons.value, formId);
|
||||
buttons.value = btns;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-table-selection-col) {
|
||||
|
||||
@ -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