From 943954bdcb3b672b89cfa097e53d2ac17a36a101 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 30 六月 2024 13:13:25 +0800 Subject: [PATCH] 产品工艺路线路由节点选择功能更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts | 45 src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts | 7 src/views/tigerprojects/system/lowcode/composition/LeftTree.vue | 9 src/api/tigerapi/model/basModel.ts | 11 src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts | 6 src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue | 8 src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue | 91 ++ src/views/tigerprojects/system/lowcode/normal/mainTable.vue | 2 src/components/FlowChart/src/FlowChartView.vue | 257 +++++++ src/views/components/CustModal.vue | 8 src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts | 72 +- src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts | 54 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts | 71 +- src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts | 48 src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts | 14 src/views/tigerprojects/system/lowcode/data.ts | 44 + src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts | 58 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts | 48 src/views/components/RouteViewModal.vue | 18 src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts | 890 +++++++++++++++----------- src/views/tigerprojects/system/lowcode/detail/detail.vue | 2 src/views/tigerprojects/system/lowcode/composition/index.vue | 59 + src/views/components/data.ts | 4 src/components/FlowChart/index.ts | 11 src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts | 42 src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts | 59 + 26 files changed, 1,266 insertions(+), 672 deletions(-) diff --git a/src/api/tigerapi/model/basModel.ts b/src/api/tigerapi/model/basModel.ts index 108931d..1239bb3 100644 --- a/src/api/tigerapi/model/basModel.ts +++ b/src/api/tigerapi/model/basModel.ts @@ -115,6 +115,10 @@ export type SupplierInfoPageListGetResultModel = BasicFetchResult<SupplierInfoListItem>; export type PackageRulePageListGetResultModel = BasicFetchResult<PackageRuleListItem>; +/** + * @description: 鑷畾涔夋柟娉曟帴鍙� + * @return {*} + */ export interface EntityCustFunctionType { CreateAction: (fnName: string) => {}; ActionItem: (params: Recordable<any>, data, ...args) => ActionItem[]; @@ -126,15 +130,18 @@ GetSearchForm: () => []; GetCrudForm: (type: string) => []; GetBaseForm: () => []; - GetBaseCards: () => []; + GetBaseCards: (type: string | undefined) => []; OthersValues: (val: string, id: string) => {}; GetTitle: (type: string) => {}; GetCrudColSlots: () => []; nodeChange: ({}) => void; CreateIcon: (params: Recordable<any>) => string; SelectNode: (selectedNodes: Ref<any[]>) => {}; - GetNavItems: () => NavItem[]; + GetNavItems: (type: string) => NavItem[]; navChangeItem: (action: any, ...args) => void; GetUseModals: () => {}; SubmitFunc: (values: Recordable<any>, type: string, emit) => void; + GetSlots: (type: string | undefined) => {}; + GenerateHtml: (type: string | null) => HTMLElement | null; + CustFunc: (type: string | undefined, ...args) => void | any; } diff --git a/src/components/FlowChart/index.ts b/src/components/FlowChart/index.ts index bad85db..498d10a 100644 --- a/src/components/FlowChart/index.ts +++ b/src/components/FlowChart/index.ts @@ -1,4 +1,15 @@ +/* + * @Description: file content + * @Author: Ben Lin + * @version: + * @Date: 2024-06-18 15:09:47 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-06-29 05:14:10 + */ import { withInstall } from '@/utils'; import flowChart from './src/FlowChart.vue'; +import flowChartView from './src/FlowChartView.vue'; export const FlowChart = withInstall(flowChart); + +export const FlowChartView = withInstall(flowChartView); diff --git a/src/components/FlowChart/src/FlowChartView.vue b/src/components/FlowChart/src/FlowChartView.vue new file mode 100644 index 0000000..c80c4d4 --- /dev/null +++ b/src/components/FlowChart/src/FlowChartView.vue @@ -0,0 +1,257 @@ +<template> + <div class="h-full" :class="prefixCls"> + <div ref="lfElRef" class="h-full"></div> + </div> +</template> +<script lang="ts" setup> + import type { Ref } from 'vue'; + import type { Definition } from '@logicflow/core'; + import { ref, onMounted, unref, nextTick, computed, watch } from 'vue'; + import FlowChartToolbar from './FlowChartToolbar.vue'; + import LogicFlow from '@logicflow/core'; + import { Snapshot, BpmnElement, Menu, DndPanel, SelectionSelect } from '@logicflow/extension'; + import { useDesign } from '@/hooks/web/useDesign'; + import { useAppStore } from '@/store/modules/app'; + import { createFlowChartContext } from './useFlowContext'; + import { toLogicFlowData } from './adpterForTurbo'; + import { useModal, BasicModal } from '@/components/Modal'; + import { JsonPreview } from '@/components/CodeEditor'; + import { configDefaultDndPanel } from './config'; + import '@logicflow/core/dist/style/index.css'; + import '@logicflow/extension/lib/style/index.css'; + import { useGlobSetting } from '/@/hooks/setting'; + import customEdge from './customEdge'; + import { useMessage } from '/@/hooks/web/useMessage'; + import { useI18n } from '/@/hooks/web/useI18n'; + import actionRect from './actionRect'; + import TestNode from './TestNode'; + import CollectNode from './CollectNode'; + import AssemblyNode from './AssemblyNode'; + import PackingNode from './PackingNode'; + import RepairNode from './RepairNode'; + + defineOptions({ name: 'FlowChart' }); + + const props = defineProps({ + flowOptions: { + type: Object as PropType<Definition>, + default: () => ({}), + }, + + data: { + type: Object as PropType<any>, + default: () => ({}), + }, + + toolbar: { + type: Boolean, + default: true, + }, + patternItems: { + type: Array, + }, + }); + + const emit = defineEmits([ + 'view-data', + 'save-data', + 'add-lf', + 'select-node', + 'click-blank', + 'init', + 'undo', + 'redo', + ]); + const lfElRef = ref(null); + const graphData = ref({}); + + const lfInstance = ref(null) as Ref<LogicFlow | null>; + + const { prefixCls } = useDesign('flow-chart'); + const appStore = useAppStore(); + const [register, { openModal }] = useModal(); + createFlowChartContext({ + logicFlow: lfInstance as unknown as LogicFlow, + }); + + const getFlowOptions = computed(() => { + const { flowOptions } = props; + + const defaultOptions: Partial<Definition> = { + grid: true, + background: { + color: appStore.getDarkMode === 'light' ? '#f7f9ff' : '#151515', + }, + keyboard: { + enabled: true, + }, + edgeType: 'polyline', + ...flowOptions, + }; + return defaultOptions as Definition; + }); + + watch( + () => props.data, + () => { + onRender(); + }, + ); + + // TODO + // watch( + // () => appStore.getDarkMode, + // () => { + // init(); + // } + // ); + + watch( + () => unref(getFlowOptions), + (options) => { + unref(lfInstance)?.updateEditConfig(options); + }, + ); + + // init logicFlow + async function init() { + await nextTick(); + + const lfEl = unref(lfElRef); + if (!lfEl) { + return; + } + // LogicFlow.use(DndPanel); + + // Canvas configuration + // LogicFlow.use(Snapshot); + // Use the bpmn plug-in to introduce bpmn elements, which can be used after conversion in turbo + LogicFlow.use(BpmnElement); + // Start the right-click menu + // LogicFlow.use(Menu); + LogicFlow.use(SelectionSelect); + + lfInstance.value = new LogicFlow({ + ...unref(getFlowOptions), + container: lfEl, + edgeGenerator: (sourceNode) => { + // console.log('a'); + // 璧峰鑺傜偣绫诲瀷 rect 鏃朵娇鐢� 鑷畾涔夌殑杈� custom-edge + if (sourceNode.properties.isReturn) return 'custom-edge'; + // if (sourceNode.type === 'rect') return 'custom-edge'; + // return 'custom-edge'; + }, + }); + const lf = unref(lfInstance)!; + lf?.setDefaultEdgeType('polyline'); + lf.register(actionRect); + lf.register(TestNode); + lf.register(CollectNode); + lf.register(AssemblyNode); + lf.register(PackingNode); + lf.register(RepairNode); + lf.register(customEdge); + onRender(); + lf?.setPatternItems(props.patternItems || configDefaultDndPanel(lf)); + } + + async function onRender() { + await nextTick(); + const lf = unref(lfInstance); + if (!lf) { + return; + } + const lFData = toLogicFlowData(props.data); + lf.render(lFData); + + lf.on('anchor:drop', (data) => { + const nodeData = data.nodeModel.getData(); + if (nodeData.properties.isReturn === true) { + console.log(11, nodeData.properties.isReturn); + data.nodeModel.graphModel.edges.forEach((element) => { + if (element.sourceNodeId === data.nodeModel.id) { + lf.changeEdgeType(element.id, 'custom-edge'); + } + }); + } + }); + lf.on('node:click,edge:click', (data) => { + if (data.isSelected) { + console.log(data.data.text.value, data.isSelected); + // notification.success({ + // message: t('鐐瑰嚮浜嗚妭鐐�'), + // description: `${data.data.text.value}: ${data.isSelected}`, + // duration: 3, + // }); + emit('select-node', data, lf); + } else { + console.log(data.data.type); + } + }); + + lf.on('blank:mousedown', (e) => { + emit('click-blank'); + }); + + lf.on('node:dnd-add', (data, e) => { + console.log('node:dnd-add', data); + emit('select-node', data, lf); + }); + + emit('init', lf); + } + + function handlePreview() { + const lf = unref(lfInstance); + if (!lf) { + return; + } + graphData.value = unref(lf).getGraphData(); + openModal(); + } + +function handleSave() { + // console.log('handleSave'); + const lf = unref(lfInstance); + if (!lf) { + return; + } + emit('save-data', lf); +} + +function handleAdd() { + const lf = unref(lfInstance); + console.log('handleAdd'); + if (!lf) { + return; + } + // lf.clearData(); + lf.render({}); +} + +function handleAddlf() { + const lf = unref(lfInstance); + if (!lf) { + return; + } + emit('add-lf', lf); +} + +function handleUndo() { + const lf = unref(lfInstance); + if (!lf) { + return; + } + emit('undo', lf); +} + +function handleRedo() { + const lf = unref(lfInstance); + if (!lf) { + return; + } + emit('redo', lf); +} + + onMounted(init); +</script> diff --git a/src/views/components/CustModal.vue b/src/views/components/CustModal.vue index c95f031..83d0f8b 100644 --- a/src/views/components/CustModal.vue +++ b/src/views/components/CustModal.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-05 15:46:07 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-13 09:28:27 + * @LastEditTime: 2024-06-28 14:26:49 --> <template> <BasicModal @@ -55,7 +55,7 @@ const dtlSlots = ref([] as any[]); const formSchema = ref([] as FormSchema[]); const formElName = ref([]); - const useFormData = ref({}); + const useFormData = ref<any>({}); const props = defineProps({ detailSlots: { type: Array, default: [] }, }); @@ -84,9 +84,9 @@ //寰幆琛ㄥ崟鍚嶆暟缁勶紝鎿嶄綔鍚勮〃鍗曞瓧娈� formElName.value.forEach((name) => { if (!isNullOrUnDef(useFormData.value[name])) { - useFormData.value[name][1].resetFields(); + useFormData.value[name][1]['resetFields'](); if (unref(isUpdate)) { - useFormData.value[name][1].setFieldsValue({ + useFormData.value[name][1]['setFieldsValue']({ ...mValues.value, }); } diff --git a/src/views/components/RouteViewModal.vue b/src/views/components/RouteViewModal.vue index 10a3fc5..4aff6cb 100644 --- a/src/views/components/RouteViewModal.vue +++ b/src/views/components/RouteViewModal.vue @@ -1,10 +1,18 @@ +<!-- + * @Description: file content + * @Author: Ben Lin + * @version: + * @Date: 2024-06-18 15:09:48 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-06-30 13:07:46 +--> <template> <BasicModal v-bind="$attrs" @register="registerModal" :defaultFullscreen="true" :title="title" - @ok="custFunction(isUpdate, 'rvSubmit', cType, setModalProps, closeModal, emit, slotName)" + @ok="custFunction(isUpdate, submitFn, cType, setModalProps, closeModal, emit, slotName)" :width="width" > <!-- 杩欓噷宓屽叆router-view鏉ュ睍绀鸿矾鐢遍〉闈� --> @@ -12,9 +20,9 @@ </BasicModal> </template> <script lang="ts" setup> - import { ref, unref, onMounted } from 'vue'; - import { GetSelectSuccess, OpenSelectItem, custFunction, getFormSchema } from './data'; - import { BasicModal, useModalInner, useModal } from '/@/components/Modal'; + import { ref, onMounted } from 'vue'; + import { custFunction } from './data'; + import { BasicModal, useModalInner } from '/@/components/Modal'; import Route_View from '/@/views/tigerprojects/mes/eng/route/index.vue'; const emit = defineEmits(['success', 'register']); @@ -23,12 +31,14 @@ const title = ref(''); const width = ref(''); const rotId = ref(''); + const submitFn = ref(''); const slotName = ref(''); const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { setModalProps({ confirmLoading: false }); rotId.value = data?.rotId; slotName.value = data?.slotName; + submitFn.value = data?.submitFn; //'rvSubmit' }); onMounted(() => {}); diff --git a/src/views/components/data.ts b/src/views/components/data.ts index 79852ad..3f4d0b6 100644 --- a/src/views/components/data.ts +++ b/src/views/components/data.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-05 15:50:59 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 10:54:27 + * @LastEditTime: 2024-06-28 11:31:37 */ import { getWoFns, @@ -47,7 +47,7 @@ } export function getFormSchema(type: string) { - let _formSchema = [] as FormSchema[]; + let _formSchema: FormSchema[] = []; switch (type) { case 'BIZ_MES_WO': _formSchema = woformSchema; diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue index 6b150b6..0342a53 100644 --- a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue +++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-05-25 00:27:00 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-24 22:58:16 + * @LastEditTime: 2024-06-28 11:40:38 --> <template> <div> @@ -177,8 +177,8 @@ edges: [], }); const formSchema = ref([] as FormSchema[]); - const woSchema = ref([] as FormSchema[]); - const prodSchema = ref([] as FormSchema[]); + const woSchema = ref<FormSchema[]>(getFormSchema('woinfo')); + const prodSchema = ref<FormSchema[]>(getFormSchema('prodinfo')); const isCustEl = ref({ forminfo: false, woinfo: false, @@ -266,8 +266,6 @@ }, { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, ]; - woSchema.value = getFormSchema('woinfo'); - prodSchema.value = getFormSchema('prodinfo'); // rotSchema.value = getFormSchema('rotinfo'); //宸ヨ壓璺嚎娓叉煋鍥惧垵濮嬪寲 if (lfInstance.value != null) { diff --git a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue index a4281d4..c057cba 100644 --- a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue +++ b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue @@ -4,12 +4,12 @@ * @version: * @Date: 2024-06-20 12:13:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 00:39:37 + * @LastEditTime: 2024-06-30 13:04:00 --> <template> - <Card :title="GetTitle()['navTitle']"> + <Card :title="GetTitle(props.configType)['navTitle']"> <CardGrid - v-for="item in GetNavItems()" + v-for="item in GetNavItems(props.configType)" :key="item.title" @click="navChangeItem(item.action, useModalData[item.action][1].openModal)" > @@ -29,50 +29,105 @@ /> </CardGrid> </Card> + <!-- 鍏朵粬鑷畾涔夊崱鐗囧唴瀹� --> + <a-card + :title="item.title" + :bordered="false" + class="!mt-2" + v-for="(item, index) in otherSlots" + :key="item.name" + > + <slot :name="item.name" :index="index"></slot> + </a-card> + <RouteViewModal @register="registerRv" @success="RvItemSuccess" /> </template> <script lang="ts" setup> import { Card, CardGrid } from 'ant-design-vue'; import Icon from '@/components/Icon/Icon.vue'; import GeneralModal from '/@/views/components/GeneralModal.vue'; + import RouteViewModal from '/@/views/components/RouteViewModal.vue'; import StepModal from '/@/views/components/StepModal.vue'; - import { Ref, inject, ref, watch } from 'vue'; + import { Ref, inject, nextTick, onMounted, ref, watch } from 'vue'; import { isNullOrUnDef } from '/@/utils/is'; import { useTabs } from '/@/hooks/web/useTabs'; import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel'; + import { useModal } from '/@/components/Modal'; + const ACard = Card; const objParams = inject('objParams') as Ref<any>; + const props = defineProps({ + configType: { type: String }, + nodes: { type: Array as PropType<any[]> }, + }); const custImport = ref<any[]>([]); const EntityCustFunction = ref([ { - GetTitle() {}, - GetNavItems() {}, + GetTitle(type: string) {}, + GetNavItems(type: string) {}, navChangeItem(action: any, ...args) {}, GetUseModals() {}, + GetBaseCards(type: string | undefined) {}, GetSelectSuccess(d, u, ...args) {}, + GenerateHtml(ype: string | null) {}, + CustFunc(type: string | undefined, ...args) {}, } as EntityCustFunctionType, ]); /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ try { custImport.value = await import(`../entityts/${objParams.value['Name']}.ts`); } catch (e) {} - const [{ GetTitle, GetNavItems, navChangeItem, GetUseModals, GetSelectSuccess }] = isNullOrUnDef( - custImport.value['default'], - ) + const [ + { + GetTitle, + GetNavItems, + navChangeItem, + GetUseModals, + GetSelectSuccess, + GetBaseCards, + GenerateHtml, + CustFunc, + }, + ] = isNullOrUnDef(custImport.value['default']) ? EntityCustFunction.value : custImport.value['default'](); const useModalData = ref(GetUseModals()); + const otherSlots = ref<any[]>(GetBaseCards(props.configType)); const { refreshPage } = useTabs(); + const [registerRv, { openModal: openRvModal }] = useModal(); - // watch( - // () => Prod_Code, - // (v) => { - // if (v !== Prod_Code.value) { - // Prod_Code.value = isNullOrEmpty(v) ? Prod_Code.value : v; - // } - // }, - // { deep: true }, - // ); + watch( + [() => props.configType, () => props.nodes], + (v) => { + otherSlots.value = GetBaseCards(v[0]); + nextTick(() => { + // var div = document.getElementById('container') as HTMLElement; + // div.innerHTML = ''; + // div.appendChild(GenerateHtml(v[0])); + // setTimeout(() => { + // if (!isNullOrUnDef(v[1])) { + // CustFunc(v[0], v[1][0]['id'], '#lfContainer'); + // } + // }, 100); + }); + }, + { deep: true }, + ); + + onMounted(() => { + nextTick(() => { + // var div = document.getElementById('container') as HTMLElement; + // if (!isNullOrUnDef(div)) { + // div.innerHTML = ''; + // div.appendChild(GenerateHtml(props.configType)); + // setTimeout(() => { + // if (!isNullOrUnDef(props.nodes) && props.nodes.length > 0) { + // CustFunc(props.configType, props.nodes[0]['id'], '#lfContainer'); + // } + // }, 100); + // } + }); + }); /** * @description: 寮瑰嚭閫夋嫨妗嗘垚鍔熻繑鍥炴柟娉� diff --git a/src/views/tigerprojects/system/lowcode/composition/LeftTree.vue b/src/views/tigerprojects/system/lowcode/composition/LeftTree.vue index 6c0249c..fc0c1fe 100644 --- a/src/views/tigerprojects/system/lowcode/composition/LeftTree.vue +++ b/src/views/tigerprojects/system/lowcode/composition/LeftTree.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-26 15:31:43 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 21:41:54 + * @LastEditTime: 2024-06-29 05:50:18 --> <template> <GeneralTree @@ -27,7 +27,6 @@ const emit = defineEmits(['select']); const objParams = inject('objParams') as Ref<any>; - const nodeType = inject('nodeType') as Ref<any>; const selectedNodes = inject('selectedNodes') as Ref<any>; const custImport = ref<any[]>([]); const EntityCustFunction = ref([ @@ -40,7 +39,7 @@ try { custImport.value = await import(`../entityts/${objParams.value['Name']}.ts`); } catch (e) {} - const [{ CreateIcon, SelectNode }] = isNullOrUnDef(custImport.value['default']) + const [{ CreateIcon, SelectNode, fetchTreeData }] = isNullOrUnDef(custImport.value['default']) ? EntityCustFunction.value : custImport.value['default'](); const treeData = ref<TreeItem[]>([]); @@ -68,7 +67,7 @@ */ async function fetch(type: string) { if (!isNullOrUnDef(custImport.value)) { - const [{ fetchTreeData }] = custImport.value['default'](); + // const [{ fetchTreeData }] = custImport.value['default'](); //鏍规嵁type鑾峰彇鏍戝舰鏁版嵁 const data = await fetchTreeData(type, objParams.value['CODE']); title.value = data.title; @@ -78,7 +77,6 @@ } function handleSelect(Id = '', info) { - nodeType.value = info.selectedNodes[0].type; selectedNodes.value = info.selectedNodes; emit('select', SelectNode(selectedNodes)); } @@ -89,7 +87,6 @@ * @return {*} */ function UnSelect(node) { - nodeType.value = ''; emit('select', SelectNode(undefined)); // reload(); } diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue index 85d8972..5fa8386 100644 --- a/src/views/tigerprojects/system/lowcode/composition/index.vue +++ b/src/views/tigerprojects/system/lowcode/composition/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-18 23:30:30 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 22:31:13 + * @LastEditTime: 2024-06-29 06:16:43 --> <template> <PageWrapper @@ -17,12 +17,19 @@ @back="goBack" > <Suspense class="w-1/4 xl:w-1/5"> - <LeftTree @select="NodeSelect"/> + <LeftTree @select="NodeSelect" /> </Suspense> <Suspense> <div class="w-3/4 xl:w-4/5 p-5"> - <CarGridNav v-if="showNav" /> - <Config v-if="showConfig" :configType="configType" @success="configSuccess"/> + <CarGridNav v-if="showNav" :configType="configType" :nodes="nodes"> + <template #[item] v-for="item in otherSlots" :key="item"> + <!-- 鑷畾涔夊唴瀹� --> + <div class="h-full" style="height: 400px"> + <FlowChartView :data="routeData" @init="init" + /></div> + </template> + </CarGridNav> + <Config v-if="showConfig" :configType="configType" @success="configSuccess" /> </div> </Suspense> <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable"> @@ -72,14 +79,17 @@ import Config from './Config.vue'; import LeftTree from './LeftTree.vue'; import CustModal from '/@/views/components/CustModal.vue'; - import { OpenCustModal } from '../data'; - import { Ref, onMounted, provide, ref } from 'vue'; + import { OpenCustModal, initRoute } from '../data'; + import { Ref, VNode, onMounted, provide, ref, unref } from 'vue'; + import { FlowChartView } from '/@/components/FlowChart'; import { useRoute } from 'vue-router'; import { BasicForm, useForm } from '/@/components/Form/index'; import { useTabs } from '/@/hooks/web/useTabs'; import { isNullOrUnDef } from '/@/utils/is'; import { useGo } from '/@/hooks/web/usePage'; import { useMessage } from '/@/hooks/web/useMessage'; + import { getRouteData } from '/@/api/tigerapi/mes/router'; + import LogicFlow from '@logicflow/core'; defineOptions({ name: 'DeptManagement' }); @@ -93,19 +103,23 @@ const useFormData = ref({}); const cType = ref(''); const dtlSlots = ref([] as any[]); + const otherSlots = ref<any[]>([]); const selectVals = ref({}); const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense); const pageTitle = ref(objParams.value.pageTitle); const pageContent = ref(objParams.value.pageContent); - const nodeType = ref(''); const selectedNodes = ref([]); const isMounted = ref(false); const showNav = ref(false); const showConfig = ref(false); const configType = ref(''); + const nodes = ref([]); + const routeData = ref({ + nodes: [], + edges: [], + }); const custImport = ref<any>(null); const [registerCust, { openModal: openCustomModal, closeModal }] = useModal(); - provide<Ref<string>>('nodeType', nodeType); provide<Ref<any>>('objParams', objParams); provide<Ref<any>>('selectedNodes', selectedNodes); setTitle(objParams.value.Title); //璁剧疆鏍囩椤垫爣棰� @@ -131,25 +145,46 @@ /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ try { custImport.value = await import(`../entityts/${entityName.value}.ts`); + if (custImport.value['default']) { + otherSlots.value = custImport.value['default']()[0]['GetSlots'](); + } isMounted.value = true; - } catch (e) {} + } catch (e) { + console.log(e); + } }); + + const currlf = ref(null) as Ref<LogicFlow | null>; + /** + * @description: 宸ヨ壓璺嚎鍒濆鍖� + * @param {*} lf + * @return {*} + */ + async function init(lf, rotId) { + initRoute(lf, rotId, routeData, currlf); + } /** * @description: 閫夋嫨鑺傜偣鏃舵牴鎹繑鍥炵殑浜嬩欢鍙傛暟鏄剧ず闅愯棌鐩稿簲缁勪欢 * @param {*} e * @return {*} - */ + */ function NodeSelect(e) { showConfig.value = e.showConfig; showNav.value = e.showNav; - configType.value = e.type + configType.value = e.type; + nodes.value = e.nodes; + routeData.value = { + nodes: [], + edges: [], + }; + initRoute(currlf, e.nodes[0].id, routeData, currlf); } /** * @description: 淇濆瓨閰嶇疆鎴愬姛杩斿洖鏂规硶 * @return {*} - */ + */ function configSuccess() { notification.success({ message: '鎴愬姛淇濆瓨琛屼负閰嶇疆鏁版嵁' }); } diff --git a/src/views/tigerprojects/system/lowcode/data.ts b/src/views/tigerprojects/system/lowcode/data.ts index 7b42f90..d1ad12c 100644 --- a/src/views/tigerprojects/system/lowcode/data.ts +++ b/src/views/tigerprojects/system/lowcode/data.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-02 17:52:35 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 22:23:12 + * @LastEditTime: 2024-06-29 06:12:26 */ import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table'; @@ -12,6 +12,19 @@ import { isNullOrEmpty } from '/@/utils/is'; import { woCustFn, woformSchema } from '/@/views/components/bizMesWo'; import { useModal } from '/@/components/Modal'; +import LogicFlow from '@logicflow/core'; +import { BpmnElement } from '@logicflow/extension/es/bpmn'; +import { Ref, ref, unref } from 'vue'; +import customEdge from '/@/components/FlowChart/src/customEdge'; +import actionRect from '/@/components/FlowChart/src/actionRect'; +import TestNode from '/@/components/FlowChart/src/TestNode'; +import CollectNode from '/@/components/FlowChart/src/CollectNode'; +import AssemblyNode from '/@/components/FlowChart/src/AssemblyNode'; +import PackingNode from '/@/components/FlowChart/src/PackingNode'; +import RepairNode from '/@/components/FlowChart/src/RepairNode'; +import { getRouteData } from '/@/api/tigerapi/mes/router'; +import { toLogicFlowData } from '/@/components/FlowChart/src/adpterForTurbo'; +import { SelectionSelect } from '@logicflow/extension'; const { t } = useI18n(); /** @@ -142,3 +155,32 @@ } return _formSchema; } + +/** + * @description: 宸ヨ壓璺嚎鍒濆鍖� + * @param {*} lf + * @return {*} + */ +export async function initRoute(lf, rotId, routeData, currlf) { + currlf.value = unref(lf); + //閫氳繃宸ヨ壓璺嚎ID鑾峰彇鍥惧舰鏁版嵁锛屽苟娓叉煋 + var _data = await getRouteData(rotId); + console.log('缁勪欢宸叉寕杞�', _data); + if (_data.Data != null) { + _data.Data.nodes.forEach((n) => { + n.node.properties = JSON.parse(n.node.properties); + n['node']['text']['value'] = n.NODE_NAME; + routeData.value.nodes.push(n['node']); + }); + console.log('111', routeData.value); + _data.Data.edges.forEach((e) => { + e.edge.properties = JSON.parse(e.edge.properties); + routeData.value.edges.push(e.edge); + }); + _data.Data.acts.forEach((act) => { + act.node.properties = JSON.parse(act.node.properties); + routeData.value.nodes.push(act.node); + }); + unref(lf).render(routeData.value); + } +} diff --git a/src/views/tigerprojects/system/lowcode/detail/detail.vue b/src/views/tigerprojects/system/lowcode/detail/detail.vue index 608ff90..725c299 100644 --- a/src/views/tigerprojects/system/lowcode/detail/detail.vue +++ b/src/views/tigerprojects/system/lowcode/detail/detail.vue @@ -63,7 +63,7 @@ EditOperation(data, d, u) {}, GetBaseColumns() {}, GetSearchForm() {}, - GetCrudForm() {}, + GetCrudForm(type: string) {}, OthersValues(val, id) {}, GetSelectSuccess(d, u, ...args) {}, OpenSelectItem(openItemModal: Fn, ...args) {}, diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts index 53c0ee9..c342d4c 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 03:13:41 + * @LastEditTime: 2024-06-28 14:21:49 */ import { Ref, h, unref } from 'vue'; @@ -26,7 +26,11 @@ slots: { customRender: 'action' }, fixed: undefined, }; - + + /** + * @description: 浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -240,7 +244,11 @@ }, ]; }, - GetBaseCards: () => { + /** + * @description: 鑾峰彇鍗$墖鍐呴厤缃垪琛紝浠ュ惊鐜樉绀哄涓崱鐗囧苟閰嶇疆澶氫釜鎻掓Ы + * @return {*} + */ + GetBaseCards: (type: string) => { return [ { name: 'BaseForm', diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts index c71ee66..115aa60 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 18:33:05 + * @LastEditTime: 2024-06-28 10:52:16 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -14,24 +14,6 @@ const { t } = useI18n(); function _default() { - /** - * @description: 鑷畾涔夌紪杈戞柟娉� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function DftGrpEdit(args: Fn[], params: {}) { - const param = { - CODE: params['record']['DFTG_CODE'], - ID: params['record']['ID'], - Name: 'BAS_DEFECT', - Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, - pCode: 'DFTG_CODE', - IsID: false, - }; - args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`); - } - const ActionColumn: BasicColumn = { width: 100, title: '鎿嶄綔', @@ -39,7 +21,10 @@ slots: { customRender: 'action' }, fixed: 'right', }; - + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -121,6 +106,26 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夌紪杈戞柟娉� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function DftGrpEdit(args: Fn[], params: {}) { + const param = { + CODE: params['record']['DFTG_CODE'], + ID: params['record']['ID'], + Name: 'BAS_DEFECT', + Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, + pCode: 'DFTG_CODE', + IsID: false, + }; + args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`); + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts index 8e041f5..adbfed7 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_PV.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 20:40:25 + * @LastEditTime: 2024-06-28 10:51:56 */ import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -21,6 +21,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -49,40 +53,40 @@ VAR_VALUE: d.values['val'], }; }, - OpenSelectItem:(openItemModal: Fn, ...args) => { - openItemModal(true, { - title: '杩囩▼鍙橀噺鍒楄〃', - schemas: [ - { - field: 'VAR_CODE', - component: 'Input', - label: '杩囩▼鍙橀噺缂栫爜', - colProps: { - span: 12, - }, + OpenSelectItem: (openItemModal: Fn, ...args) => { + openItemModal(true, { + title: '杩囩▼鍙橀噺鍒楄〃', + schemas: [ + { + field: 'VAR_CODE', + component: 'Input', + label: '杩囩▼鍙橀噺缂栫爜', + colProps: { + span: 12, }, - ], - ItemColumns: [ - { - title: t('杩囩▼鍙橀噺缂栫爜'), - dataIndex: 'VAR_CODE', - resizable: true, - sorter: true, - width: 200, - }, - { - title: t('杩囩▼鍙橀噺鍚嶇О'), - dataIndex: 'VAR_NAME', - resizable: true, - sorter: true, - width: 180, - }, - ], - tableName: 'BAS_LABEL_PV', - rowKey: 'VAR_CODE', - searchInfo: {TABLE_NAME: 'BAS_LABEL_PV'} - }); - } + }, + ], + ItemColumns: [ + { + title: t('杩囩▼鍙橀噺缂栫爜'), + dataIndex: 'VAR_CODE', + resizable: true, + sorter: true, + width: 200, + }, + { + title: t('杩囩▼鍙橀噺鍚嶇О'), + dataIndex: 'VAR_NAME', + resizable: true, + sorter: true, + width: 180, + }, + ], + tableName: 'BAS_LABEL_PV', + rowKey: 'VAR_CODE', + searchInfo: { TABLE_NAME: 'BAS_LABEL_PV' }, + }); + }, }; return [methods, ActionColumn]; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts index 6cef314..c00d7ca 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_TEMP.ts @@ -4,35 +4,12 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-24 15:52:02 + * @LastEditTime: 2024-06-28 10:52:45 */ import { ActionItem, BasicColumn } from '/@/components/Table'; function _default() { - /** - * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉� - * @param {Fn} go - * @return {*} - */ - function goDetail(go: Fn, params: Recordable) { - const id = { - ID: params['record'].ID, - CODE: params['record']['LABEL_CODE'], - Name: 'BAS_LABEL_VAR', - firstTabName: '鏍囩妯℃澘鍙橀噺', - secondTabName: '', //'鏍囩杩囩▼鍙橀噺', - firstTitle: '妯℃澘鍙橀噺', - secondTitle: '', //'杩囩▼鍙橀噺', - pageTitle: '鏍囩妯℃澘鍙橀噺', //璇︽儏椤甸潰鏍囬 - contentStr: '杩欓噷鏄爣绛炬ā鏉垮彉閲忕鐞嗛〉闈紝鍙互绠$悊鏍囩鐨勬ā鏉垮彉閲忔垨鑰呮墦鍗拌繃绋嬩腑鐨勫彉閲�', - detailName: `妯℃澘[${params['record'].LABEL_NAME}]`, - others: { LABEL_ID: params['record'].ID }, - colSlots: ['BAS_LABEL_PV1add'], - }; - go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`); - } - const ActionColumn: BasicColumn = { width: 120, title: '鎿嶄綔', @@ -41,6 +18,10 @@ fixed: 'right', }; + /** + * @description: 浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -69,6 +50,31 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉� + * @param {Fn} go + * @return {*} + */ + function goDetail(go: Fn, params: Recordable) { + const id = { + ID: params['record'].ID, + CODE: params['record']['LABEL_CODE'], + Name: 'BAS_LABEL_VAR', + firstTabName: '鏍囩妯℃澘鍙橀噺', + secondTabName: '', //'鏍囩杩囩▼鍙橀噺', + firstTitle: '妯℃澘鍙橀噺', + secondTitle: '', //'杩囩▼鍙橀噺', + pageTitle: '鏍囩妯℃澘鍙橀噺', //璇︽儏椤甸潰鏍囬 + contentStr: '杩欓噷鏄爣绛炬ā鏉垮彉閲忕鐞嗛〉闈紝鍙互绠$悊鏍囩鐨勬ā鏉垮彉閲忔垨鑰呮墦鍗拌繃绋嬩腑鐨勫彉閲�', + detailName: `妯℃澘[${params['record'].LABEL_NAME}]`, + others: { LABEL_ID: params['record'].ID }, + colSlots: ['BAS_LABEL_PV1add'], + }; + go(`/BAS_LABEL_VAR/${encodeURI(JSON.stringify(id))}`); + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts index b1609d0..288d9f2 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-23 23:42:04 + * @LastEditTime: 2024-06-28 10:53:28 */ import { Tag, Tooltip } from 'ant-design-vue'; @@ -26,6 +26,11 @@ slots: { customRender: 'action' }, fixed: undefined, }; + + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓猴紝蹇呴渶瑕佹湁鐨勬柟娉� diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts index 0110c1d..59ceb76 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts @@ -16,32 +16,6 @@ import { formatToDateTime } from '/@/utils/dateUtil'; function _default(): any[] { - /** - * @description: 鑷畾涔夊垹闄ゆ柟娉� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function custDel(args: Fn[], params: {}) { - if (!isNullOrEmpty(params['data'])) { - var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']); - params['data'].value = _data; - args[6]({ - dataSource: [], - }); - args[6]({ - dataSource: params['data'], - }); - args[1](); - } else { - DeleteEntity(params['record'], params['entityName']).then((action) => { - if (action.IsSuccessed) { - args[1](); - } - }); - } - } - const ActionColumn: BasicColumn = { width: 80, title: '鎿嶄綔', @@ -50,6 +24,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -339,6 +317,35 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夊垹闄ゆ柟娉� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function custDel(args: Fn[], params: {}) { + if (!isNullOrEmpty(params['data'])) { + var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']); + params['data'].value = _data; + args[6]({ + dataSource: [], + }); + args[6]({ + dataSource: params['data'], + }); + args[1](); + } else { + DeleteEntity(params['record'], params['entityName']).then((action) => { + if (action.IsSuccessed) { + args[1](); + } + }); + } + } + + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts index 35c6c91..7c1770c 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_RULE.ts @@ -12,24 +12,6 @@ import { buildUUID } from '/@/utils/uuid'; function _default() { - /** - * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function pkgGrpEdit(go: Fn, params: {}) { - const param = { - CODE: params['record']['RULE_CODE'], - ID: params['record']['ID'], - Name: 'BAS_PKG_DTL', - Title: `缂栬緫鍖呰瑙勫垯锛�${params['record']['RULE_CODE']}`, - pCode: 'PKG_RULE_ID', - IsID: true, - }; - go(`/BAS_PKG_DTL/High/${encodeURI(JSON.stringify(param))}`); - } - const ActionColumn: BasicColumn = { width: 80, title: '鎿嶄綔', @@ -38,6 +20,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -69,6 +55,26 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function pkgGrpEdit(go: Fn, params: {}) { + const param = { + CODE: params['record']['RULE_CODE'], + ID: params['record']['ID'], + Name: 'BAS_PKG_DTL', + Title: `缂栬緫鍖呰瑙勫垯锛�${params['record']['RULE_CODE']}`, + pCode: 'PKG_RULE_ID', + IsID: true, + }; + go(`/BAS_PKG_DTL/High/${encodeURI(JSON.stringify(param))}`); + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts index c4a9145..756df30 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts @@ -1,20 +1,11 @@ /* - * @Description: file content + * @Description: 涓嶈壇鍘熷洜鐩稿叧 * @Author: Ben Lin * @version: * @Date: 2024-06-22 00:58:43 * @LastEditors: Ben Lin * @LastEditTime: 2024-06-26 03:13:26 */ -/* - * @Description: 涓嶈壇鍘熷洜鐩稿叧 - * @Author: Ben Lin - * @version: - * @Date: 2024-06-19 20:34:27 - * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-23 18:12:40 - */ - import { Ref, h } from 'vue'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; import { ActionItem, BasicColumn } from '/@/components/Table'; @@ -25,32 +16,6 @@ import { Tag } from 'ant-design-vue'; function _default() { - /** - * @description: 鑷畾涔夊垹闄ゆ柟娉� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function rsnGrpDel(args: Fn[], params: {}) { - if (!isNullOrEmpty(params['data'])) { - var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']); - params['data'].value = _data; - args[6]({ - dataSource: [], - }); - args[6]({ - dataSource: params['data'], - }); - args[1](); - } else { - DeleteEntity(params['record'], params['entityName']).then((action) => { - if (action.IsSuccessed) { - args[1](); - } - }); - } - } - const ActionColumn: BasicColumn = { width: 80, title: '鎿嶄綔', @@ -59,6 +24,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -120,7 +89,7 @@ /** * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl * @return {*} - */ + */ GetHomeUrl: () => { return `/BAS_REASON_GRP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_REASON_GRP', colSlots: [], crudColSlots: [] }))}`; }, @@ -340,6 +309,34 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夊垹闄ゆ柟娉� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function rsnGrpDel(args: Fn[], params: {}) { + if (!isNullOrEmpty(params['data'])) { + var _data = params['data'].value.filter((item) => item['ID'] != params['record']['ID']); + params['data'].value = _data; + args[6]({ + dataSource: [], + }); + args[6]({ + dataSource: params['data'], + }); + args[1](); + } else { + DeleteEntity(params['record'], params['entityName']).then((action) => { + if (action.IsSuccessed) { + args[1](); + } + }); + } + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts index 35571ce..54b82a0 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts @@ -15,24 +15,6 @@ const { t } = useI18n(); function _default() { - /** - * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function rsnGrpEdit(args: Fn[], params: {}) { - const param = { - CODE: params['record']['RSNG_CODE'], - ID: params['record']['ID'], - Name: 'BAS_REASON', - Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`, - pCode: 'RSNG_CODE', - IsID: false, - }; - args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`); - } - const ActionColumn: BasicColumn = { width: 180, title: '鎿嶄綔', @@ -41,6 +23,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -75,7 +61,7 @@ RSNG_CODE: d.values['val'], }; }, - OpenSelectItem:(openItemModal: Fn, ...args) => { + OpenSelectItem: (openItemModal: Fn, ...args) => { openItemModal(true, { title: '涓嶈壇鍘熷洜缁勫垪琛�', schemas: [ @@ -106,11 +92,31 @@ ], tableName: 'BAS_REASON_GRP', rowKey: 'RSNG_CODE', - searchInfo: {TABLE_NAME: 'BAS_REASON_GRP'} + searchInfo: { TABLE_NAME: 'BAS_REASON_GRP' }, }); - } + }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function rsnGrpEdit(args: Fn[], params: {}) { + const param = { + CODE: params['record']['RSNG_CODE'], + ID: params['record']['ID'], + Name: 'BAS_REASON', + Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`, + pCode: 'RSNG_CODE', + IsID: false, + }; + args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`); + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts index 0654eb0..511f9a2 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts @@ -4,10 +4,10 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-27 22:57:45 + * @LastEditTime: 2024-06-29 02:57:03 */ -import { Ref, ref, unref } from 'vue'; +import { Ref, h, ref, render, unref } from 'vue'; import { GetRoutePTree, RouteToCust, RouteToProd } from '/@/api/tigerapi/mes/router'; import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system'; import { useLocale } from '/@/locales/useLocale'; @@ -16,11 +16,14 @@ import { NavItem } from '/@/api/tigerapi/model/basModel'; import { useMessage } from '/@/hooks/web/useMessage'; import { useModal } from '/@/components/Modal'; +import { FormSchema } from '/@/components/Table'; +import { initRoute } from '../data'; const { t } = useI18n(); const { createErrorModal } = useMessage(); const { getLocale } = useLocale(); function _default() { + /* 瀹氫箟鍙橀噺 */ const isNormal = (type: number) => type === 0; const isScan = (type: number) => type === 1; const isAssy = (type: number) => type === 2; @@ -28,6 +31,10 @@ const isAudit = (type: number) => type === 4; const isPrint = (type: number) => type === 5; const isPackage = (type: number) => type === 6; + /** + * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鐨勪竴浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏍戝舰鍥炬爣 @@ -81,368 +88,19 @@ data.fieldNames = { key: 'tid', title: 'name' }; return data; }, + /** + * @description: 鑾峰彇閰嶇疆椤硅〃鍗曞瓧娈碉紝鏍规嵁鏍戝舰鑺傜偣type涓嶅悓鑰屼笉鍚� + * @param {string} type + * @return {*} + */ GetCrudForm: (type: string) => { - let form: any[] = []; + let form: FormSchema[] = []; switch (type) { case 'Action': - form = [ - { - field: 'PROD_CODE', - label: '浜у搧缂栫爜', - component: 'Input', - dynamicDisabled: ({ values }) => { - return true; - }, - colProps: { span: 12 }, - }, - { - field: 'ID', - label: 'ID', - component: 'Input', - show: false, - }, - { - field: 'ACT_ID', - label: 'ACT_ID', - component: 'Input', - show: false, - }, - { - field: 'ROT_ID', - label: 'ROT_ID', - component: 'Input', - show: false, - }, - { - field: 'ACT_CODE', - label: 'ACT_CODE', - component: 'Input', - show: false, - }, - { - field: 'NODE_ID', - label: 'NODE_ID', - component: 'Input', - show: false, - }, - { - field: 'CUST_CODE', - label: '瀹㈡埛缂栫爜', - component: 'Input', - dynamicDisabled: ({ values }) => { - return true; - }, - colProps: { span: 12 }, - }, - { - field: 'ACT_TYPE', - label: '琛屼负绫诲瀷', - component: 'ApiSelect', - colProps: { span: 12 }, - defaultValue: 0, - componentProps: { - api: GetEnum, - params: { name: 'MES_PROD_ACTION+ACT_TYPEs' }, - resultField: 'Data', - labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', - valueField: 'Value', - // onChange: (e, v) => { - // alert(e) - // console.log('ApiSelect====>:', e, v); - // }, - }, - }, - { - field: 'IS_ACTIVE', - label: '鏄惁鍚敤', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'RULE_CODE', - label: '鎵爜楠岃瘉', - component: 'Input', - colProps: { span: 10 }, - ifShow: ({ values }) => isScan(values.ACT_TYPE), - }, - { - field: '0', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isScan(values.ACT_TYPE), - colSlot: 'scanadd', - }, - { - field: 'ITEM_CODE', - label: '缁勮涓婃枡', - colProps: { span: 10 }, - component: 'Input', - ifShow: ({ values }) => isAssy(values.ACT_TYPE), - }, - { - field: '00', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isAssy(values.ACT_TYPE), - colSlot: 'assyadd', - }, - { - field: 'TEST_CODE', - label: '浜у搧娴嬭瘯', - colProps: { span: 10 }, - component: 'Input', - ifShow: ({ values }) => isTest(values.ACT_TYPE), - }, - { - field: 'test0', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isTest(values.ACT_TYPE), - colSlot: 'testadd', - }, - { - field: 'SAPL_CODE', - label: '浜у搧鎶芥', - colProps: { span: 10 }, - component: 'Input', - ifShow: ({ values }) => isAudit(values.ACT_TYPE), - }, - { - field: 'audit0', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isAudit(values.ACT_TYPE), - colSlot: 'auditadd', - }, - { - field: 'LABEL_CODE', - label: '鏍囩鎵撳嵃', - colProps: { span: 10 }, - component: 'Input', - ifShow: ({ values }) => isPrint(values.ACT_TYPE), - }, - { - field: 'print0', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isPrint(values.ACT_TYPE), - colSlot: 'printadd', - }, - { - field: 'pkgRULE_CODE', - label: '鍖呰瑙勫垯', - colProps: { span: 10 }, - component: 'Input', - ifShow: ({ values }) => isPackage(values.ACT_TYPE), - }, - { - field: 'pkg0', - label: '1', - defaultValue: '', - component: 'Input', - colProps: { span: 2, pull: 1 }, - ifShow: ({ values }) => isPackage(values.ACT_TYPE), - colSlot: 'pkgadd', - }, - { - field: 'REMARK', - label: '澶囨敞', - component: 'Input', - colProps: { span: 12 }, - }, - ]; + form = actionFormShema; break; case 'Node': - form = [ - { - field: 'PROD_CODE', - label: '浜у搧缂栫爜', - component: 'Input', - dynamicDisabled: ({ values }) => { - return true; - }, - colProps: { span: 12 }, - }, - { - field: 'ID', - label: 'ID', - component: 'Input', - show: false, - }, - { - field: 'ACT_ID', - label: 'ACT_ID', - component: 'Input', - show: false, - }, - { - field: 'ROT_ID', - label: 'ROT_ID', - component: 'Input', - show: false, - }, - { - field: 'NODE_ID', - label: 'NODE_ID', - component: 'Input', - show: false, - }, - { - field: 'NODE_NAME', - label: '宸ュ簭鑺傜偣鍚嶇О', - component: 'Input', - }, - { - field: 'CUST_CODE', - label: '瀹㈡埛缂栫爜', - component: 'Input', - dynamicDisabled: ({ values }) => { - return true; - }, - colProps: { span: 12 }, - }, - { - field: 'OPER_CODE', - label: '宸ュ簭缂栫爜', - component: 'Input', - }, - { - field: 'IS_ACTIVE', - label: '鏄惁鍚敤', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'IS_CALC_FPY', - label: '鏄惁璁$畻鐩撮�氱巼', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'CAN_SKIP', - label: '鏄惁鍏佽璺崇珯', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'IS_INPUT', - label: '鏄惁鎶曞叆绔�', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'IS_OUTPUT', - label: '鏄惁浜у嚭绔�', - required: true, - component: 'Select', - colProps: { span: 12 }, - componentProps: { - options: [ - { - label: '鏄�', - value: 'Y', - key: 'Y', - }, - { - label: '鍚�', - value: 'N', - key: 'N', - }, - ], - }, - }, - { - field: 'REMARK', - label: '澶囨敞', - component: 'Input', - colProps: { span: 12 }, - }, - ]; + form = nodeFormShema; break; } return form; @@ -454,6 +112,10 @@ GetCrudColSlots: () => { return ['scanadd', 'assyadd', 'testadd', 'auditadd', 'printadd', 'pkgadd']; }, + /** + * @description: 鍒囨崲鑺傜偣鏃朵簨浠舵柟娉� + * @return {*} + */ nodeChange: (params: { resetFields: any; setFieldsValue: any; @@ -605,8 +267,6 @@ for (i = 0; i < codes.length; i++) { if (d.which == 'addRoute') { RouteToProd({ rotId: codes[i], prodCode: args[1]['CODE'] }); - } else { - RouteToCust({ rotId: codes[i], prodCode: args[1]['CODE'], custCode: '' }); } } @@ -639,6 +299,7 @@ return { addRoute: useModal(), addCustomer: useModal(), + editRoute: useModal(), }; }, /** @@ -649,20 +310,25 @@ GetTitle: (type: string) => { return { configTitle: type == 'Action' ? '琛屼负閰嶇疆' : '宸ュ簭閰嶇疆', - navTitle: '娣诲姞宸ヨ壓璺嚎', + navTitle: type == 'Product' ? '娣诲姞宸ヨ壓璺嚎' : '宸ヨ壓璺嚎缁存姢', }; }, /** - * @description: 鏍规嵁閫変腑鐨勬爲鑺傜偣鍒ゆ柇瑕佸垏鎹㈠摢涓粍浠� + * @description: 鏍规嵁閫変腑鐨勬爲鑺傜偣杩斿洖涓婚〉闈紝鑷畾涔夋柟娉曪紝杩欓噷鏄垽鏂鍒囨崲鍝釜缁勪欢 * @param {Ref} selectedNodes * @return {*} */ SelectNode: (selectedNodes: Ref<any[]>) => { - let result = { showConfig: false, showNav: false, type: selectedNodes.value[0].type }; + let result = { + showConfig: false, + showNav: false, + type: selectedNodes.value[0].type, + nodes: selectedNodes.value, + }; if (isNullOrUnDef(selectedNodes)) { return result; } - if (selectedNodes.value[0].type == 'Product') { + if (selectedNodes.value[0].type == 'Product' || selectedNodes.value[0].type == 'Route') { result.showNav = true; result.showConfig = false; } @@ -676,25 +342,43 @@ * @description: 鑾峰彇瀵艰埅椤� * @return {*} */ - GetNavItems: () => { - return [ - { - title: '娣诲姞浜у搧宸ヨ壓璺嚎', - icon: 'add_green|svg', - color: '#1fdaca', - url: '/addRoute', - action: 'addRoute', - isStep: false, - }, - { - title: '娣诲姞瀹㈡埛宸ヨ壓璺嚎', - icon: 'add_customer|svg', - color: '#bf0c2c', - url: '/addCustomer', - action: 'addCustomer', - isStep: true, - }, - ] as NavItem[]; + GetNavItems: (type: string) => { + let item: NavItem[] = []; + switch (type) { + case 'Product': + item = [ + { + title: '娣诲姞浜у搧宸ヨ壓璺嚎', + icon: 'add_green|svg', + color: '#1fdaca', + url: '/addRoute', + action: 'addRoute', + isStep: false, + }, + { + title: '娣诲姞瀹㈡埛宸ヨ壓璺嚎', + icon: 'add_customer|svg', + color: '#bf0c2c', + url: '/addCustomer', + action: 'addCustomer', + isStep: true, + }, + ]; + break; + case 'Route': + item = [ + { + title: '缂栬緫宸ヨ壓璺嚎', + icon: 'clarity:note-edit-line', + color: '#1fdaca', + url: '/editRoute', + action: 'editRoute', + isStep: false, + }, + ]; + break; + } + return item; }, /** * @description: 瀵艰埅椤甸潰鍒囨崲鎸夐挳鏃惰皟鐢ㄦ柟娉� @@ -703,6 +387,8 @@ */ navChangeItem: (action: any, ...args) => { switch (action) { + case 'editRoute': + break; case 'addRoute': args[0](true, { title: '宸ヨ壓璺嚎鍒楄〃', @@ -746,8 +432,70 @@ break; } }, + /** + * @description: 鑾峰彇鍗$墖鍐呴厤缃垪琛紝浠ュ惊鐜樉绀哄涓崱鐗囧苟閰嶇疆澶氫釜鎻掓Ы + * @return {*} + */ + GetBaseCards: (type: string) => { + let reusts: any[] = []; + switch (type) { + case 'Product': + reusts = []; + break; + case 'Route': + reusts = [ + { + name: 'RotInfo', + slots: [], + preIcons: {}, + title: '宸ヨ壓璺嚎鍥�', + entityName: '', + }, + ]; + break; + } + return reusts; + }, + /** + * @description: 鑾峰彇鎻掓Ы鍒楄〃 + * @return {*} + */ + GetSlots: () => { + return ['RotInfo']; + }, + /** + * @description: 鐢熸垚html + * @return {*} + */ + GenerateHtml: (type: string | null) => { + const newElement = document.createElement('div'); + // newElement.textContent = 'New Element =>'+type; + // newElement.style.height = '250px'; + newElement.id = 'lfContainer'; + newElement.className = "h-full"; + // newElement.style.color = 'blue'; + // newElement.style.fontSize = '16px'; + return newElement; + }, + /** + * @description: 鑷畾涔夋柟娉� + * @param {string} type + * @param {array} args + * @return {*} + */ + CustFunc: (type: string | undefined, ...args) => { + if (type == 'Route') { + initRoute(args[0], args[1]); + } + }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 寮瑰嚭閫夋嫨妗�-鐗╂枡閫夋嫨妗嗛厤缃� + * @return {*} + */ const itemCodeModalCfg = { title: '鐗╂枡鍒楄〃', schemas: [ @@ -781,6 +529,10 @@ searchInfo: { TABLE_NAME: 'BAS_ITEM' }, }; + /** + * @description: 寮瑰嚭閫夋嫨妗�-瑙勫垯閫夋嫨妗嗛厤缃� + * @return {*} + */ const ruleModalCfg = { title: '瑙勫垯鍒楄〃', schemas: [ @@ -814,6 +566,10 @@ searchInfo: { TABLE_NAME: 'BAS_CODE_RULE' }, }; + /** + * @description: 寮瑰嚭閫夋嫨妗�-鎵撳嵃妯℃澘閫夋嫨妗嗛厤缃� + * @return {*} + */ const printModalCfg = { title: '鎵撳嵃妯℃澘鍒楄〃', schemas: [ @@ -880,6 +636,372 @@ searchInfo: { TABLE_NAME: 'BAS_PKG_RULE' }, }; + /** + * @description: 琛屼负閰嶇疆琛ㄥ崟瀛楁 + * @return {*} + */ + const actionFormShema: FormSchema[] = [ + { + field: 'PROD_CODE', + label: '浜у搧缂栫爜', + component: 'Input', + dynamicDisabled: ({ values }) => { + return true; + }, + colProps: { span: 12 }, + }, + { + field: 'ID', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'ACT_ID', + label: 'ACT_ID', + component: 'Input', + show: false, + }, + { + field: 'ROT_ID', + label: 'ROT_ID', + component: 'Input', + show: false, + }, + { + field: 'ACT_CODE', + label: 'ACT_CODE', + component: 'Input', + show: false, + }, + { + field: 'NODE_ID', + label: 'NODE_ID', + component: 'Input', + show: false, + }, + { + field: 'CUST_CODE', + label: '瀹㈡埛缂栫爜', + component: 'Input', + dynamicDisabled: ({ values }) => { + return true; + }, + colProps: { span: 12 }, + }, + { + field: 'ACT_TYPE', + label: '琛屼负绫诲瀷', + component: 'ApiSelect', + colProps: { span: 12 }, + defaultValue: 0, + componentProps: { + api: GetEnum, + params: { name: 'MES_PROD_ACTION+ACT_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + // onChange: (e, v) => { + // alert(e) + // console.log('ApiSelect====>:', e, v); + // }, + }, + }, + { + field: 'IS_ACTIVE', + label: '鏄惁鍚敤', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'RULE_CODE', + label: '鎵爜楠岃瘉', + component: 'Input', + colProps: { span: 10 }, + ifShow: ({ values }) => isScan(values.ACT_TYPE), + }, + { + field: '0', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isScan(values.ACT_TYPE), + colSlot: 'scanadd', + }, + { + field: 'ITEM_CODE', + label: '缁勮涓婃枡', + colProps: { span: 10 }, + component: 'Input', + ifShow: ({ values }) => isAssy(values.ACT_TYPE), + }, + { + field: '00', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isAssy(values.ACT_TYPE), + colSlot: 'assyadd', + }, + { + field: 'TEST_CODE', + label: '浜у搧娴嬭瘯', + colProps: { span: 10 }, + component: 'Input', + ifShow: ({ values }) => isTest(values.ACT_TYPE), + }, + { + field: 'test0', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isTest(values.ACT_TYPE), + colSlot: 'testadd', + }, + { + field: 'SAPL_CODE', + label: '浜у搧鎶芥', + colProps: { span: 10 }, + component: 'Input', + ifShow: ({ values }) => isAudit(values.ACT_TYPE), + }, + { + field: 'audit0', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isAudit(values.ACT_TYPE), + colSlot: 'auditadd', + }, + { + field: 'LABEL_CODE', + label: '鏍囩鎵撳嵃', + colProps: { span: 10 }, + component: 'Input', + ifShow: ({ values }) => isPrint(values.ACT_TYPE), + }, + { + field: 'print0', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isPrint(values.ACT_TYPE), + colSlot: 'printadd', + }, + { + field: 'pkgRULE_CODE', + label: '鍖呰瑙勫垯', + colProps: { span: 10 }, + component: 'Input', + ifShow: ({ values }) => isPackage(values.ACT_TYPE), + }, + { + field: 'pkg0', + label: '1', + defaultValue: '', + component: 'Input', + colProps: { span: 2, pull: 1 }, + ifShow: ({ values }) => isPackage(values.ACT_TYPE), + colSlot: 'pkgadd', + }, + { + field: 'REMARK', + label: '澶囨敞', + component: 'Input', + colProps: { span: 12 }, + }, + ]; + + /** + * @description: 宸ュ簭閰嶇疆琛ㄥ崟瀛楁 + * @return {*} + */ + const nodeFormShema: FormSchema[] = [ + { + field: 'PROD_CODE', + label: '浜у搧缂栫爜', + component: 'Input', + dynamicDisabled: ({ values }) => { + return true; + }, + colProps: { span: 12 }, + }, + { + field: 'ID', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'ACT_ID', + label: 'ACT_ID', + component: 'Input', + show: false, + }, + { + field: 'ROT_ID', + label: 'ROT_ID', + component: 'Input', + show: false, + }, + { + field: 'NODE_ID', + label: 'NODE_ID', + component: 'Input', + show: false, + }, + { + field: 'NODE_NAME', + label: '宸ュ簭鑺傜偣鍚嶇О', + component: 'Input', + }, + { + field: 'CUST_CODE', + label: '瀹㈡埛缂栫爜', + component: 'Input', + dynamicDisabled: ({ values }) => { + return true; + }, + colProps: { span: 12 }, + }, + { + field: 'OPER_CODE', + label: '宸ュ簭缂栫爜', + component: 'Input', + }, + { + field: 'IS_ACTIVE', + label: '鏄惁鍚敤', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'IS_CALC_FPY', + label: '鏄惁璁$畻鐩撮�氱巼', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'CAN_SKIP', + label: '鏄惁鍏佽璺崇珯', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'IS_INPUT', + label: '鏄惁鎶曞叆绔�', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'IS_OUTPUT', + label: '鏄惁浜у嚭绔�', + required: true, + component: 'Select', + colProps: { span: 12 }, + componentProps: { + options: [ + { + label: '鏄�', + value: 'Y', + key: 'Y', + }, + { + label: '鍚�', + value: 'N', + key: 'N', + }, + ], + }, + }, + { + field: 'REMARK', + label: '澶囨敞', + component: 'Input', + colProps: { span: 12 }, + }, + ]; + return [methods]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts index 2b55bb4..ab621e2 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_ITEM.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-26 03:07:40 + * @LastEditTime: 2024-06-28 10:57:44 */ import { Ref, h, unref } from 'vue'; @@ -27,6 +27,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { EditOperation: ( data: Ref<any[]>, d, u) => { if (u.isUpdate) { diff --git a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts index 00fc392..5eddc8d 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/QMS_INS_STD.ts @@ -14,25 +14,6 @@ const { t } = useI18n(); function _default() { - /** - * @description: 鑷畾涔夌紪杈戞柟娉� - * @param {Fn} args - * @param {*} params - * @return {*} - */ - function insStdEdit(args: Fn[], params: {}) { - const param = { - CODE: params['record']['STD_CODE'], - ID: params['record']['ID'], - Name: 'QMS_INS_ITEM', //涓�鑸槸鏄庣粏琛ㄥ疄浣� - Title: `缂栬緫妫�楠岄」鐩細${params['record']['STD_CODE']}`, - pCode: 'TECH_STD', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚� - mCode: 'STD_CODE', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚嶆槧灏勫瓧娈� - IsID: false, - }; - args[5](`/QMS_INS_ITEM/High/${encodeURI(JSON.stringify(param))}`); - } - const ActionColumn: BasicColumn = { width: 100, title: '鎿嶄綔', @@ -41,6 +22,10 @@ fixed: 'right', }; + /** + * @description: 涓�浜涜嚜瀹氭柟娉� + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -76,7 +61,7 @@ * @param {*} d * @param {*} u * @return {*} - */ + */ GetSelectSuccess: (d, u) => { return { ITEM_CODE: d.values['val'], @@ -86,7 +71,7 @@ * @description: 寮瑰嚭閫夋嫨妗嗘墦寮�鏂规硶 * @param {Fn} openItemModal * @return {*} - */ + */ OpenSelectItem: (openItemModal: Fn, ...args) => { openItemModal(true, { title: '鐗╂枡鍒楄〃', @@ -123,6 +108,27 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夌紪杈戞柟娉� + * @param {Fn} args + * @param {*} params + * @return {*} + */ + function insStdEdit(args: Fn[], params: {}) { + const param = { + CODE: params['record']['STD_CODE'], + ID: params['record']['ID'], + Name: 'QMS_INS_ITEM', //涓�鑸槸鏄庣粏琛ㄥ疄浣� + Title: `缂栬緫妫�楠岄」鐩細${params['record']['STD_CODE']}`, + pCode: 'TECH_STD', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚� + mCode: 'STD_CODE', //璺宠浆鍒伴珮绾ц〃鍗曠殑鍏抽敭瀛楁鍚嶆槧灏勫瓧娈� + IsID: false, + }; + args[5](`/QMS_INS_ITEM/High/${encodeURI(JSON.stringify(param))}`); + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts b/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts index 6918bf2..3e2448f 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/V_BAS_PROD.ts @@ -4,37 +4,12 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-25 18:37:56 + * @LastEditTime: 2024-06-28 10:58:43 */ import { ActionItem, BasicColumn } from '/@/components/Table'; function _default() { - /** - * @description: 璺宠浆浜у搧宸ヨ壓缁戝畾椤甸潰 - * @param {*} params - * @return {*} - */ - function handleBinding(go: Fn, params: Recordable<any>) { - const id = { - ID: params['record'].ID, - Name: 'ProdRouteBinding', - CODE: params['record'].ITEM_CODE, - Title: `浜у搧[${params['record'].ITEM_CODE}]宸ヨ壓缁戝畾`, - colSlots: [], /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */ - crudColSlots: [], /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */ - dense: true, - pageTitle: `浜у搧宸ヨ壓缁戝畾`, - pageContent: `杩欓噷鏄鐞嗕骇鍝佺殑宸ヨ壓缁戝畾锛屼竴涓骇鍝佸彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛, - }; - go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify(id))}`); - // let obj = JSON.stringify(id); - // push({ - // path: '/ProdRouteBinding', - // state: {obj}, //HTML5 History API 鐨勪紶鍙傦紝鍙傛暟闅愯棌涓嶅湪鍦板潃鏍忔樉绀猴紙history锛� - // }) - } - const ActionColumn: BasicColumn = { width: 80, title: '鎿嶄綔', @@ -43,6 +18,10 @@ fixed: undefined, }; + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ const methods = { /** * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� @@ -71,6 +50,33 @@ }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 璺宠浆浜у搧宸ヨ壓缁戝畾椤甸潰 + * @param {*} params + * @return {*} + */ + function handleBinding(go: Fn, params: Recordable<any>) { + const id = { + ID: params['record'].ID, + Name: 'ProdRouteBinding', + CODE: params['record'].ITEM_CODE, + Title: `浜у搧[${params['record'].ITEM_CODE}]宸ヨ壓缁戝畾`, + colSlots: [] /* 琛ㄦ牸鍐呯殑鏌ヨ琛ㄥ崟瀛楁鐨勬彃妲藉垪琛紝涓�鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */, + crudColSlots: [] /* 澧炲垹鏀硅〃鍗曞瓧娈电殑鎻掓Ы鍒楄〃锛屼竴鑸敤浜庡脊鍑洪�夋嫨妗嗘寜閽� */, + dense: true, + pageTitle: `浜у搧宸ヨ壓缁戝畾`, + pageContent: `杩欓噷鏄鐞嗕骇鍝佺殑宸ヨ壓缁戝畾锛屼竴涓骇鍝佸彲浠ョ粦瀹氬涓伐鑹鸿矾绾縛, + }; + go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify(id))}`); + // let obj = JSON.stringify(id); + // push({ + // path: '/ProdRouteBinding', + // state: {obj}, //HTML5 History API 鐨勪紶鍙傦紝鍙傛暟闅愯棌涓嶅湪鍦板潃鏍忔樉绀猴紙history锛� + // }) + } + return [methods, ActionColumn]; } diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue index 988a7d1..1e11a42 100644 --- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue +++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue @@ -87,7 +87,7 @@ EditOperation(data, d, u) {}, GetBaseColumns() {}, GetSearchForm() {}, - GetCrudForm() {}, + GetCrudForm(type: string) {}, OthersValues(val, id) {}, } as EntityCustFunctionType, ]); -- Gitblit v1.9.3