forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
634530411e
@ -616,6 +616,9 @@ public class DataSetTableService {
|
||||
// check doris table
|
||||
if (!checkEngineTableIsExists(dataSetTableRequest.getId())) {
|
||||
if (dataSetTableRequest.isPreviewForTask()) {
|
||||
map.put("fields", fields);
|
||||
map.put("data", new ArrayList<>());
|
||||
map.put("page", new DataSetPreviewPage());
|
||||
return map;
|
||||
} else {
|
||||
throw new RuntimeException(Translator.get("i18n_data_not_sync"));
|
||||
|
@ -75,7 +75,7 @@ import { mapState } from 'vuex'
|
||||
import ComponentWrapper from './ComponentWrapper'
|
||||
import { changeStyleWithScale } from '@/components/canvas/utils/translate'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import { deepCopy, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
|
||||
@ -330,6 +330,13 @@ export default {
|
||||
if (component.type === 'view' && this.buttonFilterMap[component.propValue.viewId]) {
|
||||
component.filters = this.buttonFilterMap[component.propValue.viewId]
|
||||
}
|
||||
if (component.type === 'de-tabs') {
|
||||
for (let idx = 0; idx < component.options.tabList.length; idx++) {
|
||||
const ele = component.options.tabList[idx].content
|
||||
if (!ele.type || ele.type !== 'view') continue
|
||||
ele.filters = this.buttonFilterMap[ele.propValue.viewId]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
buildButtonFilterMap(panelItems, isClear = false) {
|
||||
|
@ -135,6 +135,16 @@ export default {
|
||||
},
|
||||
|
||||
deleteComponent() {
|
||||
if (this.curComponent.type === 'custom-button' && this.curComponent.serviceName === 'buttonSureWidget') {
|
||||
let len = this.componentData.length
|
||||
while (len--) {
|
||||
const item = this.componentData[len]
|
||||
|
||||
if (item.type === 'custom-button' && item.serviceName === 'buttonResetWidget') {
|
||||
this.componentData.splice(len, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$emit('amRemoveItem')
|
||||
this.deleteCurCondition()
|
||||
this.$store.commit('deleteComponent')
|
||||
|
@ -189,7 +189,7 @@ import DeDrag from '@/components/DeDrag'
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { getStyle, getComponentRotatedStyle } from '@/components/canvas/utils/style'
|
||||
import {_$, imgUrlTrans} from '@/components/canvas/utils/utils'
|
||||
import { _$, imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import ContextMenu from './ContextMenu'
|
||||
import MarkLine from './MarkLine'
|
||||
import Area from './Area'
|
||||
@ -1133,6 +1133,13 @@ export default {
|
||||
if (component.type === 'view' && this.buttonFilterMap[component.propValue.viewId]) {
|
||||
component.filters = this.buttonFilterMap[component.propValue.viewId]
|
||||
}
|
||||
if (component.type === 'de-tabs') {
|
||||
for (let idx = 0; idx < component.options.tabList.length; idx++) {
|
||||
const ele = component.options.tabList[idx].content
|
||||
if (!ele.type || ele.type !== 'view') continue
|
||||
ele.filters = this.buttonFilterMap[ele.propValue.viewId]
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
buildButtonFilterMap(panelItems, isClear = false) {
|
||||
|
@ -368,7 +368,7 @@ export default {
|
||||
},
|
||||
'cfilters': {
|
||||
handler: function(val1, val2) {
|
||||
if (isChange(val1, val2) && !this.isFirstLoad) {
|
||||
if ((isChange(val1, val2) || isChange(val1, this.filters)) && !this.isFirstLoad) {
|
||||
this.getData(this.element.propValue.viewId)
|
||||
}
|
||||
},
|
||||
|
@ -100,7 +100,6 @@ export const buildFilterMap = panelItems => {
|
||||
let result = buildViewKeyMap(panelItems)
|
||||
|
||||
result = buildViewKeyFilters(panelItems, result)
|
||||
fillElementsFilter(panelItems, result)
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
v-for="(widget, index) in item"
|
||||
:key="widget.widgetName+index"
|
||||
:data-id="widget.widgetName"
|
||||
:draggable="(widget.widgetName !== 'buttonSureWidget' && widget.widgetName !== 'buttonResetWidget') || (widget.widgetName === 'buttonSureWidget' && !searchButtonExist) || (widget.widgetName === 'buttonResetWidget' && searchButtonExist)"
|
||||
:draggable="(widget.widgetName !== 'buttonSureWidget' && widget.widgetName !== 'buttonResetWidget') || (widget.widgetName === 'buttonSureWidget' && !searchButtonExist) || (widget.widgetName === 'buttonResetWidget' && searchButtonExist && !resetButtonExist)"
|
||||
:data-index="index"
|
||||
:class="'filter-widget '+ (widget.defaultClass || '')"
|
||||
:class="('filter-widget '+ (widget.widgetName === 'buttonSureWidget' ? sureButtonClass : widget.widgetName === 'buttonResetWidget' ? resetButtonClass : widget.defaultClass))"
|
||||
>
|
||||
<div class="filter-widget-icon">
|
||||
<i :class="(widget.icon || 'el-icon-setting') + ' widget-icon-i'" />
|
||||
@ -74,38 +74,15 @@ export default {
|
||||
resetButtonExist() {
|
||||
return this.componentData && this.componentData.some(component => component.type === 'custom-button' && component.serviceName === 'buttonResetWidget')
|
||||
},
|
||||
resetButtonDisable() {
|
||||
return !this.resetButtonExist && this.searchButtonExist
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
searchButtonExist(val, old) {
|
||||
if (val === old) return
|
||||
if (val) {
|
||||
this.widgetSubjects['按钮'][0].defaultClass = 'button-disable-filter'
|
||||
if (this.resetButtonExist) {
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'button-disable-filter'
|
||||
} else {
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'time-filter'
|
||||
}
|
||||
} else {
|
||||
this.widgetSubjects['按钮'][0].defaultClass = 'time-filter'
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'button-disable-filter'
|
||||
}
|
||||
sureButtonClass() {
|
||||
return this.searchButtonExist ? 'button-disable-filter' : 'time-filter'
|
||||
},
|
||||
resetButtonExist(val, old) {
|
||||
if (val === old) return
|
||||
if (val) {
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'button-disable-filter'
|
||||
} else {
|
||||
if (this.searchButtonExist) {
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'time-filter'
|
||||
} else {
|
||||
this.widgetSubjects['按钮'][1].defaultClass = 'button-disable-filter'
|
||||
}
|
||||
}
|
||||
resetButtonClass() {
|
||||
return (this.searchButtonExist && !this.resetButtonExist) ? 'time-filter' : 'button-disable-filter'
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
|
@ -34,6 +34,7 @@ export default {
|
||||
if (this.componentName === 'PanelEdit') {
|
||||
next(false)
|
||||
if (confirm(this.$t('panel.edit_leave_tips'))) {
|
||||
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
|
@ -138,7 +138,6 @@ export default {
|
||||
table: [],
|
||||
filterText: "",
|
||||
fields: [],
|
||||
tableName: "",
|
||||
dataLoading: false,
|
||||
treeLoading: false,
|
||||
};
|
||||
@ -184,6 +183,7 @@ export default {
|
||||
initData(table) {
|
||||
this.dataLoading = true;
|
||||
table.row = 100;
|
||||
table.previewForTask = true
|
||||
post("/dataset/table/getPreviewData/1/100", table, false, 30000)
|
||||
.then((response) => {
|
||||
this.fields = response.data.fields;
|
||||
@ -263,4 +263,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -341,7 +341,10 @@ export default {
|
||||
created() {
|
||||
const { datasetName, id } = this.$route.query;
|
||||
this.taskDetail = { datasetName, id };
|
||||
if (!id) return;
|
||||
if (!id) {
|
||||
this.taskForm.startTime = new Date()
|
||||
return;
|
||||
};
|
||||
this.getTaskDetail(id);
|
||||
},
|
||||
methods: {
|
||||
@ -638,4 +641,4 @@ export default {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user