feat:视图根据图表类型分类

This commit is contained in:
junjie 2021-11-09 11:16:35 +08:00
parent a861223e30
commit 05710c4cad
3 changed files with 20 additions and 8 deletions

View File

@ -41,9 +41,9 @@ public class DataSetTableController {
@ApiOperation("更新")
@PostMapping("update")
public void save(@RequestBody DataSetTableRequest datasetTable) throws Exception {
if(datasetTable.getType().equalsIgnoreCase("excel")){
if (datasetTable.getType().equalsIgnoreCase("excel")) {
dataSetTableService.saveExcel(datasetTable);
}else {
} else {
dataSetTableService.save(datasetTable);
}
}
@ -53,10 +53,10 @@ public class DataSetTableController {
public void alter(@RequestBody DataSetTableRequest request) throws Exception {
dataSetTableService.alter(request);
}
@ApiOperation("删除")
@PostMapping("delete/{id}")
public void delete( @ApiParam(name = "id", value = "数据集ID", required = true) @PathVariable String id) throws Exception {
public void delete(@ApiParam(name = "id", value = "数据集ID", required = true) @PathVariable String id) throws Exception {
dataSetTableService.delete(id);
}
@ -132,9 +132,9 @@ public class DataSetTableController {
return dataSetTableService.getDatasetDetail(id);
}
// @ApiOperation("excel上传")
// @ApiOperation("excel上传")
@PostMapping("excel/upload")
public ExcelFileData excelUpload(@RequestParam("file") MultipartFile file, @RequestParam("tableId") String tableId, @RequestParam("editType") Integer editType ) throws Exception {
public ExcelFileData excelUpload(@RequestParam("file") MultipartFile file, @RequestParam("tableId") String tableId, @RequestParam("editType") Integer editType) throws Exception {
return dataSetTableService.excelSaveAndParse(file, tableId, editType);
}
@ -149,4 +149,10 @@ public class DataSetTableController {
public List<DataSetTableDTO> search(@RequestBody DataSetTableRequest dataSetTableRequest) {
return dataSetTableService.search(dataSetTableRequest);
}
@ApiOperation("数据集同步表结构")
@PostMapping("syncField/{id}")
public DatasetTable syncDatasetTableField(@PathVariable String id) throws Exception {
return dataSetTableService.syncDatasetTableField(id);
}
}

View File

@ -1659,4 +1659,10 @@ public class DataSetTableService {
return true;
}
}
public DatasetTable syncDatasetTableField(String id) throws Exception {
DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(id);
saveTableField(datasetTable);
return datasetTable;
}
}

View File

@ -150,7 +150,7 @@
<!-- </span>-->
<!-- </el-row>-->
</div>
<el-button slot="reference" size="mini" style="padding: 6px;">
<el-button slot="reference" size="mini" style="padding: 6px;" :disabled="!hasDataPermission('manage',param.privileges)">
{{ $t('chart.change_chart_type') }}
<i class="el-icon-caret-bottom" />
</el-button>
@ -210,7 +210,7 @@
<el-radio-group v-model="view.resultMode" class="radio-span" :disabled="!hasDataPermission('manage',param.privileges)" size="mini" @change="save">
<el-radio label="all"><span>{{ $t('chart.result_mode_all') }}</span></el-radio>
<el-radio label="custom">
<el-input v-model="view.resultCount" class="result-count" size="mini" @change="save" />
<el-input v-model="view.resultCount" class="result-count" size="mini" :disabled="!hasDataPermission('manage',param.privileges)" @change="save" />
</el-radio>
</el-radio-group>
</el-row>