feat: 添加导出html的i18n的数据
This commit is contained in:
@@ -99,12 +99,24 @@ if (arg === 'html') {
|
||||
inlineSource: '.(js|css)$', // embed all javascript and css inline
|
||||
hash: false,
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
// minify: {
|
||||
// removeComments: true,
|
||||
// collapseWhitespace: true,
|
||||
// removeAttributeQuotes: true
|
||||
// // more options:
|
||||
// // https://github.com/kangax/html-minifier#options-quick-reference
|
||||
// },
|
||||
minify: { // 压缩html
|
||||
collapseWhitespace: true, // 折叠空白区域
|
||||
keepClosingSlash: true, // 保持闭合间隙
|
||||
removeComments: true, // 移除注释
|
||||
removeRedundantAttributes: true, // 删除冗余属性
|
||||
removeScriptTypeAttributes: true, // 删除Script脚本类型属性
|
||||
removeStyleLinkTypeAttributes: true, // 删除样式链接类型属性
|
||||
useShortDoctype: true, // 使用短文档类型
|
||||
preserveLineBreaks: true, // 保留换行符
|
||||
minifyCSS: true, // 压缩文内css
|
||||
minifyJS: true // 压缩文内js
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency',
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = {
|
||||
},
|
||||
// Various Dev Server settings
|
||||
// host: '0.0.0.0', // can be overwritten by process.env.HOST
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
host: '0.0.0.0', // can be overwritten by process.env.HOST
|
||||
port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{{chartInfo.name}}
|
||||
<span v-show="chartInfo.param.collapse" class="collapse-content">({{chartData ? chartData.length : 0}} charts)</span>
|
||||
</div>
|
||||
<div class="chart-header__tools" v-if="chartInfo.type !== 'endpointInfo' && chartInfo.type !== 'assetInfo'">
|
||||
<div class="chart-header__tools" v-if="chartInfo.type !== 'endpointInfo' && chartInfo.type !== 'assetInfo' && !isExportHtml">
|
||||
<span v-if="chartInfo.param.link" class="chart-header__tool" @click="openUrl">
|
||||
<i class="nz-icon nz-icon-more-app tool__icon"></i>
|
||||
</span>
|
||||
|
||||
@@ -22,6 +22,10 @@ export default {
|
||||
allDataLength: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
isExportHtml: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
||||
@@ -108,7 +108,10 @@ export default {
|
||||
groupInfo: {},
|
||||
from: String,
|
||||
dataList: Array, // 看板中所有图表信息
|
||||
isExportHtml: false
|
||||
isExportHtml: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
GridLayout: GridLayout,
|
||||
@@ -425,9 +428,9 @@ export default {
|
||||
window.addEventListener('resize', this.resize)
|
||||
}
|
||||
if (this.isExportHtml) {
|
||||
this.$nextTick(() => {
|
||||
setTimeout(()=>{
|
||||
this.onScroll(999999)
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<chart-header
|
||||
v-if="!isFullscreen&&showHeader"
|
||||
:is-group="isGroup(chartInfo.type)"
|
||||
:isExportHtml="isExportHtml"
|
||||
:isError="isError"
|
||||
:chartData="chartData"
|
||||
:chart-info="chartInfo"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import bus from '@/libs/bus'
|
||||
import { hasButton } from '@/permission'
|
||||
import i18n from '@/components/common/i18n'
|
||||
export default {
|
||||
methods: {
|
||||
@@ -34,9 +33,6 @@ export default {
|
||||
timeFormate (time) {
|
||||
return bus.timeFormate(time)
|
||||
},
|
||||
hasButton (code) {
|
||||
return hasButton(this.$store.getters.buttonList, code)
|
||||
},
|
||||
numberWithEConvent (num) {
|
||||
if (num) {
|
||||
if ((('' + num).indexOf('E') !== -1) || (('' + num).indexOf('e') !== -1)) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -114,7 +114,12 @@ Vue.mixin({
|
||||
return this.$route.path
|
||||
}
|
||||
},
|
||||
...mainMixin
|
||||
methods: {
|
||||
hasButton (code) {
|
||||
return hasButton(this.$store.getters.buttonList, code)
|
||||
},
|
||||
...mainMixin.methods
|
||||
}
|
||||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
// import '@/assets/stylus/index.scss'
|
||||
// import 'element-ui/lib/theme-chalk/index.css'
|
||||
import 'xterm/dist/xterm.css'
|
||||
// import 'xterm/dist/xterm.css'
|
||||
import '@/assets/css/main.scss'
|
||||
import '@/assets/css/font/iconfont.js'
|
||||
// import '@/assets/css/font/iconfont.js'
|
||||
import ElementUI from 'element-ui'
|
||||
import i18n from '@/components/common/i18n'
|
||||
|
||||
@@ -13,7 +13,7 @@ import App from './App.vue'
|
||||
import router from '@/router/exportHtmlRouter'
|
||||
import VueResource from 'vue-resource'
|
||||
import axios from 'axios'
|
||||
import { hasPermission } from '@/permission'
|
||||
// import { hasPermission } from '@/permission'
|
||||
import loadsh from 'lodash'
|
||||
|
||||
import { post, get, put, del } from '@/http.js'
|
||||
@@ -91,6 +91,13 @@ Vue.config.productionTip = false
|
||||
Vue.use(ElementUI)
|
||||
Vue.use(Vuex)
|
||||
Vue.use(VueResource)
|
||||
const hasPermission = {
|
||||
install (Vue, options) {
|
||||
Vue.directive('has', {
|
||||
inserted: (el, binding, vnode) => {}
|
||||
})
|
||||
}
|
||||
}
|
||||
Vue.use(hasPermission)
|
||||
|
||||
/* 指令 */
|
||||
|
||||
6
nezha-fronted/src/entrance/exportHtml/i18nData.js
Normal file
6
nezha-fronted/src/entrance/exportHtml/i18nData.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
Vue.use(Router)
|
||||
console.log('router1')
|
||||
export default new Router({
|
||||
routes: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user