* 增加Docker开发环境

* 更新Dockerfile构建文件,升级NodeJS依赖版本。
 * 遵循ESLint重新格式化代码,修复部分警告
 * 登录Token失效增加登出提示
 * 网络请求问题增加错误错误提示
 * 升级UI依赖库
This commit is contained in:
yaziming
2020-06-19 16:57:00 +08:00
parent e7ff02589b
commit aeaa4493a7
129 changed files with 18222 additions and 14180 deletions

View File

@@ -1,18 +1,21 @@
<template>
<el-tree
:data="docData"
ref="documentation-tree"
:data="docData"
node-key="fullUrl"
>
<span class="custom-tree-node" :class="[data.active ? 'active' : '', `level-${data.level}`]"
slot-scope="{ node, data }">
<span
slot-scope="{ node, data }"
class="custom-tree-node"
:class="[data.active ? 'active' : '', `level-${data.level}`]"
>
<template v-if="data.level === 1 && data.children && data.children.length">
<span>{{node.label}}</span>
<span>{{ node.label }}</span>
</template>
<template v-else>
<span>
<a :href="data.fullUrl" target="_blank" style="display: block" @click="onClickDocumentationLink">
{{node.label}}
{{ node.label }}
</a>
</span>
</template>
@@ -21,86 +24,86 @@
</template>
<script>
import {
mapState
} from 'vuex'
import {
mapState
} from 'vuex'
export default {
name: 'Documentation',
data () {
return {
data: []
}
},
computed: {
...mapState('doc', [
'docData'
]),
pathLv1 () {
if (this.$route.path === '/') return '/'
const m = this.$route.path.match(/(^\/\w+)/)
return m[1]
},
currentDoc () {
// find current doc
let currentDoc
for (let i = 0; i < this.$utils.doc.docs.length; i++) {
const doc = this.$utils.doc.docs[i]
if (this.pathLv1 === doc.path) {
currentDoc = doc
break
}
export default {
name: 'Documentation',
data() {
return {
data: []
}
return currentDoc
}
},
watch: {
pathLv1 () {
},
computed: {
...mapState('doc', [
'docData'
]),
pathLv1() {
if (this.$route.path === '/') return '/'
const m = this.$route.path.match(/(^\/\w+)/)
return m[1]
},
currentDoc() {
// find current doc
let currentDoc
for (let i = 0; i < this.$utils.doc.docs.length; i++) {
const doc = this.$utils.doc.docs[i]
if (this.pathLv1 === doc.path) {
currentDoc = doc
break
}
}
return currentDoc
}
},
watch: {
pathLv1() {
this.update()
}
},
async created() {
},
mounted() {
this.update()
}
},
methods: {
isActiveNode (d) {
// check match
if (!this.currentDoc) return false
return !!d.url.match(this.currentDoc.pattern)
},
update () {
// expand related documentation list
setTimeout(() => {
this.docData.forEach(d => {
// parent node
const isActive = this.isActiveNode(d)
const node = this.$refs['documentation-tree'].getNode(d)
node.expanded = isActive
this.$set(d, 'active', isActive)
methods: {
isActiveNode(d) {
// check match
if (!this.currentDoc) return false
return !!d.url.match(this.currentDoc.pattern)
},
update() {
// expand related documentation list
setTimeout(() => {
this.docData.forEach(d => {
// parent node
const isActive = this.isActiveNode(d)
const node = this.$refs['documentation-tree'].getNode(d)
node.expanded = isActive
this.$set(d, 'active', isActive)
// child nodes
d.children.forEach(c => {
const node = this.$refs['documentation-tree'].getNode(c)
const isActive = this.isActiveNode(c)
if (!node.parent.expanded && isActive) {
node.parent.expanded = true
}
this.$set(c, 'active', isActive)
// child nodes
d.children.forEach(c => {
const node = this.$refs['documentation-tree'].getNode(c)
const isActive = this.isActiveNode(c)
if (!node.parent.expanded && isActive) {
node.parent.expanded = true
}
this.$set(c, 'active', isActive)
})
})
})
}, 100)
},
async getDocumentationData () {
// fetch api data
await this.$store.dispatch('doc/getDocData')
},
onClickDocumentationLink () {
this.$st.sendEv('全局', '点击右侧文档链接')
}, 100)
},
async getDocumentationData() {
// fetch api data
await this.$store.dispatch('doc/getDocData')
},
onClickDocumentationLink() {
this.$st.sendEv('全局', '点击右侧文档链接')
}
}
},
async created () {
},
mounted () {
this.update()
}
}
</script>
<style scoped>
.el-tree >>> .custom-tree-node.active {