提交 7b6d444f authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' into pr@dev@db2

差异被折叠。
<p align="center"><a href="https://dataease.io"><img src="https://dataease.oss-cn-hangzhou.aliyuncs.com/img/dataease-logo.png" alt="DataEase" width="300" /></a></p> <p align="center"><a href="https://dataease.io"><img src="https://dataease.oss-cn-hangzhou.aliyuncs.com/img/dataease-logo.png" alt="DataEase" width="300" /></a></p>
<h3 align="center">人人可用的开源数据可视化分析工具</h3> <h3 align="center">人人可用的开源数据可视化分析工具</h3>
<p align="center"> <p align="center">
<a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0"><img src="https://img.shields.io/github/license/dataease/dataease?color=%231890FF&style=flat-square" alt="License: GPL v2"></a> <a href="https://www.gnu.org/licenses/old-licenses/gpl-3.0"><img src="https://img.shields.io/github/license/dataease/dataease?color=%231890FF" alt="License: GPL v3"></a>
<a href="https://app.codacy.com/gh/dataease/dataease?utm_source=github.com&utm_medium=referral&utm_content=dataease/dataease&utm_campaign=Badge_Grade_Dashboard"><img src="https://app.codacy.com/project/badge/Grade/da67574fd82b473992781d1386b937ef" alt="Codacy"></a> <a href="https://app.codacy.com/gh/dataease/dataease?utm_source=github.com&utm_medium=referral&utm_content=dataease/dataease&utm_campaign=Badge_Grade_Dashboard"><img src="https://app.codacy.com/project/badge/Grade/da67574fd82b473992781d1386b937ef" alt="Codacy"></a>
<a href="https://github.com/dataease/dataease/releases/latest"><img src="https://img.shields.io/github/v/release/dataease/dataease" alt="Latest release"></a> <a href="https://github.com/dataease/dataease/releases/latest"><img src="https://img.shields.io/github/v/release/dataease/dataease" alt="Latest release"></a>
<a href="https://github.com/dataease/dataease"><img src="https://img.shields.io/github/stars/dataease/dataease?color=%231890FF&style=flat-square" alt="Stars"></a> <a href="https://github.com/dataease/dataease"><img src="https://img.shields.io/github/stars/dataease/dataease?color=%231890FF&style=flat-square" alt="Stars"></a>
...@@ -85,8 +85,8 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st ...@@ -85,8 +85,8 @@ curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_st
Copyright (c) 2014-2021 飞致云 FIT2CLOUD, All rights reserved. Copyright (c) 2014-2021 飞致云 FIT2CLOUD, All rights reserved.
Licensed under The GNU General Public License version 2 (GPLv2) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Licensed under The GNU General Public License version 3 (GPLv3) (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
<https://www.gnu.org/licenses/gpl-2.0.html> <https://www.gnu.org/licenses/gpl-3.0.html>
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package io.dataease.base.mapper.ext;
import io.dataease.mobile.dto.HomeItemDTO;
import java.util.List;
import java.util.Map;
public interface HomeMapper {
List<HomeItemDTO> queryStore(Long userId);
List<HomeItemDTO> queryHistory();
List<HomeItemDTO> queryShare(Map<String, Object> param);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="io.dataease.base.mapper.ext.HomeMapper">
<select id="queryStore" resultType="io.dataease.mobile.dto.HomeItemDTO">
select
s.panel_group_id as id,
g.name as title,
s.create_time as `time`
from panel_store s
inner join panel_group g
on s.panel_group_id = g.id
where s.user_id = #{userId}
order by s.create_time desc
</select>
<select id="queryShare" resultType="io.dataease.mobile.dto.HomeItemDTO">
select
distinct(s.panel_group_id) as id,
g.name as title,
s.create_time as `time`
from panel_share s
inner join panel_group g
on s.panel_group_id = g.id
where
( s.target_id = #{userId} and s.type = 0 ) or
( s.target_id = #{deptId} and s.type = 2 ) or
( s.target_id in
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
#{roleId}
</foreach>
and s.type = 1 )
order by s.create_time desc
</select>
</mapper>
package io.dataease.mobile.api;
import io.dataease.mobile.dto.HomeItemDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
@Api(tags = "移动端:首页")
@RequestMapping("/mobile/home")
public interface HomeApi {
@ApiOperation("查询")
@ApiImplicitParam(value = "类型", name = "type", paramType = "path", allowableValues = "{@code 0(收藏), 1(历史), 2(分享)}")
@PostMapping("/query/{type}")
List<HomeItemDTO> query(@PathVariable Integer type);
@ApiOperation("详情")
@ApiImplicitParam(value = "ID", name = "id", paramType = "path")
@PostMapping("/detail/{id}")
Object detail(@PathVariable String id);
}
package io.dataease.mobile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("首页数据实体")
public class HomeItemDTO implements Serializable {
@ApiModelProperty("ID")
private String id;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("时间")
private Long time;
}
package io.dataease.mobile.server;
import io.dataease.mobile.api.HomeApi;
import io.dataease.mobile.dto.HomeItemDTO;
import io.dataease.mobile.service.HomeService;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class HomeServer implements HomeApi {
@Resource
private HomeService homeService;
@Override
public List<HomeItemDTO> query(Integer type) {
return homeService.query(type);
}
@Override
public Object detail(String id) {
return null;
}
}
package io.dataease.mobile.service;
import io.dataease.auth.api.dto.CurrentRoleDto;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.mobile.dto.HomeItemDTO;
import io.dataease.base.mapper.ext.HomeMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class HomeService {
@Resource
private HomeMapper homeMapper;
public List<HomeItemDTO> query(Integer type) {
List<HomeItemDTO> result = new ArrayList<>();
CurrentUserDto user = AuthUtils.getUser();
switch (type){
case 0:
result = homeMapper.queryStore(user.getUserId());
break;
case 1:
result = homeMapper.queryHistory();
break;
case 2:
Map<String, Object> param = new HashMap<>();
Long deptId = user.getDeptId();
List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
param.put("userId", user.getUserId());
param.put("deptId", deptId);
param.put("roleIds", roleIds);
result = homeMapper.queryShare(param);
break;
}
return result;
}
}
...@@ -41,7 +41,7 @@ public class VAuthModelService { ...@@ -41,7 +41,7 @@ public class VAuthModelService {
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) { private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) {
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) { if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {
result = result.stream().filter(vAuthModelDTO -> { 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")) { 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; return true;
} else { } else {
return false; return false;
......
...@@ -75,6 +75,10 @@ public class DirectFieldService implements DataSetFieldService { ...@@ -75,6 +75,10 @@ public class DirectFieldService implements DataSetFieldService {
List<DataSetTableUnionDTO> listUnion = dataSetTableUnionService.listByTableId(dt.getList().get(0).getTableId()); List<DataSetTableUnionDTO> listUnion = dataSetTableUnionService.listByTableId(dt.getList().get(0).getTableId());
String sql = dataSetTableService.getCustomSQLDatasource(dt, listUnion, ds); String sql = dataSetTableService.getCustomSQLDatasource(dt, listUnion, ds);
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, Collections.singletonList(field), true)); datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, Collections.singletonList(field), true));
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "union")) {
DataTableInfoDTO dt = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
String sql = (String) dataSetTableService.getUnionSQLDatasource(dt, ds).get("sql");
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, Collections.singletonList(field), true));
} }
} else if (datasetTable.getMode() == 1) {// 抽取 } else if (datasetTable.getMode() == 1) {// 抽取
// 连接doris,构建doris数据源查询 // 连接doris,构建doris数据源查询
......
...@@ -289,4 +289,5 @@ i18n_Exec=Running ...@@ -289,4 +289,5 @@ i18n_Exec=Running
i18n_no_trigger=The current setting does not trigger task generation. i18n_no_trigger=The current setting does not trigger task generation.
i18n_dataset_field_delete=Union field deleted,please set again and redo. i18n_dataset_field_delete=Union field deleted,please set again and redo.
i18n_es_limit=Elasticsearch version cannot be less than 6.3 i18n_es_limit=Elasticsearch version cannot be less than 6.3
i18n_ds_error=Preview fail:Execute SQL error。Cause field、table、dataset changed,please check i18n_ds_error=Preview fail:Execute SQL error。Cause field、table、dataset changed,please check
\ No newline at end of file i18n_union_ds_no_checked=This union dataset no checked field,please edit
\ No newline at end of file
...@@ -289,3 +289,4 @@ i18n_no_trigger=当前设置没有触发任务生成 ...@@ -289,3 +289,4 @@ i18n_no_trigger=当前设置没有触发任务生成
i18n_dataset_field_delete=该自定义数据集有关联字段被删除,请重新确认关联关系并重做该数据集 i18n_dataset_field_delete=该自定义数据集有关联字段被删除,请重新确认关联关系并重做该数据集
i18n_es_limit=Elasticsearch 版本不能小于6.3 i18n_es_limit=Elasticsearch 版本不能小于6.3
i18n_ds_error=预览数据错误:执行SQL失败。可能因相关字段、表、数据集等元素发生变更,请检查 i18n_ds_error=预览数据错误:执行SQL失败。可能因相关字段、表、数据集等元素发生变更,请检查
i18n_union_ds_no_checked=当前关联数据集,无选中字段,请重新编辑
...@@ -291,4 +291,5 @@ i18n_Exec=運行中 ...@@ -291,4 +291,5 @@ i18n_Exec=運行中
i18n_no_trigger=当前设置没有触发任务生成 當前設置沒有觸發任務生成. i18n_no_trigger=当前设置没有触发任务生成 當前設置沒有觸發任務生成.
i18n_dataset_field_delete=該自定義數據集有關聯字段被刪除,請重新確認關聯關系並重做該數據集 i18n_dataset_field_delete=該自定義數據集有關聯字段被刪除,請重新確認關聯關系並重做該數據集
i18n_es_limit=Elasticsearch 版本不能小於6.3 i18n_es_limit=Elasticsearch 版本不能小於6.3
i18n_ds_error=預覽數據錯誤:執行SQL失敗。可能因相關字段、表、數據集等元素發生變更,請檢查 i18n_ds_error=預覽數據錯誤:執行SQL失敗。可能因相關字段、表、數據集等元素發生變更,請檢查
\ No newline at end of file i18n_union_ds_no_checked=當前關聯數據集,無選中字段,請重新編輯
\ No newline at end of file
...@@ -108,7 +108,9 @@ export default { ...@@ -108,7 +108,9 @@ export default {
}, },
computed: { computed: {
customStyle() { customStyle() {
let style = {} let style = {
width: '100%'
}
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
...@@ -266,6 +268,7 @@ export default { ...@@ -266,6 +268,7 @@ export default {
.main-class { .main-class {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-size: 100% 100% !important;
} }
.custom-position { .custom-position {
......
...@@ -327,7 +327,7 @@ function init() { ...@@ -327,7 +327,7 @@ function init() {
const vm = this const vm = this
recalcCellWidth.call(this) recalcCellWidth.call(this)
resetPositionBox.call(this) resetPositionBox.call(this)
// initPosition(this) initPosition(this)
let i = 0 let i = 0
const timeid = setInterval(function() { const timeid = setInterval(function() {
if (i >= vm.yourList.length) { if (i >= vm.yourList.length) {
...@@ -471,13 +471,11 @@ function removeItem(index) { ...@@ -471,13 +471,11 @@ function removeItem(index) {
this.yourList.splice(index, 1, {}) this.yourList.splice(index, 1, {})
} }
// eslint-disable-next-line no-unused-vars // 矩阵设计初始化的时候 预占位,防止编辑仪表板页面,初始化和视图编辑返回时出现组件位置变化问题
function initPosition(_this) { function initPosition(_this) {
_this.yourList.forEach(item => { _this.yourList.forEach(item => {
checkItemPosition.call(_this, item, { fillPositionBox.call(_this, item.y + item.sizey)
x: item.x, addItemToPositionBox.call(_this, item)
y: item.y
})
}) })
} }
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
</span> </span>
</div> </div>
<div v-else class="toolbar"> <div v-else class="toolbar">
<el-tooltip :content="$t('panel.mobile_layout')">
<el-button class="icon iconfont-tb icon-yidongduan" size="mini" circle @click="openMobileLayout" />
</el-tooltip>
<el-tooltip v-if="!canvasStyleData.auxiliaryMatrix" :content="$t('panel.new_element_distribution')+':'+$t('panel.suspension')"> <el-tooltip v-if="!canvasStyleData.auxiliaryMatrix" :content="$t('panel.new_element_distribution')+':'+$t('panel.suspension')">
<el-button class="icon iconfont-tb icon-xuanfuanniu" size="mini" circle @click="auxiliaryMatrixChange" /> <el-button class="icon iconfont-tb icon-xuanfuanniu" size="mini" circle @click="auxiliaryMatrixChange" />
</el-tooltip> </el-tooltip>
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1621224495563" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7328" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M376.795429 691.2c15.616 0 27.008-10.733714 27.008-27.337143v-46.848h1.316571c20.809143 45.878857 63.451429 74.514286 117.449143 74.514286 88.832 0 147.072-70.619429 147.072-179.620572s-58.569143-179.620571-146.413714-179.620571c-53.028571 0-96 28.964571-116.169143 74.203429h-1.627429v-166.290286c0-17.554286-11.062857-28.946286-27.337143-28.946286-16.274286 0-27.318857 11.373714-27.318857 28.946286v423.68c0 16.914286 10.422857 27.318857 26.020572 27.318857z m490.697142 0.329143c64.091429 0 118.765714-35.145143 137.325715-84.937143 1.938286-5.522286 2.925714-10.733714 2.925714-15.286857 0-13.988571-9.764571-23.753143-23.442286-23.753143-12.361143 0-18.870857 4.882286-26.020571 19.2-17.261714 37.101714-46.537143 57.270857-90.459429 57.270857-63.451429 0-105.106286-50.432-105.106285-131.785143 0-80.694857 41.654857-132.443429 105.106285-132.443428 41.965714 0 72.228571 19.858286 89.782857 57.929143 6.857143 13.659429 13.348571 18.541714 25.398858 18.541714 13.988571 0 23.753143-9.106286 23.753142-23.424 0-3.913143-0.969143-8.777143-2.267428-13.019429-16.274286-49.792-71.917714-87.533714-137.984-87.533714-96.950857 0-160.091429 71.259429-160.091429 180.278857 0 109.659429 63.780571 178.962286 161.078857 178.962286zM116.169143 691.2c49.444571 0 96.310857-27.008 115.84-68.662857h0.969143v42.313143c0.658286 15.926857 11.392 26.678857 26.697143 26.678857 15.597714 0 26.331429-10.733714 26.331428-27.977143v-215.405714c0-70.290286-51.401143-115.529143-133.394286-115.529143-60.854857 0-111.286857 26.697143-130.157714 68.022857-3.584 8.118857-5.851429 15.926857-5.851428 22.765714 0 14.317714 10.404571 23.424 24.722285 23.424 10.093714 0 17.554286-3.584 22.784-12.690285 17.554286-37.412571 45.220571-54.674286 87.204572-54.674286 50.102857 0 79.725714 27.977143 79.725714 73.216v27.337143l-103.808 5.851428C45.531429 491.428571 0 528.201143 0 588.068571 0 650.203429 47.506286 691.2 116.169143 691.2z m394.057143-47.177143c-61.184 0-104.777143-52.388571-104.777143-131.785143 0-79.725714 43.593143-132.114286 104.777143-132.114285 63.104 0 102.802286 51.090286 102.802285 131.785142 0 81.353143-39.68 132.114286-102.820571 132.114286z m-381.037715 1.956572c-43.611429 0-72.905143-23.771429-72.905142-58.898286 0-34.176 27.337143-56.630857 77.769142-60.196572l96.969143-6.180571v33.828571c0 51.419429-45.220571 91.428571-101.851428 91.428572z m700.891429 249.892571a39.168 39.168 0 0 0 39.04-39.058286 39.168 39.168 0 0 0-39.058286-39.04c-21.467429 0-39.04 17.572571-39.04 39.058286 0 21.467429 17.554286 39.04 39.058286 39.04z m154.88 0A39.168 39.168 0 0 0 1024 856.813714c0-21.467429-17.554286-39.04-39.04-39.04-21.485714 0-39.058286 17.572571-39.058286 39.058286 0 21.467429 17.572571 39.04 39.058286 39.04z m-309.76 0a38.948571 38.948571 0 0 0 39.04-39.058286 38.948571 38.948571 0 0 0-39.058286-39.04c-21.467429 0-39.04 17.572571-39.04 39.058286 0 21.467429 17.554286 39.04 39.04 39.04z m-154.898286 0a38.948571 38.948571 0 0 0 39.04-39.058286 38.948571 38.948571 0 0 0-39.04-39.04c-21.485714 0-39.058286 17.572571-39.058285 39.058286 0 21.467429 17.572571 39.04 39.058285 39.04z m-154.88 0a38.948571 38.948571 0 0 0 39.04-39.058286 38.948571 38.948571 0 0 0-39.058285-39.04c-21.467429 0-39.04 17.572571-39.04 39.058286 0 21.467429 17.572571 39.04 39.058285 39.04z m-154.88 0a39.241143 39.241143 0 0 0 39.350857-39.058286 39.222857 39.222857 0 0 0-78.409142 0c0 21.485714 17.554286 39.058286 39.04 39.058286z m-155.227428 0a38.948571 38.948571 0 0 0 39.04-39.058286 38.948571 38.948571 0 0 0-39.04-39.04c-21.467429 0-39.04 17.572571-39.04 39.058286 0 21.467429 17.554286 39.04 39.04 39.04z" p-id="7329"></path></svg> <svg t="1638772679320" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3731" width="200" height="200"><path d="M88.127 137.283h85.725v510.997h-42.862v-460.75h-68.99l26.127-50.247zM382.903 297.803h-41.81c2.093-52.686 16.717-94.347 43.902-126.217 27.185-31.869 61.663-47.795 101.39-47.795 38.673 0 71.087 14.706 96.174 44.118 26.127 30.632 39.726 68.617 38.673 112.73-1.053 29.412-8.365 58.82-21.955 84.56-14.638 26.968-36.59 58.82-64.795 95.58l-108.72 139.702h201.744v49.018h-296.856l166.203-210.776c29.263-36.76 50.175-66.172 62.722-88.232 12.541-20.84 18.815-45.337 18.815-72.288 0-28.192-9.41-52.69-27.18-73.526-18.819-20.84-40.77-31.869-66.897-31.869-28.22 0-51.215 11.030-70.028 31.869-17.793 22.055-28.242 53.919-31.379 93.123zM729.944 256.146h-44.947c8.352-41.678 24.048-74.764 46.004-96.803 22.99-22.058 50.17-34.308 81.531-34.308 34.497 0 63.76 12.249 88.848 37.985 24.035 25.731 36.576 56.38 36.576 93.145 0 44.113-18.819 79.642-56.448 104.157 25.087 12.267 44.96 30.632 59.598 55.148 13.572 24.498 20.898 51.453 20.898 79.642 0 45.337-13.585 84.56-41.81 116.42-28.22 33.093-63.756 49.018-106.618 49.018-37.628 0-68.99-12.254-94.077-37.998-25.088-25.735-40.77-62.5-49.122-111.51h42.862c7.313 34.304 19.853 58.824 35.532 74.745 15.678 15.925 37.634 24.512 65.858 24.512 30.303 0 55.403-11.030 75.263-33.088 19.859-22.055 29.268-47.79 29.268-78.426 0-34.304-10.449-61.277-32.4-80.879-21.951-19.602-53.312-30.632-95.135-30.632v-46.553c30.316 0 54.351-8.59 73.165-24.517 18.819-15.93 28.224-36.765 28.224-61.263 0-23.292-7.313-42.894-22.99-58.82-15.678-15.926-34.497-23.279-56.448-23.279-19.872 0-36.59 7.353-50.175 20.84-13.604 14.67-24.057 34.272-33.457 62.465z" p-id="3732"></path><path d="M62 837.203h900v63h-900z" p-id="3733"></path></svg>
...@@ -1427,7 +1427,9 @@ export default { ...@@ -1427,7 +1427,9 @@ export default {
video_add_tips: 'Please Add Video Info...', video_add_tips: 'Please Add Video Info...',
panel_view_result_show: 'View Result Show', panel_view_result_show: 'View Result Show',
panel_view_result_tips: 'Chose "Panel" Will Overwrite View`s Result,Range 1~10000', panel_view_result_tips: 'Chose "Panel" Will Overwrite View`s Result,Range 1~10000',
timeout_refresh: 'Timeout,Will Refresh...' timeout_refresh: 'Timeout,Will Refresh...',
mobile_layout: 'Mobile Layout',
component_hidden: 'Component Hidden'
}, },
plugin: { plugin: {
local_install: 'Local installation', local_install: 'Local installation',
......
...@@ -1430,7 +1430,9 @@ export default { ...@@ -1430,7 +1430,9 @@ export default {
video_add_tips: '請點擊添加配置視頻信息...', video_add_tips: '請點擊添加配置視頻信息...',
panel_view_result_show: '視圖結果展示', panel_view_result_show: '視圖結果展示',
panel_view_result_tips: '選擇儀表板會覆蓋視圖的結果展示數量,取值範圍1~10000', panel_view_result_tips: '選擇儀表板會覆蓋視圖的結果展示數量,取值範圍1~10000',
timeout_refresh: '请求超时,稍后刷新...' timeout_refresh: '请求超时,稍后刷新...',
mobile_layout: '移动端布局',
component_hidden: '隐藏的组件'
}, },
plugin: { plugin: {
local_install: '本地安裝', local_install: '本地安裝',
......
...@@ -1438,7 +1438,9 @@ export default { ...@@ -1438,7 +1438,9 @@ export default {
video_add_tips: '请点击添加配置视频信息...', video_add_tips: '请点击添加配置视频信息...',
panel_view_result_show: '视图结果展示', panel_view_result_show: '视图结果展示',
panel_view_result_tips: '选择仪表板会覆盖视图的结果展示数量,取值范围1~10000', panel_view_result_tips: '选择仪表板会覆盖视图的结果展示数量,取值范围1~10000',
timeout_refresh: '请求超时,稍后刷新...' timeout_refresh: '请求超时,稍后刷新...',
mobile_layout: '移动端布局',
component_hidden: '隐藏的组件'
}, },
plugin: { plugin: {
local_install: '本地安装', local_install: '本地安装',
......
...@@ -30,7 +30,7 @@ export const DEFAULT_SIZE = { ...@@ -30,7 +30,7 @@ export const DEFAULT_SIZE = {
tableItemFontSize: 12, tableItemFontSize: 12,
tableTitleHeight: 36, tableTitleHeight: 36,
tableItemHeight: 36, tableItemHeight: 36,
tablePageSize: '10', tablePageSize: '20',
gaugeMin: 0, gaugeMin: 0,
gaugeMax: 100, gaugeMax: 100,
gaugeStartAngle: 225, gaugeStartAngle: 225,
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-click="nodeClick" @node-click="nodeClick"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
> >
<span v-if="data.modelInnerType ==='group'" slot-scope="{ node, data }" class="custom-tree-node father"> <span v-if="data.modelInnerType ==='group'" slot-scope="{ node, data }" class="custom-tree-node father">
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
...@@ -673,14 +675,6 @@ export default { ...@@ -673,14 +675,6 @@ export default {
if (data.modelInnerType !== 'group') { if (data.modelInnerType !== 'group') {
this.$emit('switchComponent', { name: 'ChartEdit', param: data }) this.$emit('switchComponent', { name: 'ChartEdit', param: data })
} }
if (node.expanded) {
this.expandedArray.push(data.id)
} else {
const index = this.expandedArray.indexOf(data.id)
if (index > -1) {
this.expandedArray.splice(index, 1)
}
}
}, },
back() { back() {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<el-input v-model="name" size="mini" :placeholder="$t('commons.name')" clearable /> <el-input v-model="name" size="mini" :placeholder="$t('commons.name')" clearable />
</el-form-item> </el-form-item>
<el-form-item class="form-item"> <el-form-item class="form-item">
<el-button size="mini" @click="previewData"> <el-button :disabled="dataset.length === 0" size="mini" @click="previewData">
{{ $t('dataset.preview_result') }} {{ $t('dataset.preview_result') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
...@@ -88,7 +88,7 @@ import UnionNode from '@/views/dataset/add/union/UnionNode' ...@@ -88,7 +88,7 @@ import UnionNode from '@/views/dataset/add/union/UnionNode'
import NodeItem from '@/views/dataset/add/union/NodeItem' import NodeItem from '@/views/dataset/add/union/NodeItem'
import DatasetGroupSelectorTree from '@/views/dataset/common/DatasetGroupSelectorTree' import DatasetGroupSelectorTree from '@/views/dataset/common/DatasetGroupSelectorTree'
import UnionEdit from '@/views/dataset/add/union/UnionEdit' import UnionEdit from '@/views/dataset/add/union/UnionEdit'
import { getTable, post } from '@/api/dataset/dataset' import { post } from '@/api/dataset/dataset'
import UnionPreview from '@/views/dataset/add/union/UnionPreview' import UnionPreview from '@/views/dataset/add/union/UnionPreview'
export default { export default {
name: 'AddUnion', name: 'AddUnion',
...@@ -151,6 +151,7 @@ export default { ...@@ -151,6 +151,7 @@ export default {
}, },
watch: { watch: {
'param.tableId': function() { 'param.tableId': function() {
this.resetComponent()
this.initTableData() this.initTableData()
} }
}, },
...@@ -280,7 +281,7 @@ export default { ...@@ -280,7 +281,7 @@ export default {
initTableData() { initTableData() {
if (this.param.tableId) { if (this.param.tableId) {
getTable(this.param.tableId).then(response => { post('/dataset/table/get/' + this.param.tableId, null).then(response => {
const table = JSON.parse(JSON.stringify(response.data)) const table = JSON.parse(JSON.stringify(response.data))
this.name = table.name this.name = table.name
this.dataset = JSON.parse(table.info).union this.dataset = JSON.parse(table.info).union
...@@ -299,6 +300,11 @@ export default { ...@@ -299,6 +300,11 @@ export default {
info: '{"union":' + JSON.stringify(this.dataset) + '}' info: '{"union":' + JSON.stringify(this.dataset) + '}'
} }
this.showPreview = true this.showPreview = true
},
resetComponent() {
this.dataset = []
this.name = '关联数据集'
} }
} }
} }
...@@ -310,8 +316,8 @@ export default { ...@@ -310,8 +316,8 @@ export default {
} }
.union-container{ .union-container{
display: flex; display: flex;
width:100%; width: 100%;
height:400px; height: calc(100vh - 200px);
overflow: auto; overflow: auto;
} }
.form-item{ .form-item{
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<div v-if="unionParam.type" style="height:600px;"> <div v-if="unionParam.type" style="height:600px;">
<div class="field-style"> <div class="field-style">
<div class="fields"> <div class="fields">
<p>{{ unionParam.parent.currentDs.name }}</p> <p :title="unionParam.parent.currentDs.name">{{ unionParam.parent.currentDs.name }}</p>
<union-field-list :field-list="parentField" :node="unionParam.parent" @checkedFields="changeParentFields" /> <union-field-list :field-list="parentField" :node="unionParam.parent" @checkedFields="changeParentFields" />
</div> </div>
<div class="fields"> <div class="fields">
<p>{{ unionParam.node.currentDs.name }}</p> <p :title="unionParam.parent.currentDs.name">{{ unionParam.node.currentDs.name }}</p>
<union-field-list :field-list="nodeField" :node="unionParam.node" @checkedFields="changeNodeFields" /> <union-field-list :field-list="nodeField" :node="unionParam.node" @checkedFields="changeNodeFields" />
</div> </div>
</div> </div>
...@@ -81,6 +81,9 @@ export default { ...@@ -81,6 +81,9 @@ export default {
p{ p{
font-size: 14px; font-size: 14px;
margin: 6px 0!important; margin: 6px 0!important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
} }
.el-divider--horizontal { .el-divider--horizontal {
margin: 12px 0; margin: 12px 0;
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" /> <svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" /> <svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" /> <svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
<svg-icon v-if="data.type === 'union'" icon-class="ds-union" class="ds-icon-union" />
</span> </span>
<span v-if="data.type === 'db' || data.type === 'sql'"> <span v-if="data.type === 'db' || data.type === 'sql'">
<span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span> <span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<el-input v-model="scope.row.name" size="mini" :disabled="!hasDataPermission('manage',param.privileges)" @blur="saveEdit(scope.row)" @keyup.enter.native="saveEdit(scope.row)" /> <el-input v-model="scope.row.name" size="mini" :disabled="!hasDataPermission('manage',param.privileges)" @blur="saveEdit(scope.row)" @keyup.enter.native="saveEdit(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!(table.mode === 0 && (table.type === 'custom' || table.type === 'union'))" property="originName" :label="$t('dataset.field_origin_name')" width="100"> <el-table-column v-if="!((table.mode === 0 && table.type === 'custom') || table.type === 'union')" property="originName" :label="$t('dataset.field_origin_name')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.extField === 0" :title="scope.row.originName" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <span v-if="scope.row.extField === 0" :title="scope.row.originName" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span style="font-size: 12px;">{{ scope.row.originName }}</span> <span style="font-size: 12px;">{{ scope.row.originName }}</span>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</el-table-column> </el-table-column>
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100"> <el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span v-if="scope.row.extField === 0">
<span v-if="scope.row.deExtractType === 0"> <span v-if="scope.row.deExtractType === 0">
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" /> <svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
<span class="field-class">{{ $t('dataset.text') }}</span> <span class="field-class">{{ $t('dataset.text') }}</span>
...@@ -113,6 +113,9 @@ ...@@ -113,6 +113,9 @@
<span class="field-class">{{ $t('dataset.location') }}</span> <span class="field-class">{{ $t('dataset.location') }}</span>
</span> </span>
</span> </span>
<span v-else-if="scope.row.extField === 2" :title="$t('dataset.calc_field')" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span style="font-size: 12px;color: #c0c0c0">{{ $t('dataset.calc_field') }}</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">--> <!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
...@@ -149,7 +152,7 @@ ...@@ -149,7 +152,7 @@
<el-input v-model="scope.row.name" size="mini" :disabled="!hasDataPermission('manage',param.privileges)" @blur="saveEdit(scope.row)" @keyup.enter.native="saveEdit(scope.row)" /> <el-input v-model="scope.row.name" size="mini" :disabled="!hasDataPermission('manage',param.privileges)" @blur="saveEdit(scope.row)" @keyup.enter.native="saveEdit(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!(table.mode === 0 && (table.type === 'custom' || table.type === 'union'))" property="originName" :label="$t('dataset.field_origin_name')" width="100"> <el-table-column v-if="!((table.mode === 0 && table.type === 'custom') || table.type === 'union')" property="originName" :label="$t('dataset.field_origin_name')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.extField === 0" :title="scope.row.originName" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <span v-if="scope.row.extField === 0" :title="scope.row.originName" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span style="font-size: 12px;">{{ scope.row.originName }}</span> <span style="font-size: 12px;">{{ scope.row.originName }}</span>
...@@ -200,7 +203,7 @@ ...@@ -200,7 +203,7 @@
</el-table-column> </el-table-column>
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100"> <el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span v-if="scope.row.extField === 0">
<span v-if="scope.row.deExtractType === 0"> <span v-if="scope.row.deExtractType === 0">
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" /> <svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
<span class="field-class">{{ $t('dataset.text') }}</span> <span class="field-class">{{ $t('dataset.text') }}</span>
...@@ -219,6 +222,9 @@ ...@@ -219,6 +222,9 @@
<span class="field-class">{{ $t('dataset.location') }}</span> <span class="field-class">{{ $t('dataset.location') }}</span>
</span> </span>
</span> </span>
<span v-else-if="scope.row.extField === 2" :title="$t('dataset.calc_field')" class="field-class" style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span style="font-size: 12px;color: #c0c0c0">{{ $t('dataset.calc_field') }}</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">--> <!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
<el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit"> <el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit">
<field-edit :param="param" :table="table" /> <field-edit :param="param" :table="table" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)" :label="$t('dataset.join_view')" name="joinView">
<union-view :param="param" :table="table" />
</el-tab-pane>
<el-tab-pane v-if="table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')" :label="$t('dataset.update_info')" name="updateInfo"> <el-tab-pane v-if="table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')" :label="$t('dataset.update_info')" name="updateInfo">
<update-info v-if="tabActive=='updateInfo'" :param="param" :table="table" /> <update-info v-if="tabActive=='updateInfo'" :param="param" :table="table" />
</el-tab-pane> </el-tab-pane>
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
highlight-current highlight-current
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
@node-click="nodeClick" @node-click="nodeClick"
> >
<span v-if="data.modelInnerType === 'group'" slot-scope="{ node, data }" class="custom-tree-node father"> <span v-if="data.modelInnerType === 'group'" slot-scope="{ node, data }" class="custom-tree-node father">
...@@ -89,6 +91,10 @@ ...@@ -89,6 +91,10 @@
<svg-icon icon-class="ds-excel" class="ds-icon-excel" /> <svg-icon icon-class="ds-excel" class="ds-icon-excel" />
{{ $t('dataset.excel_data') }} {{ $t('dataset.excel_data') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="beforeClickAddData('custom',data)">
<svg-icon icon-class="ds-custom" class="ds-icon-custom" />
{{ $t('dataset.custom_data') }}
</el-dropdown-item>
<el-dropdown-item :command="beforeClickAddData('union',data)"> <el-dropdown-item :command="beforeClickAddData('union',data)">
<svg-icon icon-class="ds-union" class="ds-icon-union" /> <svg-icon icon-class="ds-union" class="ds-icon-union" />
{{ $t('dataset.union_data') }} {{ $t('dataset.union_data') }}
...@@ -524,14 +530,6 @@ export default { ...@@ -524,14 +530,6 @@ export default {
if (data.modelInnerType !== 'group') { if (data.modelInnerType !== 'group') {
this.$emit('switchComponent', { name: 'ViewTable', param: data }) this.$emit('switchComponent', { name: 'ViewTable', param: data })
} }
if (node.expanded) {
this.expandedArray.push(data.id)
} else {
const index = this.expandedArray.indexOf(data.id)
if (index > -1) {
this.expandedArray.splice(index, 1)
}
}
}, },
back() { back() {
......
<template> <template>
<el-row class="component-wait"> <el-row class="component-wait">
<el-row class="component-wait-title"> <el-row class="component-wait-title">
隐藏的组件 {{ $t('panel.component_hidden') }}
</el-row> </el-row>
<el-row class="component-wait-main"> <el-row class="component-wait-main">
<component-wait-item <component-wait-item
...@@ -73,6 +73,8 @@ export default { ...@@ -73,6 +73,8 @@ export default {
.component-wait-title { .component-wait-title {
width: 100%; width: 100%;
height: 30px; height: 30px;
color: #FFFFFF;
vertical-align: center;
background-color: #9ea6b2; background-color: #9ea6b2;
border-bottom: 1px black; border-bottom: 1px black;
} }
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<el-col :span="8" class="this_mobile_canvas_cell"> <el-col :span="8" class="this_mobile_canvas_cell">
<div <div
v-proportion="2.5" v-proportion="2.5"
:style="customCanvasStyle" :style="customCanvasMobileStyle"
class="this_mobile_canvas" class="this_mobile_canvas"
@drop="handleDrop" @drop="handleDrop"
@dragover="handleDragOver" @dragover="handleDragOver"
...@@ -331,6 +331,11 @@ export default { ...@@ -331,6 +331,11 @@ export default {
return false return false
} }
}, },
customCanvasMobileStyle() {
return {
padding: this.componentGap + 'px'
}
},
customCanvasStyle() { customCanvasStyle() {
let style = { let style = {
padding: this.componentGap + 'px' padding: this.componentGap + 'px'
......
...@@ -97,7 +97,8 @@ export default { ...@@ -97,7 +97,8 @@ export default {
const contentWidth = canvas.width const contentWidth = canvas.width
const contentHeight = canvas.height const contentHeight = canvas.height
const pageData = canvas.toDataURL('image/jpeg', 1.0) const pageData = canvas.toDataURL('image/jpeg', 1.0)
const PDF = new JsPDF('p', 'pt', [contentWidth, contentHeight]) const lp = contentWidth > contentHeight ? 'l' : 'p'
const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight])
PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight)
PDF.save(_this.panelName + '.pdf') PDF.save(_this.panelName + '.pdf')
_this.$emit('closePreExport') _this.$emit('closePreExport')
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" /> <svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" /> <svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" /> <svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
<svg-icon v-if="data.type === 'union'" icon-class="ds-union" class="ds-icon-union" />
</span> </span>
<el-tooltip class="item" effect="dark" placement="top"> <el-tooltip class="item" effect="dark" placement="top">
<div slot="content">{{ node.label }}</div> <div slot="content">{{ node.label }}</div>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<div class="block"> <div class="block">
<el-tree <el-tree
ref="default_panel_tree" ref="default_panel_tree"
:default-expanded-keys="expandedArray"
:data="defaultData" :data="defaultData"
node-key="id" node-key="id"
:highlight-current="activeTree==='system'" :highlight-current="activeTree==='system'"
...@@ -84,6 +83,8 @@ ...@@ -84,6 +83,8 @@
:highlight-current="activeTree==='self'" :highlight-current="activeTree==='self'"
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
@node-click="nodeClick" @node-click="nodeClick"
> >
<span slot-scope="{ node, data }" class="custom-tree-node-list father"> <span slot-scope="{ node, data }" class="custom-tree-node-list father">
...@@ -677,13 +678,15 @@ export default { ...@@ -677,13 +678,15 @@ export default {
bus.$emit('set-panel-show-type', 0) bus.$emit('set-panel-show-type', 0)
}) })
} }
if (node.expanded) { },
nodeExpand(data) {
if (data.id) {
this.expandedArray.push(data.id) this.expandedArray.push(data.id)
} else { }
const index = this.expandedArray.indexOf(data.id) },
if (index > -1) { nodeCollapse(data) {
this.expandedArray.splice(index, 1) if (data.id) {
} this.expandedArray.splice(this.expandedArray.indexOf(data.id), 1)
} }
}, },
back() { back() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论