commit
971304bb30
27 changed files with 5449 additions and 10801 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,45 @@ |
||||
import request from '@/utils/request' |
||||
import { tool } from '../utils/alioss.js' |
||||
import { ElLoading, ElMessage } from 'element-plus' |
||||
|
||||
enum Api { |
||||
get系统配置 = '/api/systemSettings/save', |
||||
put系统配置 = '/api/systemSettings', |
||||
} |
||||
// 提示批量处理
|
||||
const initOptions = { text: '加载中', success: '成功', error: '失败' } |
||||
function proxRequest(request, options: any = initOptions) { |
||||
return async (...arg) => { |
||||
if (!options) return request(...arg) |
||||
|
||||
const loadingInstance = ElLoading.service({ text: options.text }) |
||||
|
||||
try { |
||||
await request(...arg) |
||||
ElMessage.success(options.success) |
||||
} catch (error) { |
||||
ElMessage.error(options.error) |
||||
} finally { |
||||
loadingInstance.close() |
||||
} |
||||
|
||||
return request |
||||
} |
||||
} |
||||
|
||||
|
||||
export function uploadApi(file: File) { |
||||
if (file instanceof Object) return tool.oss.upload(file).then(res => res.url) |
||||
else return Promise.resolve(file) |
||||
} |
||||
|
||||
|
||||
export function getSysSettingApi() { |
||||
return request.get(Api.get系统配置) |
||||
} |
||||
export const proxGetSysSettingApi = proxRequest(getSysSettingApi) |
||||
|
||||
export function putSysSettingApi(params: any) { |
||||
return request.put(Api.put系统配置, params) |
||||
} |
||||
export const proxPutSysSettingApi = proxRequest(putSysSettingApi, { success: '保存成功', error: '保存失败' }) |
@ -1,11 +1,11 @@ |
||||
import request from '@/utils/request' |
||||
// 获取课程章节列表
|
||||
export const getChaptersListApi = (params) => { |
||||
return request.get(`/chapter2/chapter?courseId=${params.id}`) |
||||
return request.get(`api/chapter2/chapter?courseId=${params.id}`) |
||||
} |
||||
// 添加课程章节
|
||||
export const addChaptersApi = (params) => request.post('/chapter2/add', params) |
||||
export const addChaptersApi = (params) => request.post('api/chapter2/add', params) |
||||
// 删除课程章节
|
||||
export const delChaptersApi = (id) => { |
||||
return request.delete(`/chapter2/delete/${id}`) |
||||
return request.delete(`api/chapter2/delete/${id}`) |
||||
} |
||||
|
@ -0,0 +1,81 @@ |
||||
<template> |
||||
<!-- 根据路由动态生成菜单 --> |
||||
<template v-for="item in menuList" :key="item.path"> |
||||
<!-- 没有子路由 --> |
||||
<template v-if="!item.children"> |
||||
<el-menu-item |
||||
v-if="!item.meta.hidden" |
||||
:index="item.path" |
||||
@click="goToRoute" |
||||
> |
||||
<el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> |
||||
<template #title> |
||||
<!-- <el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> --> |
||||
<span v-show="!fold">{{ item.meta.title }}</span> |
||||
</template> |
||||
</el-menu-item> |
||||
</template> |
||||
<!-- 有子路由但是只有一个子路由 --> |
||||
<template v-if="item.children && item.children.length === 1"> |
||||
<el-menu-item |
||||
v-if="!item.children[0].meta.hidden" |
||||
:index="item.children[0].path" |
||||
@click="goToRoute" |
||||
> |
||||
<el-icon> |
||||
<component :is="item.children[0].meta.icon"></component> |
||||
</el-icon> |
||||
<template #title> |
||||
<span v-show="!fold">{{ item.children[0].meta.title }}</span> |
||||
</template> |
||||
</el-menu-item> |
||||
</template> |
||||
<!-- 有子路由且有多个 --> |
||||
<el-sub-menu |
||||
:index="item.path" |
||||
v-if="item.children && item.children.length > 1" |
||||
> |
||||
<template #title> |
||||
<el-icon> |
||||
<component :is="item.meta.icon"></component> |
||||
</el-icon> |
||||
<span v-show="!fold">{{ item.meta.title }}</span> |
||||
</template> |
||||
<Menu :menuList="item.children" /> |
||||
</el-sub-menu> |
||||
</template> |
||||
</template> |
||||
<script lang="ts" setup> |
||||
import { useRouter } from 'vue-router' |
||||
import { watch, ref } from 'vue' |
||||
import useLayoutSettingStoe from '@/store/modules/setting' |
||||
const LayoutSettingStoe = useLayoutSettingStoe() |
||||
// import { onMounted, reactive, ref, toRefs, watch } from 'vue' |
||||
// 获取父组件传递的全部的路由的数据 |
||||
const props = defineProps(['menuList']) |
||||
console.log(props.menuList); |
||||
|
||||
const $router = useRouter() |
||||
const goToRoute = (vc: any) => { |
||||
$router.push(vc.index) |
||||
} |
||||
const fold = ref(false) |
||||
watch( |
||||
() => LayoutSettingStoe.fold, |
||||
(newVal) => { |
||||
setTimeout(() => { |
||||
fold.value = newVal |
||||
}, 200) |
||||
}, |
||||
) |
||||
</script> |
||||
<script lang="ts"> |
||||
export default { |
||||
name: 'Menu', |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped></style> |
@ -0,0 +1,491 @@ |
||||
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'; |
||||
import { pa } from 'element-plus/es/locales.mjs'; |
||||
|
||||
export const constantRoute: any = [ |
||||
{ |
||||
path: '/', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'layout', |
||||
meta: { |
||||
title: '', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
// redirect: '/home',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/home',
|
||||
// component: () => import('@/views/home/index.vue'),
|
||||
// name: 'Home',
|
||||
// meta: {
|
||||
// title: '个人中心',
|
||||
// hidden: false,
|
||||
// icon: 'HomeFilled',
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
redirect: '/home', |
||||
children: [ |
||||
{ |
||||
path: '/home', |
||||
component: () => import('@/views/home/index.vue'), |
||||
name: 'Home', |
||||
meta: { |
||||
title: '个人中心', |
||||
hidden: false, |
||||
icon: 'HomeFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/configurationPage', |
||||
component: () => import('@/views/configurationPage/index.vue'), |
||||
name: 'configurationPage', |
||||
meta: { |
||||
title: '系统设置', |
||||
hidden: true, |
||||
icon: 'HomeFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/basicCourseInformation', |
||||
component: () => import('@/views/course/basicCourseInformation.vue'), |
||||
name: 'BasicCourseInformation', |
||||
meta: { |
||||
title: '课程基本信息', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/courseDetails', |
||||
component: () => import('@/views/course/courseDetails.vue'), |
||||
name: 'CourseDetails', |
||||
meta: { |
||||
title: '课程详情', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/CourseObjectives', |
||||
component: () => import('@/views/course/CourseObjectives.vue'), |
||||
name: 'CourseObjectives', |
||||
meta: { |
||||
title: '课程目标', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/courseChapters', |
||||
component: () => import('@/views/course/courseChapters.vue'), |
||||
name: 'CourseChapters', |
||||
meta: { |
||||
title: '课程章节', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/knowledgePoints', |
||||
component: () => import('@/views/course/knowledgePoints.vue'), |
||||
name: 'KnowledgePoints', // name 要与权限一致
|
||||
meta: { |
||||
title: '知识点', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/curriculumMap', |
||||
component: () => import('@/views/course/curriculumMap.vue'), |
||||
name: 'CurriculumMap', // name 要与权限一致
|
||||
meta: { |
||||
title: '课程图谱', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/knowledgeAtlas', |
||||
component: () => import('@/views/course/knowledgeAtlas.vue'), |
||||
name: 'knowledgeAtlas', |
||||
meta: { |
||||
title: '知识图谱', |
||||
hidden: true, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
// {
|
||||
// path: '/mssageManagement',
|
||||
// component: () => import('@/layout/index.vue'),
|
||||
// name: 'MssageManagement',
|
||||
// meta: {
|
||||
// title: '',
|
||||
// hidden: false,
|
||||
// icon: 'HomeFilled', // 菜单图标
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: '/mssageManagement/message',
|
||||
// component: () => import('@/views/message/index.vue'),
|
||||
// name: 'Message',
|
||||
// meta: {
|
||||
// title: '消息',
|
||||
// hidden: false,
|
||||
// icon: 'ChatDotSquare',
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{ |
||||
path: '/curriculumCenter', |
||||
redirect: '/curriculumCenter/basicCourseInformation', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'CurriculumCenter', |
||||
meta: { |
||||
title: '课程', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/curriculumCenter/basicCourseInformation', |
||||
component: () => import('@/views/course/basicCourseInformation.vue'), |
||||
name: 'BasicCourseInformation', |
||||
meta: { |
||||
title: '课程基本信息', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/courseDetails', |
||||
component: () => import('@/views/course/courseDetails.vue'), |
||||
name: 'CourseDetails', |
||||
meta: { |
||||
title: '课程详情', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/CourseObjectives', |
||||
component: () => import('@/views/course/CourseObjectives.vue'), |
||||
name: 'CourseObjectives', |
||||
meta: { |
||||
title: '课程目标', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/courseChapters', |
||||
component: () => import('@/views/course/courseChapters.vue'), |
||||
name: 'CourseChapters', |
||||
meta: { |
||||
title: '课程章节', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/knowledgePoints', |
||||
component: () => import('@/views/course/knowledgePoints.vue'), |
||||
name: 'KnowledgePoints', // name 要与权限一致
|
||||
meta: { |
||||
title: '知识点', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/curriculumMap', |
||||
component: () => import('@/views/course/curriculumMap.vue'), |
||||
name: 'CurriculumMap', // name 要与权限一致
|
||||
meta: { |
||||
title: '课程图谱', |
||||
hidden: false, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/studentManagement', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'StudentManagement', |
||||
meta: { |
||||
title: '', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/studentManagement/student', |
||||
component: () => import('@/views/student/index.vue'), |
||||
name: 'Student', |
||||
meta: { |
||||
title: '学生', |
||||
hidden: false, |
||||
icon: 'User', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
{ |
||||
path: '/messageManagement', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'MessageManagement', |
||||
meta: { |
||||
title: '消息', |
||||
hidden: false, |
||||
icon: 'ChatLineRound', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/messageManagement/message', |
||||
component: () => import('@/views/message/index.vue'), |
||||
name: 'Message', |
||||
meta: { |
||||
title: '消息详情', |
||||
hidden: false, |
||||
icon: 'ChatDotSquare', |
||||
} |
||||
}, |
||||
{ |
||||
path: '/messageManagement/sendMessage', |
||||
component: () => import('@/views/message/components/sendMessage.vue'), |
||||
name: 'SendMessage', |
||||
meta: { |
||||
title: '个人发出', |
||||
hidden: true, |
||||
icon: '', |
||||
} |
||||
}, |
||||
{ |
||||
path: '/messageContentList', |
||||
component: () => import('@/views/message/components/receiveContentList.vue'), |
||||
name: 'MessageContentList', |
||||
meta: { |
||||
title: '收到信息详情', |
||||
hidden: true, |
||||
icon: '' |
||||
} |
||||
}, |
||||
{ |
||||
path: '/sendMessageList', |
||||
component: () => import('@/views/message/components/sendMessageList.vue'), |
||||
name: 'SendMessageList', |
||||
meta: { |
||||
title: '发送信息详情', |
||||
hidden: true, |
||||
icon: '' |
||||
} |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/messageContent', |
||||
component: () => import('@/views/message/components/messageContent.vue'), |
||||
name: 'MessageContent', |
||||
meta: { |
||||
title: '写栈内信函', |
||||
hidden: true, |
||||
icon: 'EditPen', |
||||
} |
||||
}, |
||||
{ |
||||
path: '/news', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'NewsManagement', |
||||
meta: { |
||||
title: '资讯', |
||||
hidden: false, |
||||
icon: 'BellFilled' |
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/news/newsContent', |
||||
component: () => import('@/views/news/index.vue'), |
||||
name: 'NewsContent', |
||||
meta: { |
||||
title: '资讯管理', |
||||
hidden: false, |
||||
icon: 'BellFilled' |
||||
} |
||||
}, |
||||
{ |
||||
path: '/news/newsContentDetails', |
||||
component:()=>import('@/views/news/components/newsContentDetails.vue'), |
||||
name:'NewsContentDetails', |
||||
meta: { |
||||
title: '栏目添加新闻信息', |
||||
hidden: true, |
||||
icon: 'Promotion' |
||||
}, |
||||
}, |
||||
] |
||||
}, |
||||
{ |
||||
path: '/myCourseStudyManagement', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'MyCourseStudyManagement', |
||||
meta: { |
||||
title: '学习过程', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/myCourseStudyManagement/learningProcess', |
||||
component: () => import('@/views/MyCourseStudy/learningProcess.vue'), |
||||
name: 'LearningProcess', |
||||
meta: { |
||||
title: '课程学习记录', |
||||
hidden: false, |
||||
icon: 'StarFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/myCourseStudyManagement/learningProcess1', |
||||
component: () => |
||||
import('@/views/MyCourseStudy/knowledgeLearningProcess.vue'), |
||||
name: 'LearningProcess1', |
||||
meta: { |
||||
title: '知识点学习记录', |
||||
hidden: false, |
||||
icon: 'StarFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/myCourseStudyManagement/learningProcess2', |
||||
component: () => import('@/views/MyCourseStudy/resourceLearning.vue'), |
||||
name: 'LearningProcess2', |
||||
meta: { |
||||
title: '资源学习记录', |
||||
hidden: false, |
||||
icon: 'StarFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/myCourseStudyManagement/courseCollections', |
||||
component: () => import('@/views/MyCourseStudy/courseCollections.vue'), |
||||
name: 'CourseCollections', |
||||
meta: { |
||||
title: '课程收藏', |
||||
hidden: false, |
||||
icon: 'StarFilled', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/myCourseStudyManagement/Courselikes', |
||||
component: () => import('@/views/MyCourseStudy/Courselikes.vue'), |
||||
name: 'Courselikes', |
||||
meta: { |
||||
title: '课程点赞', |
||||
hidden: false, |
||||
icon: 'StarFilled', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/courseResourcesManagement', |
||||
component: () => import('@/layout/index.vue'), |
||||
name: 'CourseResourcesManagement', |
||||
meta: { |
||||
title: '课程资源', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/courseResourcesManagement/courseResources', |
||||
component: () => import('@/views/courseResources/index.vue'), |
||||
name: 'CourseResources', |
||||
meta: { |
||||
title: '课程资源', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/portal', |
||||
component: () => import('@/views/portal/view.vue'), |
||||
name: 'Portal', |
||||
meta: { |
||||
title: '门户', |
||||
hidden: false, |
||||
icon: 'HomeFilled', // 菜单图标
|
||||
}, |
||||
children: [ |
||||
{ |
||||
path: '/portal/webHome', |
||||
component: () => import('@/views/portal/index.vue'), |
||||
name: 'WebHome', |
||||
meta: { |
||||
title: '网站首页', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/portal/courseHome', |
||||
component: () => import('@/views/portal/courseHomepage.vue'), |
||||
name: 'CourseHome', |
||||
meta: { |
||||
title: '课程首页', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/portal/LearningPathRecommendations', |
||||
component: () => |
||||
import('@/views/portal/LearningPathRecommendations.vue'), |
||||
name: 'LearningPathRecommendations', |
||||
meta: { |
||||
title: '学习路径推荐', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/portal/knowledgePointLearning', |
||||
component: () => import('@/views/portal/knowledgePointLearning.vue'), |
||||
name: 'KnowledgePointLearning', |
||||
meta: { |
||||
title: '知识点学习', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
{ |
||||
path: '/portal/courseReports', |
||||
component: () => import('@/views/portal/courseReports.vue'), |
||||
name: 'CourseReports', |
||||
meta: { |
||||
title: '课程报告', |
||||
hidden: false, |
||||
icon: 'Reading', |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
path: '/curriculumCenter/largeScreen', |
||||
component: () => import('@/views/course/largeScreen.vue'), |
||||
name: 'LargeScreen', // name 要与权限一致
|
||||
meta: { |
||||
title: '课程图谱', |
||||
hidden: true, |
||||
icon: 'Notebook', |
||||
}, |
||||
}, |
||||
] |
@ -0,0 +1,51 @@ |
||||
<template> |
||||
<el-upload ref="upload" class="upload-demo" action="#" :on-change="change" v-model:file-list="fileList" :limit="1" |
||||
:on-exceed="handleExceed" :auto-upload="false" list-type="picture-card"> |
||||
<el-icon> |
||||
<Plus /> |
||||
</el-icon> |
||||
<template #file="{ file }"> |
||||
<div> |
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" /> |
||||
<span class="el-upload-list__item-actions"> |
||||
<span class="el-upload-list__item-delete" @click="handleRemove"> |
||||
<el-icon> |
||||
<Delete /> |
||||
</el-icon> |
||||
</span> |
||||
</span> |
||||
</div> |
||||
</template> |
||||
</el-upload> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { ref, watch } from 'vue' |
||||
import type { UploadUserFile } from 'element-plus' |
||||
import { genFileId } from 'element-plus' |
||||
import { Delete, Plus } from '@element-plus/icons-vue' |
||||
const props = defineProps(['modelValue']) |
||||
const emit = defineEmits(['update:modelValue']) |
||||
watch(() => props.modelValue, newVal => { |
||||
if (!newVal) return |
||||
fileList.value.length = 0 |
||||
fileList.value.push({ url: props.modelValue }) |
||||
}, { once: true }) |
||||
const fileList = ref<UploadUserFile[]>([]) |
||||
const handleRemove = () => { |
||||
fileList.value.length = 0 |
||||
change({ raw: false }) |
||||
} |
||||
|
||||
function change(file: any) { |
||||
emit('update:modelValue', file.raw) |
||||
} |
||||
|
||||
const upload = ref() |
||||
const handleExceed = (files) => { |
||||
upload.value!.clearFiles() |
||||
const file = files[0] |
||||
file.uid = genFileId() |
||||
upload.value!.handleStart(file) |
||||
} |
||||
</script> |
@ -0,0 +1,93 @@ |
||||
<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> |
||||
<p>门户宣传图配置</p> |
||||
<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="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 { ref, reactive } from 'vue' |
||||
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:'' |
||||
}) |
||||
|
||||
const ran = ref(false) |
||||
getSysSettingApi().then((res) => { |
||||
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) |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.configuration-page { |
||||
width: 600px; |
||||
margin: auto; |
||||
} |
||||
</style> |
Loading…
Reference in new issue