Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e95fd0aeee
@ -0,0 +1,15 @@
|
||||
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);
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
<?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>
|
||||
26
backend/src/main/java/io/dataease/mobile/api/HomeApi.java
Normal file
26
backend/src/main/java/io/dataease/mobile/api/HomeApi.java
Normal file
@ -0,0 +1,26 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
<span v-if="scope.row.extField === 0">
|
||||
<span v-if="scope.row.deExtractType === 0">
|
||||
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
|
||||
<span class="field-class">{{ $t('dataset.text') }}</span>
|
||||
@ -113,6 +113,9 @@
|
||||
<span class="field-class">{{ $t('dataset.location') }}</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>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
|
||||
@ -200,7 +203,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column property="deExtractType" :label="$t('dataset.origin_field_type')" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
<span v-if="scope.row.extField === 0">
|
||||
<span v-if="scope.row.deExtractType === 0">
|
||||
<svg-icon v-if="scope.row.deExtractType === 0" icon-class="field_text" class="field-icon-text" />
|
||||
<span class="field-class">{{ $t('dataset.text') }}</span>
|
||||
@ -219,6 +222,9 @@
|
||||
<span class="field-class">{{ $t('dataset.location') }}</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>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column property="groupType" :label="$t('dataset.field_group_type')" width="180">-->
|
||||
|
||||
@ -56,6 +56,9 @@
|
||||
<el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit">
|
||||
<field-edit :param="param" :table="table" />
|
||||
</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">
|
||||
<update-info v-if="tabActive=='updateInfo'" :param="param" :table="table" />
|
||||
</el-tab-pane>
|
||||
|
||||
@ -91,6 +91,10 @@
|
||||
<svg-icon icon-class="ds-excel" class="ds-icon-excel" />
|
||||
{{ $t('dataset.excel_data') }}
|
||||
</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)">
|
||||
<svg-icon icon-class="ds-union" class="ds-icon-union" />
|
||||
{{ $t('dataset.union_data') }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user