diff --git a/DataShowGUI.jar b/Data Show GUI.jar similarity index 96% rename from DataShowGUI.jar rename to Data Show GUI.jar index 0f7629ea09462234714661e01d004934bded9075..933aadc4a0756eafe55497c882c36d74a6dd1563 100644 Binary files a/DataShowGUI.jar and b/Data Show GUI.jar differ diff --git a/README.md b/README.md index 7861ae330b35f5513cc5c1829743ddece74a11c9..c3844e1e5eb77273d2d4c3611cbc35957f4ae3f6 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,28 @@ #### 软件架构 前后端分离开发,前后端合并部署 - #### 安装教程 -1.切换到DataShowGUI.jar的目录下 +1.切换到DataShowGUI.jar所在的目录下 2.命令行执行 java -jar DataShowGUI.jar +#### 删除教程 + +1.删除DataShowGUI.jar +2.删除DataShowGUI.jar所在的目录下的data-source和data-source-edit目录 + #### 使用说明 1.启动成功后,浏览器输入`localhost:8083`即可使用 2.具体使用方式见使用文档 +#### 特性说明 + +1.支持从openGauss数据库中导入数据 +2.支持从外部文件中导入数据 +3.支持数据筛选 +4.支持以柱状图、折线图、散点图、面积图、组合图、条形图、饼状图、雷达图、曲面图的形式展示数据 + #### 参与贡献 1. Fork 本仓库 diff --git a/information/DataShowGUI Open Source Software List.xlsx b/information/DataShowGUI Open Source Software List.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..a98d035d62ecf0c4e728e0381494a8f8dbaae7c4 Binary files /dev/null and b/information/DataShowGUI Open Source Software List.xlsx differ diff --git a/pom.xml b/pom.xml index 026908fc069dd5cd4db09f381f4a9a10fd8d35e3..a090623819159cb206cfb886affb42c8d4fe4179 100644 --- a/pom.xml +++ b/pom.xml @@ -33,11 +33,6 @@ 3.5.1 - - mysql - mysql-connector-java - runtime - org.projectlombok lombok @@ -134,7 +129,7 @@ spring-boot-maven-plugin 2.3.7.RELEASE - com.huawei.demo.DemoApplication + com.huawei.datashow.DemoApplication diff --git a/src/main/java/com/huawei/datashow/bean/smbms_3DdataBean.java b/src/main/java/com/huawei/datashow/bean/smbms_3DdataBean.java deleted file mode 100644 index d8b8d91054e07c5b23e7f6764122b3f3ef6b8258..0000000000000000000000000000000000000000 --- a/src/main/java/com/huawei/datashow/bean/smbms_3DdataBean.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.huawei.datashow.bean; - -import lombok.Data; - -@Data -public class smbms_3DdataBean { - private int id; - private float successPercent; - private float failurePercent; - private float unKnownPercent; -} diff --git a/src/main/java/com/huawei/datashow/controller/ConnectionPoolController.java b/src/main/java/com/huawei/datashow/controller/ConnectionPoolController.java index 71de9ff636127227ca1eafd140030293810aeec2..687d55e1c1c141283f2d89b773efde0b5cf54642 100644 --- a/src/main/java/com/huawei/datashow/controller/ConnectionPoolController.java +++ b/src/main/java/com/huawei/datashow/controller/ConnectionPoolController.java @@ -2,6 +2,8 @@ package com.huawei.datashow.controller; import com.huawei.datashow.service.ConnectionPoolService; import com.huawei.datashow.bean.ConnectionPoolDTOBean; +import com.huawei.datashow.util.MyException; +import com.huawei.datashow.util.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -28,9 +30,14 @@ public class ConnectionPoolController } @PostMapping("/addHikariCP") - public String addHikariCP(@Validated @RequestBody ConnectionPoolDTOBean dto) + public Result addHikariCP(@Validated @RequestBody ConnectionPoolDTOBean dto) { - return connectionPoolService.addHikariCP(dto); + try { + connectionPoolService.addHikariCP(dto); + return Result.OK("建立数据源连接成功!"); + } catch (MyException e) { + return Result.error(e.getMessage()); + } } @PostMapping("/removeHikariCP") diff --git a/src/main/java/com/huawei/datashow/controller/HandleDataSourceController.java b/src/main/java/com/huawei/datashow/controller/HandleDataSourceController.java index c39976d63d2e462764a602232bae0434f27703da..2f93253f65a80dac0af2c49734897af94e8c4d7f 100644 --- a/src/main/java/com/huawei/datashow/controller/HandleDataSourceController.java +++ b/src/main/java/com/huawei/datashow/controller/HandleDataSourceController.java @@ -27,7 +27,7 @@ public class HandleDataSourceController { try { handleDataSourceServiceImpl.saveDataSource(pollName, sql, dataSourceName); return Result.OK("数据源保存成功"); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); return Result.error("数据源保存失败"); } @@ -85,6 +85,17 @@ public class HandleDataSourceController { } } + @GetMapping("/reload-data-source") + public Result reloadDataSource(@RequestParam("dataSourceName") String dataSourceName) { + try { + handleDataSourceServiceImpl.reloadDataSource(dataSourceName); + return Result.OK(); + } catch (IOException ioException) { + ioException.printStackTrace(); + return Result.error("接口调用失败"); + } + } + @GetMapping("/save-edit-data-source") public Result saveEditDataSource(@RequestParam("dataSourceName") String dataSourceName) { try { diff --git a/src/main/java/com/huawei/datashow/controller/OpenGaussDataBaseController.java b/src/main/java/com/huawei/datashow/controller/OpenGaussDataBaseController.java index 182c0657d8cee7c5a07413ab2030477a265eb4c9..9bbc3d6c042af2399b4d8eb5e4c3c6899de45520 100644 --- a/src/main/java/com/huawei/datashow/controller/OpenGaussDataBaseController.java +++ b/src/main/java/com/huawei/datashow/controller/OpenGaussDataBaseController.java @@ -1,6 +1,9 @@ package com.huawei.datashow.controller; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.fasterxml.jackson.core.JsonProcessingException; +import com.huawei.datashow.bean.smbms_3DdataBean; +import com.huawei.datashow.mapper.OpenGaussDataBaseMapper; import com.huawei.datashow.service.OpenGaussDataBaseService; import com.huawei.datashow.util.SQLUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -14,9 +17,12 @@ public class OpenGaussDataBaseController @Autowired private OpenGaussDataBaseService openGaussDataBaseServiceImpl; + @Autowired + private OpenGaussDataBaseMapper openGaussDataBaseMapper; + @GetMapping("/getSchema") public String getSchema(@RequestParam("pollName") String pollName, - @RequestParam("sql") String sql) throws JsonProcessingException { + @RequestParam("sql") String sql) throws Exception { return openGaussDataBaseServiceImpl.getSourceData(pollName, sql); } @@ -29,7 +35,7 @@ public class OpenGaussDataBaseController */ @GetMapping("/getTables") public String getTables(@RequestParam("pollName") String pollName, - @RequestParam("sql") String sql) throws JsonProcessingException { + @RequestParam("sql") String sql) throws Exception { return openGaussDataBaseServiceImpl.getSourceData(pollName, sql); } @@ -42,7 +48,7 @@ public class OpenGaussDataBaseController */ @GetMapping("/getSourceData") public String getSourceData(@RequestParam("pollName") String pollName, - @RequestParam("sql") String sql) throws JsonProcessingException { + @RequestParam("sql") String sql) throws Exception { return openGaussDataBaseServiceImpl.getSourceData(pollName,sql); } @@ -58,15 +64,17 @@ public class OpenGaussDataBaseController public String showSourceData(@RequestParam("pollName") String pollName, @RequestParam("sql") String sql, @RequestParam("startIndex") int startIndex, - @RequestParam("limit") int limit) throws JsonProcessingException { + @RequestParam("limit") int limit) throws Exception { String limitSql = SQLUtil.getLimitSql(sql, startIndex, limit); return openGaussDataBaseServiceImpl.getSourceData(pollName, limitSql); } @GetMapping("/getCount") public String getCount(@RequestParam("pollName") String pollName, - @RequestParam("sql") String sql) throws JsonProcessingException { + @RequestParam("sql") String sql) throws Exception { String countSql = SQLUtil.getCountSql(sql); return openGaussDataBaseServiceImpl.getSourceData(pollName, countSql); } + + } diff --git a/src/main/java/com/huawei/datashow/controller/UploadFileController.java b/src/main/java/com/huawei/datashow/controller/UploadFileController.java index 78d4369beb82ef3c736138c172d12b8fd44c4e57..0ef2abad84c32d72d83db75b0fd1cb60ffbc5ee2 100644 --- a/src/main/java/com/huawei/datashow/controller/UploadFileController.java +++ b/src/main/java/com/huawei/datashow/controller/UploadFileController.java @@ -27,11 +27,11 @@ public class UploadFileController return Result.OK(); } catch (IOException ioException) { ioException.printStackTrace(); - return Result.error("接口调用失败"); + return Result.error("已上传,但文件为空或格式不匹配,请删除并重新上传!"); } } - @PostMapping("/uploadCSVFile") + @PostMapping("/uploadCSVOrTxtFile") public Result uploadCSVFile(MultipartFile file) { try { @@ -39,33 +39,7 @@ public class UploadFileController return Result.OK(); } catch (IOException ioException) { ioException.printStackTrace(); - return Result.error("接口调用失败"); - } - } - - @PostMapping("/uploadTXTFile") - public String uploadTXTFile(MultipartFile file, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) - { - if (file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.')).equals(".txt")) - { - try - { - httpServletRequest.getRequestDispatcher("/uploadCSVFile").forward(httpServletRequest,httpServletResponse); - } - catch (ServletException servletException) - { - servletException.printStackTrace(); - return "fail"; - } - catch (IOException ioException) - { - return "fail"; - } - return "redirect"; - } - else - { - return "unfit"; + return Result.error("已上传,但上传文件为空或格式不匹配,请删除并重新上传!"); } } } diff --git a/src/main/java/com/huawei/datashow/mapper/OpenGaussDataBaseMapper.java b/src/main/java/com/huawei/datashow/mapper/OpenGaussDataBaseMapper.java index 37e342f83f95b5af0b6ea4b038eea12dd2eb1211..55db189f6efa02e5be1d65076ab5b8650836074d 100644 --- a/src/main/java/com/huawei/datashow/mapper/OpenGaussDataBaseMapper.java +++ b/src/main/java/com/huawei/datashow/mapper/OpenGaussDataBaseMapper.java @@ -1,9 +1,12 @@ package com.huawei.datashow.mapper; +import com.huawei.datashow.bean.smbms_3DdataBean; + import java.util.List; import java.util.Map; public interface OpenGaussDataBaseMapper { List customSql(String sql); + void insert(smbms_3DdataBean bean); } diff --git a/src/main/java/com/huawei/datashow/service/ConnectionPoolService.java b/src/main/java/com/huawei/datashow/service/ConnectionPoolService.java index c08f18103039415bba7a142fe05857629e47281e..b302e22cff2fcb1118f733611908483780b0de2d 100644 --- a/src/main/java/com/huawei/datashow/service/ConnectionPoolService.java +++ b/src/main/java/com/huawei/datashow/service/ConnectionPoolService.java @@ -1,11 +1,12 @@ package com.huawei.datashow.service; import com.huawei.datashow.bean.ConnectionPoolDTOBean; +import com.huawei.datashow.util.MyException; public interface ConnectionPoolService { String getConnectionPoolsNow(); - String addHikariCP(ConnectionPoolDTOBean dto); + void addHikariCP(ConnectionPoolDTOBean dto) throws MyException; String removeHikariCP(String poolName); } diff --git a/src/main/java/com/huawei/datashow/service/ConnectionPoolServiceImpl.java b/src/main/java/com/huawei/datashow/service/ConnectionPoolServiceImpl.java index eab64b695dff16929be4aaa08913548540db0a1a..b3a4f9ffd58cb8ff10a289ab1a5e39b150698fa0 100644 --- a/src/main/java/com/huawei/datashow/service/ConnectionPoolServiceImpl.java +++ b/src/main/java/com/huawei/datashow/service/ConnectionPoolServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.dynamic.datasource.DynamicRoutingDataSource; import com.baomidou.dynamic.datasource.creator.HikariDataSourceCreator; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.huawei.datashow.bean.ConnectionPoolDTOBean; +import com.huawei.datashow.util.MyException; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -32,24 +33,39 @@ public class ConnectionPoolServiceImpl implements ConnectionPoolService } @Override - public String addHikariCP(ConnectionPoolDTOBean dto) - { + public void addHikariCP(ConnectionPoolDTOBean dto) throws MyException { DataSourceProperty dataSourceProperty = new DataSourceProperty(); BeanUtils.copyProperties(dto, dataSourceProperty); dataSourceProperty.setLazy(true); DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource; DataSource dataSource = hikariDataSourceCreator.createDataSource(dataSourceProperty); ds.addDataSource(dto.getPollName(), dataSource); - try - { + try { openGaussDataBaseService.getSourceData(dto.getPollName(),"select datname from pg_database"); } - catch(Exception e) - { - ds.getDataSources().remove(dto.getPollName()); - return "fail"; + catch (Exception e) { + ds.removeDataSource(dto.getPollName()); + String exception = e.toString(); + if (exception.contains("Invalid username/password")) { + throw new MyException("[Invalid username/password] 用户名或密码错误"); + } + else if (exception.contains("Forbid remote connection with initial user")) { + throw new MyException("[Forbid remote connection with initial user] 禁止使用数据库初始用户进行远程连接"); + } + else if (exception.contains("no pg_hba.conf entry")) { + throw new MyException("[no pg_hba.conf entry for host] 未配置openGauss远程访问白名单"); + } + else if (exception.contains("database") && exception.contains("does not exist")) { + throw new MyException("[database does not exist] 数据库不存在"); + } + else if (exception.contains("Check that the hostname and port are correct")) { + throw new MyException("[Check that the hostname and port are correct and " + + "that the postmaster is accepting TCP/IP connections] 请检查主机、端口号是否正确"); + } + else { + throw new MyException("请检查是否有非法输入,或联系开发者"); + } } - return "success"; } @Override diff --git a/src/main/java/com/huawei/datashow/service/HandleDataSourceService.java b/src/main/java/com/huawei/datashow/service/HandleDataSourceService.java index 37c186f8d2076379dabd43b4957d7915b7984cf1..1704621a8849cc2f53da37b8c02c267a18b9d277 100644 --- a/src/main/java/com/huawei/datashow/service/HandleDataSourceService.java +++ b/src/main/java/com/huawei/datashow/service/HandleDataSourceService.java @@ -15,7 +15,7 @@ public interface HandleDataSourceService { * @param dataSourceName * @return */ - public void saveDataSource(String pollName, String sql, String dataSourceName) throws IOException; + public void saveDataSource(String pollName, String sql, String dataSourceName) throws Exception; /** * Read source data from local file @@ -53,5 +53,7 @@ public interface HandleDataSourceService { */ public void editDataSource(String dataSourceName, DataSourceEditBean dataSourceEditBean) throws IOException; + public void reloadDataSource(String dataSourceName) throws IOException; + public void saveEditDataSource(String dataSourceName) throws IOException; } diff --git a/src/main/java/com/huawei/datashow/service/HandleDataSourceServiceImpl.java b/src/main/java/com/huawei/datashow/service/HandleDataSourceServiceImpl.java index 7be2d5e6049d39602111f1f49d3570961d841383..a261a43ecb955c4a4d5094fd41beaeee5a61c453 100644 --- a/src/main/java/com/huawei/datashow/service/HandleDataSourceServiceImpl.java +++ b/src/main/java/com/huawei/datashow/service/HandleDataSourceServiceImpl.java @@ -23,7 +23,7 @@ public class HandleDataSourceServiceImpl implements HandleDataSourceService{ OpenGaussDataBaseService openGaussDataBaseServiceImpl; @Override - public void saveDataSource(String pollName, String sql, String dataSourceName) throws IOException { + public void saveDataSource(String pollName, String sql, String dataSourceName) throws Exception { String countSql = SQLUtil.getCountSql(sql); List arrayList = JSON.parseObject(openGaussDataBaseServiceImpl.getSourceData(pollName, countSql), ArrayList.class); int count = (int) arrayList.get(0).get("count"); @@ -86,6 +86,11 @@ public class HandleDataSourceServiceImpl implements HandleDataSourceService{ YAMLUtil.writeYAMLFile(dataSourceName, dataSourceEditBean); } + @Override + public void reloadDataSource(String dataSourceName) throws IOException { + YAMLUtil.createYAMLFile(dataSourceName); + } + @Override public void saveEditDataSource(String dataSourceName) throws IOException { int rowCount = CSVUtil.getRowCount(dataSourceName); diff --git a/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseService.java b/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseService.java index 4557934064bff76a8988db294bdfdc6e2f8e9af1..e8b63b29d80eeb52f7bee3a05f251f3365d7c843 100644 --- a/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseService.java +++ b/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseService.java @@ -13,5 +13,5 @@ public interface OpenGaussDataBaseService * @return * @throws JsonProcessingException */ - String getSourceData(String pollName, String sql) throws JsonProcessingException; + String getSourceData(String pollName, String sql) throws Exception; } diff --git a/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseServiceImpl.java b/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseServiceImpl.java index ff49856dbe46637f6285788d460c3cb60487b9cb..9c8fd9a4f231de6afe30f0afee8a12526e20a69c 100644 --- a/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseServiceImpl.java +++ b/src/main/java/com/huawei/datashow/service/OpenGaussDataBaseServiceImpl.java @@ -26,12 +26,16 @@ public class OpenGaussDataBaseServiceImpl implements OpenGaussDataBaseService @Override - public String getSourceData(String pollName, String sql) - { + public String getSourceData(String pollName, String sql) { DynamicDataSourceContextHolder.push(pollName); - List data = openGaussDataBaseMapper.customSql(sql); - JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - String json = JSON.toJSONString(data, filter, SerializerFeature.WriteDateUseDateFormat); - return json; + try { + List data = openGaussDataBaseMapper.customSql(sql); + JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; + String json = JSON.toJSONString(data, filter, SerializerFeature.WriteDateUseDateFormat); + return json; + } + catch (Exception e) { + throw e; + } } } diff --git a/src/main/java/com/huawei/datashow/util/MyException.java b/src/main/java/com/huawei/datashow/util/MyException.java new file mode 100644 index 0000000000000000000000000000000000000000..92b17e140c6846dd3bc5680b648c7e18288011fe --- /dev/null +++ b/src/main/java/com/huawei/datashow/util/MyException.java @@ -0,0 +1,11 @@ +package com.huawei.datashow.util; + +public class MyException extends java.lang.Exception { + + private String message; + + public MyException(String message){ + super(message); + this.message = message; + } +} diff --git a/src/main/java/com/huawei/datashow/util/SQLUtil.java b/src/main/java/com/huawei/datashow/util/SQLUtil.java index 047ff8c01ac1b5c4c9d5c4239c243127ab0dbb88..2b17f23f7b51f94d9dab37aa597f5241bdb8face 100644 --- a/src/main/java/com/huawei/datashow/util/SQLUtil.java +++ b/src/main/java/com/huawei/datashow/util/SQLUtil.java @@ -22,16 +22,7 @@ public class SQLUtil { * @return */ public static String getCountSql(String sql) { - String tableName = getColumnName(sql); - String countSql = sql.replace(tableName, "count(*)"); - - if (countSql.lastIndexOf("ORDER") != -1) { - countSql = countSql.substring(0, countSql.lastIndexOf("ORDER")); - } - - if (sql.lastIndexOf("GROUP") != -1) { - countSql = countSql.substring(0, countSql.lastIndexOf("GROUP")); - } + String countSql = "SELECT COUNT(*) FROM (" + sql + ")"; return countSql; } diff --git a/src/main/java/com/huawei/datashow/util/fileUtils/CSVUtil.java b/src/main/java/com/huawei/datashow/util/fileUtils/CSVUtil.java index 730d6f4ca6216f70e86e34c7efd6aa21946ecc3b..fc72c3a98a7debfbe2ee279411e310160aadf528 100644 --- a/src/main/java/com/huawei/datashow/util/fileUtils/CSVUtil.java +++ b/src/main/java/com/huawei/datashow/util/fileUtils/CSVUtil.java @@ -121,6 +121,7 @@ public class CSVUtil { linkedHashMap.remove(columnName); } result.put("columnNames", linkedHashMap.keySet()); + in.close(); return JSON.toJSONString(result); } @@ -136,6 +137,7 @@ public class CSVUtil { while(br.readLine()!=null){ rowCount++; } + br.close(); return rowCount; } diff --git a/src/main/java/com/huawei/datashow/util/fileUtils/YAMLUtil.java b/src/main/java/com/huawei/datashow/util/fileUtils/YAMLUtil.java index 79f28ce87b97929a52e76c21e7eebff60f65447a..2f831dd5c017936873efa6a554fb1095186600c3 100644 --- a/src/main/java/com/huawei/datashow/util/fileUtils/YAMLUtil.java +++ b/src/main/java/com/huawei/datashow/util/fileUtils/YAMLUtil.java @@ -35,6 +35,7 @@ public class YAMLUtil { dataSourceEdit.put("deleteRowIndex", new ArrayList<>()); dataSourceEdit.put("deleteColumnName", new ArrayList<>()); yaml.dump(dataSourceEdit, fileWriter); + fileWriter.close(); } public static void writeYAMLFile(String fileName, DataSourceEditBean dataSourceEditBean) throws IOException { @@ -62,18 +63,23 @@ public class YAMLUtil { dataSourceEditBeanYaml.setDeleteRowIndex(deleteRowIndexYaml); dataSourceEditBeanYaml.setDeleteColumnName(deleteColumnNameYaml); + FileWriter fileWriter = new FileWriter(new File(getPath(fileName))); + Yaml yaml = getYaml(); - yaml.dump(dataSourceEditBeanYaml, new FileWriter(new File(getPath(fileName)))); + yaml.dump(dataSourceEditBeanYaml, fileWriter); + fileWriter.close(); } public static void removeYAMLFile(String fileName) throws IOException { Files.delete(Paths.get(getPath(fileName))); } - public static DataSourceEditBean readYAMLFile(String fileName) throws FileNotFoundException { + public static DataSourceEditBean readYAMLFile(String fileName) throws IOException { Yaml yaml = getYaml(); FileInputStream fileInputStream = new FileInputStream(new File(getPath(fileName))); - return yaml.loadAs(fileInputStream, DataSourceEditBean.class); + DataSourceEditBean dataSourceEditBean = yaml.loadAs(fileInputStream, DataSourceEditBean.class); + fileInputStream.close(); + return dataSourceEditBean; } } diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/css/addsourcedata/addsourcedata.css b/src/main/java/com/huawei/datashow/vue/src/assets/css/addsourcedata/addsourcedata.css index 4b6d4baabd615a8c97f4fe2eb7c7d3ae185e98f3..9a1309d38ffb2034b610fafd614b920f2ab96a50 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/css/addsourcedata/addsourcedata.css +++ b/src/main/java/com/huawei/datashow/vue/src/assets/css/addsourcedata/addsourcedata.css @@ -7,7 +7,7 @@ height: 100%; } -#img_opengauss{ +#img_database{ width: 300px; height: 300px; } @@ -44,7 +44,7 @@ } .image{ - margin-top:50% + margin-top:40% } .description{ diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/css/datasource/datasource.css b/src/main/java/com/huawei/datashow/vue/src/assets/css/datasource/datasource.css index 9c96b676dbbeba2f0a3bd11dcc7532bb19584253..d8f4820ba78aec136d47b17c9dd3b8b7c3e3cfc1 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/css/datasource/datasource.css +++ b/src/main/java/com/huawei/datashow/vue/src/assets/css/datasource/datasource.css @@ -1,7 +1,3 @@ -#table{ - height: 90%; -} - #footer{ text-align: right; font-size: 12px; diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/css/dialog/dialog-form/dialog-form.css b/src/main/java/com/huawei/datashow/vue/src/assets/css/dialog/dialog-form/dialog-form.css index 7e19fd5a66dc84134e1736e832d2da71f2682854..01baa89d2ce29e7b03985fffc030c15ea9d0f4e5 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/css/dialog/dialog-form/dialog-form.css +++ b/src/main/java/com/huawei/datashow/vue/src/assets/css/dialog/dialog-form/dialog-form.css @@ -1,3 +1,7 @@ .el-select { width: 100%; +} + +.el-checkbox { + margin-left: 20px; } \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/css/echarts/echarts.css b/src/main/java/com/huawei/datashow/vue/src/assets/css/echarts/echarts.css index 16fd1cea6a6c01a2a9bc3f2a179fae4f4c809b67..74d725b80a3c890a634664d8dd1391193a1aece0 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/css/echarts/echarts.css +++ b/src/main/java/com/huawei/datashow/vue/src/assets/css/echarts/echarts.css @@ -1,9 +1,9 @@ #echarts_container .el-aside { background-color:#EBEEF5 } -#echarts_container .scrollbar { +/* #echarts_container .scrollbar { height: 100% -} +} */ #echarts_container .el-form-item { margin-top:20px; margin-left:20px diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/css/uisourcedata/uisourcedata.css b/src/main/java/com/huawei/datashow/vue/src/assets/css/uisourcedata/uisourcedata.css index 32fc6d61bda079dfba124d1d69733737e0fbbb43..e6dfce4a34796b41c75e66698acf1e69e263f9cb 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/css/uisourcedata/uisourcedata.css +++ b/src/main/java/com/huawei/datashow/vue/src/assets/css/uisourcedata/uisourcedata.css @@ -1,6 +1,12 @@ #scrollbar{ height: 100% } +#backButton{ + width: 100%; + border-radius: 0; + height:30px; + font-size: small; +} #aside{ background-color:#F2F6FC diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/database-2-line.svg b/src/main/java/com/huawei/datashow/vue/src/assets/database-2-line.svg new file mode 100644 index 0000000000000000000000000000000000000000..0eef615454b687a24a6b53a68cf03b5cf0f8ab96 --- /dev/null +++ b/src/main/java/com/huawei/datashow/vue/src/assets/database-2-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/folder-upload-line.svg b/src/main/java/com/huawei/datashow/vue/src/assets/folder-upload-line.svg new file mode 100644 index 0000000000000000000000000000000000000000..9f205bc539bbb95059a3fd9ac800105622923244 --- /dev/null +++ b/src/main/java/com/huawei/datashow/vue/src/assets/folder-upload-line.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/language/local_en.json b/src/main/java/com/huawei/datashow/vue/src/assets/language/local_en.json index 87da23aaae922b2020fab8edb34bb8dbbc75cb51..75512b6fe14d4e9dcd95d0330e430293824fa6ee 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/language/local_en.json +++ b/src/main/java/com/huawei/datashow/vue/src/assets/language/local_en.json @@ -9,8 +9,7 @@ "button_toLogin":"Add database connection", "button_toUISourceData":"Select database connection", "button_toUploadXlsOrXlsxFile":"Import xls or xlsx file", - "button_toUploadCSVFile":"Import csv file", - "button_toUploadTxtFile":"Import txt file" + "button_toUploadCSVOrTXTFile":"Import csv or txt file" } }, "contextbutton": { @@ -23,12 +22,13 @@ "button": { "button_deleteSelection": "Delete the selected line", "button_preserve": "Save changes", - "button_deleteSourceData": "Remove data sources", + "button_reload": "Reload data source", + "button_deleteSourceData": "Remove data source", "button_fatherMethodHandelSelectDataIsActive": "Visualization" }, "message": { "deleteMessage":"Deleted data is selected, please do not delete it repeatedly", - "bigSizeMessage":"The amount of data is large and it takes a long time to save and modify. Do you want to execute it?" + "bigSizeMessage":"The amount of data is large and it takes a long time to save and modify!" } }, "dialog-form": { @@ -76,9 +76,17 @@ "axis_right":"Grid right distance", "axis_top":"Distance above grid", "axis_bottom":"Distance below the grid", + "xAxis_name":"xAxis name", + "xAxis_name_color":"Color of xAxis name", + "xAxis_name_size":"Font size of xAxis name", "xAxis_font_size":"Horizontal axis font size", "xAxis_label_distance":"Label interval", "xAxis_label_angel":"Label rotation angle", + "yAxis_name":"yAxis name", + "yAxis_max":"yAxis value Max", + "yAxis_min":"yAxis value Min", + "yAxis_name_color":"Color of yAxis name", + "yAxis_name_size":"Font size of yAxis name", "yAxis_font_size":"Vertical axis font size", "data_zoom":"Zoom control below", "echarts_text_label":"Graphic text label" @@ -155,6 +163,8 @@ "grid_right_distance": "Grid right distance", "grid_top_distance": "Distance above grid", "grid_bottom_distance": "Distance below the grid", + "xAxis_max":"xAxis value Max", + "xAxis_min":"xAxis value Min", "Horizontal_font_size": "Horizontal axis font size", "Tab_spacing": "Label interval", "Label_rotation_angle": "Label rotation angle", @@ -214,6 +224,14 @@ "hide": "hide", "open": "open", "close": "close", + "top_left": "upper left", + "top": "Directly above", + "top_right": "upper right", + "right": "right", + "bottom_right": "lower right", + "bottom": "Directly below", + "bottom_left": "lower left", + "left": "left", "horizontal_arrangement": "Horizontal arrangement", "vertical_arrangement": "Vertical arrangement" }, @@ -234,11 +252,14 @@ "username": "user name", "password": "password" }, - "button": { - "confirmButton": "登陆" - }, "message": { "notNull":"不能为空" + }, + "tips": { + "pg_hba_conf1":"Confirm you have readed", + "pg_hba_conf2":"openGauss user manual", + "pg_hba_conf3":"and configured client remote connection white list", + "ban_omm":"Can't use openGauss initialized user to establish remote connection" } }, "processeddatas": { @@ -323,13 +344,16 @@ "uploadcsvfile": { "button": { "button_select_file": "Select file", - "button_submitUpload": "Upload to server" + "button_submitUpload": "Upload to server", + "button_back":"cancel" }, "div": { - "make_sure": "Please make sure that the first line in the uploaded CSV file is the header!" + "make_sure": "Please make sure that the first line in the uploaded CSV file is the header!", + "size": "Size of file must smaller than 5MB" }, "message": { - "file_num":"The current limit is 1 file!" + "file_num":"The current limit is 1 file!", + "upload_error":"Oversize!" } }, "uploadtxtfile": { @@ -338,7 +362,9 @@ "button_submitUpload": "Upload to server" }, "div": { - "make_sure": "Please make sure that the first line in the uploaded TXT file is the header!" + "make_sure": "Please make sure that the first line in the uploaded TXT file is the header!", + "make_sure_separator": "Please make sure the delimiter of the uploaded TXT file is', '", + "size": "Size of file must smaller than 5MB" } }, "uploadxlsorxlsxfile": { @@ -347,7 +373,8 @@ "button_submitUpload": "Upload to server" }, "div": { - "make_sure": "Please make sure that the first line in the uploaded xls and xlsx files is the header!" + "make_sure": "Please make sure that the first line in the uploaded xls and xlsx files is the header!", + "size": "Size of file must smaller than 5MB" } }, "echartsType":{ @@ -364,14 +391,18 @@ "loading": { "text": "Loading" }, + "selectAll":"All", "show":"display", "hidden":"Don't show", + "operation":"operation", "remove":"delete", "submit":"Submit", "error": "error", "tips": "Tips", - "confirm" : "determine", + "confirm" : "confirm", "cancel": "cancel", "success":"success", - "fail":"fail" + "fail":"fail", + "back":"back", + "title":"Title" } \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/assets/language/local_zh.json b/src/main/java/com/huawei/datashow/vue/src/assets/language/local_zh.json index 43e3bf8ace2bce0c5c18e8ebd2c8539e99827074..7879e35caacc64d0ed8dbc52c65ba1acf7df7d45 100644 --- a/src/main/java/com/huawei/datashow/vue/src/assets/language/local_zh.json +++ b/src/main/java/com/huawei/datashow/vue/src/assets/language/local_zh.json @@ -1,7 +1,7 @@ { "addsourcedata": { "span": { - "span_opengauss":"从数据库中导入", + "span_opengauss":"从openGauss数据库中导入", "span_excel":"从外部文件导入", "span_txt":"从txt文件导入" }, @@ -9,8 +9,7 @@ "button_toLogin":"添加数据库连接", "button_toUISourceData":"选择数据库连接", "button_toUploadXlsOrXlsxFile":"导入xls或xlsx文件", - "button_toUploadCSVFile":"导入csv文件", - "button_toUploadTxtFile":"导入txt文件" + "button_toUploadCSVOrTXTFile":"导入csv或txt文件" } }, "contextbutton": { @@ -23,12 +22,13 @@ "button": { "button_deleteSelection": "删除所选行", "button_preserve": "保存修改", + "button_reload": "重新加载数据源", "button_deleteSourceData": "删除数据源", "button_fatherMethodHandelSelectDataIsActive": "可视化" }, "message": { "deleteMessage":"选择了已删除的数据,请勿重复删除", - "bigSizeMessage":"数据量较大,保存修改耗时较长,是否执行?" + "bigSizeMessage":"数据量较大,保存修改耗时较长!" } }, "dialog-form": { @@ -76,9 +76,17 @@ "axis_right":"网格右侧距离", "axis_top":"网格上侧距离", "axis_bottom":"网格下侧距离", + "xAxis_name":"横轴名称", + "xAxis_name_color":"横轴名称颜色", + "xAxis_name_size":"横轴名称大小", "xAxis_font_size":"横轴字体大小", "xAxis_label_distance":"标签间隔", "xAxis_label_angel":"标签旋转角度", + "yAxis_name":"纵轴名称", + "yAxis_max":"纵轴最大值", + "yAxis_min":"纵轴最小值", + "yAxis_name_color":"纵轴名称颜色", + "yAxis_name_size":"纵轴名称大小", "yAxis_font_size":"纵轴字体大小", "data_zoom":"下方缩放控件", "echarts_text_label":"图形文本标签" @@ -155,6 +163,8 @@ "grid_right_distance": "网格右侧距离", "grid_top_distance": "网格上侧距离", "grid_bottom_distance": "网格下侧距离", + "xAxis_max":"横轴最大值", + "xAxis_min":"横轴最小值", "Horizontal_font_size": "横轴字体大小", "Tab_spacing": "标签间隔", "Label_rotation_angle": "标签旋转角度", @@ -214,6 +224,14 @@ "hide": "隐藏", "open": "开启", "close": "关闭", + "top_left": "左上方", + "top": "正上方", + "top_right": "右上方", + "right": "右侧", + "bottom_right": "右下方", + "bottom": "正下方", + "bottom_left": "左下方", + "left": "左侧", "horizontal_arrangement": "水平排列", "vertical_arrangement": "垂直排列" }, @@ -234,11 +252,14 @@ "username": "用户名", "password": "密码" }, - "button": { - "confirmButton": "登陆" - }, "message": { "notNull":"不能为空" + }, + "tips": { + "pg_hba_conf1":"请确认已经按照", + "pg_hba_conf2":"openGauss使用手册", + "pg_hba_conf3":"配置客户端远程连接白名单", + "ban_omm":"禁止使用openGauss数据库初始用户进行远程连接" } }, "processeddatas": { @@ -266,7 +287,7 @@ }, "message": { "data_source_name": "请输入数据源名称(请避免与已有数据源名称重复且不包含'.')", - "wrong_data_source_name": "数据源名称为空或不合法!" + "wrong_data_source_name": "请检查数据源名称是否已存在或为空或不合法!" } }, "uisourcedata": { @@ -323,13 +344,16 @@ "uploadcsvfile": { "button": { "button_select_file": "选取文件", - "button_submitUpload": "上传到服务器" + "button_submitUpload": "上传到服务器", + "button_back":"取消上传" }, "div": { - "make_sure": "请务必确认上传的CSV文件中的第一行是表头!" + "make_sure": "请务必确认上传的CSV文件中的第一行是表头!", + "size": "文件大小上限为5MB" }, "message": { - "file_num":"当前限制选择1个文件!" + "file_num":"当前限制选择1个文件!", + "upload_error":"超出文件大小限制" } }, "uploadtxtfile": { @@ -338,7 +362,9 @@ "button_submitUpload": "上传到服务器" }, "div": { - "make_sure": "请务必确认上传的TXT文件中的第一行是表头!" + "make_sure": "请务必确认上传的TXT文件中的第一行是表头!", + "make_sure_separator": "请务必确认上传的TXT文件的分隔符为','", + "size": "文件大小上限为5MB" } }, "uploadxlsorxlsxfile": { @@ -347,7 +373,8 @@ "button_submitUpload": "上传到服务器" }, "div": { - "make_sure": "请务必确认上传的xls、xlsx文件中的第一行是表头!" + "make_sure": "请务必确认上传的xls、xlsx文件中的第一行是表头!", + "size": "文件大小上限为5MB" } }, "echartsType":{ @@ -364,8 +391,10 @@ "loading": { "text": "正在加载" }, + "selectAll":"全选", "show":"显示", "hidden":"不显示", + "operation":"操作", "remove":"删除", "submit":"提交", "error": "错误", @@ -373,5 +402,7 @@ "confirm" : "确定", "cancel": "取消", "success":"成功", - "fail":"失败" + "fail":"失败", + "back":"返回", + "title":"请输入标题" } \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/components/addsourcedata/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/addsourcedata/index.vue index 966be5ebe7e9b60622407c8c512396db915d7ada..ca55941a8270eaeb03e53bc12896310335abb295 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/addsourcedata/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/addsourcedata/index.vue @@ -1,9 +1,9 @@ @@ -61,12 +48,9 @@ import router from '@/router'; toUploadXlsOrXlsxFile(){ router.push('/home/processeddatas/uploadxlsorxlsxfile') }, - toUploadCSVFile(){ - router.push('/home/processeddatas/uploadcsvfile') - }, - toUploadTxtFile(){ - router.push('/home/processeddatas/uploadtxtfile') - }, + toUploadCSVOrTxtFile(){ + router.push('/home/processeddatas/uploadcsvortxtfile') + } } } diff --git a/src/main/java/com/huawei/datashow/vue/src/components/datasource/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/datasource/index.vue index 0f811f4a4f748501694bed911ff115638aa18361..19094591165f77eab3d4e053a6bcd0bd26c4c881 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/datasource/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/datasource/index.vue @@ -13,8 +13,13 @@ :element-loading-text="$t('loading.text')" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)"> - + + + + {{$t('datasource.button.button_deleteSelection')}} + + {{$t('datasource.button.button_reload')}} + import ContextButton from '@/components/contextbutton' import axios from 'axios' +import router from '@/router' export default { props:[ 'dataSourceName' ], @@ -146,12 +158,31 @@ import axios from 'axios' this.fetchDataSource() }, + async reload() { + this.dataSourceEdit.deleteColumnName = [] + this.dataSourceEdit.deleteRowIndex = [] + await axios({ + url:'/handle-data-source/reload-data-source', + method:"get", + params:{ + 'dataSourceName':this.dataSourceName + } + }).then( + response => { + this.showMessage(this.$t('success'), response.data.message, "success") + }, + error => { + this.showMessage(this.$t('fail'), response.data.message, "error") + }) + this.fetchDataSource() + }, + async preserve(){ if (this.count < 10000) { this.saveEdit(); return; } - this.$confirm(this.$t('bigSizeMessage'), this.$t('tips'), { + this.$confirm(this.$t('datasource.message.bigSizeMessage'), this.$t('tips'), { confirmButtonText: this.$t('confirm'), cancelButtonText: this.$t('cancel'), type: 'warning' @@ -177,7 +208,8 @@ import axios from 'axios' type: 'success' }) this.sourcedata = [] - this.$parent.$parent.$parent.fetchDataSourceList() + this.headers = [] + this.$parent.$parent.$parent.fetchDataSourceList() }, error => { this.$message({ @@ -227,6 +259,16 @@ import axios from 'axios' this.dataSourceEdit.deleteColumnName.push(this.currentColumn.property) this.removeRowAndColumn() }, + + deleteRow (index, row) { + if (JSON.stringify(row) == "{}") { + this.showMessage(this.$t('error'), this.$t('datasource.message.deleteMessage'), "error") + return + } + let rowIndexInDataSource = this.getRowIndexInDataSource(row) + this.dataSourceEdit.deleteRowIndex.push(rowIndexInDataSource) + this.removeRowAndColumn() + }, async fetchDataSource() { this.el_table_loading = true @@ -296,7 +338,9 @@ import axios from 'axios' }) this.fetchDataSource() this.fetchDataSourceSize() - this.$parent.$parent.$parent.el_aside_loading = false + this.$parent.$parent.$parent.el_aside_loading = false + this.dataSourceEdit.deleteColumnName = [] + this.dataSourceEdit.deleteRowIndex = [] }, // Get the index of row in data source diff --git a/src/main/java/com/huawei/datashow/vue/src/components/dialog/dialog-form/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/dialog/dialog-form/index.vue index 7f50f9e0b9b084a988f02519d0b75228a5926ae4..8eabf1ae39dca3131ace1f3e3f9c4b07f3cbde2b 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/dialog/dialog-form/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/dialog/dialog-form/index.vue @@ -14,6 +14,7 @@ + {{$t('selectAll')}} - + + {{$t('selectAll')}} + {{$t('selectAll')}} + {{$t('selectAll')}} {} ) - } + }, + form_y_options_selectAll(val) { + this.form.yOptions = [] + if (val) { + for (let i = 0; i < this.columnNames.length; i++) { + this.form.yOptions.push(this.columnNames[i]); + } + } + }, + combination_form_bar_y_options_selectAll(val) { + this.combinationForm.yOptions.bar_yOptions = [] + if (val) { + for (let i = 0; i < this.columnNames.length; i++) { + this.combinationForm.yOptions.bar_yOptions.push(this.columnNames[i]); + } + } + }, + combination_form_line_y_options_selectAll(val) { + this.combinationForm.yOptions.line_yOptions = [] + if (val) { + for (let i = 0; i < this.columnNames.length; i++) { + this.combinationForm.yOptions.line_yOptions.push(this.columnNames[i]); + } + } + }, }, }; diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/Pie.vue b/src/main/java/com/huawei/datashow/vue/src/components/echarts/Pie.vue index 7c080e7040aa38da90b48f9936798dacdce3275c..39358826e7daf39979cb4fb8df8de5ab65f32ce4 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/Pie.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/Pie.vue @@ -4,7 +4,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -102,7 +102,7 @@ - + - + diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/Radar.vue b/src/main/java/com/huawei/datashow/vue/src/components/echarts/Radar.vue index cbc9e0b15eefe0509d76cd4c8967d1fe9ece75d1..74e688ce56aac9220cbfc1d4466ae65f7c69538d 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/Radar.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/Radar.vue @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + - + - + diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/YBar.vue b/src/main/java/com/huawei/datashow/vue/src/components/echarts/YBar.vue index aca677e07c1200edaee26e9e9046882c0386e267..a9462e80ca8395fde6785789b929074da04c6466 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/YBar.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/YBar.vue @@ -2,9 +2,9 @@ - + - + @@ -14,15 +14,11 @@ - - + + - + @@ -108,8 +100,8 @@ - - + + - + - + + @change="handle_echarts_legend_orient"> - + - - - - + @@ -203,13 +184,33 @@ - + + + + + + + + + + + + + + + + + + + + + - + @@ -218,14 +219,26 @@ - + + + + + + + + + + + + + - + diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/normal/normal.js b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/normal/normal.js index 815bd5eded0c04aa6736cc43197ebf50aac11cb2..ec7f6c2658e6afd2b35291afc206c21c5ba38799 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/normal/normal.js +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/normal/normal.js @@ -9,7 +9,7 @@ export const normal = { series: [], option: { title: { - text: 'echarts', + text: this.$t('title'), show: true, textStyle:{ color: '#000000', @@ -59,23 +59,33 @@ export const normal = { } }, tooltip: { - trigger: 'axis', - axisPointer: { type: 'cross' } + trigger: 'axis', + axisPointer: { type: 'cross' } }, boundaryGap:false, dataset:[], xAxis: { - type: 'category', - axisLabel:{ - fontSize:12, - interval:'auto', - rotate:0 - } + name: '', + nameTextStyle: { + color:'', + fontSize:12 + }, + type: 'category', + axisLabel:{ + fontSize:12, + interval:0, + rotate:0 + } }, yAxis: { - axisLabel:{ - fontSize:12, - } + name: '', + nameTextStyle: { + color:'', + fontSize:12 + }, + axisLabel:{ + fontSize:12, + }, }, series:[] }, @@ -115,13 +125,27 @@ export const normal = { echarts_grid_bottom:70, - + echarts_xAxis_name:'', + + echarts_xAxis_nameTextStyle_color:'#000000', + + echarts_xAxis_nameTextStyle_fontSize:12, + echarts_xAxis_axisLabel_fontSize:12, echarts_xAxis_axisLabel_interval:0, echarts_xAxis_axisLabel_rotate:0, - + + echarts_yAxis_max:0, + + echarts_yAxis_min:0, + + echarts_yAxis_name:'', + + echarts_yAxis_nameTextStyle_color:'#000000', + + echarts_yAxis_nameTextStyle_fontSize:12, echarts_yAxis_axisLabel_fontSize:12, @@ -143,12 +167,12 @@ export const normal = { } }, watch: { - datasets: { - handler: function() { - this.refreshEcharts() - }, - deep: true - } + datasets: { + handler: function() { + this.refreshEcharts() + }, + deep: true + } }, methods: { @@ -222,7 +246,6 @@ export const normal = { handle_echarts_series_name(){ - this.option.series = this.series myChart.setOption(this.option) }, @@ -306,6 +329,21 @@ export const normal = { this.option.grid.bottom = value myChart.setOption(this.option) }, + + handle_echarts_xAxis_name(value){ + this.option.xAxis.name = value + myChart.setOption(this.option) + }, + + handle_echarts_xAxis_nameTextStyle_color(){ + this.option.xAxis.nameTextStyle.color = this.echarts_xAxis_nameTextStyle_color + myChart.setOption(this.option) + }, + + handle_echarts_xAxis_nameTextStyle_fontSize(value){ + this.option.xAxis.nameTextStyle.fontSize = value + myChart.setOption(this.option) + }, handle_echarts_xAxis_axisLabel_fontSize(value){ @@ -323,7 +361,31 @@ export const normal = { myChart.setOption(this.option) }, - + handle_echarts_yAxis_max(value){ + this.option.yAxis.max = value + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_min(value){ + this.option.yAxis.min = value + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_name(value){ + this.option.yAxis.name = value + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_nameTextStyle_color(){ + this.option.yAxis.nameTextStyle.color = this.echarts_yAxis_nameTextStyle_color + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_nameTextStyle_fontSize(value){ + this.option.yAxis.nameTextStyle.fontSize = value + myChart.setOption(this.option) + }, + handle_echarts_yAxis_axisLabel_fontSize(value){ this.option.yAxis.axisLabel.fontSize = value myChart.setOption(this.option) diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/radar/radar.js b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/radar/radar.js index 04607910fd869e4979c2d8c086ab49dde086d7b8..b64183fcd98cacc5f3a023dc3d9b3e2b3a3be26e 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/radar/radar.js +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/radar/radar.js @@ -14,7 +14,7 @@ export const radar = { option: { title: { - text: 'echarts', + text: this.$t('title'), show: true, textStyle:{ color: '#000000', diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/ybar/ybar.js b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/ybar/ybar.js index d090c7380e5f1b4b6f9a7a8ae2acb60a7d52d37e..134b4d5e91a26d34b7b6ba6a9dd1be9dc825b37e 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/ybar/ybar.js +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/mixin/ybar/ybar.js @@ -15,7 +15,7 @@ export const ybar = { option: { title: { - text: 'echarts', + text: this.$t('title'), show: true, textStyle:{ color: '#000000', @@ -72,17 +72,25 @@ export const ybar = { dataset:[], xAxis: { + name: '', + nameTextStyle: { + color:'', + fontSize:12 + }, axisLabel:{ - fontSize:12, - interval:'auto', - rotate:0 + fontSize:12 } }, yAxis: { + name: '', + nameTextStyle: { + color:'', + fontSize:12 + }, type: 'category', axisLabel:{ fontSize:12, - interval:'auto', + interval:0, rotate:0 } }, @@ -127,7 +135,16 @@ export const ybar = { echarts_grid_top:60, echarts_grid_bottom:70, + + echarts_xAxis_max:0, + + echarts_xAxis_min:0, + echarts_xAxis_name:'', + + echarts_xAxis_nameTextStyle_color:'#000000', + + echarts_xAxis_nameTextStyle_fontSize:12, echarts_xAxis_axisLabel_fontSize:12, @@ -135,10 +152,14 @@ export const ybar = { echarts_xAxis_axisLabel_rotate:0, + echarts_yAxis_name:'', + + echarts_yAxis_nameTextStyle_color:'#000000', + + echarts_yAxis_nameTextStyle_fontSize:12, echarts_yAxis_axisLabel_fontSize:12, - echarts_data_zoom_is_active:true, echarts_series_label_show:false, @@ -319,7 +340,31 @@ export const ybar = { this.option.grid.bottom = value myChart.setOption(this.option) }, + + handle_echarts_xAxis_max(value){ + this.option.xAxis.max = value + myChart.setOption(this.option) + }, + + handle_echarts_xAxis_min(value){ + this.option.xAxis.min = value + myChart.setOption(this.option) + }, + handle_echarts_xAxis_name(value){ + this.option.xAxis.name = value + myChart.setOption(this.option) + }, + + handle_echarts_xAxis_nameTextStyle_color(){ + this.option.xAxis.nameTextStyle.color = this.echarts_xAxis_nameTextStyle_color + myChart.setOption(this.option) + }, + + handle_echarts_xAxis_nameTextStyle_fontSize(value){ + this.option.xAxis.nameTextStyle.fontSize = value + myChart.setOption(this.option) + }, handle_echarts_xAxis_axisLabel_fontSize(value){ this.option.xAxis.axisLabel.fontSize = value @@ -335,8 +380,22 @@ export const ybar = { this.option.xAxis.axisLabel.rotate = value myChart.setOption(this.option) }, - + handle_echarts_yAxis_name(value){ + this.option.yAxis.name = value + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_nameTextStyle_color(){ + this.option.yAxis.nameTextStyle.color = this.echarts_yAxis_nameTextStyle_color + myChart.setOption(this.option) + }, + + handle_echarts_yAxis_nameTextStyle_fontSize(value){ + this.option.yAxis.nameTextStyle.fontSize = value + myChart.setOption(this.option) + }, + handle_echarts_yAxis_axisLabel_fontSize(value){ this.option.yAxis.axisLabel.fontSize = value myChart.setOption(this.option) diff --git a/src/main/java/com/huawei/datashow/vue/src/components/echarts/normal.vue b/src/main/java/com/huawei/datashow/vue/src/components/echarts/normal.vue index 0bf10b12b4f36c46a646c4898dc5c481341c3090..5680d2d49c943576e42de74049a53023ad15fe9c 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/echarts/normal.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/echarts/normal.vue @@ -1,12 +1,12 @@ diff --git a/src/main/java/com/huawei/datashow/vue/src/components/processeddatas/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/processeddatas/index.vue index 7dc7817569cbca50309d2f07c0b0d9c9509ebf54..f8fb248c56586512e87c1719d561c37e9b415212 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/processeddatas/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/processeddatas/index.vue @@ -67,7 +67,8 @@ methods: { error => { } ) - this.el_aside_loading = false + this.el_aside_loading = false + this.$store.commit('updateDataSourceList', this.dataSourceList) }, handleAddSourceData(){ this.selectDataIsActive = false diff --git a/src/main/java/com/huawei/datashow/vue/src/components/sourcedata/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/sourcedata/index.vue index a9aba4de7763cf25e4d7d712dd5d63767cbc0a75..d1dbfd6304853475b5f41476015f40b0c6043542 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/sourcedata/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/sourcedata/index.vue @@ -120,7 +120,7 @@ export default { confirmButtonText: this.$t('confirm'), cancelButtonText: this.$t('cancel'), }).then(({ value }) => { - if (value == null || value.includes('.')) { + if (value == null || value.includes('.') || this.$store.state.dataSourceList.indexOf(value) !== -1) { this.$message({ type: 'error', message: this.$t('sourcedata.message.wrong_data_source_name') diff --git a/src/main/java/com/huawei/datashow/vue/src/components/uisourcedata/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/uisourcedata/index.vue index 3f7c1993bd1f1b0c7c7e141c9076f6db173e17e2..b161b4679dc9922bd427bfd2b279f78de6b330bc 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/uisourcedata/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/uisourcedata/index.vue @@ -2,6 +2,14 @@ + + {{$t('back')}} + import axios from 'axios' import SourceData from '@/components/sourcedata' +import router from '@/router'; export default { data() { return { @@ -584,6 +593,10 @@ methods: { error => { } ) + }, + + back() { + router.push("/home/processeddatas/addsourcedata") } }, mounted() { diff --git a/src/main/java/com/huawei/datashow/vue/src/components/uploadcsvfile/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/uploadcsvortxtfile/index.vue similarity index 49% rename from src/main/java/com/huawei/datashow/vue/src/components/uploadcsvfile/index.vue rename to src/main/java/com/huawei/datashow/vue/src/components/uploadcsvortxtfile/index.vue index 6db35d7e0ba9da5ebe9a7f63d721bd770e18d3b4..b5c33683a04eca21cdd96f9df6c78aada1b40c12 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/uploadcsvfile/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/uploadcsvortxtfile/index.vue @@ -1,21 +1,26 @@ - - \ No newline at end of file diff --git a/src/main/java/com/huawei/datashow/vue/src/components/uploadxlsorxlsxfile/index.vue b/src/main/java/com/huawei/datashow/vue/src/components/uploadxlsorxlsxfile/index.vue index a71263d4876d6ddb5a68a7e77853d072ef220472..df3c6353c7cd918c2f32b9e825fd56afd4ef352e 100644 --- a/src/main/java/com/huawei/datashow/vue/src/components/uploadxlsorxlsxfile/index.vue +++ b/src/main/java/com/huawei/datashow/vue/src/components/uploadxlsorxlsxfile/index.vue @@ -8,13 +8,18 @@ :auto-upload="false" :limit="1" :on-exceed="handleExceed" + :on-success="handleSuccess" + :on-error="handleError" > {{$t('uploadxlsorxlsxfile.button.button_select_file')}} {{$t('uploadxlsorxlsxfile.button.button_submitUpload')}} +
{{$t('uploadxlsorxlsxfile.div.make_sure')}}
+
{{$t('uploadxlsorxlsxfile.div.size')}}