master
yujialong 2 years ago
parent 8dd8cdde96
commit 7394964cb5
  1. 5
      src/api/index.js
  2. BIN
      src/assets/img/article1.png
  3. BIN
      src/assets/img/article2.png
  4. BIN
      src/assets/img/article3.png
  5. BIN
      src/assets/img/list1.png
  6. BIN
      src/assets/img/list2.png
  7. BIN
      src/assets/img/plus.png
  8. BIN
      src/assets/img/style1.png
  9. BIN
      src/assets/img/style2.png
  10. 51
      src/layouts/navbar/index.vue
  11. 137
      src/pages/annex/list/index.vue
  12. 626
      src/pages/article/add/index.vue
  13. 313
      src/pages/article/list/index.vue
  14. 654
      src/pages/column/add/index.vue
  15. 321
      src/pages/column/list/index.vue
  16. 142
      src/pages/page/list/index.vue
  17. 109
      src/pages/site/list/index.vue
  18. 2
      src/plugins/requests/index.js
  19. 23
      src/router/modules/annex.js
  20. 17
      src/store/modules/content.js
  21. 40
      src/store/modules/user.js
  22. 128
      src/styles/common.scss

@ -1,11 +1,13 @@
import Setting from "@/setting"; import Setting from "@/setting";
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL;
const host1 = 'http://192.168.31.151:10000/' const host1 = 'http://192.168.31.151:10000/'
export default { export default {
logins: `iasf/sys/user/login`, logins: `iasf/sys/user/login`,
verification: `${host}iasf/sys/getVerify`, verification: `${host}iasf/sys/getVerify`,
upload: `${host}iasf/sysFiles/upload`,
listByPage: `${host}iasf/sysFiles/listByPage`,
delFile: `${host}iasf/sysFiles/delete`,
dept: `iasf/sys/dept`, dept: `iasf/sys/dept`,
deptTree: `iasf/sys/dept/tree`, deptTree: `iasf/sys/dept/tree`,
deptId: `iasf/sys/dept`, deptId: `iasf/sys/dept`,
@ -22,4 +24,5 @@ export default {
queryArticle: `${host1}iasf/sysContent/pagingQuery`, queryArticle: `${host1}iasf/sysContent/pagingQuery`,
saveArticle: `${host1}iasf/sysContent/save`, saveArticle: `${host1}iasf/sysContent/save`,
updateArticle: `${host1}iasf/sysContent/update`, updateArticle: `${host1}iasf/sysContent/update`,
longPageColumnList: `${host1}iasf/pageManagement/longPageColumnList`,
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

@ -95,7 +95,7 @@ export default {
return { return {
collapse: false, collapse: false,
active: this.$route.path, active: this.$route.path,
siteActive: '/page/list', siteActive: '/page',
reloadSite: true, reloadSite: true,
menus: [ menus: [
{ {
@ -149,25 +149,22 @@ export default {
title: '内容管理', title: '内容管理',
subs: [ subs: [
{ {
index: '/page/list', index: '/page',
title: '页面管理' title: '页面管理'
}, },
{ {
index: '/column/list', index: '/column',
title: '栏目管理' title: '栏目管理'
}, },
{ {
index: '/article/list', index: '/article',
title: '文章管理' title: '文章管理'
} }
] ]
} }
], ],
actives: { actives: {
dashboard: ["add"], dashboard: ["add"],
achievement: ["experiment", "experimentVir", "experimentTeach", "addexperiment", "addexperimentoptions", "showExperiment", "showExperimentoption", "showExperimentoptions"],
project: ["addproject", "program", "programOption", "programOptions"],
backstage: ["report"]
} }
}; };
}, },
@ -177,21 +174,23 @@ export default {
]) ])
}, },
watch: { watch: {
"$route"(to, from) { "$route"(to, from) {
let actives = this.actives; let actives = this.actives;
for (let i in this.actives) { for (let i in this.actives) {
if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`; if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`;
}
let arr=this.$route.path.split("/");
let name = `/${arr[1]}/list`
this.active = name
const { path } = this.$route
console.log("🚀 ~ file: index.vue ~ line 167 ~ path", this.sites[0].subs.find(e => e.index === path))
this.collapse = !!this.sites[0].subs.find(e => e.index === path)
} }
let arr=this.$route.path.split("/");
let name = `/${arr[1]}/list`
this.active = name
const { path } = this.$route
this.collapse = !!this.sites[0].subs.find(e => path.includes(e.index))
}
}, },
created() { created() {
this.collapse = !!this.sites[0].subs.find(e => e.index === this.$route.path) const { path } = this.$route
console.log("🚀 ~ file: index.vue ~ line 191 ~ created ~ path", path)
this.collapse = !!this.sites[0].subs.find(e => path.includes(e.index))
if (this.collapse) this.siteActive = '/' + path.split('/')[1]
// this.getPer() // this.getPer()
}, },
methods: { methods: {
@ -200,21 +199,9 @@ export default {
]), ]),
// //
menuSelect(index) { menuSelect(index) {
console.log("🚀 ~ file: index.vue ~ line 180 ~ menuSelect ~ index", index)
this.collapse = false this.collapse = false
if (index.includes('/')) { if (index.includes('/')) {
this.$router.push(index) this.$router.push(index)
// if (this.collapse) {
// this.reloadSite = false
// this.siteActive = '/page/list'
// this.$nextTick(() => {
// this.reloadSite = true
// })
// this.$router.push('/page')
// }
} else {
} }
}, },
// //

@ -0,0 +1,137 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input>
<el-button type="primary" @click="initData">查询</el-button>
</div>
<div class="actions">
<el-button @click="batchDel">删除</el-button>
</div>
</div>
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="ID"></el-table-column>
<el-table-column prop="site" label="站点名称" min-width="180"></el-table-column>
<el-table-column prop="type" label="文件类型" min-width="100"></el-table-column>
<el-table-column prop="format" label="格式" min-width="100"></el-table-column>
<el-table-column prop="fileSize" label="大小" min-width="100">
<template slot-scope="scope">
{{ scope.row.fileSize }}kb
</template>
</el-table-column>
<el-table-column prop="createDate" label="上传时间" min-width="150"></el-table-column>
<el-table-column prop="uploader" label="上传人" min-width="100"></el-table-column>
<el-table-column prop="quote" label="文章名称" min-width="180"></el-table-column>
<el-table-column prop="deleted" label="是否使用" min-width="100">
<template slot-scope="scope">
{{ scope.row.deleted ? '否' : '是' }}
</template>
</el-table-column>
<el-table-column label="操作" width="170">
<template slot-scope="scope">
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-button type="text" @click="edit(scope.row, 'edit')">下级</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
export default {
data() {
return {
keyword: '',
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
list: [],
multipleSelection: [],
};
},
mounted() {
this.getData()
},
methods: {
getData() {
this.$post(this.api.listByPage, {
page: this.page,
limit: this.pageSize,
}).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
add() {
this.$router.push('add')
},
edit(row, type) {
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`)
},
del(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$del(`${this.api.delFile}`, [row.id]).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$del(`${this.api.delFile}`, list.map(e => e.id)).then(res => {
this.$refs.table.clearSelection()
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
handleSelectionChange(val) {
this.multipleSelection = val
},
handleCurrentChange(val) {
this.page = val
this.$router.push(`list?page=${val}`)
this.getData()
},
}
};
</script>
<style lang="scss" scoped>
.styles {
display: inline-flex;
li {
margin-right: 20px;
text-align: center;
&:hover .review {
border-color: #2962FF;
}
}
.review {
padding: 18px;
margin-bottom: 10px;
border: 1px solid #DCDEE0;
border-radius: 2px;
}
}
</style>

@ -1,256 +1,231 @@
<template> <template>
<div> <div class="page">
<el-form> <p class="page-name mb">新增栏目</p>
<el-card shadow="hover" class="m-b-20"> <el-form class="input-form model" label-width="100px">
<div class="flex-between"> <el-form-item prop="title" label="标题">
<el-page-header @back="goBack" :content="(isEdit ? '更新' : '创建') + '文章'"></el-page-header> <el-input
<div> placeholder="请输入标题"
<el-button type="primary" @click="submit(1)">发布</el-button> v-model.trim="form.title"
<el-button v-if="!form.id" type="primary" @click="submit(0)">保存为草稿</el-button> clearable
</div> maxlength="15"
</div> class="inline-input"
</el-card> @change="nameChange"
></el-input>
<el-card shadow="hover" class="mgr20 m-b-20"> </el-form-item>
<div> <div class="item-line">
<p class="m-b-20">标题</p> <el-form-item prop="columnId" label="所属栏目">
<el-input <el-cascader
placeholder="请输入标题" ref="column"
v-model.trim="form.title" v-model="form.columnId"
clearable :options="columns"
maxlength="15" :props="columnProps"
class="inline-input" clearable></el-cascader>
@change="nameChange" </el-form-item>
></el-input> <el-form-item prop="releaseTime" label="发布日期">
</div> <el-date-picker
</el-card> v-model="form.releaseTime"
<el-card shadow="hover" class="mgr20 m-b-20"> type="date"
<div> placeholder="选择日期"
<p class="m-b-20">所属栏目</p> format="yyyy-MM-dd"
<el-cascader value-format="yyyy-MM-dd">
ref="column" </el-date-picker>
v-model="form.columnId" </el-form-item>
:options="columns" </div>
:props="columnProps" <div class="item-line">
clearable></el-cascader> <el-form-item prop="source" label="来源">
</div> <el-input
</el-card> placeholder="请输入来源"
<el-card shadow="hover" class="mgr20 m-b-20"> v-model.trim="form.source"
<div> clearable
<p class="m-b-20">发布日期</p> maxlength="15"
<div class="inline-input"> class="inline-input"
<el-date-picker @change="nameChange"
v-model="form.releaseTime" ></el-input>
type="date" </el-form-item>
placeholder="选择日期" <el-form-item prop="author" label="作者">
format="yyyy-MM-dd" <el-input
value-format="yyyy-MM-dd"> placeholder="请输入作者"
</el-date-picker> v-model.trim="form.author"
</div> clearable
</div> maxlength="15"
</el-card> class="inline-input"
<el-card shadow="hover" class="mgr20 m-b-20"> @change="nameChange"
<div> ></el-input>
<p class="m-b-20">来源</p> </el-form-item>
<el-input </div>
placeholder="请输入来源" <el-form-item prop="summary" label="摘要">
v-model.trim="form.source" <el-input
clearable type="textarea"
maxlength="15" v-model.trim="form.summary"
class="inline-input" clearable
@change="nameChange" ></el-input>
></el-input> </el-form-item>
</div> <div class="item-line">
</el-card> <el-form-item prop="titleImg" label="标题图">
<el-card shadow="hover" class="mgr20 m-b-20"> <el-upload
<div> class="avatar-uploader"
<p class="m-b-20">作者</p> accept=".jpg,.png,.jpeg,.gif"
<el-input :before-upload="beforeUpload"
placeholder="请输入作者" :on-remove="handleRemove"
v-model.trim="form.author" :on-error="uploadError"
clearable :on-success="uploadSuccess"
maxlength="15" :limit="1"
class="inline-input" :on-exceed="handleExceed"
@change="nameChange" :show-file-list="false"
></el-input> :action="this.api.upload"
</div> :data="{
</el-card> quote: form.title,
<el-card shadow="hover" class="mgr20 m-b-20"> site: '粒子研究院中文站点',
<div> uploader: userName
<p class="m-b-20">标题图</p> }"
<el-upload >
class="avatar-uploader" <img v-if="form.titleImg" :src="form.titleImg" class="avatar">
accept=".jpg,.png,.jpeg,.gif" <div class="uploader-default" v-else>
:on-remove="handleRemove" <img class="plus" src="@/assets/img/plus.png" alt="">
:on-error="uploadError" <p>点击上传</p>
:on-success="uploadSuccess" </div>
:before-remove="beforeRemove" </el-upload>
:limit="1" </el-form-item>
:on-exceed="handleExceed" <el-form-item prop="bannerImg" label="banner图" style="flex: 1;">
:action="this.api.fileupload" <el-upload
:headers="headers" class="avatar-uploader avatar-uploader-lg"
name="file" accept=".jpg,.png,.jpeg,.gif"
> :before-upload="beforeUpload"
<img v-if="form.titleImg" :src="form.titleImg" class="avatar"> :on-remove="handleRemove"
<div class="uploader-default" v-else> :on-error="uploadError"
<i class="el-icon-plus"></i> :on-success="uploadSuccessBanner"
<p>上传banner</p> :limit="1"
</div> :on-exceed="handleExceed"
<div slot="tip" class="el-upload__tip"> :show-file-list="false"
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p> :action="this.api.upload"
</div> :data="{
</el-upload> quote: form.title,
</div> site: '粒子研究院中文站点',
</el-card> uploader: userName
<el-card shadow="hover" class="mgr20 m-b-20"> }"
<div> >
<p class="m-b-20">banner图</p> <img v-if="form.bannerImg" :src="form.bannerImg" class="avatar">
<el-upload <div class="uploader-default" v-else>
class="avatar-uploader avatar-uploader-lg" <img class="plus" src="@/assets/img/plus.png" alt="">
accept=".jpg,.png,.jpeg,.gif" <p>点击上传</p>
:on-remove="handleRemove" </div>
:on-error="uploadError" </el-upload>
:on-success="uploadSuccessBanner" </el-form-item>
:before-remove="beforeRemove" </div>
:limit="1" <el-form-item prop="articleTemplate" label="独立文章模板">
:on-exceed="handleExceed" <ul class="styles">
:action="this.api.fileupload" <li>
:headers="headers" <div class="review">
name="file" <img src="@/assets/img/article2.png" alt="">
> </div>
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar"> <el-radio v-model="form.articleTemplate" :label="1">视频详情</el-radio>
<div class="uploader-default" v-else> </li>
<i class="el-icon-plus"></i> <li>
<p>上传banner</p> <div class="review">
</div> <img src="@/assets/img/article1.png" alt="">
<div slot="tip" class="el-upload__tip"> </div>
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p> <el-radio v-model="form.articleTemplate" :label="2">富文本</el-radio>
</div> </li>
</el-upload> <li>
</div> <div class="review">
</el-card> <img src="@/assets/img/article3.png" alt="">
<el-card shadow="hover" class="mgr20 m-b-20"> </div>
<div> <el-radio v-model="form.articleTemplate" :label="3">链接</el-radio>
<p class="m-b-20">独立文章模板</p> </li>
<div class="style-wrap"> </ul>
<ul class="styles"> </el-form-item>
<li> <template v-if="form.articleTemplate === 1 || form.articleTemplate === 2">
<el-radio v-model="form.articleTemplate" :label="1">视频详情</el-radio> <el-form-item prop="mainBody" label="正文">
</li> <quill :border="true" v-model="form.mainBody" :height="150" />
<li> </el-form-item>
<el-radio v-model="form.articleTemplate" :label="2">富文本</el-radio> <el-form-item prop="mainBody" label="文件上传">
</li> <el-upload
<li> class="avatar-uploader avatar-uploader-lg"
<el-radio v-model="form.articleTemplate" :label="3">链接</el-radio> accept=".jpg,.png,.jpeg,.gif"
</li> :on-remove="handleRemove"
</ul> :on-error="uploadError"
</div> :on-success="uploadSuccessFile"
</div> :limit="1"
</el-card> :on-exceed="handleExceed"
<template v-if="form.articleTemplate === 1 || form.articleTemplate === 2"> :show-file-list="false"
<el-card shadow="hover" class="mgr20 m-b-20"> :action="this.api.upload"
<div> :data="{
<p class="m-b-20">正文</p> quote: form.columnName,
<quill :border="true" v-model="form.mainBody" :height="400" /> site: '粒子研究院中文站点',
</div> uploader: userName
</el-card> }"
<el-card shadow="hover" class="mgr20 m-b-20"> >
<div> <el-button type="primary">上传</el-button>
<p class="m-b-20">文件上传</p> </el-upload>
<el-upload </el-form-item>
:on-remove="handleRemove" </template>
:on-error="uploadError" <template v-if="form.articleTemplate === 3">
:on-success="uploadSuccessFile" <el-form-item prop="connectionType" label="连接类型">
:before-remove="beforeRemove" <el-radio-group v-model="form.connectionType">
:limit="1" <el-radio :label="1">站内链接</el-radio>
:on-exceed="handleExceed" <el-radio :label="2">站外链接</el-radio>
:action="this.api.fileupload" <el-radio :label="3">其他站点链接</el-radio>
:headers="headers" </el-radio-group>
name="file" </el-form-item>
> <el-form-item v-show="form.connectionType === 1" prop="connectionType" label="站内链接">
<el-button type="primary">上传</el-button> <el-cascader
</el-upload> v-model="links"
</div> :options="columns"
</el-card> :props="columnProps"
</template> clearable></el-cascader>
<template v-if="form.articleTemplate === 3"> </el-form-item>
<el-card shadow="hover" class="mgr20 m-b-20"> <el-form-item v-show="form.connectionType === 2" prop="connectionType" label="站内链接">
<div> <el-input
<p class="m-b-20">连接类型</p> placeholder="请输入站外链接"
<el-radio-group v-model="form.connectionType"> v-model.trim="form.linkAddress"
<el-radio :label="1">站内链接</el-radio> clearable
<el-radio :label="2">站外链接</el-radio> ></el-input>
<el-radio :label="3">其他站点链接</el-radio> </el-form-item>
</el-radio-group> <template v-if="form.connectionType === 3">
</div> <el-form-item prop="siteSelection" label="站点选择">
</el-card> <el-select v-model="form.siteSelection">
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20"> <el-option
<div> v-for="item in sites"
<p class="m-b-20">站内链接</p> :key="item.id"
<el-cascader :label="item.name"
v-model="links" :value="item.id">
:options="columns" </el-option>
:props="columnProps" </el-select>
clearable></el-cascader> </el-form-item>
</div> <el-form-item label="栏目">
</el-card> <el-cascader
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20"> v-model="links"
<div> :options="columns"
<p class="m-b-20">站外链接</p> :props="columnProps"
<el-input clearable></el-cascader>
placeholder="请输入站外链接" </el-form-item>
v-model.trim="form.linkAddress" </template>
clearable </template>
></el-input> <el-form-item v-show="form.typeId === 4" prop="showWithDetails" label="栏目">
</div> <el-switch
</el-card> v-model="form.showWithDetails"
<template v-if="form.connectionType === 3"> :active-value="1"
<el-card shadow="hover" class="mgr20 m-b-20"> :inactive-value="0">
<div> </el-switch>
<p class="m-b-20">站点选择</p> </el-form-item>
<el-select v-model="form.siteSelection"> </el-form>
<el-option <div class="btns">
v-for="item in sites" <el-button type="primary" @click="submit(1)">发布</el-button>
:key="item.id" <el-button @click="preview">预览</el-button>
:label="item.name" <el-button v-if="!isEdit" @click="submit(0)">保存草稿</el-button>
:value="item.id"> <el-button @click="$router.back()">取消</el-button>
</el-option>
</el-select>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目</p>
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
</template>
</template>
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">在新窗口打开</p>
<el-switch
v-model="form.showWithDetails"
:active-value="1"
:inactive-value="0">
</el-switch>
</div>
</el-card>
</el-form>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from '@/libs/util'
import ColumnConst from '@/const/column' import ColumnConst from '@/const/column'
import quill from '@/components/quill' import quill from '@/components/quill'
import { mapState, mapActions } from "vuex"; import { mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
siteId: this.$store.state.content.siteId,
isEdit: this.$route.query.type === 'edit', isEdit: this.$route.query.type === 'edit',
headers: {}, headers: {},
nameRepeat: false, nameRepeat: false,
@ -265,6 +240,7 @@ export default {
}, },
links: [], links: [],
form: { form: {
siteId: this.$store.state.content.siteId,
id: this.$route.query.id || '', id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId, founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId, editorId: +this.$store.state.user.userId,
@ -288,6 +264,11 @@ export default {
updateTime: 0 updateTime: 0
}; };
}, },
computed: {
...mapState('user', [
'userName'
])
},
components: { components: {
quill quill
}, },
@ -308,6 +289,7 @@ export default {
// //
getList() { getList() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.siteId,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
@ -332,6 +314,7 @@ export default {
const { title, level, id } = this.form const { title, level, id } = this.form
if(title && title !== this.originalName){ if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, { this.$post(this.api.checkIfTheTitleIsRepeat, {
siteId: this.siteId,
title, title,
id: id || '' id: id || ''
}).then(res => { }).then(res => {
@ -346,6 +329,19 @@ export default {
// //
typeChange(val) { typeChange(val) {
},
//
beforeUpload(file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
if (size / 1024 / 1024 > 1) {
this.$message.error('请上传1M以内的图片!')
return false
}
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -364,13 +360,17 @@ export default {
this.form.columnBanner = '' this.form.columnBanner = ''
}, },
uploadSuccess(res) { uploadSuccess(res) {
this.form.columnBanner = res.data.filesResult.fileUrl this.form.columnBanner = res.data.url
}, },
uploadSuccessBanner(res) { uploadSuccessBanner(res) {
this.form.bannerImg = res.data.filesResult.fileUrl this.form.bannerImg = res.data.url
}, },
uploadSuccessFile(res) { uploadSuccessFile(res) {
this.form.file = res.data.filesResult.fileUrl this.form.file = res.data.url
},
//
preview() {
}, },
// //
submit(isRelease) { submit(isRelease) {
@ -432,86 +432,62 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.inline-input {
width: 500px;
}
$upload-width: 220px; $upload-width: 220px;
$upload-height: 140px; $upload-height: 102px;
$upload-lg-height: 150px; $upload-lg-height: 102px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $upload-width; width: $upload-width;
height: $upload-height; height: $upload-height;
border: 1px dashed #d9d9d9; border: 1px solid #DCDEE0;
border-radius: 6px; border-radius: 2px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
.uploader-default {
&:hover { display: flex;
border-color: #cb221c; height: $upload-height;
} flex-direction: column;
justify-content: center;
.uploader-default { align-items: center;
display: flex; text-align: center;
height: $upload-height; background: #FAFAFA;
flex-direction: column; p {
justify-content: center; margin-top: 10px;
text-align: center; font-size: 14px;
background: rgba(0, 0, 0, 0.04); color: #333;
line-height: 20px;
i { }
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
} }
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.avatar-lg { .uploader-default {
display: block;
width: 100%;
height: $upload-lg-height; height: $upload-lg-height;
}
} }
}
.el-upload__tip { .avatar {
margin-top: 0; display: block;
width: $upload-width;
p { height: $upload-height;
font-size: 14px; }
color: rgba(0, 0, 0, 0.45); .avatar-lg {
line-height: 1; display: block;
width: 100%;
&:first-child { height: $upload-lg-height;
margin-bottom: 5px; }
} .el-upload__tip {
} margin-top: 0;
p {
font-size: 12px;
color: #333;
} }
}
} }
.style-wrap { .style-wrap {
display: flex; display: flex;
@ -524,6 +500,16 @@ $upload-lg-height: 150px;
display: inline-flex; display: inline-flex;
li { li {
margin-right: 20px; margin-right: 20px;
text-align: center;
&:hover .review {
border-color: #2962FF;
}
}
.review {
padding: 18px;
margin-bottom: 10px;
border: 1px solid #DCDEE0;
border-radius: 2px;
} }
} }
</style> </style>

@ -1,192 +1,161 @@
<template> <template>
<div class="flex"> <div class="flex page">
<div class="page" style="width: 320px"> <div style="width: 218px">
<div> <p class="page-name mb">全部栏目</p>
<div class="flex-between m-b-20"> <div style="height: 504px;overflow: auto">
<h6 class="p-title" style="margin-bottom: 0">栏目</h6> <el-tree ref="column" :data="columns" :props="defaultProps" node-key="id" @node-click="columnClick"></el-tree>
</div>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree ref="column" :data="columns" :props="defaultProps" node-key="id" @node-click="columnClick"></el-tree>
</div>
</div>
</div> </div>
<div class="page flex-1 m-l-20"> </div>
<h6 class="p-title">筛选</h6> <div class="flex-1">
<div class="tool"> <div class="tool">
<ul class="filter"> <div class="search-wrap">
<li> <el-input placeholder="请输入文章标题" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input>
<el-input style="width: 250px;" placeholder="请输入文章标题" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-button type="primary" @click="initData">查询</el-button>
</li>
</ul>
<div>
<el-button type="info" v-auth @click="add">新增</el-button>
<el-button type="primary" v-auth @click="delAllSelection">批量删除</el-button>
</div>
</div> </div>
<div class="actions">
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-button type="primary" @click="add" >新增</el-button>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-button @click="batchDel">删除</el-button>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="title" label="标题" align="center" min-width="100"></el-table-column>
<el-table-column prop="columnName" label="栏目" align="center" min-width="100"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-auth type="text" @click="resetPassword(scope.row)">预览</el-button>
<el-button v-auth type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div> </div>
</div> </div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="title" label="标题" align="center" min-width="100"></el-table-column>
<el-table-column prop="columnName" label="栏目" align="center" min-width="100"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-auth type="text" @click="resetPassword(scope.row)">预览</el-button>
<el-button v-auth type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from '@/libs/util'
import Setting from "@/setting";
import { mapState } from "vuex";
export default { export default {
data() { data() {
return { return {
columns: [], columns: [],
defaultProps: { defaultProps: {
value: 'id', value: 'id',
label: 'columnName' label: 'columnName'
}, },
keyword: "", keyword: '',
originForm: {}, list: [],
form: { page: 1,
userName: "", pageSize: 10,
phone: "", total: 0,
uniqueIdentification: "", multipleSelection: [],
workNumber: "", };
email: "",
account: "",
classId: ""
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
};
}, },
mounted() { mounted() {
this.getColumn() this.getColumn()
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
if (this.studentType) {
this.initData();
} else {
this.getOrgStudentData();
}
}, 500);
},
},
methods: { methods: {
// //
getColumn() { getColumn() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
columnName: '', siteId: this.$store.state.content.siteId,
templateId: '', columnName: '',
typeId : '', templateId: '',
}).then(({ data }) => { typeId : '',
this.columns = data }).then(({ data }) => {
this.$nextTick(() => { this.columns = data
this.$refs.column.setCurrentKey(data[0].id) this.$nextTick(() => {
this.getData() this.$refs.column.setCurrentKey(data[0].id)
})
}).catch(e => {})
},
//
columnClick(data, node) {
this.getData()
},
//
getData() {
this.$post(this.api.queryArticle, {
columnIds: [this.$refs.column.getCurrentKey()],
pageNum: this.page,
pageSize: this.pageSize,
title: this.keyword
}).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
},
currentChange(val) { //
this.page = val;
this.getData() this.getData()
}, })
handleSelectionChange(val) { // }).catch(e => {})
this.multipleSelection = val; },
}, //
initData() { columnClick(data, node) {
this.$refs.table.clearSelection(); this.getData()
this.page = 1; },
this.getData(); //
}, getData() {
delAllSelection() { // this.$post(this.api.queryArticle, {
if (this.multipleSelection.length) { siteId: this.$store.state.content.siteId,
this.$confirm("确定要删除选中用户吗?", "提示", { columnIds: [this.$refs.column.getCurrentKey()],
type: "warning" pageNum: this.page,
}).then(() => { pageSize: this.pageSize,
let ids = this.multipleSelection.map(item => { title: this.keyword
return item.accountId; }).then(({ data }) => {
}); this.list = data.records
this.$post(`${this.api.delStudent}?accountIds=${ids.toString()}`).then(res => { this.total = +data.total
this.multipleSelection = []; }).catch(err => {})
this.$refs.table.clearSelection(); },
util.successMsg("删除成功"); currentChange(val) {
if (this.studentType) { this.page = val
this.getData(); this.getData()
} else { },
this.getOrgStudentData(); handleSelectionChange(val) {
} this.multipleSelection = val
}).catch(res => { },
}); initData() {
if(this.multipleSelection.length === this.list.length && this.page>1) { this.$refs.table.clearSelection()
this.handleCurrentChange(this.page - 1) this.page = 1
} this.getData()
}).catch(() => { },
}); batchDel() { //
} else { if (this.multipleSelection.length) {
util.errorMsg("请先选择数据 !"); this.$confirm("确定要删除选中用户吗?", "提示", {
} type: "warning"
}, }).then(() => {
handleDelete(row) { // let ids = this.multipleSelection.map(item => {
this.$confirm("确定要删除吗?", "提示", { return item.accountId;
type: "warning" });
}).then(() => { this.$post(`${this.api.delStudent}?accountIds=${ids.toString()}`).then(res => {
this.$post(`${this.api.deleteArticle}?id=${row.id}`).then(res => { this.multipleSelection = [];
util.successMsg("删除成功"); this.$refs.table.clearSelection();
this.getData() util.successMsg("删除成功");
}).catch(res => {}) if (this.studentType) {
}).catch(() => { this.getData();
}); } else {
}, this.getOrgStudentData();
// }
add() { }).catch(res => {
this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}`) });
}, if(this.multipleSelection.length === this.list.length && this.page>1) {
// this.handleCurrentChange(this.page - 1)
edit(row) { }
this.$router.push(`add?id=${row.id}`) }).catch(() => {
}, });
} else {
util.errorMsg("请先选择数据 !");
}
},
//
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteArticle}?id=${row.id}`).then(res => {
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
add() {
this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}`)
},
//
edit(row) {
this.$router.push(`add?id=${row.id}`)
},
} }
}; };
</script> </script>

@ -1,252 +1,239 @@
<template> <template>
<div> <div class="page">
<el-form> <p class="page-name mb">新增栏目</p>
<el-card shadow="hover" class="m-b-20"> <el-form class="input-form model" label-width="100px">
<div class="flex-between"> <div class="item-line">
<el-page-header @back="goBack" :content="(isEdit ? '更新' : '创建') + '栏目'"></el-page-header> <el-form-item prop="columnName" label="栏目名称">
<div> <el-input
<el-button type="primary" @click="submit">{{ form.id ? "更新" : "创建" }}</el-button> placeholder="请输入栏目名称"
</div> v-model.trim="form.columnName"
</div> clearable
</el-card> maxlength="15"
@change="nameChange"
<el-card shadow="hover" class="mgr20 m-b-20"> ></el-input>
<div> </el-form-item>
<p class="m-b-20">栏目名称</p> <el-form-item prop="fatherId" label="设置上级">
<el-input <el-cascader
placeholder="请输入栏目名称" v-model="form.fatherId"
v-model.trim="form.columnName" :options="columns"
clearable :props="columnProps"
maxlength="15" clearable></el-cascader>
class="inline-input" </el-form-item>
@change="nameChange" </div>
></el-input> <div class="item-line">
</div> <el-form-item prop="typeId" label="栏目类型">
</el-card> <el-select v-model="form.typeId" @change="typeChange">
<el-card shadow="hover" class="mgr20 m-b-20"> <el-option
<div> v-for="item in types"
<p class="m-b-20">设置上级</p> :key="item.id"
<el-cascader :label="item.name"
v-model="form.fatherId" :value="item.id">
:options="columns" </el-option>
:props="columnProps" </el-select>
clearable></el-cascader> </el-form-item>
</div> <el-form-item prop="pageSize" label="分页条数">
</el-card> <el-input-number v-model="form.pageSize" :min="0" class="auto"></el-input-number>
<el-card shadow="hover" class="mgr20 m-b-20"> </el-form-item>
<div> <el-form-item prop="menuVisible" label="导航菜单可见">
<p class="m-b-20">栏目类型</p> <el-switch
<div class="inline-input"> v-model="form.menuVisible"
<el-select v-model="form.typeId" @change="typeChange"> :active-value="0"
<el-option :inactive-value="1">
v-for="item in types" </el-switch>
:key="item.id" </el-form-item>
:label="item.name" </div>
:value="item.id"> <div class="line"></div>
</el-option> <template v-if="form.typeId === 1 || form.typeId === 4">
</el-select> <el-form-item prop="columnBanner" label="栏目banner">
</div> <el-upload
</div> class="avatar-uploader avatar-uploader-lg"
</el-card> accept=".jpg,.png,.jpeg,.gif"
<el-card shadow="hover" class="mgr20 m-b-20"> :before-upload="beforeUpload"
<div> :on-remove="handleRemove"
<p class="m-b-20">分页条数</p> :on-error="uploadError"
<el-input :on-success="uploadSuccess"
placeholder="请输入分页条数" :limit="1"
v-model.trim="form.pageSize" :on-exceed="handleExceed"
maxlength="15" :show-file-list="false"
type="number" :action="this.api.upload"
style="width: 150px" :data="{
></el-input> quote: form.columnName,
</div> site: '粒子研究院中文站点',
</el-card> uploader: userName
<el-card shadow="hover" class="mgr20 m-b-20"> }"
<div> >
<p class="m-b-20">导航菜单可见</p> <img v-if="form.columnBanner" :src="form.columnBanner" class="avatar">
<el-switch <div class="uploader-default" v-else>
v-model="form.menuVisible" <img class="plus" src="@/assets/img/plus.png" alt="">
:active-value="0" <p>点击上传</p>
:inactive-value="1"> </div>
</el-switch> <div slot="tip" class="el-upload__tip">
</div> <p>请上传1920x500PX1M以内的jpgbmppng格式</p>
</el-card> </div>
<template v-if="form.typeId === 1 || form.typeId === 4"> </el-upload>
<el-card shadow="hover" class="mgr20 m-b-20"> </el-form-item>
<div> <el-form-item prop="templateId" label="栏目模板">
<p class="m-b-20">栏目banner</p> <el-select v-model="form.templateId">
<el-upload <el-option
class="avatar-uploader avatar-uploader-lg" v-for="item in templates"
accept=".jpg,.png,.jpeg,.gif" :key="item.id"
:on-remove="handleRemove" :label="item.name"
:on-error="uploadError" :value="item.id">
:on-success="uploadSuccess" </el-option>
:before-remove="beforeRemove" </el-select>
:limit="1" </el-form-item>
:on-exceed="handleExceed" <el-form-item prop="listStyleId" label="列表样式">
:action="this.api.fileupload" <ul class="styles">
:headers="headers" <li>
name="file" <div class="review">
> <img src="@/assets/img/list1.png" alt="">
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar"> </div>
<div class="uploader-default" v-else> <el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
<i class="el-icon-plus"></i> </li>
<p>上传banner</p> <li>
</div> <div class="review">
<div slot="tip" class="el-upload__tip"> <img src="@/assets/img/list2.png" alt="">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p> </div>
</div> <el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio>
</el-upload> </li>
</div> <li>
</el-card> <div class="review">
<el-card shadow="hover" class="mgr20 m-b-20"> <img src="@/assets/img/list2.png" alt="">
<div> </div>
<p class="m-b-20">栏目模板</p> <el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
<el-select v-model="form.templateId"> </li>
<el-option </ul>
v-for="item in templates" </el-form-item>
:key="item.id" <el-form-item prop="detailStyle" label="详情样式">
:label="item.name" <ul class="styles">
:value="item.id"> <li>
</el-option> <div class="review">
</el-select> <img src="@/assets/img/article1.png" alt="">
<div class="style-wrap"> </div>
<p class="label">列表样式</p> <el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio>
<ul class="styles"> </li>
<li> <li>
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> <div class="review">
</li> <img src="@/assets/img/article2.png" alt="">
<li> </div>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> <el-radio v-model="form.detailStyle" :label="2">富文本</el-radio>
</li> </li>
<li> <li>
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> <div class="review">
</li> <img src="@/assets/img/article3.png" alt="">
</ul> </div>
</div> <el-radio v-model="form.detailStyle" :label="3">链接</el-radio>
<div class="style-wrap"> </li>
<p class="label">详情样式</p> </ul>
<ul class="styles"> </el-form-item>
<li> </template>
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio> <template v-if="form.typeId === 2">
</li> <el-form-item prop="connectionType" label="连接类型">
<li> <el-radio-group v-model="form.connectionType">
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio> <el-radio :label="1">站内链接</el-radio>
</li> <el-radio :label="2">站外链接</el-radio>
<li> <el-radio :label="3">其他站点链接</el-radio>
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio> </el-radio-group>
</li> </el-form-item>
</ul> <el-form-item v-show="form.connectionType === 1" label="站内链接">
</div> <el-cascader
</div> v-model="links"
</el-card> :options="columns"
</template> :props="columnProps"
<template v-if="form.typeId === 2"> clearable></el-cascader>
<el-card shadow="hover" class="mgr20 m-b-20"> </el-form-item>
<div> <el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接">
<p class="m-b-20">连接类型</p> <el-input
<el-radio-group v-model="form.connectionType"> placeholder="请输入站外链接"
<el-radio :label="1">站内链接</el-radio> v-model.trim="form.linkAddress"
<el-radio :label="2">站外链接</el-radio> clearable
<el-radio :label="3">其他站点链接</el-radio> ></el-input>
</el-radio-group> </el-form-item>
</div> <template v-if="form.connectionType === 3">
</el-card> <el-form-item prop="siteSelection" label="站点选择">
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20"> <el-select v-model="form.siteSelection">
<div> <el-option
<p class="m-b-20">站内链接</p> v-for="item in sites"
<el-cascader :key="item.id"
v-model="links" :label="item.name"
:options="columns" :value="item.id">
:props="columnProps" </el-option>
clearable></el-cascader> </el-select>
</div> </el-form-item>
</el-card> <el-form-item label="栏目">
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20"> <el-cascader
<div> :options="links"
<p class="m-b-20">站外链接</p> :props="{ checkStrictly: true }"
<el-input clearable></el-cascader>
placeholder="请输入站外链接" </el-form-item>
v-model.trim="form.linkAddress" </template>
clearable <el-form-item prop="isOpen" label="新窗口打开">
></el-input> <el-switch
</div> v-model="form.isOpen"
</el-card> :active-value="1"
<template v-if="form.connectionType === 3"> :inactive-value="0">
<el-card shadow="hover" class="mgr20 m-b-20"> </el-switch>
<div> </el-form-item>
<p class="m-b-20">站点选择</p> </template>
<el-select v-model="form.siteSelection"> <template v-if="form.typeId === 3">
<el-option <el-form-item prop="templateId" label="栏目模板">
v-for="item in sites" <el-select v-model="form.templateId">
:key="item.id" <el-option
:label="item.name" v-for="item in templates"
:value="item.id"> :key="item.id"
</el-option> :label="item.name"
</el-select> :value="item.id">
</div> </el-option>
</el-card> </el-select>
<el-card shadow="hover" class="mgr20 m-b-20"> </el-form-item>
<div> <el-form-item prop="listStyleId" label="列表样式">
<p class="m-b-20">栏目</p> <ul class="styles">
<el-cascader <li>
:options="links" <div class="review">
:props="{ checkStrictly: true }" <img src="@/assets/img/list1.png" alt="">
clearable></el-cascader> </div>
</div> <el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
</el-card> </li>
</template> <li>
</template> <div class="review">
<template v-if="form.typeId === 3"> <img src="@/assets/img/list2.png" alt="">
<el-card shadow="hover" class="mgr20 m-b-20"> </div>
<div> <el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio>
<p class="m-b-20">栏目模板</p> </li>
<el-select v-model="form.templateId"> <li>
<el-option <div class="review">
v-for="item in templates" <img src="@/assets/img/list2.png" alt="">
:key="item.id" </div>
:label="item.name" <el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
:value="item.id"> </li>
</el-option> </ul>
</el-select> </el-form-item>
<div class="style-wrap"> </template>
<p class="label">列表样式</p> <el-form-item v-show="form.typeId === 4" prop="showWithDetails" label="只有一篇文章时,以详情方式展示">
<ul class="styles"> <el-switch
<li> v-model="form.showWithDetails"
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> :active-value="1"
</li> :inactive-value="0">
<li> </el-switch>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> </el-form-item>
</li> </el-form>
<li> <div class="btns">
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> <el-button type="primary" @click="submit(1)">发布</el-button>
</li> <el-button @click="preview">预览</el-button>
</ul> <el-button v-if="!isEdit" @click="submit(0)">保存草稿</el-button>
</div> <el-button @click="$router.back()">取消</el-button>
</div>
</el-card>
</template>
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">只有一篇文章时以详情方式展示</p>
<el-switch
v-model="form.showWithDetails"
:active-value="1"
:inactive-value="0">
</el-switch>
</div>
</el-card>
</el-form>
</div> </div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import ColumnConst from '@/const/column' import ColumnConst from '@/const/column'
import { mapState, mapActions } from "vuex"; import { mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
siteId: this.$store.state.content.siteId,
isEdit: this.$route.query.type === 'edit', isEdit: this.$route.query.type === 'edit',
headers: {},
nameRepeat: false, nameRepeat: false,
types: ColumnConst.types, types: ColumnConst.types,
templates: ColumnConst.templates, templates: ColumnConst.templates,
@ -259,6 +246,7 @@ export default {
}, },
links: [], links: [],
form: { form: {
siteId: this.$store.state.content.siteId,
id: this.$route.query.id || '', id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId, founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId, editorId: +this.$store.state.user.userId,
@ -278,11 +266,17 @@ export default {
siteSelection: 1, siteSelection: 1,
status: 1, status: 1,
sort: 1, sort: 1,
isOpen: 1
}, },
submiting: false, // submiting: false, //
updateTime: 0 updateTime: 0
}; };
}, },
computed: {
...mapState('user', [
'userName'
])
},
mounted() { mounted() {
this.getList() this.getList()
this.isEdit && this.getData() this.isEdit && this.getData()
@ -300,6 +294,7 @@ export default {
// //
getList() { getList() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.siteId,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
@ -320,8 +315,9 @@ export default {
// //
nameChange(){ nameChange(){
const { columnName, level, id } = this.form const { columnName, level, id } = this.form
if(columnName && columnName !== this.originalName){ if (columnName && columnName !== this.originalName) {
this.$post(this.api.sameLevelJudgment, { this.$post(this.api.sameLevelJudgment, {
siteId: this.siteId,
columnName, columnName,
level: +level, level: +level,
id: +id || '' id: +id || ''
@ -337,6 +333,19 @@ export default {
// //
typeChange(val) { typeChange(val) {
},
//
beforeUpload(file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
if (size / 1024 / 1024 > 1) {
this.$message.error('请上传1M以内的图片!')
return false
}
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -345,9 +354,6 @@ export default {
center: true center: true
}) })
}, },
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
@ -355,10 +361,14 @@ export default {
this.form.columnBanner = '' this.form.columnBanner = ''
}, },
uploadSuccess(res) { uploadSuccess(res) {
this.form.columnBanner = res.data.filesResult.fileUrl this.form.columnBanner = res.data.url
},
//
preview() {
}, },
// //
submit() { submit(status) {
if (this.submiting) return false if (this.submiting) return false
const { form } = this const { form } = this
if (!form.columnName) return util.errorMsg('请填写栏目名称') if (!form.columnName) return util.errorMsg('请填写栏目名称')
@ -371,7 +381,7 @@ export default {
if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目') if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目')
form.linkAddress = links.join() form.linkAddress = links.join()
} }
console.log(44, this.links) form.status = status
this.submiting = true this.submiting = true
if (this.isEdit) { if (this.isEdit) {
delete form.children delete form.children
@ -390,112 +400,68 @@ export default {
this.submiting = false this.submiting = false
}) })
} }
},
//
backPage() {
this.$router.back()
},
goBack() {
const { id } = this.form
const { updateTime } = this
//
if ((!this.isEdit && updateTime > 1) || (id && updateTime > 2)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.submit()
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.inline-input {
width: 500px;
}
$upload-width: 220px; $upload-width: 220px;
$upload-height: 140px; $upload-height: 102px;
$upload-lg-height: 150px; $upload-lg-height: 102px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $upload-width; width: $upload-width;
height: $upload-height; height: $upload-height;
border: 1px dashed #d9d9d9; border: 1px solid #DCDEE0;
border-radius: 6px; border-radius: 2px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
.uploader-default {
&:hover { display: flex;
border-color: #cb221c; height: $upload-height;
} flex-direction: column;
justify-content: center;
.uploader-default { align-items: center;
display: flex; text-align: center;
height: $upload-height; background: #FAFAFA;
flex-direction: column; p {
justify-content: center; margin-top: 10px;
text-align: center; font-size: 14px;
background: rgba(0, 0, 0, 0.04); color: #333;
line-height: 20px;
i { }
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
} }
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.avatar-lg { .uploader-default {
display: block;
width: 100%;
height: $upload-lg-height; height: $upload-lg-height;
}
} }
}
.el-upload__tip { .avatar {
margin-top: 0; display: block;
width: $upload-width;
p { height: $upload-height;
font-size: 14px; }
color: rgba(0, 0, 0, 0.45); .avatar-lg {
line-height: 1; display: block;
width: 100%;
&:first-child { height: $upload-lg-height;
margin-bottom: 5px; }
} .el-upload__tip {
} margin-top: 0;
p {
font-size: 12px;
color: #333;
} }
}
} }
.style-wrap { .style-wrap {
display: flex; display: flex;
@ -508,6 +474,16 @@ $upload-lg-height: 150px;
display: inline-flex; display: inline-flex;
li { li {
margin-right: 20px; margin-right: 20px;
text-align: center;
&:hover .review {
border-color: #2962FF;
}
}
.review {
padding: 18px;
margin-bottom: 10px;
border: 1px solid #DCDEE0;
border-radius: 2px;
} }
} }
</style> </style>

@ -1,50 +1,83 @@
<template> <template>
<div class="page"> <div class="page">
<h6 class="p-title">筛选</h6> <div class="tool">
<div class="tool mul"> <div class="search-wrap">
<ul class="filter"> <el-input placeholder="请输入栏目名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input>
<li> <el-button type="primary" @click="initData">查询</el-button>
<el-input placeholder="请输入栏目名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable style="width: 300px"></el-input> </div>
</li> <div class="actions">
</ul> <el-button type="primary" @click="add" >新增</el-button>
<div> <el-button @click="batchDel">删除</el-button>
<div> <el-button class="lg" @click="sort">更改排序</el-button>
<el-button type="info" round @click="add" >新增</el-button> <el-button class="lg" @click="styleSet">导航样式设置</el-button>
<el-button type="primary" round @click="delAllData">批量删除</el-button> </div>
</div>
</div>
</div>
<el-table v-loading="listLoading" ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="columnName" label="名称"></el-table-column>
<el-table-column prop="typeId" label="栏目类型" align="center">
<template slot-scope="scope">
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }}
</template>
</el-table-column>
<el-table-column prop="templateId" label="栏目模板" align="center"></el-table-column>
<el-table-column prop="listStyleId" label="列表/长页样式" align="center"></el-table-column>
<el-table-column prop="detailStyle" label="详情样式" align="center"></el-table-column>
<el-table-column prop="menuVisible" label="导航菜单" align="center"></el-table-column>
<el-table-column prop="id" label="ID" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row, 'add')">新增下级</el-button>
<el-button type="text" @click="edit(scope.row, 'edit')">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div> </div>
<el-table v-loading="listLoading" ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" :reserve-selection="true"></el-table-column>
<el-table-column prop="columnName" label="名称"></el-table-column>
<el-table-column prop="typeId" label="栏目类型">
<template slot-scope="scope">
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }}
</template>
</el-table-column>
<el-table-column prop="templateId" label="栏目模板"></el-table-column>
<el-table-column prop="listStyleId" label="列表/长页样式"></el-table-column>
<el-table-column prop="detailStyle" label="详情样式"></el-table-column>
<el-table-column prop="menuVisible" label="导航菜单">
<template slot-scope="scope">
<el-switch
v-model="scope.row.menuVisible"
:active-value="0"
:inactive-value="1">
</el-switch>
</template>
</el-table-column>
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column label="操作" width="170">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row, 'add')">新增下级</el-button>
<el-button type="text" @click="edit(scope.row, 'edit')">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<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="导航样式">
<el-select v-model="form.typeId">
<el-option
v-for="item in styleTypes"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="样式选择">
<ul class="styles">
<li>
<div class="review">
<img src="@/assets/img/style1.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="1">竖行导航</el-radio>
</li>
<li>
<div class="review">
<img src="@/assets/img/style2.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="2">横向导航</el-radio>
</li>
</ul>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="styleVisible = false"> </el-button>
<el-button type="primary" @click="styleSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
@ -55,104 +88,130 @@ export default {
return { return {
types: ColumnConst.types, types: ColumnConst.types,
templates: ColumnConst.templates, templates: ColumnConst.templates,
keyWord: "", // keyword: '',
searchTimer: null, searchTimer: null,
page: +this.$route.query.page || 1, // list: [],
pageSize: 10, // 10 multipleSelection: [],
total: 0, // listLoading: false,
listData: [], // styleVisible: false,
multipleSelection: [], // styleTypes: [
listLoading:false,// {
id: 1,
name: '目录树结构'
},
{
id: 2,
name: '分类结构'
}
],
form: {
}
}; };
}, },
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() { mounted() {
this.getData() this.getData()
}, },
methods: { methods: {
getData() { getData() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
columnName: this.keyWord, siteId: this.$store.state.content.siteId,
templateId: '', columnName: this.keyword,
typeId : '', templateId: '',
}).then(({ data }) => { typeId : '',
this.listData = data }).then(({ data }) => {
this.listLoading = false this.list = data
}).catch(err => { this.listLoading = false
this.listLoading = false }).catch(err => {
}) this.listLoading = false
}, })
initData() { },
this.$refs.table.clearSelection() initData() {
this.page = 1 this.$refs.table.clearSelection()
this.getData() this.page = 1
}, this.getData()
add() { },
this.$router.push('add') add() {
}, this.$router.push('add')
edit(row, type) { },
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) edit(row, type) {
}, this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`)
del(row) { },
this.$confirm("确定要删除吗?", "提示", { del(row) {
type: "warning" this.$confirm("确定要删除吗?", "提示", {
}).then(() => { type: "warning"
this.$post(`${this.api.deleteColumn}?id=${row.id}`).then(res => { }).then(() => {
util.successMsg("删除成功") this.$post(`${this.api.deleteColumn}?id=${row.id}`).then(res => {
this.getData() util.successMsg("删除成功")
}).catch(res => {}) this.getData()
}).catch(() => {}) }).catch(res => {})
}, }).catch(() => {})
delAllData() { },
if (this.multipleSelection.length) { batchDel() {
let ids = this.multipleSelection.map(item => { if (this.multipleSelection.length) {
return item.id; let ids = this.multipleSelection.map(item => {
}); return item.id;
this.$confirm("确定要删除吗?", "提示", { });
type: "warning" this.$confirm("确定要删除吗?", "提示", {
}).then(() => { type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => { this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
util.successMsg("删除成功"); util.successMsg("删除成功");
this.sss = 0 this.sss = 0
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
if(this.multipleSelection.length === this.listData.length && this.page>1) { if(this.multipleSelection.length === this.list.length && this.page>1) {
this.handleCurrentChange(this.page - 1) this.handleCurrentChange(this.page - 1)
} }
}).catch(() => { }).catch(() => {
}); });
} else { } else {
util.errorMsg("请先选择数据 !"); util.errorMsg("请先选择数据 !");
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.$router.push(`list?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData(); this.getData()
} },
//
sort() {
},
//
styleSet() {
this.styleVisible = true
},
//
styleSubmit() {
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-radio-group { .styles {
white-space: nowrap; display: inline-flex;
} li {
.el-radio.is-bordered + .el-radio.is-bordered { margin-right: 20px;
margin-left: 0; text-align: center;
&:hover .review {
border-color: #2962FF;
}
}
.review {
padding: 18px;
margin-bottom: 10px;
border: 1px solid #DCDEE0;
border-radius: 2px;
}
} }
</style> </style>

@ -1,81 +1,91 @@
<template> <template>
<div class="page"> <div class="page">
<h6 class="p-title">筛选</h6> <div class="tool">
<div class="tool mul"> <p class="page-name">长页栏目列表</p>
<ul class="filter"> <div class="search-wrap">
<li> <el-input placeholder="请输入栏目或模板名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input>
<el-input placeholder="请输入栏目或模板名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable style="width: 300px"></el-input> <el-button type="primary" @click="initData">查询</el-button>
</li> </div>
</ul> </div>
<div>
<div>
<!-- <el-button v-auth type="info" round @click="add" >创建考核</el-button>
<el-button v-auth type="primary" round @click="delAllData">批量删除</el-button> -->
</div>
</div>
</div>
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="id"> <el-table ref="table" :data="list" class="table" header-align="center" row-key="id">
<el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center">
<el-table-column type="index" width="60" label="序号" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> {{ scope.$index + (page - 1) * pageSize + 1 }}
{{ scope.$index + (pageNum - 1) * pageSize + 1 }} </template>
</template> </el-table-column>
</el-table-column> <el-table-column prop="columnName" label="长页栏目名称" align="center"></el-table-column>
<el-table-column prop="createTime" label="长页栏目名称" align="center"></el-table-column> <el-table-column prop="articleTemplate" label="模板名称" align="center"></el-table-column>
<el-table-column prop="createTime" label="模板名称" align="center"></el-table-column> <el-table-column prop="columnName" label="上级栏目" align="center">
<el-table-column prop="createTime" label="上级栏目" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="createTime" label="最近编辑" align="center"></el-table-column> {{ scope.row.parents }}
<el-table-column prop="createTime" label="编辑人" align="center"></el-table-column> </template>
<el-table-column label="操作" width="170" align="center"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-button type="text" @click="start(scope.row)">预览</el-button> <el-table-column prop="updateTime" label="最近编辑" align="center"></el-table-column>
<el-button type="text" @click="start(scope.row)">编辑</el-button> <el-table-column prop="editorName" label="编辑人" align="center"></el-table-column>
<el-button type="text" @click="start(scope.row)">删除</el-button> <el-table-column label="操作" width="170" align="center">
</template> <template slot-scope="scope">
</el-table-column> <el-button type="text" @click="start(scope.row)">预览</el-button>
</el-table> <el-button type="text" @click="start(scope.row)">编辑</el-button>
<div class="pagination"> <el-button type="text" @click="start(scope.row)">删除</el-button>
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="pageNum"></el-pagination> </template>
</div> </el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
keyword: '', keyword: '',
pageNum: +this.$route.query.page || 1, // page: +this.$route.query.page || 1,
pageSize: 10, // 10 pageSize: 10,
total: 0, // total: 0,
list: [] list: []
}; };
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
}, },
mounted() { mounted() {
this.getData()
}, },
methods: { methods: {
handleCurrentChange(val) { //
this.page = val getData() {
// this.getData(); this.$post(this.api.longPageColumnList, {
}, siteId: this.$store.state.content.siteId,
add() { pageNum: this.page,
this.$router.push("add"); pageSize: this.pageSize,
}, title: this.keyword
edit(row) { }).then(({ data }) => {
this.$router.push(`add?id=${row.id}`); const list = data.records
}, list.map(e => {
//
e.parents = e.superiorColumn ?
e.superiorColumn.map(n => n.columnName).join(' / ') :
'--'
})
this.list = list
this.total = +data.total
}).catch(err => {})
},
initData() {
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val
this.getData()
},
add() {
this.$router.push("add");
},
edit(row) {
this.$router.push(`add?id=${row.id}`);
}
} }
}; };
</script> </script>

@ -1,73 +1,69 @@
<template> <template>
<div class="page"> <div class="page">
<h6 class="p-title">筛选</h6> <div class="tool">
<div class="tool mul"> <p class="page-name">站点列表</p>
<ul class="filter"> <div class="search-wrap">
<li> <el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="getData"></el-input>
<el-input placeholder="请输入站点名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable style="width: 300px"></el-input> <el-button type="primary" @click="getData">查询</el-button>
</li> </div>
</ul> </div>
</div>
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="id"> <el-table ref="table" :data="list" class="table" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="站点名称" align="center"></el-table-column> <el-table-column prop="name" label="站点名称" align="center"></el-table-column>
<el-table-column prop="domain" label="域名" align="center"></el-table-column> <el-table-column prop="domain" label="域名" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center"> <el-table-column label="操作" width="170" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toIndex(scope.row)">前往网站首页</el-button> <el-button type="text" @click="toIndex(scope.row)">前往网站首页</el-button>
<el-button type="text" @click="content(scope.row)">内容管理</el-button> <el-button type="text" @click="content(scope.row)">内容管理</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapMutations } from 'vuex'
import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
keyword: '', keyword: '',
page: +this.$route.query.page || 1, // page: +this.$route.query.page || 1, //
pageSize: 10, // 10 pageSize: 10, // 10
total: 0, // total: 2, //
list: [ list: [
{ {
id: 1, id: 1,
name: '粒子研究院中文站点', name: '粒子研究院中文站点',
domain: 'www.iasf.ac.cn' domain: 'www.iasf.ac.cn'
}, },
{ {
id: 2, id: 2,
name: '粒子研究院英文文站点', name: '粒子研究院英文文站点',
domain: 'www.iasf.ac.en' domain: 'www.iasf.ac.en'
} }
] ]
}; };
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500)
}
}, },
mounted() { mounted() {
}, },
methods: { methods: {
...mapMutations('content', [
'setSiteId'
]),
getData() {
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
}, },
// //
toIndex(row) { toIndex(row) {
@ -75,6 +71,7 @@ export default {
}, },
// //
content(row) { content(row) {
this.setSiteId(row.id)
this.$router.push(`/page`) this.$router.push(`/page`)
}, },
} }

@ -112,7 +112,7 @@ function post(url, params) {
function del(url, params) { function del(url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
service.delete(url, { service.delete(url, {
params data: params
}).then(res => { }).then(res => {
resolve(res); resolve(res);
}).catch(err => { }).catch(err => {

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'annex-'
export default {
path: '/annex',
name: 'annex',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/annex/list'),
meta: { title: '栏目管理' }
}
]
}

@ -0,0 +1,17 @@
/**
* 内容管理
* */
export default {
namespaced: true,
state: {
siteId: ''
},
mutations: {
setSiteId: (state, siteId) => {
state.siteId = siteId
}
},
actions: {
}
};

@ -10,29 +10,29 @@ import addRoutes from "@/libs/route/addRoutes";
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png", avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
userId: '', userId: '',
userName: '', userName: '',
}, },
mutations: { mutations: {
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
}, },
SET_USERID: (state, userId) => { SET_USERID: (state, userId) => {
state.userId = userId state.userId = userId
}, },
SET_USERNAME: (state, userName) => { SET_USERNAME: (state, userName) => {
state.userName = userName state.userName = userName
}, }
}, },
actions: { actions: {
logout({ commit, state, dispatch }) { logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey); util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey); util.local.remove(Setting.tokenKey)
location.reload() location.reload()
resolve(); resolve()
}); })
} }
} }
}; };

@ -27,28 +27,11 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.el-button--primary.action-btn {
color: $--color-primary !important;
font-size: 14px !important;
background-color: #fff !important;
border-radius: 4px !important;
}
.el-button--info.action-btn {
color: #fff !important;
font-size: 14px !important;
background-color: $--color-primary !important;
border-radius: 4px !important;
border: none;
}
.el-input { .el-input {
.el-input__inner { .el-input__inner {
border-color: rgba(0, 0, 0, 0.15); border-color: #DCDEE0;
} }
} }
.p-title { .p-title {
padding-left: 5px; padding-left: 5px;
margin-bottom: 24px; margin-bottom: 24px;
@ -60,21 +43,24 @@
.page { .page {
position: relative; position: relative;
padding: 24px; padding: 16px 20px;
background-color: #fff; background-color: #fff;
border-radius: 8px; .page-name {
font-size: 14px;
color: #333;
&.mb {
margin-bottom: 16px;
}
}
.tool { .tool {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
margin-bottom: 24px; margin-bottom: 24px;
.filter { .filter {
display: inline-flex; display: inline-flex;
//flex-wrap: wrap;
align-items: center; align-items: center;
flex: 1; flex: 1;
li { li {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@ -89,15 +75,6 @@
} }
} }
} }
.el-button--primary {
@extend .action-btn;
}
.el-button--info {
@extend .action-btn;
}
&.mul { &.mul {
margin-bottom: 0; margin-bottom: 0;
@ -111,7 +88,61 @@
} }
} }
} }
.search-wrap {
display: flex;
.el-input__inner {
border-radius: 0;
border-right: 0;
}
.el-button {
border-radius: 0;
}
}
.actions, .btns, .el-dialog__footer {
.el-button {
width: 80px;
padding: 8px 0;
font-size: 14px;
border-radius: 2px;
&.lg {
width: 100px;
}
}
}
.input-form {
&.model {
height: calc(100vh - 278px);
padding-right: 20px;
overflow: auto;
}
.item-line {
display: flex;
justify-content: space-between;
}
.line {
margin-bottom: 24px;
border-bottom: 1px dashed #C2C2C2;
}
.el-form-item--small.el-form-item {
margin-bottom: 24px;
}
.el-input, .el-select {
width: 300px;
}
.auto, .auto .el-input {
width: auto;
}
}
.btns {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 14px 0;
text-align: center;
background-color: #fff;
box-shadow: 4px -2px 6px 0px rgba(198,198,198,0.3500);
}
.pagination { .pagination {
margin: 20px 0; margin: 20px 0;
text-align: center; text-align: center;
@ -119,7 +150,7 @@
button, .number { button, .number {
color: rgba(0, 0, 0, .65) !important; color: rgba(0, 0, 0, .65) !important;
background-color: transparent !important; background-color: transparent !important;
border: 1px solid rgba(0, 0, 0, 0.15) !important; border: 1px solid #DCDEE0 !important;
border-radius: 4px !important; border-radius: 4px !important;
} }
@ -134,25 +165,24 @@
} }
.el-table { .el-table {
border-radius: 8px;
border: 1px solid rgba(0, 0, 0, 0.06);
border-bottom: 0; border-bottom: 0;
.cell { .cell {
font-size: 12px; font-size: 12px;
color: #333;
line-height: 35px; line-height: 35px;
} }
th { th {
background: $--color-primary !important; background: #F7F7F7 !important;
.cell { .cell {
color: #fff; color: #323232;
font-size: 14px; font-size: 12px;
font-weight: normal; font-weight: normal;
} }
} }
} }
.el-table th.is-leaf, .el-table td {
border-bottom-color: #EBEDF0;
}
.tabs { .tabs {
display: flex; display: flex;
@ -226,7 +256,6 @@
} }
} }
} }
.el-message-box { .el-message-box {
padding-bottom: 24px; padding-bottom: 24px;
@ -272,33 +301,22 @@
} }
} }
.el-dialog__wrapper { .el-dialog__wrapper {
.el-dialog { .el-dialog {
border-radius: 4px; border-radius: 4px;
.el-dialog__header { .el-dialog__header {
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-bottom: 1px solid rgba(0, 0, 0, 0.06);
.el-dialog__title { .el-dialog__title {
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
} }
.el-dialog__footer { .el-dialog__footer {
padding: 10px 16px; padding: 10px 16px;
border-top: 1px solid rgba(0, 0, 0, 0.06); border-top: 1px solid rgba(0, 0, 0, 0.06);
.el-button {
font-size: 14px;
border-radius: 4px;
border-color: rgba(0, 0, 0, 0.15);
}
} }
} }
} }
.upload-wrap { .upload-wrap {
position: relative; position: relative;
display: flex; display: flex;

Loading…
Cancel
Save