generated from Leo_Ding/web-template
all
This commit is contained in:
parent
26fd822328
commit
6c8ae42671
@ -25,6 +25,20 @@
|
|||||||
</a-date-picker>
|
</a-date-picker>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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="sequence">
|
||||||
|
<a-radio-group v-model:value="formData.sequence">
|
||||||
|
<a-radio :value="0">置顶</a-radio>
|
||||||
|
<a-radio :value="1">不置顶</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'状态'" name="status">
|
<a-form-item :label="'状态'" name="status">
|
||||||
<a-radio-group v-model:value="formData.status" :options="[
|
<a-radio-group v-model:value="formData.status" :options="[
|
||||||
@ -67,6 +81,7 @@ formRules.value = {
|
|||||||
content: { required: true, message: '请输入内容' },
|
content: { required: true, message: '请输入内容' },
|
||||||
link: { required: true, message: '请输入链接' },
|
link: { required: true, message: '请输入链接' },
|
||||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||||
|
sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
||||||
pushAt: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
|
pushAt: [{ required: true, message: '请选择发布日期', trigger: 'change' }],
|
||||||
// imgUrl: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
// imgUrl: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,12 @@
|
|||||||
<span>{{ record.content }}</span>
|
<span>{{ record.content }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'sequence'">
|
||||||
|
<a-tooltip :title="record.sequence === 0 ? '置顶' : '不置顶'">
|
||||||
|
<span>{{ record.sequence === 0 ? '置顶' : '不置顶' }}</span>
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'link'">
|
<template v-if="column.dataIndex === 'link'">
|
||||||
<a-tooltip :title="record.link">
|
<a-tooltip :title="record.link">
|
||||||
<a :href="record.link" target="_blank" style="text-decoration: underline;">{{
|
<a :href="record.link" target="_blank" style="text-decoration: underline;">{{
|
||||||
@ -110,6 +116,7 @@ const columns = [
|
|||||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||||
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
|
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
|
||||||
{ title: '链接', dataIndex: 'link', align: 'center' },
|
{ title: '链接', dataIndex: 'link', align: 'center' },
|
||||||
|
{ title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -138,6 +145,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
listData.value = data.filter(item => item.type === "news")
|
listData.value = data.filter(item => item.type === "news")
|
||||||
|
console.log('消息:',this.listData.value)
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -202,7 +210,6 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -202,7 +202,6 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -150,7 +150,7 @@ const columns = [
|
|||||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||||
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
|
{ title: '发布日期', dataIndex: 'pushAt', width: 120, align: 'center' },
|
||||||
{ title: '链接', dataIndex: 'link', align: 'center' },
|
{ title: '链接', dataIndex: 'link', align: 'center' },
|
||||||
{ title: '月份+事件', dataIndex: 'month', key: 'month' },
|
// { title: '月份+事件', dataIndex: 'month', key: 'month' },
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 100, align: 'center' },
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,6 +120,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type:80,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -128,7 +129,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值80对应about
|
//筛选type的值80对应about
|
||||||
listData.value = data.filter( item => item.type===80)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -193,7 +194,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -120,6 +120,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 100,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -128,7 +129,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值100对应corporateHonor
|
//筛选type的值100对应corporateHonor
|
||||||
listData.value = data.filter( item => item.type===100)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -193,7 +194,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -121,6 +121,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 120,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -129,7 +130,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值80对应about
|
//筛选type的值80对应about
|
||||||
listData.value = data.filter(item => item.type === 120)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -194,7 +195,6 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -120,6 +120,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 110,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -128,7 +129,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值110对应researchHonor
|
//筛选type的值110对应researchHonor
|
||||||
listData.value = data.filter(item => item.type===110)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -193,7 +194,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -120,6 +120,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 90,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -128,7 +129,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值90对应talentCenter
|
//筛选type的值90对应talentCenter
|
||||||
listData.value = data.filter(item => item.type===90)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -193,7 +194,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -120,6 +120,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 70,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -128,7 +129,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值90对应talentCenter
|
//筛选type的值90对应talentCenter
|
||||||
listData.value = data.filter(item => item.type===70)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -193,7 +194,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -193,7 +193,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -62,6 +62,11 @@
|
|||||||
<a-input v-model:value="formArea.name" :placeholder="'请输入基地名称'" />
|
<a-input v-model:value="formArea.name" :placeholder="'请输入基地名称'" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item :label="'基地排序'" name="name">
|
||||||
|
<a-input v-model:value="formArea.sequence" :placeholder="'请输入基地排序'" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'状态'" name="status" style="width: 100%;">
|
<a-form-item :label="'状态'" name="status" style="width: 100%;">
|
||||||
<a-radio-group v-model:value="formArea.status" :options="[
|
<a-radio-group v-model:value="formArea.status" :options="[
|
||||||
@ -147,6 +152,7 @@ function handleCreate() {
|
|||||||
formData.value.status = 'enabled'
|
formData.value.status = 'enabled'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//新建基地
|
//新建基地
|
||||||
|
|
||||||
const childHandleOk = async () => {
|
const childHandleOk = async () => {
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
<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="status">
|
<a-form-item label="状态" name="status">
|
||||||
<a-select v-model:value="searchFormData.status" allowClear>
|
<a-select v-model:value="searchFormData.status" allowClear>
|
||||||
@ -40,6 +39,12 @@
|
|||||||
</template>
|
</template>
|
||||||
新增招聘
|
新增招聘
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button style="margin: 0 20px" type="primary" @click="handleCreateJD()">
|
||||||
|
<template #icon>
|
||||||
|
<EditOutlined />
|
||||||
|
</template>
|
||||||
|
编辑基地
|
||||||
|
</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">
|
||||||
@ -198,6 +203,17 @@ async function onOk() {
|
|||||||
message.success(t('component.message.success.delete'))
|
message.success(t('component.message.success.delete'))
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 编辑基地
|
||||||
|
*/
|
||||||
|
function handleCreateJD() {
|
||||||
|
showModal({
|
||||||
|
type: 'edit',
|
||||||
|
title: '编辑地基',
|
||||||
|
})
|
||||||
|
initData()
|
||||||
|
formData.value.status = 'enabled'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|||||||
@ -10,16 +10,27 @@
|
|||||||
<a-input :placeholder="'请输入姓名'" v-model:value="formData.name"></a-input>
|
<a-input :placeholder="'请输入姓名'" v-model:value="formData.name"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<!-- <a-col :span="24">-->
|
||||||
<a-form-item :label="'人物描述'" name="rank">
|
<!-- <a-form-item :label="'人物描述'" name="rank">-->
|
||||||
<a-input :placeholder="'请输入人物描述内容'" v-model:value="formData.rank"></a-input>
|
<!-- <a-input :placeholder="'请输入人物描述内容'" v-model:value="formData.rank"></a-input>-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
</a-col>
|
<!-- </a-col>-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'研究领域'" name="area">
|
<a-form-item :label="'研究领域'" name="area">
|
||||||
<a-input :placeholder="'请输入研究领域内容'" v-model:value="formData.area"></a-input>
|
<a-input :placeholder="'请输入研究领域内容'" v-model:value="formData.area"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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-col :span="24">
|
||||||
<a-form-item :label="'顺序'" name="sequence">
|
<a-form-item :label="'顺序'" name="sequence">
|
||||||
<a-input-number :placeholder="'请输入顺序'" v-model:value="formData.sequence"></a-input-number>
|
<a-input-number :placeholder="'请输入顺序'" v-model:value="formData.sequence"></a-input-number>
|
||||||
@ -65,6 +76,7 @@ const roles = ref([])
|
|||||||
const img = ref('')
|
const img = ref('')
|
||||||
formRules.value = {
|
formRules.value = {
|
||||||
name: { required: true, message: '请输入名称' },
|
name: { required: true, message: '请输入名称' },
|
||||||
|
rank: { required: true, message: '请输入人物简介' },
|
||||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||||
sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
sequence: [{ required: true, message: '请选择顺序', trigger: 'change' }],
|
||||||
img: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
img: [{ required: true, message: '请上传图片', trigger: 'change' }],
|
||||||
@ -105,7 +117,7 @@ async function handleEdit(record = {}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
formData.value = { ...data }
|
formData.value = { ...data }
|
||||||
formData.value.pushAt=dayjs(data.pushAt)
|
formData.value.pushAt = dayjs(data.pushAt)
|
||||||
console.log(formData.value)
|
console.log(formData.value)
|
||||||
img.value = config('http.apiBasic') + data.img
|
img.value = config('http.apiBasic') + data.img
|
||||||
}
|
}
|
||||||
@ -121,15 +133,8 @@ function handleOk() {
|
|||||||
showLoading()
|
showLoading()
|
||||||
const params = {
|
const params = {
|
||||||
...values,
|
...values,
|
||||||
rank: Array.isArray(formData.rank)
|
|
||||||
? formData.rank
|
|
||||||
: typeof formData.rank === 'string'
|
|
||||||
? formData.rank
|
|
||||||
.split(/[\s;]+/)
|
|
||||||
.map(item => item.trim())
|
|
||||||
.filter(Boolean)
|
|
||||||
: [],
|
|
||||||
img: formData.value.img,
|
img: formData.value.img,
|
||||||
|
rank: formData.value.rank,
|
||||||
}
|
}
|
||||||
let result = null
|
let result = null
|
||||||
console.log(modal.value.type)
|
console.log(modal.value.type)
|
||||||
|
|||||||
@ -55,12 +55,24 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</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'">
|
<template v-if="column.dataIndex === 'rank'">
|
||||||
<a-tooltip :title="record.rank">
|
<div>
|
||||||
<span>{{ record.rank }}</span>
|
<a-tag
|
||||||
</a-tooltip>
|
v-for="(item, index) in record.rank"
|
||||||
|
:key="index"
|
||||||
|
color="blue"
|
||||||
|
>
|
||||||
|
{{ item }}
|
||||||
|
</a-tag>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<template v-if="column.dataIndex === 'area'">
|
<template v-if="column.dataIndex === 'area'">
|
||||||
<a-tooltip :title="record.area">
|
<a-tooltip :title="record.area">
|
||||||
<span>{{ record.area }}</span>
|
<span>{{ record.area }}</span>
|
||||||
@ -92,6 +104,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { message, Modal } from 'ant-design-vue'
|
import { message, Modal } from 'ant-design-vue'
|
||||||
|
import { computed } from 'vue';
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import apis from '@/apis'
|
import apis from '@/apis'
|
||||||
import { formatUtcDateTime } from '@/utils/util'
|
import { formatUtcDateTime } from '@/utils/util'
|
||||||
@ -110,7 +123,7 @@ const { t } = useI18n() // 解构出t方法
|
|||||||
const columns = [
|
const columns = [
|
||||||
{ title: '图片', dataIndex: 'img', width: 100, align: 'center' },
|
{ title: '图片', dataIndex: 'img', width: 100, align: 'center' },
|
||||||
{ title: '名称', dataIndex: 'name', key: 'name' },
|
{ title: '名称', dataIndex: 'name', key: 'name' },
|
||||||
{ title: '任务描述', dataIndex: 'rank', key: 'rank' },
|
{ title: '人物描述', dataIndex: 'rank', key: 'rank' },
|
||||||
{ title: '研究领域', dataIndex: 'area', key: 'area' },
|
{ title: '研究领域', dataIndex: 'area', key: 'area' },
|
||||||
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
{ title: '状态', dataIndex: 'status', width: 120, align: 'center' },
|
||||||
{ title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
{ title: '顺序', dataIndex: 'sequence', width: 100, align: 'center' },
|
||||||
@ -206,7 +219,6 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -5,7 +5,8 @@
|
|||||||
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
<a-textarea :placeholder="'请输入零容忍内容'" v-model:value="reportContent"></a-textarea>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="'零容忍图片'" name="reportImage">
|
<a-form-item :label="'零容忍图片'" name="reportImage">
|
||||||
<x-upload-image v-model="reportImage" @imgChange="imgChange" />
|
<!-- <x-upload-image v-model="reportImage" @imgChange="imgChange" />-->
|
||||||
|
<gx-upload v-model="reportImage" :fileNumber="1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="'举报邮箱'" name="email">
|
<a-form-item :label="'举报邮箱'" name="email">
|
||||||
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
<a-input :placeholder="'请输入举报邮箱'" v-model:value="email"></a-input>
|
||||||
@ -35,9 +36,9 @@
|
|||||||
v-model:value="itemImg.name"
|
v-model:value="itemImg.name"
|
||||||
placeholder="请输入图片名称"
|
placeholder="请输入图片名称"
|
||||||
/>
|
/>
|
||||||
<x-upload-image
|
<gx-upload
|
||||||
v-model="itemImg.image"
|
v-model="itemImg.image"
|
||||||
@imgChange="(value) => imgChange(index, value)"
|
:fileNumber="1"
|
||||||
/>
|
/>
|
||||||
<a-input
|
<a-input
|
||||||
class="inputPhone"
|
class="inputPhone"
|
||||||
@ -71,8 +72,10 @@ import { ref } from 'vue'
|
|||||||
import apis from '@/apis' // 假设这里包含 saveAffirm 接口
|
import apis from '@/apis' // 假设这里包含 saveAffirm 接口
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import { useI18n } from 'vue-i18n'
|
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 XSearchBar from '@/components/SearchBar/SearchBar.vue'
|
||||||
|
import GxUpload from '@/components/GxUpload/index.vue' // 获取声明接口
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'contactUs',
|
name: 'contactUs',
|
||||||
})
|
})
|
||||||
@ -113,7 +116,9 @@ async function getPageList() {
|
|||||||
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 : []
|
socialMedia.value = Array.isArray(res.data.socialMedia) ? res.data.socialMedia : []
|
||||||
|
|
||||||
//console.log(affirm.value)
|
//console.log(affirm.value)
|
||||||
console.log("web-Id:",id.value)
|
console.log("web-Id:",id.value)
|
||||||
console.log('webData',res.data)
|
console.log('webData',res.data)
|
||||||
@ -131,19 +136,60 @@ async function handleSearch() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
console.log("id.value:", id.value)
|
console.log("id.value:", id.value)
|
||||||
|
// 转换 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, {
|
await apis.webSite.updateWebData(id.value, {
|
||||||
affirm: affirm.value,
|
affirm: affirm.value,
|
||||||
reportContent: reportContent.value,
|
reportContent: reportContent.value,
|
||||||
reportImage: reportImage.value,
|
reportImage: reportImageFormatted.reportImage,
|
||||||
|
//reportImage:Array.isArray(reportImage.value) ? reportImage.value[0] : reportImage.value,
|
||||||
email: email.value,
|
email: email.value,
|
||||||
lat: lat.value,
|
lat: lat.value,
|
||||||
lon: lon.value,
|
lon: lon.value,
|
||||||
address: address.value,
|
address: address.value,
|
||||||
phone: phone.value,
|
phone: phone.value,
|
||||||
reportNum: reportNum.value,
|
reportNum: reportNum.value,
|
||||||
socialMedia: socialMedia.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('保存成功')
|
message.success('保存成功')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error('保存失败,请重试')
|
message.error('保存失败,请重试')
|
||||||
|
|||||||
@ -126,6 +126,7 @@ async function getPageList() {
|
|||||||
.getDataList({
|
.getDataList({
|
||||||
pageSize,
|
pageSize,
|
||||||
page: current,
|
page: current,
|
||||||
|
type: 10,
|
||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -134,7 +135,7 @@ async function getPageList() {
|
|||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
//筛选type的值10对应friendlyLinks
|
//筛选type的值10对应friendlyLinks
|
||||||
listData.value = data.filter(item => item.type===10)
|
listData.value = data
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -199,7 +200,7 @@ function handleResetSearch() {
|
|||||||
* 编辑完成
|
* 编辑完成
|
||||||
*/
|
*/
|
||||||
async function onOk() {
|
async function onOk() {
|
||||||
message.success(t('component.message.success.delete'))
|
|
||||||
await getPageList()
|
await getPageList()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user