| | |
| | | * @version: |
| | | * @Date: 2024-06-02 17:52:35 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-08-03 23:48:01 |
| | | * @LastEditTime: 2024-10-15 20:55:16 |
| | | */ |
| | | |
| | | import { ActionItem, FormSchema, PopConfirm } from '/@/components/Table'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; |
| | | import { woCustFn, woformSchema } from '/@/views/components/bizMesWo'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { Ref, unref } from 'vue'; |
| | | import { getRouteData } from '/@/api/tigerapi/mes/router'; |
| | | import { getRouteData, getWoRouteData } from '/@/api/tigerapi/mes/router'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { formatToDateTime } from '/@/utils/dateUtil'; |
| | | import { DeleteEntity } from '/@/api/tigerapi/system'; |
| | | import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | |
| | | const { t } = useI18n(); |
| | | /** |
| | |
| | | * @param {*} lf |
| | | * @return {*} |
| | | */ |
| | | export async function initRoute(lf, rotId, routeData, currlf) { |
| | | export async function initRoute(lf, rotId, routeData, currlf, rotType) { |
| | | currlf.value = unref(lf); |
| | | //通过工艺路线ID获取图形数据,并渲染 |
| | | var _data = await getRouteData(rotId); |
| | | var _data = rotType == 'Wo' ? await getWoRouteData(rotId) : await getRouteData(rotId); |
| | | console.log('组件已挂载', _data); |
| | | if (_data.Data != null) { |
| | | _data.Data.nodes.forEach((n) => { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * @description: 跳转并根据传入的参数通过session传入 |
| | | * @param {string} path 跳转地址 |
| | | * @return {*} |
| | | */ |
| | | export function goByParams(path: string, params: {}, go) { |
| | | if (path.split('/').length > 2 && path.split('/')[2] == 'LC') { |
| | | getEntity({ |
| | | sqlcmd: `ASSEMBLY_NAME ='${path.split('/')[1]}'`, |
| | | entityName: 'SYS_LOW_CODE', |
| | | order: '', |
| | | }).then((data) => { |
| | | var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON); |
| | | let colSlots = [] as string[]; |
| | | for (const i in searchForms) { |
| | | if (!isNullOrUnDef(searchForms[i]['colSlot'])) { |
| | | colSlots.push('form-' + searchForms[i]['colSlot']); |
| | | } |
| | | } |
| | | |
| | | var _cruds = JSON.parse(data.Data.Items[0].FORM_JSON); |
| | | let crudColSlots = [] as string[]; |
| | | for (const i in _cruds) { |
| | | if (!isNullOrUnDef(_cruds[i]['colSlot'])) { |
| | | crudColSlots.push(_cruds[i]['colSlot']); |
| | | } |
| | | } |
| | | const id = { |
| | | ID: path.split('/')[1], |
| | | colSlots: colSlots, |
| | | crudColSlots: crudColSlots, |
| | | sName: `${path.split('/')[1]}_update`, |
| | | }; |
| | | // 将对象转换为JSON字符串并保存到sessionStorage |
| | | sessionStorage.removeItem(`${id.sName}_params`); |
| | | sessionStorage.setItem(`${id.sName}_params`, encodeURI(JSON.stringify({ params: params }))); |
| | | go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify(id))}`); |
| | | }); |
| | | } else if ( |
| | | (path.split('/').length > 2 && path.split('/')[2] == 'High') || |
| | | path.split('/')[2] == 'CP' |
| | | ) { |
| | | const id = { sName: `${path.split('/')[1]}_update`, Name: path.split('/')[1], params: params }; |
| | | // 将对象转换为JSON字符串并保存到sessionStorage |
| | | sessionStorage.removeItem(`${id.sName}_params`); |
| | | sessionStorage.setItem(`${id.sName}_params`, encodeURI(JSON.stringify(id))); |
| | | go(`/${path.split('/')[1]}/${path.split('/')[2]}/${encodeURI(JSON.stringify({ sName: id.sName, Name: id.Name }))}`); |
| | | } else { |
| | | const id = { sName: `${path.split('/')[1]}_update`,params: params }; |
| | | // 将对象转换为JSON字符串并保存到sessionStorage |
| | | sessionStorage.removeItem(`${id.sName}_params`); |
| | | sessionStorage.setItem(`${id.sName}_params`, encodeURI(JSON.stringify(id))); |
| | | go(`${path}/${encodeURI(JSON.stringify({ sName: id.sName}))}`); |
| | | } |
| | | } |