| | |
| | | style="background: #fafafa; border-left: 1px solid #d9d9d9; padding: 10px" |
| | | :zeroWidthTriggerStyle="{ 'margin-top': '-70px', 'background-color': 'gray' }" |
| | | > |
| | | <PropsPanel ref="propsPanel" :activeKey="routeConfig.activeKey"> |
| | | <PropsPanel ref="propsPanel" |
| | | :activeKey="routeConfig.activeKey" |
| | | :IsOperation="IsOperation" |
| | | :title="title" |
| | | :colSlots="colSlots" |
| | | :crudColSlots="crudColSlots" |
| | | :entityName="entityName"> |
| | | <!-- <template v-for="item of formConfig.schemas" #[`${item.component}Props`]="data"> |
| | | <slot |
| | | :name="`${item.component}Props`" |
| | |
| | | </PageWrapper> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | <script lang="ts" setup name="Route_View"> |
| | | import { FlowChart } from '/@/components/FlowChart'; |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import { SaveRouteData, getRouteData } from '/@/api/tigerapi/mes/router'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import RouteModal from './RouteModal.vue'; |
| | | import { onMounted, ref, unref, Ref, provide, reactive, nextTick } from 'vue'; |
| | | import { onMounted, ref, unref, Ref, provide, reactive, nextTick, watch } from 'vue'; |
| | | import { Layout, LayoutContent, LayoutSider } from 'ant-design-vue'; |
| | | import { |
| | | RouteData, |
| | |
| | | import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; |
| | | import { useRoute } from 'vue-router'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import LogicFlow from '@logicflow/core'; |
| | | import { getEntity } from '/@/api/tigerapi/system'; |
| | | |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerModal, { openModal }] = useModal(); |
| | |
| | | provide<Ref<MES_ROUTE>>('mesRoute', currRoute); |
| | | const selectnode = ref({} as node); |
| | | const currRotId = ref(route.params?.id); |
| | | |
| | | const colSlots = ref<any>([]); |
| | | const crudColSlots = ref<any>([]); |
| | | const entityName = ref<any>('MES_POSITION'); |
| | | const props = defineProps({ |
| | | rotId: { type: String, default: '' }, |
| | | }); |
| | | const IsOperation = ref(false); |
| | | const title = ref('行为'); |
| | | watch( |
| | | () => props.rotId, |
| | | (v) => { |
| | | if (v !== currRotId.value) { |
| | | currRotId.value = v; |
| | | if (!isNullOrUnDef(unref(currlf))) { |
| | | unref(currlf).render({}); |
| | | routeData.value = { |
| | | nodes: [], |
| | | edges: [], |
| | | }; |
| | | init(currlf); |
| | | } |
| | | } |
| | | }, |
| | | { deep: true }, |
| | | ); |
| | | |
| | | const currlf = ref(null) as Ref<LogicFlow | null>; |
| | | console.log(currRotId.value); |
| | | |
| | | onMounted(() => { |
| | | getEntity({ |
| | | sqlcmd: `ASSEMBLY_NAME ='MES_POSITION'`, |
| | | entityName: 'SYS_LOW_CODE', |
| | | }).then((data) => { |
| | | var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON); |
| | | for (const i in searchForms) { |
| | | if(!isNullOrUnDef(searchForms[i]['colSlot'])){ |
| | | colSlots.value.push('form-'+searchForms[i]['colSlot']); |
| | | } |
| | | } |
| | | |
| | | var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON); |
| | | for (const i in _cruds) { |
| | | if(!isNullOrUnDef(_cruds[i]['colSlot'])){ |
| | | crudColSlots.value.push(_cruds[i]['colSlot']); |
| | | } |
| | | } |
| | | entityName.value = 'MES_POSITION'; |
| | | }); |
| | | }); |
| | | async function init(lf) { |
| | | currlf.value = unref(lf); |
| | | //通过工艺路线ID获取图形数据,并渲染 |
| | | var _data = await getRouteData(currRotId.value); |
| | | console.log('组件已挂载', _data); |
| | |
| | | if (_data.Data != null) { |
| | | //工艺路线主信息 |
| | | currRoute.value = _data.Data.route; |
| | | if (!isNullOrEmpty(currRotId.value)) { |
| | | if (!isNullOrEmpty(currRotId.value) && isNullOrEmpty(props.rotId)) { |
| | | setTitle('设计:工艺路线-' + currRoute.value.ROT_CODE); |
| | | } |
| | | _data.Data.nodes.forEach((n) => { |
| | |
| | | if (selectnode.value.properties.operType && selectnode.value.properties.operType == 'Action') { |
| | | var _act = routeConfig.routeData.acts.filter((x) => x.ID == selectnode.value.id)[0]; |
| | | routeConfig.activeKey = 3; |
| | | IsOperation.value = false; |
| | | title.value = '行为'; |
| | | routeConfig.currentAct = { |
| | | ID: selectnode.value.id, |
| | | CREATE_TIME: currRoute.value.CREATE_TIME, |
| | |
| | | |
| | | console.log(routeConfig.currentItem); |
| | | routeConfig.activeKey = 2; |
| | | IsOperation.value = true; |
| | | title.value = '岗位'; |
| | | } |
| | | } |
| | | |