|
@@ -5,6 +5,7 @@ import Warning from '@/components/icon/warning.vue'
|
|
|
import Search from '@/components/icon/search.vue'
|
|
|
import { get } from '../../utils/request'
|
|
|
import { userStore } from '@/store/userInfo'
|
|
|
+import { productListNameMapping } from '../../utils/mapping'
|
|
|
|
|
|
const currentPage = ref(1)
|
|
|
const size = ref(5)
|
|
@@ -50,7 +51,7 @@ const pagingQuery = () => {
|
|
|
'code=' +
|
|
|
productId.value
|
|
|
).then((res) => {
|
|
|
- tableData.value = productNameMapping(res.data.result.list)
|
|
|
+ tableData.value = productListNameMapping(res.data.result.list)
|
|
|
total.value = res.data.result.total
|
|
|
})
|
|
|
}
|
|
@@ -58,7 +59,7 @@ const pagingQuery = () => {
|
|
|
const getproductList = (val) => {
|
|
|
get('/pdf-tech/product/listWithAll').then(
|
|
|
(res) => {
|
|
|
- productList.value = productNameMapping(res.data.result)
|
|
|
+ productList.value = productListNameMapping(res.data.result)
|
|
|
}
|
|
|
)
|
|
|
}
|
|
@@ -77,22 +78,6 @@ const handleCurrentChange = (value) => {
|
|
|
currentPage.value = value
|
|
|
pagingQuery()
|
|
|
}
|
|
|
-// 产品名映射
|
|
|
-const productNameMapping = (data) => {
|
|
|
- const nameMapping = {
|
|
|
- 'com.brother.pdfreaderpro.mac.product_1': 'PDF Reader Pro for Mac',
|
|
|
- 'com.brother.pdfreaderpro.windows.product_1': 'PDF Reader Pro for Windows',
|
|
|
- 'com.brother.pdfreaderpro.mac.product_3': 'PDF Reader Pro for Mac (With PDF to Office Pack)',
|
|
|
- 'com.brother.pdfreaderpro.windows.product_3': 'PDF Reader Pro for Windows (With PDF to Office Pack)',
|
|
|
- 'com.brother.pdfreaderpro.cross.platform.product_3': 'PDF Reader Pro Cross-Platform (With PDF to Office Pack)'
|
|
|
- }
|
|
|
- return data.map((item) => {
|
|
|
- if (Object.prototype.hasOwnProperty.call(nameMapping, item.code)) {
|
|
|
- item.name = nameMapping[item.code]
|
|
|
- }
|
|
|
- return item
|
|
|
- })
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<template>
|