master
yujialong 2 years ago
parent 982ec52326
commit 8ff5dc70e7
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 5
      src/api/index.js
  4. BIN
      src/assets/img/list3.png
  5. 35
      src/const/column.js
  6. 22
      src/layouts/header/index.vue
  7. 11
      src/libs/util.js
  8. 8
      src/pages/annex/list/index.vue
  9. 75
      src/pages/article/add/editor.js
  10. 46
      src/pages/article/add/index.vue
  11. 24
      src/pages/article/list/index.vue
  12. 130
      src/pages/column/add/index.vue
  13. 145
      src/pages/column/list/index.vue
  14. 1
      src/pages/setting/list/index.vue
  15. 11
      src/pages/setting/list/info.vue
  16. 11
      src/pages/site/list/index.vue
  17. 4
      src/pages/user/list/index.vue
  18. 2
      src/setting.js
  19. 2
      src/styles/common.scss

5
package-lock.json generated

@ -995,6 +995,11 @@
}
}
},
"@tinymce/tinymce-vue": {
"version": "3.2.8",
"resolved": "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-3.2.8.tgz",
"integrity": "sha512-jEz+NZ0g+FZFz273OEUWz9QkwPMyjc5AJYyxOgu51O1Y5UaJ/6IUddXTX6A20mwCleEv5ebwNYdalviafx4fnA=="
},
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",

@ -8,6 +8,7 @@
"build": "vue-cli-service build"
},
"dependencies": {
"@tinymce/tinymce-vue": "^3.2.8",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"echarts": "^4.8.0",

@ -1,6 +1,6 @@
import Setting from '@/setting'
const host = Setting.apiBaseURL
const host1 = 'http://192.168.31.136:10000/'
const host1 = 'http://192.168.31.151:10000/'
export default {
logins: `iasf/sys/user/login`,
@ -13,7 +13,7 @@ export default {
depts: `iasf/sys/dept/tree`,
users: `iasf/sys/users`,
user: `iasf/sys/user`,
staffTemplate: `http://192.168.31.137:10000/iasf/sysFiles/preview/1559385019981807617`,
staffTemplate: `http://192.168.31.136/用户导入模板.xlsx`,
checkJobNumber: `iasf/sys/checkJobNumber`,
checkUsername: `iasf/sys/checkUsername`,
resetPwd: `iasf/sys/resetPwd`,
@ -34,6 +34,7 @@ export default {
findColumn: `${host1}iasf/sysColumn/findById`,
deleteColumn: `${host1}iasf/sysColumn/delete`,
sameLevelJudgment: `${host1}iasf/sysColumn/sameLevelJudgment`,
sortByColumn: `${host1}iasf/sysColumn/sortByColumn`,
checkIfTheTitleIsRepeat: `${host1}iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `${host1}iasf/sysContent/delete`,
findArticle: `${host1}iasf/sysContent/findById`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

@ -33,37 +33,34 @@ export default {
name: '文库'
},
],
// 站点
sites: [
// 列表样式
listStyle: [
{
id: 1,
name: '粒子研究院英文站点',
domain: 'www.iasf.ac.cn'
name: '图片列表'
},
{
id: 2,
name: '粒子研究院中文站点',
domain: 'www.iasf.ac.cn'
name: '新闻列表'
},
{
id: 3,
name: 'SFEL中文站点',
domain: 'www.iasf.ac.cn'
},
name: '出版物列表'
}
],
// 详情样式
detailStyle: [
{
id: 4,
name: 'SFEL英文站点',
domain: 'www.iasf.ac.cn'
id: 1,
name: '视频详情'
},
{
id: 5,
name: 'SRL中文站点',
domain: 'www.iasf.ac.cn'
id: 2,
name: '富文本'
},
{
id: 6,
name: 'SRL英文站点',
domain: 'www.iasf.ac.cn'
},
id: 3,
name: '链接'
}
],
}

@ -15,14 +15,14 @@
切换站点<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(site, i) in sites" :key="i" :command="site">{{ site.name }}</el-dropdown-item>
<el-dropdown-item v-for="(site, i) in sites" :key="i" :command="site">{{ site.siteName }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<!-- <img class="cp" src="@/assets/img/notice.png"> -->
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="24" :src="avatar"></el-avatar>
<el-avatar :size="36" :src="avatar"></el-avatar>
<span class="username">{{userName}}</span>
</div>
<el-dropdown-menu slot="dropdown">
@ -35,12 +35,12 @@
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
import ColumnConst from '@/const/column'
import breadcrumb from '@/components/breadcrumb'
import util from '@/libs/util'
export default {
data() {
return {
sites: ColumnConst.sites,
sites: [],
crumbRefresh: true,
inContent: false, //
sitePath: ['/page', '/column', '/article']
@ -52,6 +52,9 @@ export default {
computed: {
...mapState('user', [
'avatar', 'userName', 'crumbs'
]),
...mapState('auth', [
'btns'
])
},
watch: {
@ -66,6 +69,7 @@ export default {
}
},
mounted() {
this.getSite()
this.setContent()
},
methods: {
@ -75,6 +79,16 @@ export default {
...mapMutations('content', [
'setSite'
]),
//
getSite() {
this.$post(this.api.site, {
page: 1,
limit: 1000,
siteName: ''
}).then(({ data }) => {
this.sites = util.getSite(data.records)
}).catch(e => {})
},
//
setContent() {
const { path } = this.$route

@ -18,6 +18,15 @@ const util = {
cookies,
local: _local,
session: _session,
// 筛选出有权限的站点
getSite(list) {
const result = []
const auth = store.state.auth.btns
list.map(e => {
auth.find(n => n.includes(e.siteName)) && result.push(e)
})
return result
},
// 传入身份证获取生日
getBirth(idCard) {
var birthday = "";
@ -83,7 +92,7 @@ const util = {
},
// 传入文件后缀判断是否是图片
isImg(ext) {
if (exts.img.includes(ext)) return true;
if (exts.img.includes(ext.toLowerCase())) return true;
return false;
},
// 传入文件后缀判断是否是pdf以外的文档

@ -79,6 +79,7 @@
</template>
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
data() {
@ -125,6 +126,11 @@ export default {
multipleSelection: [],
};
},
computed: {
...mapState('auth', [
'btns'
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
@ -165,7 +171,7 @@ export default {
limit: 1000,
siteName: ''
}).then(({ data }) => {
this.sites = data.records
this.sites = util.getSite(data.records)
}).catch(e => {})
},
initData() {

@ -0,0 +1,75 @@
import axios from 'axios'
import Api from '@/api'
export default {
//skin:'oxide-dark',
language:'zh_CN',
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 formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em lineheight formatpainter',
height: 650, //编辑器高度
min_height: 400,
/*content_css: [ //css使
'/static/reset.css',
'/static/ax.css',
'/static/css.css',
],*/
fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px',
font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif',
link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
],
image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
],
image_class_list: [
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
],
//importcss_append: true,
//自定义文件选择器的回调内容
file_picker_callback: function (callback, value, meta) {
if (meta.filetype === 'file') {
callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' });
}
if (meta.filetype === 'image') {
callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' });
}
if (meta.filetype === 'media') {
callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' });
}
},
//为内容模板插件提供预置模板
templates: [
{ title: '模板1', description: '介绍文字1', content: '模板内容' },
{ title: '模板2', description: '介绍文字2', content: '<div class="mceTmpl"><span class="cdate">CDATE</span>,<span class="mdate">MDATE</span>,我的内容</div>' }
],
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
// extended_valid_elements:'script[src]',
//
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false,
toolbar_mode : 'wrap',
automatic_uploads: true,
// images_upload_base_path: '/demo',
// images_upload_url: 'http://192.168.31.136:10000/iasf/sysFiles/upload',
paste_data_images: true,
images_upload_handler: function (blobInfo, succFun, failFun) {
const form = new FormData()
form.append('file', blobInfo.blob()),
axios({
method: 'post',
url: Api.upload,
data: form,
headers: {
'Content-Type': 'multipart/form-data'
},
}).then(({ data }) => {
succFun(data.url)
}).catch(res => {})
},
//icons:'ax-color',
}

@ -1,6 +1,6 @@
<template>
<div class="page">
<p class="page-name mb">{{ }}栏目</p>
<p class="page-name mb">文章详情</p>
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px">
<el-form-item prop="title" label="标题">
<el-input
@ -67,8 +67,6 @@
:before-upload="beforeUpload"
:on-error="uploadError"
:on-success="uploadSuccess"
:limit="1"
:on-exceed="handleExceed"
:show-file-list="false"
:action="this.api.upload"
:data="{
@ -91,8 +89,6 @@
:before-upload="beforeUpload"
:on-error="uploadError"
:on-success="uploadSuccessBanner"
:limit="1"
:on-exceed="handleExceed"
:show-file-list="false"
:action="this.api.upload"
:data="{
@ -143,7 +139,7 @@
</el-form-item>
<template v-if="form.articleTemplate === 1 || form.articleTemplate === 2">
<el-form-item prop="mainBody" label="正文">
<VueUeditorWrap v-model="form.mainBody" :config="editorConfig" editor-id="editor"/>
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
</el-form-item>
<el-form-item prop="file" label="文件上传">
<el-upload
@ -226,7 +222,8 @@
import util from '@/libs/util'
import ColumnConst from '@/const/column'
import { mapState } from 'vuex'
import VueUeditorWrap from 'vue-ueditor-wrap'
import Editor from '@tinymce/tinymce-vue'
import editorConfig from './editor'
export default {
data() {
return {
@ -246,8 +243,8 @@ export default {
form: {
siteId: this.$store.state.content.site.id,
id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId,
founderId: this.$store.state.user.userId,
editorId: this.$store.state.user.userId,
useArticleTemplate: 0,
articleTemplate: this.$route.query.columnId ? this.$store.state.content.column.detailStyle : '',
author: '',
@ -282,11 +279,8 @@ export default {
{ required: true, message: '请选择连接类型', trigger: 'blur' }
],
},
editorConfig: {
UEDITOR_HOME_URL: '/UEditor/',
initialFrameHeight: 200,
serverUrl: 'http://192.168.31.137:10000/iasf/sysFiles/upload' //
},
fileList: [],
editorConfig,
submiting: false, //
updateTime: 0
};
@ -297,7 +291,16 @@ export default {
])
},
components: {
VueUeditorWrap
Editor
},
watch: {
// ,
form: {
handler(val){
this.updateTime++
},
deep:true
}
},
mounted() {
this.$store.commit('user/setCrumbs', [
@ -319,15 +322,6 @@ export default {
this.getList()
this.form.id && this.getData()
},
watch: {
// ,
form: {
handler(val){
this.updateTime++
},
deep:true
}
},
methods: {
//
getList() {
@ -425,9 +419,13 @@ export default {
this.form.file = ''
},
uploadSuccess(res) {
let url = this.form.titleImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {})
this.form.titleImg = res.url
},
uploadSuccessBanner(res) {
let url = this.form.bannerImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {})
this.form.bannerImg = res.url
},
uploadSuccessFile(res) {

@ -6,18 +6,18 @@
<el-tree ref="column" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all :props="defaultProps" node-key="id" @node-click="getData"></el-tree>
</div>
</div>
<div class="flex-1 p-l-20">
<div class="p-l-20" style="width: calc(100% - 219px);">
<div class="tool">
<div class="search-wrap">
<!-- <el-select v-model="field" @change="initData">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select> -->
<el-input placeholder="请输入文章标题" v-model.trim="keyword" clearable></el-input>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-dropdown class="setting" trigger="click" :hide-on-click="false">
@ -49,8 +49,8 @@
</el-table-column>
<el-table-column v-if="settings[4].show" prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[5].show" prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[6].show" prop="updateTime" label="修改日期" align="center" min-width="120"></el-table-column>
<el-table-column v-if="settings[7].show" prop="releaseTime" label="发布日期" align="center" min-width="120"></el-table-column>
<el-table-column v-if="settings[6].show" prop="updateTime" label="修改日期" align="center" min-width="130"></el-table-column>
<el-table-column v-if="settings[7].show" prop="releaseTime" label="发布日期" align="center" min-width="130"></el-table-column>
<el-table-column v-if="settings[8].show" prop="totalBrowsing" label="总浏览" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[9].show" prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
@ -93,15 +93,15 @@ export default {
name: '标题'
},
{
id: 'founderName',
id: 'founder',
name: '录入人'
},
{
id: 'columnName',
id: 'column',
name: '栏目'
},
{
id: 'editorName',
id: 'editor',
name: '修改人'
}
],
@ -207,12 +207,16 @@ export default {
getData() {
const id = this.$refs.column.getCurrentKey()
this.$router.push(`/article?columnId=${id}`).catch(e => {})
const { keyword } = this
this.$post(this.api.queryArticle, {
siteId: this.$store.state.content.site.id,
columnIds: [id],
pageNum: this.page,
pageSize: this.pageSize,
title: this.keyword
title: this.field === 'title' ? keyword : '',
founder: this.field === 'founder' ? keyword : '',
column: this.field === 'column' ? keyword : '',
editor: this.field === 'editor' ? keyword : ''
}).then(({ data }) => {
this.list = data.records
this.total = +data.total

@ -1,6 +1,6 @@
<template>
<div class="page">
<p class="page-name mb">新增栏目</p>
<p class="page-name mb">栏目</p>
<el-form :model="form" :rules="rules" class="input-form model" label-width="120px">
<div class="item-line">
<el-form-item prop="columnName" label="栏目名称">
@ -22,7 +22,7 @@
</div>
<div class="item-line">
<el-form-item prop="typeId" label="栏目类型">
<el-select v-model="form.typeId" @change="typeChange">
<el-select v-model="form.typeId">
<el-option
v-for="item in types"
:key="item.id"
@ -44,7 +44,7 @@
</div>
<div class="line"></div>
<template v-if="form.typeId === 1 || form.typeId === 4">
<el-form-item prop="columnBanner" label="栏目banner">
<el-form-item prop="columnBanner" label="栏目Banner">
<el-upload
class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
@ -52,8 +52,6 @@
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:limit="1"
:on-exceed="handleExceed"
:show-file-list="false"
:action="this.api.upload"
:data="{
@ -84,45 +82,21 @@
</el-form-item>
<el-form-item prop="listStyleId" label="列表样式">
<ul class="styles">
<li>
<div class="review">
<img src="@/assets/img/list1.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
</li>
<li>
<div class="review">
<img src="@/assets/img/list2.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio>
</li>
<li>
<li v-for="(item, i) in listStyle" :key="i">
<div class="review">
<img src="@/assets/img/list2.png" alt="">
<img :src="require('@/assets/img/list' + item.id + '.png')" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.name }}</el-radio>
</li>
</ul>
</el-form-item>
<el-form-item prop="detailStyle" label="详情样式">
<ul class="styles">
<li>
<div class="review">
<img src="@/assets/img/article1.png" alt="">
</div>
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio>
</li>
<li>
<li v-for="(item, i) in detailStyle" :key="i">
<div class="review">
<img src="@/assets/img/article2.png" alt="">
<img :src="require('@/assets/img/article' + item.id + '.png')" alt="">
</div>
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio>
</li>
<li>
<div class="review">
<img src="@/assets/img/article3.png" alt="">
</div>
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio>
<el-radio v-model="form.detailStyle" :label="item.id">{{ item.name }}</el-radio>
</li>
</ul>
</el-form-item>
@ -135,13 +109,26 @@
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="form.connectionType === 1" 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 label="文章">
<el-select v-model="article">
<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="请输入站外链接"
@ -165,7 +152,18 @@
v-model="otherLink"
:options="columns"
:props="columnProps"
clearable></el-cascader>
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="otherArticle">
<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 prop="isOpen" label="新窗口打开">
@ -234,22 +232,27 @@ export default {
site: this.$store.state.content.site,
isEdit: this.$route.query.type === 'edit',
nameRepeat: false,
listStyle: ColumnConst.listStyle,
detailStyle: ColumnConst.detailStyle,
types: ColumnConst.types,
templates: ColumnConst.templates,
sites: [],
columns: [],
articles: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
article: '',
otherLink: [],
otherArticle: '',
form: {
siteId: this.$store.state.content.site.id,
id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId,
founderId: this.$store.state.user.userId,
editorId: this.$store.state.user.userId,
fatherId: +this.$route.query.id || 0,
level: this.$route.query.level || 1,
columnName: '',
@ -330,7 +333,7 @@ export default {
},
},
methods: {
//
//
getList() {
this.$post(this.api.listWithTree, {
siteId: this.site.id,
@ -342,6 +345,20 @@ export default {
this.isEdit && this.getData()
}).catch(err => {})
},
//
getArticle() {
// /
const id = this.form.connectionType === 1 ? this.links[this.links.length - 1] : this.otherLink[this.otherLink.length - 1]
this.$post(this.api.queryArticle, {
siteId: this.site.id,
columnIds: [id],
pageNum: 1,
pageSize: 1000,
title: ''
}).then(({ data }) => {
this.articles = data.records
}).catch(err => {})
},
//
getData() {
this.$post(`${this.api.findColumn}?id=${this.form.id}`).then(({ data }) => {
@ -350,13 +367,27 @@ export default {
let link = data.linkAddress
if (link) {
link = link.split(',').map(e => +e)
const article = +link.splice(link.length - 1, 1) // ididlinkAddressid
//
this.$post(this.api.queryArticle, {
siteId: this.site.id,
columnIds: [link[link.length - 1]], // ididid
pageNum: 1,
pageSize: 1000,
title: ''
}).then(res => {
this.articles = res.data.records
// /
if (data.connectionType === 1) {
this.links = link
this.form.linkAddress = ''
this.article = article
} else if (data.connectionType === 3) {
this.otherLink = link
this.form.linkAddress = ''
this.otherArticle = article
}
}).catch(err => {})
}
}
}).catch(err => {})
@ -388,10 +419,6 @@ export default {
}else{
this.nameRepeat = false
}
},
//
typeChange(val) {
},
//
beforeUpload(file) {
@ -413,13 +440,12 @@ export default {
center: true
})
},
handleExceed(files, fileList) {
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
handleRemove(file, fileList) {
this.form.columnBanner = ''
},
uploadSuccess(res) {
let url = this.form.columnBanner
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {})
this.form.columnBanner = res.url
},
//
@ -435,14 +461,16 @@ export default {
if (!form.pageSize) return util.errorMsg('请填写分页条数')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
if (form.typeId === 2 && form.connectionType !== 2) {
const { links, otherLink } = this
const { links, article, otherLink, otherArticle } = this
if (form.connectionType === 1) {
if (!links.length) return util.errorMsg('请选择站内链接')
form.linkAddress = links.join()
if (!article) return util.errorMsg('请选择文章')
form.linkAddress = links.join() + ',' + article
}
if (form.connectionType === 3) {
if (!otherLink.length) return util.errorMsg('请选择栏目')
form.linkAddress = otherLink.join()
if (!otherArticle) return util.errorMsg('请选择文章')
form.linkAddress = otherLink.join() + ',' + otherArticle
}
}
this.submiting = true

@ -25,8 +25,8 @@
</div>
</div>
<el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column v-if="settings[0].show" type="selection" width="50" :reserve-selection="true"></el-table-column>
<el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center" @selection-change="handleSelectionChange" @select-all="selectAll" row-key="id">
<el-table-column v-if="settings[0].show" type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="columnName" label="名称" min-width="140"></el-table-column>
<el-table-column v-if="settings[1].show" prop="typeId" label="栏目类型" min-width="100">
<template slot-scope="scope">
@ -34,8 +34,16 @@
</template>
</el-table-column>
<el-table-column v-if="settings[2].show" prop="templateId" label="栏目模板" min-width="100"></el-table-column>
<el-table-column v-if="settings[3].show" prop="listStyleId" label="列表/长页样式" min-width="100"></el-table-column>
<el-table-column v-if="settings[4].show" prop="detailStyle" label="详情样式" min-width="100"></el-table-column>
<el-table-column v-if="settings[3].show" prop="listStyleId" label="列表/长页样式" min-width="100">
<template slot-scope="scope">
{{ listStyle.find(e => e.id == scope.row.listStyleId) && listStyle.find(e => e.id == scope.row.listStyleId).name }}
</template>
</el-table-column>
<el-table-column v-if="settings[4].show" prop="detailStyle" label="详情样式" min-width="100">
<template slot-scope="scope">
{{ detailStyle.find(e => e.id == scope.row.detailStyle) && detailStyle.find(e => e.id == scope.row.detailStyle).name }}
</template>
</el-table-column>
<el-table-column v-if="settings[5].show" prop="menuVisible" label="导航菜单" min-width="100">
<template slot-scope="scope">
<el-switch
@ -56,6 +64,39 @@
</el-table-column>
</el-table>
<el-dialog title="编辑栏目排序" :visible.sync="sortVisible" width="750px" :close-on-click-modal="false">
<div class="sort-wrap">
<ul class="thead">
<li style="width: 395px;padding-left: 30px">栏目</li>
<li style="width: 205px">栏目类型</li>
<li>前台可见</li>
</ul>
<el-tree
class="sort"
:data="sortColumns"
node-key="id"
default-expand-all
draggable>
<ul class="sort-line" slot-scope="{ node, data }">
<li>{{ data.columnName }}</li>
<li>{{ types.find(e => e.id == data.typeId) && types.find(e => e.id == data.typeId).name }}</li>
<li>
<el-switch
v-model="data.menuVisible"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, data)">
</el-switch>
</li>
</ul>
</el-tree>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="sortVisible = false"> </el-button>
<el-button type="primary" @click="sortSubmit"> </el-button>
</span>
</el-dialog>
<el-dialog title="导航样式设置" :visible.sync="styleVisible" width="850px" :close-on-click-modal="false">
<el-form class="input-form" label-width="100px">
<el-form-item label="导航样式">
@ -102,6 +143,8 @@ export default {
siteName: this.$store.state.content.site.siteName,
types: ColumnConst.types,
templates: ColumnConst.templates,
listStyle: ColumnConst.listStyle,
detailStyle: ColumnConst.detailStyle,
keyword: '',
searchTimer: null,
list: [],
@ -112,10 +155,6 @@ export default {
{
id: 1,
name: '目录树结构'
},
{
id: 2,
name: '分类结构'
}
],
form: {
@ -155,7 +194,10 @@ export default {
name: '操作',
show: true
}
]
],
sortVisible: false,
sortColumns: [],
sortLevel: 1
};
},
watch: {
@ -245,6 +287,17 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val
},
//
selectAll() {
this.checkedKeys = !this.checkedKeys
this.select(this.list, this.checkedKeys)
},
select(data, flag) {
data.map(row => {
this.$refs.table.toggleRowSelection(row, flag)
if (row.children != undefined) this.select(row.children, this.checkedKeys)
})
},
handleCurrentChange(val) {
this.page = val
this.$router.push(`list?page=${val}`)
@ -252,7 +305,35 @@ export default {
},
//
sort() {
// this.sortColumns = JSON.parse(JSON.stringify(this.list))
this.sortVisible = true
},
//
sortList(list, result, parent = {}) {
list.map((e, i) => {
result.push({
id: e.id,
fatherId: parent.id || 0,
level: this.sortLevel,
sort: i + 1,
})
if (e.children.length) {
++this.sortLevel
this.sortList(e.children, result, e)
} else {
this.sortLevel = 1
}
})
},
//
sortSubmit() {
// const result = []
// this.sortList(this.sortColumns, result)
// this.$post(this.api.sortByColumn, result).then(({ data }) => {
// util.successMsg('')
// this.sortVisible = false
// this.getData()
// }).catch(err => {})
},
//
styleSet() {
@ -267,6 +348,50 @@ export default {
</script>
<style lang="scss" scoped>
.sort-wrap {
max-height: 400px;
overflow: auto;
}
.thead {
display: flex;
line-height: 44px;
background-color: #F7F7F7;
li {
padding: 0 10px;
font-size: 12px;
font-weight: 500;
font-family: PingFangSC-Medium, PingFang SC;
color: #323232;
}
}
/deep/.sort {
.el-tree-node__content {
height: auto;
border-bottom: 1px solid #EBEDF0;
}
.el-tree-node__expand-icon {
display: none;
}
}
.sort-line {
display: flex;
width: 100%;
li {
padding: 12px 0;
&:first-child {
width: 230px;
padding-left: 30px;
}
&:nth-child(2) {
position: absolute;
left: 400px;
}
&:last-child {
position: absolute;
right: 50px;
}
}
}
.styles {
display: inline-flex;
li {

@ -65,7 +65,6 @@ export default {
<style lang="scss" scoped>
.main{
display: flex;
width: $min-width;
padding: 12px 0 0;
margin: 0 auto;
.left{

@ -1,5 +1,5 @@
<template>
<div v-loading="loading">
<div class="relative" v-loading="loading">
<div class="page">
<div class="page-content">
<ul class="list">
@ -50,7 +50,7 @@
</ul>
</div>
</div>
<div class="btns">
<div class="btn-wrap">
<el-button size="small" v-throttle @click="$router.back()">取消</el-button>
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button>
</div>
@ -425,6 +425,9 @@ export default {
</script>
<style lang="scss" scoped>
.page {
height: calc(100% - 66px);
}
.list{
.line {
display: flex;
@ -464,7 +467,9 @@ export default {
}
}
}
.btns {
.btn-wrap {
position: absolute;
bottom: 0;
width: 100%;
padding: 12px 0;
text-align: center;

@ -34,6 +34,7 @@
<script>
import { mapState, mapMutations } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
@ -75,13 +76,9 @@ export default {
limit: this.pageSize,
siteName: this.keyword
}).then(({ data }) => {
const { btns } = this
const result = []
data.records.map(e => {
btns.find(n => n.includes(e.siteName)) && result.push(e)
})
this.list = result
this.total = result.length
const list = util.getSite(data.records)
this.list = list
this.total = list.length
}).catch(e => {})
},
initData() {

@ -105,7 +105,7 @@
<el-table-column v-if="settings[4].show" prop="phone" label="手机号" min-width="100" show-overflow-tooltip></el-table-column>
<el-table-column v-if="settings[5].show" prop="deptArchitectureName" label="所在部门" min-width="100"></el-table-column>
<el-table-column v-if="settings[6].show" prop="createTime" label="创建日期" min-width="140"></el-table-column>
<el-table-column v-if="settings[7].show" prop="roleName" label="授权角色" min-width="100"></el-table-column>
<el-table-column v-if="settings[7].show" prop="roleName" label="授权角色" show-overflow-tooltip min-width="100"></el-table-column>
<el-table-column v-if="settings[8].show" prop="groupName" label="用户组" min-width="100"></el-table-column>
<el-table-column v-if="settings[9].show" prop="lastLoginTime" label="最后登录时间" min-width="140"></el-table-column>
<el-table-column v-if="settings[10].show" label="操作" width="180">
@ -757,7 +757,7 @@ export default {
},
//
download() {
util.downloadFile('用户导入模板.xlsx', this.api.staffTemplate)
location.href = this.api.staffTemplate
},
//
handleExceed(files, fileList) {

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

@ -20,7 +20,7 @@
background: #d7d7d7;
}
.el-tooltip__popper.is-dark, .el-menu--vertical[x-placement="right-start"] {
display: none !important;
// display: none !important;
}
.flex-between {
display: flex;

Loading…
Cancel
Save