添加数据日志,港口、品种、公司资质证书、LNG气源地调试

This commit is contained in:
2025-10-27 16:30:22 +08:00
parent 231ba89c53
commit 1e4c82f206
11 changed files with 1518 additions and 1569 deletions

View File

@ -8,12 +8,10 @@ enum Api {
Info = '/mdm/port/info', Info = '/mdm/port/info',
LngBPort = '/mdm/port', LngBPort = '/mdm/port',
Enable = '/mdm/port/enable', Enable = '/mdm/port/enable',
Disable = '/mdm/port/disable', 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>( return defHttp.get<LngBPortPageResult>(
{ {
url: Api.Page, 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>( return defHttp.get<LngBPortPageModel>(
{ {
url: Api.Info, 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>( return defHttp.post<boolean>(
{ {
url: Api.LngBPort, 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>( return defHttp.put<boolean>(
{ {
url: Api.LngBPort, 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>( return defHttp.delete<boolean>(
{ {
url: Api.LngBPort, url: Api.LngBPort,
data: ids, data: ids
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
/** /**
* @description: 启用数据LngBPort * @description: 启用数据LngBPort
*/ */
@ -99,11 +96,11 @@ export async function enableLngBPort(ids: string[], mode: ErrorMessageMode = 'mo
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.Enable, 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>( return defHttp.post<boolean>(
{ {
url: Api.Disable, url: Api.Disable,
data: ids, data: ids
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }
/** /**
* @description: 获取数据日志LngBPort * @description: 获取数据日志LngBPort
*/ */
@ -130,10 +125,10 @@ export async function disableLngBPort(ids: string[], mode: ErrorMessageMode = 'm
return defHttp.post<boolean>( return defHttp.post<boolean>(
{ {
url: Api.Datalog, url: Api.Datalog,
data: id, data: id
}, },
{ {
errorMessageMode: mode, errorMessageMode: mode
}, }
); );
} }

View File

@ -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'
} }
]; ];

View File

@ -1,7 +1,6 @@
<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)">
@ -21,24 +20,23 @@
</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 { 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 { getLngBCategoryPage, deleteLngBCategory} from '/@/api/mdm/Category'; import { getLngBCategoryPage, deleteLngBCategory, disableLngBCategory, enableLngBCategory } from '/@/api/mdm/Category';
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';
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 { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index' import { setIndexFlowStatus } from '/@/utils/flow/index';
import { getLngBCategory } from '/@/api/mdm/Category'; import { getLngBCategory } from '/@/api/mdm/Category';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import CategoryModal from './components/CategoryModal.vue'; import CategoryModal from './components/CategoryModal.vue';
@ -46,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/category/datalog');
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -61,12 +63,22 @@
const tableRef = ref(); 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 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 selectedKeys = ref([]);
const tableButtonConfig = computed(() => { const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -76,55 +88,55 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); 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 { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
const formIdComputedRef = ref(); const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId formIdComputedRef.value = currentRoute.value.meta.formId;
const schemaIdComputedRef = ref(); const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const formName = '品种'; const formName = '品种';
const [registerTable, { reload, }] = useTable({ const [registerTable, { reload }] = useTable({
title: '' || (formName + '列表'), title: '' || formName + '列表',
api: getLngBCategoryPage, api: getLngBCategoryPage,
rowKey: 'id', rowKey: 'id',
columns: customConfigColums, columns: customConfigColums,
formConfig: { formConfig: {
rowProps: { rowProps: {
gutter: 16, gutter: 16
}, },
schemas: customSearchFormSchema, schemas: customSearchFormSchema,
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false, showResetButton: false
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableRef.value.setToolBarWidth(); tableRef.value.setToolBarWidth();
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
rowSelection: {
type: 'checkbox'
},
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' }
}, },
tableSetting: { tableSetting: {
size: false, size: false,
setting: false, setting: false
}, }
}); });
function dbClickRow(record) { function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) { if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
return; return;
} }
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
@ -160,10 +172,13 @@
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
function selectionChange(selected) {
selectedKeys.value = selected.keys;
}
function handleAdd() { function handleAdd() {
if (schemaIdComputedRef.value) { if (schemaIdComputedRef.value) {
router.push({ router.push({
@ -182,7 +197,6 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/Category/' + record.id + '/updateForm', path: '/form/Category/' + record.id + '/updateForm',
query: { query: {
@ -200,7 +214,7 @@
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要启用的数据'), description: t('请选择需要启用的数据')
}); });
return; return;
} }
@ -217,19 +231,18 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('启用成功!'), description: t('启用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDisable() { function handleDisable() {
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要禁用的数据'), description: t('请选择需要禁用的数据')
}); });
return; return;
} }
@ -245,11 +258,11 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('禁用成功!'), description: t('禁用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function deleteList(ids) { function deleteList(ids) {
@ -264,28 +277,28 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('删除成功!'), description: t('删除成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDatalog(record: Recordable) {
modalVisible.value = true;
logId.value = record.id;
}
function handleRefresh() { function handleRefresh() {
reload(); reload();
} }
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
dbClickRow(record); dbClickRow(record);
} }
onMounted(() => { onMounted(() => {
if (schemaIdComputedRef.value) { if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh); bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh); bus.on(CREATE_FLOW, handleRefresh);
@ -305,21 +318,20 @@
} }
}); });
function getActions(record: Recordable): ActionItem[] { function getActions(record: Recordable): ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) { if (!record.workflowData?.processId) {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record)
}; };
} else { } else {
if (button.code === 'view') { if (button.code === 'view') {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record)
}; };
} else { } else {
return {}; return {};
@ -341,7 +353,7 @@
let btns = await mergeButtons(buttons.value, formId); let btns = await mergeButtons(buttons.value, formId);
buttons.value = btns; buttons.value = btns;
} }
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {

View File

@ -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) {

View File

@ -1,13 +1,8 @@
<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';
@ -16,7 +11,7 @@
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';
@ -30,16 +25,17 @@
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 = [];
@ -50,12 +46,8 @@
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); //表单事件:初始化表单
await loadFormEvent(customFormEventConfigs, state.formModel,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} else if (props.fromPage == FromPageType.FLOW) { } else if (props.fromPage == FromPageType.FLOW) {
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法 // loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
@ -64,20 +56,13 @@
} else if (props.fromPage == FromPageType.DESKTOP) { } else if (props.fromPage == FromPageType.DESKTOP) {
// 桌面设计 表单事件需要执行 // 桌面设计 表单事件需要执行
emits('loadingCompleted'); //告诉系统表单已经加载完毕 emits('loadingCompleted'); //告诉系统表单已经加载完毕
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,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
emits('form-mounted', formProps); emits('form-mounted', formProps);
} catch (error) { } catch (error) {}
}
}); });
async function mergeCustomFormRenderConfig() { async function mergeCustomFormRenderConfig() {
let cloneProps = cloneDeep(formProps); let cloneProps = cloneDeep(formProps);
let fEventConfigs = cloneDeep(formEventConfigs); let fEventConfigs = cloneDeep(formEventConfigs);
@ -125,9 +110,7 @@
state.formModel = record; state.formModel = record;
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据 await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record; return record;
} catch (error) { } catch (error) {}
}
} }
// 辅助设置表单数据 // 辅助设置表单数据
function setFieldsValue(record) { function setFieldsValue(record) {
@ -151,9 +134,7 @@
values[RowKey] = rowId; values[RowKey] = rowId;
state.formModel = values; state.formModel = values;
let saveVal = await updateLngBDocCp(values); let saveVal = await updateLngBDocCp(values);
await submitFormEvent(customFormEventConfigs, state.formModel, await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -162,9 +143,7 @@
try { try {
state.formModel = values; state.formModel = values;
let saveVal = await addLngBDocCp(values); let saveVal = await addLngBDocCp(values);
await submitFormEvent(customFormEventConfigs, state.formModel, await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
systemFormRef.value,
formProps.schemas); //表单事件:提交表单
return saveVal; return saveVal;
} catch (error) {} } catch (error) {}
} }
@ -189,24 +168,30 @@
} }
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,
systemFormRef.value,
formProps.schemas); //表单事件:加载表单
} }
function getFormModel() { function getFormModel() {
return systemFormRef.value.formModel return systemFormRef.value.formModel;
} }
async function handleDelete(id) { async function handleDelete(id) {
return await deleteLngBDocCp([id]); return await deleteLngBDocCp([id]);
} }
// watch(
// () => systemFormRef.value.suSign,
// (val) => {
// console.log(val);
// },
// {
// immediate: true,
// deep: true
// }
// );
defineExpose({ defineExpose({
setFieldsValue, setFieldsValue,
resetFields, resetFields,

View File

@ -2,14 +2,14 @@ import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table'; import { BasicColumn } from '/@/components/Table';
export const formConfig = { export const formConfig = {
useCustomConfig: false, useCustomConfig: false
}; };
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'fullName', field: 'fullName',
label: '名称', label: '名称',
component: 'Input', component: 'Input'
}, },
{ {
field: 'valid', field: 'valid',
@ -21,71 +21,9 @@ export const searchFormSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
getPopupContainer: () => document.body, 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',
},
]; ];
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -95,7 +33,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -104,7 +42,7 @@ export const columns: BasicColumn[] = [
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -113,7 +51,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -122,7 +60,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -131,7 +69,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -140,7 +78,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -149,7 +87,7 @@ export const columns: BasicColumn[] = [
componentType: 'select', componentType: 'select',
align: 'left', align: 'left',
sorter: true, sorter: true
}, },
{ {
@ -158,8 +96,8 @@ export const columns: BasicColumn[] = [
componentType: 'textarea', componentType: 'textarea',
align: 'left', align: 'left',
sorter: true, sorter: true
}, }
]; ];
//表单事件 //表单事件
export const formEventConfigs = { export const formEventConfigs = {
@ -170,7 +108,7 @@ export const formEventConfigs = {
text: '开始节点', text: '开始节点',
icon: '#icon-kaishi', icon: '#icon-kaishi',
bgcColor: '#D8E5FF', bgcColor: '#D8E5FF',
isUserDefined: false, isUserDefined: false
}, },
{ {
color: '#F6AB01', color: '#F6AB01',
@ -178,8 +116,8 @@ export const formEventConfigs = {
text: '初始化表单', text: '初始化表单',
bgcColor: '#f9f5ea', bgcColor: '#f9f5ea',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
1: [ 1: [
{ {
@ -189,8 +127,8 @@ export const formEventConfigs = {
detail: '(新增无此操作)', detail: '(新增无此操作)',
bgcColor: '#F8F2FC', bgcColor: '#F8F2FC',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
2: [ 2: [
{ {
@ -199,8 +137,8 @@ export const formEventConfigs = {
text: '加载表单', text: '加载表单',
bgcColor: '#FFF1F1', bgcColor: '#FFF1F1',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
3: [ 3: [
{ {
@ -209,8 +147,8 @@ export const formEventConfigs = {
text: '提交表单', text: '提交表单',
bgcColor: '#F5F4FF', bgcColor: '#F5F4FF',
isUserDefined: false, isUserDefined: false,
nodeInfo: { processEvent: [] }, nodeInfo: { processEvent: [] }
}, }
], ],
4: [ 4: [
{ {
@ -220,9 +158,9 @@ export const formEventConfigs = {
icon: '#icon-jieshuzhiliao', icon: '#icon-jieshuzhiliao',
bgcColor: '#FFD6D6', bgcColor: '#FFD6D6',
isLast: true, isLast: true,
isUserDefined: false, isUserDefined: false
}, }
], ]
}; };
export const formProps: FormProps = { export const formProps: FormProps = {
labelCol: { span: 3, offset: 0 }, labelCol: { span: 3, offset: 0 },
@ -261,8 +199,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'df68cc4350f542f7b3a8c7b55c39927c', key: 'df68cc4350f542f7b3a8c7b55c39927c',
@ -295,8 +233,8 @@ export const formProps: FormProps = {
isSave: false, isSave: false,
isShow: true, isShow: true,
scan: false, scan: false,
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '4d924c23bfd84b22ac683240bae16929', key: '4d924c23bfd84b22ac683240bae16929',
@ -318,30 +256,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { 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, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1676483934342787074' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: true,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1676483934342787074', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'f60587f7bb5c482ba5afca76fec9916a', key: 'f60587f7bb5c482ba5afca76fec9916a',
@ -363,30 +301,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { 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, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1676831752869834753' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1676831752869834753', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '5e8a28c2704c431cbf5f9cb9be19edc7', key: '5e8a28c2704c431cbf5f9cb9be19edc7',
@ -408,30 +346,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { 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, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1679007059387240450' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: true,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1679007059387240450', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'e2a327ac6aa249a5b5eb66199e263131', key: 'e2a327ac6aa249a5b5eb66199e263131',
@ -453,30 +391,30 @@ export const formProps: FormProps = {
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
mode: 'multiple', mode: '',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { 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, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '1679010661178691585' }, params: { itemId: '1978056598125330433' },
labelField: 'name', labelField: 'name',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
rules: [], rules: [],
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1679010661178691585', itemId: '1978056598125330433',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: '5b805c85cd284ddf88ff0025273f7939', key: '5b805c85cd284ddf88ff0025273f7939',
@ -497,12 +435,12 @@ export const formProps: FormProps = {
showLabel: true, showLabel: true,
showSearch: false, showSearch: false,
clearable: false, clearable: false,
disabled: false, disabled: true,
mode: 'multiple', mode: '',
staticOptions: [ staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' }, { key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' }, { 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, defaultSelect: null,
datasourceType: 'dic', datasourceType: 'dic',
@ -512,7 +450,7 @@ export const formProps: FormProps = {
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
method: 'GET', method: 'GET',
apiId: '93d735dcb7364a0f8102188ec4d77ac7', apiId: '93d735dcb7364a0f8102188ec4d77ac7'
}, },
dicOptions: [], dicOptions: [],
required: false, required: false,
@ -520,8 +458,8 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
itemId: '1978057078528327681', itemId: '1978057078528327681',
style: { width: '100%' }, style: { width: '100%' }
}, }
}, },
{ {
key: 'd74fd39918f043e5992b2fbe119b5725', key: 'd74fd39918f043e5992b2fbe119b5725',
@ -551,14 +489,14 @@ export const formProps: FormProps = {
isShow: true, isShow: true,
rules: [], rules: [],
events: {}, events: {},
style: { width: '100%' }, style: { width: '100%' }
}, }
}, }
], ],
showActionButtonGroup: false, showActionButtonGroup: false,
buttonLocation: 'center', buttonLocation: 'center',
actionColOptions: { span: 24 }, actionColOptions: { span: 24 },
showResetButton: false, showResetButton: false,
showSubmitButton: false, showSubmitButton: false,
hiddenComponent: [], hiddenComponent: []
}; };

View File

@ -1,7 +1,6 @@
<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)">
@ -21,24 +20,23 @@
</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 { 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 { getLngBDocCpPage, deleteLngBDocCp} from '/@/api/mdm/DocCp'; import { getLngBDocCpPage, deleteLngBDocCp, disableLngBDocCp, enableLngBDocCp } from '/@/api/mdm/DocCp';
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';
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 { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index' import { setIndexFlowStatus } from '/@/utils/flow/index';
import { getLngBDocCp } from '/@/api/mdm/DocCp'; import { getLngBDocCp } from '/@/api/mdm/DocCp';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import DocCpModal from './components/DocCpModal.vue'; import DocCpModal from './components/DocCpModal.vue';
@ -46,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/docCp/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();
@ -61,12 +62,21 @@
const tableRef = ref(); 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 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(() => { const tableButtonConfig = computed(() => {
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
@ -76,55 +86,58 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); 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 { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
const formIdComputedRef = ref(); const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId formIdComputedRef.value = currentRoute.value.meta.formId;
const schemaIdComputedRef = ref(); const schemaIdComputedRef = ref();
schemaIdComputedRef.value = currentRoute.value.meta.schemaId schemaIdComputedRef.value = currentRoute.value.meta.schemaId;
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const formName = '公司资质证书'; const formName = '公司资质证书';
const [registerTable, { reload, }] = useTable({ const [registerTable, { reload }] = useTable({
title: '' || (formName + '列表'), title: '' || formName + '列表',
api: getLngBDocCpPage, api: getLngBDocCpPage,
rowKey: 'id', rowKey: 'id',
columns: customConfigColums, columns: customConfigColums,
formConfig: { formConfig: {
rowProps: { rowProps: {
gutter: 16, gutter: 16
}, },
schemas: customSearchFormSchema, schemas: customSearchFormSchema,
fieldMapToTime: [], fieldMapToTime: [],
showResetButton: false, showResetButton: false
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableRef.value.setToolBarWidth(); tableRef.value.setToolBarWidth();
}, },
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
rowSelection: {
type: 'checkbox'
},
striped: false, striped: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' }
}, },
tableSetting: { tableSetting: {
size: false, size: false,
setting: false, setting: false
}, }
}); });
function selectionChange(selected) {
selectedKeys.value = selected.keys;
}
function dbClickRow(record) { function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) { if (!actionButtonConfig?.value.some((element) => element.code == 'view')) {
return; return;
} }
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
@ -160,7 +173,6 @@
} }
function buttonClick(code) { function buttonClick(code) {
btnEvent[code](); btnEvent[code]();
} }
@ -182,7 +194,6 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
router.push({ router.push({
path: '/form/DocCp/' + record.id + '/updateForm', path: '/form/DocCp/' + record.id + '/updateForm',
query: { query: {
@ -200,7 +211,7 @@
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要启用的数据'), description: t('请选择需要启用的数据')
}); });
return; return;
} }
@ -217,19 +228,18 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('启用成功!'), description: t('启用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDisable() { function handleDisable() {
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: 'Tip',
description: t('请选择需要禁用的数据'), description: t('请选择需要禁用的数据')
}); });
return; return;
} }
@ -245,13 +255,17 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('禁用成功!'), description: t('禁用成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleDatalog(record: Recordable) {
modalVisible.value = true;
logId.value = record.id;
}
function deleteList(ids) { function deleteList(ids) {
Modal.confirm({ Modal.confirm({
title: '提示信息', title: '提示信息',
@ -264,28 +278,24 @@
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: 'Tip',
description: t('删除成功!'), description: t('删除成功!')
}); });
}); });
}, },
onCancel() {}, onCancel() {}
}); });
} }
function handleRefresh() { function handleRefresh() {
reload(); reload();
} }
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
dbClickRow(record); dbClickRow(record);
} }
onMounted(() => { onMounted(() => {
if (schemaIdComputedRef.value) { if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh); bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh); bus.on(CREATE_FLOW, handleRefresh);
@ -305,21 +315,20 @@
} }
}); });
function getActions(record: Recordable): ActionItem[] { function getActions(record: Recordable): ActionItem[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => { const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) { if (!record.workflowData?.processId) {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined, color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record)
}; };
} else { } else {
if (button.code === 'view') { if (button.code === 'view') {
return { return {
icon: button?.icon, icon: button?.icon,
tooltip: button?.name, tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record), onClick: btnEvent[button.code].bind(null, record)
}; };
} else { } else {
return {}; return {};
@ -341,7 +350,7 @@
let btns = await mergeButtons(buttons.value, formId); let btns = await mergeButtons(buttons.value, formId);
buttons.value = btns; buttons.value = btns;
} }
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
:deep(.ant-table-selection-col) { :deep(.ant-table-selection-col) {

View File

@ -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: '提示信息',

View File

@ -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) {}

View File

@ -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);

View File

@ -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) {