diff --git a/src/views/dynamic/companyNews/components/EditDialog.vue b/src/views/dynamic/companyNews/components/EditDialog.vue
index 7510dc4..51c8831 100644
--- a/src/views/dynamic/companyNews/components/EditDialog.vue
+++ b/src/views/dynamic/companyNews/components/EditDialog.vue
@@ -142,7 +142,7 @@ function handleOk() {
...values,
img: formData.value.img,
pushAt:dayjs(formData.value.pushAt).format("YYYY-MM-DD"),
- type: 'news'
+ typer: 'news'
}
let result = null
console.log(modal.value.type)
diff --git a/src/views/dynamic/companyNews/index.vue b/src/views/dynamic/companyNews/index.vue
index 5e63df6..fa1b2da 100644
--- a/src/views/dynamic/companyNews/index.vue
+++ b/src/views/dynamic/companyNews/index.vue
@@ -137,6 +137,7 @@ async function getPageList() {
.getDataList({
pageSize,
current:current,
+ type:'news',
...searchFormData.value,
})
.catch(() => {
@@ -144,7 +145,7 @@ async function getPageList() {
})
hideLoading()
if (config('http.code.success') === success) {
- listData.value = data.filter(item => item.type === "news")
+ listData.value = data
console.log('消息:',this.listData.value)
paginationState.total = total
}
diff --git a/src/views/dynamic/mediaReports/components/EditDialog.vue b/src/views/dynamic/mediaReports/components/EditDialog.vue
index 95dae12..999d2ad 100644
--- a/src/views/dynamic/mediaReports/components/EditDialog.vue
+++ b/src/views/dynamic/mediaReports/components/EditDialog.vue
@@ -128,7 +128,7 @@ function handleOk() {
...values,
img: formData.value.img,
pushAt:dayjs(formData.value.pushAt).format("YYYY-MM-DD"),
- type: 'banner'
+ typer: 'banner'
}
let result = null
console.log(modal.value.type)
diff --git a/src/views/dynamic/mediaReports/index.vue b/src/views/dynamic/mediaReports/index.vue
index 2704265..ba093f6 100644
--- a/src/views/dynamic/mediaReports/index.vue
+++ b/src/views/dynamic/mediaReports/index.vue
@@ -130,6 +130,7 @@ async function getPageList() {
.getDataList({
pageSize,
current:current,
+ type:'banner',
...searchFormData.value,
})
.catch(() => {
@@ -137,7 +138,7 @@ async function getPageList() {
})
hideLoading()
if (config('http.code.success') === success) {
- listData.value = data.filter(item => item.type === "banner")
+ listData.value = data
paginationState.total = total
}
} catch (error) {
diff --git a/src/views/websiteRelated/contactUs/index.vue b/src/views/websiteRelated/contactUs/index.vue
index fdfd0fb..01808b2 100644
--- a/src/views/websiteRelated/contactUs/index.vue
+++ b/src/views/websiteRelated/contactUs/index.vue
@@ -5,7 +5,7 @@
-
+
750*500px,图片大小不超过150kb
@@ -28,44 +28,22 @@
-
-
-
+
+
106*106px,图片大小不超过50kb
-
- 删除
+
+ 删除
- 新增社交媒体
+ 新增社交媒体
-
-
-
+
保存
@@ -77,7 +55,7 @@ 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 { getWebData, updateWebData } from '@/apis/modules/webSite'
import XSearchBar from '@/components/SearchBar/SearchBar.vue'
import GxUpload from '@/components/GxUpload/index.vue' // 获取声明接口
import { config } from '@/config'
@@ -114,14 +92,14 @@ async function getPageList() {
id.value = res.data.id
affirm.value = res.data.affirm
reportContent.value = res.data.reportContent
- reportImage.value = [config('http.apiBasic')+res.data.reportImage]
+ 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]})) : []
+ 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('获取声明内容失败')
@@ -159,9 +137,10 @@ async function handleSearch() {
? reportImage.value[0]
: reportImage?.value;
const reportImageFormatted = {
- reportImage: spliceUrl(reportImageRaw)};
+ reportImage: spliceUrl(reportImageRaw)
+ };
- await apis.webSite.updateWebData(id.value, {
+ const {success}=await apis.webSite.updateWebData(id.value, {
affirm: affirm.value,
reportContent: reportContent.value,
reportImage: reportImageFormatted.reportImage,
@@ -174,6 +153,11 @@ async function handleSearch() {
reportNum: reportNum.value,
socialMedia: formattedSocialMedia,
})
+ if(success){
+ getPageList()
+ message.success('保存成功')
+
+ }
// await apis.webSite.updateWebData(id.value, {
// affirm: affirm.value,
// reportContent: reportContent.value,
@@ -189,7 +173,6 @@ async function handleSearch() {
//
// socialMedia: socialMedia.value,
// })
- message.success('保存成功')
} catch (e) {
message.error('保存失败,请重试')
} finally {
diff --git a/src/views/websiteRelated/websiteStatement/index.vue b/src/views/websiteRelated/websiteStatement/index.vue
index d9bfe3b..933e71d 100644
--- a/src/views/websiteRelated/websiteStatement/index.vue
+++ b/src/views/websiteRelated/websiteStatement/index.vue
@@ -1,7 +1,7 @@
-
+
保存
@@ -20,9 +20,9 @@ defineOptions({
})
const { t } = useI18n()
const { showLoading, hideLoading} = usePagination()
-let affirm = null // 初始化声明内容
-let id = null // 初始化声明内容
-
+let affirm = ref() // 初始化声明内容
+let id = ref() // 初始化声明内容
+let form=ref({})
// 页面加载时获取声明内容
getPageList()
@@ -32,12 +32,10 @@ getPageList()
async function getPageList() {
try {
showLoading()
- const res = await getWebData() // 假设返回格式为 { data: { affirm: '内容' } }
- if (res?.data) {
- affirm = res.data.affirm
- id = res.data.id // 新增
- console.log(affirm)
- console.log(id)
+ const {data,success} = await getWebData() // 假设返回格式为 { data: { affirm: '内容' } }
+ if (success) {
+ console.log(data,'data')
+ form.value={...data}
}
} catch (e) {
message.error('获取声明内容失败')
@@ -46,22 +44,16 @@ async function getPageList() {
}
}
-function isEmptyRichText(html) {
- return !html || html.replace(/<[^>]+>/g, '').trim() === ''
-}
-
/**
* 提交声明内容
*/
async function handleSearch() {
- console.log('affirm:', affirm)
- if (isEmptyRichText(affirm)) {
- message.warning('请输入声明内容')
- return
- }
try {
showLoading()
- await apis.webSite.updateWebData(id, { affirm: affirm })
+ const {data,success} = await apis.webSite.updateWebData(form.value.id, form.value)
+ if(success){
+ getPageList()
+ }
message.success('保存成功')
} catch (e) {
message.error('保存失败,请重试')