feat: 大改前存档

This commit is contained in:
fit2cloud-chenyw 2021-04-09 11:58:03 +08:00
parent 396285ad69
commit acdfd5015f
4 changed files with 16 additions and 10 deletions

View File

@ -13,7 +13,6 @@ export default {
const item = context.props.item const item = context.props.item
return createElement(item.component, { return createElement(item.component, {
props: { props: {
options: item.options,
element: item element: item
}, },
on: { on: {

View File

@ -15,16 +15,19 @@
export default { export default {
props: { props: {
options: { element: {
type: Object, type: Object,
default: null default: null
} }
}, },
data() { data() {
return { return {
options: null
} }
}, },
created() {
this.options = this.element.options
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -74,7 +74,7 @@
:visible.sync="filterVisible" :visible.sync="filterVisible"
custom-class="de-filter-dialog" custom-class="de-filter-dialog"
> >
<filter-dialog v-if="filterVisible" :widget-id="currentWidgetId" @re-fresh-component="reFreshComponent"> <filter-dialog v-if="filterVisible" :component-info="currentComponent" :widget-id="currentWidgetId" @re-fresh-component="reFreshComponent">
<de-drawing-widget <de-drawing-widget
v-if="filterVisible && currentComponent" v-if="filterVisible && currentComponent"
:id="'component' + currentComponent.id" :id="'component' + currentComponent.id"
@ -272,7 +272,7 @@ export default {
this.currentComponent.style.top = e.offsetY this.currentComponent.style.top = e.offsetY
this.currentComponent.style.left = e.offsetX this.currentComponent.style.left = e.offsetX
this.currentComponent.id = newComponentId this.currentComponent.id = newComponentId
this.openFilterDiolog(componentInfo.id) this.openFilterDiolog()
return return
} }
component = deepCopy(this.currentWidget) component = deepCopy(this.currentWidget)
@ -308,8 +308,8 @@ export default {
this.$store.commit('hideContextMenu') this.$store.commit('hideContextMenu')
} }
}, },
openFilterDiolog(widgetId) { openFilterDiolog() {
this.currentWidgetId = widgetId this.currentWidgetId = this.currentComponent.name
this.filterVisible = true this.filterVisible = true
}, },
cancelFilter() { cancelFilter() {

View File

@ -159,6 +159,10 @@ export default {
widgetId: { widgetId: {
type: String, type: String,
default: null default: null
},
componentInfo: {
type: Object,
default: null
} }
}, },
data() { data() {
@ -185,12 +189,12 @@ export default {
if (values && values.length > 0) { if (values && values.length > 0) {
const value = values[0] const value = values[0]
const fieldId = value.id const fieldId = value.id
this.widget && this.widget.setOptionDatas && fieldValues(fieldId).then(res => { this.componentInfo && this.componentInfo.setOptionDatas && fieldValues(fieldId).then(res => {
const datas = res.data.map(item => { const datas = res.data.map(item => {
return { id: item, text: item } return { id: item, text: item }
}) })
this.widget.setOptionDatas(datas) this.componentInfo.setOptionDatas(datas)
this.$emit('re-fresh-component', this.widget) this.$emit('re-fresh-component', this.componentInfo)
}) })
} }
} }