提交 0a6e5524 authored 作者: wangjiahao's avatar wangjiahao

Merge remote-tracking branch 'origin/dev' into dev

...@@ -68,7 +68,7 @@ public class DePermissionAnnotationHandler { ...@@ -68,7 +68,7 @@ public class DePermissionAnnotationHandler {
return point.proceed(point.getArgs()); return point.proceed(point.getArgs());
} catch (Throwable throwable) { } catch (Throwable throwable) {
LogUtil.error(throwable.getMessage(), throwable); LogUtil.error(throwable.getMessage(), throwable);
throw new RuntimeException(throwable); throw new RuntimeException(throwable.getMessage());
} }
} }
......
package io.dataease.auth.api;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("api/data")
public class demo {
@ApiOperation("查询")
@GetMapping("demo")
public Object listByTableId() {
JSONArray jsonArray = new JSONArray();
for(int i=0;i<10;i++){
JSONObject jsonObject = new JSONObject();
for(int j=0;j<1;j++){
jsonObject.set("column" +i + j, "value"+i+j);
}
jsonArray.put(jsonObject);
}
return jsonArray;
}
}
...@@ -20,7 +20,6 @@ public class ShiroServiceImpl implements ShiroService { ...@@ -20,7 +20,6 @@ public class ShiroServiceImpl implements ShiroService {
// ---------------------------------------------------------- // ----------------------------------------------------------
// 放行Swagger2页面,需要放行这些 // 放行Swagger2页面,需要放行这些
filterChainDefinitionMap.put("/api/data/demo", ANON);
filterChainDefinitionMap.put("/doc.html**", "doc"); filterChainDefinitionMap.put("/doc.html**", "doc");
filterChainDefinitionMap.put("/deApi**", ANON); filterChainDefinitionMap.put("/deApi**", ANON);
filterChainDefinitionMap.put("/swagger-ui.html", ANON); filterChainDefinitionMap.put("/swagger-ui.html", ANON);
......
...@@ -37,8 +37,7 @@ public class DataSetTableController { ...@@ -37,8 +37,7 @@ public class DataSetTableController {
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.DATASET, value = "id"), @DePermission(type = DePermissionType.DATASET, value = "id"),
@DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE), @DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@DePermission(type = DePermissionType.DATASOURCE, value = "dataSourceId", level = ResourceAuthLevel.DATASET_LEVEL_USE)
}, logical = Logical.AND) }, logical = Logical.AND)
@ApiOperation("批量保存") @ApiOperation("批量保存")
@PostMapping("batchAdd") @PostMapping("batchAdd")
...@@ -48,8 +47,7 @@ public class DataSetTableController { ...@@ -48,8 +47,7 @@ public class DataSetTableController {
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.DATASET, value = "id", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE), @DePermission(type = DePermissionType.DATASET, value = "id", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE),
@DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE), @DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@DePermission(type = DePermissionType.DATASOURCE, value = "dataSourceId", level = ResourceAuthLevel.DATASET_LEVEL_USE)
}, logical = Logical.AND) }, logical = Logical.AND)
@ApiOperation("更新") @ApiOperation("更新")
@PostMapping("update") @PostMapping("update")
...@@ -63,8 +61,7 @@ public class DataSetTableController { ...@@ -63,8 +61,7 @@ public class DataSetTableController {
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.DATASET, value = "id", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE), @DePermission(type = DePermissionType.DATASET, value = "id", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE),
@DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE), @DePermission(type = DePermissionType.DATASET, value = "sceneId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@DePermission(type = DePermissionType.DATASOURCE, value = "dataSourceId", level = ResourceAuthLevel.DATASET_LEVEL_USE)
}, logical = Logical.AND) }, logical = Logical.AND)
@ApiOperation("修改") @ApiOperation("修改")
@PostMapping("alter") @PostMapping("alter")
...@@ -107,7 +104,6 @@ public class DataSetTableController { ...@@ -107,7 +104,6 @@ public class DataSetTableController {
return dataSetTableService.getWithPermission(id, null); return dataSetTableService.getWithPermission(id, null);
} }
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_USE, value = "dataSourceId")
@ApiOperation("查询原始字段") @ApiOperation("查询原始字段")
@PostMapping("getFields") @PostMapping("getFields")
public List<TableField> getFields(@RequestBody DatasetTable datasetTable) throws Exception { public List<TableField> getFields(@RequestBody DatasetTable datasetTable) throws Exception {
...@@ -128,14 +124,12 @@ public class DataSetTableController { ...@@ -128,14 +124,12 @@ public class DataSetTableController {
return dataSetTableService.getPreviewData(dataSetTableRequest, page, pageSize, null); return dataSetTableService.getPreviewData(dataSetTableRequest, page, pageSize, null);
} }
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_USE, value = "dataSourceId")
@ApiOperation("根据sql查询预览数据") @ApiOperation("根据sql查询预览数据")
@PostMapping("sqlPreview") @PostMapping("sqlPreview")
public Map<String, Object> getSQLPreview(@RequestBody DataSetTableRequest dataSetTableRequest) throws Exception { public Map<String, Object> getSQLPreview(@RequestBody DataSetTableRequest dataSetTableRequest) throws Exception {
return dataSetTableService.getSQLPreview(dataSetTableRequest); return dataSetTableService.getSQLPreview(dataSetTableRequest);
} }
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_USE, value = "dataSourceId")
@ApiOperation("预览自定义数据数据") @ApiOperation("预览自定义数据数据")
@PostMapping("customPreview") @PostMapping("customPreview")
public Map<String, Object> customPreview(@RequestBody DataSetTableRequest dataSetTableRequest) throws Exception { public Map<String, Object> customPreview(@RequestBody DataSetTableRequest dataSetTableRequest) throws Exception {
......
...@@ -80,7 +80,7 @@ public class PanelGroupController { ...@@ -80,7 +80,7 @@ public class PanelGroupController {
@DePermissionProxy(paramIndex = 1) @DePermissionProxy(paramIndex = 1)
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
@PostMapping("/proxy/findOne/{id}") @PostMapping("/proxy/findOne/{id}")
public PanelGroupWithBLOBs proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy) public PanelGroupDTO proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy)
throws Exception { throws Exception {
return panelGroupService.findOne(id); return panelGroupService.findOne(id);
} }
......
...@@ -64,12 +64,12 @@ public class ColumnPermissionsController { ...@@ -64,12 +64,12 @@ public class ColumnPermissionsController {
return columnPermissionService.searchPermissions(request); return columnPermissionService.searchPermissions(request);
} }
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE) @DePermission(type = DePermissionType.DATASET, value = "datasetId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("/delete/{id}") @PostMapping("/delete")
public void delete(@PathVariable String id) { public void delete(@RequestBody DatasetColumnPermissions datasetColumnPermissions) {
ColumnPermissionService columnPermissionService = SpringContextUtil.getBean(ColumnPermissionService.class); ColumnPermissionService columnPermissionService = SpringContextUtil.getBean(ColumnPermissionService.class);
columnPermissionService.delete(id); columnPermissionService.delete(datasetColumnPermissions.getId());
} }
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE) @DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
......
...@@ -62,12 +62,12 @@ public class RowPermissionsController { ...@@ -62,12 +62,12 @@ public class RowPermissionsController {
return rowPermissionService.searchRowPermissions(request); return rowPermissionService.searchRowPermissions(request);
} }
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_MANAGE) @DePermission(type = DePermissionType.DATASET, value = "datasetId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("/delete/{id}") @PostMapping("/delete")
public void dataSetRowPermissionInfo(@PathVariable String id) { public void dataSetRowPermissionInfo(@RequestBody DatasetRowPermissions datasetRowPermissions) {
RowPermissionService rowPermissionService = SpringContextUtil.getBean(RowPermissionService.class); RowPermissionService rowPermissionService = SpringContextUtil.getBean(RowPermissionService.class);
rowPermissionService.delete(id); rowPermissionService.delete(datasetRowPermissions.getId());
} }
@DePermission(type = DePermissionType.DATASET, value = "datasetId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE) @DePermission(type = DePermissionType.DATASET, value = "datasetId", level = ResourceAuthLevel.DATASET_LEVEL_MANAGE)
......
package io.dataease.plugins.server; package io.dataease.plugins.server;
import io.dataease.auth.api.dto.CurrentUserDto; import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.commons.constants.AuthConstants; import io.dataease.commons.constants.AuthConstants;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
...@@ -20,6 +19,8 @@ import io.dataease.plugins.xpack.auth.service.AuthXpackService; ...@@ -20,6 +19,8 @@ import io.dataease.plugins.xpack.auth.service.AuthXpackService;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@ApiIgnore @ApiIgnore
@RequestMapping("/plugin/auth") @RequestMapping("/plugin/auth")
@RestController @RestController
...@@ -74,11 +75,31 @@ public class XAuthServer { ...@@ -74,11 +75,31 @@ public class XAuthServer {
} }
String authCacheKey = getAuthCacheKey(request); String authCacheKey = getAuthCacheKey(request);
if (StringUtils.isNotBlank(authCacheKey)) { if (StringUtils.isNotBlank(authCacheKey)) {
CacheUtils.remove(authCacheKey, request.getAuthTargetType() + request.getAuthTarget()); if (StringUtils.equals("dept", request.getAuthTargetType())) {
List<String> authTargets = getAuthModels(request.getAuthTarget(), request.getAuthTargetType(),
user.getUserId(), user.getIsAdmin());
if (CollectionUtils.isNotEmpty(authTargets)) {
authTargets.forEach(deptId -> {
CacheUtils.remove(authCacheKey, request.getAuthTargetType() + deptId);
});
}
} else {
CacheUtils.remove(authCacheKey, request.getAuthTargetType() + request.getAuthTarget());
}
} }
}); });
} }
private List<String> getAuthModels(String id, String type, Long userId, Boolean isAdmin) {
AuthXpackService sysAuthService = SpringContextUtil.getBean(AuthXpackService.class);
List<XpackVAuthModelDTO> vAuthModelDTOS = sysAuthService
.searchAuthModelTree(new XpackBaseTreeRequest(id, type, "children"), userId, isAdmin);
List<String> authSources = Optional.ofNullable(vAuthModelDTOS).orElse(new ArrayList<>()).stream()
.map(XpackVAuthModelDTO::getId)
.collect(Collectors.toList());
return authSources;
}
private String getAuthCacheKey(XpackSysAuthRequest request) { private String getAuthCacheKey(XpackSysAuthRequest request) {
if (CollectionUtils.isEmpty(cacheTypes)) { if (CollectionUtils.isEmpty(cacheTypes)) {
......
...@@ -606,7 +606,7 @@ public class JdbcProvider extends DatasourceProvider { ...@@ -606,7 +606,7 @@ public class JdbcProvider extends DatasourceProvider {
case mysql: case mysql:
case mariadb: case mariadb:
JdbcConfiguration jdbcConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), JdbcConfiguration.class); JdbcConfiguration jdbcConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), JdbcConfiguration.class);
return String.format("SELECT TABLE_NAME,TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = '%s' ;", jdbcConfiguration.getDataBase()); return String.format("SELECT TABLE_NAME,TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s' ;", jdbcConfiguration.getDataBase());
case de_doris: case de_doris:
case ds_doris: case ds_doris:
case hive: case hive:
......
...@@ -26,14 +26,12 @@ public class VAuthModelService { ...@@ -26,14 +26,12 @@ public class VAuthModelService {
public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request) { public List<VAuthModelDTO> queryAuthModel(VAuthModelRequest request) {
request.setUserId(String.valueOf(AuthUtils.getUser().getUserId())); request.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
// 定时任务选数据集时,列表需去除空目录
if (request.isClearEmptyDir()) {
request.setMode(null);
}
List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request); List<VAuthModelDTO> result = extVAuthModelMapper.queryAuthModel(request);
// 定时任务选数据集时,列表需去除空目录
if (request.getPrivileges() != null) {
result = filterPrivileges(request, result);
}
if (request.isClearEmptyDir()) { if (request.isClearEmptyDir()) {
result = filterData(request, result);
List<VAuthModelDTO> vAuthModelDTOS = TreeUtils.mergeTree(result); List<VAuthModelDTO> vAuthModelDTOS = TreeUtils.mergeTree(result);
setAllLeafs(vAuthModelDTOS); setAllLeafs(vAuthModelDTOS);
removeEmptyDir(vAuthModelDTOS); removeEmptyDir(vAuthModelDTOS);
...@@ -42,16 +40,7 @@ public class VAuthModelService { ...@@ -42,16 +40,7 @@ public class VAuthModelService {
return TreeUtils.mergeTree(result); return TreeUtils.mergeTree(result);
} }
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) { private List<VAuthModelDTO> filterPrivileges(VAuthModelRequest request, List<VAuthModelDTO> result) {
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {
result = result.stream().filter(vAuthModelDTO -> {
if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getMode().equals(1L)) && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("excel") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("custom") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("union")) {
return true;
} else {
return false;
}
}).collect(Collectors.toList());
}
if (request.getPrivileges() != null) { if (request.getPrivileges() != null) {
result = result.stream().filter(vAuthModelDTO -> { result = result.stream().filter(vAuthModelDTO -> {
if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getPrivileges() != null && vAuthModelDTO.getPrivileges().contains(request.getPrivileges()))) { if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getPrivileges() != null && vAuthModelDTO.getPrivileges().contains(request.getPrivileges()))) {
......
...@@ -283,7 +283,6 @@ public class PanelGroupService { ...@@ -283,7 +283,6 @@ public class PanelGroupService {
panelData = panelData.replaceAll(panelView.getCopyFromView(), panelView.getChartViewId()); panelData = panelData.replaceAll(panelView.getCopyFromView(), panelView.getChartViewId());
} }
newPanel.setPanelData(panelData); newPanel.setPanelData(panelData);
panelGroupMapper.insertSelective(newPanel);
//TODO 复制跳转信息 copy panel_link_jump panel_link_jump_info panel_link_jump_target_view_info //TODO 复制跳转信息 copy panel_link_jump panel_link_jump_info panel_link_jump_target_view_info
extPanelLinkJumpMapper.copyLinkJump(copyId); extPanelLinkJumpMapper.copyLinkJump(copyId);
extPanelLinkJumpMapper.copyLinkJumpInfo(copyId); extPanelLinkJumpMapper.copyLinkJumpInfo(copyId);
...@@ -292,6 +291,7 @@ public class PanelGroupService { ...@@ -292,6 +291,7 @@ public class PanelGroupService {
extPanelViewLinkageMapper.copyViewLinkage(copyId); extPanelViewLinkageMapper.copyViewLinkage(copyId);
extPanelViewLinkageMapper.copyViewLinkageField(copyId); extPanelViewLinkageMapper.copyViewLinkageField(copyId);
} }
panelGroupMapper.insertSelective(newPanel);
return newPanelId; return newPanelId;
} }
......
...@@ -244,7 +244,15 @@ delete from panel_view where id in ( ...@@ -244,7 +244,15 @@ delete from panel_view where id in (
'805b0bdb-8e0a-11ec-8e4b-0242ac130002', '805b0bdb-8e0a-11ec-8e4b-0242ac130002',
'805b0cc1-8e0a-11ec-8e4b-0242ac130002', '805b0cc1-8e0a-11ec-8e4b-0242ac130002',
'805b0cf8-8e0a-11ec-8e4b-0242ac130002', '805b0cf8-8e0a-11ec-8e4b-0242ac130002',
'805b0d31-8e0a-11ec-8e4b-0242ac130002' '805b0d31-8e0a-11ec-8e4b-0242ac130002',
'7583dc0d-058d-11ec-a2b0-0242ac130003',
'7583deb5-058d-11ec-a2b0-0242ac130003',
'7583df2c-058d-11ec-a2b0-0242ac130003',
'7583df74-058d-11ec-a2b0-0242ac130003',
'7583dfbe-058d-11ec-a2b0-0242ac130003',
'7583e00f-058d-11ec-a2b0-0242ac130003',
'7583e053-058d-11ec-a2b0-0242ac130003',
'7583e091-058d-11ec-a2b0-0242ac130003'
); );
INSERT INTO `panel_view` VALUES ('5dafcf9b-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', '84b444e1-0088-44f9-acdc-cc39018413bc', NULL, NULL, NULL, NULL, NULL), ('5dafd1d1-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c68db172-2df2-4aa2-aad6-077cf1684e14', NULL, NULL, NULL, NULL, NULL), ('5dafd224-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'f8d62b2b-b99a-4b6c-8378-d7c2ec4ea766', NULL, NULL, NULL, NULL, NULL), ('5dafd26e-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c4943403-4960-4ad8-a9c5-12c46c538c34', NULL, NULL, NULL, NULL, NULL), ('5dafd2ac-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'f257452d-6fc1-4499-bdce-bd10b3e1c520', NULL, NULL, NULL, NULL, NULL), ('5dafd2f1-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', '8271c4e4-43ab-48c6-b7b4-67ccaba3f80b', NULL, NULL, NULL, NULL, NULL), ('5dafd32e-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'a0058881-b29f-4b5c-911f-7f1480b07eb0', NULL, NULL, NULL, NULL, NULL), ('5dafd363-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c36cd358-0501-4f83-a323-f754485d00b1', NULL, NULL, NULL, NULL, NULL), ('6c200051-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '95f8e3a2-62a5-48a7-a719-fcf53746da8d', NULL, NULL, NULL, NULL, NULL), ('6c2002c2-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '8a26a936-89bf-45a8-b1ce-d5ef1719465d', NULL, NULL, NULL, NULL, NULL), ('6c20030f-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '8d1c3f30-0639-452e-9883-164f37353324', NULL, NULL, NULL, NULL, NULL), ('6c2003ca-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '175b25df-1939-4582-a9c5-d9e8ed3ea2b1', NULL, NULL, NULL, NULL, NULL), ('6c20040d-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'c3da496f-073c-413a-bebd-e7f1a4a00ba7', NULL, NULL, NULL, NULL, NULL), ('6c200442-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'da18eecd-feff-4140-a291-cce4abf1afaa', NULL, NULL, NULL, NULL, NULL), ('6c200478-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '3f201733-bbb3-485e-a1d6-0fe4f00b5304', NULL, NULL, NULL, NULL, NULL), ('6c2004a9-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '692d5bdc-aa70-4fce-b830-b8d6620539c6', NULL, NULL, NULL, NULL, NULL), ('6c2004e4-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'aff5be0c-f195-4fce-bd2b-b8d0e63764de', NULL, NULL, NULL, NULL, NULL), ('6c200530-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'cb66836d-a34c-40c6-87e7-0db0375ec19e', NULL, NULL, NULL, NULL, NULL), ('6c200568-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '1d06e2a0-d936-4192-b523-2eb1e8cebd51', NULL, NULL, NULL, NULL, NULL), ('6c200598-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '0de1d446-8300-4ab3-a4ef-4e8f8579cb2e', NULL, NULL, NULL, NULL, NULL), ('7611e439-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'ebac2821-d1a0-4f26-b5d9-cd5c60ac75ab', NULL, NULL, NULL, NULL, NULL), ('7611e678-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '5ad64afc-132c-40ea-8f69-2f8bfe6b31d4', NULL, NULL, NULL, NULL, NULL), ('7611e6c4-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '4242cbb0-fca4-4b27-b2a7-ca576a18815e', NULL, NULL, NULL, NULL, NULL), ('7611e700-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'c52b6d95-b404-4130-8635-5903cb8d0e84', NULL, NULL, NULL, NULL, NULL), ('7611e7d0-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '2e6f8b45-116d-46c4-a287-f3054e798556', NULL, NULL, NULL, NULL, NULL), ('7611e80a-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '504c0abd-7d31-4771-8ef9-a3494c7bb33c', NULL, NULL, NULL, NULL, NULL), ('7611e844-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '02136575-effb-4a0c-b5be-9886d20259b3', NULL, NULL, NULL, NULL, NULL), ('7611e87d-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '8412d80d-1830-4128-bc6a-019cf32afc7f', NULL, NULL, NULL, NULL, NULL), ('7611e8b5-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '0f9cd623-f319-4bb5-9751-7478abee3bd2', NULL, NULL, NULL, NULL, NULL), ('7611e8ed-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'a1d7bfef-f20c-4739-bfe4-cc55ed0b3fc8', NULL, NULL, NULL, NULL, NULL), ('7611e923-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '68fc74f2-1790-427a-ac22-49fb20edbe9a', NULL, NULL, NULL, NULL, NULL), ('7611e957-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '97400660-27a5-4502-a7cd-274190953a6c', NULL, NULL, NULL, NULL, NULL), ('7611e98f-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '07ece816-f983-493e-b25d-7bfb467d787d', NULL, NULL, NULL, NULL, NULL), ('7611e9c9-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'c124c0f3-3f1f-4635-bac7-f3e1f5503099', NULL, NULL, NULL, NULL, NULL), ('7611ea05-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '984059ca-3f9d-4ee4-9616-e409dd11991e', NULL, NULL, NULL, NULL, NULL), ('7611ea46-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '2de7c3d3-e642-4509-aff1-b2520ebfe85e', NULL, NULL, NULL, NULL, NULL), ('805b082d-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '3a5e4081-4cd5-427f-bd3a-ff7815efaf25', NULL, NULL, NULL, NULL, NULL), ('805b0a85-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '57760693-15db-4de9-9170-55ee7d1eb0eb', NULL, NULL, NULL, NULL, NULL), ('805b0abb-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '0d8bc9d7-b76b-4ec5-96e7-0df1c3426205', NULL, NULL, NULL, NULL, NULL), ('805b0ae0-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '03410ec1-1bd0-4afd-ac37-9306e00e328c', NULL, NULL, NULL, NULL, NULL), ('805b0b0f-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', 'eaa8947b-d9e7-4ca4-ba65-08965dfa620c', NULL, NULL, NULL, NULL, NULL), ('805b0b2d-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '93a58625-3730-4a07-99bd-75f174ff428d', NULL, NULL, NULL, NULL, NULL), ('805b0bdb-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '2f9bf4d5-b1d3-4cac-9df2-2c8827d65bbf', NULL, NULL, NULL, NULL, NULL), ('805b0cc1-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '1aad98e5-3f99-4c0a-aa75-ca9236de0f09', NULL, NULL, NULL, NULL, NULL), ('805b0cf8-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '5f694f25-b0fd-45f6-acbd-9dd338e196ce', NULL, NULL, NULL, NULL, NULL), ('805b0d31-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '9ecb6827-f47f-4b19-b788-81a6b55940af', NULL, NULL, NULL, NULL, NULL); INSERT INTO `panel_view` VALUES ('5dafcf9b-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', '84b444e1-0088-44f9-acdc-cc39018413bc', NULL, NULL, NULL, NULL, NULL), ('5dafd1d1-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c68db172-2df2-4aa2-aad6-077cf1684e14', NULL, NULL, NULL, NULL, NULL), ('5dafd224-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'f8d62b2b-b99a-4b6c-8378-d7c2ec4ea766', NULL, NULL, NULL, NULL, NULL), ('5dafd26e-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c4943403-4960-4ad8-a9c5-12c46c538c34', NULL, NULL, NULL, NULL, NULL), ('5dafd2ac-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'f257452d-6fc1-4499-bdce-bd10b3e1c520', NULL, NULL, NULL, NULL, NULL), ('5dafd2f1-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', '8271c4e4-43ab-48c6-b7b4-67ccaba3f80b', NULL, NULL, NULL, NULL, NULL), ('5dafd32e-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'a0058881-b29f-4b5c-911f-7f1480b07eb0', NULL, NULL, NULL, NULL, NULL), ('5dafd363-8e0a-11ec-8e4b-0242ac130002', '117f679e-8355-4645-a692-47e2009cbc0d', 'c36cd358-0501-4f83-a323-f754485d00b1', NULL, NULL, NULL, NULL, NULL), ('6c200051-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '95f8e3a2-62a5-48a7-a719-fcf53746da8d', NULL, NULL, NULL, NULL, NULL), ('6c2002c2-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '8a26a936-89bf-45a8-b1ce-d5ef1719465d', NULL, NULL, NULL, NULL, NULL), ('6c20030f-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '8d1c3f30-0639-452e-9883-164f37353324', NULL, NULL, NULL, NULL, NULL), ('6c2003ca-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '175b25df-1939-4582-a9c5-d9e8ed3ea2b1', NULL, NULL, NULL, NULL, NULL), ('6c20040d-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'c3da496f-073c-413a-bebd-e7f1a4a00ba7', NULL, NULL, NULL, NULL, NULL), ('6c200442-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'da18eecd-feff-4140-a291-cce4abf1afaa', NULL, NULL, NULL, NULL, NULL), ('6c200478-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '3f201733-bbb3-485e-a1d6-0fe4f00b5304', NULL, NULL, NULL, NULL, NULL), ('6c2004a9-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '692d5bdc-aa70-4fce-b830-b8d6620539c6', NULL, NULL, NULL, NULL, NULL), ('6c2004e4-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'aff5be0c-f195-4fce-bd2b-b8d0e63764de', NULL, NULL, NULL, NULL, NULL), ('6c200530-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', 'cb66836d-a34c-40c6-87e7-0db0375ec19e', NULL, NULL, NULL, NULL, NULL), ('6c200568-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '1d06e2a0-d936-4192-b523-2eb1e8cebd51', NULL, NULL, NULL, NULL, NULL), ('6c200598-8e0a-11ec-8e4b-0242ac130002', 'c8d4c4b4-2293-417f-b76d-3632cc217bb1', '0de1d446-8300-4ab3-a4ef-4e8f8579cb2e', NULL, NULL, NULL, NULL, NULL), ('7611e439-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'ebac2821-d1a0-4f26-b5d9-cd5c60ac75ab', NULL, NULL, NULL, NULL, NULL), ('7611e678-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '5ad64afc-132c-40ea-8f69-2f8bfe6b31d4', NULL, NULL, NULL, NULL, NULL), ('7611e6c4-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '4242cbb0-fca4-4b27-b2a7-ca576a18815e', NULL, NULL, NULL, NULL, NULL), ('7611e700-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'c52b6d95-b404-4130-8635-5903cb8d0e84', NULL, NULL, NULL, NULL, NULL), ('7611e7d0-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '2e6f8b45-116d-46c4-a287-f3054e798556', NULL, NULL, NULL, NULL, NULL), ('7611e80a-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '504c0abd-7d31-4771-8ef9-a3494c7bb33c', NULL, NULL, NULL, NULL, NULL), ('7611e844-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '02136575-effb-4a0c-b5be-9886d20259b3', NULL, NULL, NULL, NULL, NULL), ('7611e87d-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '8412d80d-1830-4128-bc6a-019cf32afc7f', NULL, NULL, NULL, NULL, NULL), ('7611e8b5-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '0f9cd623-f319-4bb5-9751-7478abee3bd2', NULL, NULL, NULL, NULL, NULL), ('7611e8ed-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'a1d7bfef-f20c-4739-bfe4-cc55ed0b3fc8', NULL, NULL, NULL, NULL, NULL), ('7611e923-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '68fc74f2-1790-427a-ac22-49fb20edbe9a', NULL, NULL, NULL, NULL, NULL), ('7611e957-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '97400660-27a5-4502-a7cd-274190953a6c', NULL, NULL, NULL, NULL, NULL), ('7611e98f-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '07ece816-f983-493e-b25d-7bfb467d787d', NULL, NULL, NULL, NULL, NULL), ('7611e9c9-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', 'c124c0f3-3f1f-4635-bac7-f3e1f5503099', NULL, NULL, NULL, NULL, NULL), ('7611ea05-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '984059ca-3f9d-4ee4-9616-e409dd11991e', NULL, NULL, NULL, NULL, NULL), ('7611ea46-8e0a-11ec-8e4b-0242ac130002', 'd2bda4c3-3c25-40c6-bed3-994ffe2949df', '2de7c3d3-e642-4509-aff1-b2520ebfe85e', NULL, NULL, NULL, NULL, NULL), ('805b082d-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '3a5e4081-4cd5-427f-bd3a-ff7815efaf25', NULL, NULL, NULL, NULL, NULL), ('805b0a85-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '57760693-15db-4de9-9170-55ee7d1eb0eb', NULL, NULL, NULL, NULL, NULL), ('805b0abb-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '0d8bc9d7-b76b-4ec5-96e7-0df1c3426205', NULL, NULL, NULL, NULL, NULL), ('805b0ae0-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '03410ec1-1bd0-4afd-ac37-9306e00e328c', NULL, NULL, NULL, NULL, NULL), ('805b0b0f-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', 'eaa8947b-d9e7-4ca4-ba65-08965dfa620c', NULL, NULL, NULL, NULL, NULL), ('805b0b2d-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '93a58625-3730-4a07-99bd-75f174ff428d', NULL, NULL, NULL, NULL, NULL), ('805b0bdb-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '2f9bf4d5-b1d3-4cac-9df2-2c8827d65bbf', NULL, NULL, NULL, NULL, NULL), ('805b0cc1-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '1aad98e5-3f99-4c0a-aa75-ca9236de0f09', NULL, NULL, NULL, NULL, NULL), ('805b0cf8-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '5f694f25-b0fd-45f6-acbd-9dd338e196ce', NULL, NULL, NULL, NULL, NULL), ('805b0d31-8e0a-11ec-8e4b-0242ac130002', 'ceb6cd6c-531e-4a23-a467-caa5ef7218cc', '9ecb6827-f47f-4b19-b788-81a6b55940af', NULL, NULL, NULL, NULL, NULL);
...@@ -448,3 +456,9 @@ RETURN oTemp; ...@@ -448,3 +456,9 @@ RETURN oTemp;
END END
;; ;;
delimiter ; delimiter ;
delete from chart_view where id in (
'ce33ad2c-3915-41cc-8d86-55405456ed05',
'd73eda10-68c9-40e2-b03a-a7cbe3e5b365',
'de923e69-df6b-4f61-9391-da2987f77b51'
);
...@@ -170,8 +170,8 @@ export default { ...@@ -170,8 +170,8 @@ export default {
.full-height { .full-height {
height: 100vh !important; height: 100vh !important;
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0px; width: 5px;
height: 0px; height: 5px;
} }
} }
......
...@@ -112,7 +112,13 @@ export function getLabel(chart) { ...@@ -112,7 +112,13 @@ export function getLabel(chart) {
if (l.show) { if (l.show) {
if (chart.type === 'pie') { if (chart.type === 'pie') {
label = { label = {
type: l.position type: l.position,
autoRotate: false
}
} else if (chart.type.includes('line')) {
label = {
position: l.position,
offsetY: -8
} }
} else { } else {
label = { label = {
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
<i slot="reference" class="el-icon-warning icon-class" style="margin-left: 4px;cursor: pointer;" /> <i slot="reference" class="el-icon-warning icon-class" style="margin-left: 4px;cursor: pointer;" />
</el-popover> </el-popover>
<span style="float: right;line-height: 40px;"> <span style="float: right;line-height: 40px;">
<el-button size="mini" @click="close">
{{ $t('chart.close') }}
</el-button>
<el-button size="mini" :disabled="!hasEdit" @click="reset"> <el-button size="mini" :disabled="!hasEdit" @click="reset">
{{ $t('chart.recover') }} {{ $t('chart.recover') }}
</el-button> </el-button>
...@@ -1246,7 +1249,8 @@ export default { ...@@ -1246,7 +1249,8 @@ export default {
this.table = response.data this.table = response.data
this.initTableField(id) this.initTableField(id)
}).catch(err => { }).catch(err => {
this.resetView() this.table = null
this.resetDatasetField()
this.httpRequest.status = err.response.data.success this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err.response.data.message this.httpRequest.msg = err.response.data.message
return true return true
...@@ -1525,6 +1529,14 @@ export default { ...@@ -1525,6 +1529,14 @@ export default {
this.$success(this.$t('commons.save_success')) this.$success(this.$t('commons.save_success'))
}) })
}, },
close() {
this.closeChangeChart()
// 从仪表板入口关闭
if (this.$route.path.indexOf('panel') > -1) {
this.$store.commit('recordSnapshot')
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
}
},
getData(id) { getData(id) {
this.hasEdit = false this.hasEdit = false
if (id) { if (id) {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<!--选择数据集--> <!--选择数据集-->
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css"> <el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" @getTable="firstDs" /> <dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" clear-empty-dir="true" @getTable="firstDs" />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button> <el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
<el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button> <el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button>
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
allChildCount: 0 allChildCount: 0
}, },
name: '关联数据集', name: '关联数据集',
customType: ['db', 'sql', 'excel'], customType: ['db', 'sql', 'excel', 'api'],
selectDsDialog: false, selectDsDialog: false,
// 弹框临时选中的数据集 // 弹框临时选中的数据集
tempDs: {}, tempDs: {},
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<!--选择数据集--> <!--选择数据集-->
<el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css"> <el-dialog v-if="selectDsDialog" v-dialogDrag :title="$t('chart.select_dataset')" :visible="selectDsDialog" :show-close="false" width="400px" class="dialog-css">
<dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" :mode="currentNode.currentDs.mode" @getTable="firstDs" /> <dataset-group-selector-tree :fix-height="true" show-mode="union" :custom-type="customType" clear-empty-dir="true" :mode="currentNode.currentDs.mode" @getTable="firstDs" />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button> <el-button size="mini" @click="closeSelectDs()">{{ $t('dataset.cancel') }}</el-button>
<el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button> <el-button :disabled="!tempDs.id" type="primary" size="mini" @click="confirmSelectDs()">{{ $t('dataset.confirm') }}</el-button>
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
}, },
allChildCount: 0 allChildCount: 0
}, },
customType: ['db', 'sql', 'excel'], customType: ['db', 'sql', 'excel', 'api'],
selectDsDialog: false, selectDsDialog: false,
// 弹框临时选中的数据集 // 弹框临时选中的数据集
tempDs: {}, tempDs: {},
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
selectDs() { selectDs() {
// 根据父级node,过滤不同的数据集 // 根据父级node,过滤不同的数据集
if (this.currentNode.currentDs.mode === 1) { if (this.currentNode.currentDs.mode === 1) {
this.customType = ['db', 'sql', 'excel'] this.customType = ['db', 'sql', 'excel', 'api']
} else if (this.currentNode.currentDs.mode === 0) { } else if (this.currentNode.currentDs.mode === 0) {
if (this.currentNode.currentDs.modelInnerType === 'db') { if (this.currentNode.currentDs.modelInnerType === 'db') {
this.customType = ['db'] this.customType = ['db']
......
...@@ -340,7 +340,7 @@ export default { ...@@ -340,7 +340,7 @@ export default {
{ required: true, message: this.$t('dataset.required'), trigger: 'change' } { required: true, message: this.$t('dataset.required'), trigger: 'change' }
] ]
}, },
customType: ['db', 'sql'] customType: ['db', 'sql', 'api']
} }
}, },
computed: { computed: {
......
import axios from 'axios' import axios from 'axios'
import Config from '@/settings' import Config from '@/settings'
import { getToken, setToken, setUserInfo } from '@/common/utils' import { getToken, setToken, setUserInfo, parseLanguage } from '@/common/utils'
const TokenKey = Config.TokenKey const TokenKey = Config.TokenKey
const RefreshTokenKey = Config.RefreshTokenKey const RefreshTokenKey = Config.RefreshTokenKey
const white_list = Config.WHITE_LIST const white_list = Config.WHITE_LIST
...@@ -15,6 +15,17 @@ let service = axios.create({ ...@@ -15,6 +15,17 @@ let service = axios.create({
// request interceptor // request interceptor
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
let lang = parseLanguage() || uni.getLocale()
if (lang === 'en') {
config.headers['Accept-Language'] = 'en-US'
}else if(lang === 'zh-Hant'){
config.headers['Accept-Language'] = 'zh-TW'
}else {
config.headers['Accept-Language'] = 'zh-CN'
}
if (white_list.includes(config.url)) { if (white_list.includes(config.url)) {
return config return config
} }
......
...@@ -21,13 +21,23 @@ ...@@ -21,13 +21,23 @@
</block> </block>
</uni-nav-bar> </uni-nav-bar>
<view v-if="url">
<web-view <scroll-view
:webview-styles="webViewStyles"
style="height: 100vh;" :scroll-top="scrollTop"
> scroll-y="true"
</web-view> class="scroll-Y"
</view> @scrolltoupper="upper"
@scrolltolower="lower"
@scroll="scroll">
<!-- <web-view v-if="url" :style="{height: 'calc(100vh - ' + ktxStatusHeight +'px)'}" /> -->
<!-- <web-view v-if="url" style="height: 100vh;" /> -->
<web-view v-if="url" :style="{height: viewHeight}" />
</scroll-view>
...@@ -73,16 +83,16 @@ ...@@ -73,16 +83,16 @@
title: '', title: '',
banner: {}, banner: {},
htmlNodes: [], htmlNodes: [],
webViewStyles: {
progress: {
color: '#FF3333'
},
height: '700px'
},
url: '', url: '',
hasStar: false, hasStar: false,
refreshCount: 0 refreshCount: 0,
scrollTop: 0,
old: {
scrollTop: 0
},
viewHeight: null,
ktxStatusHeight: null
} }
}, },
onLoad(event) { onLoad(event) {
...@@ -101,12 +111,12 @@ ...@@ -101,12 +111,12 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.banner.title title: this.banner.title
}); });
// this.getDetail();
this.addRecent() this.addRecent()
uni.$emit('loadHomeIndex', { uni.$emit('loadHomeIndex', {
index: 1 index: 1
}) })
this.loadStarStatus() this.loadStarStatus()
this.caclViewHeight()
}, },
...@@ -118,68 +128,10 @@ ...@@ -118,68 +128,10 @@
uni.navigateBack() uni.navigateBack()
}, },
onShareAppMessage() {
return {
title: this.banner.title,
path: DETAIL_PAGE_PATH + '?detailDate=' + JSON.stringify(this.banner)
}
},
onNavigationBarButtonTap(event) {
const buttonIndex = event.index;
if (buttonIndex === 0) {
// 分享 H5 的页面
const shareProviders = [];
uni.getProvider({
service: 'share',
success: (result) => {
// 目前仅考虑分享到微信
if (result.provider && result.provider.length && ~result.provider.indexOf('weixin')) {
const channels = _handleShareChannels(result.provider);
uni.showActionSheet({
itemList: channels.map(channel => {
return channel.text;
}),
success: (result) => {
const tapIndex = result.tapIndex;
uni.share({
provider: 'weixin',
type: 0,
title: this.banner.title,
scene: tapIndex === 0 ? 'WXSceneSession' : 'WXSenceTimeline',
href: 'https://uniapp.dcloud.io/h5' + DETAIL_PAGE_PATH + '?detailDate=' + JSON.stringify(this.banner),
imageUrl: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b6304f00-5168-11eb-bd01-97bc1429a9ff.png'
});
}
});
} else {
uni.showToast({
title: '未检测到可用的微信分享服务'
});
}
},
fail: (error) => {
uni.showToast({
title: '获取分享服务失败'
});
}
});
}
},
methods: { methods: {
getDetail() {
uni.request({
url: 'https://unidemo.dcloud.net.cn/api/news/36kr/' + this.banner.post_id,
success: (data) => {
if (data.statusCode == 200) {
var htmlString = data.data.content.replace(/\\/g, "").replace(/<img/g, "<img style=\"display:none;\"");
//this.htmlNodes = htmlParser(htmlString);
}
},
fail: () => {
console.log('fail');
}
});
},
addRecent() { addRecent() {
const item = {id: this.banner.id, title: this.banner.title, index: this.banner.index} const item = {id: this.banner.id, title: this.banner.title, index: this.banner.index}
addRecent(item) addRecent(item)
...@@ -215,18 +167,30 @@ ...@@ -215,18 +167,30 @@
}) })
}, },
loadLinkUrl() { loadLinkUrl() {
this.url = process.env.VUE_APP_BASE_API + 'tempMobileLink/' + this.banner.id + "/" + getToken() this.url = process.env.VUE_APP_BASE_API + 'tempMobileLink/' + this.banner.id + "/" + getToken()
const url = this.url const url = this.url
/* uni.hideLoading() */
setTimeout(() => { setTimeout(() => {
const iframe = document.getElementsByTagName("iframe")[0] const iframe = document.getElementsByTagName("iframe")[0]
// iframe.style.height = (ktxScreentHeight - ktxStatusHeight) + 'px'
iframe.src = url iframe.src = url
iframe.onload = e => { iframe.onload = e => {
uni.hideLoading() uni.hideLoading()
} }
}, 1000); }, 1000);
}, },
caclViewHeight() {
let systemInfo = uni.getSystemInfoSync()
const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
if(systemInfo.navigationBarHeight) {
h5Height = h5Height - systemInfo.navigationBarHeight
}
this.viewHeight = h5Height + 'px'
},
back() { back() {
// #ifdef H5 // #ifdef H5
let canBack = true let canBack = true
...@@ -245,7 +209,27 @@ ...@@ -245,7 +209,27 @@
return return
// #endif // #endif
uni.navigateBack(1) uni.navigateBack(1)
} },
upper: function(e) {
console.log(e)
},
lower: function(e) {
console.log(e)
},
scroll: function(e) {
console.log(e)
this.old.scrollTop = e.detail.scrollTop
},
goTop: function(e) {
this.scrollTop = this.old.scrollTop
this.$nextTick(() => {
this.scrollTop = 0
});
uni.showToast({
icon:"none",
title:"纵向滚动 scrollTop 值已被修改为 0"
})
}
} }
} }
</script> </script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论