
15 changed files with 1079 additions and 2071 deletions
@ -1,343 +1,13 @@ |
|||||
<template> |
.<template> |
||||
<div id="tags-view-container" class="tags-view-container"> |
|
||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> |
|
||||
<router-link |
|
||||
v-for="(tag,index) in visitedViews" |
|
||||
ref="tag" |
|
||||
:key="tag.path" |
|
||||
:class="isActive(tag)?'active':''" |
|
||||
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" |
|
||||
tag="span" |
|
||||
class="tags-view-item" |
|
||||
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" |
|
||||
@contextmenu.prevent.native="openMenu(tag,$event)" |
|
||||
> |
|
||||
{{ tag.title }} |
|
||||
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(index)" /> |
|
||||
</router-link> |
|
||||
</scroll-pane> |
|
||||
<!--<div class="tags-close-box"> |
|
||||
<el-dropdown @command="handleTags"> |
|
||||
<el-button size="mini" type="primary"> 标签选项<i class="el-icon-arrow-down el-icon--right"></i> </el-button> |
|
||||
<el-dropdown-menu size="small" slot="dropdown"> |
|
||||
<el-dropdown-item command="other">关闭其他</el-dropdown-item> |
|
||||
<el-dropdown-item command="all">关闭所有</el-dropdown-item> |
|
||||
</el-dropdown-menu> |
|
||||
</el-dropdown> |
|
||||
</div>--> |
|
||||
|
|
||||
|
|
||||
|
|
||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> |
|
||||
<li @click="refreshSelectedTag(selectedTag)">刷新</li> |
|
||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li> |
|
||||
<li @click="closeOthersTags">关闭其他</li> |
|
||||
<li @click="closeAllTags(selectedTag)">关闭所有</li> |
|
||||
</ul> |
|
||||
</div> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import ScrollPane from './ScrollPane' |
|
||||
import path from 'path' |
|
||||
export default { |
export default { |
||||
components: { ScrollPane }, |
|
||||
data() { |
|
||||
return { |
|
||||
visible: false, |
|
||||
top: 0, |
|
||||
left: 0, |
|
||||
selectedTag: {}, |
|
||||
affixTags: [] |
|
||||
} |
|
||||
}, |
|
||||
computed: { |
|
||||
visitedViews() { |
|
||||
return this.$store.state.tagsView.visitedViews |
|
||||
}, |
|
||||
routes() { |
|
||||
return this.$store.state.permission.routes |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
$route() { |
|
||||
this.addTags() |
|
||||
this.moveToCurrentTag() |
|
||||
}, |
|
||||
visible(value) { |
|
||||
if (value) { |
|
||||
document.body.addEventListener('click', this.closeMenu) |
|
||||
} else { |
|
||||
document.body.removeEventListener('click', this.closeMenu) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.initTags() |
|
||||
this.addTags() |
|
||||
}, |
|
||||
methods: { |
|
||||
isActive(route) { |
|
||||
return route.path === this.$route.path |
|
||||
}, |
|
||||
isAffix(tag) { |
|
||||
return tag.meta && tag.meta.affix |
|
||||
}, |
|
||||
filterAffixTags(routes, basePath = '/') { |
|
||||
let tags = [] |
|
||||
routes.forEach(route => { |
|
||||
if (route.meta && route.meta.affix) { |
|
||||
const tagPath = path.resolve(basePath, route.path) |
|
||||
tags.push({ |
|
||||
fullPath: tagPath, |
|
||||
path: tagPath, |
|
||||
name: route.name, |
|
||||
meta: { ...route.meta } |
|
||||
}) |
|
||||
} |
|
||||
if (route.children) { |
|
||||
const tempTags = this.filterAffixTags(route.children, route.path) |
|
||||
if (tempTags.length >= 1) { |
|
||||
tags = [...tags, ...tempTags] |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
return tags |
|
||||
}, |
|
||||
initTags() { |
|
||||
const affixTags = this.affixTags = this.filterAffixTags(this.routes) |
|
||||
for (const tag of affixTags) { |
|
||||
// Must have tag name |
|
||||
if (tag.name) { |
|
||||
this.$store.dispatch('tagsView/addVisitedView', tag) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
addTags() { |
|
||||
const { name } = this.$route |
|
||||
if (name) { |
|
||||
this.$store.dispatch('tagsView/addView', this.$route) |
|
||||
} |
|
||||
return false |
|
||||
}, |
|
||||
moveToCurrentTag() { |
|
||||
const tags = this.$refs.tag |
|
||||
this.$nextTick(() => { |
|
||||
for (const tag of tags) { |
|
||||
if (tag.to.path === this.$route.path) { |
|
||||
this.$refs.scrollPane.moveToTarget(tag) |
|
||||
// when query is different then update |
|
||||
if (tag.to.fullPath !== this.$route.fullPath) { |
|
||||
this.$store.dispatch('tagsView/updateVisitedView', this.$route) |
|
||||
} |
|
||||
break |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
refreshSelectedTag(view) { |
|
||||
this.$store.dispatch('tagsView/delCachedView', view).then(() => { |
|
||||
const { fullPath } = view |
|
||||
this.$nextTick(() => { |
|
||||
this.$router.replace({ |
|
||||
path: '/redirect' + fullPath |
|
||||
}) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
closeSelectedTag(index) { |
|
||||
const delItem = this.visitedViews.splice(index, 1)[0]; |
|
||||
const item = this.visitedViews[index] ? this.visitedViews[index] : this.visitedViews[index - 1]; |
|
||||
if (item) { |
|
||||
delItem.path === this.$route.fullPath && this.$router.push(item.path); |
|
||||
} else { |
|
||||
this.$router.push('/index'); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
// this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { |
|
||||
// if (this.isActive(view)) { |
|
||||
// this.toLastView(visitedViews, view) |
|
||||
// } |
|
||||
// }) |
|
||||
}, |
|
||||
closeOthersTags() { |
|
||||
this.$router.push(this.selectedTag) |
|
||||
this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { |
|
||||
this.moveToCurrentTag() |
|
||||
}) |
|
||||
}, |
|
||||
closeAllTags(view) { |
|
||||
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { |
|
||||
if (this.affixTags.some(tag => tag.path === view.path)) { |
|
||||
return |
|
||||
} |
|
||||
this.toLastView(visitedViews, view) |
|
||||
}) |
|
||||
}, |
|
||||
toLastView(visitedViews, view) { |
|
||||
const latestView = visitedViews.slice(-1)[0] |
|
||||
if (latestView) { |
|
||||
this.$router.push(latestView.fullPath) |
|
||||
} else { |
|
||||
// now the default is to redirect to the home page if there is no tags-view, |
|
||||
// you can adjust it according to your needs. |
|
||||
if (view.name === 'Dashboard') { |
|
||||
// to reload home page |
|
||||
this.$router.replace({ path: '/redirect' + view.fullPath }) |
|
||||
} else { |
|
||||
this.$router.push('/') |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
openMenu(tag, e) { |
|
||||
const menuMinWidth = 105 |
|
||||
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left |
|
||||
const offsetWidth = this.$el.offsetWidth // container width |
|
||||
const maxLeft = offsetWidth - menuMinWidth // left boundary |
|
||||
const left = e.clientX - offsetLeft + 15 // 15: margin right |
|
||||
if (left > maxLeft) { |
|
||||
this.left = maxLeft |
|
||||
} else { |
|
||||
this.left = left |
|
||||
} |
|
||||
this.top = e.clientY - 32 |
|
||||
this.visible = true |
|
||||
this.selectedTag = tag |
|
||||
}, |
|
||||
closeMenu() { |
|
||||
this.visible = false |
|
||||
}, |
|
||||
handleScroll() { |
|
||||
this.closeMenu() |
|
||||
}, |
|
||||
handleTags(command) { |
|
||||
command === 'other' ? this.closeOther() : this.closeAll(); |
|
||||
}, |
|
||||
// 关闭全部标签 |
|
||||
closeAll() { |
|
||||
// this.visitedViews = []; |
|
||||
this.visitedViews.splice(0, this.visitedViews.length); |
|
||||
this.$router.push('/index'); |
|
||||
}, |
|
||||
// 关闭其他标签 |
|
||||
closeOther() { |
|
||||
return this.visitedViews.filter((item) => { |
|
||||
return item.path === this.$route.fullPath; |
|
||||
}); |
|
||||
// this.visitedViews = curItem; |
|
||||
}, |
|
||||
} |
|
||||
} |
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style> |
||||
@import "~@/styles/variables.scss"; |
|
||||
.tags-view-container { |
|
||||
position:relative; |
|
||||
height: 40px; |
|
||||
width: 100%; |
|
||||
// background: $menuHover; |
|
||||
background: #FFFFFF; |
|
||||
border-bottom: 1px solid #d8dce5; |
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04); |
|
||||
.tags-view-wrapper { |
|
||||
height: 40px; |
|
||||
.tags-view-item { |
|
||||
display: inline-block; |
|
||||
position: relative; |
|
||||
cursor: pointer; |
|
||||
height: 30px; |
|
||||
line-height: 30px; |
|
||||
border-radius: 10px 10px 0 0; |
|
||||
color: #495060; |
|
||||
border: 1px solid #d8dce5; |
|
||||
background: #FFFFFF; |
|
||||
padding: 0 10px; |
|
||||
font-size: 14px; |
|
||||
margin-left: 5px; |
|
||||
margin-top: 9px; |
|
||||
&:first-of-type { |
|
||||
margin-left: 15px; |
|
||||
} |
|
||||
&:last-of-type { |
|
||||
margin-right: 15px; |
|
||||
} |
|
||||
&.active { |
|
||||
background-color: $menuHover; |
|
||||
color: #FFFFFF; |
|
||||
&::before { |
|
||||
content: ''; |
|
||||
background: #FFFFFF; |
|
||||
display: inline-block; |
|
||||
width: 8px; |
|
||||
height: 8px; |
|
||||
border-radius: 50%; |
|
||||
position: relative; |
|
||||
margin-right: 2px; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.contextmenu { |
|
||||
margin: 0; |
|
||||
background: #fff; |
|
||||
z-index: 3000; |
|
||||
position: absolute; |
|
||||
list-style-type: none; |
|
||||
padding: 5px 0; |
|
||||
border-radius: 4px; |
|
||||
font-size: 12px; |
|
||||
font-weight: 400; |
|
||||
color: #333; |
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); |
|
||||
li { |
|
||||
margin: 0; |
|
||||
padding: 7px 16px; |
|
||||
cursor: pointer; |
|
||||
&:hover { |
|
||||
background: #eee; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
||||
|
|
||||
<style lang="scss"> |
|
||||
//reset element css of el-icon-close |
|
||||
.tags-view-wrapper { |
|
||||
.tags-view-item { |
|
||||
.el-icon-close { |
|
||||
width: 16px; |
|
||||
height: 16px; |
|
||||
vertical-align: 1px; |
|
||||
border-radius: 50%; |
|
||||
text-align: center; |
|
||||
transition: all .3s cubic-bezier(.645, .045, .355, 1); |
|
||||
transform-origin: 100% 50%; |
|
||||
&:before { |
|
||||
// transform: scale(.6); |
|
||||
// display: inline-block; |
|
||||
vertical-align: -1px; |
|
||||
} |
|
||||
&:hover { |
|
||||
background-color: #b4bccc; |
|
||||
color: #fff; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
.tags-close-box { |
|
||||
position: absolute; |
|
||||
right: 0; |
|
||||
top: 0; |
|
||||
box-sizing: border-box; |
|
||||
padding-top: 1px; |
|
||||
text-align: center; |
|
||||
width: 110px; |
|
||||
height: 30px; |
|
||||
background: #fff; |
|
||||
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, 0.1); |
|
||||
z-index: 10; |
|
||||
} |
|
||||
</style> |
</style> |
@ -1,167 +1,422 @@ |
|||||
<template> |
<template> |
||||
<div class="content"> |
<div> |
||||
<div class="right_cont"> |
<div v-if="this.msg != 5"> |
||||
<!-- table --> |
<span> |
||||
<div style="padding-top: 15px;"></div> |
查询不到您的个人信息请添加: |
||||
<table class="tishi" cellspacing="0" style="margin:0 auto 30px"> |
<el-button type="primary" size="mini" @click="saveSid()"> |
||||
|
添加 |
||||
|
</el-button> |
||||
|
</span> |
||||
|
</div> |
||||
|
<div v-else-if="this.infoSid != null"> |
||||
|
<el-tabs v-model="activeName" class="my-tabs" type="card"> |
||||
|
<el-tab-pane label="学生信息" name="roleList"> |
||||
|
<div class="container"> |
||||
|
<el-table :data="tableData" border style="width: 100%"> |
||||
|
<el-table-column |
||||
|
label="序号" |
||||
|
width="70px" |
||||
|
type="index" |
||||
|
align="center" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="操作" width="150px" align="center"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
size="mini" |
||||
|
@click="editRow(scope.row)" |
||||
|
> |
||||
|
修改 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="name" |
||||
|
label="学生姓名" |
||||
|
width="100px" |
||||
|
align="center" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="userName" |
||||
|
label="学号ID" |
||||
|
align="center" |
||||
|
width="150px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="sex" |
||||
|
label="性别" |
||||
|
align="center" |
||||
|
width="70px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="nickName" |
||||
|
width="100px" |
||||
|
label="昵称" |
||||
|
align="center" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="calss" |
||||
|
label="所属班级" |
||||
|
align="center" |
||||
|
width="100px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="department" |
||||
|
label="系别" |
||||
|
align="center" |
||||
|
width="100px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="speciality" |
||||
|
label="专业" |
||||
|
align="center" |
||||
|
width="150px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="studyYear" |
||||
|
label="入学年份" |
||||
|
align="center" |
||||
|
width="150px" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane label="修改密码" name="addrole"> |
||||
|
<div class="right_cont"> |
||||
|
<!-- table --> |
||||
|
<div style="padding-top: 15px"></div> |
||||
|
<table class="tishi" cellspacing="0" style="margin: 0 auto 30px"> |
||||
|
<tr> |
||||
|
<td style="border-bottom: none; border-right: none">新密码</td> |
||||
|
<td style="border-bottom: none"> |
||||
|
<el-input |
||||
|
type="password" |
||||
|
v-model="usePwd.password" |
||||
|
show-password |
||||
|
/> |
||||
|
<span>*</span> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td style="border-right: none">确认密码</td> |
||||
|
<td> |
||||
|
<el-input |
||||
|
type="password" |
||||
|
v-model="usePwd.id" |
||||
|
show-password |
||||
|
/> |
||||
|
<span>*</span> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<span slot="footer" class="dialog-footer" style="margin-left: 40%"> |
||||
|
<el-button |
||||
|
style="margin-left: 8%; width: 100px; height: 40px" |
||||
|
type="primary" |
||||
|
@click="updatePsw()" |
||||
|
>确认</el-button |
||||
|
> |
||||
|
</span> |
||||
|
</div> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</div> |
||||
|
<!-- 编辑角色信息 --> |
||||
|
<el-dialog |
||||
|
:title="dialogTitle + '角色信息'" |
||||
|
:visible.sync="editDialog" |
||||
|
width="40%" |
||||
|
> |
||||
|
<table class="e-table" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td>学生姓名</td> |
||||
|
<td> |
||||
|
<el-input v-model="form.name" style="width: 300px"></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
<tr> |
<tr> |
||||
<td style="border-bottom: none; border-right: none;">原密码</td> |
<td>学号ID</td> |
||||
<td style="border-bottom: none;"> |
<td> |
||||
<el-input type="password" v-model="form.original" show-password/> |
<el-input v-model="form.infoId" style="width: 300px"></el-input> |
||||
<span>*</span> |
|
||||
</td> |
</td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td style="border-bottom: none; border-right: none;">新密码</td> |
<td>昵称</td> |
||||
<td style="border-bottom: none;"> |
<td> |
||||
<el-input type="password" v-model="form.password" show-password/> |
<el-input v-model="form.nickName" style="width: 300px"></el-input> |
||||
<span>*</span> |
|
||||
</td> |
</td> |
||||
</tr> |
</tr> |
||||
<tr> |
<tr> |
||||
<td style="border-right: none;">确认密码</td> |
<td>性别</td> |
||||
<td> |
<td> |
||||
<el-input type="password" v-model="form.confirmPassword" show-password/> |
<el-input v-model="form.sex" style="width: 300px"></el-input> |
||||
<span>*</span> |
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>所属班级</td> |
||||
|
<td> |
||||
|
<el-input v-model="form.calss" style="width: 300px"></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>系别</td> |
||||
|
<td> |
||||
|
<el-input v-model="form.department" style="width: 300px"></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>专业</td> |
||||
|
<td> |
||||
|
<el-input v-model="form.speciality" style="width: 300px"></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<td>入学年份</td> |
||||
|
<td> |
||||
|
<el-input v-model="form.studyYear" style="width: 300px"></el-input> |
||||
</td> |
</td> |
||||
</tr> |
</tr> |
||||
</table> |
</table> |
||||
<span slot="footer" class="dialog-footer" style="margin-left:40%;"> |
<div style="margin-top: 20px; text-align: center"> |
||||
<el-button style=" margin-left: 8%; width: 100px;height: 40px;" type="primary" |
<el-button type="primary" @click="save()">保存</el-button> |
||||
@click="updatePsw()">确认</el-button> |
<!--<el-button @click="editDialog = false">关闭</el-button>--> |
||||
<!-- <el-button style="margin-left: 6%; width: 100px;height: 40px;" type="danger" @click="$router.go(-1)">关闭</el-button> --> |
</div> |
||||
</span> |
</el-dialog> |
||||
</div> |
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import login from '@/api/User/login.js' |
import { |
||||
import {removeStorage} from '@/utils/auth' |
putSourcesInfo, |
||||
import User from '@/api/User/login.js' |
UserInfo, |
||||
import myviewer from '@/components/viewerjs/index.vue' |
saveSourcesInfo, |
||||
|
alterPassword |
||||
export default { |
} from "@/api/system/sources/index.js"; |
||||
components: {myviewer}, |
export default { |
||||
data() { |
data() { |
||||
return { |
return { |
||||
checked: '', |
activeName: "roleList", |
||||
form: { |
dialogTitle: "", |
||||
confirmPassword: '', |
editDialog: false, |
||||
original: '', |
entry: false, |
||||
password: '', |
form: { |
||||
userSid: window.sessionStorage.getItem('userSid') |
userSid: "", |
||||
|
id: "9", |
||||
|
}, |
||||
|
student: {}, |
||||
|
type: "xs", |
||||
|
infoSid: "", |
||||
|
jiuye: "已就业", |
||||
|
formBackup: Object.assign({}, this.form), |
||||
|
page: { |
||||
|
total: 0, // 默认数据总数 |
||||
|
current: 1, // 默认开始页面 |
||||
|
size: 10, // 每页的数据条数 |
||||
|
params: { |
||||
|
psid: "", |
||||
|
sourceId: "", |
||||
|
sourceName: "", |
||||
}, |
}, |
||||
token: window.sessionStorage.getItem('token') |
}, |
||||
} |
msg: 0, |
||||
|
tableData: [], |
||||
|
zylb: [], |
||||
|
sourceList: [], |
||||
|
usePwd: { |
||||
|
id: "", |
||||
|
password: "" |
||||
|
}, |
||||
|
token: window.sessionStorage.getItem("token"), |
||||
|
sid: window.sessionStorage.getItem("sid"), |
||||
|
}; |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.loginform(); |
||||
|
}, |
||||
|
methods: { |
||||
|
loginform() { |
||||
|
UserInfo({ sid: this.sid }).then((res) => { |
||||
|
this.msg = res.msg.length; |
||||
|
console.log(res); |
||||
|
let qyArry = Object.keys(res.data).map((item) => { |
||||
|
if (res.data[item] == null) { |
||||
|
delete res.data[item]; |
||||
|
} |
||||
|
return res.data; |
||||
|
}); |
||||
|
this.qyArry = Object.values(qyArry[0]); |
||||
|
console.log(qyArry); |
||||
|
this.tableData = qyArry; |
||||
|
this.form.id = qyArry.id; |
||||
|
}); |
||||
}, |
}, |
||||
mounted() { |
pagination(val) { |
||||
|
// 分页 |
||||
|
this.page.current = val.pageNum; |
||||
|
this.page.size = val.pageSize; |
||||
}, |
}, |
||||
methods: { |
resetSearch() { |
||||
updatePsw() { |
// 重置 |
||||
if (this.form.password != this.form.confirmPassword) { |
this.page = { |
||||
|
total: 0, // 默认数据总数 |
||||
|
current: 1, // 默认开始页面 |
||||
|
size: 10, // 每页的数据条数 |
||||
|
params: { |
||||
|
name: "", |
||||
|
psid: "", |
||||
|
sourceId: "", |
||||
|
sourceName: "", |
||||
|
}, |
||||
|
}; |
||||
|
this.getPageList(); |
||||
|
}, |
||||
|
getPageList() {}, |
||||
|
saveSid() { |
||||
|
this.dialogTitle = "添加"; |
||||
|
this.editDialog = true; |
||||
|
}, |
||||
|
save() { |
||||
|
if (this.msg != 5) { |
||||
|
this.form.userSid = this.sid; |
||||
|
this.dialogTitle = "新增"; |
||||
|
console.log(this.form.userSid); |
||||
|
saveSourcesInfo(this.form).then((res) => { |
||||
|
console.log(res); |
||||
|
this.editDialog = false; |
||||
|
if (res.code == 200) { |
||||
|
location.reload(true); |
||||
|
} |
||||
this.$message({ |
this.$message({ |
||||
type: 'warning', |
message: res.msg, |
||||
message: '两次密码输入不一致!' |
type: "success", |
||||
}); |
}); |
||||
return |
}); |
||||
} |
} else { |
||||
login.updatePassword(this.form).then(res => { |
putSourcesInfo(this.form).then((res) => { |
||||
this.$alert('密码修改成!请重新登录点击确定后退出。', '修改成功', { |
this.form.userSid = this.sid; |
||||
confirmButtonText: '确定', |
this.editDialog = false; |
||||
callback: action => { |
this.loginform(); |
||||
User.logout({token: this.token}).then(res => { |
this.$message({ |
||||
// removeToken() |
message: res.msg, |
||||
window.sessionStorage.removeStorage('token') |
type: "success", |
||||
window.sessionStorage.removeStorage('userSid') |
|
||||
this.$router.push({path: '/login'}) |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
this.$router.push({path: '/login'}) |
|
||||
}) |
|
||||
} |
|
||||
}); |
}); |
||||
// this.$message({ |
}); |
||||
// type: 'success', |
|
||||
// message: '!' |
|
||||
// }); |
|
||||
}) |
|
||||
}, |
|
||||
guanli() { |
|
||||
this.$router.push({ |
|
||||
name: 'roleAdminister' |
|
||||
}) |
|
||||
} |
} |
||||
|
this.reset(); |
||||
}, |
}, |
||||
} |
reset() { |
||||
|
this.form = {}; |
||||
|
}, |
||||
|
editRow(row) { |
||||
|
this.dialogTitle = "编辑"; |
||||
|
this.editDialog = true; |
||||
|
this.form = Object.assign({}, row); |
||||
|
// getSourcesInfo({sid: row.sid}).then(res => { |
||||
|
// this.form = res.data |
||||
|
// }) |
||||
|
}, |
||||
|
updatePsw() { |
||||
|
// if (this.formPwd.password != this.formPwd.confirmPassword) { |
||||
|
// this.$message({ |
||||
|
// type: 'warning', |
||||
|
// message: '两次密码输入不一致!' |
||||
|
// }); |
||||
|
// return |
||||
|
// } |
||||
|
alterPassword(this.usePwd).then((res) => { |
||||
|
if(res.code===200){ |
||||
|
this.$alert("密码修改成!请重新登录点击确定后退出。", "修改成功", { |
||||
|
confirmButtonText: "确定", |
||||
|
callback: (action) => { |
||||
|
window.sessionStorage.removeStorage("token"); |
||||
|
window.sessionStorage.removeStorage("userSid"); |
||||
|
this.$router.push({ path: "/login" }); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped="scoped" lang="scss"> |
<style scoped="scoped" lang="scss"> |
||||
|
.my-tabs { |
||||
|
margin-top: 10px; |
||||
|
} |
||||
|
.content { |
||||
|
width: 100%; |
||||
|
padding-top: 10px; |
||||
|
font-size: 16px; |
||||
|
color: #fff; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
.content { |
.shouye { |
||||
width: 100%; |
position: absolute; |
||||
padding-top: 10px; |
top: -3px; |
||||
font-size: 16px; |
left: 100px; |
||||
color: #fff; |
font-size: 16px; |
||||
box-sizing: border-box; |
color: #0395d8; |
||||
} |
font-weight: bold; |
||||
|
} |
||||
|
|
||||
.shouye { |
.placename { |
||||
position: absolute; |
position: absolute; |
||||
top: -3px; |
top: -3px; |
||||
left: 100px; |
left: 210px; |
||||
font-size: 16px; |
font-size: 16px; |
||||
color: #0395d8; |
color: #fff; |
||||
font-weight: bold; |
font-weight: bold; |
||||
} |
} |
||||
|
|
||||
.placename { |
.right_cont { |
||||
position: absolute; |
width: 100%; |
||||
top: -3px; |
height: 645px; |
||||
left: 210px; |
background-color: #fff; |
||||
font-size: 16px; |
margin: 0; |
||||
color: #fff; |
padding: 15px; |
||||
font-weight: bold; |
box-sizing: border-box; |
||||
} |
} |
||||
|
|
||||
.right_cont { |
.tishi { |
||||
width: 100%; |
width: 560px; |
||||
height: 645px; |
color: #000; |
||||
background-color: #fff; |
padding-left: 1.5%; |
||||
margin: 0; |
margin-bottom: 50px; |
||||
padding: 15px; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
|
|
||||
.tishi { |
|
||||
width: 560px; |
|
||||
color: #000; |
|
||||
padding-left: 1.5%; |
|
||||
margin-bottom: 50px; |
|
||||
|
|
||||
tr { |
tr { |
||||
height: 70px; |
height: 70px; |
||||
} |
} |
||||
|
|
||||
td { |
td { |
||||
border: 1px solid #e6e9f0; |
border: 1px solid #e6e9f0; |
||||
text-align: center; |
text-align: center; |
||||
} |
} |
||||
|
|
||||
td:first-child { |
td:first-child { |
||||
background-color: #f7f9fc; |
background-color: #f7f9fc; |
||||
} |
} |
||||
|
|
||||
.el-input, |
.el-input, |
||||
input { |
input { |
||||
width: 80%; |
width: 80%; |
||||
} |
} |
||||
|
|
||||
span { |
span { |
||||
font-size: 26px; |
font-size: 26px; |
||||
color: red; |
color: red; |
||||
margin-left: 10px; |
margin-left: 10px; |
||||
} |
|
||||
} |
} |
||||
|
} |
||||
</style> |
</style> |
||||
|
File diff suppressed because it is too large
@ -1,248 +1,246 @@ |
|||||
<template> |
<template xmlns=""> |
||||
<div class="container"> |
<div> |
||||
<div v-show="viewState == 1"> |
<el-tabs |
||||
<div class="tab-header"> |
class="my-tabs" |
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px"> |
v-model="activeName" |
||||
<el-row :gutter="20"> |
type="card" |
||||
<el-col :span="14"> |
> |
||||
<el-form-item label="数据value"> |
<el-tab-pane label="字典列表" name="roleList"> |
||||
<el-input v-model="page.params.dictValue" clearable></el-input> |
<div class="container"> |
||||
</el-form-item> |
<!-- table --> |
||||
</el-col> |
<el-table :data="roleTable" border style="width: 100%"> |
||||
<el-col :span="10"> |
<el-table-column |
||||
<el-form-item style="float: right;"> |
label="序号" |
||||
<el-button type="primary" @click="onSearch()">查 询</el-button> |
width="50px" |
||||
<el-button @click="add()">添 加</el-button> |
type="index" |
||||
<el-button @click="closeDict">返 回</el-button> |
align="center" |
||||
</el-form-item> |
> |
||||
</el-col> |
</el-table-column> |
||||
</el-row> |
<el-table-column label="操作" width="520px" align="center"> |
||||
</el-form> |
<template slot-scope="scope"> |
||||
</div> |
<el-button |
||||
<el-table :data="tableData" border style="width: 100%;"> |
@click="editRow(scope.row)" |
||||
<el-table-column label="序号" width="50px" type="index" align="center"> |
type="primary" |
||||
</el-table-column> |
size="mini" |
||||
<el-table-column label="操作" align="center" width="280px"> |
>修改</el-button |
||||
<template slot-scope="scope"> |
> |
||||
<!-- <el-button type="primary" size="mini" @click="add(scope.row)">--> |
<el-button @click="delRow(scope.row)" type="danger" size="mini" |
||||
<!-- 添加子级--> |
>删除</el-button |
||||
<!-- </el-button>--> |
> |
||||
<el-button type="primary" size="mini" @click="editRow(scope.row)"> |
</template> |
||||
修改 |
</el-table-column> |
||||
</el-button> |
<el-table-column |
||||
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)"> |
prop="dictTypeCode" |
||||
删除 |
label="类型代码" |
||||
</el-button> |
width="220px" |
||||
<el-button type="primary" size="mini" @click="handleMap(scope.row)"> |
align="center" |
||||
映射 |
> |
||||
</el-button> |
</el-table-column> |
||||
</template> |
<el-table-column |
||||
</el-table-column> |
prop="dictTypeName" |
||||
<el-table-column prop="dictType" label="字典分类编码" align="center"> |
label="类型名称" |
||||
</el-table-column> |
width="220px" |
||||
<el-table-column prop="groupName" label="数据分组" align="center"> |
align="center" |
||||
</el-table-column> |
> |
||||
<el-table-column prop="dictKey" label="数据key" align="center"> |
</el-table-column> |
||||
</el-table-column> |
<el-table-column prop="remarks" label="类型说明" align="center"> |
||||
<el-table-column prop="dictValue" label="数据value" align="center"> |
</el-table-column> |
||||
</el-table-column> |
</el-table> |
||||
</el-table> |
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/> |
|
||||
|
|
||||
<!-- 分类编辑 --> |
<!-- 编辑字典信息 --> |
||||
<el-dialog :title="dialogTitle + '字典数据'" :visible.sync="editDialog" width="50%"> |
<el-dialog |
||||
<table class="e-table" cellspacing="0"> |
:title="dialogTitle + '字典信息'" |
||||
<tr> |
:visible.sync="editDialog" |
||||
<td>字典分类编码</td> |
width="40%" |
||||
<td> |
> |
||||
{{ form.dictType }} |
<table class="e-table" cellspacing="0"> |
||||
</td> |
<tr> |
||||
</tr> |
<td>类型代码</td> |
||||
<tr> |
<td> |
||||
<td>数据分组</td> |
<el-input |
||||
<td> |
v-model="roleForm.dictTypeCode" |
||||
<el-input v-model="form.groupName"></el-input> |
style="width: 300px" |
||||
</td> |
></el-input> |
||||
</tr> |
</td> |
||||
<tr> |
</tr> |
||||
<td>数据key</td> |
<tr> |
||||
<td> |
<td>类型名称</td> |
||||
<el-input v-model="form.dictKey"></el-input> |
<td> |
||||
</td> |
<el-input |
||||
</tr> |
v-model="roleForm.dictTypeName" |
||||
<tr> |
style="width: 300px" |
||||
<td>数据value</td> |
></el-input> |
||||
<td> |
</td> |
||||
<el-input v-model="form.dictValue"></el-input> |
</tr> |
||||
</td> |
<tr> |
||||
</tr> |
<td>类型说明</td> |
||||
</table> |
<td> |
||||
<div slot="footer" class="dialog-footer"> |
<el-input |
||||
<el-button type="primary" @click="save()">保 存</el-button> |
type="textarea" |
||||
<el-button @click="editDialog = false">关 闭</el-button> |
v-model="roleForm.remarks" |
||||
|
></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div style="margin-top: 20px; text-align: center"> |
||||
|
<el-button type="primary" @click="save1()">保 存</el-button> |
||||
|
<el-button @click="editDialog = false">关 闭</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
</div> |
</div> |
||||
</el-dialog> |
</el-tab-pane> |
||||
</div> |
<!-- 添加字典 --> |
||||
<dictMap v-show="viewState == 2" ref="divAdd" @doback="resetState"/> |
<el-tab-pane label="添加字典" name="addrole"> |
||||
|
<el-card class="box-card"> |
||||
|
<table class="e-table" cellspacing="0"> |
||||
|
<tr> |
||||
|
<td>类型代码</td> |
||||
|
<td> |
||||
|
<el-input |
||||
|
v-model="roleForm.dictTypeCode" |
||||
|
style="width: 300px" |
||||
|
></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>类型名称</td> |
||||
|
<td> |
||||
|
<el-input |
||||
|
v-model="roleForm.dictTypeName" |
||||
|
style="width: 300px" |
||||
|
></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td>类型说明</td> |
||||
|
<td> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
:autosize="{ minRows: 4, maxRows: 6 }" |
||||
|
v-model="roleForm.remarks" |
||||
|
></el-input> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
<div style="margin-top: 20px; text-align: center"> |
||||
|
<el-button type="primary" @click="save()">保 存</el-button> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script>; |
||||
import { deldictCommon, dictCommonList, putdictCommon, savedictCommon } from '@/api/system/dictType/dictCommon.js' |
import { save,pageList,delOrgroles } from '@/api/system/dictType/index.js' |
||||
import dictMap from './dictMap' |
|
||||
export default { |
export default { |
||||
components: { |
|
||||
dictMap |
|
||||
}, |
|
||||
data() { |
data() { |
||||
return { |
return { |
||||
editDialog: false, |
dialogTitle: "", |
||||
dialogTitle: '', |
activeName: "roleList", |
||||
viewState: 1, |
editDialog:false, |
||||
form: { |
roleForm: { |
||||
dictKey: '', |
dictTypeCode: "", |
||||
dictType: '', |
dictTypeName: "", |
||||
groupName: '', |
remarks: "" |
||||
dictValue: '', |
}, |
||||
parentSid: '' |
formBackup: {}, |
||||
|
search: { |
||||
|
name: "", |
||||
}, |
}, |
||||
page: { |
page: { |
||||
total: 0, // 默认数据总数 |
total: 0, // 默认数据总数 |
||||
current: 1, // 默认开始页面 |
current: 1, // 默认开始页面 |
||||
size: 10, // 每页的数据条数 |
size: 10, // 每页的数据条数 |
||||
params: { |
|
||||
dictKey: '', |
|
||||
dictType: '', |
|
||||
dictValue: '', |
|
||||
parentSid: '', |
|
||||
sidPath: '', |
|
||||
} |
|
||||
}, |
|
||||
tableData: [] |
|
||||
} |
|
||||
}, |
|
||||
props: ['dictData'], |
|
||||
watch: { |
|
||||
dictData: { |
|
||||
handler(val) { |
|
||||
this.form.parentSid = val.sid |
|
||||
this.form.dictType = val.dictType |
|
||||
this.form.groupName = val.groupName |
|
||||
this.page.params.parentSid = val.sid |
|
||||
this.page.params.dictType = val.dictType |
|
||||
this.getPageList(this.page) |
|
||||
}, |
}, |
||||
deep: true |
roleTable: [], |
||||
} |
postSidData1: [], |
||||
|
postSidData: [ |
||||
|
{ num: "0", type: "学生" }, |
||||
|
{ num: "1", type: "教师" }, |
||||
|
{ num: "2", type: "管理员" }, |
||||
|
], |
||||
|
}; |
||||
}, |
}, |
||||
mounted() { |
mounted() { |
||||
// if (this.$route.query.sid) { |
this.formBackup = Object.assign({}, this.roleForm); |
||||
// sessionStorage.setItem('dictType', this.$route.query.dictType); |
this.getroleOrgList(); |
||||
// sessionStorage.setItem('parentSid', this.$route.query.sid); |
this.getPostList(); |
||||
// this.page.params.dictType = this.$route.query.dictType |
|
||||
// this.page.params.parentSid = this.$route.query.sid |
|
||||
// this.form.dictType = this.$route.query.dictType; |
|
||||
// this.form.parentSid = this.$route.query.sid |
|
||||
// } else { |
|
||||
// this.page.params.dictType = sessionStorage.getItem('dictType'); |
|
||||
// this.page.params.parentSid = sessionStorage.getItem('parentSid'); |
|
||||
// this.form.dictType = sessionStorage.getItem('dictType'); |
|
||||
// this.form.parentSid = sessionStorage.getItem('parentSid'); |
|
||||
// } |
|
||||
this.getPageList(this.page) |
|
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
pagination(val) { // 分页 |
getPostList() { |
||||
this.page.current = val.pageNum |
pageList(this.page).then((res) => { |
||||
this.page.size = val.pageSize |
console.log(res); |
||||
this.getPageList(this.page) |
if (res.success) { |
||||
}, |
this.roleTable = res.data.records; |
||||
onSearch() { // 查询 |
} |
||||
this.getPageList(this.page) |
}); |
||||
}, |
|
||||
resetSearch() { // 重置 |
|
||||
this.getPageList(this.page) |
|
||||
}, |
|
||||
getPageList(data) { // 获取列表 |
|
||||
dictCommonList(data).then((res) => { |
|
||||
this.tableData = res.data.records |
|
||||
this.page.total = res.data.total |
|
||||
}) |
|
||||
}, |
}, |
||||
add(row) { |
// 分页列表 |
||||
if (row) { |
getroleOrgList(flag) { |
||||
this.form.dictType = row.dictType |
if (flag == "1") { |
||||
this.form.parentSid = row.sid |
this.page.current = 1; |
||||
} else { |
|
||||
this.form.parentSid = 0 |
|
||||
// this.form.dictType = row.dictType |
|
||||
} |
} |
||||
this.dialogTitle = '新增' |
let params = this.page; |
||||
this.editDialog = true |
params.params = this.search; |
||||
this.form.dictKey = '' |
|
||||
this.form.groupName = '' |
|
||||
this.form.dictValue = '' |
|
||||
this.form.sid = '' |
|
||||
}, |
|
||||
closeDict() { |
|
||||
this.form.parentSid = '' |
|
||||
this.form.dictType = '' |
|
||||
this.form.groupName = '' |
|
||||
this.page.params.parentSid = '' |
|
||||
this.page.params.dictType = '' |
|
||||
this.$emit('doback') |
|
||||
}, |
}, |
||||
editRow(row) { |
editRow(row) { |
||||
this.dialogTitle = '编辑' |
this.dialogTitle = "编辑"; |
||||
this.editDialog = true |
this.editDialog = true; |
||||
this.form = Object.assign({}, row) |
this.roleForm = Object.assign({}, row); |
||||
}, |
}, |
||||
save() { |
delRow(row) { |
||||
if (this.form.sid) { |
console.log("rowrow",row); |
||||
putdictCommon(this.form).then(res => { |
this.$confirm("确定要删除该角色吗, 是否继续?", "提示", { |
||||
this.editDialog = false |
confirmButtonText: "确定", |
||||
this.getPageList(this.page) |
cancelButtonText: "取消", |
||||
this.$message({ |
type: "warning", |
||||
message: res.msg, |
|
||||
type: 'success' |
|
||||
}) |
|
||||
}) |
|
||||
} else { |
|
||||
savedictCommon(this.form).then(res => { |
|
||||
this.editDialog = false |
|
||||
this.getPageList(this.page) |
|
||||
this.$message({ |
|
||||
message: res.msg, |
|
||||
type: 'success' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
deleteRow(row) { |
|
||||
this.$confirm('确定要删除该数据吗, 是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
}).then(() => { |
||||
deldictCommon({ sid: row.sid }).then(res => { |
delOrgroles({ sid: row.sid }).then((res) => { |
||||
this.getPageList(this.page) |
if (res.success) { |
||||
this.$message({ |
this.getPostList(); |
||||
type: 'success', |
this.$message({ |
||||
message: '删除成功!' |
showClose: true, |
||||
}) |
type: "success", |
||||
}) |
message: "删除成功!", |
||||
}) |
}); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
}, |
}, |
||||
handleMap(row) { |
// 保存角色 |
||||
this.viewState = 2 |
save() { |
||||
this.$refs['divAdd'].showAdd(row) |
save(this.roleForm).then((res) => { |
||||
|
console.log(res); |
||||
|
if (res.success) { |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: res.msg, |
||||
|
type: "success", |
||||
|
}); |
||||
|
(this.activeName = "roleList"), this.getPostList(); |
||||
|
} |
||||
|
}); |
||||
}, |
}, |
||||
resetState() { |
save1(){ |
||||
this.viewState = 1 |
save(this.roleForm).then((res) => { |
||||
} |
if (res.success) { |
||||
} |
this.getPostList(); |
||||
} |
this.editDialog = false; |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
message: res.msg, |
||||
|
type: "success", |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
|
.my-tabs { |
||||
|
margin-top: 10px; |
||||
|
} |
||||
</style> |
</style> |
||||
|
@ -1,200 +0,0 @@ |
|||||
<template> |
|
||||
<div class="container"> |
|
||||
<div v-show="viewState == 1"> |
|
||||
<div class="tab-header"> |
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px"> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="6"> |
|
||||
<el-form-item label="分类名称"> |
|
||||
<el-input clearable v-model="page.params.dictTypeName"></el-input> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="8"> |
|
||||
<el-form-item label="说明"> |
|
||||
<el-input clearable v-model="page.params.remarks"></el-input> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="10"> |
|
||||
<el-form-item style="float: right;"> |
|
||||
<el-button type="primary" @click="onSearch()">查询</el-button> |
|
||||
<el-button @click="add()">添加</el-button> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table :data="tableData" border style="width: 100%;"> |
|
||||
<el-table-column label="序号" width="50px" type="index" align="center"> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="操作" align="center" width="300px"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="mini" @click="guanli(scope.row)"> |
|
||||
管理 |
|
||||
</el-button> |
|
||||
<el-button type="primary" size="mini" @click="editRow(scope.row)"> |
|
||||
修改 |
|
||||
</el-button> |
|
||||
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)"> |
|
||||
删除 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="dictTypeCode" label="字典分类编码" align="center"> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="dictTypeName" label="字典分类名称" align="center"> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="remarks" label="说明" align="center"> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/> |
|
||||
<!-- 分类编辑 --> |
|
||||
<el-dialog :title="dialogTitle + '字典分类'" :visible.sync="editDialog" width="50%"> |
|
||||
<el-form> |
|
||||
<table class="e-table" cellspacing="0"> |
|
||||
<tr> |
|
||||
<td>数据字典code</td> |
|
||||
<td> |
|
||||
<el-input v-model="form.dictTypeCode"></el-input> |
|
||||
</td> |
|
||||
</tr> |
|
||||
<tr> |
|
||||
<td>数据分类名称</td> |
|
||||
<td> |
|
||||
<el-input v-model="form.dictTypeName"></el-input> |
|
||||
</td> |
|
||||
</tr> |
|
||||
<tr> |
|
||||
<td>说明</td> |
|
||||
<td> |
|
||||
<el-input type="textarea" v-model="form.remarks"></el-input> |
|
||||
</td> |
|
||||
</tr> |
|
||||
</table> |
|
||||
</el-form> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button type="primary" @click="save()">保 存</el-button> |
|
||||
<el-button @click="editDialog = false">关 闭</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
<dict-common @doback="resetState" :dictData='dictData' v-show="viewState == 2"/> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { pageList, saveDictType, putDictType, delDictType } from '@/api/system/dictType/index.js' |
|
||||
import dictCommon from './dictCommon.vue' |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
editDialog: false, |
|
||||
dialogTitle: '', |
|
||||
form: {}, |
|
||||
formBackup: Object.assign({}, this.form), |
|
||||
page: { |
|
||||
total: 0, // 默认数据总数 |
|
||||
current: 1, // 默认开始页面 |
|
||||
size: 10, // 每页的数据条数 |
|
||||
params: { |
|
||||
dictTypeName: '', |
|
||||
dictTypeCode: '' |
|
||||
} |
|
||||
}, |
|
||||
tableData: [], |
|
||||
viewState: 1, |
|
||||
dictData: {} |
|
||||
} |
|
||||
}, |
|
||||
components: { |
|
||||
dictCommon |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.getPageList(this.page) |
|
||||
}, |
|
||||
methods: { |
|
||||
pagination(val) { // 分页 |
|
||||
this.page.current = val.pageNum |
|
||||
this.page.size = val.pageSize |
|
||||
this.getPageList(this.page) |
|
||||
}, |
|
||||
onSearch() { // 查询 |
|
||||
this.getPageList() |
|
||||
}, |
|
||||
resetSearch() { // 重置 |
|
||||
this.page.current = 1 |
|
||||
this.getPageList() |
|
||||
}, |
|
||||
getPageList() { // 获取列表 |
|
||||
pageList(this.page).then((res) => { |
|
||||
if (res.success) { |
|
||||
this.tableData = res.data.records |
|
||||
this.page.total = res.data.total |
|
||||
} else { |
|
||||
this.tableData = [] |
|
||||
this.page.total = 0 |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
add() { |
|
||||
this.dialogTitle = '新增' |
|
||||
this.editDialog = true |
|
||||
this.form = Object.assign({}, this.formBackup) |
|
||||
}, |
|
||||
editRow(row) { |
|
||||
this.dialogTitle = '编辑' |
|
||||
this.editDialog = true |
|
||||
this.form = Object.assign({}, row) |
|
||||
}, |
|
||||
save() { |
|
||||
if (this.form.sid) { |
|
||||
putDictType(this.form).then(res => { |
|
||||
this.editDialog = false |
|
||||
this.getPageList(this.page) |
|
||||
this.$message({ |
|
||||
message: res.msg, |
|
||||
type: 'success' |
|
||||
}) |
|
||||
}) |
|
||||
} else { |
|
||||
saveDictType(this.form).then(res => { |
|
||||
this.editDialog = false |
|
||||
this.getPageList(this.page) |
|
||||
this.$message({ |
|
||||
message: res.msg, |
|
||||
type: 'success' |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
deleteRow(row) { |
|
||||
this.$confirm('确定要删除该条数据吗, 是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
delDictType({ sid: row.sid }).then(res => { |
|
||||
this.getPageList(this.page) |
|
||||
this.$message({ |
|
||||
type: 'success', |
|
||||
message: '删除成功!' |
|
||||
}) |
|
||||
}) |
|
||||
}) |
|
||||
}, |
|
||||
guanli(row) { |
|
||||
this.dictData = { dictType: row.dictTypeCode } |
|
||||
this.viewState = 2 |
|
||||
}, |
|
||||
resetState() { |
|
||||
this.viewState = 1 |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped="scoped"> |
|
||||
.my-tabs { |
|
||||
margin-top: 10px; |
|
||||
} |
|
||||
</style> |
|
@ -1,155 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-app-container"> |
|
||||
<div class="tab-header webtop"> |
|
||||
<!--标题--> |
|
||||
<div>{{ viewTitle }}</div> |
|
||||
<!--start 添加修改按钮--> |
|
||||
<div> |
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存 |
|
||||
</el-button> |
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="listconadd"> |
|
||||
<el-form ref="form_obj" class="formadd" :model="formobj"> |
|
||||
<div class="title"> |
|
||||
<div>[{{ dictionariesKey }}+{{dictionariesValue}}]映射列表</div> |
|
||||
<el-button type="primary" size="mini" @click="Add">添加</el-button> |
|
||||
</div> |
|
||||
<el-table :key="tableKey" :data="formobj.listDtos" :index="index" border style="width: 100%"> |
|
||||
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/> |
|
||||
<el-table-column fixed prop="name" label="操作" width="100px" align="center" header-align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button size="mini" type="danger" @click="dataDelete(scope.$index)">删除 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="映射来源" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select v-model="scope.row.map_sourceValue" filterable placeholder="" @change="changeSource($event, scope.row)"> |
|
||||
<el-option v-for="item in mappingsource_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="映射实体名称" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input v-model="scope.row.map_object" placeholder="" clearable/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="映射项目类别" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input v-model="scope.row.map_item" placeholder="" clearable/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="映射项目编码" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input v-model="scope.row.map_itemKey" placeholder="" clearable/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column label="映射项目值" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input v-model="scope.row.map_itemValue" placeholder="" clearable/> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { typeValues } from '@/api/system/roleAdminister/index' |
|
||||
import { saveMappingList, selectMappingListInfo } from '@/api/system/dictType/index.js' |
|
||||
export default { |
|
||||
data() { |
|
||||
return{ |
|
||||
viewTitle: '数据字典-映射管理', |
|
||||
tableKey: 0, |
|
||||
index: 0, |
|
||||
dictionariesKey: '', |
|
||||
dictionariesValue: '', |
|
||||
mappingsource_list: [], |
|
||||
formobj: { |
|
||||
userSid: '', |
|
||||
dictSid: '', |
|
||||
listDtos: [] |
|
||||
}, |
|
||||
submitdisabled: false |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
showAdd(row) { |
|
||||
this.formobj.dictSid = row.sid |
|
||||
this.dictionariesKey = row.dictType |
|
||||
this.dictionariesValue = row.dictValue |
|
||||
this.formobj.userSid = window.sessionStorage.getItem('userSid') |
|
||||
typeValues({ type: 'sys_mappingsource' }).then((resp) => { |
|
||||
if (resp.success) { |
|
||||
this.mappingsource_list = resp.data |
|
||||
} |
|
||||
}) |
|
||||
selectMappingListInfo({ dictSid: row.sid }).then((resp) => { |
|
||||
if (resp.success) { |
|
||||
this.formobj.listDtos = resp.data |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
Add() { |
|
||||
this.formobj.listDtos.push({ |
|
||||
map_item: '', |
|
||||
map_itemKey: '', |
|
||||
map_itemValue: '', |
|
||||
map_object: '', |
|
||||
map_sourceKey: '', |
|
||||
map_sourceValue: '', |
|
||||
sid: '' |
|
||||
}) |
|
||||
}, |
|
||||
changeSource(value, row) { |
|
||||
let bb = null |
|
||||
this.mappingsource_list.forEach((e) => { |
|
||||
if (e.dictValue === value) { |
|
||||
bb = { |
|
||||
value: e.dictValue, |
|
||||
key: e.dictKey |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
row.map_sourceKey = bb.key |
|
||||
}, |
|
||||
dataDelete(index) { |
|
||||
this.formobj.listDtos.splice(index, 1) |
|
||||
}, |
|
||||
save() { |
|
||||
if (this.formobj.listDtos.length === 0) { |
|
||||
this.$message({ showClose: true, type: 'error', message: '映射列表不能为空' }) |
|
||||
return |
|
||||
} |
|
||||
saveMappingList(this.formobj).then((res) => { |
|
||||
if (res.success) { |
|
||||
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
||||
this.handleReturn() |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
handleReturn() { |
|
||||
this.formobj = { |
|
||||
userSid: '', |
|
||||
dictSid: '', |
|
||||
listDtos: [] |
|
||||
} |
|
||||
this.$emit('doback') |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
.title { |
|
||||
padding: 7px; |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
justify-content: space-between; |
|
||||
align-items: center; |
|
||||
} |
|
||||
</style> |
|
Loading…
Reference in new issue