Commit 55726fbf authored by 何虹's avatar 何虹 💬

优化

parent d1c391c6
...@@ -3,9 +3,6 @@ import App from './App.vue' ...@@ -3,9 +3,6 @@ import App from './App.vue'
import './packages/index' import './packages/index'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import 'jsoneditor/dist/jsoneditor.min.css'
import jsoneditor from 'jsoneditor'
Vue.prototype.$jsoneditor = jsoneditor
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI) Vue.use(ElementUI)
new Vue({ new Vue({
......
...@@ -106,6 +106,8 @@ import request from '../funTools/request' ...@@ -106,6 +106,8 @@ import request from '../funTools/request'
import lookPageLog from './lookPageLog.vue' import lookPageLog from './lookPageLog.vue'
import asyncFormPropSet from './asyncFormPropSet.vue' import asyncFormPropSet from './asyncFormPropSet.vue'
import tbaleColumsSet from './tbaleColumsSet.vue' import tbaleColumsSet from './tbaleColumsSet.vue'
import 'jsoneditor/dist/jsoneditor.min.css'
import jsoneditor from 'jsoneditor'
// const lookPageLog = r => require.ensure([], () => r(require('./lookPageLog.vue')), 'lookPageLog') // const lookPageLog = r => require.ensure([], () => r(require('./lookPageLog.vue')), 'lookPageLog')
// const asyncFormPropSet = r => require.ensure([], () => r(require('./asyncFormPropSet.vue')), 'asyncFormPropSet') // const asyncFormPropSet = r => require.ensure([], () => r(require('./asyncFormPropSet.vue')), 'asyncFormPropSet')
// const tbaleColumsSet = r => require.ensure([], () => r(require('./tbaleColumsSet.vue')), 'tbaleColumsSet') // const tbaleColumsSet = r => require.ensure([], () => r(require('./tbaleColumsSet.vue')), 'tbaleColumsSet')
...@@ -492,7 +494,7 @@ export default { ...@@ -492,7 +494,7 @@ export default {
}, },
drow(el, json = {}, flage) { drow(el, json = {}, flage) {
const container = document.getElementById(el) const container = document.getElementById(el)
this[flage] = new this.$jsoneditor(container, this.options) this[flage] = new jsoneditor(container, this.options)
this[flage].set(json) this[flage].set(json)
} }
} }
......
import uuidv1 from 'uuid/v1' import uuidv1 from 'uuid/v1'
export default { export default {
data() { data () {
return { return {
elId: '', elId: '',
outBoxDom: null outBoxDom: null
} }
}, },
created() { created () {
this.elId = uuidv1() // 获取随机id this.elId = uuidv1() // 获取随机id
}, },
mounted() { mounted () {
this.$nextTick(_ => { this.$nextTick(_ => {
this.showEditJsonDialog() this.showEditJsonDialog()
}) })
}, },
destroyed() { destroyed () {
if (this.outBoxDom) { if (this.outBoxDom) {
this.outBoxDom.removeEventListener('mousedown', this.boxEventMouse) this.outBoxDom.removeEventListener('mousedown', this.boxEventMouse)
} }
this.chart = null this.chart = null
}, },
beforeDestroy() { beforeDestroy () {
clearInterval(this.timer)// 清除定时器 clearInterval(this.timer)// 清除定时器
this.timer = null this.timer = null
if (this.chart) { if (this.chart) {
...@@ -31,7 +32,7 @@ export default { ...@@ -31,7 +32,7 @@ export default {
} }
}, },
methods: { methods: {
boxEventMouse(event) { boxEventMouse (event) {
const that = this const that = this
event.stopPropagation() event.stopPropagation()
if (event.shiftKey && event.altKey && !event.ctrlKey) { if (event.shiftKey && event.altKey && !event.ctrlKey) {
...@@ -40,7 +41,7 @@ export default { ...@@ -40,7 +41,7 @@ export default {
} }
}, },
// 弹出可编辑的弹框 // 弹出可编辑的弹框
showEditJsonDialog() { showEditJsonDialog () {
this.outBoxDom = document.getElementById(this.elId) this.outBoxDom = document.getElementById(this.elId)
this.outBoxDom && this.outBoxDom.addEventListener('mousedown', this.boxEventMouse) this.outBoxDom && this.outBoxDom.addEventListener('mousedown', this.boxEventMouse)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment