长页联调及bug修复

master
yujialong 2 years ago
parent fa3304b0e2
commit 861944f20e
  1. 2
      public/tinymce/langs/zh_CN.js
  2. BIN
      src/assets/images/page/exp.png
  3. BIN
      src/assets/images/page/science.png
  4. BIN
      src/assets/images/page/sfel.png
  5. BIN
      src/assets/images/page/survey.png
  6. BIN
      src/assets/images/page/talent.png
  7. BIN
      src/assets/images/page/userSharing.png
  8. 1
      src/components/editor.js
  9. 26
      src/const/column.js
  10. 2
      src/mixins/page/index.js
  11. 3
      src/pages/article/add/editor.js
  12. 136
      src/pages/article/add/index.vue
  13. 21
      src/pages/column/add/index.vue
  14. 1
      src/pages/column/page/news.vue
  15. 15
      src/pages/role/list/index.vue
  16. 4
      src/pages/user/list/index.vue
  17. 57
      src/plugins/requests/index.js
  18. 2
      src/setting.js
  19. 1
      src/styles/page/page.scss

@ -4,7 +4,7 @@
* Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
* Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
*/
tinymce.addI18n('zh-Hans', {
tinymce.addI18n('zh_CN', {
"Redo": "重做",
"Undo": "撤销",
"Cut": "剪切",

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

@ -5,6 +5,7 @@ import Util from '@/libs/util'
export default {
//skin:'oxide-dark',
language:'zh_CN',
language_url: './tinymce/langs/zh_CN.js',
plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter',
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \

@ -22,6 +22,32 @@ export default {
name: '子级优先栏目'
}
],
long: [
{
name: 'SFEL',
path: 'sfel'
},
{
name: 'SFEL-科普之窗',
path: 'science'
},
{
name: 'SFEL-装置介绍-实验站',
path: 'exp'
},
{
name: 'SFEL-人才队伍',
path: 'talent'
},
{
name: 'SFEL-用户共享',
path: 'userSharing'
},
{
name: 'SFEL-概况',
path: 'survey'
},
],
// 出版物类型
publicationTypes: [
{

@ -68,7 +68,7 @@ export default {
this.id = json.id
const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing']
this.originModules = str // 原始json,用以页面离开的时候判断是否需要提示保存
// this.modules = JSON.parse(str)
this.modules = JSON.parse(str)
console.log("🚀 ~ file: index.js ~ line 53 ~ this.$post ~ this.modules", this.modules)
}
}).catch(err => {})

@ -5,8 +5,9 @@ import Util from '@/libs/util'
export default {
//skin:'oxide-dark',
language:'zh_CN',
language_url: './tinymce/langs/zh_CN.js',
plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter',
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em formatpainter',
style_formats: [

@ -18,7 +18,7 @@
</div>
<ul v-if="form.templateStatus" class="styles">
<template v-for="(item, i) in detailStyle">
<li v-if="item.id !== column.detailStyle" :key="i" @click="form.articleTemplate = item.id">
<li v-if="item.id !== column.detailStyle" :key="i" @click="styleChange(item.id)">
<div class="review">
<img :class="{'is-link': item.id == 24}" :src="require('@/assets/images/style/' + item.id + '.png')" alt="">
</div>
@ -321,14 +321,27 @@
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="form.connectionType === 1" prop="connectionType" label="站内链接">
<template v-if="form.connectionType === 1">
<el-form-item label="站内链接">
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable></el-cascader>
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item v-show="form.connectionType === 2" prop="connectionType" label="站内链接">
<el-form-item label="文章">
<el-select v-model="article" clearable>
<el-option
v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接">
<el-input
placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
@ -351,9 +364,27 @@
v-model="otherLink"
:options="otherColumns"
:props="columnProps"
clearable></el-cascader>
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="otherArticle" clearable>
<el-option
v-for="item in otherArticles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item prop="isOpen" label="新窗口打开">
<el-switch
v-model="form.isOpen"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</template>
</el-form>
<div class="btns">
@ -458,16 +489,20 @@ export default {
},
nameRepeat: false,
sites: [],
otherColumns: [],
otherLink: [],
detailStyle: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherColumns: [],
otherLink: [],
otherArticle: '',
form: {
siteId: this.$store.state.content.site.id,
id: this.$route.query.id || '',
@ -505,7 +540,8 @@ export default {
connectionType : 1,
linkAddress: '',
siteSelection: 1,
fileList: []
fileList: [],
isOpen: 1
},
rules: {
title: [
@ -668,6 +704,22 @@ export default {
e.children.length ? this.getId(e.children, e.ids) : delete e.children
})
},
//
getArticle() {
// /
const inner = this.form.connectionType === 1
const id = inner ? this.links[this.links.length - 1] : this.otherLink[this.otherLink.length - 1]
this[inner ? 'article' : 'otherArticle'] = ''
this.$post(this.api.queryArticle, {
siteId: inner ? this.site.id : this.form.siteSelection,
columnIds: [id],
pageNum: 1,
pageSize: 1000,
title: ''
}).then(({ data }) => {
this[inner ? 'articles' : 'otherArticles'] = data.records.filter(e => e.isRelease) //
}).catch(err => {})
},
//
getData() {
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => {
@ -681,14 +733,36 @@ export default {
}
//
if (data.articleTemplate === 24 && data.connectionType !== 2 && data.linkAddress) {
const links = data.linkAddress.split(',').map(e => +e)
if (data.connectionType === 1) this.links = links
if (data.connectionType === 3) this.otherLink = links
data.linkAddress = ''
const columnArticle = data.linkAddress.split('-')
const column = columnArticle[0].split(',').map(e => +e)
console.log("🚀 ~ file: index.vue:737 ~ this.$post ~ columnArticle", column)
const article = columnArticle[1] || '' // ididlinkAddress-
const { connectionType } = data
//
this.$post(this.api.queryArticle, {
siteId: connectionType === 1 ? this.site.id : data.siteSelection,
columnIds: [column[column.length - 1]], // ididid
pageNum: 1,
pageSize: 1000,
title: ''
}).then(res => {
this[connectionType === 1 ? 'articles' : 'otherArticles'] = res.data.records
// /
if (connectionType === 1) {
this.links = column
this.form.linkAddress = ''
if (article) this.article = +article
} else if (connectionType === 3) {
this.otherLink = column
this.form.linkAddress = ''
if (article) this.otherArticle = +article
}
}).catch(err => {})
}
data.siteSelection && this.getOtherColumn()
this.originalName = data.title
this.form = data
data.siteSelection && this.getOtherColumn()
this.getColumn()
}).catch(err => {})
},
@ -701,17 +775,28 @@ export default {
if (!form.templateStatus) {
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 23
}
//
if (form.articleTemplate === 25) {
this.rules.titleImg[0].required = false
this.rules.classificationId[0].required = true
}
this.handleRules()
this.getClassification()
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(err => {})
},
//
handleRules() {
const { articleTemplate } = this.form
//
if (articleTemplate === 25) {
this.rules.titleImg[0].required = false
} else {
this.rules.titleImg[0].required = true
}
},
//
styleChange(id) {
this.form.articleTemplate = id
this.handleRules()
},
//
getSite() {
this.$post(this.api.site, {
@ -723,7 +808,7 @@ export default {
}).catch(e => {})
},
//
getOtherColumn() {
getOtherColumn(val) {
this.$post(this.api.listWithTree, {
siteId: this.form.siteSelection,
columnName: '',
@ -731,6 +816,11 @@ export default {
typeId : '',
isSort: 1
}).then(({ data }) => {
if (val) {
this.otherArticles = []
this.otherArticle = ''
this.otherLink = ''
}
this.otherColumns = data
}).catch(err => {})
},
@ -998,9 +1088,9 @@ export default {
},
//
handleRemove(e, fileList) {
e.id && this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {
e.id ? this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {
this.form.fileList = fileList
}).catch(res => {})
}).catch(res => {}) : (this.form.fileList = fileList)
},
// banner
uploadSuccessBanner(res) {
@ -1080,7 +1170,7 @@ export default {
if (tId !== 25) {
if (!form.releaseTime) return Util.errorMsg('请选择发布日期')
}
if (tId === 22 || tId === 23) {
if (tId === 22 || tId === 23 || tId === 24) {
if (!form.titleImg ) return Util.errorMsg('请上传封面')
}
if (tId === 25) {
@ -1101,8 +1191,10 @@ export default {
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布')
if (form.connectionType === 1) {
form.linkAddress = this.links.join()
if (this.article) form.linkAddress += '-' + this.article
} else if (form.connectionType === 3) {
form.linkAddress = this.otherLink.join()
if (this.otherArticle) form.linkAddress += '-' + this.otherArticle
}
const { columnId, bannerImg, fileList, titleImg } = form
const fileId = []

@ -159,7 +159,7 @@
<el-form-item label="文章">
<el-select v-model="otherArticle" clearable>
<el-option
v-for="item in articles"
v-for="item in otherArticles"
:key="item.id"
:label="item.title"
:value="item.id">
@ -242,6 +242,7 @@ export default {
sites: [],
columns: [],
articles: [],
otherArticles: [],
columnProps: {
checkStrictly: true,
value: 'id',
@ -408,7 +409,7 @@ export default {
pageSize: 1000,
title: ''
}).then(({ data }) => {
this.articles = data.records.filter(e => e.isRelease) //
this[inner ? 'articles' : 'otherArticles'] = data.records.filter(e => e.isRelease) //
}).catch(err => {})
},
//
@ -422,21 +423,22 @@ export default {
const columnArticle = data.linkAddress.split('-')
const column = columnArticle[0].split(',').map(e => +e)
const article = columnArticle[1] || '' // ididlinkAddress-
const { connectionType } = data
//
this.$post(this.api.queryArticle, {
siteId: data.connectionType === 1 ? this.site.id : data.siteSelection,
siteId: connectionType === 1 ? this.site.id : data.siteSelection,
columnIds: [column[column.length - 1]], // ididid
pageNum: 1,
pageSize: 1000,
title: ''
}).then(res => {
this.articles = res.data.records
this[connectionType === 1 ? 'articles' : 'otherArticles'] = res.data.records
// /
if (data.connectionType === 1) {
if (connectionType === 1) {
this.links = column
this.form.linkAddress = ''
if (article) this.article = +article
} else if (data.connectionType === 3) {
} else if (connectionType === 3) {
this.otherLink = column
this.form.linkAddress = ''
if (article) this.otherArticle = +article
@ -496,7 +498,7 @@ export default {
}).catch(e => {})
},
//
getOtherColumn() {
getOtherColumn(val) {
this.$post(this.api.listWithTree, {
siteId: this.form.siteSelection,
columnName: '',
@ -504,6 +506,11 @@ export default {
typeId : '',
isSort: 1
}).then(({ data }) => {
if (val) {
this.otherArticles = []
this.otherArticle = ''
this.otherLink = ''
}
this.otherColumns = data
}).catch(err => {})
},

@ -299,6 +299,7 @@ export default {
box-shadow: 0px 2px 14px 0px rgba(167,167,167,0.26);
li {
position: relative;
min-width: 100px;
padding: 25px 19px;
margin: 0 10px;
font-size: 22px;

@ -113,8 +113,9 @@ export default {
limit: this.pageSize,
name: this.keyword,
}).then(({ data }) => {
this.list = data.records
this.total = +data.total
const list = data.records.filter(e => e.id !== 1) //
this.list = list
this.total = data.total == 0 ? 0 : +data.total - 1
}).catch(res => {})
},
initData() {
@ -123,8 +124,8 @@ export default {
this.getData()
},
currentChange(val) {
this.page = val;
this.getData();
this.page = val
this.getData()
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
@ -132,9 +133,9 @@ export default {
}).then(() => {
this.$del(this.api.deleteRole, [row.id]).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
this.getData()
}).catch(res => {})
}).catch(() => {})
},
handleSelectionChange(val) {
this.multipleSelection = val;

@ -1,6 +1,6 @@
<template>
<div class="flex">
<div class="page" style="width: 218px;border-right: 1px solid #EBEDF0">
<div class="page" style="width: 230px;border-right: 1px solid #EBEDF0">
<div class="m-b-20">
<p class="page-name mb">后台员工账号</p>
<el-radio-group v-model="staffType" @change="changeType">
@ -885,6 +885,6 @@ export default {
}
}
.list-wrap {
width: calc(100% - 219px);
width: calc(100% - 231px);
}
</style>

@ -1,6 +1,5 @@
import axios from "axios";
import util from "@/libs/util";
import router from "@/router/index";
import Util from "@/libs/util";
import Setting from "@/setting";
import store from '@/store'
@ -10,15 +9,13 @@ const service = axios.create({
});
// post请求头
service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
// service.defaults.withCredentials = true
// 请求拦截器
service.interceptors.request.use(config => {
let token = util.local.get(Setting.tokenKey);
let token = Util.local.get(Setting.tokenKey);
if (token) config.headers.token = token
return config;
}, err => {
util.errorMsg({
Util.errorMsg({
message: "退出登陆",
onClose: function() {
store.dispatch('user/logout')
@ -30,58 +27,38 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(
response => {
const res = response.data;
if (res.code == 200) {
const res = response.data
const { code } = res
if (code == 200) {
return Promise.resolve(res).catch(e => {});
} else if (code === 401) {
Util.errorMsg(res.msg)
setTimeout(() => {
store.dispatch('user/logout')
}, 1000)
return Promise.reject(res)
} else {
util.errorMsg(res.msg);
Util.errorMsg(res.msg);
return Promise.reject(res)
// return Promise.resolve(res).catch(e => {});
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey);
util.errorMsg("登录过期,请重新登录");
setTimeout(() => {
store.dispatch('user/logout')
}, 1000);
break;
case 500:
util.errorMsg("网络错误");
break;
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey);
util.errorMsg("登录过期,请重新登录");
// 清除token
// store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
store.dispatch('user/logout')
}, 1000);
Util.errorMsg("网络错误");
break;
// 404请求不存在
case 404:
util.errorMsg("网络请求不存在!");
Util.errorMsg("网络请求不存在!");
break;
case 401001:
util.errorMsg(error.response.data.msg);
Util.errorMsg(error.response.data.msg);
break;
// 其他错误,直接抛出错误提示
default:
util.errorMsg(error.response.data.msg);
Util.errorMsg(error.response.data.msg);
Promise.reject(res);
}
return Promise.reject(error.response);

@ -7,7 +7,7 @@ let host = `${location.origin}/`
if (isDev) {
host = 'http://192.168.31.136:10000/' // 测试服
// host = 'http://192.168.31.51:10000/' // 榕
// host = 'http://192.168.31.116:10000/' // 赓
host = 'http://192.168.31.116:10000/' // 赓
}
const Setting = {

@ -64,6 +64,7 @@
justify-content: center;
align-items: center;
font-size: 22px;
white-space: nowrap;
color: #fff;
background-color: rgba(0, 0, 0, .5);
cursor: pointer;

Loading…
Cancel
Save