feat: 查询条件编辑
This commit is contained in:
parent
ee63e0be73
commit
9de0749200
@ -49,6 +49,9 @@ export default {
|
||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit' })
|
||||
}
|
||||
if (this.curComponent.type === 'custom') {
|
||||
bus.$emit('component-dialog-edit')
|
||||
}
|
||||
// 编辑组件
|
||||
},
|
||||
lock() {
|
||||
|
||||
@ -38,6 +38,7 @@ export class DrawWidgetService {
|
||||
|
||||
getDrawPanel() {
|
||||
let drawPanel = this.initDrawPanel()
|
||||
drawPanel.serviceName = this.options.name
|
||||
drawPanel.style = Object.assign(drawPanel.style, commonStyle)
|
||||
drawPanel = Object.assign(drawPanel, commonAttr)
|
||||
if (this.filterDialog) {
|
||||
|
||||
@ -97,6 +97,26 @@ const data = {
|
||||
}
|
||||
},
|
||||
|
||||
setComponentWithId(state, component) {
|
||||
for (let index = 0; index < state.componentData.length; index++) {
|
||||
const element = state.componentData[index]
|
||||
if (element.id && element.id === component.id) {
|
||||
state.componentData[index] = component
|
||||
return
|
||||
}
|
||||
}
|
||||
state.componentData.push(component)
|
||||
},
|
||||
deleteComponentWithId(state, id) {
|
||||
for (let index = 0; index < state.componentData.length; index++) {
|
||||
const element = state.componentData[index]
|
||||
if (element.id && element.id === id) {
|
||||
state.componentData.splice(index, 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
deleteComponent(state, index) {
|
||||
if (index === undefined) {
|
||||
index = state.curComponentIndex
|
||||
|
||||
@ -163,7 +163,8 @@ export default {
|
||||
'componentData',
|
||||
'curComponent',
|
||||
'isClickComponent',
|
||||
'canvasStyleData'
|
||||
'canvasStyleData',
|
||||
'curComponentIndex'
|
||||
])
|
||||
},
|
||||
|
||||
@ -193,6 +194,10 @@ export default {
|
||||
bus.$on('component-on-drag', () => {
|
||||
this.show = false
|
||||
})
|
||||
|
||||
bus.$on('component-dialog-edit', () => {
|
||||
this.eidtDialog()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
const elx = this.$refs.rightPanel
|
||||
@ -273,7 +278,7 @@ export default {
|
||||
} else {
|
||||
this.currentWidget = ApplicationContext.getService(componentInfo.id)
|
||||
|
||||
this.currentFilterCom = this.currentWidget.getDrawPanel(this.panelInfo.id)
|
||||
this.currentFilterCom = this.currentWidget.getDrawPanel()
|
||||
this.currentFilterCom.style.top = e.offsetY
|
||||
this.currentFilterCom.style.left = e.offsetX
|
||||
this.currentFilterCom.id = newComponentId
|
||||
@ -330,12 +335,19 @@ export default {
|
||||
},
|
||||
sureFilter() {
|
||||
const component = deepCopy(this.currentFilterCom)
|
||||
this.$store.commit('addComponent', { component })
|
||||
// this.$store.commit('addComponent', { component })
|
||||
this.$store.commit('setComponentWithId', component)
|
||||
this.$store.commit('recordSnapshot')
|
||||
this.cancelFilter()
|
||||
},
|
||||
reFreshComponent(component) {
|
||||
this.currentFilterCom = component
|
||||
},
|
||||
eidtDialog() {
|
||||
const serviceName = this.curComponent.serviceName
|
||||
this.currentWidget = ApplicationContext.getService(serviceName)
|
||||
this.currentFilterCom = this.curComponent
|
||||
this.openFilterDiolog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,6 +195,7 @@ export default {
|
||||
this.widget && fieldValues(fieldId).then(res => {
|
||||
info.options.attrs.datas = this.widget.optionDatas(res.data)
|
||||
info.options.attrs.fieldId = fieldId
|
||||
info.options.attrs.dragItems = values
|
||||
this.$emit('re-fresh-component', info)
|
||||
})
|
||||
}
|
||||
@ -204,6 +205,10 @@ export default {
|
||||
// this.widget = ApplicationContext.getService(this.widgetId)
|
||||
this.widget = this.widgetInfo
|
||||
this.loadDataSetTree()
|
||||
|
||||
if (this.componentInfo && this.componentInfo.options.attrs.dragItems) {
|
||||
this.selectField = this.componentInfo.options.attrs.dragItems
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user