diff --git a/src/api/index.js b/src/api/index.js
index ff32b19..be43a6b 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -91,6 +91,8 @@ export default {
delSeo: `/iasf/seo/delete`,
seoList: `/iasf/seo/list`,
updateSeo: `/iasf/seo/update`,
+ saveLogo: `/iasf/LogoService/Logo/saveOrUpdate`,
+ findLogo: `/iasf/LogoService/Logo/findById`,
batchDeletionFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/batchDeletion`,
findFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/findById`,
diff --git a/src/assets/images/page/shop.png b/src/assets/images/page/shop.png
new file mode 100644
index 0000000..a252bbe
Binary files /dev/null and b/src/assets/images/page/shop.png differ
diff --git a/src/components/modules/content.vue b/src/components/modules/content.vue
index b2af1ac..393dbf2 100644
--- a/src/components/modules/content.vue
+++ b/src/components/modules/content.vue
@@ -12,7 +12,7 @@
@@ -35,6 +35,17 @@
只支持.jpg,.png格式
+
+
+
+
+ 上传资源
+
+
+
+
@@ -92,10 +103,12 @@ export default {
isUpload: false,
file: {}, // 当前被选择的图片文件
curForm: {},
+ curItem: {},
fixed: false,
fixedNumber: [0.88, 1],
autoCropWidth: 480,
autoCropHeight: 124,
+ fileList: [],
};
},
watch: {
@@ -110,16 +123,28 @@ export default {
methods: {
// 处理form表单参数
handleForm () {
- const { forms, type } = this.data
+ const { forms, form, type } = this.data
this.fixed = false
// 这两张类型的模块才需要处理参数
if (forms) {
forms.map(e => {
- if (e.type === 'upload' && e.width) {
- this.autoCropWidth = e.width
- this.autoCropHeight = e.height
- this.fixed = true
- this.fixedNumber = [e.width / e.height, 1]
+ if (e.type === 'upload') {
+ if (e.width) {
+ this.autoCropWidth = e.width
+ this.autoCropHeight = e.height
+ this.fixed = true
+ this.fixedNumber = [e.width / e.height, 1]
+ } else {
+ this.fixed = false
+ }
+ }
+ if (e.type === 'media' && form.fileName) {
+ this.fileList = [
+ {
+ name: form.fileName,
+ url: form.video || e.pic
+ }
+ ]
}
if (e.required) {
this.rules[e.prop] = [
@@ -161,14 +186,14 @@ export default {
}, 1000);
return false
}
- this.$set(this.curForm, 'pic', data.url)
+ this.$set(this.curForm, this.curItem.prop, data.url)
}).catch(res => { })
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
// 图片改变钩子
- changeFile (file, form) {
+ changeFile (file, form, item) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
@@ -181,6 +206,7 @@ export default {
}
this.file = file
this.curForm = form
+ this.curItem = item
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
@@ -189,9 +215,28 @@ export default {
})
})
},
+ beforeRemove (file, fileList) {
+ return this.$confirm(`确定移除 ${file.name}?`);
+ },
+ handleRemove (file, fileList, form, prop) {
+ form[prop] = ''
+ form.fileName = ''
+ },
// 上传成功
- uploadSuccess (res, row) {
- this.$set(row, 'pic', res.url)
+ uploadSuccess (res, row, item) {
+ console.log("🚀 ~ file: content.vue:270 ~ uploadSuccess ~ item:", res, row, item)
+ this.$set(row, item.prop, res.url)
+ if (item.type === 'media') {
+ this.fileList = [
+ {
+ name: res.original,
+ url: res.url
+ }
+ ]
+ }
+ this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1))
+ this.$set(row, 'fileName', res.original)
+ // console.log("🚀 ~ file: content.vue:273 ~ uploadSuccess ~ row:", row)
},
// 展示链接设置
toLink (row, i = 0) {
diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue
index a8183e8..5cd1d9f 100644
--- a/src/components/modules/module.vue
+++ b/src/components/modules/module.vue
@@ -17,13 +17,13 @@
-
+
- {{ scope.row[item.prop] }}
+
@@ -64,7 +64,7 @@
上传图片
-
只支持.jpg,.png格式
+
只支持.jpg,.png,.mp4格式
-
-
+
+
@@ -37,7 +37,7 @@
设置
-
+
@@ -47,6 +47,12 @@
设置
+
+
+ 是
+ 否
+
+
@@ -110,14 +116,14 @@
-
+
-
+
@@ -185,16 +191,16 @@
@upload="customUpload" />
-
-
+
-
+
-
{{ scope.row.name }}
@@ -212,16 +218,16 @@
-
+
-
+
-
+
-
{{ scope.row.name }}
@@ -307,6 +313,7 @@ export default {
detailedDescription: '',
source: '平台官方',
coverImageUrl: '',
+ courseType: '',
subjectSpecialtyList: [
{
professionalClassList: [],
@@ -367,7 +374,7 @@ export default {
...mapState('content', [
'column'
]),
- getModelData: {
+ classification: {
get () {
const data = this.classifications.find(item => item.categoryId === this.form.classificationTagId)
return data ? data.categoryId : ''
@@ -445,6 +452,8 @@ export default {
const { data } = await this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`)
data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : []
if (data.classificationTagId) data.classificationTagId = +data.classificationTagId
+ if (data.courseType) data.courseType = +data.courseType
+
this.originalName = data.name
this.getColumnDetail()
// 学科专业处理
@@ -624,6 +633,7 @@ export default {
// 显示分类弹框
setClass () {
this.classVisible = true
+ this.getClassification()
},
// 新增分类
addClass () {
@@ -632,6 +642,10 @@ export default {
categoryId: '',
name: ''
})
+ this.$nextTick(() => {
+ const el = document.querySelector('.el-table__body-wrapper')
+ if (el) el.scrollTop = el.scrollHeight
+ })
},
// 编辑分类
editClass (row) {
@@ -654,8 +668,7 @@ export default {
},
// 提交分类
submitClass (row, showMsg = 1) {
- if (!row.name) return Util.errorMsg('请输入分类')
- // this.$post(`${this.api.checkClassif}?name=${row.name}&siteId=${this.site.id}&classificationTagId=${row.id}`).then(res => {
+ if (!row.name) return Util.errorMsg('请输入类型')
this.$post(this.api.categorySave, {
type: 0,
name: row.name,
@@ -663,11 +676,12 @@ export default {
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
- }).then(res => {
+ }).then(({ data }) => {
showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功')
- this.getClassification()
+ // 直接把id赋值进去
+ row.categoryId = data
+ row.edit = false
}).catch(res => { })
- // }).catch(res => { })
},
// 关闭所属分类
closeClass () {
@@ -698,14 +712,19 @@ export default {
// 显示类型
setLabel () {
this.labelVisible = true
+ this.getLabel()
},
// 新增类型
addLabel () {
this.categories.push({
edit: true,
- id: '',
+ categoryId: '',
name: ''
})
+ this.$nextTick(() => {
+ const el = document.querySelector('.el-table__body-wrapper')
+ if (el) el.scrollTop = el.scrollHeight
+ })
},
// 编辑类型
editLabel (row) {
@@ -728,8 +747,7 @@ export default {
},
// 提交类型
submitLabel (row, showMsg = 1) {
- if (!row.name) return Util.errorMsg('请输入类型')
- // this.$post(`${this.api.checkLabel}?name=${row.name}&siteId=${this.site.id}&labelId=${row.id}`).then(res => {
+ if (!row.name) return Util.errorMsg('请输入标签/分类')
this.$post(this.api.categorySave, {
type: 1,
name: row.name,
@@ -737,11 +755,12 @@ export default {
siteId: this.site.id,
editorId: this.userId,
founderId: this.userId
- }).then(res => {
+ }).then(({ data }) => {
showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功')
- this.getLabel()
+ // 直接把id赋值进去
+ row.categoryId = data
+ row.edit = false
}).catch(res => { })
- // }).catch(res => { })
},
// 关闭类型
closeLabel () {
@@ -876,7 +895,7 @@ export default {
},
// 预览
preview () {
- window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
+ window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/index/show?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
},
// 返回
back () {
diff --git a/src/pages/article/list/index.vue b/src/pages/article/list/index.vue
index b967f1e..58cd984 100644
--- a/src/pages/article/list/index.vue
+++ b/src/pages/article/list/index.vue
@@ -421,12 +421,12 @@ export default {
// 置顶
sticky (row) {
this.$post(`${this.api[this.isCourseProduct ? 'productDetailsTop' : 'articleTopOperation']}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
- this.initData()
+ this.getData()
}).catch(res => { })
},
// 预览
preview (row) {
- window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`)
+ window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/${this.isCourseProduct ? 'index/show' : 'article'}?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`)
},
// 编辑
edit (row) {
diff --git a/src/pages/column/page/aboutUs.vue b/src/pages/column/page/aboutUs.vue
index be3eac7..755ade7 100644
--- a/src/pages/column/page/aboutUs.vue
+++ b/src/pages/column/page/aboutUs.vue
@@ -169,56 +169,6 @@
-
-
diff --git a/src/pages/column/page/application.vue b/src/pages/column/page/application.vue
index 2eb703a..bbd556c 100644
--- a/src/pages/column/page/application.vue
+++ b/src/pages/column/page/application.vue
@@ -3,11 +3,9 @@
页面设置/APPLICATION
- 预览
+ 预览
保存为草稿
- 发布
+ 发布
放弃编辑
@@ -15,19 +13,14 @@
+ :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
-
-
+
+
-
点击更换banner与链接
+
点击更换banner与链接
@@ -39,38 +32,25 @@
{{ modules[1].form.des }}
-
+
- 点击更改图片、标题概述与链接
+ 点击更改图片、标题概述与链接
-
+
{{ modules[2].form.title }}
{{ modules[2].form.des }}
-
点击更换标题与描述
+
点击更换标题与描述
- -
-
-
+
-
+
+
{{ item.title }}
- 点击更标题与链接
+ 点击更标题与链接
@@ -81,17 +61,13 @@
{{ modules[4].form.title }}
{{ modules[4].form.des }}
-
点击更换标题与描述
+
点击更换标题与描述
- -
-
+
-
+
{{ item.title }}
- 点击更改图片、标题与链接
+ 点击更改图片、标题与链接
@@ -102,75 +78,76 @@
{{ modules[6].form.title }}
{{ modules[6].form.des }}
-
点击更换标题与描述
+
点击更换标题与描述
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
-
-
+
2022 New Year Message from President Sun Dongbai
-
2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)…
+
2021 is another challenging year for the Institute of Advanced Science Facilities,
+ Shenzhen
+ (IASF)…
2022.08.12
- 点击更换标题与描述
+ 点击更换标题与描述
-
+
@@ -211,142 +188,170 @@ export default {
\ No newline at end of file
diff --git a/src/pages/column/page/index.vue b/src/pages/column/page/index.vue
index eefdea8..48f0727 100644
--- a/src/pages/column/page/index.vue
+++ b/src/pages/column/page/index.vue
@@ -3,11 +3,9 @@
页面设置/首页
- 预览
+ 预览
保存为草稿
- 发布
+ 发布
放弃编辑
@@ -15,42 +13,31 @@
+ :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
-
-
+
+
-
点击更换banner与链接
+
点击更换banner与链接
- -
-
+
-
+
{{ item.title }}
{{ item.des }}
- 点击更改图片、标题、链接与描述
+ 点击更改图片、标题、链接与描述
-
+
@@ -91,45 +78,54 @@ export default {
\ No newline at end of file
diff --git a/src/pages/column/page/shop.vue b/src/pages/column/page/shop.vue
new file mode 100644
index 0000000..9a835d8
--- /dev/null
+++ b/src/pages/column/page/shop.vue
@@ -0,0 +1,131 @@
+
+
+
+
页面设置/首页
+
+ 预览
+ 保存为草稿
+ 发布
+ 放弃编辑
+
+
+
+
+
+
+
+
+
+
+
+
+
点击更换banner与链接
+
+
+
+
+ -
+
+
+
{{ item.title }}
+
{{ item.des }}
+
+
+
+ 点击更改图片、标题、链接与描述
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/floatingFrame/index.vue b/src/pages/floatingFrame/index.vue
index b33bec0..6b2c6cf 100644
--- a/src/pages/floatingFrame/index.vue
+++ b/src/pages/floatingFrame/index.vue
@@ -366,7 +366,7 @@ export default {
applicationScopeId: 0
}]
}
- form.isDisable = 1
+ // form.isDisable = 1
if (!form.floatingBarSchemeId) form.founderId = form.editorId // 新增则创建人即编辑人
try {
await this.$post(this.api.saveFloating, form)
diff --git a/src/pages/footer/index.vue b/src/pages/footer/index.vue
index 2f98e84..8138298 100644
--- a/src/pages/footer/index.vue
+++ b/src/pages/footer/index.vue
@@ -351,7 +351,7 @@ export default {
}]
}
form.footerContent = JSON.stringify(this.modules)
- form.isDisable = 1
+ // form.isDisable = 1
if (!form.footerId) form.founderId = form.editorId // 新增则创建人即编辑人
try {
await this.$post(this.api.saveFooter, form)
diff --git a/src/pages/logo/index.vue b/src/pages/logo/index.vue
new file mode 100644
index 0000000..cf06497
--- /dev/null
+++ b/src/pages/logo/index.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
上传logo
+
+
+
+
+
+
+
只能上传jpg/png文件,请上传120*40左右的logo
+
+
+
+
+ {{ form.id ? "更新" : "创建" }}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/seo/index.vue b/src/pages/seo/index.vue
index 9563ca6..c8636c1 100644
--- a/src/pages/seo/index.vue
+++ b/src/pages/seo/index.vue
@@ -63,7 +63,7 @@ export default {
this.$get(this.api.seoList, {
siteId: this.siteId,
}).then(({ data }) => {
- this.form = data[0]
+ if (data.length) this.form = data[0]
}).catch(err => { })
},
// 保存
@@ -72,7 +72,7 @@ export default {
if (valid) {
if (this.submiting) return false
this.submiting = true
- this.$post(this.api.updateSeo, this.form).then(res => {
+ this.$post(this.api[this.form.id ? 'updateSeo' : 'addSeo'], this.form).then(res => {
Util.successMsg('保存成功!')
this.submiting = false
}).catch(res => {
diff --git a/src/plugins/requests/index.js b/src/plugins/requests/index.js
index 0cd208f..ddc36cc 100644
--- a/src/plugins/requests/index.js
+++ b/src/plugins/requests/index.js
@@ -2,6 +2,7 @@ import axios from 'axios'
import Util from '@/libs/util'
import Setting from '@/setting'
import store from '@/store'
+import Router from '@/router'
const service = axios.create({
baseURL: Setting.apiBaseURL,
@@ -51,37 +52,42 @@ service.interceptors.response.use(
error => {
if (error.response.status) {
const { msg, code } = error.response.data
- switch (code) {
- // 401: 未登录
- case 401:
- Util.errorMsg("登录过期,请重新登录");
- setTimeout(() => {
- store.dispatch('user/logout')
- }, 1000);
- break;
- // 403 token过期
- case 403:
- Util.errorMsg("登录过期,请重新登录");
- setTimeout(() => {
- store.dispatch('user/logout')
- }, 1000);
- break;
- // 其他错误,直接抛出错误提示
- default:
- Util.errorMsg(msg);
- Promise.reject(error.response.data);
+ // 站点id为空
+ if (error.response.status === 405) {
+ Router.replace('/site')
+ } else {
+ switch (code) {
+ // 401: 未登录
+ case 401:
+ Util.errorMsg("登录过期,请重新登录")
+ setTimeout(() => {
+ store.dispatch('user/logout')
+ }, 1000)
+ break
+ // 403 token过期
+ case 403:
+ Util.errorMsg("登录过期,请重新登录")
+ setTimeout(() => {
+ store.dispatch('user/logout')
+ }, 1000)
+ break
+ // 其他错误,直接抛出错误提示
+ default:
+ Util.errorMsg(msg)
+ Promise.reject(error.response.data)
+ }
+ return Promise.reject(error.response)
}
- return Promise.reject(error.response);
}
}
-);
+)
function get (url, params) {
return new Promise((resolve, reject) => {
service.get(url, { params: params }).then(res => {
- resolve(res);
+ resolve(res)
}).catch(err => {
- reject(err);
+ reject(err)
});
});
}
diff --git a/src/router/modules/column.js b/src/router/modules/column.js
index 7a3d12c..500d4db 100644
--- a/src/router/modules/column.js
+++ b/src/router/modules/column.js
@@ -53,7 +53,7 @@ export default {
path: `careers`,
component: () => import('@/pages/column/page/careers'),
meta: { title: 'CAREERS' }
- },,
+ }, ,
{
name: `${pre}edu`,
path: `edu`,
@@ -267,5 +267,10 @@ export default {
component: () => import('@/pages/column/page/aboutUs'),
meta: { title: '关于我们' }
},
+ {
+ path: `shop`,
+ component: () => import('@/pages/column/page/shop'),
+ meta: { title: '产品中心' }
+ },
]
}
diff --git a/src/router/modules/logo.js b/src/router/modules/logo.js
new file mode 100644
index 0000000..90d255e
--- /dev/null
+++ b/src/router/modules/logo.js
@@ -0,0 +1,16 @@
+import BasicLayout from '@/layouts/home'
+
+const meta = {}
+
+export default {
+ path: '/logo',
+ meta,
+ component: BasicLayout,
+ children: [
+ {
+ path: `/logo`,
+ component: () => import('@/pages/logo'),
+ meta: { title: '网站logo设置' }
+ },
+ ]
+}
diff --git a/src/router/modules/seo.js b/src/router/modules/seo.js
index 9dfc16a..d2c209d 100644
--- a/src/router/modules/seo.js
+++ b/src/router/modules/seo.js
@@ -5,14 +5,14 @@ const meta = {}
const pre = 'article-'
export default {
- path: '/seo',
- meta,
- component: BasicLayout,
- children: [
- {
- path: `/seo`,
- component: () => import('@/pages/seo'),
- meta: { title: 'SEO管理' }
- },
- ]
+ path: '/seo',
+ meta,
+ component: BasicLayout,
+ children: [
+ {
+ path: `/seo`,
+ component: () => import('@/pages/seo'),
+ meta: { title: 'SEO管理' }
+ },
+ ]
}
diff --git a/src/setting.js b/src/setting.js
index e2b7b9b..8cd23f3 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = location.origin
if (isDev) {
host = 'https://huorantech.com'
- // host = 'http://192.168.31.217:10000'
+ host = 'http://192.168.31.217:10000'
}
const Setting = {
@@ -16,8 +16,7 @@ const Setting = {
routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址
- // huoranApi: `https://occupationlab.com`,
- huoranApi: `http://121.37.12.51`,
+ huoranApi: `https://occupationlab.com`,
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice