新增接口curd、数据权限、导航栏样式变更。
This commit is contained in:
parent
c3da071985
commit
2b4fc51ea5
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
|
@ -77,7 +77,11 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-scrollbar__view{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.scroll-container {
|
.scroll-container {
|
||||||
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -1,369 +1,395 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="tags-view-container" class="tags-view-container" style="">
|
<div id="tags-view-container" class="tags-view-container" style="display: flex">
|
||||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
|
<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' : ''"
|
<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"
|
: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) : ''"
|
:style="activeStyle(tag)" @click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
|
||||||
@contextmenu.prevent.native="openMenu(tag, $event)">
|
@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)" />
|
<div class="showBox">
|
||||||
</router-link>
|
<div v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"></div>
|
||||||
</scroll-pane>
|
<div class="text">{{ tag.meta.title ? tag.meta.title : tag.title }}</div>
|
||||||
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
</div>
|
||||||
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
</router-link>
|
||||||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前
|
</scroll-pane>
|
||||||
</li>
|
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
||||||
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
||||||
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前
|
||||||
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
|
</li>
|
||||||
<li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
|
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
||||||
</ul>
|
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
||||||
</div>
|
<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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ScrollPane from './ScrollPane'
|
import ScrollPane from './ScrollPane'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import {
|
import {
|
||||||
getCompanyId
|
getCompanyId
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ScrollPane
|
ScrollPane
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
selectedTag: {},
|
selectedTag: {},
|
||||||
affixTags: [],
|
affixTags: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
visitedViews() {
|
visitedViews() {
|
||||||
return this.$store.state.tagsView.visitedViews
|
return this.$store.state.tagsView.visitedViews
|
||||||
},
|
},
|
||||||
routes() {
|
routes() {
|
||||||
return this.$store.state.permission.routes
|
return this.$store.state.permission.routes
|
||||||
},
|
},
|
||||||
theme() {
|
theme() {
|
||||||
return this.$store.state.settings.theme;
|
return this.$store.state.settings.theme
|
||||||
},
|
},
|
||||||
companyID() {
|
companyID() {
|
||||||
return this.$store.state.user.companyID;
|
return this.$store.state.user.companyID
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
this.addTags()
|
this.addTags()
|
||||||
this.moveToCurrentTag()
|
this.moveToCurrentTag()
|
||||||
},
|
},
|
||||||
visible(value) {
|
visible(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.addEventListener('click', this.closeMenu)
|
document.body.addEventListener('click', this.closeMenu)
|
||||||
} else {
|
} else {
|
||||||
document.body.removeEventListener('click', this.closeMenu)
|
document.body.removeEventListener('click', this.closeMenu)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
companyID: {
|
companyID: {
|
||||||
deep: true, //深度监听设置为 true
|
deep: true, //深度监听设置为 true
|
||||||
handler: function (newV, oldV) {
|
handler: function(newV, oldV) {
|
||||||
if (oldV) {
|
if (oldV) {
|
||||||
this.$vmNews("切换公司成功", "success")
|
this.$vmNews('切换公司成功', 'success')
|
||||||
this.closeAllTags(this.closeAllTags)
|
this.closeAllTags(this.closeAllTags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initTags()
|
this.initTags()
|
||||||
this.addTags()
|
this.addTags()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isActive(route) {
|
isActive(route) {
|
||||||
return route.path === this.$route.path
|
return route.path === this.$route.path
|
||||||
},
|
},
|
||||||
activeStyle(tag) {
|
activeStyle(tag) {
|
||||||
if (!this.isActive(tag)) return {};
|
if (!this.isActive(tag)) return {}
|
||||||
return {
|
return {
|
||||||
"background-color": this.theme,
|
// "background-color": this.theme,
|
||||||
"border-color": this.theme
|
'border-color': this.theme
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
isAffix(tag) {
|
isAffix(tag) {
|
||||||
return tag.meta && tag.meta.affix
|
return tag.meta && tag.meta.affix
|
||||||
},
|
},
|
||||||
isFirstView() {
|
isFirstView() {
|
||||||
try {
|
try {
|
||||||
return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath ===
|
return this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath ===
|
||||||
'/index'
|
'/index'
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isLastView() {
|
isLastView() {
|
||||||
try {
|
try {
|
||||||
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
return this.selectedTag.fullPath === this.visitedViews[this.visitedViews.length - 1].fullPath
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filterAffixTags(routes, basePath = '/') {
|
filterAffixTags(routes, basePath = '/') {
|
||||||
let tags = []
|
let tags = []
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
if (route.meta && route.meta.affix) {
|
if (route.meta && route.meta.affix) {
|
||||||
const tagPath = path.resolve(basePath, route.path)
|
const tagPath = path.resolve(basePath, route.path)
|
||||||
tags.push({
|
tags.push({
|
||||||
fullPath: tagPath,
|
fullPath: tagPath,
|
||||||
path: tagPath,
|
path: tagPath,
|
||||||
name: route.name,
|
name: route.name,
|
||||||
id: route.id ? route.id : 0,
|
id: route.id ? route.id : 0,
|
||||||
meta: {
|
meta: {
|
||||||
...route.meta
|
...route.meta
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (route.children) {
|
if (route.children) {
|
||||||
const tempTags = this.filterAffixTags(route.children, route.path)
|
const tempTags = this.filterAffixTags(route.children, route.path)
|
||||||
if (tempTags.length >= 1) {
|
if (tempTags.length >= 1) {
|
||||||
tags = [...tags, ...tempTags]
|
tags = [...tags, ...tempTags]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return tags
|
return tags
|
||||||
},
|
},
|
||||||
initTags() {
|
initTags() {
|
||||||
const affixTags = this.affixTags = this.filterAffixTags(this.routes)
|
const affixTags = this.affixTags = this.filterAffixTags(this.routes)
|
||||||
for (const tag of affixTags) {
|
for (const tag of affixTags) {
|
||||||
// Must have tag name
|
// Must have tag name
|
||||||
if (tag.name) {
|
if (tag.name) {
|
||||||
this.$store.dispatch('tagsView/addVisitedView', tag)
|
this.$store.dispatch('tagsView/addVisitedView', tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addTags() {
|
addTags() {
|
||||||
const name = this.$route.meta.title
|
const name = this.$route.meta.title
|
||||||
// this.$route.meta.noCache = false
|
// this.$route.meta.noCache = false
|
||||||
if (name) {
|
if (name) {
|
||||||
this.$store.dispatch('tagsView/addView', this.$route)
|
this.$store.dispatch('tagsView/addView', this.$route)
|
||||||
if (this.$route.meta.link) {
|
if (this.$route.meta.link) {
|
||||||
this.$store.dispatch('tagsView/addIframeView', this.$route)
|
this.$store.dispatch('tagsView/addIframeView', this.$route)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
moveToCurrentTag() {
|
moveToCurrentTag() {
|
||||||
const tags = this.$refs.tag
|
const tags = this.$refs.tag
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
for (const tag of tags) {
|
for (const tag of tags) {
|
||||||
if (tag.to.path === this.$route.path) {
|
if (tag.to.path === this.$route.path) {
|
||||||
this.$refs.scrollPane.moveToTarget(tag)
|
this.$refs.scrollPane.moveToTarget(tag)
|
||||||
// when query is different then update
|
// when query is different then update
|
||||||
if (tag.to.fullPath !== this.$route.fullPath) {
|
if (tag.to.fullPath !== this.$route.fullPath) {
|
||||||
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
|
this.$store.dispatch('tagsView/updateVisitedView', this.$route)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshSelectedTag(view) {
|
refreshSelectedTag(view) {
|
||||||
this.$tab.refreshPage(view);
|
this.$tab.refreshPage(view)
|
||||||
if (this.$route.meta.link) {
|
if (this.$route.meta.link) {
|
||||||
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
this.$store.dispatch('tagsView/delIframeView', this.$route)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeSelectedTag(view) {
|
closeSelectedTag(view) {
|
||||||
this.$tab.closePage(view).then(({
|
this.$tab.closePage(view).then(({
|
||||||
visitedViews
|
visitedViews
|
||||||
}) => {
|
}) => {
|
||||||
if (this.isActive(view)) {
|
if (this.isActive(view)) {
|
||||||
this.toLastView(visitedViews, view)
|
this.toLastView(visitedViews, view)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeRightTags() {
|
closeRightTags() {
|
||||||
this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
|
this.$tab.closeRightPage(this.selectedTag).then(visitedViews => {
|
||||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||||
this.toLastView(visitedViews)
|
this.toLastView(visitedViews)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeLeftTags() {
|
closeLeftTags() {
|
||||||
this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
|
this.$tab.closeLeftPage(this.selectedTag).then(visitedViews => {
|
||||||
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
if (!visitedViews.find(i => i.fullPath === this.$route.fullPath)) {
|
||||||
this.toLastView(visitedViews)
|
this.toLastView(visitedViews)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeOthersTags() {
|
closeOthersTags() {
|
||||||
this.$router.push(this.selectedTag).catch(() => { });
|
this.$router.push(this.selectedTag).catch(() => {
|
||||||
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
})
|
||||||
this.moveToCurrentTag()
|
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
||||||
})
|
this.moveToCurrentTag()
|
||||||
},
|
})
|
||||||
closeAllTags(view) {
|
},
|
||||||
this.$tab.closeAllPage().then(({
|
closeAllTags(view) {
|
||||||
visitedViews
|
this.$tab.closeAllPage().then(({
|
||||||
}) => {
|
visitedViews
|
||||||
if (this.affixTags.some(tag => tag.path === this.$route.path)) {
|
}) => {
|
||||||
return
|
if (this.affixTags.some(tag => tag.path === this.$route.path)) {
|
||||||
}
|
return
|
||||||
this.toLastView(visitedViews, view)
|
}
|
||||||
})
|
this.toLastView(visitedViews, view)
|
||||||
},
|
})
|
||||||
toLastView(visitedViews, view) {
|
},
|
||||||
const latestView = visitedViews.slice(-1)[0]
|
toLastView(visitedViews, view) {
|
||||||
if (latestView) {
|
const latestView = visitedViews.slice(-1)[0]
|
||||||
this.$router.push(latestView.fullPath)
|
if (latestView) {
|
||||||
} else {
|
this.$router.push(latestView.fullPath)
|
||||||
// now the default is to redirect to the home page if there is no tags-view,
|
} else {
|
||||||
// you can adjust it according to your needs.
|
// now the default is to redirect to the home page if there is no tags-view,
|
||||||
if (view.name === 'Dashboard') {
|
// you can adjust it according to your needs.
|
||||||
// to reload home page
|
if (view.name === 'Dashboard') {
|
||||||
this.$router.replace({
|
// to reload home page
|
||||||
path: '/redirect' + view.fullPath
|
this.$router.replace({
|
||||||
})
|
path: '/redirect' + view.fullPath
|
||||||
} else {
|
})
|
||||||
this.$router.push('/')
|
} else {
|
||||||
}
|
this.$router.push('/')
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
openMenu(tag, e) {
|
},
|
||||||
const menuMinWidth = 105
|
openMenu(tag, e) {
|
||||||
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
|
console.log(e.target, 'e')
|
||||||
const offsetWidth = this.$el.offsetWidth // container width
|
const menuMinWidth = 105
|
||||||
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
const offsetLeft = e.target.getBoundingClientRect().left // container margin left
|
||||||
const left = e.clientX - offsetLeft + 15 // 15: margin right
|
const offsetWidth = e.target.offsetWidth // container width
|
||||||
|
const maxLeft = offsetWidth - menuMinWidth // left boundary
|
||||||
|
const left = offsetLeft + 100 // 15: margin right
|
||||||
|
|
||||||
if (left > maxLeft) {
|
// if (left > maxLeft) {
|
||||||
this.left = maxLeft
|
// this.left = 800
|
||||||
} else {
|
// } else {
|
||||||
this.left = left
|
// this.left = 800
|
||||||
}
|
// }
|
||||||
this.top = e.clientY - 40
|
this.left = left
|
||||||
this.visible = true
|
this.top = e.clientY - 40
|
||||||
this.selectedTag = tag
|
this.visible = true
|
||||||
},
|
this.selectedTag = tag
|
||||||
closeMenu() {
|
},
|
||||||
this.visible = false
|
closeMenu() {
|
||||||
},
|
this.visible = false
|
||||||
handleScroll() {
|
},
|
||||||
this.closeMenu()
|
handleScroll() {
|
||||||
}
|
this.closeMenu()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .scrollbar__view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.tags-view-container {
|
.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;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
.tags-view-item {
|
.tags-view-item {
|
||||||
display: inline-block;
|
display: flex;
|
||||||
position: relative;
|
align-items: center;
|
||||||
cursor: pointer;
|
justify-content: center;
|
||||||
border: 1px solid #d8dce5;
|
position: relative;
|
||||||
color: #495060;
|
cursor: pointer;
|
||||||
background: #fff;
|
//border: 1px solid #d8dce5;
|
||||||
padding: 5px 8px;
|
color: #495060;
|
||||||
font-size: 18px;
|
background: #fff;
|
||||||
margin-left: 5px;
|
padding: 0 15px;
|
||||||
margin: 4px;
|
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 {
|
&:last-of-type {
|
||||||
// margin-left: 15px;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&:last-of-type {
|
&.active {
|
||||||
margin-right: 15px;
|
//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 {
|
.contextmenu {
|
||||||
background-color: #42b983;
|
margin: 0;
|
||||||
color: #fff;
|
background: #fff;
|
||||||
border-color: #42b983;
|
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 {
|
li {
|
||||||
content: '';
|
margin: 0;
|
||||||
background: #fff;
|
padding: 7px 16px;
|
||||||
display: inline-block;
|
cursor: pointer;
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: relative;
|
|
||||||
margin-right: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.contextmenu {
|
&:hover {
|
||||||
margin: 0;
|
background: #eee;
|
||||||
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">
|
<style lang="scss">
|
||||||
//reset element css of el-icon-close
|
//reset element css of el-icon-close
|
||||||
.tags-view-wrapper {
|
.tags-view-wrapper {
|
||||||
.tags-view-item {
|
.tags-view-item {
|
||||||
.el-icon-close {
|
.el-icon-close {
|
||||||
width: 16px;
|
//width: 16px;
|
||||||
height: 16px;
|
//height: 16px;
|
||||||
vertical-align: 2px;
|
left: -14px;
|
||||||
border-radius: 50%;
|
top: -3px;
|
||||||
text-align: center;
|
position: absolute;
|
||||||
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
vertical-align: 2px;
|
||||||
transform-origin: 100% 50%;
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
//transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
||||||
|
transform-origin: 100% 50%;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
transform: scale(.6);
|
transform: scale(.6);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: -3px;
|
vertical-align: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #b4bccc;
|
background-color: #b4bccc;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</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,169 @@
|
||||||
|
/**
|
||||||
|
* @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: 'workshopName',
|
||||||
|
tag: 'elLook',
|
||||||
|
span: 24,
|
||||||
|
disabled: true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elCol: [{
|
||||||
|
label: '插件',
|
||||||
|
prop: 'plugName',
|
||||||
|
slotName: 'plugName',
|
||||||
|
tag: 'elLook',
|
||||||
|
span: 24,
|
||||||
|
disabled: true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elCol: [{
|
||||||
|
label: '描述',
|
||||||
|
prop: 'remark',
|
||||||
|
tag: 'elLook',
|
||||||
|
type: 'textarea',
|
||||||
|
span: 24,
|
||||||
|
disabled: true
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
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>
|
||||||
<el-table-column prop="dataList" label="字段">
|
<el-table-column prop="dataList" label="字段">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<i
|
<div style="display: flex;align-items: center">
|
||||||
class="el-icon-star-on"
|
<i
|
||||||
style="
|
class="el-icon-star-on"
|
||||||
|
style="
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
"
|
"
|
||||||
v-show="
|
v-show="btnShowHandle(interfaceList,true)"
|
||||||
scope.row.dataList.length != 0 &&
|
@click="cancellation(interfaceList)"
|
||||||
scope.row.dataList.length == scope.row.buttonList.length
|
></i>
|
||||||
"
|
<i
|
||||||
@click="cancellation(scope.row)"
|
class="el-icon-star-on"
|
||||||
></i>
|
style="
|
||||||
<i
|
|
||||||
class="el-icon-star-on"
|
|
||||||
style="
|
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
color: #808080;
|
color: #808080;
|
||||||
"
|
"
|
||||||
v-show="
|
v-show="btnShowHandle(interfaceList,false)"
|
||||||
scope.row.dataList.length != 0 &&
|
@click="selectAllButton(interfaceList)"
|
||||||
scope.row.dataList.length != scope.row.buttonList.length
|
></i>
|
||||||
"
|
<el-checkbox v-model="item.check" v-for="item in interfaceList">{{ item.name }}</el-checkbox>
|
||||||
@click="selectAllButton(scope.row)"
|
</div>
|
||||||
></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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -50,11 +40,27 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
||||||
|
import config from '@/views/doraChunk/config/indexChunkConfig'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [
|
||||||
selectedList: []
|
{
|
||||||
|
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: {
|
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) {
|
selectAllButton(item) {
|
||||||
let data = [];
|
console.log(item)
|
||||||
item.dataList.forEach((el) => {
|
item.forEach(item => {
|
||||||
data.push(el.id);
|
item.check = true
|
||||||
});
|
})
|
||||||
item.buttonList = data;
|
|
||||||
},
|
},
|
||||||
cancellation(item) {
|
cancellation(item) {
|
||||||
item.buttonList = [];
|
item.forEach(item => {
|
||||||
|
item.check = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleTabClick() {
|
handleTabClick() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -89,32 +108,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
return
|
console.log(this.tableData,'23')
|
||||||
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;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -300,7 +300,7 @@ export default {
|
||||||
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
const data = res.attribute
|
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
|
row.check = !row.check
|
||||||
},
|
},
|
||||||
// 默认选中
|
// 默认选中
|
||||||
exhibitList(menu, homeList, id) {
|
exhibitList(menu, list, id) {
|
||||||
this.$refs.layOutPermissions.homeList = homeList
|
//首页拖拽权限
|
||||||
console.log(menu, 'menu')
|
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);
|
// let data = this.treeToArray(this.menuDatas);
|
||||||
this.build = id
|
this.build = id
|
||||||
// data.forEach((el, index) => {
|
// data.forEach((el, index) => {
|
||||||
|
@ -235,19 +238,32 @@ export default {
|
||||||
kindId: 2,
|
kindId: 2,
|
||||||
sysPopedomHomeEntities: [],
|
sysPopedomHomeEntities: [],
|
||||||
sysPopedomMenuEntities: [],
|
sysPopedomMenuEntities: [],
|
||||||
sysPopedomOperateEntities: []
|
sysPopedomOperateEntities: [],
|
||||||
|
sysPopedomInterfaceEntities: []
|
||||||
}
|
}
|
||||||
|
//数据权限处理
|
||||||
|
this.interfaceListHandle(params.sysPopedomInterfaceEntities)
|
||||||
|
//首页拖拽处理
|
||||||
this.homeListHandle(params.sysPopedomHomeEntities)
|
this.homeListHandle(params.sysPopedomHomeEntities)
|
||||||
|
//菜单、按钮处理
|
||||||
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
||||||
const res = await authApi("sysUserService","","saveJurisdiction","",params)
|
const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
|
||||||
if(res.status == '200'){
|
if (res.status == '200') {
|
||||||
this.handleDialogClose();
|
this.handleDialogClose()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "保存成功",
|
message: '保存成功',
|
||||||
type: "success",
|
type: 'success'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//接口权限数据处理
|
||||||
|
interfaceListHandle(arr) {
|
||||||
|
this.$refs.dataPermissions.interfaceList.forEach(item => {
|
||||||
|
if (item.check) {
|
||||||
|
arr.push({ interfaceId: item.id })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//处理首页拖拽
|
//处理首页拖拽
|
||||||
homeListHandle(arr) {
|
homeListHandle(arr) {
|
||||||
this.$refs.layOutPermissions.homeList.forEach(item => {
|
this.$refs.layOutPermissions.homeList.forEach(item => {
|
||||||
|
@ -265,7 +281,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (item.children.length) {
|
if (item.children.length) {
|
||||||
this.menuListHandle(item.children, result,btnResult)
|
this.menuListHandle(item.children, result, btnResult)
|
||||||
}
|
}
|
||||||
if (item.buttonList.length) {
|
if (item.buttonList.length) {
|
||||||
this.btnListHandle(item.buttonList, btnResult, item.id)
|
this.btnListHandle(item.buttonList, btnResult, item.id)
|
||||||
|
@ -276,7 +292,7 @@ export default {
|
||||||
btnListHandle(list, btnResult, menuId) {
|
btnListHandle(list, btnResult, menuId) {
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
if (item.check) {
|
if (item.check) {
|
||||||
console.log(btnResult,'btnResult')
|
console.log(btnResult, 'btnResult')
|
||||||
btnResult.push({
|
btnResult.push({
|
||||||
menuId,
|
menuId,
|
||||||
operate: item.id
|
operate: item.id
|
||||||
|
|
|
@ -1,52 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-table
|
<el-table ref="multipleTable" :data="tableData" style="width: 100%" :show-header="false">
|
||||||
ref="multipleTable"
|
|
||||||
:data="tableData"
|
|
||||||
style="width: 100%"
|
|
||||||
:show-header="false"
|
|
||||||
>
|
|
||||||
<el-table-column prop="billName" label="单据" width="120">
|
<el-table-column prop="billName" label="单据" width="120">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="dataList" label="字段">
|
<el-table-column prop="dataList" label="字段">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<i
|
<div style="display: flex;align-items: center">
|
||||||
class="el-icon-star-on"
|
<i
|
||||||
style="
|
class="el-icon-star-on"
|
||||||
|
style="
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
"
|
"
|
||||||
v-show="
|
v-show="btnShowHandle(interfaceList,true)"
|
||||||
scope.row.dataList.length != 0 &&
|
@click="cancellation(interfaceList)"
|
||||||
scope.row.dataList.length == scope.row.buttonList.length
|
></i>
|
||||||
"
|
<i
|
||||||
@click="cancellation(scope.row)"
|
class="el-icon-star-on"
|
||||||
></i>
|
style="
|
||||||
<i
|
|
||||||
class="el-icon-star-on"
|
|
||||||
style="
|
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
color: #808080;
|
color: #808080;
|
||||||
"
|
"
|
||||||
v-show="
|
v-show="btnShowHandle(interfaceList,false)"
|
||||||
scope.row.dataList.length != 0 &&
|
@click="selectAllButton(interfaceList)"
|
||||||
scope.row.dataList.length != scope.row.buttonList.length
|
></i>
|
||||||
"
|
<el-checkbox v-model="item.check" v-for="item in interfaceList">{{ item.name }}</el-checkbox>
|
||||||
@click="selectAllButton(scope.row)"
|
</div>
|
||||||
></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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -55,11 +40,27 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
|
||||||
|
import config from '@/views/doraChunk/config/indexChunkConfig'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [
|
||||||
|
{
|
||||||
|
billName: '数据权限控制',
|
||||||
|
dataList: config.config.map((item) => {
|
||||||
|
let obj = {
|
||||||
|
id: item.componentName,
|
||||||
|
name: item.name
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
}),
|
||||||
|
buttonList: [],
|
||||||
|
|
||||||
|
}
|
||||||
|
],
|
||||||
selectedList: [],
|
selectedList: [],
|
||||||
|
interfaceList:[],
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -74,52 +75,40 @@ export default {
|
||||||
mounted() {},
|
mounted() {},
|
||||||
|
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
this.handleTabClick();
|
this.handleTabClick()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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) {
|
selectAllButton(item) {
|
||||||
let data = [];
|
console.log(item)
|
||||||
item.dataList.forEach((el) => {
|
item.forEach(item => {
|
||||||
data.push(el.id);
|
item.check = true
|
||||||
});
|
})
|
||||||
item.buttonList = data;
|
|
||||||
},
|
},
|
||||||
cancellation(item) {
|
cancellation(item) {
|
||||||
item.buttonList = [];
|
item.forEach(item => {
|
||||||
|
item.check = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleTabClick() {
|
handleTabClick() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
|
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
return
|
console.log(this.tableData,'23')
|
||||||
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;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -336,7 +336,7 @@ export default {
|
||||||
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
const data = res.attribute
|
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) {
|
handleSelectionChange(val, row) {
|
||||||
this.multipleSelection = val
|
row.check = !row.check
|
||||||
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 )
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 默认选中
|
// 默认选中
|
||||||
exhibitList(menu, homeList, id) {
|
exhibitList(menu, list, id) {
|
||||||
this.$refs.layOutPermissions.homeList = homeList
|
//首页拖拽权限
|
||||||
console.log(menu, 'menu')
|
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);
|
// let data = this.treeToArray(this.menuDatas);
|
||||||
this.build = id
|
this.build = id
|
||||||
// data.forEach((el, index) => {
|
// data.forEach((el, index) => {
|
||||||
|
@ -284,9 +238,14 @@ export default {
|
||||||
kindId: 1,
|
kindId: 1,
|
||||||
sysPopedomHomeEntities: [],
|
sysPopedomHomeEntities: [],
|
||||||
sysPopedomMenuEntities: [],
|
sysPopedomMenuEntities: [],
|
||||||
sysPopedomOperateEntities: []
|
sysPopedomOperateEntities: [],
|
||||||
|
sysPopedomInterfaceEntities: []
|
||||||
}
|
}
|
||||||
|
//数据权限处理
|
||||||
|
this.interfaceListHandle(params.sysPopedomInterfaceEntities)
|
||||||
|
//首页拖拽处理
|
||||||
this.homeListHandle(params.sysPopedomHomeEntities)
|
this.homeListHandle(params.sysPopedomHomeEntities)
|
||||||
|
//菜单、按钮处理
|
||||||
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
|
||||||
const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
|
const res = await authApi('sysUserService', '', 'saveJurisdiction', '', params)
|
||||||
if (res.status == '200') {
|
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) {
|
homeListHandle(arr) {
|
||||||
this.$refs.layOutPermissions.homeList.forEach(item => {
|
this.$refs.layOutPermissions.homeList.forEach(item => {
|
||||||
|
|
Loading…
Reference in New Issue