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

优化

parent d1c391c6
......@@ -3,9 +3,6 @@ import App from './App.vue'
import './packages/index'
import ElementUI from 'element-ui'
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.use(ElementUI)
new Vue({
......
......@@ -106,6 +106,8 @@ import request from '../funTools/request'
import lookPageLog from './lookPageLog.vue'
import asyncFormPropSet from './asyncFormPropSet.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 asyncFormPropSet = r => require.ensure([], () => r(require('./asyncFormPropSet.vue')), 'asyncFormPropSet')
// const tbaleColumsSet = r => require.ensure([], () => r(require('./tbaleColumsSet.vue')), 'tbaleColumsSet')
......@@ -492,7 +494,7 @@ export default {
},
drow(el, json = {}, flage) {
const container = document.getElementById(el)
this[flage] = new this.$jsoneditor(container, this.options)
this[flage] = new jsoneditor(container, this.options)
this[flage].set(json)
}
}
......
import uuidv1 from 'uuid/v1'
export default {
data() {
data () {
return {
elId: '',
outBoxDom: null
}
},
created() {
created () {
this.elId = uuidv1() // 获取随机id
},
mounted() {
mounted () {
this.$nextTick(_ => {
this.showEditJsonDialog()
})
},
destroyed() {
destroyed () {
if (this.outBoxDom) {
this.outBoxDom.removeEventListener('mousedown', this.boxEventMouse)
}
this.chart = null
},
beforeDestroy() {
beforeDestroy () {
clearInterval(this.timer)// 清除定时器
this.timer = null
if (this.chart) {
......@@ -31,7 +32,7 @@ export default {
}
},
methods: {
boxEventMouse(event) {
boxEventMouse (event) {
const that = this
event.stopPropagation()
if (event.shiftKey && event.altKey && !event.ctrlKey) {
......@@ -40,7 +41,7 @@ export default {
}
},
// 弹出可编辑的弹框
showEditJsonDialog() {
showEditJsonDialog () {
this.outBoxDom = document.getElementById(this.elId)
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