generated from Leo_Ding/web-template
修复bug
This commit is contained in:
parent
cc53aed3f4
commit
eb5caa1ee0
4
.env.dev
4
.env.dev
@ -12,8 +12,8 @@ VITE_ROUTER_BASE=/
|
|||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# api
|
||||||
#VITE_API_BASIC=https://api.hailin-keji.com
|
VITE_API_BASIC=https://api.hailin-keji.com
|
||||||
VITE_API_BASIC=http://10.10.1.6:8060
|
# VITE_API_BASIC=http://10.10.1.6:8060
|
||||||
VITE_API_HTTP=/api/v1/
|
VITE_API_HTTP=/api/v1/
|
||||||
# storage
|
# storage
|
||||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||||
|
|||||||
@ -53,7 +53,6 @@ const uploadUrl = config('http.apiBasic') + '/api/v1/upload'
|
|||||||
const fileList = ref([]);
|
const fileList = ref([]);
|
||||||
// 初始化文件列表
|
// 初始化文件列表
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(' props.modelValue', props.modelValue)
|
|
||||||
fileList.value = props.modelValue.map(url => ({
|
fileList.value = props.modelValue.map(url => ({
|
||||||
uid: `preview-${Date.now()}-${Math.random()}`,
|
uid: `preview-${Date.now()}-${Math.random()}`,
|
||||||
name: url.substring(url.lastIndexOf('/') + 1),
|
name: url.substring(url.lastIndexOf('/') + 1),
|
||||||
|
|||||||
@ -103,7 +103,7 @@ const imgChange = (value) => {
|
|||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -89,7 +89,7 @@ const imgChange = (value) => {
|
|||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -126,7 +126,7 @@ const imgChange = (value, type) => {
|
|||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
@ -115,12 +115,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="timeline">
|
<!-- <div class="timeline">
|
||||||
<div v-for="item in listData" :key="item.id" class="timeline-item">
|
<div v-for="item in listData" :key="item.id" class="timeline-item">
|
||||||
<div class="timeline-date">{{ item.year }}年{{ item.month }}月</div>
|
<div class="timeline-date">{{ item.year }}年{{ item.month }}月</div>
|
||||||
<div class="timeline-event">{{ item.title }}</div>
|
<div class="timeline-event">{{ item.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,14 +34,14 @@
|
|||||||
<a-row :gutter="8" :wrap="false">
|
<a-row :gutter="8" :wrap="false">
|
||||||
<a-col flex="auto">
|
<a-col flex="auto">
|
||||||
<a-card type="flex">
|
<a-card type="flex">
|
||||||
<x-action-bar class="mb-8-2">
|
<!-- <x-action-bar class="mb-8-2">
|
||||||
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar> -->
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
@ -64,10 +64,10 @@
|
|||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||||
<edit-outlined /> </a-tooltip></x-action-button>
|
<edit-outlined /> </a-tooltip></x-action-button>
|
||||||
<x-action-button @click="handleDelete(record)">
|
<!-- <x-action-button @click="handleDelete(record)">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button> -->
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -98,7 +98,7 @@ const imgChange = (value) => {
|
|||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -14,13 +14,16 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'产品类别'" name="categoryIDs">
|
<a-form-item :label="'产品类别'" name="categoryIDs">
|
||||||
<a-tree-select v-model:value="formData.categoryIDs" :tree-data="categoryList"
|
<!-- <a-tree-select v-model:value="formData.categoryIDs" :tree-data="categoryList"
|
||||||
@change="handleTreeSelectChange" placeholder="请选择(只能选最后一级)"
|
@change="handleTreeSelectChange" placeholder="请选择(只能选最后一级)"
|
||||||
style="width: 100%" tree-default-expand-all/>
|
style="width: 100%" tree-default-expand-all/> -->
|
||||||
|
<a-tree-select v-model:value="formData.categoryIDs" style="width: 100%" :tree-data="categoryList"
|
||||||
|
tree-checkable allow-clear :show-checked-strategy="SHOW_PARENT"
|
||||||
|
placeholder="Please select" tree-node-filter-prop="label" @change="handleChange"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'原料组成'">
|
<a-form-item :label="'原料组成'" name="compose">
|
||||||
<a-textarea :placeholder="'请输入原料组成'"
|
<a-textarea :placeholder="'请输入原料组成'"
|
||||||
v-model:value="formData.compose"></a-textarea>
|
v-model:value="formData.compose"></a-textarea>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -139,13 +142,13 @@ const targetList = ref([])
|
|||||||
const images = ref([])
|
const images = ref([])
|
||||||
const contentImage = ref([])
|
const contentImage = ref([])
|
||||||
const childOpen = ref(false)
|
const childOpen = ref(false)
|
||||||
|
const categoryIDs=['']
|
||||||
const activeKey = ref('1')
|
const activeKey = ref('1')
|
||||||
formRules.value = {
|
formRules.value = {
|
||||||
title: { required: true, message: '请输入产品类别名称' },
|
title: { required: true, message: '请输入产品类别名称' },
|
||||||
code: { required: true, message: '请输入产品名称' },
|
code: { required: true, message: '请输入产品名称' },
|
||||||
categoryIDs: { required: true, message: '请选择产品类别', trigger: 'change' },
|
categoryIDs: { required: true, message: '请选择产品类别', trigger: 'change' },
|
||||||
compose: { required: true, message: '请选择产品适用对象', trigger: 'change' },
|
compose: { required: false, message: '请选择产品适用对象'},
|
||||||
feature: [{ required: true, message: '请输入产品功能特点', trigger: 'change' }],
|
feature: [{ required: true, message: '请输入产品功能特点', trigger: 'change' }],
|
||||||
// feature: [{ required: true, message: '请输入产品功能特点' }],
|
// feature: [{ required: true, message: '请输入产品功能特点' }],
|
||||||
standard: [{ required: true, message: '请输入产品标准' }],
|
standard: [{ required: true, message: '请输入产品标准' }],
|
||||||
@ -183,7 +186,7 @@ function handleCreate() {
|
|||||||
// 初始化所有字段
|
// 初始化所有字段
|
||||||
formData.value = {
|
formData.value = {
|
||||||
title: '',
|
title: '',
|
||||||
categoryIDs:'',
|
categoryIDs: [],
|
||||||
compose: '',
|
compose: '',
|
||||||
target: '',
|
target: '',
|
||||||
feature: [{
|
feature: [{
|
||||||
@ -238,9 +241,8 @@ async function handleEdit(record = {}) {
|
|||||||
}
|
}
|
||||||
formData.value = {
|
formData.value = {
|
||||||
...data,
|
...data,
|
||||||
categoryIDs:data.categoryID,
|
categoryIDs: data.categoryID,
|
||||||
categoryID:data.categoryID,
|
categoryRootID: data.categoryRootID,
|
||||||
categoryRootID:data.categoryRootID,
|
|
||||||
standard: data.standard || [{
|
standard: data.standard || [{
|
||||||
label: '',
|
label: '',
|
||||||
val: '',
|
val: '',
|
||||||
@ -252,7 +254,7 @@ async function handleEdit(record = {}) {
|
|||||||
data: []
|
data: []
|
||||||
}],
|
}],
|
||||||
// images:data.images || [''],
|
// images:data.images || [''],
|
||||||
mainImage: data.images ? data.images.map(item=>config('http.apiBasic')+item):[''],
|
mainImage: data.images ? data.images.map(item => config('http.apiBasic') + item) : [''],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,8 +268,8 @@ function handleOk() {
|
|||||||
showLoading()
|
showLoading()
|
||||||
const params = {
|
const params = {
|
||||||
...values,
|
...values,
|
||||||
categoryID:formData.value.categoryID,
|
categoryID: formData.value.categoryIDs,
|
||||||
categoryRootID:formData.value.categoryRootID,
|
categoryRootID: formData.value.categoryRootID,
|
||||||
standard: formData.value.standard ||
|
standard: formData.value.standard ||
|
||||||
[{
|
[{
|
||||||
label: '',
|
label: '',
|
||||||
@ -276,8 +278,9 @@ function handleOk() {
|
|||||||
prx: '',
|
prx: '',
|
||||||
}],
|
}],
|
||||||
feature: formData.value.feature,
|
feature: formData.value.feature,
|
||||||
images: formData.value.mainImage?formData.value.mainImage.map(item=>spliceUrl(item)):[''],
|
images: formData.value.mainImage ? formData.value.mainImage.map(item => spliceUrl(item)) : [''],
|
||||||
}
|
}
|
||||||
|
console.log(params)
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
case 'create':
|
case 'create':
|
||||||
@ -366,16 +369,17 @@ const findNodePath = (tree, value, path = []) => {
|
|||||||
// 获取节点是否是叶子节点
|
// 获取节点是否是叶子节点
|
||||||
const isLeafNode = (id) => {
|
const isLeafNode = (id) => {
|
||||||
const node = findNodeById(categoryList.value, id);
|
const node = findNodeById(categoryList.value, id);
|
||||||
if(node.children.length>0) return false;
|
if (node.children.length > 0) return false;
|
||||||
else return true
|
else return true
|
||||||
};
|
};
|
||||||
|
//根据Id
|
||||||
// 根据ID查找节点
|
// 根据ID查找节点
|
||||||
const findNodeById = (tree, value) => {
|
const findNodeById = (tree, value) => {
|
||||||
for (const node of tree) {
|
for (const node of tree) {
|
||||||
if (node.value === value) return node;
|
if (node.value == value) return node.value;
|
||||||
if(node.children){
|
if (node.children) {
|
||||||
const found=findNodeById(node.children,value)
|
const found = findNodeById(node.children, value)
|
||||||
if(found) return found;
|
if (found) return found.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -383,18 +387,43 @@ const findNodeById = (tree, value) => {
|
|||||||
// 处理选择事件
|
// 处理选择事件
|
||||||
const handleTreeSelectChange = (value) => {
|
const handleTreeSelectChange = (value) => {
|
||||||
// 验证是否叶子节点
|
// 验证是否叶子节点
|
||||||
if (!isLeafNode(value)) {
|
// if (!isLeafNode(value)) {
|
||||||
message.warning('只能选择最后一级节点');
|
// message.warning('只能选择最后一级节点');
|
||||||
formData.value.categoryID = null; // 清除非叶子选择
|
// formData.value.categoryID = null; // 清除非叶子选择
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (!value) return;
|
// if (!value) return;
|
||||||
const pathIds = findNodePath(categoryList.value, value);
|
const pathIds = findNodePath(categoryList.value, value);
|
||||||
if (pathIds) {
|
if (pathIds) {
|
||||||
console.log('选中的路径ID数组:', pathIds);
|
console.log('选中的路径ID数组:', pathIds);
|
||||||
// 实际使用中,此处可提交 pathIds 到后端或进行其他操作
|
// 实际使用中,此处可提交 pathIds 到后端或进行其他操作
|
||||||
formData.value.categoryID=pathIds[1]
|
formData.value.categoryID = pathIds[1]
|
||||||
formData.value.categoryRootID=pathIds[0]
|
formData.value.categoryRootID = pathIds[0]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 递归查找父节点 key 的函数
|
||||||
|
const getParentKey = (key, tree) => {
|
||||||
|
for (const node of tree) {
|
||||||
|
if (node.children) {
|
||||||
|
if (node.children.some(child => child.value === key)) {
|
||||||
|
return node.value; // 返回直接父节点 key
|
||||||
|
}
|
||||||
|
const parentKey = getParentKey(key, node.children);
|
||||||
|
if (parentKey) return parentKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理选择变化
|
||||||
|
const handleChange = (selectedKeys) => {
|
||||||
|
if (selectedKeys.length > 0) {
|
||||||
|
const lastSelectedKey = selectedKeys[selectedKeys.length - 1];
|
||||||
|
const parentKey = getParentKey(lastSelectedKey, categoryList.value);
|
||||||
|
|
||||||
|
console.log('选中的父级值:', parentKey);
|
||||||
|
formData.value.categoryRootID=parentKey
|
||||||
|
// 使用父级值做其他操作...
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
<template #default="{ gutter, colSpan }">
|
<template #default="{ gutter, colSpan }">
|
||||||
<a-form :model="searchFormData" layout="inline">
|
<a-form :model="searchFormData" layout="inline">
|
||||||
<a-row :gutter="gutter">
|
<a-row :gutter="gutter">
|
||||||
<a-col v-bind="colSpan">
|
<!-- <a-col v-bind="colSpan">
|
||||||
<a-form-item label="产品类别名称" name="title">
|
<a-form-item label="产品类别名称" name="title">
|
||||||
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.title"></a-input>
|
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.title"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col> -->
|
||||||
<a-col v-bind="colSpan">
|
<a-col v-bind="colSpan">
|
||||||
<a-form-item label="产品名称" name="code">
|
<a-form-item label="产品名称" name="code">
|
||||||
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.code"></a-input>
|
<a-input placeholder="请输入产品名称" v-model:value="searchFormData.code"></a-input>
|
||||||
@ -123,7 +123,7 @@ defineOptions({
|
|||||||
const { t } = useI18n() // 解构出t方法
|
const { t } = useI18n() // 解构出t方法
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '产品名称', dataIndex: 'code', width: 120, ellipsis:true},
|
{ title: '产品名称', dataIndex: 'code', width: 120, ellipsis:true},
|
||||||
{ title: '产品类别', dataIndex: 'categoryID', key: 'categoryID', width: 120 },
|
{ title: '产品类别', dataIndex: 'categoryRootName', key: 'categoryRootName', width: 120 },
|
||||||
{ title: '适用对象', dataIndex: 'target', width: 120 },
|
{ title: '适用对象', dataIndex: 'target', width: 120 },
|
||||||
{ title: '原料组成', dataIndex: 'compose', key: 'compose', width: 120 },
|
{ title: '原料组成', dataIndex: 'compose', key: 'compose', width: 120 },
|
||||||
// {
|
// {
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'基地排序'" name="name">
|
<a-form-item :label="'基地排序'" name="name">
|
||||||
<a-input v-model:value="formArea.sequence" :placeholder="'请输入基地排序'" />
|
<a-input-number v-model:value="formArea.sequence" :placeholder="'请输入基地排序'" style="width: 100%;"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|||||||
@ -239,7 +239,6 @@ function handleDelete({ id }) {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getMenuList()
|
await getMenuList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -226,7 +226,6 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -97,7 +97,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
@ -104,7 +104,7 @@ const imgChange = (value) => {
|
|||||||
function handleCreate() {
|
function handleCreate() {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,6 +76,7 @@ import { spliceUrl } from '@/utils/util'
|
|||||||
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
||||||
import XSearchBar from '@/components/SearchBar/SearchBar.vue'
|
import XSearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
import GxUpload from '@/components/GxUpload/index.vue' // 获取声明接口
|
import GxUpload from '@/components/GxUpload/index.vue' // 获取声明接口
|
||||||
|
import { config } from '@/config'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'contactUs',
|
name: 'contactUs',
|
||||||
})
|
})
|
||||||
@ -109,19 +110,14 @@ async function getPageList() {
|
|||||||
id.value = res.data.id
|
id.value = res.data.id
|
||||||
affirm.value = res.data.affirm
|
affirm.value = res.data.affirm
|
||||||
reportContent.value = res.data.reportContent
|
reportContent.value = res.data.reportContent
|
||||||
reportImage.value = res.data.reportImage
|
reportImage.value = [config('http.apiBasic')+res.data.reportImage]
|
||||||
email.value = res.data.email
|
email.value = res.data.email
|
||||||
lat.value = res.data.lat
|
lat.value = res.data.lat
|
||||||
lon.value = res.data.lon
|
lon.value = res.data.lon
|
||||||
address.value = res.data.address
|
address.value = res.data.address
|
||||||
phone.value = res.data.phone
|
phone.value = res.data.phone
|
||||||
reportNum.value = res.data.reportNum
|
reportNum.value = res.data.reportNum
|
||||||
|
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia.map(item=>({link:item.link,name:item.name,image:[config('http.apiBasic')+item.image]})) : []
|
||||||
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
|
||||||
|
|
||||||
//console.log(affirm.value)
|
|
||||||
console.log("web-Id:",id.value)
|
|
||||||
console.log('webData',res.data)
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error('获取声明内容失败')
|
message.error('获取声明内容失败')
|
||||||
@ -135,7 +131,6 @@ async function getPageList() {
|
|||||||
async function handleSearch() {
|
async function handleSearch() {
|
||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
console.log("id.value:", id.value)
|
|
||||||
// 转换 socialMedia.image 为字符串
|
// 转换 socialMedia.image 为字符串
|
||||||
// const formattedSocialMedia = Array.isArray(socialMedia.value)
|
// const formattedSocialMedia = Array.isArray(socialMedia.value)
|
||||||
// ? socialMedia.value.map(item => ({
|
// ? socialMedia.value.map(item => ({
|
||||||
|
|||||||
@ -79,7 +79,7 @@ function handleCreate() {
|
|||||||
showModal({
|
showModal({
|
||||||
type: 'create',
|
type: 'create',
|
||||||
// 80对应about
|
// 80对应about
|
||||||
title: '添加公司动态',
|
title: '添加',
|
||||||
})
|
})
|
||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined></plus-outlined>
|
<plus-outlined></plus-outlined>
|
||||||
</template>
|
</template>
|
||||||
新增动态
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
</x-action-bar>
|
</x-action-bar>
|
||||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user