Merge remote-tracking branch 'origin/codeCheck' into codeCheck
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
require('./check-versions')()
|
require('./check-versions')()
|
||||||
|
|
||||||
process.env.NODE_ENV = 'production'
|
let arg = process.argv.splice(2)[0];
|
||||||
|
process.env.NODE_ENV = arg == 'dev' ? 'development' : 'production'
|
||||||
|
process.env.BUILD_MODE = arg
|
||||||
|
|
||||||
const ora = require('ora')
|
const ora = require('ora')
|
||||||
const rm = require('rimraf')
|
const rm = require('rimraf')
|
||||||
|
|||||||
@@ -145,11 +145,51 @@ const webpackConfig = merge(baseWebpackConfig, {
|
|||||||
ignore: ['*']
|
ignore: ['*']
|
||||||
}
|
}
|
||||||
]),
|
]),
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
if(process.env.NODE_ENV == 'development'){
|
||||||
|
webpackConfig.plugins.push(
|
||||||
|
new fileManagerPlugin({
|
||||||
|
onStart:[
|
||||||
|
{
|
||||||
|
delete:[path.join(__dirname,'../dist/') ]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
onEnd: [
|
||||||
|
{
|
||||||
|
move:[
|
||||||
|
{ source: path.join(__dirname,'../dist','/static/config.json'), destination: path.join(__dirname,'../dist/config.json') },
|
||||||
|
{ source: path.join(__dirname,'../dist','/static'), destination: path.join(__dirname,'../dist','/nezha') }
|
||||||
|
],
|
||||||
|
mkdir:[
|
||||||
|
path.join(__dirname,'../dist','/static')
|
||||||
|
],
|
||||||
|
copy:[
|
||||||
|
{ source: path.join(__dirname,'../dist','/config.json'), destination: path.join(__dirname,'../dist','/static/config.json') }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
delete:[
|
||||||
|
path.join(__dirname,'../dist','/config.json')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
archive:[
|
||||||
|
{ source: path.join(__dirname,'../dist'), destination: path.join(__dirname,'../dist','/nz-gui.zip') }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
|
||||||
|
)
|
||||||
|
}else{
|
||||||
|
webpackConfig.plugins.push(
|
||||||
new WebpackZipPlugin({
|
new WebpackZipPlugin({
|
||||||
initialFile: './dist',
|
initialFile: './dist',
|
||||||
endPath: './dist',
|
endPath: './dist',
|
||||||
zipName: 'nz-gui.zip',
|
zipName: 'nz-gui.zip',
|
||||||
behindShell: 'cd '+path.join(__dirname,'../dist/')+";md5=`md5sum nz-gui.zip |awk '{print $1}'|cut -c 1-8`;mv nz-gui.zip nz-gui-${md5}.zip"+(process.env.BUILD_MODE=='all'?'mkdir -p dist/static;cp -r ../static/Tiles dist/static/;zip -gr nz-gui-${md5}.zip dist/static/Tiles;rm -rf dist;':'')
|
behindShell: 'cd '+path.join(__dirname,'../dist/')+";md5=`md5sum nz-gui.zip |awk '{print $1}'|cut -c 1-8`;mv nz-gui.zip nz-gui-${md5}.zip;"+(process.env.BUILD_MODE=='all'?'mkdir -p ./dist/static;echo "start add map picture to zip file,it will take a few moment,please wait...";cp -r ../static/Tiles dist/static/;zip -gr nz-gui-${md5}.zip dist/static/Tiles>/dev/null;rm -rf dist;':'')
|
||||||
}),
|
}),
|
||||||
new fileManagerPlugin({
|
new fileManagerPlugin({
|
||||||
onStart:[
|
onStart:[
|
||||||
@@ -157,16 +197,9 @@ const webpackConfig = merge(baseWebpackConfig, {
|
|||||||
delete:[path.join(__dirname,'../dist/') ]
|
delete:[path.join(__dirname,'../dist/') ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// onEnd: [
|
|
||||||
// {
|
|
||||||
// move:[
|
|
||||||
// { source: path.join(__dirname,'../dist','/nz-gui.zip'), destination: path.join(__dirname,'../dist','/nz-gui-[chunkhash].zip') }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
})
|
})
|
||||||
]
|
)
|
||||||
})
|
}
|
||||||
|
|
||||||
if (config.build.productionGzip) {
|
if (config.build.productionGzip) {
|
||||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
let BUILD_MODE=process.argv.splice(2)[0] || 'prod';
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
BUILD_MODE:'"'+BUILD_MODE+'"'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -902,8 +902,10 @@
|
|||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
|
if(this.scrollbarWrap){
|
||||||
if(this.scrollbarWrap){
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -488,7 +488,9 @@
|
|||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
||||||
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -365,6 +365,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentProject = p;
|
this.currentProject = p;
|
||||||
|
if(p.id!==this.$store.state.currentProject.id){
|
||||||
|
bus.$emit("project-page-type", "project");
|
||||||
|
}
|
||||||
this.$store.commit("currentProjectChange", p);
|
this.$store.commit("currentProjectChange", p);
|
||||||
this.activeItemIndex = p.id;
|
this.activeItemIndex = p.id;
|
||||||
this.jumpTo('/project');
|
this.jumpTo('/project');
|
||||||
@@ -611,7 +614,7 @@
|
|||||||
}
|
}
|
||||||
.header .el-menu--horizontal>.icon-menu-item .el-submenu__title {
|
.header .el-menu--horizontal>.icon-menu-item .el-submenu__title {
|
||||||
min-width: 50px !important;
|
min-width: 50px !important;
|
||||||
line-height: 46px;
|
line-height: 50px;
|
||||||
/*margin-right:20px;*/
|
/*margin-right:20px;*/
|
||||||
}
|
}
|
||||||
.header .vertical-line{
|
.header .vertical-line{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="sidebar-title too-long-split">{{$t(parentMenu.i18n)}}</div>
|
<div class="sidebar-title too-long-split">{{$t(parentMenu.i18n)}}</div>
|
||||||
<div class="sidebar-info" style="height: 90%; overflow: auto;">
|
<div class="sidebar-info" style="height: 90%; overflow: auto;">
|
||||||
<template v-if="parentMenu == '/project'">
|
<template v-if="parentMenu == '/project'">
|
||||||
<el-collapse accordion class="left-menu-bg" ref="projectLeft" style="padding-top: 0;">
|
<el-collapse v-model="projectChoose" accordion class="left-menu-bg" ref="projectLeft" style="padding-top: 0;">
|
||||||
<el-collapse-item :key="item.id" :name="item.id + ''" v-for="(item, index) in projectList">
|
<el-collapse-item :key="item.id" :name="item.id + ''" v-for="(item, index) in projectList">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div :class="{'sidebar-info-item-active': item.id == currentProject.id}" :id="'project-module-'+item.id" @click="detailProject(item)" class="sidebar-info-item-project sidebar-info-item">
|
<div :class="{'sidebar-info-item-active': item.id == currentProject.id}" :id="'project-module-'+item.id" @click="detailProject(item)" class="sidebar-info-item-project sidebar-info-item">
|
||||||
@@ -172,6 +172,7 @@
|
|||||||
lastCheckSize:0,
|
lastCheckSize:0,
|
||||||
assetPingSwitch:true,
|
assetPingSwitch:true,
|
||||||
isRouterAlive: true,
|
isRouterAlive: true,
|
||||||
|
projectChoose:[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -217,7 +218,9 @@
|
|||||||
this.currentProject = n;
|
this.currentProject = n;
|
||||||
if (this.currentProject && this.currentProject.id && this.showProjectPanel) {
|
if (this.currentProject && this.currentProject.id && this.showProjectPanel) {
|
||||||
this.detailProject(this.currentProject);
|
this.detailProject(this.currentProject);
|
||||||
|
// this.projectChoose=[];
|
||||||
}
|
}
|
||||||
|
this.changeCurrentModule('');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -258,6 +261,9 @@
|
|||||||
getParentMenu(route) {
|
getParentMenu(route) {
|
||||||
let parentMenu = "";
|
let parentMenu = "";
|
||||||
let end = false;
|
let end = false;
|
||||||
|
if (route != '/project'){
|
||||||
|
this.changeCurrentModule('');
|
||||||
|
}
|
||||||
if (route != '/project' && route != '/asset') {
|
if (route != '/project' && route != '/asset') {
|
||||||
this.$store.getters.menuList.forEach(menu => {
|
this.$store.getters.menuList.forEach(menu => {
|
||||||
if (!end) {
|
if (!end) {
|
||||||
|
|||||||
@@ -524,7 +524,9 @@
|
|||||||
bus.$off("alert-rule-list-change");
|
bus.$off("alert-rule-list-change");
|
||||||
bus.$off("dc-list-change");
|
bus.$off("dc-list-change");
|
||||||
bus.$off('alert-message-change');
|
bus.$off('alert-message-change');
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
//是否存在分页缓存
|
//是否存在分页缓存
|
||||||
|
|||||||
@@ -851,7 +851,9 @@
|
|||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
bus.$off("asset-filter-change");
|
bus.$off("asset-filter-change");
|
||||||
bus.$off('alert-message-change');
|
bus.$off('alert-message-change');
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -436,7 +436,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isCurrentUser() {
|
isCurrentUser() {
|
||||||
|
|||||||
@@ -531,7 +531,9 @@
|
|||||||
},
|
},
|
||||||
beforeDestroy(){
|
beforeDestroy(){
|
||||||
bus.$off("dc-list-change");
|
bus.$off("dc-list-change");
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
//是否存在分页缓存
|
//是否存在分页缓存
|
||||||
|
|||||||
@@ -342,7 +342,9 @@
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -380,7 +380,9 @@
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -383,7 +383,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -281,7 +281,9 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isCurrentUser() {
|
isCurrentUser() {
|
||||||
|
|||||||
@@ -317,7 +317,6 @@
|
|||||||
this.$message.error(this.$t("tip.noAccess"));
|
this.$message.error(this.$t("tip.noAccess"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.tableData = [];
|
|
||||||
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
||||||
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -347,6 +346,7 @@
|
|||||||
return JSON.parse(JSON.stringify(this.blankPromServer));
|
return JSON.parse(JSON.stringify(this.blankPromServer));
|
||||||
},
|
},
|
||||||
pageNo(val) {
|
pageNo(val) {
|
||||||
|
console.log('page',val)
|
||||||
this.pageObj.pageNo = val;
|
this.pageObj.pageNo = val;
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
@@ -434,7 +434,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -319,7 +319,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//初始化表头
|
//初始化表头
|
||||||
|
|||||||
@@ -289,7 +289,9 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
//是否存在分页缓存
|
//是否存在分页缓存
|
||||||
|
|||||||
@@ -765,7 +765,9 @@
|
|||||||
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
||||||
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
||||||
}
|
}
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -226,6 +226,11 @@
|
|||||||
facade,
|
facade,
|
||||||
'delete-button':deleteButton,
|
'delete-button':deleteButton,
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
currentProjectChange() {
|
||||||
|
return this.$store.state.currentProject;
|
||||||
|
}
|
||||||
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
rightBox:{
|
rightBox:{
|
||||||
@@ -844,13 +849,13 @@
|
|||||||
if (n.length === 0 && this.endpointPageObj.pageNo > 1) {
|
if (n.length === 0 && this.endpointPageObj.pageNo > 1) {
|
||||||
this.endpointPageNo(this.endpointPageObj.pageNo-1);
|
this.endpointPageNo(this.endpointPageObj.pageNo-1);
|
||||||
}
|
}
|
||||||
if(!this.delFlag){ // 不是删除时回到顶部 以及修改时
|
if(!this.delFlag&&this.pageType==='endpoint'){ // 不是删除时回到顶部 以及修改时
|
||||||
this.$refs.endpointTable.bodyWrapper.scrollTop = 0
|
this.$refs.endpointTable.bodyWrapper.scrollTop = 0
|
||||||
}else{
|
}else{
|
||||||
this.delFlag=false;
|
this.delFlag=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
bus.$off("project-page-type");
|
bus.$off("project-page-type");
|
||||||
@@ -860,7 +865,9 @@
|
|||||||
bus.$off("module-list-change");
|
bus.$off("module-list-change");
|
||||||
bus.$off("endpoint-list-change");
|
bus.$off("endpoint-list-change");
|
||||||
bus.$off('alert-message-change');
|
bus.$off('alert-message-change');
|
||||||
|
if(this.scrollbarWrap){
|
||||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||||
|
};
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user