业务95值计算的新增任务、交换机监控策略
、交换机监控策略表单引用功能修改 2、欢迎页开发并联调(100%) 3、业务95值计算新增任务表单功能修改(80%)
This commit is contained in:
@@ -720,7 +720,7 @@ export function getLogicalNode() {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 所有资源管理的列表
|
||||
export function getRegistList(query) {
|
||||
return request({
|
||||
url: '/system/registration/getRegistList',
|
||||
|
||||
@@ -24,3 +24,18 @@ export function getColumnList(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'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -369,6 +369,7 @@
|
||||
this.selectList = [];
|
||||
this.ids = [];
|
||||
if (tableInstance) {
|
||||
console.log('rows===',rows);
|
||||
if (rows && rows.length > 0) {
|
||||
rows.forEach(row => {
|
||||
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() {
|
||||
this.$emit("fnRenderList");
|
||||
},
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
:active-text-color="settings.theme"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
@select="handleMenuSelect"
|
||||
>
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
@@ -28,6 +29,7 @@ import { mapGetters, mapState } from "vuex"
|
||||
import Logo from "./Logo"
|
||||
import SidebarItem from "./SidebarItem"
|
||||
import variables from "@/assets/styles/variables.scss"
|
||||
import {clicMenuCount} from "@/api/menu";
|
||||
|
||||
export default {
|
||||
components: { SidebarItem, Logo },
|
||||
@@ -52,6 +54,39 @@ export default {
|
||||
isCollapse() {
|
||||
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>
|
||||
|
||||
+7
-13
@@ -6,6 +6,7 @@ Vue.use(Router)
|
||||
/* Layout */
|
||||
import Layout from '@/layout'
|
||||
import DialogView from '@/views/earnManage/server/dialogView.vue'
|
||||
import Welcome from '@/views/welcome.vue'
|
||||
|
||||
/**
|
||||
* Note: 路由配置项
|
||||
@@ -62,19 +63,12 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// redirect: 'index',
|
||||
// children: [
|
||||
// {
|
||||
// path: 'index',
|
||||
// component: () => import('@/views/index'),
|
||||
// name: 'Index',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '',
|
||||
component: Welcome,
|
||||
hidden: true,
|
||||
name: 'Welcome'
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
|
||||
@@ -2,22 +2,24 @@
|
||||
<div class="app-container">
|
||||
<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-tab-pane label="按业务名称选择" name="first">用户管理</el-tab-pane>
|
||||
<el-tab-pane label="按逻辑节点标识选择" name="second">配置管理</el-tab-pane>
|
||||
<el-tab-pane label="按业务名称选择" name="first"></el-tab-pane>
|
||||
<el-tab-pane label="按逻辑节点标识选择" name="second"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-row :gutter="20">
|
||||
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
|
||||
<pane size="16">
|
||||
<pane size="20">
|
||||
<el-col>
|
||||
<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>
|
||||
</el-col>
|
||||
</pane>
|
||||
<pane size="84">
|
||||
<TableList ref="tabRef" :columns="columns" :config="{colHiddenCheck: true, colTopHiddenIcon: true, currentSel: true}" :queryParams="{total: 0}" :tableList="tableList" @fnClick="callback"></TableList>
|
||||
<pane size="80">
|
||||
<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>
|
||||
</splitpanes>
|
||||
</el-row>
|
||||
@@ -32,10 +34,9 @@
|
||||
<script setup>
|
||||
import Form from '@/components/form/index.vue';
|
||||
import TableList from "@/components/table/index.vue"
|
||||
import {deptTreeSelect } from "@/api/system/user"
|
||||
import { Splitpanes, Pane } from "splitpanes"
|
||||
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"
|
||||
export default {
|
||||
name: 'busValueCount_Details',
|
||||
@@ -56,6 +57,11 @@
|
||||
paramsData: {},
|
||||
busNameList: {},
|
||||
open: false,
|
||||
busNameListData: [],
|
||||
logicalNodeList: [],
|
||||
currentNodeKey: '',
|
||||
tableColChange: {},
|
||||
changeName: null,
|
||||
tableList: [],
|
||||
// 列显隐信息
|
||||
columns: {
|
||||
@@ -70,22 +76,59 @@
|
||||
this.paramsData = this.$route && this.$route.query;
|
||||
this.fnFormList();
|
||||
this.switchList();
|
||||
this.getDeptTree();
|
||||
this.fnLogicalNode();
|
||||
},
|
||||
methods: {
|
||||
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() {
|
||||
deptTreeSelect().then(response => {
|
||||
this.deptOptions = response.data;
|
||||
})
|
||||
// 逻辑节点标识
|
||||
fnLogicalNode() {
|
||||
getLogicalNode().then(val => {
|
||||
this.logicalNodeList = val && val.map(item => {
|
||||
return Object.assign({}, item,{label: item.logicalNodeId, id: item.logicalNodeId});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
// this.queryParams.deptId = data.id;
|
||||
// this.handleQuery();
|
||||
this.currentNodeKey = data.id;
|
||||
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集合
|
||||
fnFormList(objVal) {
|
||||
@@ -96,7 +139,7 @@
|
||||
taskName: {label: '任务名称', span: 18, type: 'input',required: true},
|
||||
businessName: {label: '业务名称', span: 18, type: 'select', options:[]},
|
||||
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},
|
||||
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},
|
||||
@@ -108,6 +151,7 @@
|
||||
switchList() {
|
||||
listAllBusinessList().then(val => {
|
||||
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;
|
||||
return Object.assign({label: item.businessName, value: item.businessName});
|
||||
});
|
||||
@@ -133,8 +177,16 @@
|
||||
}
|
||||
},
|
||||
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.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) {
|
||||
@@ -150,7 +202,7 @@
|
||||
this.formList[0].controls.includedResources['hidden'] = false;
|
||||
this.formList[0].controls.includedResourcesTree['hidden'] = true;
|
||||
}
|
||||
this.includeDataList(dataVal);
|
||||
// this.includeDataList(dataVal);
|
||||
} else {
|
||||
this.formList[0].controls.includedResourcesTree['hidden'] = true;
|
||||
this.formList[0].controls.changeClientId['hidden'] = true;
|
||||
@@ -175,6 +227,8 @@
|
||||
break;
|
||||
case 'changeClientId':
|
||||
this.open = true;
|
||||
this.tableColChange = {};
|
||||
this.handleClick();
|
||||
break;
|
||||
case 'submit':
|
||||
dataVal['calculationMode'] = this.paramsData.calculationMode;
|
||||
|
||||
@@ -161,7 +161,6 @@
|
||||
activeName: {
|
||||
handler(val) {
|
||||
this.getList();
|
||||
this.busList();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
@@ -225,11 +224,10 @@
|
||||
busNameList: []
|
||||
}
|
||||
},
|
||||
// created() {
|
||||
// this.$nextTick(() => {
|
||||
created() {
|
||||
// this.getList(1);
|
||||
// });
|
||||
// },
|
||||
this.busList();
|
||||
},
|
||||
// activated() {
|
||||
// this.$nextTick(() => {
|
||||
// this.getList();
|
||||
|
||||
+2
-1
@@ -143,7 +143,8 @@ export default {
|
||||
}
|
||||
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(()=>{})
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
getMonitorPolicy(id).then(val => {
|
||||
if (val && val.data) {
|
||||
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['status'] = Number(val.data.policy.status);
|
||||
this.ruleFormData = val.data.policy;
|
||||
@@ -358,8 +358,16 @@
|
||||
// 3. 操作form(如验证)
|
||||
formValid.validate((valid) => {
|
||||
if (valid) {
|
||||
formValid.model.deployDevice = formValid.model.deployDevice.join('\n');
|
||||
this.ruleFormData = formValid.model;
|
||||
let newModel = {};
|
||||
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);
|
||||
} else {
|
||||
resolve(false);
|
||||
@@ -393,6 +401,7 @@
|
||||
|
||||
let paramsList = idsList.concat(autoIds);
|
||||
let params = Object.assign(this.ruleFormData, {resourceType: 'switch'},{collectionAndIdList: paramsList});
|
||||
params.deployDevice = params.deployDevice.join('\n');
|
||||
let fnType = addResourcePolicy;
|
||||
if (this.paramsData && this.paramsData.id) {
|
||||
fnType = updateResourcePolicy;
|
||||
|
||||
+22
-14
@@ -21,7 +21,7 @@
|
||||
<div class="w100 plr-20">
|
||||
<div class="menu-container">
|
||||
<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>
|
||||
@@ -29,6 +29,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {clicMenuCount, getMenuTopEight} from "@/api/menu";
|
||||
export default {
|
||||
name: "welcome",
|
||||
data() {
|
||||
@@ -56,25 +57,32 @@
|
||||
methods: {
|
||||
// 处理菜单
|
||||
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 {
|
||||
this.menuList.push({name: val.meta.title, link: item.path && item.path === '/' ? item.path + val.path : item.path + '/' + val.path});
|
||||
}
|
||||
}
|
||||
});
|
||||
// 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 {
|
||||
// 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) {
|
||||
let params = {pageRoute: menuLink.pageRoute, pageName: menuLink.pageName};
|
||||
clicMenuCount(params).then(res => {});
|
||||
this.$router.push({
|
||||
path: menuLink.link
|
||||
path: menuLink.pageRoute
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user