业务95值计算的新增任务、交换机监控策略

、交换机监控策略表单引用功能修改
2、欢迎页开发并联调(100%)
3、业务95值计算新增任务表单功能修改(80%)
This commit is contained in:
康冉冉
2025-11-13 18:58:44 +08:00
parent 1dff3d2a9f
commit cabb31a953
12 changed files with 639 additions and 496 deletions
+1 -1
View File
@@ -720,7 +720,7 @@ export function getLogicalNode() {
method: 'get', method: 'get',
}) })
} }
// 所有资源管理的列表
export function getRegistList(query) { export function getRegistList(query) {
return request({ return request({
url: '/system/registration/getRegistList', url: '/system/registration/getRegistList',
+15
View File
@@ -24,3 +24,18 @@ export function getColumnList(data) {
data: data data: data
}) })
} }
// 点击菜单 计数
export function clicMenuCount(data) {
return request({
url: '/system/sysMenuClick',
method: 'post',
data: data
})
}
// 获取最受欢迎的前八位菜单
export function getMenuTopEight() {
return request({
url: '/system/sysMenuClick/getMenuListTopEight',
method: 'get'
})
}
+29
View File
@@ -369,6 +369,7 @@
this.selectList = []; this.selectList = [];
this.ids = []; this.ids = [];
if (tableInstance) { if (tableInstance) {
console.log('rows===',rows);
if (rows && rows.length > 0) { if (rows && rows.length > 0) {
rows.forEach(row => { rows.forEach(row => {
tableInstance.toggleRowSelection(row, true); tableInstance.toggleRowSelection(row, true);
@@ -380,6 +381,34 @@
} }
} }
}, },
// 提供给父组件调用的方法:默认选中值 otherRow:新的回显方式,防止破坏原来rows判断的逻辑与回显
defaultSelectRows(rows,otherRow){
const tableInstance = this.config && this.config.tableKey ? this.$refs[`tableRef_${this.config.tableKey}`] : this.$refs.selChangeList;
this.selectList = [];
this.ids = [];
if (tableInstance) {
if (otherRow && otherRow.length > 0) {
otherRow.forEach(rowVal => {
this.tableList.some(tabVal => {
if (rowVal.id === tabVal.id) {
tableInstance.toggleRowSelection(tabVal, true);
this.selectList.push(tabVal);
this.ids.push(tabVal.id);
return true;
}
});
});
} else if (rows && rows.length > 0) {
rows.forEach(row => {
tableInstance.toggleRowSelection(row, true);
this.selectList.push(row);
this.ids.push(row.id);
});
} else {
tableInstance.clearSelection();
}
}
},
renderList() { renderList() {
this.$emit("fnRenderList"); this.$emit("fnRenderList");
}, },
+99 -99
View File
@@ -1,99 +1,99 @@
<template> <template>
<div v-if="!item.hidden"> <div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
</el-menu-item> </el-menu-item>
</app-link> </app-link>
</template> </template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title"> <template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template> </template>
<sidebar-item <sidebar-item
v-for="(child, index) in item.children" v-for="(child, index) in item.children"
:key="child.path + index" :key="child.path + index"
:is-nest="true" :is-nest="true"
:item="child" :item="child"
:base-path="resolvePath(child.path)" :base-path="resolvePath(child.path)"
class="nest-menu" class="nest-menu"
/> />
</el-submenu> </el-submenu>
</div> </div>
</template> </template>
<script> <script>
import path from 'path' import path from 'path'
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
import Item from './Item' import Item from './Item'
import AppLink from './Link' import AppLink from './Link'
import FixiOSBug from './FixiOSBug' import FixiOSBug from './FixiOSBug'
export default { export default {
name: 'SidebarItem', name: 'SidebarItem',
components: { Item, AppLink }, components: { Item, AppLink },
mixins: [FixiOSBug], mixins: [FixiOSBug],
props: { props: {
// route object // route object
item: { item: {
type: Object, type: Object,
required: true required: true
}, },
isNest: { isNest: {
type: Boolean, type: Boolean,
default: false default: false
}, },
basePath: { basePath: {
type: String, type: String,
default: '' default: ''
} }
}, },
data() { data() {
this.onlyOneChild = null this.onlyOneChild = null
return {} return {}
}, },
methods: { methods: {
hasOneShowingChild(children = [], parent) { hasOneShowingChild(children = [], parent) {
if (!children) { if (!children) {
children = [] children = []
} }
const showingChildren = children.filter(item => { const showingChildren = children.filter(item => {
if (item.hidden) { if (item.hidden) {
return false return false
} }
// Temp set(will be used if only has one showing child) // Temp set(will be used if only has one showing child)
this.onlyOneChild = item this.onlyOneChild = item
return true return true
}) })
// When there is only one child router, the child router is displayed by default // When there is only one child router, the child router is displayed by default
if (showingChildren.length === 1) { if (showingChildren.length === 1) {
return true return true
} }
// Show parent if there are no child router to display // Show parent if there are no child router to display
if (showingChildren.length === 0) { if (showingChildren.length === 0) {
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true } this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true return true
} }
return false return false
}, },
resolvePath(routePath, routeQuery) { resolvePath(routePath, routeQuery) {
if (isExternal(routePath)) { if (isExternal(routePath)) {
return routePath return routePath
} }
if (isExternal(this.basePath)) { if (isExternal(this.basePath)) {
return this.basePath return this.basePath
} }
if (routeQuery) { if (routeQuery) {
let query = JSON.parse(routeQuery) let query = JSON.parse(routeQuery)
return { path: path.resolve(this.basePath, routePath), query: query } return { path: path.resolve(this.basePath, routePath), query: query }
} }
return path.resolve(this.basePath, routePath) return path.resolve(this.basePath, routePath)
} }
} }
} }
</script> </script>
+36 -1
View File
@@ -11,6 +11,7 @@
:active-text-color="settings.theme" :active-text-color="settings.theme"
:collapse-transition="false" :collapse-transition="false"
mode="vertical" mode="vertical"
@select="handleMenuSelect"
> >
<sidebar-item <sidebar-item
v-for="(route, index) in sidebarRouters" v-for="(route, index) in sidebarRouters"
@@ -28,6 +29,7 @@ import { mapGetters, mapState } from "vuex"
import Logo from "./Logo" import Logo from "./Logo"
import SidebarItem from "./SidebarItem" import SidebarItem from "./SidebarItem"
import variables from "@/assets/styles/variables.scss" import variables from "@/assets/styles/variables.scss"
import {clicMenuCount} from "@/api/menu";
export default { export default {
components: { SidebarItem, Logo }, components: { SidebarItem, Logo },
@@ -52,6 +54,39 @@ export default {
isCollapse() { isCollapse() {
return !this.sidebar.opened return !this.sidebar.opened
} }
} },
data(){
return {
menuList: {}
}
},
created() {
this.menuHandle(this.sidebarRouters);
},
methods: {
// 点击菜单 计数
handleMenuSelect(index, indexPath) {
let params = {pageRoute: index, pageName: this.menuList[index]};
clicMenuCount(params).then(res => {});
},
// 处理菜单
menuHandle(menu) {
menu.forEach(item => {
if (!item.hidden) {
item.children.forEach(val => {
if (!val.hidden) {
if (val.children) {
val.path = item.path + '/' + val.path;
this.menuHandle([val]);
} else {
let link = item.path && item.path === '/' ? item.path + val.path : item.path + '/' + val.path;
this.menuList[link] = val.meta.title;
}
}
});
}
});
},
}
} }
</script> </script>
+337 -337
View File
@@ -1,337 +1,337 @@
<template> <template>
<div id="tags-view-container" class="tags-view-container"> <div id="tags-view-container" class="tags-view-container">
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
<router-link <router-link
v-for="tag in visitedViews" v-for="tag in visitedViews"
ref="tag" ref="tag"
:key="tag.path" :key="tag.path"
:class="{ 'active': isActive(tag), 'has-icon': tagsIcon }" :class="{ 'active': isActive(tag), 'has-icon': tagsIcon }"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span" tag="span"
class="tags-view-item" class="tags-view-item"
:style="activeStyle(tag)" :style="activeStyle(tag)"
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@contextmenu.prevent.native="openMenu(tag,$event)" @contextmenu.prevent.native="openMenu(tag,$event)"
> >
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" /> <svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
{{ tag.title }} {{ tag.title }}
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" /> <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
</router-link> </router-link>
</scroll-pane> </scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> <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 @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 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 @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="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></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> <li @click="closeAllTags(selectedTag)"><i class="el-icon-circle-close"></i> 全部关闭</li>
</ul> </ul>
</div> </div>
</template> </template>
<script> <script>
import ScrollPane from './ScrollPane' import ScrollPane from './ScrollPane'
import path from 'path' import path from 'path'
export default { export default {
components: { ScrollPane }, components: { 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
}, },
tagsIcon() { tagsIcon() {
return this.$store.state.settings.tagsIcon return this.$store.state.settings.tagsIcon
} }
}, },
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)
} }
} }
}, },
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 === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath return this.selectedTag.fullPath === '/index' || this.selectedTag.fullPath === this.visitedViews[1].fullPath
} 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,
meta: { ...route.meta } 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 const { name } = this.$route
if (name) { if (name) {
this.$store.dispatch('tagsView/addView', this.$route) this.$store.dispatch('tagsView/addView', this.$route)
} }
}, },
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(({ visitedViews }) => { this.$tab.closePage(view).then(({ 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.fullPath).catch(()=>{}) this.$router.push(this.selectedTag.fullPath).catch(()=>{})
this.$tab.closeOtherPage(this.selectedTag).then(() => { this.$tab.closeOtherPage(this.selectedTag).then(() => {
this.moveToCurrentTag() this.moveToCurrentTag()
}) })
}, },
closeAllTags(view) { closeAllTags(view) {
this.$tab.closeAllPage().then(({ visitedViews }) => { this.$tab.closeAllPage().then(({ visitedViews }) => {
if (this.affixTags.some(tag => tag.path === this.$route.path)) { if (this.affixTags.some(tag => tag.path === this.$route.path)) {
return return
} }
this.toLastView(visitedViews, view) this.toLastView(visitedViews, view)
}) })
}, },
toLastView(visitedViews, view) { toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0] const latestView = visitedViews.slice(-1)[0]
if (latestView) { if (latestView) {
this.$router.push(latestView.fullPath) this.$router.push(latestView.fullPath)
} else { } else {
// now the default is to redirect to the home page if there is no tags-view, // now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs. // you can adjust it according to your needs.
if (view.name === 'Dashboard') { if (view.name === 'Dashboard') {
// to reload home page // to reload home page
this.$router.replace({ path: '/redirect' + view.fullPath }) this.$router.replace({ path: '/redirect' + view.fullPath })
} else { } else {
this.$router.push('/') this.$router.push('/')
} }
} }
}, },
openMenu(tag, e) { openMenu(tag, e) {
const menuMinWidth = 105 const menuMinWidth = 105
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
const offsetWidth = this.$el.offsetWidth // container width const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - menuMinWidth // left boundary const maxLeft = offsetWidth - menuMinWidth // left boundary
const left = e.clientX - offsetLeft + 15 // 15: margin right const left = e.clientX - offsetLeft + 15 // 15: margin right
if (left > maxLeft) { if (left > maxLeft) {
this.left = maxLeft this.left = maxLeft
} else { } else {
this.left = left this.left = left
} }
this.top = e.clientY this.top = e.clientY
this.visible = true this.visible = true
this.selectedTag = tag this.selectedTag = tag
}, },
closeMenu() { closeMenu() {
this.visible = false this.visible = false
}, },
handleScroll() { handleScroll() {
this.closeMenu() this.closeMenu()
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tags-view-container { .tags-view-container {
height: 34px; height: 34px;
width: 100%; width: 100%;
background: #fff; background: #fff;
border-bottom: 1px solid #d8dce5; 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); box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
.tags-view-wrapper { .tags-view-wrapper {
.tags-view-item { .tags-view-item {
display: inline-block; display: inline-block;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
border: 1px solid #d8dce5; border: 1px solid #d8dce5;
color: #495060; color: #495060;
background: #fff; background: #fff;
padding: 0 8px; padding: 0 8px;
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;
margin-top: 4px; margin-top: 4px;
&:first-of-type { &:first-of-type {
margin-left: 15px; margin-left: 15px;
} }
&:last-of-type { &:last-of-type {
margin-right: 15px; margin-right: 15px;
} }
&.active { &.active {
background-color: #42b983; background-color: #42b983;
color: #fff; color: #fff;
border-color: #42b983; border-color: #42b983;
&::before { &::before {
content: ''; content: '';
background: #fff; background: #fff;
display: inline-block; display: inline-block;
width: 8px; width: 8px;
height: 8px; height: 8px;
border-radius: 50%; border-radius: 50%;
position: relative; position: relative;
margin-right: 2px; margin-right: 2px;
} }
} }
} }
} }
.tags-view-item.active.has-icon::before { .tags-view-item.active.has-icon::before {
content: none !important; content: none !important;
} }
.contextmenu { .contextmenu {
margin: 0; margin: 0;
background: #fff; background: #fff;
z-index: 3000; z-index: 3000;
position: absolute; position: absolute;
list-style-type: none; list-style-type: none;
padding: 5px 0; padding: 5px 0;
border-radius: 4px; border-radius: 4px;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #333; color: #333;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
li { li {
margin: 0; margin: 0;
padding: 7px 16px; padding: 7px 16px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: #eee; 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; vertical-align: 2px;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
transition: all .3s cubic-bezier(.645, .045, .355, 1); transition: all .3s cubic-bezier(.645, .045, .355, 1);
transform-origin: 100% 50%; transform-origin: 100% 50%;
&: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>
+7 -13
View File
@@ -6,6 +6,7 @@ Vue.use(Router)
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import DialogView from '@/views/earnManage/server/dialogView.vue' import DialogView from '@/views/earnManage/server/dialogView.vue'
import Welcome from '@/views/welcome.vue'
/** /**
* Note: 路由配置项 * Note: 路由配置项
@@ -62,19 +63,12 @@ export const constantRoutes = [
component: () => import('@/views/error/401'), component: () => import('@/views/error/401'),
hidden: true hidden: true
}, },
// { {
// path: '', path: '',
// component: Layout, component: Welcome,
// redirect: 'index', hidden: true,
// children: [ name: 'Welcome'
// { },
// path: 'index',
// component: () => import('@/views/index'),
// name: 'Index',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
// },
{ {
path: '/user', path: '/user',
component: Layout, component: Layout,
+75 -21
View File
@@ -2,22 +2,24 @@
<div class="app-container"> <div class="app-container">
<Form :formList="formList" :ruleFormData="ruleForm" @fnClick="callback"></Form> <Form :formList="formList" :ruleFormData="ruleForm" @fnClick="callback"></Form>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog title="选择包含资源" :visible.sync="open" width="900px" height="300px" append-to-body> <el-dialog title="选择包含资源" :visible.sync="open" width="1000px" height="300px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="按业务名称选择" name="first">用户管理</el-tab-pane> <el-tab-pane label="按业务名称选择" name="first"></el-tab-pane>
<el-tab-pane label="按逻辑节点标识选择" name="second">配置管理</el-tab-pane> <el-tab-pane label="按逻辑节点标识选择" name="second"></el-tab-pane>
</el-tabs> </el-tabs>
<el-row :gutter="20"> <el-row :gutter="20">
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme"> <splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
<pane size="16"> <pane size="20">
<el-col> <el-col>
<div class="head-container"> <div class="head-container">
<el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" ref="tree" node-key="id" default-expand-all highlight-current @node-click="handleNodeClick" /> <el-tree :data="deptOptions" :props="defaultProps" :current-node-key="currentNodeKey" :expand-on-click-node="false" ref="tree" node-key="id" default-expand-all highlight-current @node-click="handleNodeClick" />
</div> </div>
</el-col> </el-col>
</pane> </pane>
<pane size="84"> <pane size="80">
<TableList ref="tabRef" :columns="columns" :config="{colHiddenCheck: true, colTopHiddenIcon: true, currentSel: true}" :queryParams="{total: 0}" :tableList="tableList" @fnClick="callback"></TableList> <div class="block" style="max-height: calc(100vh - 290px);overflow: auto;">
<TableList ref="tabRef" :columns="columns" :config="{colTopHiddenIcon: true}" :queryParams="{total: 0}" :tableList="tableList" @fnClick="callback"></TableList>
</div>
</pane> </pane>
</splitpanes> </splitpanes>
</el-row> </el-row>
@@ -32,10 +34,9 @@
<script setup> <script setup>
import Form from '@/components/form/index.vue'; import Form from '@/components/form/index.vue';
import TableList from "@/components/table/index.vue" import TableList from "@/components/table/index.vue"
import {deptTreeSelect } from "@/api/system/user"
import { Splitpanes, Pane } from "splitpanes" import { Splitpanes, Pane } from "splitpanes"
import {listAllBusinessList, addTaskStatic, switchNameTree} from "@/api/disRevenue/earnManage" import {listAllBusinessList, addTaskStatic, switchNameTree} from "@/api/disRevenue/earnManage"
import {listAllSwitchName, getRegistList} from "@/api/disRevenue/resource" import {getLogicalNode, getRegistList} from "@/api/disRevenue/resource"
import "splitpanes/dist/splitpanes.css" import "splitpanes/dist/splitpanes.css"
export default { export default {
name: 'busValueCount_Details', name: 'busValueCount_Details',
@@ -56,6 +57,11 @@
paramsData: {}, paramsData: {},
busNameList: {}, busNameList: {},
open: false, open: false,
busNameListData: [],
logicalNodeList: [],
currentNodeKey: '',
tableColChange: {},
changeName: null,
tableList: [], tableList: [],
// 列显隐信息 // 列显隐信息
columns: { columns: {
@@ -70,22 +76,59 @@
this.paramsData = this.$route && this.$route.query; this.paramsData = this.$route && this.$route.query;
this.fnFormList(); this.fnFormList();
this.switchList(); this.switchList();
this.getDeptTree(); this.fnLogicalNode();
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); if (this.changeName) {
this.tableColChange[this.changeName] = this.tableColChange[this.changeName] ? this.tableColChange[this.changeName].concat(this.$refs.tabRef.selectList) : this.$refs.tabRef.selectList;
}
this.deptOptions = [];
this.currentNodeKey = null;
if (this.activeName === 'first') {
this.deptOptions = this.busNameListData;
} else {
this.deptOptions = this.logicalNodeList;
}
if (this.deptOptions.length > 1) {
this.changeName = null;
this.handleNodeClick(this.deptOptions[0]);
}
}, },
/** 查询部门下拉树结构 */ // 逻辑节点标识
getDeptTree() { fnLogicalNode() {
deptTreeSelect().then(response => { getLogicalNode().then(val => {
this.deptOptions = response.data; this.logicalNodeList = val && val.map(item => {
}) return Object.assign({}, item,{label: item.logicalNodeId, id: item.logicalNodeId});
});
});
}, },
// 节点单击事件 // 节点单击事件
handleNodeClick(data) { handleNodeClick(data) {
// this.queryParams.deptId = data.id; this.currentNodeKey = data.id;
// this.handleQuery(); if (this.changeName) {
this.tableColChange[this.changeName] = this.tableColChange[this.changeName] ? this.tableColChange[this.changeName].concat(this.$refs.tabRef.selectList) : this.$refs.tabRef.selectList;
}
let params = {logicalNodeId: data.id};
if (this.activeName === 'first') {
params = {businessName: data.id};
}
this.changeName = data.id;
this.getList(params,data.id);
},
getList(val,changeVal) {
this.$modal.loading();
getRegistList(Object.assign({}, {resourceType: 1}, val)).then(val => {
this.tableList = val && val.data || [];
if (this.tableColChange[changeVal] && this.tableColChange[changeVal].length > 0) {
setTimeout(() => {
this.$refs.tabRef.defaultSelectRows(null, this.tableColChange[changeVal]);
},500);
}
this.$modal.closeLoading();
}).catch(() => {
this.$modal.closeLoading();
});
}, },
// formList集合 // formList集合
fnFormList(objVal) { fnFormList(objVal) {
@@ -96,7 +139,7 @@
taskName: {label: '任务名称', span: 18, type: 'input',required: true}, taskName: {label: '任务名称', span: 18, type: 'input',required: true},
businessName: {label: '业务名称', span: 18, type: 'select', options:[]}, businessName: {label: '业务名称', span: 18, type: 'select', options:[]},
resourceType: {label: '包含资源类型', span: 18, type: 'select', eventName: 'change', options: this.dict.type.resource_type, required: true}, resourceType: {label: '包含资源类型', span: 18, type: 'select', eventName: 'change', options: this.dict.type.resource_type, required: true},
includedResourcesTree: {label: '包含资源', span: 18, type: 'treeSelect', options: [], searchable: true, multiple: true, required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '1' ? false : true}, includedResourcesTree: {label: '包含资源', span: 18, type: 'input', required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '1' ? false : true},
changeClientId: {label: '选择ClientID', span: 3, type: 'button', eventName: 'change', hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '1' ? false : true}, changeClientId: {label: '选择ClientID', span: 3, type: 'button', eventName: 'change', hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '1' ? false : true},
includedResources: {label: '包含资源', span: 18, type: 'cascader', options: [], required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '2' ? false : true}, includedResources: {label: '包含资源', span: 18, type: 'cascader', options: [], required: true, hidden: this.ruleForm.resourceType && this.ruleForm.resourceType === '2' ? false : true},
calculationType: {label: '计算类型', span: 18, type: 'select', options: this.dict.type.caculate_type, eventName: 'change', required: true}, calculationType: {label: '计算类型', span: 18, type: 'select', options: this.dict.type.caculate_type, eventName: 'change', required: true},
@@ -108,6 +151,7 @@
switchList() { switchList() {
listAllBusinessList().then(val => { listAllBusinessList().then(val => {
this.formList[0].controls.businessName['options'] = val && val.data.map(item => { this.formList[0].controls.businessName['options'] = val && val.data.map(item => {
this.busNameListData.push(Object.assign({}, item, {id: item.businessName, label: item.businessName}));
this.busNameList[item.businessName] = item; this.busNameList[item.businessName] = item;
return Object.assign({label: item.businessName, value: item.businessName}); return Object.assign({label: item.businessName, value: item.businessName});
}); });
@@ -133,8 +177,16 @@
} }
}, },
submitPubilc() { submitPubilc() {
this.tableColChange[this.changeName] = this.tableColChange[this.changeName] ? this.tableColChange[this.changeName].concat(this.$refs.tabRef.selectList) : this.$refs.tabRef.selectList;
this.open = false; this.open = false;
this.getFormDataList(this.currentDataList.id, 'btnGain'); console.log('tableColChange===',this.tableColChange);
let valList = [];
Object.keys(this.tableColChange).forEach(key => {
if (this.tableColChange[key] && this.tableColChange[key].length > 0) {
valList = valList.concat(this.tableColChange[key].map(item => item.clientId));
}
});
console.log('valList==',valList);
}, },
// 监听事件 // 监听事件
callback(result, dataVal, formVal) { callback(result, dataVal, formVal) {
@@ -150,7 +202,7 @@
this.formList[0].controls.includedResources['hidden'] = false; this.formList[0].controls.includedResources['hidden'] = false;
this.formList[0].controls.includedResourcesTree['hidden'] = true; this.formList[0].controls.includedResourcesTree['hidden'] = true;
} }
this.includeDataList(dataVal); // this.includeDataList(dataVal);
} else { } else {
this.formList[0].controls.includedResourcesTree['hidden'] = true; this.formList[0].controls.includedResourcesTree['hidden'] = true;
this.formList[0].controls.changeClientId['hidden'] = true; this.formList[0].controls.changeClientId['hidden'] = true;
@@ -175,6 +227,8 @@
break; break;
case 'changeClientId': case 'changeClientId':
this.open = true; this.open = true;
this.tableColChange = {};
this.handleClick();
break; break;
case 'submit': case 'submit':
dataVal['calculationMode'] = this.paramsData.calculationMode; dataVal['calculationMode'] = this.paramsData.calculationMode;
+4 -6
View File
@@ -161,7 +161,6 @@
activeName: { activeName: {
handler(val) { handler(val) {
this.getList(); this.getList();
this.busList();
}, },
deep: true, deep: true,
immediate: true immediate: true
@@ -225,11 +224,10 @@
busNameList: [] busNameList: []
} }
}, },
// created() { created() {
// this.$nextTick(() => { // this.getList(1);
// this.getList(1); this.busList();
// }); },
// },
// activated() { // activated() {
// this.$nextTick(() => { // this.$nextTick(() => {
// this.getList(); // this.getList();
+2 -1
View File
@@ -143,7 +143,8 @@ export default {
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
// 默认指向知识库页面 // 默认指向知识库页面
this.$router.push('/problemRecord').catch(()=>{}) // this.$router.push('/problemRecord').catch(()=>{})
this.$router.push('/').catch(()=>{})
// this.$router.push({ path: this.redirect || "/" }).catch(()=>{}) // this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
@@ -260,7 +260,7 @@
getMonitorPolicy(id).then(val => { getMonitorPolicy(id).then(val => {
if (val && val.data) { if (val && val.data) {
if (val.data && val.data.policy) { if (val.data && val.data.policy) {
val.data.policy['policyName'] = btnGain && btnGain ? val.data.policy['policyName'] + '-引用' : val.data.policy['policyName']; val.data.policy['policyName'] = btnGain && btnGain ? val.data.policy['policyName'] + '-' + Date.now() : val.data.policy['policyName'];
val.data.policy['deployDevice'] = val.data.policy.deployDevice.split('\n'); val.data.policy['deployDevice'] = val.data.policy.deployDevice.split('\n');
// val.data.policy['status'] = Number(val.data.policy.status); // val.data.policy['status'] = Number(val.data.policy.status);
this.ruleFormData = val.data.policy; this.ruleFormData = val.data.policy;
@@ -358,8 +358,16 @@
// 3. 操作form(如验证) // 3. 操作form(如验证)
formValid.validate((valid) => { formValid.validate((valid) => {
if (valid) { if (valid) {
formValid.model.deployDevice = formValid.model.deployDevice.join('\n'); let newModel = {};
this.ruleFormData = formValid.model; let newForm = JSON.parse(JSON.stringify(formValid.model));
this.formList.forEach(formCol => {
Object.keys(formCol.controls).forEach(colVal => {
if (!formCol.controls[colVal].hidden && colVal !== 'id') {
newModel[colVal] = newForm[colVal];
}
});
});
this.ruleFormData = newModel;
resolve(true); resolve(true);
} else { } else {
resolve(false); resolve(false);
@@ -393,6 +401,7 @@
let paramsList = idsList.concat(autoIds); let paramsList = idsList.concat(autoIds);
let params = Object.assign(this.ruleFormData, {resourceType: 'switch'},{collectionAndIdList: paramsList}); let params = Object.assign(this.ruleFormData, {resourceType: 'switch'},{collectionAndIdList: paramsList});
params.deployDevice = params.deployDevice.join('\n');
let fnType = addResourcePolicy; let fnType = addResourcePolicy;
if (this.paramsData && this.paramsData.id) { if (this.paramsData && this.paramsData.id) {
fnType = updateResourcePolicy; fnType = updateResourcePolicy;
+22 -14
View File
@@ -21,7 +21,7 @@
<div class="w100 plr-20"> <div class="w100 plr-20">
<div class="menu-container"> <div class="menu-container">
<div v-for="menuItem of menuList" @click="menuRouter(menuItem)" class="menu-item"> <div v-for="menuItem of menuList" @click="menuRouter(menuItem)" class="menu-item">
<div class="menu-item-content">{{menuItem.name}}</div> <div class="menu-item-content">{{menuItem.pageName}}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -29,6 +29,7 @@
</template> </template>
<script> <script>
import {clicMenuCount, getMenuTopEight} from "@/api/menu";
export default { export default {
name: "welcome", name: "welcome",
data() { data() {
@@ -56,25 +57,32 @@
methods: { methods: {
// 处理菜单 // 处理菜单
menuHandle(menu) { menuHandle(menu) {
menu.forEach(item => { // menu.forEach(item => {
if (!item.hidden) { // if (!item.hidden) {
item.children.forEach(val => { // item.children.forEach(val => {
if (!val.hidden) { // if (!val.hidden) {
if (val.children) { // if (val.children) {
val.path = item.path + '/' + val.path; // val.path = item.path + '/' + val.path;
this.menuHandle([val]); // this.menuHandle([val]);
} else { // } else {
this.menuList.push({name: val.meta.title, link: item.path && item.path === '/' ? item.path + val.path : item.path + '/' + val.path}); // this.menuList.push({name: val.meta.title, link: item.path && item.path === '/' ? item.path + val.path : item.path + '/' + val.path});
} // }
} // }
}); // });
// }
// });
getMenuTopEight().then(res => {
if (res && res.data) {
this.menuList = res.data
} }
}); });
}, },
// 菜单跳转 // 菜单跳转
menuRouter(menuLink) { menuRouter(menuLink) {
let params = {pageRoute: menuLink.pageRoute, pageName: menuLink.pageName};
clicMenuCount(params).then(res => {});
this.$router.push({ this.$router.push({
path: menuLink.link path: menuLink.pageRoute
}); });
} }
} }