From 0990f596791ebc4518e293a2d60407ff1165b53c Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 21 六月 2024 18:09:31 +0800 Subject: [PATCH] 菜单更新 --- src/views/tigerprojects/system/lowcode/composition/RouteAction.vue | 46 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue b/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue index 5df9cec..cc0363e 100644 --- a/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue +++ b/src/views/tigerprojects/system/lowcode/composition/RouteAction.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-20 12:13:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-21 00:11:00 + * @LastEditTime: 2024-06-21 15:37:05 --> <template> <Card title="鎿嶄綔"> @@ -24,7 +24,16 @@ import GeneralModal from '/@/views/components/GeneralModal.vue'; import { useModal } from '/@/components/Modal'; import { useI18n } from '/@/hooks/web/useI18n'; + import { Ref, inject, ref, watch } from 'vue'; + import { isNullOrEmpty } from '/@/utils/is'; + import { useTabs } from '/@/hooks/web/useTabs'; + import { useMessage } from '/@/hooks/web/useMessage'; + const { refreshPage } = useTabs(); + const {createErrorModal} = useMessage(); + // const props = defineProps({ + // prodCode: { type: String }, + // }); const { t } = useI18n(); const [register, { openModal }] = useModal(); interface NavItem { @@ -34,20 +43,32 @@ url: string; action: string; } + const Prod_Code = inject('prodCode') as Ref<string>; + + // watch( + // () => Prod_Code, + // (v) => { + // if (v !== Prod_Code.value) { + // Prod_Code.value = isNullOrEmpty(v) ? Prod_Code.value : v; + // } + // }, + // { deep: true }, + // ); + // 蹇嵎瀵艰埅 const navItems: NavItem[] = [ { - title: '娣诲姞宸ヨ壓璺嚎', - icon: 'ion:home-outline', + title: '娣诲姞浜у搧宸ヨ壓璺嚎', + icon: 'add_green|svg', color: '#1fdaca', - url: '/workbench', + url: '/addRoute', action: 'addRoute', }, { - title: '娣诲姞瀹㈡埛', - icon: 'materialreq|svg', + title: '娣诲姞瀹㈡埛宸ヨ壓璺嚎', + icon: 'add_customer|svg', color: '#bf0c2c', - url: '/materialreq', + url: '/addCustomer', action: 'addCustomer', }, // { @@ -131,12 +152,17 @@ * @param {*} u * @return {*} */ - function handleSuccess(d, u) { + async function handleSuccess(d, u) { + if(isNullOrEmpty(Prod_Code.value)){ + createErrorModal({ title: t('sys.api.errorTip'), content: '浜у搧涓虹┖锛屼笉鑳芥坊鍔犲伐鑹鸿矾绾匡紝璇风偣鍑诲乏渚ч�夋嫨浜у搧' }); + return; + } let codes = d.values.id.split(','); - let eintity: any[] = []; var i; for (i = 0; i < codes.length; i++) { - RouteToProd({ rotId: codes[i], prodCode: 'K5811AA015007' }).then(() => {}); + await RouteToProd({ rotId: codes[i], prodCode: Prod_Code.value }); } + + await refreshPage(); } </script> -- Gitblit v1.9.3