master
yujialong 2 years ago
parent ac89c17e65
commit caf1587264
  1. 92
      src/layouts/header/index.vue
  2. 5
      src/layouts/home/index.vue
  3. 80
      src/layouts/navbar/index.vue
  4. 51
      src/pages/account/login/index.vue
  5. 59
      src/pages/annex/list/index.vue
  6. 120
      src/pages/article/add/index.vue
  7. 74
      src/pages/article/list/index.vue
  8. 39
      src/pages/column/add/index.vue
  9. 38
      src/pages/column/list/index.vue
  10. 41
      src/pages/page/list/index.vue
  11. 79
      src/pages/role/list/index.vue
  12. 8
      src/pages/setting/list/info.vue
  13. 13
      src/pages/site/list/index.vue
  14. 142
      src/pages/user/list/index.vue
  15. 16
      src/pages/userGroup/list/index.vue
  16. 12
      src/router/modules/setting.js
  17. 20
      src/router/permission.js
  18. 47
      src/setting.js
  19. 6
      src/store/modules/content.js
  20. 43
      src/styles/common.scss

@ -2,22 +2,23 @@
<div class="header"> <div class="header">
<div class="group"> <div class="group">
<img src="@/assets/img/group.png"> <img src="@/assets/img/group.png">
<!-- <span>站点管理</span> -->
<breadcrumb v-if="crumbRefresh" ref="breadcrumb" :data="crumbs"></breadcrumb> <breadcrumb v-if="crumbRefresh" ref="breadcrumb" :data="crumbs"></breadcrumb>
</div> </div>
<div class="user-tool"> <div class="user-tool">
<div class="site cp"> <template v-if="inContent">
<img src="@/assets/img/index.png"> <div class="site cp">
当前站点首页 <img src="@/assets/img/index.png">
</div> 当前站点首页
<el-dropdown class="site-switch cp"> </div>
<span class="el-dropdown-link"> <el-dropdown class="site-switch cp" @command="siteCommand">
切换站点<i class="el-icon-caret-bottom el-icon--right"></i> <span class="el-dropdown-link">
</span> 切换站点<i class="el-icon-caret-bottom el-icon--right"></i>
<el-dropdown-menu slot="dropdown"> </span>
<el-dropdown-item v-for="(site, i) in sites" :key="i">{{ site.name }}</el-dropdown-item> <el-dropdown-menu slot="dropdown">
</el-dropdown-menu> <el-dropdown-item v-for="(site, i) in sites" :key="i" :command="site">{{ site.name }}</el-dropdown-item>
</el-dropdown> </el-dropdown-menu>
</el-dropdown>
</template>
<img class="cp" src="@/assets/img/notice.png"> <img class="cp" src="@/assets/img/notice.png">
<el-dropdown class="user-wrap" @command="userCommand"> <el-dropdown class="user-wrap" @command="userCommand">
<div class="user"> <div class="user">
@ -35,14 +36,14 @@
<script> <script>
import { mapState, mapMutations, mapActions } from 'vuex' import { mapState, mapMutations, mapActions } from 'vuex'
import ColumnConst from '@/const/column' import ColumnConst from '@/const/column'
import Bus from '@/libs/bus'
import breadcrumb from '@/components/breadcrumb' import breadcrumb from '@/components/breadcrumb'
export default { export default {
data() { data() {
return { return {
sites: ColumnConst.sites, sites: ColumnConst.sites,
// crumbs: '', crumbRefresh: true,
crumbRefresh: true inContent: false, //
sitePath: ['/page', '/column', '/article']
}; };
}, },
components: { components: {
@ -59,54 +60,39 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.crumbRefresh = true this.crumbRefresh = true
}) })
},
'$route'() {
this.setContent()
} }
}, },
mounted() { mounted() {
// this.getSystemDetail() this.setContent()
// this.getUserDetail() // this.getUserDetail()
}, },
methods: { methods: {
...mapMutations("user", [
'SET_SCHOOLID'
]),
...mapActions("user", [ ...mapActions("user", [
'logout' 'logout'
]), ]),
getSystemDetail() { // logo ...mapMutations('content', [
this.$get(this.api.logoDetail).then(res => { 'setSite'
const { data } = res ]),
if (data) { //
this.setTitle(data.title) setContent() {
this.setLogoUrl(data.logoUrl) const { path } = this.$route
this.SET_SCHOOLID(data.schoolId) this.inContent = !!this.sitePath.find(e => path.includes(e))
} else {
// schoolId
this.$post(this.api.getSchoolIdByToken).then(res => {
this.SET_SCHOOLID(res.schoolId)
}).catch(res => {})
}
}).catch(res => {})
}, },
getUserDetail() { // //
this.$get(this.api.queryUserInfoDetails).then(res => { siteCommand(e) {
let { hrUserInfo } = res.result this.setSite(e)
if (hrUserInfo) { location.reload()
const { userAvatars, userName } = hrUserInfo
userAvatars && this.setAvatar(userAvatars)
this.setUserName(userName)
} else {
this.$get(this.api.isClient).then(res => {
res.customerName && this.setUserName(res.customerName)
}).catch(res => {})
}
}).catch(res => {})
}, },
userCommand(command) { // //
if (command == "person") { userCommand(command) {
this.$router.push("/setting/person"); if (command == 'person') {
} else { this.$router.push('/setting')
this.logout() } else {
} this.logout()
}
}, },
} }
}; };

@ -9,7 +9,6 @@
<router-view class="view"></router-view> <router-view class="view"></router-view>
</transition> </transition>
<el-backtop target=".content"></el-backtop> <el-backtop target=".content"></el-backtop>
<v-footer ref="footer"></v-footer>
</div> </div>
</div> </div>
</div> </div>
@ -44,11 +43,11 @@ export default {
.layout{ .layout{
width: calc(100% - 256px); width: calc(100% - 256px);
.content{ .content{
height: calc(100vh - 80px); height: calc(100vh - 64px);
padding: 24px 24px 0; padding: 24px 24px 0;
overflow: auto; overflow: auto;
.view{ .view{
min-height: calc(100% - 60px); min-height: 100%;
} }
} }
} }

@ -44,25 +44,26 @@
<img class="logo-icon" src="@/assets/img/logo.png" alt=""> <img class="logo-icon" src="@/assets/img/logo.png" alt="">
<ul class="col-nav"> <ul class="col-nav">
<li v-for="(item, i) in colNav" :key="i" @click="menuSelect(item.index)"> <li v-for="(item, i) in colNav" :key="i" @click="menuSelect(item.index)">
<img :src="require('@/assets/img/' + item.icon + '.png')" alt=""> <img width="15" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
</li> </li>
</ul> </ul>
</div> </div>
<div> <div class="col-menu">
<div class="name">粒子研究院中文站点</div> <div class="name">{{ this.$store.state.content.site.name }}</div>
<el-menu <el-menu
v-if="colRefresh" v-if="colRefresh"
:default-active="siteActive" :default-active="siteActive"
background-color="#fff" background-color="#fff"
text-color="#333" text-color="#333"
active-text-color="#fff" active-text-color="#fff"
:collapse-transition="false"
router router
> >
<template v-for="item in sites"> <template v-for="item in sites">
<template v-if="item.subs"> <template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index"> <el-submenu :index="item.index" :key="item.index">
<template slot="title"> <template slot="title">
<img class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt=""> <img width="14" class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<template v-for="subItem in item.subs"> <template v-for="subItem in item.subs">
@ -188,7 +189,8 @@ export default {
const ori = this.collapse const ori = this.collapse
this.collapse = !!this.sites[0].subs.find(e => path.includes(e.index)) this.collapse = !!this.sites[0].subs.find(e => path.includes(e.index))
// //
if (!ori && this.collapse) { if (!ori && this.sites[0].subs.find(e => from.path.includes(e.index))) {
this.siteActive = '/page'
this.colRefresh = false this.colRefresh = false
this.$nextTick(() => { this.$nextTick(() => {
this.colRefresh = true this.colRefresh = true
@ -203,39 +205,39 @@ export default {
// this.getPer() // this.getPer()
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions('user', [
'logout' 'logout'
]), ]),
// //
menuSelect(index) { menuSelect(index) {
this.collapse = false this.collapse = false
if (index.includes('/')) { if (index.includes('/')) {
this.$router.push(index) this.$router.push(index)
}
},
//
getPer() {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const routes = res.permissionMenu[0].children
addRoutes(routes)
this.initMenu()
}).catch(({ status }) => {
status === 500 && this.logout()
})
},
initMenu() {
// store
if (Setting.dynamicRoute) {
const { routes } = this
const menus = []
this.defaultMenus.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
});
this.menus = menus
} else {
this.menus = this.defaultMenus
}
} }
},
//
getPer() {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const routes = res.permissionMenu[0].children
addRoutes(routes)
this.initMenu()
}).catch(({ status }) => {
status === 500 && this.logout()
})
},
initMenu() {
// store
if (Setting.dynamicRoute) {
const { routes } = this
const menus = []
this.defaultMenus.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
});
this.menus = menus
} else {
this.menus = this.defaultMenus
}
}
} }
}; };
</script> </script>
@ -275,6 +277,7 @@ export default {
display: flex; display: flex;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
overflow: hidden;
.col-wrap { .col-wrap {
width: 64px; width: 64px;
background-color: #001529; background-color: #001529;
@ -296,6 +299,9 @@ export default {
color: #333; color: #333;
line-height: 32px; line-height: 32px;
} }
.col-menu {
width: 192px;
}
/deep/.el-submenu__title { /deep/.el-submenu__title {
padding-left: 14px !important; padding-left: 14px !important;
} }

@ -62,36 +62,35 @@
</template> </template>
<script> <script>
import { mapActions, mapMutations } from "vuex"; import { mapActions, mapMutations } from 'vuex'
import vFooter from "@/layouts/footer"; import vFooter from '@/layouts/footer'
import util from "@/libs/util"; import util from '@/libs/util'
import Setting from "@/setting"; import Setting from '@/setting'
export default { export default {
data: function() { data: function() {
return { return {
activeName: "1", activeName: "1",
loginForm: { loginForm: {
username: "", username: "",
password: "", password: "",
captcha: "", // captcha: "", //
}, },
loginRules: { loginRules: {
username: [{ required: true, message: "请输入账号", trigger: "blur" }], username: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }], password: [{ required: true, message: "请输入密码", trigger: "blur" }],
captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }] captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }]
}, },
verificationIMG: "", verificationIMG: "",
phoneVisible: false, // phoneVisible: false, //
phone: "", phone: "",
phoneCode: "", phoneCode: "",
phoneDisabled: false, phoneDisabled: false,
phoneTimer: null, phoneTimer: null,
phoneBtnText: "发送验证码" phoneBtnText: "发送验证码"
}; };
}, },
components: { components: {
vFooter vFooter
}, },
created() { created() {
this.getVerImg(); this.getVerImg();

@ -29,8 +29,15 @@
</div> </div>
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入文章名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-select v-model="field" @change="initData">
<el-button type="primary" @click="initData">查询</el-button> <el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" placeholder="请输入文章名称" v-model.trim="keyword" clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button @click="batchDel">删除</el-button> <el-button @click="batchDel">删除</el-button>
@ -38,7 +45,7 @@
</div> </div>
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id"> <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="selection" width="50" align="center" :reserve-selection="true" :selectable="row => !row.quote"></el-table-column>
<el-table-column type="index" width="60" label="ID"></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="site" label="站点名称" min-width="180"></el-table-column>
<el-table-column prop="type" label="文件类型" min-width="100"></el-table-column> <el-table-column prop="type" label="文件类型" min-width="100"></el-table-column>
@ -58,7 +65,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="170"> <el-table-column label="操作" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" :disabled="scope.row.quote" @click="del(scope.row)">删除</el-button> <el-button type="text" :disabled="scope.row.quote !== ''" @click="del(scope.row)">删除</el-button>
<el-button type="text" @click="download(scope.row, 'edit')">下载</el-button> <el-button type="text" @click="download(scope.row, 'edit')">下载</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -90,6 +97,21 @@ export default {
name: '文档' name: '文档'
} }
], ],
field: 'fileName',
keywords: [
{
id: 'fileName',
name: '文件名称'
},
{
id: 'uploader',
name: '上传人'
},
{
id: 'quote',
name: '文章名称'
}
],
keyword: '', keyword: '',
form: { form: {
site: '', site: '',
@ -102,6 +124,14 @@ export default {
multipleSelection: [], multipleSelection: [],
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -116,7 +146,9 @@ export default {
this.$post(this.api.listByPage, { this.$post(this.api.listByPage, {
page: this.page, page: this.page,
limit: this.pageSize, limit: this.pageSize,
quote: this.keyword, quote: this.field === 'quote' ? this.keyword : '',
fileName: this.field === 'fileName' ? this.keyword : '',
uploader: this.field === 'uploader' ? this.keyword : '',
site: form.site, site: form.site,
type: form.type === '不限' ? '' : form.type type: form.type === '不限' ? '' : form.type
}).then(({ data }) => { }).then(({ data }) => {
@ -174,20 +206,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <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> </style>

@ -60,58 +60,54 @@
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<div class="item-line"> <el-form-item prop="titleImg" label="封面图">
<el-form-item prop="titleImg" label="标题图"> <el-upload
<el-upload class="avatar-uploader"
class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif"
accept=".jpg,.png,.jpeg,.gif" :before-upload="beforeUpload"
:before-upload="beforeUpload" :on-error="uploadError"
:on-remove="handleRemove" :on-success="uploadSuccess"
:on-error="uploadError" :limit="1"
:on-success="uploadSuccess" :on-exceed="handleExceed"
:limit="1" :show-file-list="false"
:on-exceed="handleExceed" :action="this.api.upload"
:show-file-list="false" :data="{
:action="this.api.upload" quote: form.title,
:data="{ site: '粒子研究院中文站点',
quote: form.title, uploader: userName
site: '粒子研究院中文站点', }"
uploader: userName >
}" <img v-if="form.titleImg" :src="form.titleImg" class="avatar">
> <div class="uploader-default" v-else>
<img v-if="form.titleImg" :src="form.titleImg" class="avatar"> <img class="plus" src="@/assets/img/plus.png" alt="">
<div class="uploader-default" v-else> <p>点击上传</p>
<img class="plus" src="@/assets/img/plus.png" alt=""> </div>
<p>点击上传</p> </el-upload>
</div> </el-form-item>
</el-upload> <el-form-item prop="bannerImg" label="Banner图" style="flex: 1;">
</el-form-item> <el-upload
<el-form-item prop="bannerImg" label="banner图" style="flex: 1;"> class="avatar-uploader avatar-uploader-lg"
<el-upload accept=".jpg,.png,.jpeg,.gif"
class="avatar-uploader avatar-uploader-lg" :before-upload="beforeUpload"
accept=".jpg,.png,.jpeg,.gif" :on-error="uploadError"
:before-upload="beforeUpload" :on-success="uploadSuccessBanner"
:on-remove="handleRemove" :limit="1"
:on-error="uploadError" :on-exceed="handleExceed"
:on-success="uploadSuccessBanner" :show-file-list="false"
:limit="1" :action="this.api.upload"
:on-exceed="handleExceed" :data="{
:show-file-list="false" quote: form.title,
:action="this.api.upload" site: '粒子研究院中文站点',
:data="{ uploader: userName
quote: form.title, }"
site: '粒子研究院中文站点', >
uploader: userName <img v-if="form.bannerImg" :src="form.bannerImg" class="avatar">
}" <div class="uploader-default" v-else>
> <img class="plus" src="@/assets/img/plus.png" alt="">
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar"> <p>点击上传</p>
<div class="uploader-default" v-else> </div>
<img class="plus" src="@/assets/img/plus.png" alt=""> </el-upload>
<p>点击上传</p> </el-form-item>
</div>
</el-upload>
</el-form-item>
</div>
<el-form-item class="lg" prop="articleTemplate" label="独立文章模板"> <el-form-item class="lg" prop="articleTemplate" label="独立文章模板">
<el-tooltip effect="dark" content="支持导入其它数据用于实验,总上传的文件大小不可以超过10M" placement="bottom"> <el-tooltip effect="dark" content="支持导入其它数据用于实验,总上传的文件大小不可以超过10M" placement="bottom">
<img class="info" src="@/assets/img/ques.png" alt=""> <img class="info" src="@/assets/img/ques.png" alt="">
@ -227,7 +223,7 @@ import VueUeditorWrap from 'vue-ueditor-wrap'
export default { export default {
data() { data() {
return { return {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
headers: {}, headers: {},
nameRepeat: false, nameRepeat: false,
types: ColumnConst.types, types: ColumnConst.types,
@ -241,7 +237,7 @@ export default {
}, },
links: [], links: [],
form: { form: {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
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,
@ -263,21 +259,22 @@ export default {
}, },
rules: { rules: {
title: [ title: [
{ required: true } { required: true, message: '请输入标题', trigger: 'blur' }
], ],
columnId: [ columnId: [
{ required: true } { required: true, message: '请选择所属栏目', trigger: 'change' }
], ],
releaseTime: [ releaseTime: [
{ required: true } { required: true, message: '请选择发布日期', trigger: 'change' }
], ],
mainBody: [ mainBody: [
{ required: true } { required: true, message: '请输入正文', trigger: 'blur' }
], ],
}, },
editorConfig: { editorConfig: {
UEDITOR_HOME_URL: '/UEditor/', UEDITOR_HOME_URL: '/UEditor/',
serverUrl: 'http://192.168.31.137:10000/iasf/sysFiles/upload' // initialFrameHeight: 200,
serverUrl: 'http://192.168.31.137:10000/iasf/sysFiles/upload/' //
}, },
submiting: false, // submiting: false, //
updateTime: 0 updateTime: 0
@ -395,7 +392,7 @@ export default {
this.form.columnBanner = '' this.form.columnBanner = ''
}, },
uploadSuccess(res) { uploadSuccess(res) {
this.form.columnBanner = res.data.url this.form.titleImg = res.data.url
}, },
uploadSuccessBanner(res) { uploadSuccessBanner(res) {
this.form.bannerImg = res.data.url this.form.bannerImg = res.data.url
@ -413,7 +410,7 @@ export default {
const { form } = this const { form } = this
if (!form.title) return util.errorMsg('请填写标题') if (!form.title) return util.errorMsg('请填写标题')
if (this.nameRepeat) return util.errorMsg('该标题已重复!') if (this.nameRepeat) return util.errorMsg('该标题已重复!')
if (!form.releaseTime) return util.errorMsg('请选择发布日期') if (!form.releaseTime && isRelease) return util.errorMsg('请选择发布日期')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1] if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
if (form.articleTemplate === 3 && form.connectionType !== 2) { if (form.articleTemplate === 3 && form.connectionType !== 2) {
const { links } = this const { links } = this
@ -421,7 +418,6 @@ 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.isRelease = isRelease form.isRelease = isRelease
this.submiting = true this.submiting = true
if (form.id) { if (form.id) {

@ -1,16 +1,23 @@
<template> <template>
<div class="flex page"> <div class="flex page">
<div style="width: 218px"> <div style="width: 218px;border-right: 1px solid #EBEDF0">
<p class="page-name mb">全部栏目</p> <p class="page-name mb">全部栏目</p>
<div style="height: 504px;overflow: auto"> <div style="height: 504px;overflow: auto">
<el-tree ref="column" :data="columns" :props="defaultProps" node-key="id" @node-click="getData"></el-tree> <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> </div>
<div class="flex-1"> <div class="flex-1 p-l-20">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入文章标题" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <!-- <el-select v-model="field" @change="initData">
<el-button type="primary" @click="initData">查询</el-button> <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>
</div> </div>
<div class="actions"> <div class="actions">
<el-dropdown class="setting" trigger="click" :hide-on-click="false"> <el-dropdown class="setting" trigger="click" :hide-on-click="false">
@ -35,13 +42,17 @@
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column v-if="settings[1].show" prop="title" label="标题" align="center" min-width="100"></el-table-column> <el-table-column v-if="settings[1].show" prop="title" label="标题" align="center" min-width="100"></el-table-column>
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="100"></el-table-column> <el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="100"></el-table-column>
<el-table-column v-if="settings[3].show" prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column> <el-table-column v-if="settings[3].show" prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[4].show" prop="workNumber" label="状态" align="center" min-width="100"> <el-table-column v-if="settings[4].show" prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[5].show" prop="updateTime" label="修改日期" align="center" min-width="110"></el-table-column>
<el-table-column v-if="settings[6].show" prop="releaseTime" label="发布日期" align="center" min-width="110"></el-table-column>
<el-table-column v-if="settings[7].show" prop="totalBrowsing" label="总浏览" align="center" min-width="80"></el-table-column>
<el-table-column v-if="settings[8].show" prop="workNumber" label="状态" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[5].show" label="操作" align="center" width="300"> <el-table-column v-if="settings[9].show" label="操作" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth type="text" @click="resetPassword(scope.row)">预览</el-button> <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="edit(scope.row)">编辑</el-button>
@ -66,6 +77,25 @@ export default {
value: 'id', value: 'id',
label: 'columnName' label: 'columnName'
}, },
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founderName',
name: '录入人'
},
{
id: 'columnName',
name: '栏目'
},
{
id: 'editorName',
name: '修改人'
}
],
keyword: '', keyword: '',
list: [], list: [],
page: 1, page: 1,
@ -86,10 +116,26 @@ export default {
name: '栏目', name: '栏目',
show: true show: true
}, },
{
name: '录入人',
show: false
},
{
name: '修改人',
show: false
},
{
name: '修改日期',
show: false
},
{ {
name: '发布日期', name: '发布日期',
show: true show: true
}, },
{
name: '总浏览',
show: false
},
{ {
name: '状态', name: '状态',
show: true show: true
@ -101,6 +147,14 @@ export default {
] ]
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -121,7 +175,7 @@ export default {
// //
getColumn() { getColumn() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
@ -136,7 +190,7 @@ export default {
// //
getData() { getData() {
this.$post(this.api.queryArticle, { this.$post(this.api.queryArticle, {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
columnIds: [this.$refs.column.getCurrentKey()], columnIds: [this.$refs.column.getCurrentKey()],
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,

@ -1,7 +1,7 @@
<template> <template>
<div class="page"> <div class="page">
<p class="page-name mb">新增栏目</p> <p class="page-name mb">新增栏目</p>
<el-form class="input-form model" label-width="120px"> <el-form :model="form" :rules="rules" class="input-form model" label-width="120px">
<div class="item-line"> <div class="item-line">
<el-form-item prop="columnName" label="栏目名称"> <el-form-item prop="columnName" label="栏目名称">
<el-input <el-input
@ -218,9 +218,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
<el-button type="primary" @click="submit(1)">发布</el-button> <el-button type="primary" @click="submit">确定</el-button>
<el-button @click="preview">预览</el-button>
<el-button v-if="!isEdit" @click="submit(0)">保存草稿</el-button>
<el-button @click="$router.back()">取消</el-button> <el-button @click="$router.back()">取消</el-button>
</div> </div>
</div> </div>
@ -232,7 +230,7 @@ import { mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
isEdit: this.$route.query.type === 'edit', isEdit: this.$route.query.type === 'edit',
nameRepeat: false, nameRepeat: false,
types: ColumnConst.types, types: ColumnConst.types,
@ -246,7 +244,7 @@ export default {
}, },
links: [], links: [],
form: { form: {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
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,
@ -268,6 +266,29 @@ export default {
sort: 1, sort: 1,
isOpen: 1 isOpen: 1
}, },
rules: {
columnName: [
{ required: true, message: '请输入栏目名称', trigger: 'blur' }
],
typeId: [
{ required: true, message: '请选择栏目类型', trigger: 'change' }
],
pageSize: [
{ required: true, message: '请输入分页条数', trigger: 'blur' }
],
templateId: [
{ required: true, message: '请输入栏目名称', trigger: 'blur' }
],
listStyleId: [
{ required: true, message: '请选择栏目模板', trigger: 'change' }
],
detailStyle: [
{ required: true, message: '请选择详情样式', trigger: 'change' }
],
connectionType: [
{ required: true, message: '请选择连接类型', trigger: 'blur' }
],
},
submiting: false, // submiting: false, //
updateTime: 0 updateTime: 0
}; };
@ -384,7 +405,7 @@ export default {
}, },
// //
submit(status) { submit() {
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('请填写栏目名称')
@ -397,7 +418,6 @@ 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()
} }
form.status = status
this.submiting = true this.submiting = true
if (this.isEdit) { if (this.isEdit) {
delete form.children delete form.children
@ -506,4 +526,7 @@ $upload-lg-height: 102px;
border-radius: 2px; border-radius: 2px;
} }
} }
/deep/.input-form .auto .el-input {
width: 119px;
}
</style> </style>

@ -2,8 +2,7 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入栏目名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-input placeholder="请输入栏目名称" v-model.trim="keyword" clearable></el-input>
<el-button type="primary" @click="initData">查询</el-button>
</div> </div>
<div class="actions"> <div class="actions">
<el-dropdown class="setting" trigger="click" :hide-on-click="false"> <el-dropdown class="setting" trigger="click" :hide-on-click="false">
@ -26,27 +25,28 @@
</div> </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 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-column v-if="settings[0].show" type="selection" width="50" :reserve-selection="true"></el-table-column>
<el-table-column prop="columnName" label="名称"></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="栏目类型"> <el-table-column v-if="settings[1].show" prop="typeId" label="栏目类型" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }} {{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[2].show" prop="templateId" label="栏目模板"></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="列表/长页样式"></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="详情样式"></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[5].show" prop="menuVisible" label="导航菜单"> <el-table-column v-if="settings[5].show" prop="menuVisible" label="导航菜单" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.menuVisible" v-model="scope.row.menuVisible"
:active-value="0" :active-value="0"
:inactive-value="1"> :inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[6].show" prop="id" label="ID"></el-table-column> <el-table-column v-if="settings[6].show" prop="id" label="ID" min-width="80"></el-table-column>
<el-table-column v-if="settings[7].show" label="操作" width="170"> <el-table-column v-if="settings[7].show" label="操作" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row, 'add')">新增下级</el-button> <el-button type="text" @click="edit(scope.row, 'add')">新增下级</el-button>
@ -118,7 +118,7 @@ export default {
} }
], ],
form: { form: {
typeId: 1
}, },
originSettings: [], originSettings: [],
settings: [ settings: [
@ -157,6 +157,14 @@ export default {
] ]
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -176,7 +184,7 @@ export default {
methods: { methods: {
getData() { getData() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
columnName: this.keyword, columnName: this.keyword,
templateId: '', templateId: '',
typeId : '', typeId : '',
@ -212,6 +220,10 @@ export default {
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}, },
//
switchOff(val, row) {
this.$post(this.api.updateColumn, row).then(res => {}).catch((res) => {})
},
// //
batchDel() { batchDel() {
const list = this.multipleSelection const list = this.multipleSelection

@ -1,7 +1,7 @@
<template> <template>
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<p class="page-name">长页栏目列表</p> <p class="page-name">企业网站管理后台</p>
<div style="display: inline-flex;align-items: center;"> <div style="display: inline-flex;align-items: center;">
<el-dropdown class="setting" trigger="click" :hide-on-click="false"> <el-dropdown class="setting" trigger="click" :hide-on-click="false">
<el-tooltip placement="top"> <el-tooltip placement="top">
@ -17,8 +17,15 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入栏目或模板名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-select v-model="field" @change="initData">
<el-button type="primary" @click="initData">查询</el-button> <el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" placeholder="请输入栏目或模板名称" v-model.trim="keyword" clearable></el-input>
</div> </div>
</div> </div>
</div> </div>
@ -57,6 +64,17 @@
export default { export default {
data() { data() {
return { return {
field: 'programName',
keywords: [
{
id: 'programName',
name: '栏目名称'
},
{
id: 'templateName',
name: '模板名称'
}
],
keyword: '', keyword: '',
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
@ -95,6 +113,14 @@ export default {
] ]
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -115,10 +141,11 @@ export default {
// //
getData() { getData() {
this.$post(this.api.longPageColumnList, { this.$post(this.api.longPageColumnList, {
siteId: this.$store.state.content.siteId, siteId: this.$store.state.content.site.id,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
title: this.keyword programName: this.field === 'programName' ? this.keyword : '',
templateName: this.field === 'templateName' ? this.keyword : ''
}).then(({ data }) => { }).then(({ data }) => {
const list = data.records const list = data.records
list.map(e => { list.map(e => {
@ -144,10 +171,10 @@ export default {
this.getData() this.getData()
}, },
add() { add() {
this.$router.push("add"); this.$router.push('add')
}, },
edit(row) { edit(row) {
this.$router.push(`add?id=${row.id}`); this.$router.push(`add?id=${row.id}`)
} }
} }
}; };

@ -2,8 +2,7 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入角色名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-input placeholder="请输入角色名称" v-model.trim="keyword" clearable></el-input>
<el-button type="primary" @click="initData">查询</el-button>
</div> </div>
<div class="actions"> <div class="actions">
<el-button type="primary" @click="addRole">新增</el-button> <el-button type="primary" @click="addRole">新增</el-button>
@ -88,6 +87,14 @@ export default {
roleNameReapeat: false // roleNameReapeat: false //
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -166,22 +173,19 @@ export default {
}, },
// //
getPer(row) { getPer(row) {
if (!this.permissions.length) { if (!this.permissions.length) {
this.$get(this.api.perTree).then(({ data }) => { this.$get(this.api.perTree).then(({ data }) => {
this.permissions = data[0].children this.permissions = data
if (row) { row && this.getDetail(row)
this.getDetail(row); }).catch(res => {})
} }
}).catch(res => {
});
}
}, },
addRole() { addRole() {
this.isAdd = true; this.isAdd = true
this.getPer(); this.getPer()
this.checkedIds = []; this.checkedIds = []
this.permissions.length && this.$refs.per.setCheckedNodes([]); this.permissions.length && this.$refs.per.setCheckedNodes([])
this.roleVisible = true; this.roleVisible = true
}, },
// //
async getDetail(row) { async getDetail(row) {
@ -190,42 +194,45 @@ export default {
this.form.name = role.name this.form.name = role.name
this.form.description = role.description this.form.description = role.description
this.form.id = role.id this.form.id = role.id
this.$refs.per.setCheckedKeys(data.permissionList) const list = data.permissionList
list[0] === '1' && list.shift() // 11
this.$refs.per.setCheckedKeys(list)
}).catch(err => {}) }).catch(err => {})
}, },
showRole(row) { showRole(row) {
this.isDetail = true; this.isDetail = true
this.isAdd = false; this.isAdd = false
this.getPer(row); this.getPer(row)
this.roleVisible = true; this.roleVisible = true
}, },
editRole(row) { editRole(row) {
this.isAdd = false; this.isAdd = false
this.getPer(row); this.getPer(row)
this.roleVisible = true; this.roleVisible = true
}, },
async saveData() { async saveData() {
const { form } = this const { form } = this
if (!form.name) return util.warningMsg("请填写角色名称"); if (!form.name) return util.warningMsg("请填写角色名称")
if (!form.description) return util.warningMsg("请填写角色描述"); if (!form.description) return util.warningMsg("请填写角色描述")
const checked = this.$refs.per.getCheckedKeys() const checked = this.$refs.per.getCheckedKeys()
if (!checked.length) return util.warningMsg("请选择角色权限"); if (!checked.length) return util.warningMsg("请选择角色权限")
checked[0] !== '1' && checked.unshift('1')
let data = { let data = {
...form, ...form,
permissions: checked permissions: checked
}; }
if (form.id) { if (form.id) {
this.$put(this.api.role, data).then(res => { this.$put(this.api.role, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功")
this.getData(); this.getData()
this.roleVisible = false; this.roleVisible = false
}).catch(res => {}); }).catch(res => {})
} else { } else {
this.$post(this.api.role, data).then(res => { this.$post(this.api.role, data).then(res => {
util.successMsg("新增成功"); util.successMsg("新增成功")
this.getData(); this.getData()
this.roleVisible = false; this.roleVisible = false
}).catch(res => {}); }).catch(res => {})
} }
} }
} }

@ -2,7 +2,7 @@
<div> <div>
<div class="scroll" v-loading="loading"> <div class="scroll" v-loading="loading">
<div class="page"> <div class="page">
<h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 用户信息</h6> <!-- <h6 class="l-title"><img src="@/assets/img/info1.png" alt=""> 用户信息</h6> -->
<div class="page-content"> <div class="page-content">
<ul class="list"> <ul class="list">
<div class="line info"> <div class="line info">
@ -83,7 +83,7 @@
</ul> </ul>
</div> </div>
<div class="arc-action flex j-between a-center"> <div class="arc-action flex j-between a-center">
<h6 class="l-title"><img src="@/assets/img/info2.png" alt=""> 个人档案</h6> <!-- <h6 class="l-title"><img src="@/assets/img/info2.png" alt=""> 个人档案</h6> -->
<el-button type="text" icon="el-icon-plus" style="margin-left: 16px" @click="addArch">新增</el-button> <el-button type="text" icon="el-icon-plus" style="margin-left: 16px" @click="addArch">新增</el-button>
</div> </div>
<div class="page-content"> <div class="page-content">
@ -132,7 +132,7 @@
</li> </li>
</div> </div>
</ul> </ul>
<img class="del" src="@/assets/img/trash.png" alt="" v-if="index" @click="delArchive(index)"> <!-- <img class="del" src="@/assets/img/trash.png" alt="" v-if="index" @click="delArchive(index)"> -->
</div> </div>
<div class="fold" v-if="archivesList.length > 1"> <div class="fold" v-if="archivesList.length > 1">
<span :class="{active: showArch}" @click="showArch = !showArch"> <span :class="{active: showArch}" @click="showArch = !showArch">
@ -143,7 +143,7 @@
</div> </div>
</div> </div>
<div class="page"> <div class="page">
<h6 class="l-title"><img src="@/assets/img/info3.png" alt=""> 账号信息</h6> <!-- <h6 class="l-title"><img src="@/assets/img/info3.png" alt=""> 账号信息</h6> -->
<div class="page-content"> <div class="page-content">
<ul class="list"> <ul class="list">
<div class="line info imp"> <div class="line info imp">

@ -4,7 +4,6 @@
<p class="page-name">站点列表</p> <p class="page-name">站点列表</p>
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="getData"></el-input> <el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="getData"></el-input>
<el-button type="primary" @click="getData">查询</el-button>
</div> </div>
</div> </div>
@ -42,6 +41,14 @@ export default {
list: ColumnConst.sites list: ColumnConst.sites
}; };
}, },
// watch: {
// keyword: function(val) {
// clearTimeout(this.searchTimer)
// this.searchTimer = setTimeout(() => {
// this.initData()
// }, 500)
// }
// },
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {
@ -51,7 +58,7 @@ export default {
}, },
methods: { methods: {
...mapMutations('content', [ ...mapMutations('content', [
'setSiteId' 'setSite'
]), ]),
getData() { getData() {
@ -65,7 +72,7 @@ export default {
}, },
// //
content(row) { content(row) {
this.setSiteId(row.id) this.setSite(row)
this.$router.push(`/page`) this.$router.push(`/page`)
}, },
} }

@ -3,7 +3,7 @@
<div class="page" style="width: 320px"> <div class="page" style="width: 320px">
<div class="m-b-20"> <div class="m-b-20">
<p class="page-name mb">后台员工账号</p> <p class="page-name mb">后台员工账号</p>
<el-radio-group v-model="studentType" @change="changeType"> <el-radio-group v-model="staffType" @change="changeType">
<div class="m-b-20"> <div class="m-b-20">
<el-radio :label="1">所有员工</el-radio> <el-radio :label="1">所有员工</el-radio>
</div> </div>
@ -20,7 +20,7 @@
</div> </div>
<div style="height: 504px;overflow: auto"> <div style="height: 504px;overflow: auto">
<el-tree class="org" ref="orgs" :data="orgs" :props="defaultProps" default-expand-all node-key="id" @node-click="handleNodeClick"> <el-tree class="org" ref="orgs" :data="orgs" :props="defaultProps" highlight-current :expand-on-click-node="false" default-expand-all node-key="id" @node-click="handleNodeClick">
<span class="node-wrap" slot-scope="{ node, data }"> <span class="node-wrap" slot-scope="{ node, data }">
<div class="left"> <div class="left">
<img src="@/assets/img/node.png" alt=""> <img src="@/assets/img/node.png" alt="">
@ -76,8 +76,7 @@
<div class="page list-wrap"> <div class="page list-wrap">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入员工姓名" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-input placeholder="请输入员工姓名/账号" v-model.trim="keyword" clearable></el-input>
<el-button type="primary" @click="initData">查询</el-button>
</div> </div>
<div class="actions"> <div class="actions">
<el-dropdown class="setting" trigger="click" :hide-on-click="false"> <el-dropdown class="setting" trigger="click" :hide-on-click="false">
@ -123,7 +122,7 @@
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div> </div>
<el-dialog :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '员工'" :visible.sync="staffVisible" width="500px" class="dialog" :close-on-click-modal="false" @close="closeStaff"> <el-dialog :title="isDetail ? '查看' : (form.id ? '编辑' : '新增') + '员工'" :visible.sync="staffVisible" width="500px" class="dialog" :close-on-click-modal="false" @close="closeStaff">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="isDetail" style='margin-right: 60px;'> <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="isDetail" style='margin-right: 60px;'>
<el-form-item prop="jobNumber" label="工号"> <el-form-item prop="jobNumber" label="工号">
<el-input v-model.trim="form.jobNumber" placeholder="请输入工号"></el-input> <el-input v-model.trim="form.jobNumber" placeholder="请输入工号"></el-input>
@ -139,7 +138,7 @@
<template v-for="item in roleIds"> <template v-for="item in roleIds">
<!-- 不显示超管 --> <!-- 不显示超管 -->
<el-option <el-option
v-if="item.roleName !== '超级管理员'" v-if="item.name !== '超级管理员'"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
@ -242,39 +241,13 @@ export default {
} }
} }
} }
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){
// this.phoneChange()
callback()
}else{
callback(new Error('请输入正确手机号格式'))
}
} else {
callback()
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){
// this.emailChange()
callback()
}else{
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return { return {
orgs: [], orgs: [],
defaultProps: { defaultProps: {
label: 'name' label: 'name'
}, },
orgListDia: [], orgListDia: [],
studentType: 1, //:(1. 2.) staffType: 1, //:(1. 2.)
orgVisible: false, // orgVisible: false, //
orgForm: { orgForm: {
id: '', id: '',
@ -291,6 +264,7 @@ export default {
treeResolve: [], treeResolve: [],
isDetail: false, isDetail: false,
keyword: '', keyword: '',
searchTimer: null,
originSettings: [], originSettings: [],
settings: [ settings: [
{ {
@ -343,7 +317,7 @@ export default {
phone: '', phone: '',
jobNumber: '', jobNumber: '',
email: '', email: '',
groupId: '', groupId: 1,
roleIds: [], roleIds: [],
deptArchitectureId: [] deptArchitectureId: []
}, },
@ -365,11 +339,8 @@ export default {
roleIds: [ roleIds: [
{ required: true, message: "请选择授权角色", trigger: "change" } { required: true, message: "请选择授权角色", trigger: "change" }
], ],
phone: [ groupId: [
{ validator: phonePass, trigger: 'blur' } { required: true, message: "请选择用户组", trigger: "change" }
],
email: [
{ validator: emailPass, trigger: 'blur' }
] ]
}, },
list: [], list: [],
@ -392,6 +363,7 @@ export default {
value: 'id', value: 'id',
isLeaf: 'leaf' isLeaf: 'leaf'
}, },
archId: [],
importVisible: false, importVisible: false,
uploadList: [], uploadList: [],
@ -420,9 +392,15 @@ export default {
this.originForm = JSON.parse(JSON.stringify(this.form)) this.originForm = JSON.parse(JSON.stringify(this.form))
}, },
watch: { watch: {
filterText(val) { keyword: function(val) {
this.$refs.classTree.filter(val); clearTimeout(this.searchTimer)
} this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
},
filterText(val) {
this.$refs.classTree.filter(val);
}
}, },
methods: { methods: {
// //
@ -533,7 +511,7 @@ export default {
// //
handleNodeClick(data) { handleNodeClick(data) {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.studentType = null this.staffType = null
this.getStaff() this.getStaff()
}, },
// //
@ -549,7 +527,7 @@ export default {
// //
getStaff() { getStaff() {
this.$post(this.api.users, { this.$post(this.api.users, {
type: this.studentType || 1, type: this.staffType || 1,
deptArchitectureId: this.$refs.orgs.getCurrentKey() || '', deptArchitectureId: this.$refs.orgs.getCurrentKey() || '',
keyWord: this.keyword, keyWord: this.keyword,
pageNum: this.page, pageNum: this.page,
@ -602,7 +580,7 @@ export default {
}, },
// //
resetPassword(row) { resetPassword(row) {
this.$confirm(`确定重置密码?`, "提示", { type: "warning" }).then(() => { this.$confirm(`确定重置密码?重置后密码为111aaa。`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPwd}?userId=${row.id}`).then(res => { this.$get(`${this.api.resetPwd}?userId=${row.id}`).then(res => {
util.successMsg("重置成功") util.successMsg("重置成功")
}).catch(res => {}) }).catch(res => {})
@ -610,36 +588,40 @@ export default {
}, },
// //
addStaff() { addStaff() {
if (!this.staffType) {
this.archId = []
this.handleArchId(this.orgs, [this.$refs.orgs.getCurrentKey()])
this.form.deptArchitectureId = this.archId
}
this.staffVisible = true this.staffVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
}) })
}, },
// id
handleArchId(list, ids, pid = []) {
list.map(e => {
// id[[1, 2], [3, 4]]idid
if (ids.includes(e.id)) {
this.archId.push([...pid, e.id])
} else {
e.children && this.handleArchId(e.children, ids, [...pid, e.id])
}
})
},
// / // /
queryStaff(row, isDetail) { queryStaff(row, isDetail) {
const archId = []
// id
const handleArchId = (list, ids, pid = []) => {
list.map(e => {
// id[[1, 2], [3, 4]]idid
if (ids.includes(e.id)) {
archId.push([...pid, e.id])
} else {
e.children && handleArchId(e.children, ids, [...pid, e.id])
}
})
}
this.isDetail = isDetail this.isDetail = isDetail
this.staffVisible = true this.staffVisible = true
this.$get(`${this.api.user}/${row.id}`).then(({ data }) => { this.$get(`${this.api.user}/${row.id}`).then(({ data }) => {
const { deptArchitectureId, roleId } = data const { deptArchitectureId, roleId } = data
if (roleId) { if (roleId) {
const roleIds = roleId.split(',') const ids = roleId.split(',')
const list = this.roleIds const list = this.roleIds
if (roleIds.length) { if (ids.length) {
let has = false // let has = false //
for (const i in roleIds) { for (const i in ids) {
if (list.find(n => n.id === roleIds[i])) { if (list.find(n => n.id === ids[i])) {
has = true has = true
break break
} }
@ -648,14 +630,16 @@ export default {
util.warningMsg('角色被删请重新选择') util.warningMsg('角色被删请重新选择')
data.roleIds = [] data.roleIds = []
} else { } else {
data.roleIds = roleIds data.roleIds = ids
} }
} }
} }
if (deptArchitectureId) { if (deptArchitectureId) {
handleArchId(this.orgs, deptArchitectureId.split(',')) this.archId = []
data.deptArchitectureId = archId this.handleArchId(this.orgs, deptArchitectureId.split(','))
data.deptArchitectureId = this.archId
} }
data.groupId = +data.groupId
this.form = data this.form = data
this.originAccount = data.username this.originAccount = data.username
this.originWorkNumber = data.jobNumber this.originWorkNumber = data.jobNumber
@ -705,32 +689,6 @@ export default {
}) })
} }
}, },
//
phoneChange() {
const form = this.form
const { phone } = form
if (phone) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?phone=${phone}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.phoneRepeat = false
}).catch(err => {
this.phoneRepeat = true
})
}
},
//
emailChange() {
const form = this.form
const { email } = form
if (email) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?email=${email}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.emailRepeat = false
}).catch(err => {
this.emailRepeat = true
})
}
},
// / // /
submitStaff() { submitStaff() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
@ -775,7 +733,7 @@ export default {
// //
closeStaff() { closeStaff() {
this.form = { this.form = {
accountId: '', id: '',
realName: '', realName: '',
username: '', username: '',
phone: '', phone: '',
@ -836,7 +794,7 @@ export default {
}, },
uploadSure() { uploadSure() {
this.importVisible = false this.importVisible = false
this.studentType = 1 this.staffType = 1
this.keyword = '' this.keyword = ''
this.$refs.orgs.setCurrentKey(null) this.$refs.orgs.setCurrentKey(null)
this.getOrg() this.getOrg()

@ -2,8 +2,7 @@
<div class="page"> <div class="page">
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-input placeholder="请输入用户组名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> <el-input placeholder="请输入用户组名称" v-model.trim="keyword" clearable></el-input>
<el-button type="primary" @click="initData">查询</el-button>
</div> </div>
<div class="actions"> <div class="actions">
<el-button type="primary" @click="add" >新增</el-button> <el-button type="primary" @click="add" >新增</el-button>
@ -31,7 +30,7 @@
<el-form-item prop="groupName" label="名称"> <el-form-item prop="groupName" label="名称">
<el-input v-model="form.groupName" placeholder="请输入名称"></el-input> <el-input v-model="form.groupName" placeholder="请输入名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述"> <el-form-item prop="description" label="描述">
<el-input v-model="form.description" placeholder="请输入描述" type="textarea" rows="5"></el-input> <el-input v-model="form.description" placeholder="请输入描述" type="textarea" rows="5"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -62,11 +61,22 @@ export default {
rules: { rules: {
groupName: [ groupName: [
{ required: true, message: "请输入名称", trigger: "blur" } { required: true, message: "请输入名称", trigger: "blur" }
],
description: [
{ required: true, message: "请输入描述", trigger: "blur" }
] ]
}, },
formVisible: false formVisible: false
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() { mounted() {
this.$store.commit('user/SET_CRUMBS', [ this.$store.commit('user/SET_CRUMBS', [
{ {

@ -13,11 +13,11 @@ export default {
meta, meta,
component: BasicLayout, component: BasicLayout,
children: [ children: [
// { {
// name: `${pre}person`, name: `${pre}person`,
// path: `person`, path: `person`,
// component: () => import("@/pages/setting/list"), component: () => import("@/pages/setting/list"),
// meta: { title: "个人中心" } meta: { title: "个人中心" }
// } }
] ]
}; };

@ -1,14 +1,14 @@
import router from "./index"; import router from './index'
import Setting from "@/setting"; import Setting from '@/setting'
import util from "@/libs/util"; import util from '@/libs/util'
const whiteList = Setting.whiteList // 白名单 const whiteList = Setting.whiteList // 白名单
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix; document.title = Setting.titleSuffix
const role = util.local.get(Setting.tokenKey); const role = util.local.get(Setting.tokenKey)
if (!role && !whiteList.includes(to.path)) { if (!role && !whiteList.includes(to.path)) {
next('/login') next('/login')
} else { } else {
next() next()
} }
}); });

@ -3,47 +3,29 @@
* */ * */
const url = location.host; const url = location.host;
const isDev = process.env.NODE_ENV === "development"; // 开发环境 const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isPro = url.includes("occupationlab.com"); //是否职站生产 const isPro = url.includes("occupationlab.com"); //是否生产
const isTest = url.includes('121.37.12.51'); //是否中台测试服
let bankPath = `${location.origin}/banksystem` // 银行系统地址
let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}/` let host = `${location.origin}/`
let uploadURL = `http://121.37.12.51/` if (isDev) {
// host = 'http://121.37.12.51/' // 中台测试服
if (isPro) { // host = 'http://192.168.31.151:10000/' // 榕
// 职站生产 host = 'http://192.168.31.137:10000/' // 赓
uploadURL = `https://www.huorantech.cn/`
bankPath = `https://www.huorantech.cn/banksystem`
jumpPath = `https://www.huorantech.cn/judgmentPoint/`
} else if (isDev) {
jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093`
host = "http://121.37.12.51/"; // 中台测试服
// host = "http://192.168.31.151:10000/"; // 榕
host = 'http://192.168.31.137:10000/'; // 赓
} }
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
platformId: 1, // 平台标识,1职站,2数据平台,3中台
platformType: 0, // 平台端区分:0->教师端 1->学生端 2->无端
titleSuffix: '粒子研究院', // 网页标题的后缀 titleSuffix: '粒子研究院', // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
jumpPath, // 判分点系统前缀
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
cookiesExpires: 1, // Cookies 默认保存时间,单位:天 cookiesExpires: 1, // Cookies 默认保存时间,单位:天
tokenExpires: 1296000000, // token在localStorage的时间(毫秒) tokenExpires: 1296000000, // token在localStorage的时间(毫秒)
bankPath,
isDev, isDev,
isTest,
isPro, isPro,
/** /**
* 路由白名单 * 路由白名单
@ -52,11 +34,11 @@ const Setting = {
/** /**
* localStorage里保存的token的key * localStorage里保存的token的key
*/ */
tokenKey: "oc_server_token", tokenKey: "IASF_server_token",
/** /**
* localStorage里保存的vuex的key * localStorage里保存的vuex的key
*/ */
storeKey: "oc_server_store", storeKey: "IASF_server_store",
/** /**
* 默认密码 * 默认密码
*/ */
@ -65,10 +47,10 @@ const Setting = {
* 多语言配置 * 多语言配置
* */ * */
i18n: { i18n: {
// 默认语言 // 默认语言
default: "zh", default: "zh",
// 是否根据用户电脑配置自动设置语言(仅第一次有效) // 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false auto: false
}, },
/** /**
* 布局配置 * 布局配置
@ -80,12 +62,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新 // 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false, sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮) // 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false, dynamicRoute: false
// 文件上传
upload: {
apiURL: uploadURL,
maxSize: 30
}
}; };
export default Setting; export default Setting;

@ -4,11 +4,11 @@
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
siteId: '' site: {}
}, },
mutations: { mutations: {
setSiteId: (state, siteId) => { setSite: (state, site) => {
state.siteId = siteId state.site = site
} }
}, },
actions: { actions: {

@ -33,6 +33,18 @@
border-radius: 2px; border-radius: 2px;
} }
} }
.search-wrap {
display: flex;
.el-select {
width: 140px;
}
.keyword .el-input__inner {
border-left: 0;
}
.el-input__inner {
border-radius: 0;
}
}
.page { .page {
position: relative; position: relative;
padding: 16px 20px; padding: 16px 20px;
@ -83,15 +95,6 @@
} }
} }
} }
.search-wrap {
display: flex;
.el-input__inner {
border-right: 0;
}
.el-button {
border-radius: 0;
}
}
.actions, .btns, .el-dialog__footer { .actions, .btns, .el-dialog__footer {
.el-button { .el-button {
width: 80px; width: 80px;
@ -117,7 +120,9 @@
} }
.item-line { .item-line {
display: flex; display: flex;
justify-content: space-between; .el-form-item:not(:last-child) {
margin-right: 200px;
}
} }
.line { .line {
margin-bottom: 24px; margin-bottom: 24px;
@ -168,27 +173,30 @@
background-color: $--color-primary !important; background-color: $--color-primary !important;
} }
} }
.el-table { .el-table {
border-bottom: 0; border-bottom: 0;
.cell { td {
font-size: 12px; padding: 5px 0;
color: #333; .cell {
line-height: 35px; font-size: 12px;
color: #333;
font-family: PingFangSC-Regular, PingFang SC;
}
} }
th { th {
background: #F7F7F7 !important; background: #F7F7F7 !important;
.cell { .cell {
line-height: 26px;
color: #323232; color: #323232;
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: 500;
font-family: PingFangSC-Medium, PingFang SC;
} }
} }
} }
.el-table th.is-leaf, .el-table td { .el-table th.is-leaf, .el-table td {
border-bottom-color: #EBEDF0; border-bottom-color: #EBEDF0;
} }
.tabs { .tabs {
display: flex; display: flex;
align-items: center; align-items: center;
@ -224,7 +232,6 @@
} }
} }
} }
.el-message { .el-message {
padding: 11px 20px; padding: 11px 20px;
top:1.2rem!important; top:1.2rem!important;

Loading…
Cancel
Save