Merge remote-tracking branch 'origin/codeCheck' into codeCheck
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
'use strict'
|
||||
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 rm = require('rimraf')
|
||||
|
||||
@@ -145,11 +145,51 @@ const webpackConfig = merge(baseWebpackConfig, {
|
||||
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({
|
||||
initialFile: './dist',
|
||||
endPath: './dist',
|
||||
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({
|
||||
onStart:[
|
||||
@@ -157,16 +197,9 @@ const webpackConfig = merge(baseWebpackConfig, {
|
||||
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) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
'use strict'
|
||||
let BUILD_MODE=process.argv.splice(2)[0] || 'prod';
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"',
|
||||
BUILD_MODE:'"'+BUILD_MODE+'"'
|
||||
}
|
||||
|
||||
@@ -902,8 +902,10 @@
|
||||
*/
|
||||
},
|
||||
beforeDestroy(){
|
||||
if(this.scrollbarWrap){
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,7 +488,9 @@
|
||||
beforeDestroy(){
|
||||
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
||||
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -365,6 +365,9 @@
|
||||
return;
|
||||
}
|
||||
this.currentProject = p;
|
||||
if(p.id!==this.$store.state.currentProject.id){
|
||||
bus.$emit("project-page-type", "project");
|
||||
}
|
||||
this.$store.commit("currentProjectChange", p);
|
||||
this.activeItemIndex = p.id;
|
||||
this.jumpTo('/project');
|
||||
@@ -611,7 +614,7 @@
|
||||
}
|
||||
.header .el-menu--horizontal>.icon-menu-item .el-submenu__title {
|
||||
min-width: 50px !important;
|
||||
line-height: 46px;
|
||||
line-height: 50px;
|
||||
/*margin-right:20px;*/
|
||||
}
|
||||
.header .vertical-line{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="sidebar-title too-long-split">{{$t(parentMenu.i18n)}}</div>
|
||||
<div class="sidebar-info" style="height: 90%; overflow: auto;">
|
||||
<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">
|
||||
<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">
|
||||
@@ -172,6 +172,7 @@
|
||||
lastCheckSize:0,
|
||||
assetPingSwitch:true,
|
||||
isRouterAlive: true,
|
||||
projectChoose:[],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -217,7 +218,9 @@
|
||||
this.currentProject = n;
|
||||
if (this.currentProject && this.currentProject.id && this.showProjectPanel) {
|
||||
this.detailProject(this.currentProject);
|
||||
// this.projectChoose=[];
|
||||
}
|
||||
this.changeCurrentModule('');
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -258,6 +261,9 @@
|
||||
getParentMenu(route) {
|
||||
let parentMenu = "";
|
||||
let end = false;
|
||||
if (route != '/project'){
|
||||
this.changeCurrentModule('');
|
||||
}
|
||||
if (route != '/project' && route != '/asset') {
|
||||
this.$store.getters.menuList.forEach(menu => {
|
||||
if (!end) {
|
||||
|
||||
@@ -524,7 +524,9 @@
|
||||
bus.$off("alert-rule-list-change");
|
||||
bus.$off("dc-list-change");
|
||||
bus.$off('alert-message-change');
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
created(){
|
||||
//是否存在分页缓存
|
||||
|
||||
@@ -851,7 +851,9 @@
|
||||
beforeDestroy() {
|
||||
bus.$off("asset-filter-change");
|
||||
bus.$off('alert-message-change');
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -436,7 +436,9 @@
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isCurrentUser() {
|
||||
|
||||
@@ -531,7 +531,9 @@
|
||||
},
|
||||
beforeDestroy(){
|
||||
bus.$off("dc-list-change");
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
created(){
|
||||
//是否存在分页缓存
|
||||
|
||||
@@ -342,7 +342,9 @@
|
||||
this.getTableData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -380,7 +380,9 @@
|
||||
this.getTableData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -383,7 +383,9 @@
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -281,7 +281,9 @@
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isCurrentUser() {
|
||||
|
||||
@@ -317,7 +317,6 @@
|
||||
this.$message.error(this.$t("tip.noAccess"));
|
||||
return;
|
||||
}
|
||||
this.tableData = [];
|
||||
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
|
||||
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
|
||||
this.loading = true;
|
||||
@@ -347,6 +346,7 @@
|
||||
return JSON.parse(JSON.stringify(this.blankPromServer));
|
||||
},
|
||||
pageNo(val) {
|
||||
console.log('page',val)
|
||||
this.pageObj.pageNo = val;
|
||||
this.getTableData();
|
||||
},
|
||||
@@ -434,7 +434,9 @@
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
@@ -319,7 +319,9 @@
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//初始化表头
|
||||
|
||||
@@ -289,7 +289,9 @@
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
created(){
|
||||
//是否存在分页缓存
|
||||
|
||||
@@ -765,7 +765,9 @@
|
||||
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
|
||||
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
|
||||
}
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -226,6 +226,11 @@
|
||||
facade,
|
||||
'delete-button':deleteButton,
|
||||
},
|
||||
computed:{
|
||||
currentProjectChange() {
|
||||
return this.$store.state.currentProject;
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
rightBox:{
|
||||
@@ -844,13 +849,13 @@
|
||||
if (n.length === 0 && 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
|
||||
}else{
|
||||
this.delFlag=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
bus.$off("project-page-type");
|
||||
@@ -860,7 +865,9 @@
|
||||
bus.$off("module-list-change");
|
||||
bus.$off("endpoint-list-change");
|
||||
bus.$off('alert-message-change');
|
||||
if(this.scrollbarWrap){
|
||||
this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
|
||||
};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user