diff --git a/src/views/product/components/EditDialog.vue b/src/views/product/components/EditDialog.vue
index 3f3aa09..a49f3a0 100644
--- a/src/views/product/components/EditDialog.vue
+++ b/src/views/product/components/EditDialog.vue
@@ -1,154 +1,191 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
新增产品类别
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+ 新增产品标准
+
+
+
+
+
+
+
+ imgChange(index, value)" />
+ 删除
+
+
+
+ 新增产品图片
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
+
+ 新增产品类别
+
+
+
diff --git a/src/views/product/index.vue b/src/views/product/index.vue
index a4e21dc..c11a23f 100644
--- a/src/views/product/index.vue
+++ b/src/views/product/index.vue
@@ -45,21 +45,32 @@
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
-
-
- {{ record.introduce }}
+
+
+ {{ record.title }}
-
-
- {{ record.duty }}
+
+
+ {{ record.categoryID }}
+
+
+
+
+ {{ record.compose }}
+
+
+ {{ record.target }}
+
+
启用
停用
+
@@ -91,21 +102,66 @@ import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
+import { delProductsItem, getProductsList } from '@/apis/modules/products'
defineOptions({
- name: 'homeBanner',
+ name: 'components',
})
const { t } = useI18n() // 解构出t方法
+// const columns = [
+// { title: '产品名称', dataIndex: 'title', width: 120, },
+// { title: '产品类别', dataIndex: 'categoryID', key: 'categoryID', width: 120 },
+// { title: '原料组成', dataIndex: 'compose', key: 'compose',width: 120},
+// { title: '适用对象', dataIndex: 'target',width: 120},
+// { title: '功能特点', dataIndex: 'feature', width: 120, align: 'center'},
+// { title: '产品标准', dataIndex: 'standard', width: 120, align: 'center'},
+// { title: '产品图片', dataIndex: 'images', width: 120, align: 'center'},
+// { title: '产品排序', dataIndex: 'sequence', width: 120, align: 'center'},
+// { title: '产品状态', dataIndex: 'status',width:120 , align: 'center'},
+// { title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
+// ]
const columns = [
- { title: '招聘岗位', dataIndex: 'title', width: 120, },
- { title: '所属基地', dataIndex: 'areaName', key: 'title', width: 150 },
- { title: '岗位要求', dataIndex: 'introduce', key: 'introduce'},
- { title: '岗位职责', dataIndex: 'duty',ellipsis: true,},
- { title: '薪资范畴', dataIndex: 'salary', width: 120, align: 'center'},
- { title: '岗位排序', dataIndex: 'sequence', width: 120, align: 'center'},
- { title: '状态', dataIndex: 'status',width:80 , align: 'center'},
+ { title: '产品名称', dataIndex: 'title', width: 120 },
+ { title: '产品类别', dataIndex: 'categoryID', key: 'categoryID', width: 120 },
+ { title: '原料组成', dataIndex: 'compose', key: 'compose', width: 120 },
+ { title: '适用对象', dataIndex: 'target', width: 120 },
+
+ {
+ title: '功能特点',
+ dataIndex: 'feature',
+ width: 120,
+ align: 'center',
+ customRender: ({ text }) => Array.isArray(text) ? text.join(', ') : ''
+ },
+
+ {
+ title: '产品标准',
+ dataIndex: 'standard',
+ width: 120,
+ align: 'center',
+ customRender: ({ text }) => Array.isArray(text)
+ ? text.map(item => `${item.label}: ${item.value}`).join(', ')
+ : ''
+ },
+
+ {
+ title: '产品图片',
+ dataIndex: 'images',
+ width: 120,
+ align: 'center',
+ customRender: ({ text }) => {
+ if (Array.isArray(text) && text.length > 0) {
+ return `
`
+ }
+ return '-'
+ }
+ },
+
+ { title: '产品排序', dataIndex: 'sequence', width: 120, align: 'center' },
+ { title: '产品状态', dataIndex: 'status', width: 120, align: 'center' },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
]
+
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } =
usePagination()
@@ -119,8 +175,8 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
- const { success, data, total } = await apis.recruitment
- .getDataList({
+ const { success, data, total } = await apis.products
+ .getProductsList({
pageSize,
page: current,
...searchFormData.value,
@@ -150,7 +206,7 @@ function handleDelete({ id }) {
return new Promise((resolve, reject) => {
; (async () => {
try {
- const { success } = await apis.recruitment.delItem(id).catch(() => {
+ const { success } = await apis.products.delProductsItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
@@ -198,6 +254,16 @@ async function onOk() {
message.success(t('component.message.success.delete'))
await getPageList()
}
+
+function addImage() {
+ images.value.push('')
+}
+
+function removeImage(index) {
+ if (images.value.length > 1) {
+ images.value.splice(index, 1)
+ }
+}