generated from Leo_Ding/web-template
11
This commit is contained in:
parent
2375cddadb
commit
acbb5f642b
14
src/apis/modules/companies.js
Normal file
14
src/apis/modules/companies.js
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 海邻大事记动态接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取菜单列表
|
||||
export const getCompanies = (params) => request.basic.get('/api/v1/companies ', params)
|
||||
// 获取菜单条数据
|
||||
export const getMenuCompanies = (id) => request.basic.get(`/api/v1/companies/${id}`)
|
||||
// 添加菜单
|
||||
export const createCompaniesMenu = (params) => request.basic.post('/api/v1/companies', params)
|
||||
// 更新菜单
|
||||
export const updateCompanies = (id, params) => request.basic.put(`/api/v1/companies/${id}`, params)
|
||||
// 删除菜单
|
||||
export const delCompanies = (id) => request.basic.delete(`/api/v1/companies/${id}`)
|
||||
@ -48,7 +48,7 @@ export default {
|
||||
product:'产品中心',
|
||||
team:'技术团队',
|
||||
importantEvents:'发展历程',
|
||||
websiteRelated:'网站相关',
|
||||
websiteRelated:'联系我们',
|
||||
friendlyLinks:'友情链接',
|
||||
websiteStatement:'网站声明',
|
||||
contactUs:'联系我们',
|
||||
@ -58,5 +58,10 @@ export default {
|
||||
productClassify:'产品分类',
|
||||
technologyCenter:'技术中心',
|
||||
environment:'办公环境',
|
||||
other:'其他',
|
||||
logo: '海邻logo',
|
||||
officialWeChat:'官方微信',
|
||||
Profile:'企业简介',
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
export default {
|
||||
'pages.layouts.userLayout.title':
|
||||
'成为中国领先的新型饲用蛋白供应商',
|
||||
'pages.layouts.userLayout.title': '成为中国领先的新型饲用蛋白供应商',
|
||||
'pages.login.accountLogin.tab': '账户密码登录',
|
||||
'pages.login.failure': '登录失败,请重试!',
|
||||
'pages.login.success': '登录成功!',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { PictureOutlined } from '@ant-design/icons-vue'
|
||||
import { DeploymentUnitOutlined } from '@ant-design/icons-vue'
|
||||
|
||||
export default [
|
||||
{
|
||||
@ -6,24 +6,24 @@ export default [
|
||||
name: 'AboutY',
|
||||
component: 'RouteViewLayout',
|
||||
meta: {
|
||||
icon: PictureOutlined,
|
||||
icon: DeploymentUnitOutlined,
|
||||
title: '关于海邻',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
},
|
||||
children: [
|
||||
// {
|
||||
// path: 'Profile',
|
||||
// name: 'Profile',
|
||||
// component: 'AboutY/Profile/index.vue',
|
||||
// meta: {
|
||||
// title: '企业简介',
|
||||
// isMenu: true,
|
||||
// keepAlive: true,
|
||||
// permission: '*',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: 'Profile',
|
||||
name: 'Profile',
|
||||
component: 'AboutY/Profile/index.vue',
|
||||
meta: {
|
||||
title: '企业简介',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'importantEvents',
|
||||
name: 'importantEvents',
|
||||
@ -36,9 +36,9 @@ export default [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'researchHonor',
|
||||
name: 'researchHonor',
|
||||
component: 'AboutY/researchHonor/index.vue',
|
||||
path: 'corporateHonor',
|
||||
name: 'corporateHonor',
|
||||
component: 'AboutY/corporateHonor/index.vue',
|
||||
meta: {
|
||||
title: '企业荣誉',
|
||||
isMenu: true,
|
||||
|
||||
@ -1,3 +1,69 @@
|
||||
// import { EllipsisOutlined } from '@ant-design/icons-vue'
|
||||
//
|
||||
// export default [
|
||||
// {
|
||||
// path: 'other',
|
||||
// name: 'other',
|
||||
// component: 'RouteViewLayout',
|
||||
// meta: {
|
||||
// icon: EllipsisOutlined,
|
||||
// title: '其他',
|
||||
// isMenu: true,
|
||||
// keepAlive: true,
|
||||
// permission: '*',
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: 'logo',
|
||||
// name: 'logo',
|
||||
// component: 'other/logo/index.vue',
|
||||
// meta: {
|
||||
// layout: 'CustomLayout',
|
||||
// title: '海邻logo',
|
||||
// isMenu: true,
|
||||
// target: '_blank',
|
||||
// keepAlive: true,
|
||||
// permission: '*',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'officialWeChat',
|
||||
// name: 'officialWeChat',
|
||||
// component: 'other/officialWeChat/index.vue',
|
||||
// meta: {
|
||||
// layout: 'CustomLayout',
|
||||
// title: '官方微信',
|
||||
// isMenu: true,
|
||||
// target: '_blank',
|
||||
// keepAlive: true,
|
||||
// permission: '*',
|
||||
// },
|
||||
// },
|
||||
// // {
|
||||
// // path: 'multi-tab',
|
||||
// // name: 'otherMultiTab',
|
||||
// // component: 'other/multi-tab/index.vue',
|
||||
// // meta: {
|
||||
// // title: '多标签操作',
|
||||
// // isMenu: true,
|
||||
// // keepAlive: true,
|
||||
// // permission: '*',
|
||||
// // },
|
||||
// // },
|
||||
// // {
|
||||
// // path: 'badge',
|
||||
// // name: 'otherBadge',
|
||||
// // component: 'other/badge/index.vue',
|
||||
// // meta: {
|
||||
// // title: '菜单徽标',
|
||||
// // isMenu: true,
|
||||
// // keepAlive: true,
|
||||
// // permission: '*',
|
||||
// // },
|
||||
// // },
|
||||
// ],
|
||||
// },
|
||||
// ]
|
||||
import { EllipsisOutlined } from '@ant-design/icons-vue'
|
||||
|
||||
export default [
|
||||
@ -14,35 +80,22 @@ export default [
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'custom-layout',
|
||||
name: 'otherCustomLayout',
|
||||
component: '/list/basic/index.vue',
|
||||
path: 'logo',
|
||||
name: 'logo',
|
||||
component: 'other/logo/index.vue',
|
||||
meta: {
|
||||
layout: 'CustomLayout',
|
||||
title: '自定义框架',
|
||||
isMenu: true,
|
||||
target: '_blank',
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'multi-tab',
|
||||
name: 'otherMultiTab',
|
||||
component: '/other/multi-tab/index.vue',
|
||||
meta: {
|
||||
title: '多标签操作',
|
||||
title: 'logo',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'badge',
|
||||
name: 'otherBadge',
|
||||
component: 'other/badge/index.vue',
|
||||
path: 'officialWeChat',
|
||||
name: 'officialWeChat',
|
||||
component: 'other/officialWeChat/index.vue',
|
||||
meta: {
|
||||
title: '菜单徽标',
|
||||
title: '官方微信',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
permission: '*',
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
// },
|
||||
// },
|
||||
// ]
|
||||
import { PictureOutlined } from '@ant-design/icons-vue'
|
||||
import { ShoppingOutlined } from '@ant-design/icons-vue'
|
||||
|
||||
export default [
|
||||
{
|
||||
@ -34,7 +34,7 @@ export default [
|
||||
name: 'productY',
|
||||
component: 'RouteViewLayout',
|
||||
meta: {
|
||||
icon: PictureOutlined,
|
||||
icon: ShoppingOutlined,
|
||||
title: '产品中心',
|
||||
isMenu: true,
|
||||
keepAlive: true,
|
||||
|
||||
213
src/views/AboutY/Profile/index.vue
Normal file
213
src/views/AboutY/Profile/index.vue
Normal file
@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form-item :label="'零容忍'" name="reportContent">
|
||||
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'零容忍图片'" name="reportImage">
|
||||
<!-- <x-upload-image v-model="reportImage" @imgChange="imgChange" />-->
|
||||
<gx-upload v-model="reportImage" :fileNumber="1" />
|
||||
<p class="hint">750*500px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'举报邮箱'" name="email">
|
||||
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'经度'" name="lat">
|
||||
<a-input-number :placeholder="'请输入经度'" v-model:value="lat"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'纬度'" name="lon">
|
||||
<a-input-number :placeholder="'请输入经度'" v-model:value="lon"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'地址'" name="address">
|
||||
<a-input :placeholder="'请输入地址'" v-model:value="address"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'电话'" name="phone">
|
||||
<a-input :placeholder="'请输入电话'" v-model:value="phone"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'编码'" name="reportNum">
|
||||
<a-input :placeholder="'请输入编码'" v-model:value="reportNum"></a-input>
|
||||
</a-form-item>
|
||||
<template v-if="Array.isArray(socialMedia)">
|
||||
<a-form-item
|
||||
v-for="(itemImg, index) in socialMedia"
|
||||
:key="index"
|
||||
:label="itemImg.name || `社交媒体${index + 1}`">
|
||||
<a-input
|
||||
class="inputPhone"
|
||||
v-model:value="itemImg.name"
|
||||
placeholder="请输入图片名称"
|
||||
/>
|
||||
<gx-upload
|
||||
v-model="itemImg.image"
|
||||
:fileNumber="1"
|
||||
/>
|
||||
<p class="hint">106*106px,图片大小不超过50kb</p>
|
||||
<a-input
|
||||
class="inputPhone"
|
||||
v-model:value="itemImg.link"
|
||||
placeholder="请输入跳转链接"
|
||||
/>
|
||||
<a-button
|
||||
danger
|
||||
@click="removeSocialMedia(index)"
|
||||
size="small"
|
||||
style="margin-bottom: 20px">删除
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button
|
||||
type="dashed"
|
||||
block
|
||||
@click="addSocialMedia">新增社交媒体
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
|
||||
</template>
|
||||
<x-editor :modelValue="affirm" @update:modelValue="affirm = $event" placeholder="请输入声明内容"></x-editor>
|
||||
<a-button ghost type="primary" @click="handleSearch" style="margin-top: 20px">保存</a-button>
|
||||
</template>
|
||||
</x-search-bar>
|
||||
</template>
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis' // 假设这里包含 saveAffirm 接口
|
||||
import { usePagination } from '@/hooks'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { spliceUrl } from '@/utils/util'
|
||||
import { getWebData,updateWebData} from '@/apis/modules/webSite'
|
||||
import XSearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||
import GxUpload from '@/components/GxUpload/index.vue' // 获取声明接口
|
||||
import { config } from '@/config'
|
||||
import { getCompanies } from '@/apis/modules/companies'
|
||||
defineOptions({
|
||||
name: 'contactUs',
|
||||
})
|
||||
const { t } = useI18n()
|
||||
const { showLoading, hideLoading } = usePagination()
|
||||
const affirm = ref(null)
|
||||
const id = ref(null)
|
||||
const reportContent = ref(null)
|
||||
const reportImage = ref(null)
|
||||
const email = ref(null)
|
||||
const lat = ref(null)
|
||||
const lon = ref(null)
|
||||
const address = ref(null)
|
||||
const phone = ref(null)
|
||||
const reportNum = ref(null)
|
||||
const socialMedia = ref([{ name: '', image: '', link: '' }])
|
||||
const imgChange = (index, value) => {
|
||||
socialMedia.value[index].image = value
|
||||
reportImage.value = value
|
||||
}
|
||||
// 页面加载时获取声明内容
|
||||
getPageList()
|
||||
/**
|
||||
* 获取声明内容
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const res = await getCompanies() // 假设返回格式为 { data: { affirm: '内容' } }
|
||||
if (res?.data) {
|
||||
id.value = res.data.id
|
||||
affirm.value = res.data.affirm
|
||||
reportContent.value = res.data.reportContent
|
||||
reportImage.value = [config('http.apiBasic')+res.data.reportImage]
|
||||
email.value = res.data.email
|
||||
lat.value = res.data.lat
|
||||
lon.value = res.data.lon
|
||||
address.value = res.data.address
|
||||
phone.value = res.data.phone
|
||||
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]})) : []
|
||||
}
|
||||
} catch (e) {
|
||||
message.error('获取声明内容失败')
|
||||
} finally {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 提交声明内容
|
||||
*/
|
||||
async function handleSearch() {
|
||||
try {
|
||||
showLoading()
|
||||
// 转换 socialMedia.image 为字符串
|
||||
// const formattedSocialMedia = Array.isArray(socialMedia.value)
|
||||
// ? socialMedia.value.map(item => ({
|
||||
// ...item,
|
||||
// image: Array.isArray(item.image) ? item.image[0] : item.image
|
||||
// }))
|
||||
// : []
|
||||
const formattedSocialMedia = Array.isArray(socialMedia?.value)
|
||||
? socialMedia.value.map(item => {
|
||||
const imageRaw = Array.isArray(item?.image)
|
||||
? item.image[0]
|
||||
: item?.image;
|
||||
|
||||
return {
|
||||
...item,
|
||||
image: spliceUrl(imageRaw)
|
||||
};
|
||||
})
|
||||
: [];
|
||||
|
||||
const reportImageRaw = Array.isArray(reportImage?.value)
|
||||
? reportImage.value[0]
|
||||
: reportImage?.value;
|
||||
const reportImageFormatted = {
|
||||
reportImage: spliceUrl(reportImageRaw)};
|
||||
|
||||
await apis.webSite.updateWebData(id.value, {
|
||||
affirm: affirm.value,
|
||||
reportContent: reportContent.value,
|
||||
reportImage: reportImageFormatted.reportImage,
|
||||
//reportImage:Array.isArray(reportImage.value) ? reportImage.value[0] : reportImage.value,
|
||||
email: email.value,
|
||||
lat: lat.value,
|
||||
lon: lon.value,
|
||||
address: address.value,
|
||||
phone: phone.value,
|
||||
reportNum: reportNum.value,
|
||||
socialMedia: formattedSocialMedia,
|
||||
})
|
||||
// await apis.webSite.updateWebData(id.value, {
|
||||
// affirm: affirm.value,
|
||||
// reportContent: reportContent.value,
|
||||
//
|
||||
// reportImage: reportImage.value,
|
||||
//
|
||||
// email: email.value,
|
||||
// lat: lat.value,
|
||||
// lon: lon.value,
|
||||
// address: address.value,
|
||||
// phone: phone.value,
|
||||
// reportNum: reportNum.value,
|
||||
//
|
||||
// socialMedia: socialMedia.value,
|
||||
// })
|
||||
message.success('保存成功')
|
||||
} catch (e) {
|
||||
message.error('保存失败,请重试')
|
||||
} finally {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
function addSocialMedia() {
|
||||
socialMedia.value.push({ name: '', image: '', link: '' })
|
||||
}
|
||||
|
||||
function removeSocialMedia(index) {
|
||||
socialMedia.value.splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">406*270px,图片大小不要超过200kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -194,4 +195,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="imgUrl">
|
||||
<x-upload-image v-model="imgUrl" @imgChange="imgChange" />
|
||||
<p class="hint">683*339px,图片大小不超过900kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -222,4 +223,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="imgUrl">
|
||||
<x-upload-image v-model="imgUrl" @imgChange="imgChange" />
|
||||
<p class="hint">240*155px,图片大小不超过100kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -208,4 +209,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
<!-- <a-textarea :placeholder="'请输入内容'" v-model:value="formData.subheading"></a-textarea>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'链接'" name="link">
|
||||
<a-input v-model:value="formData.link" :placeholder="'请输入链接'" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">-->
|
||||
<!-- <a-form-item :label="'链接'" name="link">-->
|
||||
<!-- <a-input v-model:value="formData.link" :placeholder="'请输入链接'" />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'日期'" name="pushAt">
|
||||
<a-date-picker v-model:value="formData.pushAt" :format="'YYYY-MM-DD'" placeholder="选择日期" style="width: 100%;">
|
||||
@ -37,11 +37,13 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'大图片'" name="fullImg">
|
||||
<x-upload-image v-model="fullImg" @imgChange="(val) => imgChange(val, 'fullImg')" />
|
||||
<p class="hint">大图片尺寸:1400*350px,图片大小不超过900kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'小图片'" name="smallImg">
|
||||
<x-upload-image v-model="smallImg" @imgChange="(val) => imgChange(val, 'smallImg')" />
|
||||
<p class="hint">小图片尺寸:256*146px,图片大小不超过900kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@ -103,7 +105,7 @@ const videoUrl = ref([''])
|
||||
formRules.value = {
|
||||
title: { required: true, message: '请输入标题' },
|
||||
subheading: { required: false, message: '请输入内容' },
|
||||
link: { required: false, message: '请输入链接' },
|
||||
// link: { required: false, message: '请输入链接' },
|
||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||
pushAt: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
|
||||
fullImg: [{ required: false, message: '请上传大图片', trigger: 'change' }],
|
||||
@ -249,4 +251,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -67,12 +67,12 @@
|
||||
<!-- <span>{{ record.subheading }}</span>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- </template>-->
|
||||
<template v-if="column.dataIndex === 'link'">
|
||||
<a-tooltip :title="record.link">
|
||||
<a :href="record.link" target="_blank" style="text-decoration: underline;">{{
|
||||
record.link }}</a>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<!-- <template v-if="column.dataIndex === 'link'">-->
|
||||
<!-- <a-tooltip :title="record.link">-->
|
||||
<!-- <a :href="record.link" target="_blank" style="text-decoration: underline;">{{-->
|
||||
<!-- record.link }}</a>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- </template>-->
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
@ -149,8 +149,8 @@ const columns = [
|
||||
// { title: '简介', dataIndex: 'subheading', key: 'subheading' },
|
||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
|
||||
{ title: '链接', dataIndex: 'link', align: 'center' },
|
||||
// { title: '月份+事件', dataIndex: 'month', key: 'month' },
|
||||
//{ title: '链接', dataIndex: 'link', align: 'center' },
|
||||
//{ title: '月份+事件', dataIndex: 'month', key: 'month' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">713*620px,图片大小不要超过300kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -195,4 +196,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint{
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">1920*831px, 图片大小不要超过700kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -67,6 +68,7 @@ const handleChange = (value) => {
|
||||
const imgChange = (value) => {
|
||||
formData.value.img = value
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
@ -194,4 +196,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">314*432px,图片大小不要超过300kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -194,4 +195,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint{
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
<template>
|
||||
<a-card title="基础示例">
|
||||
<a-space>
|
||||
<a-input v-model:value="form.name"></a-input>
|
||||
<a-input-number
|
||||
v-model:value="form.count"
|
||||
:min="0"></a-input-number>
|
||||
<a-button @click="handleSet">设置</a-button>
|
||||
<a-button @click="handleClear">清除</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useMenu } from '@/hooks'
|
||||
|
||||
defineOptions({
|
||||
name: 'otherBadge',
|
||||
})
|
||||
|
||||
const form = ref({
|
||||
name: 'home',
|
||||
count: 10,
|
||||
})
|
||||
const { setBadge } = useMenu()
|
||||
|
||||
function handleSet() {
|
||||
setBadge(form.value?.name, form.value?.count)
|
||||
}
|
||||
|
||||
function handleClear() {
|
||||
setBadge(form.value?.name, 0)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
208
src/views/other/logo/components/EditDialog.vue
Normal file
208
src/views/other/logo/components/EditDialog.vue
Normal file
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'名称'" name="name">
|
||||
<a-input :placeholder="'请输入名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">-->
|
||||
<!-- <a-form-item :label="'顺序'" name="sequence">-->
|
||||
<!-- <a-input-number :placeholder="'请输入顺序'" v-model:value="formData.sequence"></a-input-number>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'状态'" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
{ label: '启用', value: 'enabled' },
|
||||
{ label: '停用', value: 'disabled' },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint" v-if="formData.sequence == 1 ">400*70px,图片大小不超过150kb</p>
|
||||
<p class="hint" v-if="formData.sequence == 0 ">300*50px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { ref } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
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/imgmgt'
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
const rolesValue = ref([])
|
||||
const roles = ref([])
|
||||
const img = ref('')
|
||||
formRules.value = {
|
||||
name: { required: true, message: '请输入名称' },
|
||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||
// sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
||||
img: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
||||
}
|
||||
/**
|
||||
* select 选择框
|
||||
*/
|
||||
const handleChange = (value) => {
|
||||
rolesValue.value = value
|
||||
}
|
||||
const imgChange = (value) => {
|
||||
formData.value.img = value
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
// 80对应about
|
||||
title: '添加',
|
||||
})
|
||||
formData.value.status = 'enabled'
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: t('pages.system.user.edit'),
|
||||
})
|
||||
const { data, success } = await apis.imgmgt.getMenu(record.id).catch()
|
||||
if (!success) {
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
formData.value = { ...data }
|
||||
formData.value.pushAt=dayjs(data.pushAt)
|
||||
console.log(formData.value)
|
||||
img.value = config('http.apiBasic') + data.img
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
function handleOk() {
|
||||
if (!formData.value.img) return message.error('请上传图片');
|
||||
formRef.value.validateFields().then(async (values) => {
|
||||
console.log(values)
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
img: formData.value.img,
|
||||
// pushAt:dayjs(formData.value.pushAt).format("YYYY-MM-DD"),
|
||||
type: 1 ,
|
||||
// 120对应banner
|
||||
}
|
||||
let result = null
|
||||
console.log(modal.value.type)
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.imgmgt.createMenu(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
// result = await apis.imgmgt.updateMenu(formData.value.id, params).catch(() => {
|
||||
result = await apis.imgmgt.updateMenu(formData.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 对权限组 过数据格式
|
||||
*/
|
||||
function formatArr(data, type = '') {
|
||||
const rolesArr = []
|
||||
data.forEach((item) => {
|
||||
roles.value.forEach((r) => {
|
||||
if (type === 'edit') {
|
||||
if (item.role_id === r.value) {
|
||||
rolesArr.push({
|
||||
value: item.role_id,
|
||||
label: r.label,
|
||||
})
|
||||
return
|
||||
}
|
||||
} else if (r.value === item) {
|
||||
rolesArr.push({
|
||||
role_id: item,
|
||||
role_name: r.label,
|
||||
})
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
return rolesArr
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
function handleCancel() {
|
||||
img.value = ''
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleEdit,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
:deep(.ant-table-cell) {
|
||||
background-color: #ccc;
|
||||
}
|
||||
</style>
|
||||
@ -4,8 +4,8 @@
|
||||
<a-form :label-col="{ style: { width: '40px' } }" :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="成员" name="name">
|
||||
<a-input placeholder="请输入成员" v-model:value="searchFormData.name"></a-input>
|
||||
<a-form-item label="名称" name="name">
|
||||
<a-input placeholder="请输入图片名称" v-model:value="searchFormData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@ -55,30 +55,6 @@
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- <template v-if="column.dataIndex === 'rank'">-->
|
||||
<!-- <a-tooltip :title="record.rank">-->
|
||||
<!-- <span>{{ record.rank }}</span>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- </template>-->
|
||||
<template v-if="column.dataIndex === 'rank'">
|
||||
<div>
|
||||
<a-tag
|
||||
v-for="(item, index) in record.rank"
|
||||
:key="index"
|
||||
color="blue"
|
||||
>
|
||||
{{ item }}
|
||||
</a-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="column.dataIndex === 'area'">
|
||||
<a-tooltip :title="record.area">
|
||||
<span>{{ record.area }}</span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
@ -104,7 +80,6 @@
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { computed } from 'vue';
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
@ -115,18 +90,16 @@ 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 { delMenu, getDataList } from '@/apis/modules/team'
|
||||
import { delMenu, getDataList } from '@/apis/modules/imgmgt'
|
||||
defineOptions({
|
||||
name: 'team',
|
||||
name: 'logo',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '图片', dataIndex: 'img', width: 100, align: 'center' },
|
||||
{ title: '名称', dataIndex: 'name', key: 'name' },
|
||||
{ title: '人物描述', dataIndex: 'rank', key: 'rank' },
|
||||
{ title: '研究领域', dataIndex: 'area', key: 'area' },
|
||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||
{ title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||
// { title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
@ -139,14 +112,16 @@ getPageList()
|
||||
* 获取用户列表
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.team
|
||||
const { success, data, total } = await apis.imgmgt
|
||||
.getDataList({
|
||||
pageSize,
|
||||
current:current,
|
||||
type: 1,//logo
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
@ -154,6 +129,7 @@ async function getPageList() {
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === success) {
|
||||
//筛选type的值80对应about
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
@ -174,7 +150,7 @@ function handleDelete({ id }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.team.delMenu(id).catch(() => {
|
||||
const { success } = await apis.imgmgt.delMenu(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
@ -1,98 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-card title="打开">
|
||||
<a-space>
|
||||
<a-button @click="handleOpen">打开欢迎页</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
<a-card
|
||||
class="mt-8-2"
|
||||
title="刷新">
|
||||
<a-space>
|
||||
<a-button @click="handleReload">刷新当前</a-button>
|
||||
<span>{{ date }}</span>
|
||||
</a-space>
|
||||
</a-card>
|
||||
<a-card
|
||||
class="mt-8-2"
|
||||
title="关闭">
|
||||
<a-space>
|
||||
<a-button @click="handleClose">关闭当前</a-button>
|
||||
<a-button @click="handleCloseOther">关闭其他</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
<a-card
|
||||
class="mt-8-2"
|
||||
title="设置">
|
||||
<a-space>
|
||||
<a-input v-model:value="title"></a-input>
|
||||
<a-button @click="handleSetTitle">设置标题</a-button>
|
||||
<a-button @click="handleRevertTitle">还原</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMultiTab } from '@/hooks'
|
||||
|
||||
defineOptions({
|
||||
name: 'otherMultiTab',
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
const { reload, close, closeOther, setTitle } = useMultiTab()
|
||||
const date = ref('')
|
||||
const title = ref('自定义名称')
|
||||
|
||||
onMounted(() => {
|
||||
date.value = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
})
|
||||
|
||||
/**
|
||||
* 打开欢迎页
|
||||
*/
|
||||
function handleOpen() {
|
||||
router.push({ name: 'home' })
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新当前
|
||||
*/
|
||||
function handleReload() {
|
||||
reload()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
*/
|
||||
function handleClose() {
|
||||
close()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭其他
|
||||
*/
|
||||
function handleCloseOther() {
|
||||
closeOther()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标题
|
||||
*/
|
||||
function handleSetTitle() {
|
||||
setTitle(title.value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 还原标题
|
||||
*/
|
||||
function handleRevertTitle() {
|
||||
setTitle(router.currentRoute.value.meta?.title)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
169
src/views/other/officialWeChat/components/Department.vue
Normal file
169
src/views/other/officialWeChat/components/Department.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<a-card
|
||||
:body-style="{ height: 'calc(100% - 56px - 47px)', padding: 0 }"
|
||||
:style="{
|
||||
position: 'sticky',
|
||||
top: appStore.mainOffsetTop,
|
||||
height: appStore.mainHeight,
|
||||
}">
|
||||
<template #title>
|
||||
<a-input-search placeholder="搜索部门"></a-input-search>
|
||||
</template>
|
||||
<x-scrollbar class="pa-8-2">
|
||||
<a-spin :spinning="loading">
|
||||
<a-tree
|
||||
block-node
|
||||
:selected-keys="selectedKeys"
|
||||
:tree-data="listData"
|
||||
:field-names="{ key: 'id', children: 'children' }"
|
||||
@select="onSelect">
|
||||
<template #title="{ title }">
|
||||
<span class="ant-tree-title__name">{{ title }}</span>
|
||||
<span class="ant-tree-title__actions">
|
||||
<a-dropdown
|
||||
:trigger="['click']"
|
||||
@click.stop>
|
||||
<x-action-button>
|
||||
<more-outlined></more-outlined>
|
||||
</x-action-button>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item @click="$refs.editDepartmentDialogRef.handleEdit()">
|
||||
添加子部门
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="$refs.editDepartmentDialogRef.handleEdit()">
|
||||
编辑
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="handleDelete">删除</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
</template>
|
||||
</a-tree>
|
||||
<empty
|
||||
v-if="!listData.length"
|
||||
:image="Empty.PRESENTED_IMAGE_SIMPLE"></empty>
|
||||
</a-spin>
|
||||
</x-scrollbar>
|
||||
<template #actions>
|
||||
<span @click="$refs.editDepartmentDialogRef.handleCreate()">
|
||||
<plus-outlined></plus-outlined>
|
||||
新建部门
|
||||
</span>
|
||||
</template>
|
||||
</a-card>
|
||||
|
||||
<edit-department-dialog
|
||||
ref="editDepartmentDialogRef"
|
||||
@ok="onOk"></edit-department-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useAppStore } from '@/store'
|
||||
import { ref, watch } from 'vue'
|
||||
import { usePagination } from '@/hooks'
|
||||
import apis from '@/apis'
|
||||
import { Empty, Modal, message } from 'ant-design-vue'
|
||||
import { config } from '@/config'
|
||||
import { head, get, find } from 'lodash-es'
|
||||
import { MoreOutlined, PlusOutlined } from '@ant-design/icons-vue'
|
||||
import EditDepartmentDialog from './EditDepartmentDialog.vue'
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change', 'update:value'])
|
||||
|
||||
const appStore = useAppStore()
|
||||
const { listData, loading, showLoading, hideLoading } = usePagination()
|
||||
|
||||
const editDepartmentDialogRef = ref()
|
||||
const selectedKeys = ref([props.value])
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
if (val === selectedKeys.value?.[0]) return
|
||||
selectedKeys.value = [val]
|
||||
}
|
||||
)
|
||||
|
||||
getList()
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function getList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { code, data } = await apis.common.getPageList().catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records } = data
|
||||
listData.value = records
|
||||
if (listData.value.length) {
|
||||
selectedKeys.value = [get(head(listData.value), 'id')]
|
||||
trigger()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function handleDelete({ id }) {
|
||||
Modal.confirm({
|
||||
title: '删除提示',
|
||||
content: '确认删除?',
|
||||
okText: '确认',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === code) {
|
||||
resolve()
|
||||
message.success('删除成功')
|
||||
await getList()
|
||||
}
|
||||
} catch (error) {
|
||||
reject()
|
||||
}
|
||||
})()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function onSelect(keys) {
|
||||
if (!keys.length) return
|
||||
selectedKeys.value = keys
|
||||
trigger()
|
||||
}
|
||||
|
||||
async function onOk() {
|
||||
await getList()
|
||||
}
|
||||
|
||||
function trigger() {
|
||||
const value = head(selectedKeys.value)
|
||||
const record = find(listData.value, { id: value })
|
||||
emit('update:value', value)
|
||||
emit('change', record)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:width="480"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
:cancel-text="cancelText"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '90px' } }">
|
||||
<a-form-item
|
||||
label="部门名称"
|
||||
name="name">
|
||||
<a-input v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="上级部门"
|
||||
name="parent_id">
|
||||
<a-tree-select v-model:value="formData.parent_id"></a-tree-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="部门负责人"
|
||||
name="name">
|
||||
<a-input v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { ref } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const cancelText = ref('取消')
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新建部门',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑部门',
|
||||
})
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
function handleOk() {
|
||||
formRef.value
|
||||
.validateFields()
|
||||
.then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.common.create(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.common.update(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (config('http.code.success') === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
function handleCancel() {
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
cancelText.value = '取消'
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleEdit,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -4,38 +4,16 @@
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="12">
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'姓名'" name="name">
|
||||
<a-input :placeholder="'请输入姓名'" v-model:value="formData.name"></a-input>
|
||||
<a-form-item :label="'名称'" name="name">
|
||||
<a-input :placeholder="'请输入名称'" v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="24">-->
|
||||
<!-- <a-form-item :label="'人物描述'" name="rank">-->
|
||||
<!-- <a-input :placeholder="'请输入人物描述内容'" v-model:value="formData.rank"></a-input>-->
|
||||
<!-- <a-form-item :label="'顺序'" name="sequence">-->
|
||||
<!-- <a-input-number :placeholder="'请输入顺序'" v-model:value="formData.sequence"></a-input-number>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'研究领域'" name="area">
|
||||
<a-input :placeholder="'请输入研究领域内容'" v-model:value="formData.area"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'人物简介'">
|
||||
<a-select
|
||||
v-model:value="formData.rank"
|
||||
mode="tags"
|
||||
:placeholder="'请输入研究领域,按回车分隔'"
|
||||
:token-separators="[',']"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'顺序'" name="sequence">
|
||||
<a-input-number :placeholder="'请输入顺序'" v-model:value="formData.sequence"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'状态'" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
@ -47,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">80*80px,图片大小不超过50kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -64,7 +43,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/team'
|
||||
import { createMenu, getMenu, updateMenu } from '@/apis/modules/imgmgt'
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
@ -76,9 +55,8 @@ const roles = ref([])
|
||||
const img = ref('')
|
||||
formRules.value = {
|
||||
name: { required: true, message: '请输入名称' },
|
||||
rank: { required: true, message: '请输入人物简介' },
|
||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||
sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
||||
// sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
||||
img: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
||||
}
|
||||
/**
|
||||
@ -90,6 +68,7 @@ const handleChange = (value) => {
|
||||
const imgChange = (value) => {
|
||||
formData.value.img = value
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
@ -108,16 +87,15 @@ function handleCreate() {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
// 80对应about
|
||||
title: t('pages.system.user.edit'),
|
||||
})
|
||||
const { data, success } = await apis.team.getMenu(record.id).catch()
|
||||
const { data, success } = await apis.imgmgt.getMenu(record.id).catch()
|
||||
if (!success) {
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
formData.value = { ...data }
|
||||
formData.value.pushAt = dayjs(data.pushAt)
|
||||
formData.value.pushAt=dayjs(data.pushAt)
|
||||
console.log(formData.value)
|
||||
img.value = config('http.apiBasic') + data.img
|
||||
}
|
||||
@ -134,18 +112,21 @@ function handleOk() {
|
||||
const params = {
|
||||
...values,
|
||||
img: formData.value.img,
|
||||
rank: formData.value.rank,
|
||||
// pushAt:dayjs(formData.value.pushAt).format("YYYY-MM-DD"),
|
||||
type: 1000 ,
|
||||
// 120对应banner
|
||||
}
|
||||
let result = null
|
||||
console.log(modal.value.type)
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.team.createMenu(params).catch(() => {
|
||||
result = await apis.imgmgt.createMenu(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.team.updateMenu(formData.value.id, params).catch(() => {
|
||||
// result = await apis.imgmgt.updateMenu(formData.value.id, params).catch(() => {
|
||||
result = await apis.imgmgt.updateMenu(formData.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
@ -215,4 +196,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
202
src/views/other/officialWeChat/index.vue
Normal file
202
src/views/other/officialWeChat/index.vue
Normal file
@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :label-col="{ style: { width: '40px' } }" :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="名称" name="name">
|
||||
<a-input placeholder="请输入图片名称" v-model:value="searchFormData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-select v-model:value="searchFormData.status" allowClear>
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="enabled">启用</a-select-option>
|
||||
<a-select-option value="disabled">停用</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
{{ $t('button.search') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-card type="flex">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新增
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
|
||||
:pagination="paginationState" :scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'img' === column.dataIndex">
|
||||
<!-- <a-image :width="60" :src="record.img || $imageErr.imgErr" />-->
|
||||
<a-image :width="60" :src="config('http.apiBasic') + record.img || $imageErr.imgErr" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'name'">
|
||||
<a-tooltip :title="record.name">
|
||||
<span>{{ record.name }}</span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="'status' === column.dataIndex">
|
||||
<a-tag v-if="record.status === 'enabled'" :color="'green'">启用</a-tag>
|
||||
<a-tag v-if="record.status === 'disabled'" :color="'red'">停用</a-tag>
|
||||
</template>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.user.edit') }}</template>
|
||||
<edit-outlined /> </a-tooltip></x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" /> </a-tooltip></x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
import { config } from '@/config'
|
||||
import { statusUserTypeEnum } from '@/enums/system'
|
||||
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 { delMenu, getDataList } from '@/apis/modules/imgmgt'
|
||||
defineOptions({
|
||||
name: 'officialWeChat',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '图片', dataIndex: 'img', width: 100, align: 'center' },
|
||||
{ title: '名称', dataIndex: 'name', key: 'name' },
|
||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||
// { title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||
]
|
||||
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } =
|
||||
usePagination()
|
||||
|
||||
const editDialogRef = ref()
|
||||
getPageList()
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.imgmgt
|
||||
.getDataList({
|
||||
pageSize,
|
||||
current:current,
|
||||
type: 1000,//官方微信
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === success) {
|
||||
//筛选type的值80对应about
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function handleDelete({ id }) {
|
||||
Modal.confirm({
|
||||
title: t('pages.system.user.delTip'),
|
||||
content: t('button.confirm'),
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.imgmgt.delMenu(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
resolve()
|
||||
message.success(t('component.message.success.delete'))
|
||||
await getPageList()
|
||||
}
|
||||
} catch (error) {
|
||||
reject()
|
||||
}
|
||||
})()
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 编辑完成
|
||||
*/
|
||||
async function onOk() {
|
||||
await getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -50,6 +50,7 @@
|
||||
</a-col>
|
||||
<a-form-item :label="'产品图片'">
|
||||
<gx-upload v-model="formData.mainImage" :fileNumber="2" />
|
||||
<p class="hint">包装图片尺寸:599*450px,感官图片尺寸:150*151px,图片大小不超过700kb</p>
|
||||
</a-form-item>
|
||||
|
||||
</a-row>
|
||||
@ -428,4 +429,9 @@ const handleChange = (selectedKeys) => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">310*206px,图片大小不超过100kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -194,4 +195,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">380*285px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -194,4 +195,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'研究领域'" name="area">
|
||||
<a-input :placeholder="'请输入研究领域内容'" v-model:value="formData.area"></a-input>
|
||||
<a-textarea :placeholder="'请输入研究领域内容'" v-model:value="formData.area"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@ -47,6 +47,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">300*400px,图片大小不超过100kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -215,4 +216,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="reportImage">
|
||||
<x-upload-image v-model="reportImage" @imgChange="imgChange" />
|
||||
<p class="hint">750*500px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -222,4 +223,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
<a-form-item :label="'零容忍图片'" name="reportImage">
|
||||
<!-- <x-upload-image v-model="reportImage" @imgChange="imgChange" />-->
|
||||
<gx-upload v-model="reportImage" :fileNumber="1" />
|
||||
<p class="hint">750*500px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
<a-form-item :label="'举报邮箱'" name="email">
|
||||
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
||||
@ -40,6 +41,7 @@
|
||||
v-model="itemImg.image"
|
||||
:fileNumber="1"
|
||||
/>
|
||||
<p class="hint">106*106px,图片大小不超过50kb</p>
|
||||
<a-input
|
||||
class="inputPhone"
|
||||
v-model:value="itemImg.link"
|
||||
@ -203,4 +205,8 @@ function removeSocialMedia(index) {
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'图片'" name="img">
|
||||
<x-upload-image v-model="img" @imgChange="imgChange" />
|
||||
<p class="hint">106*106px,图片大小不超过150kb</p>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -199,4 +200,9 @@ defineExpose({
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
.hint {
|
||||
color: red;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user