parent
d948aaca3d
commit
3f9738733b
4 changed files with 154 additions and 118 deletions
@ -1,96 +1,100 @@ |
||||
<template> |
||||
<div class="configuration-page"> |
||||
<el-form :model="form" label-width="auto" style="max-width: 600px"> |
||||
<el-form-item label="LOGO"> |
||||
<my-update v-model="form.logo"></my-update> |
||||
</el-form-item> |
||||
<el-form-item label="项目名称"> |
||||
<el-input v-model="form.name" /> |
||||
</el-form-item> |
||||
<el-form-item label="门户头部宣传大图"> |
||||
<my-update v-model="form.promotionalImages"></my-update> |
||||
</el-form-item> |
||||
<el-form-item label="门户首页"> |
||||
<el-input v-model="form.home" /> |
||||
</el-form-item> |
||||
<el-form-item label="后台登陆首页地址"> |
||||
<el-input v-model="form.loginAddress" /> |
||||
</el-form-item> |
||||
<el-form-item label="系统标题"> |
||||
<el-input v-model="form.title" /> |
||||
</el-form-item> |
||||
<el-form-item label="版权信息"> |
||||
<el-input v-model="form.copyrightInformation" /> |
||||
</el-form-item> |
||||
<el-form-item label="备案号"> |
||||
<el-input v-model="form.recordNumber" /> |
||||
</el-form-item> |
||||
<el-form-item label="备案号信息"> |
||||
<el-input v-model="form.recordInformation" type="textarea" /> |
||||
</el-form-item> |
||||
<el-form-item label="qq"> |
||||
<el-input v-model="form.qqNumber" /> |
||||
</el-form-item> |
||||
<el-form-item label="邮箱"> |
||||
<el-input v-model="form.mailbox" /> |
||||
</el-form-item> |
||||
<el-form-item label="电话"> |
||||
<el-input v-model="form.phone" /> |
||||
</el-form-item> |
||||
<el-form-item label="联系地址"> |
||||
<el-input v-model="form.address" /> |
||||
</el-form-item> |
||||
<el-form-item label="二维码"> |
||||
<my-update v-model="form.qrCode"></my-update> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="onSubmit">保存</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</div> |
||||
<div class="configuration-page"> |
||||
<el-form :model="form" label-width="auto" style="max-width: 600px"> |
||||
<el-form-item label="LOGO"> |
||||
<my-update v-model="form.logo"></my-update> |
||||
</el-form-item> |
||||
<el-form-item label="项目名称"> |
||||
<el-input v-model="form.name" /> |
||||
</el-form-item> |
||||
<el-form-item label="门户头部宣传大图"> |
||||
<my-update v-model="form.promotionalImages"></my-update> |
||||
</el-form-item> |
||||
<el-form-item label="门户首页"> |
||||
<el-input v-model="form.home" /> |
||||
</el-form-item> |
||||
<el-form-item label="后台登陆首页地址"> |
||||
<el-input v-model="form.loginAddress" /> |
||||
</el-form-item> |
||||
<el-form-item label="系统标题"> |
||||
<el-input v-model="form.title" /> |
||||
</el-form-item> |
||||
<el-form-item label="版权信息"> |
||||
<el-input v-model="form.copyrightInformation" /> |
||||
</el-form-item> |
||||
<el-form-item label="备案号"> |
||||
<el-input v-model="form.recordNumber" /> |
||||
</el-form-item> |
||||
<el-form-item label="备案号信息"> |
||||
<el-input v-model="form.recordInformation" type="textarea" /> |
||||
</el-form-item> |
||||
<el-form-item label="qq"> |
||||
<el-input v-model="form.qqNumber" /> |
||||
</el-form-item> |
||||
<el-form-item label="邮箱"> |
||||
<el-input v-model="form.mailbox" /> |
||||
</el-form-item> |
||||
<el-form-item label="电话"> |
||||
<el-input v-model="form.phone" /> |
||||
</el-form-item> |
||||
<el-form-item label="联系地址"> |
||||
<el-input v-model="form.address" /> |
||||
</el-form-item> |
||||
<el-form-item label="二维码"> |
||||
<my-update v-model="form.qrCode"></my-update> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="onSubmit">保存</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</div> |
||||
</template> |
||||
|
||||
<script lang="ts" setup> |
||||
import { getSysSettingApi, proxPutSysSettingApi, uploadApi } from '@/api/configuration'; |
||||
import { |
||||
getSysSettingApi, |
||||
proxPutSysSettingApi, |
||||
uploadApi, |
||||
} from '@/api/configuration' |
||||
import { ref, reactive } from 'vue' |
||||
import MyUpdate from './MyUpdate.vue'; |
||||
import useUserStore from '@/store/modules/user'; |
||||
import MyUpdate from './MyUpdate.vue' |
||||
import useUserStore from '@/store/modules/user' |
||||
const userStore = useUserStore() |
||||
|
||||
// do not use same name with ref |
||||
const form = reactive({ |
||||
address: '', |
||||
copyrightInformation: '', |
||||
id: userStore.data.id, |
||||
loginAddress: '', |
||||
logo: '', |
||||
name: '', |
||||
phone: '', |
||||
promotionalImages: '', |
||||
qqNumber: '', |
||||
qrCode: '', |
||||
recordNumber: '', |
||||
title: '', |
||||
mailbox: '', |
||||
home: '', |
||||
recordInformation: '' |
||||
address: '', |
||||
copyrightInformation: '', |
||||
id: userStore.data.id, |
||||
loginAddress: '', |
||||
logo: '', |
||||
name: '', |
||||
phone: '', |
||||
promotionalImages: '', |
||||
qqNumber: '', |
||||
qrCode: '', |
||||
recordNumber: '', |
||||
title: '', |
||||
mailbox: '', |
||||
home: '', |
||||
recordInformation: '', |
||||
}) |
||||
|
||||
const ran = ref(false) |
||||
getSysSettingApi().then((res) => { |
||||
Object.assign(form, res.data) |
||||
ran.value = true |
||||
Object.assign(form, res.data) |
||||
ran.value = true |
||||
}) |
||||
const onSubmit = async () => { |
||||
form.logo = await uploadApi(form.logo) |
||||
form.promotionalImages = await uploadApi(form.promotionalImages) |
||||
form.qrCode = await uploadApi(form.qrCode) |
||||
await proxPutSysSettingApi(form) |
||||
form.logo = await uploadApi(form.logo) |
||||
form.promotionalImages = await uploadApi(form.promotionalImages) |
||||
form.qrCode = await uploadApi(form.qrCode) |
||||
await proxPutSysSettingApi(form) |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.configuration-page { |
||||
width: 600px; |
||||
margin: auto; |
||||
width: 600px; |
||||
margin: auto; |
||||
} |
||||
</style> |
||||
</style> |
||||
|
Loading…
Reference in new issue