
15 changed files with 1079 additions and 2071 deletions
@ -1,343 +1,13 @@ |
|||
<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>--> |
|||
.<template> |
|||
|
|||
|
|||
|
|||
<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> |
|||
|
|||
<script> |
|||
import ScrollPane from './ScrollPane' |
|||
import path from 'path' |
|||
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> |
|||
|
|||
<style lang="scss" scoped> |
|||
@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> |
|||
|
|||
<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> |
@ -1,167 +1,422 @@ |
|||
<template> |
|||
<div class="content"> |
|||
<div class="right_cont"> |
|||
<!-- table --> |
|||
<div style="padding-top: 15px;"></div> |
|||
<table class="tishi" cellspacing="0" style="margin:0 auto 30px"> |
|||
<div> |
|||
<div v-if="this.msg != 5"> |
|||
<span> |
|||
查询不到您的个人信息请添加: |
|||
<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> |
|||
<td style="border-bottom: none; border-right: none;">原密码</td> |
|||
<td style="border-bottom: none;"> |
|||
<el-input type="password" v-model="form.original" show-password/> |
|||
<span>*</span> |
|||
<td>学号ID</td> |
|||
<td> |
|||
<el-input v-model="form.infoId" style="width: 300px"></el-input> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border-bottom: none; border-right: none;">新密码</td> |
|||
<td style="border-bottom: none;"> |
|||
<el-input type="password" v-model="form.password" show-password/> |
|||
<span>*</span> |
|||
<td>昵称</td> |
|||
<td> |
|||
<el-input v-model="form.nickName" style="width: 300px"></el-input> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border-right: none;">确认密码</td> |
|||
<td>性别</td> |
|||
<td> |
|||
<el-input type="password" v-model="form.confirmPassword" show-password/> |
|||
<span>*</span> |
|||
<el-input v-model="form.sex" style="width: 300px"></el-input> |
|||
</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> |
|||
</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> |
|||
<!-- <el-button style="margin-left: 6%; width: 100px;height: 40px;" type="danger" @click="$router.go(-1)">关闭</el-button> --> |
|||
</span> |
|||
</div> |
|||
<div style="margin-top: 20px; text-align: center"> |
|||
<el-button type="primary" @click="save()">保存</el-button> |
|||
<!--<el-button @click="editDialog = false">关闭</el-button>--> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import login from '@/api/User/login.js' |
|||
import {removeStorage} from '@/utils/auth' |
|||
import User from '@/api/User/login.js' |
|||
import myviewer from '@/components/viewerjs/index.vue' |
|||
|
|||
export default { |
|||
components: {myviewer}, |
|||
data() { |
|||
return { |
|||
checked: '', |
|||
form: { |
|||
confirmPassword: '', |
|||
original: '', |
|||
password: '', |
|||
userSid: window.sessionStorage.getItem('userSid') |
|||
import { |
|||
putSourcesInfo, |
|||
UserInfo, |
|||
saveSourcesInfo, |
|||
alterPassword |
|||
} from "@/api/system/sources/index.js"; |
|||
export default { |
|||
data() { |
|||
return { |
|||
activeName: "roleList", |
|||
dialogTitle: "", |
|||
editDialog: false, |
|||
entry: false, |
|||
form: { |
|||
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: { |
|||
updatePsw() { |
|||
if (this.form.password != this.form.confirmPassword) { |
|||
resetSearch() { |
|||
// 重置 |
|||
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({ |
|||
type: 'warning', |
|||
message: '两次密码输入不一致!' |
|||
message: res.msg, |
|||
type: "success", |
|||
}); |
|||
return |
|||
} |
|||
login.updatePassword(this.form).then(res => { |
|||
this.$alert('密码修改成!请重新登录点击确定后退出。', '修改成功', { |
|||
confirmButtonText: '确定', |
|||
callback: action => { |
|||
User.logout({token: this.token}).then(res => { |
|||
// removeToken() |
|||
window.sessionStorage.removeStorage('token') |
|||
window.sessionStorage.removeStorage('userSid') |
|||
this.$router.push({path: '/login'}) |
|||
}) |
|||
.catch(() => { |
|||
this.$router.push({path: '/login'}) |
|||
}) |
|||
} |
|||
}); |
|||
} else { |
|||
putSourcesInfo(this.form).then((res) => { |
|||
this.form.userSid = this.sid; |
|||
this.editDialog = false; |
|||
this.loginform(); |
|||
this.$message({ |
|||
message: res.msg, |
|||
type: "success", |
|||
}); |
|||
// 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> |
|||
|
|||
<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 { |
|||
width: 100%; |
|||
padding-top: 10px; |
|||
font-size: 16px; |
|||
color: #fff; |
|||
box-sizing: border-box; |
|||
} |
|||
.shouye { |
|||
position: absolute; |
|||
top: -3px; |
|||
left: 100px; |
|||
font-size: 16px; |
|||
color: #0395d8; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.shouye { |
|||
position: absolute; |
|||
top: -3px; |
|||
left: 100px; |
|||
font-size: 16px; |
|||
color: #0395d8; |
|||
font-weight: bold; |
|||
} |
|||
.placename { |
|||
position: absolute; |
|||
top: -3px; |
|||
left: 210px; |
|||
font-size: 16px; |
|||
color: #fff; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.placename { |
|||
position: absolute; |
|||
top: -3px; |
|||
left: 210px; |
|||
font-size: 16px; |
|||
color: #fff; |
|||
font-weight: bold; |
|||
} |
|||
.right_cont { |
|||
width: 100%; |
|||
height: 645px; |
|||
background-color: #fff; |
|||
margin: 0; |
|||
padding: 15px; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.right_cont { |
|||
width: 100%; |
|||
height: 645px; |
|||
background-color: #fff; |
|||
margin: 0; |
|||
padding: 15px; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
.tishi { |
|||
width: 560px; |
|||
color: #000; |
|||
padding-left: 1.5%; |
|||
margin-bottom: 50px; |
|||
.tishi { |
|||
width: 560px; |
|||
color: #000; |
|||
padding-left: 1.5%; |
|||
margin-bottom: 50px; |
|||
|
|||
tr { |
|||
height: 70px; |
|||
} |
|||
tr { |
|||
height: 70px; |
|||
} |
|||
|
|||
td { |
|||
border: 1px solid #e6e9f0; |
|||
text-align: center; |
|||
} |
|||
td { |
|||
border: 1px solid #e6e9f0; |
|||
text-align: center; |
|||
} |
|||
|
|||
td:first-child { |
|||
background-color: #f7f9fc; |
|||
} |
|||
td:first-child { |
|||
background-color: #f7f9fc; |
|||
} |
|||
|
|||
.el-input, |
|||
input { |
|||
width: 80%; |
|||
} |
|||
.el-input, |
|||
input { |
|||
width: 80%; |
|||
} |
|||
|
|||
span { |
|||
font-size: 26px; |
|||
color: red; |
|||
margin-left: 10px; |
|||
} |
|||
span { |
|||
font-size: 26px; |
|||
color: red; |
|||
margin-left: 10px; |
|||
} |
|||
} |
|||
</style> |
|||
|
File diff suppressed because it is too large
@ -1,248 +1,246 @@ |
|||
<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="14"> |
|||
<el-form-item label="数据value"> |
|||
<el-input v-model="page.params.dictValue" clearable></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-button @click="closeDict">返 回</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="280px"> |
|||
<template slot-scope="scope"> |
|||
<!-- <el-button type="primary" size="mini" @click="add(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> |
|||
<el-button type="primary" size="mini" @click="handleMap(scope.row)"> |
|||
映射 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="dictType" label="字典分类编码" align="center"> |
|||
</el-table-column> |
|||
<el-table-column prop="groupName" label="数据分组" align="center"> |
|||
</el-table-column> |
|||
<el-table-column prop="dictKey" label="数据key" align="center"> |
|||
</el-table-column> |
|||
<el-table-column prop="dictValue" label="数据value" align="center"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/> |
|||
<template xmlns=""> |
|||
<div> |
|||
<el-tabs |
|||
class="my-tabs" |
|||
v-model="activeName" |
|||
type="card" |
|||
> |
|||
<el-tab-pane label="字典列表" name="roleList"> |
|||
<div class="container"> |
|||
<!-- table --> |
|||
<el-table :data="roleTable" border style="width: 100%"> |
|||
<el-table-column |
|||
label="序号" |
|||
width="50px" |
|||
type="index" |
|||
align="center" |
|||
> |
|||
</el-table-column> |
|||
<el-table-column label="操作" width="520px" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
@click="editRow(scope.row)" |
|||
type="primary" |
|||
size="mini" |
|||
>修改</el-button |
|||
> |
|||
<el-button @click="delRow(scope.row)" type="danger" size="mini" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="dictTypeCode" |
|||
label="类型代码" |
|||
width="220px" |
|||
align="center" |
|||
> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="dictTypeName" |
|||
label="类型名称" |
|||
width="220px" |
|||
align="center" |
|||
> |
|||
</el-table-column> |
|||
<el-table-column prop="remarks" label="类型说明" align="center"> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分类编辑 --> |
|||
<el-dialog :title="dialogTitle + '字典数据'" :visible.sync="editDialog" width="50%"> |
|||
<table class="e-table" cellspacing="0"> |
|||
<tr> |
|||
<td>字典分类编码</td> |
|||
<td> |
|||
{{ form.dictType }} |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>数据分组</td> |
|||
<td> |
|||
<el-input v-model="form.groupName"></el-input> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>数据key</td> |
|||
<td> |
|||
<el-input v-model="form.dictKey"></el-input> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td>数据value</td> |
|||
<td> |
|||
<el-input v-model="form.dictValue"></el-input> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="save()">保 存</el-button> |
|||
<el-button @click="editDialog = false">关 闭</el-button> |
|||
<!-- 编辑字典信息 --> |
|||
<el-dialog |
|||
:title="dialogTitle + '字典信息'" |
|||
:visible.sync="editDialog" |
|||
width="40%" |
|||
> |
|||
<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" |
|||
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> |
|||
</el-dialog> |
|||
</div> |
|||
<dictMap v-show="viewState == 2" ref="divAdd" @doback="resetState"/> |
|||
</el-tab-pane> |
|||
<!-- 添加字典 --> |
|||
<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> |
|||
</template> |
|||
|
|||
<script> |
|||
import { deldictCommon, dictCommonList, putdictCommon, savedictCommon } from '@/api/system/dictType/dictCommon.js' |
|||
import dictMap from './dictMap' |
|||
<script>; |
|||
import { save,pageList,delOrgroles } from '@/api/system/dictType/index.js' |
|||
export default { |
|||
components: { |
|||
dictMap |
|||
}, |
|||
data() { |
|||
return { |
|||
editDialog: false, |
|||
dialogTitle: '', |
|||
viewState: 1, |
|||
form: { |
|||
dictKey: '', |
|||
dictType: '', |
|||
groupName: '', |
|||
dictValue: '', |
|||
parentSid: '' |
|||
dialogTitle: "", |
|||
activeName: "roleList", |
|||
editDialog:false, |
|||
roleForm: { |
|||
dictTypeCode: "", |
|||
dictTypeName: "", |
|||
remarks: "" |
|||
}, |
|||
formBackup: {}, |
|||
search: { |
|||
name: "", |
|||
}, |
|||
page: { |
|||
total: 0, // 默认数据总数 |
|||
current: 1, // 默认开始页面 |
|||
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() { |
|||
// if (this.$route.query.sid) { |
|||
// sessionStorage.setItem('dictType', this.$route.query.dictType); |
|||
// sessionStorage.setItem('parentSid', this.$route.query.sid); |
|||
// 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) |
|||
this.formBackup = Object.assign({}, this.roleForm); |
|||
this.getroleOrgList(); |
|||
this.getPostList(); |
|||
}, |
|||
methods: { |
|||
pagination(val) { // 分页 |
|||
this.page.current = val.pageNum |
|||
this.page.size = val.pageSize |
|||
this.getPageList(this.page) |
|||
}, |
|||
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 |
|||
}) |
|||
getPostList() { |
|||
pageList(this.page).then((res) => { |
|||
console.log(res); |
|||
if (res.success) { |
|||
this.roleTable = res.data.records; |
|||
} |
|||
}); |
|||
}, |
|||
add(row) { |
|||
if (row) { |
|||
this.form.dictType = row.dictType |
|||
this.form.parentSid = row.sid |
|||
} else { |
|||
this.form.parentSid = 0 |
|||
// this.form.dictType = row.dictType |
|||
// 分页列表 |
|||
getroleOrgList(flag) { |
|||
if (flag == "1") { |
|||
this.page.current = 1; |
|||
} |
|||
this.dialogTitle = '新增' |
|||
this.editDialog = true |
|||
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') |
|||
let params = this.page; |
|||
params.params = this.search; |
|||
}, |
|||
editRow(row) { |
|||
this.dialogTitle = '编辑' |
|||
this.editDialog = true |
|||
this.form = Object.assign({}, row) |
|||
this.dialogTitle = "编辑"; |
|||
this.editDialog = true; |
|||
this.roleForm = Object.assign({}, row); |
|||
}, |
|||
save() { |
|||
if (this.form.sid) { |
|||
putdictCommon(this.form).then(res => { |
|||
this.editDialog = false |
|||
this.getPageList(this.page) |
|||
this.$message({ |
|||
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' |
|||
delRow(row) { |
|||
console.log("rowrow",row); |
|||
this.$confirm("确定要删除该角色吗, 是否继续?", "提示", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}).then(() => { |
|||
deldictCommon({ sid: row.sid }).then(res => { |
|||
this.getPageList(this.page) |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '删除成功!' |
|||
}) |
|||
}) |
|||
}) |
|||
delOrgroles({ sid: row.sid }).then((res) => { |
|||
if (res.success) { |
|||
this.getPostList(); |
|||
this.$message({ |
|||
showClose: true, |
|||
type: "success", |
|||
message: "删除成功!", |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
}, |
|||
handleMap(row) { |
|||
this.viewState = 2 |
|||
this.$refs['divAdd'].showAdd(row) |
|||
// 保存角色 |
|||
save() { |
|||
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() { |
|||
this.viewState = 1 |
|||
} |
|||
} |
|||
} |
|||
save1(){ |
|||
save(this.roleForm).then((res) => { |
|||
if (res.success) { |
|||
this.getPostList(); |
|||
this.editDialog = false; |
|||
this.$message({ |
|||
showClose: true, |
|||
message: res.msg, |
|||
type: "success", |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.my-tabs { |
|||
margin-top: 10px; |
|||
} |
|||
</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