Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2021-07-28 12:09:35 +08:00
commit 7ea80cd633
13 changed files with 63 additions and 17 deletions

View File

@ -138,14 +138,16 @@ public class ChartViewService {
}.getType()); }.getType());
List<ChartFieldCustomFilterDTO> fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken<List<ChartFieldCustomFilterDTO>>() { List<ChartFieldCustomFilterDTO> fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken<List<ChartFieldCustomFilterDTO>>() {
}.getType()); }.getType());
List<ChartCustomFilterDTO> customFilter = fieldCustomFilter.stream().map(ele -> { List<ChartCustomFilterDTO> customFilter = new ArrayList<>();
ChartCustomFilterDTO dto = new ChartCustomFilterDTO(); for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) {
ele.getFilter().forEach(f -> { List<ChartCustomFilterDTO> collect = ele.getFilter().stream().map(f -> {
ChartCustomFilterDTO dto = new ChartCustomFilterDTO();
BeanUtils.copyBean(dto, f); BeanUtils.copyBean(dto, f);
dto.setField(dataSetTableFieldsService.get(f.getFieldId())); dto.setField(dataSetTableFieldsService.get(f.getFieldId()));
}); return dto;
return dto; }).collect(Collectors.toList());
}).collect(Collectors.toList()); customFilter.addAll(collect);
}
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) { if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
xAxis = new ArrayList<>(); xAxis = new ArrayList<>();

View File

@ -28,3 +28,6 @@ RETURN concat(chartName,'-copy(',chartNameCount,')');
END END
;; ;;
delimiter ; delimiter ;
DROP VIEW IF EXISTS `v_auth_model`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char charset utf8mb4) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where (((`sys_menu`.`permission` is not null) or (`sys_menu`.`pid` = 0)) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where ((`plugin_sys_menu`.`permission` is not null) or (`plugin_sys_menu`.`pid` = 0));

View File

@ -264,7 +264,6 @@ export default {
}, },
save(withClose) { save(withClose) {
debugger
// //
const requestInfo = { const requestInfo = {
id: this.$store.state.panel.panelInfo.id, id: this.$store.state.panel.panelInfo.id,

View File

@ -64,6 +64,7 @@ export default {
}, },
dateChange(value) { dateChange(value) {
this.setCondition() this.setCondition()
this.styleChange()
}, },
formatValues(values) { formatValues(values) {
if (!values || values.length === 0) { if (!values || values.length === 0) {
@ -83,6 +84,9 @@ export default {
const value = values[0] const value = values[0]
return timeSection(value, this.options.attrs.type) return timeSection(value, this.options.attrs.type)
} }
},
styleChange() {
this.$store.state.styleChangeTimes++
} }
} }
} }

View File

@ -135,6 +135,7 @@ export default {
return false return false
} }
this.setCondition() this.setCondition()
this.styleChange()
}) })
}, },
setCondition() { setCondition() {
@ -165,6 +166,9 @@ export default {
this.inDraw && this.$store.commit('addViewFilter', param) this.inDraw && this.$store.commit('addViewFilter', param)
return return
} }
},
styleChange() {
this.$store.state.styleChangeTimes++
} }
} }
} }

View File

@ -80,6 +80,7 @@ export default {
methods: { methods: {
changeValue(value) { changeValue(value) {
this.setCondition() this.setCondition()
this.styleChange()
this.showNumber = false this.showNumber = false
this.$nextTick(() => { this.$nextTick(() => {
if (!this.$refs.deSelect.$refs.tags || !this.options.attrs.multiple) { if (!this.$refs.deSelect.$refs.tags || !this.options.attrs.multiple) {
@ -101,7 +102,11 @@ export default {
operator: this.operator operator: this.operator
} }
this.inDraw && this.$store.commit('addViewFilter', param) this.inDraw && this.$store.commit('addViewFilter', param)
},
styleChange() {
this.$store.state.styleChangeTimes++
} }
} }
} }
</script> </script>

View File

@ -167,6 +167,7 @@ export default {
this.options.value = values this.options.value = values
this.setCondition() this.setCondition()
this.styleChange()
}, },
// //
setAllNodeStatus() { setAllNodeStatus() {
@ -208,7 +209,11 @@ export default {
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data[this.defaultProp.label].indexOf(value) !== -1 return data[this.defaultProp.label].indexOf(value) !== -1
},
styleChange() {
this.$store.state.styleChangeTimes++
} }
} }
} }
</script> </script>

View File

@ -88,6 +88,11 @@ export default {
} }
}, },
watch: { watch: {
'param.tableId': {
handler: function() {
this.resetComponent()
}
},
'checkedList': function() { 'checkedList': function() {
// console.log(this.checkedList) // console.log(this.checkedList)
this.getUnionData() this.getUnionData()
@ -233,14 +238,21 @@ export default {
cancel() { cancel() {
// this.dataReset() // this.dataReset()
if (this.param.tableId) { if (this.param.tableId) {
this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table })
} else { } else {
this.$emit('switchComponent', { name: '' }) this.$emit('switchComponent', { name: '' })
} }
}, },
dataReset() { resetComponent() {
this.name = '自定义数据集'
this.table = {}
this.checkedList = []
this.unionData = []
this.height = 500
this.data = []
this.fields = []
this.customType = ['db', 'sql', 'excel']
} }
} }

View File

@ -258,7 +258,7 @@ export default {
type: 'excel', type: 'excel',
mode: parseInt(this.mode), mode: parseInt(this.mode),
// info: '{"data":"' + this.path + '"}', // info: '{"data":"' + this.path + '"}',
info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]]}), info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]] }),
fields: this.fields fields: this.fields
} }
} else { } else {
@ -285,7 +285,7 @@ export default {
this.dataReset() this.dataReset()
// this.$router.push('/dataset/home') // this.$router.push('/dataset/home')
if (this.param.tableId) { if (this.param.tableId) {
this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table })
} else { } else {
this.$emit('switchComponent', { name: '' }) this.$emit('switchComponent', { name: '' })
} }

View File

@ -163,6 +163,7 @@ export default {
watch: { watch: {
'param.tableId': { 'param.tableId': {
handler: function() { handler: function() {
this.resetComponent()
this.initTableInfo() this.initTableInfo()
} }
} }
@ -283,7 +284,7 @@ export default {
cancel() { cancel() {
// this.dataReset() // this.dataReset()
if (this.param.tableId) { if (this.param.tableId) {
this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table })
} else { } else {
this.$emit('switchComponent', { name: '' }) this.$emit('switchComponent', { name: '' })
} }
@ -302,6 +303,20 @@ export default {
// console.log(newCode) // console.log(newCode)
this.sql = newCode this.sql = newCode
this.$emit('codeChange', this.sql) this.$emit('codeChange', this.sql)
},
resetComponent() {
this.dataSource = ''
this.options = []
this.name = ''
this.sql = ''
this.data = []
this.fields = []
this.mode = '0'
this.syncType = 'sync_now'
this.height = 500
this.kettleRunning = false
this.$refs.plxTable.reloadData(this.data)
} }
} }
} }

View File

@ -122,7 +122,7 @@ export default {
if (id !== null) { if (id !== null) {
this.fields = [] this.fields = []
this.data = [] this.data = []
getTable(id, true).then(response => { post('/dataset/table/getWithPermission/' + id, null).then(response => {
this.table = response.data this.table = response.data
this.initPreviewData(this.page) this.initPreviewData(this.page)
}).catch(res => { }).catch(res => {

View File

@ -646,7 +646,6 @@ export default {
}) })
}, },
newViewInfo(newViewInfo) { newViewInfo(newViewInfo) {
debugger
let component let component
const newComponentId = uuid.v1() const newComponentId = uuid.v1()
// //
@ -681,7 +680,6 @@ export default {
} }
}, },
canvasScroll(event) { canvasScroll(event) {
debugger
this.scrollLeft = event.target.scrollLeft this.scrollLeft = event.target.scrollLeft
this.scrollTop = event.target.scrollTop this.scrollTop = event.target.scrollTop
}, },

View File

@ -73,7 +73,6 @@ export default {
}, },
watch: { watch: {
inputType(newVal) { inputType(newVal) {
debugger
if (newVal === 'self') { if (newVal === 'self') {
this.editPanel = deepCopy(this.editPanelOut) this.editPanel = deepCopy(this.editPanelOut)
} else { } else {