Merge pull request 'huyt' (#6) from huyt into dev
Reviewed-on: http://192.168.2.237:3000/root/middleground_code_v2/pulls/6
This commit is contained in:
commit
e52be3998f
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
|
@ -77,7 +77,11 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-scrollbar__view{
|
||||
display: flex;
|
||||
}
|
||||
.scroll-container {
|
||||
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -1,369 +1,395 @@
|
|||
<template>
|
||||
<div id="tags-view-container" class="tags-view-container" style="">
|
||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
|
||||
<router-link v-for="tag 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"
|
||||
:style="activeStyle(tag)" @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
|
||||
@contextmenu.prevent.native="openMenu(tag, $event)">
|
||||
{{ tag.meta.title ? tag.meta.title : tag.title }}
|
||||
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
||||
</router-link>
|
||||
</scroll-pane>
|
||||
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前
|
||||
</li>
|
||||
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
||||
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
||||
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
|
||||
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tags-view-container" class="tags-view-container" style="display: flex">
|
||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
|
||||
<router-link v-for="tag 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"
|
||||
:style="activeStyle(tag)" @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
|
||||
@contextmenu.prevent.native="openMenu(tag, $event)"
|
||||
>
|
||||
<div class="showBox">
|
||||
<div v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"></div>
|
||||
<div class="text">{{ tag.meta.title ? tag.meta.title : tag.title }}</div>
|
||||
</div>
|
||||
</router-link>
|
||||
</scroll-pane>
|
||||
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前
|
||||
</li>
|
||||
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
||||
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
||||
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
|
||||
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ScrollPane from './ScrollPane'
|
||||
import path from 'path'
|
||||
import {
|
||||
getCompanyId
|
||||
getCompanyId
|
||||
} from '@/utils/auth'
|
||||
|
||||
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
|
||||
},
|
||||
theme() {
|
||||
return this.$store.state.settings.theme;
|
||||
},
|
||||
companyID() {
|
||||
return this.$store.state.user.companyID;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.addTags()
|
||||
this.moveToCurrentTag()
|
||||
},
|
||||
visible(value) {
|
||||
if (value) {
|
||||
document.body.addEventListener('click', this.closeMenu)
|
||||
} else {
|
||||
document.body.removeEventListener('click', this.closeMenu)
|
||||
}
|
||||
},
|
||||
companyID: {
|
||||
deep: true, //深度监听设置为 true
|
||||
handler: function (newV, oldV) {
|
||||
if (oldV) {
|
||||
this.$vmNews("切换公司成功", "success")
|
||||
this.closeAllTags(this.closeAllTags)
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
},
|
||||
theme() {
|
||||
return this.$store.state.settings.theme
|
||||
},
|
||||
companyID() {
|
||||
return this.$store.state.user.companyID
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.addTags()
|
||||
this.moveToCurrentTag()
|
||||
},
|
||||
visible(value) {
|
||||
if (value) {
|
||||
document.body.addEventListener('click', this.closeMenu)
|
||||
} else {
|
||||
document.body.removeEventListener('click', this.closeMenu)
|
||||
}
|
||||
},
|
||||
companyID: {
|
||||
deep: true, //深度监听设置为 true
|
||||
handler: function(newV, oldV) {
|
||||
if (oldV) {
|
||||
this.$vmNews('切换公司成功', 'success')
|
||||
this.closeAllTags(this.closeAllTags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.initTags()
|
||||
this.addTags()
|
||||
},
|
||||
methods: {
|
||||
isActive(route) {
|
||||
return route.path === this.$route.path
|
||||
},
|
||||
activeStyle(tag) {
|
||||
if (!this.isActive(tag)) return {};
|
||||
return {
|
||||
"background-color": this.theme,
|
||||
"border-color": this.theme
|
||||
};
|
||||
},
|
||||
isAffix(tag) {
|
||||
return tag.meta && tag.meta.affix
|
||||
},
|
||||
isFirstView() {
|
||||
try {
|
||||
return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath ===
|
||||
'/index'
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isLastView() {
|
||||
try {
|
||||
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
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,
|
||||
id: route.id ? route.id : 0,
|
||||
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.meta.title
|
||||
// this.$route.meta.noCache = false
|
||||
if (name) {
|
||||
this.$store.dispatch('tagsView/addView', this.$route)
|
||||
if (this.$route.meta.link) {
|
||||
this.$store.dispatch('tagsView/addIframeView', 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.$tab.refreshPage(view);
|
||||
if (this.$route.meta.link) {
|
||||
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
||||
}
|
||||
},
|
||||
closeSelectedTag(view) {
|
||||
this.$tab.closePage(view).then(({
|
||||
visitedViews
|
||||
}) => {
|
||||
if (this.isActive(view)) {
|
||||
this.toLastView(visitedViews, view)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeRightTags() {
|
||||
this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
|
||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||
this.toLastView(visitedViews)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeLeftTags() {
|
||||
this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
|
||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||
this.toLastView(visitedViews)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeOthersTags() {
|
||||
this.$router.push(this.selectedTag).catch(() => { });
|
||||
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
||||
this.moveToCurrentTag()
|
||||
})
|
||||
},
|
||||
closeAllTags(view) {
|
||||
this.$tab.closeAllPage().then(({
|
||||
visitedViews
|
||||
}) => {
|
||||
if (this.affixTags.some(tag => tag.path === this.$route.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
|
||||
},
|
||||
mounted() {
|
||||
this.initTags()
|
||||
this.addTags()
|
||||
},
|
||||
methods: {
|
||||
isActive(route) {
|
||||
return route.path === this.$route.path
|
||||
},
|
||||
activeStyle(tag) {
|
||||
if (!this.isActive(tag)) return {}
|
||||
return {
|
||||
// "background-color": this.theme,
|
||||
'border-color': this.theme
|
||||
}
|
||||
},
|
||||
isAffix(tag) {
|
||||
return tag.meta && tag.meta.affix
|
||||
},
|
||||
isFirstView() {
|
||||
try {
|
||||
return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath ===
|
||||
'/index'
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
isLastView() {
|
||||
try {
|
||||
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
},
|
||||
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,
|
||||
id: route.id ? route.id : 0,
|
||||
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.meta.title
|
||||
// this.$route.meta.noCache = false
|
||||
if (name) {
|
||||
this.$store.dispatch('tagsView/addView', this.$route)
|
||||
if (this.$route.meta.link) {
|
||||
this.$store.dispatch('tagsView/addIframeView', 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.$tab.refreshPage(view)
|
||||
if (this.$route.meta.link) {
|
||||
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
||||
}
|
||||
},
|
||||
closeSelectedTag(view) {
|
||||
this.$tab.closePage(view).then(({
|
||||
visitedViews
|
||||
}) => {
|
||||
if (this.isActive(view)) {
|
||||
this.toLastView(visitedViews, view)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeRightTags() {
|
||||
this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
|
||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||
this.toLastView(visitedViews)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeLeftTags() {
|
||||
this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
|
||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||
this.toLastView(visitedViews)
|
||||
}
|
||||
})
|
||||
},
|
||||
closeOthersTags() {
|
||||
this.$router.push(this.selectedTag).catch(() => {
|
||||
})
|
||||
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
||||
this.moveToCurrentTag()
|
||||
})
|
||||
},
|
||||
closeAllTags(view) {
|
||||
this.$tab.closeAllPage().then(({
|
||||
visitedViews
|
||||
}) => {
|
||||
if (this.affixTags.some(tag => tag.path === this.$route.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) {
|
||||
console.log(e.target, 'e')
|
||||
const menuMinWidth = 105
|
||||
const offsetLeft = e.target.getBoundingClientRect().left // container margin left
|
||||
const offsetWidth = e.target.offsetWidth // container width
|
||||
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
||||
const left = offsetLeft + 100 // 15: margin right
|
||||
|
||||
if (left > maxLeft) {
|
||||
this.left = maxLeft
|
||||
} else {
|
||||
this.left = left
|
||||
}
|
||||
this.top = e.clientY - 40
|
||||
this.visible = true
|
||||
this.selectedTag = tag
|
||||
},
|
||||
closeMenu() {
|
||||
this.visible = false
|
||||
},
|
||||
handleScroll() {
|
||||
this.closeMenu()
|
||||
}
|
||||
}
|
||||
// if (left > maxLeft) {
|
||||
// this.left = 800
|
||||
// } else {
|
||||
// this.left = 800
|
||||
// }
|
||||
this.left = left
|
||||
this.top = e.clientY - 40
|
||||
this.visible = true
|
||||
this.selectedTag = tag
|
||||
},
|
||||
closeMenu() {
|
||||
this.visible = false
|
||||
},
|
||||
handleScroll() {
|
||||
this.closeMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .scrollbar__view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tags-view-container {
|
||||
// height: 34px;
|
||||
width: 100%;
|
||||
// width: calc(100% - 180px);
|
||||
margin-left: 10px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
// 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);
|
||||
//position: fixed;
|
||||
//top: 22px;
|
||||
// margin-top: 60px;
|
||||
z-index: 1000;
|
||||
|
||||
.tags-view-wrapper {
|
||||
// height: 34px;
|
||||
width: 80vw;
|
||||
overflow: auto;
|
||||
// width: calc(100% - 180px);
|
||||
//margin-left: 10px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
// 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);
|
||||
//position: fixed;
|
||||
//top: 22px;
|
||||
// margin-top: 60px;
|
||||
z-index: 1000;
|
||||
|
||||
.tags-view-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.tags-view-item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
border: 1px solid #d8dce5;
|
||||
color: #495060;
|
||||
background: #fff;
|
||||
padding: 5px 8px;
|
||||
font-size: 18px;
|
||||
margin-left: 5px;
|
||||
margin: 4px;
|
||||
.tags-view-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
//border: 1px solid #d8dce5;
|
||||
color: #495060;
|
||||
background: #fff;
|
||||
padding: 0 15px;
|
||||
height: 39px;
|
||||
font-size: 14px;
|
||||
.showBox{
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
&:first-of-type {
|
||||
// margin-left: 15px;
|
||||
}
|
||||
|
||||
&:first-of-type {
|
||||
// margin-left: 15px;
|
||||
}
|
||||
&:last-of-type {
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-right: 15px;
|
||||
}
|
||||
&.active {
|
||||
//background-color: #42b983;
|
||||
color: #fff;
|
||||
border-color: #42b983;
|
||||
background: #3876ee;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20px;
|
||||
//&::before {
|
||||
// content: '';
|
||||
// background: #fff;
|
||||
// display: inline-block;
|
||||
// width: 8px;
|
||||
// height: 8px;
|
||||
// border-radius: 50%;
|
||||
// position: relative;
|
||||
// margin-right: 2px;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #42b983;
|
||||
color: #fff;
|
||||
border-color: #42b983;
|
||||
.contextmenu {
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
z-index: 999999;
|
||||
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);
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
cursor: pointer;
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
&: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: 2px;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
||||
transform-origin: 100% 50%;
|
||||
.tags-view-item {
|
||||
.el-icon-close {
|
||||
//width: 16px;
|
||||
//height: 16px;
|
||||
left: -14px;
|
||||
top: -3px;
|
||||
position: absolute;
|
||||
vertical-align: 2px;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
//transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
||||
transform-origin: 100% 50%;
|
||||
font-weight: 700;
|
||||
|
||||
&:before {
|
||||
transform: scale(.6);
|
||||
display: inline-block;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
&:before {
|
||||
transform: scale(.6);
|
||||
display: inline-block;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #b4bccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
background-color: #b4bccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
|
@ -0,0 +1,222 @@
|
|||
<template>
|
||||
<div>
|
||||
<template v-if="!lookflag">
|
||||
<el-select
|
||||
v-loading="selLoading"
|
||||
class="w-100"
|
||||
v-model="selectValue"
|
||||
:placeholder="placeholder"
|
||||
:clearable="false"
|
||||
style="width: 240px"
|
||||
size="mini"
|
||||
refs="mySelect"
|
||||
:reserve-keyword="true"
|
||||
:disabled="disabled"
|
||||
filterable
|
||||
popper-class="sele"
|
||||
:filter-method="filter"
|
||||
@change="fun"
|
||||
@focus="funx"
|
||||
@blur="funb"
|
||||
@visible-change="hidden"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.plugId"
|
||||
:label="item.plugName"
|
||||
remote
|
||||
:value="item.plugName"
|
||||
placeholder="请输入"
|
||||
>
|
||||
</el-option>
|
||||
|
||||
<div style="bottom: -10px">
|
||||
<el-pagination
|
||||
v-if="pageModel.total > pageModel.limit"
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageModel.pageIndex"
|
||||
:page-size="pageModel.limit"
|
||||
layout="prev, pager,next,total"
|
||||
:total="pageModel.total"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else
|
||||
><div v-loading="selLoading">{{ showValue }}</div></template
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-input--mini .el-input__inner {
|
||||
height: 38px;
|
||||
}
|
||||
.w-100 {
|
||||
width: 100% !important;
|
||||
}
|
||||
.drop >>> .el-input__inner {
|
||||
background: #5183ff !important;
|
||||
color: white;
|
||||
border: none;
|
||||
height: 26px;
|
||||
padding: 10px 22px 10px 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.drop {
|
||||
width: 250px;
|
||||
}
|
||||
.drop >>> .el-select .el-input .el-select__caret {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import debounce from "lodash/debounce";
|
||||
import { getUserModuleApi } from "@/api/integrationOption/integrationOption.js";
|
||||
export default {
|
||||
props: {
|
||||
ruleForm: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
selectInfo: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
// 是否禁用
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
placeholder: String,
|
||||
value: {
|
||||
type: String,
|
||||
},
|
||||
itemObj: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
lookflag: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [], //当前页码的数据
|
||||
pageModel: {
|
||||
total: 0,
|
||||
pageIndex: 1,
|
||||
limit: 10,
|
||||
},
|
||||
selLoading: false,
|
||||
showValue: "",
|
||||
lookLoading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
selectValue: {
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit("input", val);
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.getUserModuleApi()
|
||||
},
|
||||
methods: {
|
||||
// 请求select信息(分页)
|
||||
async getUserModuleApi(obj = {}) {
|
||||
this.selLoading = true;
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "sysPlugArgService",
|
||||
as: "integrationTaskService",
|
||||
dj: "queryPlugArg",
|
||||
},
|
||||
{
|
||||
pageNum: this.pageModel.pageIndex,
|
||||
pageSize: this.pageModel.limit,
|
||||
...obj,
|
||||
}
|
||||
);
|
||||
if (res.status === '200') {
|
||||
this.pageModel.total = res.attribute.total;
|
||||
this.options = res.attribute.list;
|
||||
}
|
||||
console.log(this.options,'options')
|
||||
this.selLoading = false;
|
||||
},
|
||||
// 根据selectid找到value
|
||||
async getSelectdata(id) {
|
||||
this.selLoading = true;
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "mdmService",
|
||||
as: "mdmService",
|
||||
dj: "queryTemplateData",
|
||||
},
|
||||
{
|
||||
tableName: this.itemObj.service,
|
||||
id: id,
|
||||
label: this.itemObj.label,
|
||||
value: this.itemObj.value,
|
||||
}
|
||||
);
|
||||
if (res.status == 200 && res.attribute.length) {
|
||||
this.selLoading = false;
|
||||
this.options = res.attribute;
|
||||
this.showValue = res.attribute[0][this.itemObj.label];
|
||||
} else {
|
||||
this.selLoading = false;
|
||||
this.options.push({
|
||||
[this.itemObj.label]: "请选择",
|
||||
[this.itemObj.value]: id,
|
||||
});
|
||||
}
|
||||
},
|
||||
// 页码改变事件
|
||||
handleCurrentChange(val) {
|
||||
this.pageModel.pageIndex = val;
|
||||
this.getUserModuleApi();
|
||||
},
|
||||
// select选中更改事件
|
||||
fun(val) {
|
||||
console.log(val)
|
||||
this.$emit("selectChangeHandle",val,this.options)
|
||||
// this.$emit(`${this.funName}`, arr);
|
||||
},
|
||||
// 获得焦点
|
||||
funx() {
|
||||
this.getUserModuleApi();
|
||||
},
|
||||
// 失去焦点
|
||||
funb() {},
|
||||
hidden() {},
|
||||
//搜索方法,将符合的数据存入options中,并分页展示
|
||||
filter: debounce(function (val) {
|
||||
// this.pageModel.pageIndex = 1;
|
||||
// this.getUserModuleApi({ lableValue: val });
|
||||
}, 300),
|
||||
},
|
||||
//监听来自父组件的数据,当数据更新时,重置展示
|
||||
watch: {},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,192 @@
|
|||
/**
|
||||
* @desc 集成产品清单
|
||||
* @date 2023-07-10
|
||||
*/
|
||||
// 表头
|
||||
const tableColumnData = [
|
||||
{
|
||||
label: '接口名称',
|
||||
prop: 'name'
|
||||
}, {
|
||||
label: '服务名',
|
||||
prop: 'beanName'
|
||||
},
|
||||
{
|
||||
label: '方法名',
|
||||
prop: 'interfaceName'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark'
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state'
|
||||
}
|
||||
]
|
||||
const tableVersionColumn = [
|
||||
{
|
||||
label: '参数',
|
||||
prop: 'argName'
|
||||
},
|
||||
{
|
||||
label: '参数值',
|
||||
prop: 'argValue'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
// 基本信息内容
|
||||
const formRow = [
|
||||
{
|
||||
elCol: [{
|
||||
label: '接口名称',
|
||||
prop: 'name',
|
||||
tag: 'elInput',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '服务名',
|
||||
prop: 'beanName',
|
||||
tag: 'elInput',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '方法名',
|
||||
prop: 'interfaceName',
|
||||
tag: 'elInput',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
tag: 'elRadio',
|
||||
span: 24,
|
||||
options: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
label: '停用',
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '描述',
|
||||
prop: 'remark',
|
||||
tag: 'elInput',
|
||||
type: 'textarea',
|
||||
span: 24
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
const basicsRules = {
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入接口名称',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
beanName: [{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
interfaceName: [{
|
||||
required: true,
|
||||
message: '请输入方法名',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
}
|
||||
|
||||
// 查看
|
||||
const formRowShow = [
|
||||
{
|
||||
elCol: [{
|
||||
label: '接口名称',
|
||||
prop: 'name',
|
||||
tag: 'elLook',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '服务名',
|
||||
prop: 'beanName',
|
||||
tag: 'elLook',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '方法名',
|
||||
prop: 'interfaceName',
|
||||
tag: 'elLook',
|
||||
span: 24
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
tag: 'elRadio',
|
||||
disabled:true,
|
||||
span: 24,
|
||||
options: [
|
||||
{
|
||||
label: '启用',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
label: '停用',
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
elCol: [{
|
||||
label: '描述',
|
||||
prop: 'remark',
|
||||
tag: 'elLook',
|
||||
type: 'textarea',
|
||||
span: 24
|
||||
}]
|
||||
}
|
||||
]
|
||||
const operationTableColumn = [
|
||||
{
|
||||
label: '本次推送的执行时间',
|
||||
prop: 'create_time'
|
||||
},
|
||||
{
|
||||
label: '本次推送的入参',
|
||||
prop: 'inParameter'
|
||||
},
|
||||
{
|
||||
label: '推送人名称',
|
||||
prop: 'create_user_id'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
tableColumnData,
|
||||
formRow,
|
||||
basicsRules,
|
||||
formRowShow,
|
||||
tableVersionColumn,
|
||||
operationTableColumn
|
||||
}
|
|
@ -0,0 +1,222 @@
|
|||
<template>
|
||||
<div>
|
||||
<base-layout
|
||||
ref="baseLayout"
|
||||
:buttonList="buttonList"
|
||||
@onFuncBtn="onFuncBtn"
|
||||
:querySwitch="true"
|
||||
:searchList="requirementList"
|
||||
@search="handleSearchEvent"
|
||||
:isPage="true"
|
||||
@pageChange="handlePageChange"
|
||||
>
|
||||
<div slot="main" slot-scope="{ tableHeight }">
|
||||
<base-table
|
||||
ref="baseTable"
|
||||
:showIndex="true"
|
||||
:funWidth="180"
|
||||
:funData="funData"
|
||||
@onFunc="onFunc"
|
||||
:tabLoading.sync="tabLoading"
|
||||
:tableHeight="tableHeight"
|
||||
:tableData="tableData"
|
||||
:tableColumn="tableColumnData"
|
||||
@onCellClick="onCellClick"
|
||||
>
|
||||
<template #state="{row}">
|
||||
{{ row.state == 0 ? '启用' : '停用'}}
|
||||
</template>
|
||||
</base-table>
|
||||
</div>
|
||||
</base-layout>
|
||||
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import baseLayout from "@/components/base/baseLayout";
|
||||
import baseTable from "@/components/base/baseTable";
|
||||
import rightDialog from "./rightDialog";
|
||||
import configData from "./configData";
|
||||
import { authApi } from "@/api/apis/auth";
|
||||
export default {
|
||||
components: {
|
||||
baseLayout,
|
||||
baseTable,
|
||||
rightDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
buttonList: [
|
||||
{
|
||||
menuName: "新增",
|
||||
icon: "el-icon-plus",
|
||||
btnFunction: "add",
|
||||
},
|
||||
{
|
||||
menuName: "刷新",
|
||||
icon: "el-icon-refresh",
|
||||
btnFunction: "resetLoad",
|
||||
},
|
||||
], //按钮组
|
||||
requirementList: [
|
||||
{
|
||||
placeholder: "接口名称",
|
||||
prop: "name",
|
||||
tag: "elInput",
|
||||
},
|
||||
{
|
||||
placeholder: "服务名",
|
||||
prop: "beanName",
|
||||
tag: "elInput",
|
||||
},
|
||||
{
|
||||
placeholder: "方法名",
|
||||
prop: "interfaceName",
|
||||
tag: "elInput",
|
||||
},
|
||||
], //查询模板list
|
||||
tabLoading: false,
|
||||
tableColumnData: configData.tableColumnData, //表头数据
|
||||
funData: [
|
||||
|
||||
{
|
||||
color: "#6a9af1",
|
||||
text: "编辑",
|
||||
},
|
||||
{
|
||||
color: "#d67a74",
|
||||
text: "删除",
|
||||
},
|
||||
],
|
||||
tableData: [], //表格数据
|
||||
pageModel: {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
},
|
||||
queryModel: {
|
||||
code: "",
|
||||
name: "",
|
||||
classify: "",
|
||||
productionCompany: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.queryProductClassfy();
|
||||
this.GetProductionTableData();
|
||||
},
|
||||
methods: {
|
||||
onCellClick(row){
|
||||
this.openLoading("detail");
|
||||
this.$refs.rightDialog.openDialog("show", row);
|
||||
},
|
||||
// 表格数据
|
||||
async GetProductionTableData() {
|
||||
this.tabLoading = true;
|
||||
let param = {
|
||||
...this.pageModel,
|
||||
...this.queryModel,
|
||||
};
|
||||
let res = await authApi(
|
||||
"sysInterfaceService",
|
||||
"",
|
||||
"queryEntityPage",
|
||||
"",
|
||||
param
|
||||
);
|
||||
this.tabLoading = false;
|
||||
if (res.status == "200") {
|
||||
this.tableData = res.attribute.list;
|
||||
this.$refs.baseLayout.setPageTotal(res.attribute.total);
|
||||
}
|
||||
},
|
||||
// 分页变化
|
||||
handlePageChange(val) {
|
||||
this.pageModel.pageNum = val.pageIndex;
|
||||
this.pageModel.pageSize = val.pageSize;
|
||||
this.GetProductionTableData();
|
||||
},
|
||||
// 按钮组
|
||||
onFuncBtn(btn) {
|
||||
this[btn.btnFunction]();
|
||||
},
|
||||
// 新增
|
||||
add() {
|
||||
this.$refs.rightDialog.openDialog("add");
|
||||
},
|
||||
// 表格操作事件 查看 重推 删除
|
||||
onFunc(index, row,item) {
|
||||
// 查看
|
||||
if (item.text==='查看') {
|
||||
this.openLoading("detail");
|
||||
this.$refs.rightDialog.openDialog("show", row);
|
||||
}
|
||||
// 重推
|
||||
if (item.text==='编辑') {
|
||||
this.openLoading("detail");
|
||||
this.$refs.rightDialog.openDialog("edit", row);
|
||||
}
|
||||
// 删除
|
||||
if (item.text==='删除') {
|
||||
this.$delConfirm().then(() => {
|
||||
this.openLoading("del");
|
||||
this.productionDeleteById(row.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
async productionDeleteById(id) {
|
||||
let param = {
|
||||
id: id,
|
||||
};
|
||||
let res = await authApi(
|
||||
"sysInterfaceService",
|
||||
"",
|
||||
"deleteEntity",
|
||||
"",
|
||||
param
|
||||
);
|
||||
if (res.status == "200") {
|
||||
this.$vmNews("删除成功", "success");
|
||||
this.resetTable();
|
||||
}
|
||||
},
|
||||
// 重置表格
|
||||
resetTable() {
|
||||
this.pageModel.pageNum = 1;
|
||||
this.$refs.baseLayout.pageClear();
|
||||
this.GetProductionTableData();
|
||||
},
|
||||
// 搜索
|
||||
handleSearchEvent() {
|
||||
let data = this.$refs.baseLayout.ruleForm;
|
||||
this.queryModel = data;
|
||||
this.resetTable();
|
||||
},
|
||||
// 获取所有产品分类
|
||||
async queryProductClassfy() {
|
||||
let params = {
|
||||
tab_name: "sys_product",
|
||||
column_name: "classify",
|
||||
};
|
||||
let res = await authApi(
|
||||
"generalServiceImpl",
|
||||
"dictionaryshop",
|
||||
"selectDictionaryshop",
|
||||
"",
|
||||
params
|
||||
);
|
||||
if (res.status == "200") {
|
||||
this.requirementList[2].options = res.attribute;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.clickTitle {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,323 @@
|
|||
<template>
|
||||
<div>
|
||||
<base-right-dialog
|
||||
size="1000px"
|
||||
ref="baseRightDialog"
|
||||
:footerShow="true"
|
||||
:dialogVisible.sync="dialogVisible"
|
||||
:title="dialogTitle + ' 集成前台任务'"
|
||||
@handleClose="handleDialogClose"
|
||||
:type="dialogType"
|
||||
:submitShow="submitShow"
|
||||
@handleConfirmClick="handleConfirmClick"
|
||||
>
|
||||
<base-form
|
||||
ref="basicsForm"
|
||||
:formRow="formRow"
|
||||
:isFunBtn="false"
|
||||
:rules="basicsRules"
|
||||
class="dialog_form"
|
||||
:spanWidth="`120px`"
|
||||
:loading="vLoading"
|
||||
|
||||
>
|
||||
</base-form>
|
||||
|
||||
</base-right-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import baseRightDialog from '@/components/base/baseRightDialog'
|
||||
import baseNewSelect from './baseNewSelect.vue'
|
||||
import baseForm from '@/components/base/baseNewForm'
|
||||
import baseTable from '@/components/base/baseTable'
|
||||
import configData from './configData'
|
||||
import { authApi } from '@/api/apis/auth'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
baseRightDialog,
|
||||
baseForm,
|
||||
baseTable,
|
||||
baseNewSelect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogTitle: '',
|
||||
dialogType: '',
|
||||
formRow: configData.formRow,
|
||||
basicsRules: configData.basicsRules,
|
||||
vLoading: false,
|
||||
newMarryOptions: [],
|
||||
submitShow: true,
|
||||
loadingType: true,
|
||||
tableVersionData: [],
|
||||
tableVersionColumn: configData.tableVersionColumn,
|
||||
funData: [],
|
||||
isEdit: false,
|
||||
select_dist: {},
|
||||
plugNameOptions: [],
|
||||
tableColumn: configData.operationTableColumn,//操作记录
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initSelect()
|
||||
},
|
||||
methods: {
|
||||
// 插件下拉
|
||||
async initSelect() {
|
||||
let res = await authApi(
|
||||
'pluginService',
|
||||
'plugins',
|
||||
'queryPluginsByType',
|
||||
'',
|
||||
{
|
||||
'pluginType': '1'
|
||||
}
|
||||
)
|
||||
if (res.status == 200) {
|
||||
console.log(res.attribute)
|
||||
res.attribute.forEach(item => {
|
||||
this.$set(this.select_dist, item.pluginId, item)
|
||||
})
|
||||
this.formRow[0].elCol[0].options = res.attribute
|
||||
}
|
||||
},
|
||||
//下拉改变事件
|
||||
selectChangeHandle(val, options) {
|
||||
if (!val) {
|
||||
this.tableVersionData = []
|
||||
return
|
||||
}
|
||||
//找到这条
|
||||
let obj = options.find(item => {
|
||||
return item.plugName === val
|
||||
})
|
||||
console.log(obj)
|
||||
this.$set(this.$refs.basicsForm.ruleForm, 'plugId', obj.plugId)
|
||||
this.$set(this.$refs.basicsForm.ruleForm, 'plugName', obj.plugName)
|
||||
this.searchInfo(obj.plugId)
|
||||
},
|
||||
//下拉后查询单据详情
|
||||
async searchInfo(plugId) {
|
||||
let params = {
|
||||
plugId
|
||||
}
|
||||
let res = await authApi(
|
||||
'sysPlugArgService',
|
||||
'integrationTaskService',
|
||||
'getPlugArgByPlugId',
|
||||
'',
|
||||
params
|
||||
)
|
||||
console.log(res, 'res')
|
||||
if (res.status == 200) {
|
||||
//数据处理
|
||||
let arr = []
|
||||
res.attribute.forEach(item => {
|
||||
arr.push({
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
remark: '',
|
||||
argValue: '',
|
||||
argName: item.argName,
|
||||
argCode: item.argCode,
|
||||
argType: item.argType
|
||||
})
|
||||
|
||||
})
|
||||
this.tableVersionData = arr
|
||||
}
|
||||
},
|
||||
openDialog(type, row) {
|
||||
|
||||
this.formRow = configData.formRow
|
||||
this.submitShow = true
|
||||
|
||||
this.isEdit = false
|
||||
this.funData = []
|
||||
|
||||
// 编辑
|
||||
if (type == 'edit') {
|
||||
this.isEdit = true
|
||||
this.dialogTitle = '编辑'
|
||||
this.dialogType = 'edit'
|
||||
this.productGetById(row.id)
|
||||
}
|
||||
// 查看
|
||||
if (type == 'show') {
|
||||
this.funData = Object.assign([], [])
|
||||
this.submitShow = false
|
||||
this.formRow = configData.formRowShow
|
||||
this.dialogTitle = '查看'
|
||||
this.dialogType = 'show'
|
||||
this.productGetById(row.id)
|
||||
|
||||
}
|
||||
this.dialogVisible = true
|
||||
// 新增
|
||||
if (type == 'add') {
|
||||
this.dialogTitle = '新增'
|
||||
this.dialogType = 'add'
|
||||
this.$nextTick(()=>{
|
||||
this.$set(this.$refs.basicsForm.ruleForm,'state','0')
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 编辑详情
|
||||
async productGetById(id) {
|
||||
let params = {
|
||||
id: id
|
||||
}
|
||||
let res = await authApi(
|
||||
'sysInterfaceService',
|
||||
'',
|
||||
'getEntity',
|
||||
'',
|
||||
params
|
||||
)
|
||||
if (res.status == '200') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.basicsForm.incomingParameters(res.attribute)
|
||||
})
|
||||
}
|
||||
},
|
||||
addVersionDialog() {
|
||||
let obj = {
|
||||
argName: '',
|
||||
argCode: '',
|
||||
argType: '1',
|
||||
remark: ''
|
||||
}
|
||||
this.tableVersionData.push(obj)
|
||||
},
|
||||
// 删除
|
||||
onFunc(index, row) {
|
||||
if (index == 0) {
|
||||
this.$delConfirm().then(() => {
|
||||
this.tableVersionData.forEach((item, itemIndex) => {
|
||||
if (item.id === row.id) {
|
||||
this.tableVersionData.splice(itemIndex, 1)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 弹窗关闭
|
||||
handleDialogClose() {
|
||||
this.tableVersionData = Object.assign([], [])
|
||||
this.$refs.basicsForm.resetFields()
|
||||
this.dialogVisible = false
|
||||
},
|
||||
// 弹窗确认按钮
|
||||
handleConfirmClick() {
|
||||
this.$refs.basicsForm.$refs['ruleForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return
|
||||
} else {
|
||||
let params = {
|
||||
...this.$refs.basicsForm.ruleForm,
|
||||
}
|
||||
if (this.dialogType == 'add') {
|
||||
this.openLoading('submit')
|
||||
this.productSaveDto(params)
|
||||
}
|
||||
if (this.dialogType == 'edit') {
|
||||
this.openLoading('submit')
|
||||
this.productUpdateDto(params)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 新增保存
|
||||
async productSaveDto(params) {
|
||||
let res = await authApi(
|
||||
'sysInterfaceService',
|
||||
'',
|
||||
'saveEntity',
|
||||
'',
|
||||
params
|
||||
)
|
||||
if (res.status == '200') {
|
||||
this.handleDialogClose()
|
||||
this.$vmNews('新增成功', 'success')
|
||||
this.$emit('resetTable')
|
||||
}
|
||||
},
|
||||
// 编辑保存
|
||||
async productUpdateDto(params) {
|
||||
let res = await authApi(
|
||||
'sysInterfaceService',
|
||||
'',
|
||||
'updateEntity',
|
||||
'',
|
||||
params
|
||||
)
|
||||
if (res.status == '200') {
|
||||
this.handleDialogClose()
|
||||
this.$vmNews('更新成功', 'success')
|
||||
this.$emit('resetTable')
|
||||
}
|
||||
},
|
||||
// 获取所有产品分类
|
||||
async queryProductClassfy() {
|
||||
let params = {
|
||||
tab_name: 'sys_product',
|
||||
column_name: 'classify'
|
||||
}
|
||||
let res = await authApi(
|
||||
'generalServiceImpl',
|
||||
'dictionaryshop',
|
||||
'selectDictionaryshop',
|
||||
'',
|
||||
params
|
||||
)
|
||||
if (res.status == '200') {
|
||||
this.formRow[1].elCol[0].options = res.attribute
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.small_title {
|
||||
margin: 10px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.dialogList {
|
||||
padding: 16px 0;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.updateBtn {
|
||||
border: 1px solid #ebedf1;
|
||||
padding: 5px 0;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.updateBtn:hover {
|
||||
color: #1890ff;
|
||||
border-color: #badeff;
|
||||
background-color: #e8f4ff;
|
||||
}
|
||||
|
||||
::v-deep .el-table__body-wrapper.is-scrolling-none {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
::v-deep .app-container {
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
|
@ -5,43 +5,33 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="dataList" label="字段">
|
||||
<template slot-scope="scope">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
<div style="display: flex;align-items: center">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 25px;
|
||||
margin-right: 7px;
|
||||
"
|
||||
v-show="
|
||||
scope.row.dataList.length != 0 &&
|
||||
scope.row.dataList.length == scope.row.buttonList.length
|
||||
"
|
||||
@click="cancellation(scope.row)"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
v-show="btnShowHandle(interfaceList,true)"
|
||||
@click="cancellation(interfaceList)"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 25px;
|
||||
margin-right: 7px;
|
||||
color: #808080;
|
||||
"
|
||||
v-show="
|
||||
scope.row.dataList.length != 0 &&
|
||||
scope.row.dataList.length != scope.row.buttonList.length
|
||||
"
|
||||
@click="selectAllButton(scope.row)"
|
||||
></i>
|
||||
<el-checkbox-group v-model="scope.row.buttonList" size="small">
|
||||
<el-checkbox
|
||||
v-for="item in scope.row.dataList"
|
||||
:label="item.id"
|
||||
:key="item.id"
|
||||
>{{ item.name }}</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
v-show="btnShowHandle(interfaceList,false)"
|
||||
@click="selectAllButton(interfaceList)"
|
||||
></i>
|
||||
<el-checkbox v-model="item.check" v-for="item in interfaceList">{{ item.name }}</el-checkbox>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -50,11 +40,27 @@
|
|||
|
||||
<script>
|
||||
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
||||
import config from '@/views/doraChunk/config/indexChunkConfig'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
selectedList: []
|
||||
tableData: [
|
||||
{
|
||||
billName: '数据权限控制',
|
||||
dataList: config.config.map((item) => {
|
||||
let obj = {
|
||||
id: item.componentName,
|
||||
name: item.name
|
||||
}
|
||||
return obj
|
||||
}),
|
||||
buttonList: [],
|
||||
|
||||
}
|
||||
],
|
||||
selectedList: [],
|
||||
interfaceList:[],
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -73,15 +79,28 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
//判断全选是否显示
|
||||
btnShowHandle(list, flag = false) {
|
||||
if (!list.length) return false
|
||||
let flagResult = list.every(item => {
|
||||
return item.check
|
||||
})
|
||||
if (flag) {
|
||||
return flagResult
|
||||
} else {
|
||||
return !flagResult
|
||||
}
|
||||
},
|
||||
selectAllButton(item) {
|
||||
let data = [];
|
||||
item.dataList.forEach((el) => {
|
||||
data.push(el.id);
|
||||
});
|
||||
item.buttonList = data;
|
||||
console.log(item)
|
||||
item.forEach(item => {
|
||||
item.check = true
|
||||
})
|
||||
},
|
||||
cancellation(item) {
|
||||
item.buttonList = [];
|
||||
item.forEach(item => {
|
||||
item.check = false
|
||||
})
|
||||
},
|
||||
handleTabClick() {
|
||||
this.$nextTick(() => {
|
||||
|
@ -89,32 +108,7 @@ export default {
|
|||
})
|
||||
},
|
||||
async init() {
|
||||
return
|
||||
let data = [];
|
||||
const res = await GetAllBilldata({});
|
||||
if (res.code == 1) {
|
||||
data = res.data[0];
|
||||
data.forEach((el) => {
|
||||
el.dataList = [];
|
||||
el.buttonList = []
|
||||
});
|
||||
}
|
||||
const item = await GetAllBillDataPepedom({});
|
||||
if (item.code == 1) {
|
||||
data.forEach((el) => {
|
||||
item.data[0].forEach((e) => {
|
||||
if (el.billKindID == e.billKindID) {
|
||||
el.dataList.push(e);
|
||||
}
|
||||
})
|
||||
this.selectedList.forEach(add => {
|
||||
if (el.billKindID == add.dp_billKindID) {
|
||||
el.buttonList = add.dp_popeList.split("\,")
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
this.tableData = data;
|
||||
console.log(this.tableData,'23')
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -300,7 +300,7 @@ export default {
|
|||
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
||||
if (res.status == 200) {
|
||||
const data = res.attribute
|
||||
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
|
||||
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute,this.userRadioId)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -183,9 +183,12 @@ export default {
|
|||
row.check = !row.check
|
||||
},
|
||||
// 默认选中
|
||||
exhibitList(menu, homeList, id) {
|
||||
this.$refs.layOutPermissions.homeList = homeList
|
||||
console.log(menu, 'menu')
|
||||
exhibitList(menu, list, id) {
|
||||
//首页拖拽权限
|
||||
this.$refs.layOutPermissions.homeList = list.homeList
|
||||
//数据权限
|
||||
this.$refs.dataPermissions.interfaceList = list.interfaceList
|
||||
console.log(this.$refs.dataPermissions.interfaceList, 'this.$refs.dataPermissions.interfaceList')
|
||||
// let data = this.treeToArray(this.menuDatas);
|
||||
this.build = id
|
||||
// data.forEach((el, index) => {
|
||||
|
@ -235,19 +238,32 @@ export default {
|
|||
kindId: 2,
|
||||
sysPopedomHomeEntities: [],
|
||||
sysPopedomMenuEntities: [],
|
||||
sysPopedomOperateEntities: []
|
||||
sysPopedomOperateEntities: [],
|
||||
sysPopedomInterfaceEntities: []
|
||||
}
|
||||
//数据权限处理
|
||||
this.interfaceListHandle(params.sysPopedomInterfaceEntities)
|
||||
//首页拖拽处理
|
||||
this.homeListHandle(params.sysPopedomHomeEntities)
|
||||
//菜单、按钮处理
|
||||
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
||||
const res = await authApi("sysUserService","","saveJurisdiction","",params)
|
||||
if(res.status == '200'){
|
||||
this.handleDialogClose();
|
||||
const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
|
||||
if (res.status == '200') {
|
||||
this.handleDialogClose()
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
},
|
||||
//接口权限数据处理
|
||||
interfaceListHandle(arr) {
|
||||
this.$refs.dataPermissions.interfaceList.forEach(item => {
|
||||
if (item.check) {
|
||||
arr.push({ interfaceId: item.id })
|
||||
}
|
||||
})
|
||||
},
|
||||
//处理首页拖拽
|
||||
homeListHandle(arr) {
|
||||
this.$refs.layOutPermissions.homeList.forEach(item => {
|
||||
|
@ -265,7 +281,7 @@ export default {
|
|||
})
|
||||
}
|
||||
if (item.children.length) {
|
||||
this.menuListHandle(item.children, result,btnResult)
|
||||
this.menuListHandle(item.children, result, btnResult)
|
||||
}
|
||||
if (item.buttonList.length) {
|
||||
this.btnListHandle(item.buttonList, btnResult, item.id)
|
||||
|
@ -276,7 +292,7 @@ export default {
|
|||
btnListHandle(list, btnResult, menuId) {
|
||||
list.forEach(item => {
|
||||
if (item.check) {
|
||||
console.log(btnResult,'btnResult')
|
||||
console.log(btnResult, 'btnResult')
|
||||
btnResult.push({
|
||||
menuId,
|
||||
operate: item.id
|
||||
|
|
|
@ -1,52 +1,37 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
:show-header="false"
|
||||
>
|
||||
<el-table ref="multipleTable" :data="tableData" style="width: 100%" :show-header="false">
|
||||
<el-table-column prop="billName" label="单据" width="120">
|
||||
</el-table-column>
|
||||
<el-table-column prop="dataList" label="字段">
|
||||
<template slot-scope="scope">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
<div style="display: flex;align-items: center">
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 25px;
|
||||
margin-right: 7px;
|
||||
"
|
||||
v-show="
|
||||
scope.row.dataList.length != 0 &&
|
||||
scope.row.dataList.length == scope.row.buttonList.length
|
||||
"
|
||||
@click="cancellation(scope.row)"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
v-show="btnShowHandle(interfaceList,true)"
|
||||
@click="cancellation(interfaceList)"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-star-on"
|
||||
style="
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 25px;
|
||||
margin-right: 7px;
|
||||
color: #808080;
|
||||
"
|
||||
v-show="
|
||||
scope.row.dataList.length != 0 &&
|
||||
scope.row.dataList.length != scope.row.buttonList.length
|
||||
"
|
||||
@click="selectAllButton(scope.row)"
|
||||
></i>
|
||||
<el-checkbox-group v-model="scope.row.buttonList" size="small">
|
||||
<el-checkbox
|
||||
v-for="item in scope.row.dataList"
|
||||
:label="item.id"
|
||||
:key="item.id"
|
||||
>{{ item.name }}</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
v-show="btnShowHandle(interfaceList,false)"
|
||||
@click="selectAllButton(interfaceList)"
|
||||
></i>
|
||||
<el-checkbox v-model="item.check" v-for="item in interfaceList">{{ item.name }}</el-checkbox>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -55,11 +40,27 @@
|
|||
|
||||
<script>
|
||||
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
||||
import config from '@/views/doraChunk/config/indexChunkConfig'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
tableData: [
|
||||
{
|
||||
billName: '数据权限控制',
|
||||
dataList: config.config.map((item) => {
|
||||
let obj = {
|
||||
id: item.componentName,
|
||||
name: item.name
|
||||
}
|
||||
return obj
|
||||
}),
|
||||
buttonList: [],
|
||||
|
||||
}
|
||||
],
|
||||
selectedList: [],
|
||||
interfaceList:[],
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -74,52 +75,40 @@ export default {
|
|||
mounted() {},
|
||||
|
||||
beforeUpdate() {
|
||||
this.handleTabClick();
|
||||
this.handleTabClick()
|
||||
},
|
||||
|
||||
methods: {
|
||||
//判断全选是否显示
|
||||
btnShowHandle(list, flag = false) {
|
||||
if (!list.length) return false
|
||||
let flagResult = list.every(item => {
|
||||
return item.check
|
||||
})
|
||||
if (flag) {
|
||||
return flagResult
|
||||
} else {
|
||||
return !flagResult
|
||||
}
|
||||
},
|
||||
selectAllButton(item) {
|
||||
let data = [];
|
||||
item.dataList.forEach((el) => {
|
||||
data.push(el.id);
|
||||
});
|
||||
item.buttonList = data;
|
||||
console.log(item)
|
||||
item.forEach(item => {
|
||||
item.check = true
|
||||
})
|
||||
},
|
||||
cancellation(item) {
|
||||
item.buttonList = [];
|
||||
item.forEach(item => {
|
||||
item.check = false
|
||||
})
|
||||
},
|
||||
handleTabClick() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
|
||||
});
|
||||
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
return
|
||||
let data = [];
|
||||
const res = await GetAllBilldata({});
|
||||
if (res.code == 1) {
|
||||
data = res.data[0];
|
||||
data.forEach((el) => {
|
||||
el.dataList = [];
|
||||
el.buttonList = [];
|
||||
});
|
||||
}
|
||||
const item = await GetAllBillDataPepedom({});
|
||||
if (item.code == 1) {
|
||||
data.forEach((el) => {
|
||||
item.data[0].forEach((e) => {
|
||||
if (el.billKindID == e.billKindID) {
|
||||
el.dataList.push(e);
|
||||
}
|
||||
});
|
||||
this.selectedList.forEach((add) => {
|
||||
if (el.billKindID == add.dp_billKindID) {
|
||||
el.buttonList = add.dp_popeList.split(",");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.tableData = data;
|
||||
console.log(this.tableData,'23')
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -336,7 +336,7 @@ export default {
|
|||
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
||||
if (res.status == 200) {
|
||||
const data = res.attribute
|
||||
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
|
||||
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute,this.userRadioId)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -180,61 +180,15 @@ export default {
|
|||
})
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
this.multipleSelection = val
|
||||
let data = this.treeToArray([row])
|
||||
this.childNode = !row.check
|
||||
console.log(this.childNode,'this.childNode')
|
||||
if (data.length > 1) {
|
||||
console.log(data,'data')
|
||||
data.forEach((el, index) => {
|
||||
el.check = this.childNode
|
||||
this.$refs.multipleTable.toggleRowSelection(el, this.childNode)
|
||||
})
|
||||
let ids = data[0].id
|
||||
let arr = this.treeFindPath(
|
||||
this.menuDatas,
|
||||
(data) => data.id == ids,
|
||||
'id'
|
||||
)
|
||||
arr = arr.splice(0, arr.length - 1)
|
||||
let dataList = []
|
||||
let allList = this.treeToArray(this.menuDatas)
|
||||
allList.forEach((el, index) => {
|
||||
if (arr.includes(el.id)) {
|
||||
dataList.push(el)
|
||||
}
|
||||
})
|
||||
dataList.forEach((el, index) => {
|
||||
el.check = true
|
||||
this.$refs.multipleTable.toggleRowSelection(el, true)
|
||||
})
|
||||
} else {
|
||||
let ids = data[0].id
|
||||
let arr = this.treeFindPath(
|
||||
this.menuDatas,
|
||||
(data) => data.id == ids,
|
||||
'id'
|
||||
)
|
||||
console.log(arr,'arr')
|
||||
// arr = arr.splice(0, arr.length - 1)
|
||||
let dataList = []
|
||||
let allList = this.treeToArray(this.menuDatas)
|
||||
allList.forEach((el, index) => {
|
||||
if (arr.includes(el.id)) {
|
||||
dataList.push(el)
|
||||
}
|
||||
})
|
||||
console.log(dataList,'dataList')
|
||||
dataList.forEach((el, index) => {
|
||||
el.check = this.childNode
|
||||
this.$refs.multipleTable.toggleRowSelection(el, this.childNode )
|
||||
})
|
||||
}
|
||||
row.check = !row.check
|
||||
},
|
||||
// 默认选中
|
||||
exhibitList(menu, homeList, id) {
|
||||
this.$refs.layOutPermissions.homeList = homeList
|
||||
console.log(menu, 'menu')
|
||||
exhibitList(menu, list, id) {
|
||||
//首页拖拽权限
|
||||
this.$refs.layOutPermissions.homeList = list.homeList
|
||||
//数据权限
|
||||
this.$refs.dataPermissions.interfaceList = list.interfaceList
|
||||
console.log(this.$refs.dataPermissions.interfaceList, 'this.$refs.dataPermissions.interfaceList')
|
||||
// let data = this.treeToArray(this.menuDatas);
|
||||
this.build = id
|
||||
// data.forEach((el, index) => {
|
||||
|
@ -284,9 +238,14 @@ export default {
|
|||
kindId: 1,
|
||||
sysPopedomHomeEntities: [],
|
||||
sysPopedomMenuEntities: [],
|
||||
sysPopedomOperateEntities: []
|
||||
sysPopedomOperateEntities: [],
|
||||
sysPopedomInterfaceEntities: []
|
||||
}
|
||||
//数据权限处理
|
||||
this.interfaceListHandle(params.sysPopedomInterfaceEntities)
|
||||
//首页拖拽处理
|
||||
this.homeListHandle(params.sysPopedomHomeEntities)
|
||||
//菜单、按钮处理
|
||||
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
||||
const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
|
||||
if (res.status == '200') {
|
||||
|
@ -297,6 +256,14 @@ export default {
|
|||
})
|
||||
}
|
||||
},
|
||||
//接口权限数据处理
|
||||
interfaceListHandle(arr) {
|
||||
this.$refs.dataPermissions.interfaceList.forEach(item => {
|
||||
if (item.check) {
|
||||
arr.push({ interfaceId: item.id })
|
||||
}
|
||||
})
|
||||
},
|
||||
//处理首页拖拽
|
||||
homeListHandle(arr) {
|
||||
this.$refs.layOutPermissions.homeList.forEach(item => {
|
||||
|
|
Loading…
Reference in New Issue