diff --git a/src/locales/lang/zh-CN/menu.js b/src/locales/lang/zh-CN/menu.js
index 2c1a183..4271195 100644
--- a/src/locales/lang/zh-CN/menu.js
+++ b/src/locales/lang/zh-CN/menu.js
@@ -51,4 +51,5 @@ export default {
friendlyLinks:'友情链接',
websiteStatement:'网站声明',
contactUs:'联系我们',
+ productType:'产品分类'
}
diff --git a/src/router/routes/product.js b/src/router/routes/product.js
index 1762640..1c8b7a0 100644
--- a/src/router/routes/product.js
+++ b/src/router/routes/product.js
@@ -13,4 +13,16 @@ export default [
permission: '*',
},
},
+ {
+ path: 'productType',
+ name: 'productType',
+ component: 'productType/index.vue',
+ meta: {
+ icon: ShoppingOutlined,
+ title: '产品分类',
+ isMenu: true,
+ keepAlive: true,
+ permission: '*',
+ },
+ },
]
diff --git a/src/views/product/components/EditDialog.vue b/src/views/product/components/EditDialog.vue
index ba87c93..fc443e9 100644
--- a/src/views/product/components/EditDialog.vue
+++ b/src/views/product/components/EditDialog.vue
@@ -1,137 +1,91 @@
+ :after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.categoryIDName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 删除
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ item.categoryIDName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- 新增产品功能特点
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 删除
+
+
-
-
-
+
+ 新增产品功能特点
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
删除
@@ -143,76 +97,14 @@
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新增产品类别
-
-
@@ -221,7 +113,7 @@ import { cloneDeep } from 'lodash-es'
import { ref, onBeforeMount } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
-import { useForm, useModal,useSpining } from '@/hooks'
+import { useForm, useModal, useSpining } from '@/hooks'
import { message } from 'ant-design-vue'
import { useI18n } from 'vue-i18n'
@@ -239,7 +131,7 @@ const emit = defineEmits(['ok'])
const { t } = useI18n() // 解构出t方法
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
-const { spining,showSpining,hideSpining} = useSpining()
+const { spining, showSpining, hideSpining } = useSpining()
const cancelText = ref(t('button.cancel'))
const okText = ref(t('button.confirm'))
const rolesValue = ref([])
@@ -251,6 +143,7 @@ const mainImage = ref([])
const contentImage = ref([])
const childOpen = ref(false)
const formArea = ref({ name: '', status: 'enabled' })
+const activeKey=ref('1')
formRules.value = {
title: { required: true, message: '请输入产品类别名称' },
code: { required: true, message: '请输入产品名称' },
@@ -264,6 +157,7 @@ formRules.value = {
contentImage: { required: false, message: '请上传产品内容图片' },
sequence: [{ required: true, message: '请输入产品排序' }],
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
+
}
const areaFormRules = {
categoryIDName: [{ required: true, message: '请输入产品类别' }],
@@ -283,7 +177,7 @@ const initDataBatch = async (configs) => {
const mapped = data.map(item => {
return {
value: item.value,
- children:item.children,
+ children: item.children,
[resultKey]: item.label,// e.g. item['label']
}
})
@@ -328,26 +222,24 @@ function handleCreate() {
compose: '',
target: '',
feature: [{
- label:'功能特点',
- data:[{
- msg:[''],
- }]
- }],
+ label: '功能特点',
+ data: []
+ }],
standard: [{
label: '',
- val: '' ,
- fu_hoao: '' ,
- prx: '' ,
+ val: '',
+ fu_hoao: '',
+ prx: '',
}],
images: [
...(Array.isArray(formData.value.mainImage)
- ? formData.value.mainImage
- : [formData.value.mainImage]
+ ? formData.value.mainImage
+ : [formData.value.mainImage]
).filter(Boolean).map(item => String(item)),
...(Array.isArray(formData.value.contentImage)
- ? formData.value.contentImage
- : [formData.value.contentImage]
+ ? formData.value.contentImage
+ : [formData.value.contentImage]
).filter(Boolean).map(item => String(item))
],
@@ -406,26 +298,24 @@ async function handleEdit(record = {}) {
}
formData.value = {
...data,
- standard:data.standard|| [{
+ standard: data.standard || [{
label: '',
- val: '' ,
- fu_hoao: '' ,
- prx: '' ,
+ val: '',
+ fu_hoao: '',
+ prx: '',
}],
- feature:data.feature|| [{
- label:'功能特点',
- data:[{
- msg:[''],
- }]
+ feature: data.feature || [{
+ label: '功能特点',
+ data: []
}],
- // images:data.images || [''],
- mainImage: data.images?[config('http.apiBasic')+data.images[0]]:[''],
- contentImage:data.images?[config('http.apiBasic')+data.images[1]]:[''],
+ // images:data.images || [''],
+ mainImage: data.images ? [config('http.apiBasic') + data.images[0]] : [''],
+ contentImage: data.images ? [config('http.apiBasic') + data.images[1]] : [''],
}
// imgUrl.value = config('http.apiBasic') + data.img
- mainImage.value = config('http.apiBasic') + data.images?.[0] ,
- contentImage.value = config('http.apiBasic') + data.images?.[1] ,
- console.log('编辑产品数据:',formData.value);
+ mainImage.value = config('http.apiBasic') + data.images?.[0],
+ contentImage.value = config('http.apiBasic') + data.images?.[1],
+ console.log('编辑产品数据:', formData.value);
}
/**
@@ -438,28 +328,23 @@ function handleOk() {
showLoading()
const params = {
...values,
- standard:formData.value.standard ||
+ standard: formData.value.standard ||
[{
- label: '',
- val: '' ,
- fu_hoao: '' ,
- prx: '' ,
+ label: '',
+ val: '',
+ fu_hoao: '',
+ prx: '',
}],
- feature:formData.value.feature|| [{
- label:'功能特点',
- data:[{
- msg:[''],
- }]
- }],
+ feature: formData.value.feature,
images: [
...(Array.isArray(formData.value.mainImage)
- ? formData.value.mainImage
- : [formData.value.mainImage]
+ ? formData.value.mainImage
+ : [formData.value.mainImage]
).filter(Boolean).map(item => spliceUrl(item)),
...(Array.isArray(formData.value.contentImage)
- ? formData.value.contentImage
- : [formData.value.contentImage]
+ ? formData.value.contentImage
+ : [formData.value.contentImage]
).filter(Boolean).map(item => spliceUrl(item))
],
}
@@ -538,6 +423,4 @@ function removeFeature(index) {
}
-
+
diff --git a/src/views/productType/components/EditDialog.vue b/src/views/productType/components/EditDialog.vue
new file mode 100644
index 0000000..fc443e9
--- /dev/null
+++ b/src/views/productType/components/EditDialog.vue
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ item.categoryIDName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+ 新增产品功能特点
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+ 新增产品标准
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/productType/index.vue b/src/views/productType/index.vue
new file mode 100644
index 0000000..80b11c2
--- /dev/null
+++ b/src/views/productType/index.vue
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全部
+ 启用
+ 停用
+
+
+
+
+
+ {{ $t('button.reset') }}
+
+ {{ $t('button.search') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增产品
+
+
+
+
+
+
+
+ {{ record.title }}
+
+
+
+
+ {{ record.categoryID }}
+
+
+
+
+ {{ record.compose }}
+
+
+
+
+
+ {{ record.target }}
+
+
+
+
+
+
+
+
+
+ 启用
+ 停用
+
+
+
+
+
+ {{ $t('pages.system.user.edit') }}
+
+
+
+ {{ $t('pages.system.delete') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/websiteRelated/contactUs/components/EditDialog.vue b/src/views/websiteRelated/contactUs/components/EditDialog.vue
index aea6b2c..46f2abe 100644
--- a/src/views/websiteRelated/contactUs/components/EditDialog.vue
+++ b/src/views/websiteRelated/contactUs/components/EditDialog.vue
@@ -67,7 +67,7 @@ import { useForm, useModal } from '@/hooks'
import { message } from 'ant-design-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
-import { createMenu, getMenu, updateMenu } from '@/apis/modules/webSite'
+
const emit = defineEmits(['ok'])
const { t } = useI18n() // 解构出t方法
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()