| | |
| | | import { ElMessage, ElTable, ElTableColumn, ElPagination, ElForm, ElFormItem, ElDialog } from 'element-plus'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import axios from 'axios'; |
| | | import { el } from 'element-plus/es/locale'; |
| | | const route = useRoute(); |
| | | const router = useRouter(); |
| | | const dialogVisible = ref(false); |
| | |
| | | .then((res) => { |
| | | state.m_PageLoading = false; |
| | | let result = res.data; |
| | | result.sort((a: any, b: any) => { |
| | | const aPrefix = a.Model.slice(0, 3); |
| | | const bPrefix = b.Model.slice(0, 3); |
| | | const aContainsDP = aPrefix.includes('DP') || aPrefix.includes('DRL'); |
| | | const bContainsDP = bPrefix.includes('DP') || bPrefix.includes('DRL'); |
| | | |
| | | if (aContainsDP && !bContainsDP) { |
| | | return -1; |
| | | } else if (!aContainsDP && bContainsDP) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | }); |
| | | let arr = []; |
| | | result.forEach((item: any, index: number) => { |
| | | let node = { |
| | |
| | | initData(); |
| | | }; |
| | | const clickDetail = (row: any) => { |
| | | dialogVisible.value = true; |
| | | state.m_detailDialogInfo = row; |
| | | // 找到当前点击的产品 |
| | | const currentProduct = state.m_dispTableData.find((item) => item.id === row.id); |
| | | if (currentProduct) { |
| | | // 保存产品信息到localStorage |
| | | localStorage.setItem('currentProduct', JSON.stringify(currentProduct)); |
| | | } |
| | | router.push(`/product/${currentProduct.Id}`); |
| | | }; |
| | | const clickDetailCertifcate = (row: any) => { |
| | | state.m_detailDialogInfo = row; |