Skip to content

Commit e95fd0a

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents e9404e6 + 7a43574 commit e95fd0a

File tree

9 files changed

+182
-2
lines changed

9 files changed

+182
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.dataease.base.mapper.ext;
2+
3+
import io.dataease.mobile.dto.HomeItemDTO;
4+
import java.util.List;
5+
import java.util.Map;
6+
7+
public interface HomeMapper {
8+
9+
10+
List<HomeItemDTO> queryStore(Long userId);
11+
12+
List<HomeItemDTO> queryHistory();
13+
14+
List<HomeItemDTO> queryShare(Map<String, Object> param);
15+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3+
<mapper namespace="io.dataease.base.mapper.ext.HomeMapper">
4+
5+
<select id="queryStore" resultType="io.dataease.mobile.dto.HomeItemDTO">
6+
select
7+
s.panel_group_id as id,
8+
g.name as title,
9+
s.create_time as `time`
10+
from panel_store s
11+
inner join panel_group g
12+
on s.panel_group_id = g.id
13+
where s.user_id = #{userId}
14+
order by s.create_time desc
15+
</select>
16+
17+
<select id="queryShare" resultType="io.dataease.mobile.dto.HomeItemDTO">
18+
select
19+
distinct(s.panel_group_id) as id,
20+
g.name as title,
21+
s.create_time as `time`
22+
from panel_share s
23+
inner join panel_group g
24+
on s.panel_group_id = g.id
25+
where
26+
( s.target_id = #{userId} and s.type = 0 ) or
27+
( s.target_id = #{deptId} and s.type = 2 ) or
28+
( s.target_id in
29+
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
30+
#{roleId}
31+
</foreach>
32+
and s.type = 1 )
33+
order by s.create_time desc
34+
</select>
35+
36+
37+
38+
39+
</mapper>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.dataease.mobile.api;
2+
3+
import io.dataease.mobile.dto.HomeItemDTO;
4+
import io.swagger.annotations.Api;
5+
import io.swagger.annotations.ApiImplicitParam;
6+
import io.swagger.annotations.ApiOperation;
7+
import org.springframework.web.bind.annotation.PathVariable;
8+
import org.springframework.web.bind.annotation.PostMapping;
9+
import org.springframework.web.bind.annotation.RequestMapping;
10+
import java.util.List;
11+
12+
@Api(tags = "移动端:首页")
13+
@RequestMapping("/mobile/home")
14+
public interface HomeApi {
15+
16+
@ApiOperation("查询")
17+
@ApiImplicitParam(value = "类型", name = "type", paramType = "path", allowableValues = "{@code 0(收藏), 1(历史), 2(分享)}")
18+
@PostMapping("/query/{type}")
19+
List<HomeItemDTO> query(@PathVariable Integer type);
20+
21+
@ApiOperation("详情")
22+
@ApiImplicitParam(value = "ID", name = "id", paramType = "path")
23+
@PostMapping("/detail/{id}")
24+
Object detail(@PathVariable String id);
25+
26+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package io.dataease.mobile.dto;
2+
3+
import io.swagger.annotations.ApiModel;
4+
import io.swagger.annotations.ApiModelProperty;
5+
import lombok.Data;
6+
import java.io.Serializable;
7+
8+
@Data
9+
@ApiModel("首页数据实体")
10+
public class HomeItemDTO implements Serializable {
11+
12+
@ApiModelProperty("ID")
13+
private String id;
14+
@ApiModelProperty("标题")
15+
private String title;
16+
@ApiModelProperty("时间")
17+
private Long time;
18+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.dataease.mobile.server;
2+
3+
import io.dataease.mobile.api.HomeApi;
4+
import io.dataease.mobile.dto.HomeItemDTO;
5+
import io.dataease.mobile.service.HomeService;
6+
import org.springframework.web.bind.annotation.RestController;
7+
import javax.annotation.Resource;
8+
import java.util.List;
9+
10+
@RestController
11+
public class HomeServer implements HomeApi {
12+
13+
@Resource
14+
private HomeService homeService;
15+
16+
@Override
17+
public List<HomeItemDTO> query(Integer type) {
18+
return homeService.query(type);
19+
}
20+
21+
@Override
22+
public Object detail(String id) {
23+
return null;
24+
}
25+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package io.dataease.mobile.service;
2+
3+
import io.dataease.auth.api.dto.CurrentRoleDto;
4+
import io.dataease.auth.api.dto.CurrentUserDto;
5+
import io.dataease.commons.utils.AuthUtils;
6+
import io.dataease.mobile.dto.HomeItemDTO;
7+
import io.dataease.base.mapper.ext.HomeMapper;
8+
import org.springframework.stereotype.Service;
9+
import javax.annotation.Resource;
10+
import java.util.ArrayList;
11+
import java.util.HashMap;
12+
import java.util.List;
13+
import java.util.Map;
14+
import java.util.stream.Collectors;
15+
16+
@Service
17+
public class HomeService {
18+
19+
@Resource
20+
private HomeMapper homeMapper;
21+
22+
public List<HomeItemDTO> query(Integer type) {
23+
List<HomeItemDTO> result = new ArrayList<>();
24+
CurrentUserDto user = AuthUtils.getUser();
25+
switch (type){
26+
case 0:
27+
result = homeMapper.queryStore(user.getUserId());
28+
break;
29+
case 1:
30+
result = homeMapper.queryHistory();
31+
break;
32+
case 2:
33+
Map<String, Object> param = new HashMap<>();
34+
Long deptId = user.getDeptId();
35+
List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());
36+
param.put("userId", user.getUserId());
37+
param.put("deptId", deptId);
38+
param.put("roleIds", roleIds);
39+
result = homeMapper.queryShare(param);
40+
break;
41+
}
42+
return result;
43+
}
44+
}

frontend/src/views/dataset/data/FieldEdit.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</el-table-column>
9595
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
9696
<template slot-scope="scope">
97-
<span>
97+
<span v-if="scope.row.extField === 0">
9898
<span v-if="scope.row.deExtractType === 0">
9999
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
100100
<span class="field-class">{{ $t('dataset.text') }}</span>
@@ -113,6 +113,9 @@
113113
<span class="field-class">{{ $t('dataset.location') }}</span>
114114
</span>
115115
</span>
116+
<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;">
117+
<span style="font-size: 12px;color: #c0c0c0">{{ $t('dataset.calc_field') }}</span>
118+
</span>
116119
</template>
117120
</el-table-column>
118121
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
@@ -200,7 +203,7 @@
200203
</el-table-column>
201204
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
202205
<template slot-scope="scope">
203-
<span>
206+
<span v-if="scope.row.extField === 0">
204207
<span v-if="scope.row.deExtractType === 0">
205208
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
206209
<span class="field-class">{{ $t('dataset.text') }}</span>
@@ -219,6 +222,9 @@
219222
<span class="field-class">{{ $t('dataset.location') }}</span>
220223
</span>
221224
</span>
225+
<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;">
226+
<span style="font-size: 12px;color: #c0c0c0">{{ $t('dataset.calc_field') }}</span>
227+
</span>
222228
</template>
223229
</el-table-column>
224230
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->

frontend/src/views/dataset/data/ViewTable.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
<el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit">
5757
<field-edit :param="param" :table="table" />
5858
</el-tab-pane>
59+
<el-tab-pane v-if="table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)" :label="$t('dataset.join_view')" name="joinView">
60+
<union-view :param="param" :table="table" />
61+
</el-tab-pane>
5962
<el-tab-pane v-if="table.mode === 1 && (table.type === 'excel' || table.type === 'db' || table.type === 'sql')" :label="$t('dataset.update_info')" name="updateInfo">
6063
<update-info v-if="tabActive=='updateInfo'" :param="param" :table="table" />
6164
</el-tab-pane>

frontend/src/views/dataset/group/Group.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
<svg-icon icon-class="ds-excel" class="ds-icon-excel" />
9292
{{ $t('dataset.excel_data') }}
9393
</el-dropdown-item>
94+
<el-dropdown-item :command="beforeClickAddData('custom',data)">
95+
<svg-icon icon-class="ds-custom" class="ds-icon-custom" />
96+
{{ $t('dataset.custom_data') }}
97+
</el-dropdown-item>
9498
<el-dropdown-item :command="beforeClickAddData('union',data)">
9599
<svg-icon icon-class="ds-union" class="ds-icon-union" />
96100
{{ $t('dataset.union_data') }}

0 commit comments

Comments
 (0)