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