diff --git a/packages/bigscreen/designer/Layout.vue b/packages/bigscreen/designer/Layout.vue index 4de5c5fc..8207f7a3 100644 --- a/packages/bigscreen/designer/Layout.vue +++ b/packages/bigscreen/designer/Layout.vue @@ -294,6 +294,7 @@ export default { }, currLayout: { set(v) { + console.log(v) this.componentList.splice(this.activeIndex, 1, v) }, get() { @@ -351,7 +352,7 @@ export default { this.form.images = [] this.isShowAddImg = false }, - + //置顶图层 setTop() { const maxZindex = Math.max.apply(Math, this.componentList.map(item => { return item.zIndex @@ -359,7 +360,7 @@ export default { this.$set(this.componentList[this.activeIndex], 'zIndex', maxZindex + 1) }, - + //置底图层 setBottom() { const item = this.componentList[this.activeIndex] this.componentList.splice(this.activeIndex, 1) @@ -404,6 +405,7 @@ export default { } }) }, + //从资产中新建时使用 clone(e) { this.componentList.push(this.deepClone(e)) }, @@ -456,12 +458,12 @@ export default { e.preventDefault() }, - + //复制图层功能 copyLayer() { const layer = this.deepClone(this.componentList[this.activeIndex]) this.componentList.push(layer) }, - + //删除图层功能 removeLayer() { this.componentList.splice(this.activeIndex, 1) this.activeIndex = -1 diff --git a/packages/bigscreen/designer/components/DataConfig.vue b/packages/bigscreen/designer/components/DataConfig.vue index 9fa04085..658a3660 100644 --- a/packages/bigscreen/designer/components/DataConfig.vue +++ b/packages/bigscreen/designer/components/DataConfig.vue @@ -37,7 +37,7 @@ + @input="chart={...chart,...chart.ds},$emit('change',options)"/>

基础设置

- +
@@ -154,6 +154,7 @@ export default { list: [], showMapEditor: false, form: {}, + datasource:{} } }, computed: { diff --git a/packages/bigscreen/designer/components/datasourcePicker.vue b/packages/bigscreen/designer/components/datasourcePicker.vue index 766feafc..d41f9b45 100644 --- a/packages/bigscreen/designer/components/datasourcePicker.vue +++ b/packages/bigscreen/designer/components/datasourcePicker.vue @@ -1,22 +1,22 @@ @@ -45,22 +45,28 @@ export default { return { dataTypes: Object.entries(DvCompData.types).map(e => ({id: e[0], label: e[1]})), content: "", - sourceData: [] + loading: false } }, computed: { contentstr: v => JSON.stringify(v.options.staticData), - dataLang: v => v.options.dataType == 'htmlData' ? 'html' : 'json' + dataLang: v => v.options.dataType == 'htmlData' ? 'html' : 'json', + source: { + set(v) { + console.log(v) + this.$emit("input", v) + }, + get() { + return this.options + } + } }, methods: { - updateOptions() { - this.$emit("input", this.options) - }, - changeData() { - new DvCompData(this.options.dataType, this.options, this.instance).getData().then(data => { - this.options[this.options.dataType] = data - this.updateOptions() - }) + changeData(sdata) { + this.source.dataType == 'staticData' ? this.source.staticData = sdata : + new DvCompData(this.source.dataType, this.source, this.instance).getData().then(data => { + this.source[this.source.dataType] = data + }) } }, }