build: 打包

This commit is contained in:
taojinlong 2021-03-11 11:44:59 +08:00
commit 2c95a3c600
30 changed files with 739 additions and 442 deletions

View File

@ -33,8 +33,17 @@
left join sys_role r on r.role_id = ur.role_id
left join sys_dept d on d.dept_id = u.dept_id
<where>
<if test="request.quick != null and request.name == null">
AND u.nick_name like CONCAT('%', #{request.quick},'%')
</if>
<if test="request.name != null">
AND u.name like CONCAT('%', #{request.name},'%')
AND u.nick_name like CONCAT('%', #{request.name},'%')
</if>
<if test="request.enabled != null">
AND u.enabled = #{request.enabled}
</if>
<if test="request.deptId != null">
AND u.dept_id = #{request.deptId}
</if>
</where>
order by u.update_time desc

View File

@ -1,10 +1,18 @@
package io.dataease.controller.sys.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class UserGridRequest implements Serializable {
@ApiModelProperty("快速检索")
private String quick;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("组织")
private String deptId;
@ApiModelProperty("状态")
private String enabled;
}

View File

@ -37,6 +37,8 @@ public class DataSetTableService {
private DatasourceMapper datasourceMapper;
@Resource
private DataSetTableFieldsService dataSetTableFieldsService;
@Resource
private DataSetTableTaskService dataSetTableTaskService;
public void batchInsert(List<DatasetTable> datasetTable) throws Exception {
for (DatasetTable table : datasetTable) {
@ -67,11 +69,13 @@ public class DataSetTableService {
public void delete(String id) {
datasetTableMapper.deleteByPrimaryKey(id);
dataSetTableFieldsService.deleteByTableId(id);
// 删除同步任务
dataSetTableTaskService.deleteByTableId(id);
}
public List<DatasetTable> list(DataSetTableRequest dataSetTableRequest) {
DatasetTableExample datasetTableExample = new DatasetTableExample();
if(StringUtils.isNotEmpty(dataSetTableRequest.getSceneId())){
if (StringUtils.isNotEmpty(dataSetTableRequest.getSceneId())) {
datasetTableExample.createCriteria().andSceneIdEqualTo(dataSetTableRequest.getSceneId());
}
if (StringUtils.isNotEmpty(dataSetTableRequest.getSort())) {
@ -173,7 +177,7 @@ public class DataSetTableService {
return map;
}
public List<String[]> getDataSetData(String datasourceId, String table, List<DatasetTableField> fields){
public List<String[]> getDataSetData(String datasourceId, String table, List<DatasetTableField> fields) {
List<String[]> data = new ArrayList<>();
Datasource ds = datasourceMapper.selectByPrimaryKey(datasourceId);
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
@ -188,7 +192,7 @@ public class DataSetTableService {
return data;
}
public Long getDataSetTotalData(String datasourceId, String table){
public Long getDataSetTotalData(String datasourceId, String table) {
List<String[]> data = new ArrayList<>();
Datasource ds = datasourceMapper.selectByPrimaryKey(datasourceId);
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
@ -203,7 +207,7 @@ public class DataSetTableService {
return 0l;
}
public List<String[]> getDataSetPageData(String datasourceId, String table, List<DatasetTableField> fields, Long startPage, Long pageSize){
public List<String[]> getDataSetPageData(String datasourceId, String table, List<DatasetTableField> fields, Long startPage, Long pageSize) {
List<String[]> data = new ArrayList<>();
Datasource ds = datasourceMapper.selectByPrimaryKey(datasourceId);
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());

View File

@ -7,6 +7,7 @@ import io.dataease.service.ScheduleService;
import org.apache.commons.lang3.StringUtils;
import org.quartz.CronExpression;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@ -17,6 +18,7 @@ import java.util.UUID;
* @Date 2021/3/4 1:26 下午
*/
@Service
@Transactional
public class DataSetTableTaskService {
@Resource
private DatasetTableTaskMapper datasetTableTaskMapper;
@ -50,6 +52,20 @@ public class DataSetTableTaskService {
dataSetTableTaskLogService.deleteByTaskId(id);
}
public void delete(DatasetTableTask task) {
datasetTableTaskMapper.deleteByPrimaryKey(task.getId());
scheduleService.deleteSchedule(task);
dataSetTableTaskLogService.deleteByTaskId(task.getId());
}
public void deleteByTableId(String id) {
DatasetTableTaskExample datasetTableTaskExample = new DatasetTableTaskExample();
DatasetTableTaskExample.Criteria criteria = datasetTableTaskExample.createCriteria();
criteria.andTableIdEqualTo(id);
List<DatasetTableTask> datasetTableTasks = datasetTableTaskMapper.selectByExample(datasetTableTaskExample);
datasetTableTasks.forEach(this::delete);
}
public DatasetTableTask get(String id) {
return datasetTableTaskMapper.selectByPrimaryKey(id);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

View File

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="947.2 183.1 174 35" style="enable-background:new 947.2 183.1 174 35;" xml:space="preserve">
<style type="text/css">
.st0{fill:#783887;}
.st1{fill:#622870;}
.st2{fill:#8B489B;}
.st3{fill:#FFFFFF;}
</style>
<g>
<g id="XMLID_803_">
<path id="XMLID_829_" class="st0" d="M998.3,209.6l-1.1-11.2l-3.1,11.2h-3.6l-3-11.2l-1.1,11.2l-5,0l2.4-16.5h6.3l2.2,7.8l2.2-7.8
h6.2l2.5,16.5H998.3z"/>
<path id="XMLID_826_" class="st0" d="M1015.2,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1015.1,200.7,1015.2,201.6,1015.2,202.7z M1011.8,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_823_" class="st0" d="M1037.3,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1037.2,200.7,1037.3,201.6,1037.3,202.7z M1033.9,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1L1033.9,202.1z"/>
<path id="XMLID_820_" class="st0" d="M1098.2,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1098.1,200.7,1098.2,201.6,1098.2,202.7z M1094.8,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_817_" class="st0" d="M1120.3,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1120.2,200.7,1120.3,201.6,1120.3,202.7z M1116.9,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_815_" class="st0" d="M1025.7,209.6h-2.1c-0.4,0-0.7,0-0.9,0c-0.7-0.1-1.3-0.2-1.7-0.4c-0.5-0.3-1-0.7-1.2-1.2
c-0.3-0.6-0.5-1.4-0.5-2.5l0-4.6h-1.7v-3h1.7v-2.3l1.7,0l1.8-0.2v2.6h2.7l-0.4,3h-2.3v4.4c0,0.1,0,0.2,0,0.3c0,0.2,0,0.3,0.1,0.5
c0.1,0.3,0.3,0.5,0.7,0.6c0.3,0.1,1.9,0.1,1.9,0.1L1025.7,209.6z"/>
<path id="XMLID_813_" class="st0" d="M1047.7,197.9l-0.1,2.8c-0.3,0-1.2,0-2.1,0.2c-0.8,0.2-1.7,0.6-2.1,0.8v8h-3.5v-11.8h3.3
c0,0-0.1,0.6,0,0.9l0.8-0.3c0.5-0.2,1-0.3,1.7-0.4C1046.7,197.8,1047.3,197.9,1047.7,197.9z"/>
<path id="XMLID_811_" class="st0" d="M1108.9,197.9l-0.1,2.8c-0.3,0-1.2,0-2.1,0.2c-0.8,0.2-1.7,0.6-2.1,0.8v8h-3.5v-11.8h3.3
c0,0-0.1,0.6,0,0.9l0.8-0.3c0.5-0.2,1-0.3,1.7-0.4C1107.9,197.8,1108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1,0.1,0.1,0.1,0.2c0.2,0.4,0.3,0.9,0.4,1.4
c0.1,0.6,0.2,1.3,0.2,2.2v0.7c0,1.8-0.1,2.7-0.4,3.4c-0.5,1.1-1.6,1.6-3.7,1.7c-0.3,0-0.7,0-1.2,0l-0.8,0c-0.3,0-0.5,0-0.7,0v5.1
l-3.6,0.2V197.8L1063.6,197.8z M1067.2,206.1c0.7,0.1,1.1,0.1,1.7,0.1l0.6-0.1c0.7-0.2,1-0.6,1-1.3v-2.3c0-0.3,0-0.6-0.1-0.7
c-0.2-0.7-0.8-1-1.8-0.9l-0.4,0.1l-0.7,0.2l-0.3,0.1L1067.2,206.1L1067.2,206.1z"/>
<path id="XMLID_804_" class="st0" d="M1086.5,203.2v6.4h-3.6v-7c0-0.4-0.3-1.1-0.8-1.4c-0.4-0.2-1-0.2-1.2-0.1
c-0.5,0.1-1,0.4-1.3,0.6v7.9h-3.6v-17l3.6,0v6c0.4-0.2,0.9-0.3,1.4-0.4c0.4-0.1,0.8-0.1,1.2-0.1c2.1,0,3.2,0.6,3.7,1.7
C1086.2,200.2,1086.5,201.4,1086.5,203.2z"/>
</g>
<g id="XMLID_799_">
<path id="XMLID_800_" class="st0" d="M961.7,184.4l13.7,8v16.1l-13.7,8l-13.7-8v-16.1L961.7,184.4 M961.7,183.9l-14.1,8.3v16.5
l14.1,8.3l14.1-8.3v-16.5L961.7,183.9L961.7,183.9z"/>
</g>
<g id="XMLID_796_">
<polygon id="XMLID_64_" class="st1" points="961.9,200.6 973.8,193.6 973.8,207.5 961.9,214.5 "/>
</g>
<polygon id="XMLID_795_" class="st2" points="949.8,193.2 961.7,186.3 973.6,193.2 961.7,200.2 "/>
<g id="XMLID_792_">
<polygon id="XMLID_65_" class="st0" points="949.6,207.5 949.6,193.6 961.5,200.6 961.5,214.5 "/>
</g>
<g id="XMLID_789_">
<path id="XMLID_790_" class="st3" d="M957.8,209.4v-4.9l-1.8,3.9l-1.5-0.9l-0.8-5.4l-0.9,4.3l-2.1-1.3l1.7-6.2l2.6,1.6l0.6,3.8
l1.2-2.7l2.6,1.5l0.4,7.5L957.8,209.4z"/>
</g>
<g id="XMLID_786_">
<path id="XMLID_787_" class="st3" d="M968,209.1c-0.4,0.2-0.9,0.3-1.4,0.5c-0.2,0.1-0.4,0.1-0.6,0.2l-0.8,0.2l0-2l1.2-0.3
c0,0,0.5-0.1,0.7-0.2c0.3-0.1,0.5-0.2,0.7-0.3c0.8-0.3,1.2-0.7,1.3-1.1c0.1-0.2,0.1-0.3,0-0.4c-0.1-0.1-0.2-0.2-0.5-0.2
c-0.1,0-0.2,0-0.4,0l-0.5,0c-0.2,0-0.4,0.1-0.5,0.1c-0.2,0-0.4,0-0.6,0c-0.4,0-0.8-0.1-1-0.2c-0.2-0.1-0.4-0.4-0.5-0.7
c-0.1-0.2-0.1-0.5,0-0.8c0.1-0.9,0.4-1.7,1.1-2.3c0.3-0.2,0.5-0.5,0.9-0.7c0.1-0.1,0.3-0.2,0.5-0.2l0.5-0.2l0.3-0.1
c0.4-0.1,0.7-0.3,1.2-0.4l0.5-0.2l0.6-0.2l0.1,1.8c-0.2,0-0.5,0.1-0.9,0.2c-0.4,0.1-0.9,0.3-1.2,0.4c-0.8,0.3-1.1,0.6-1.2,1
c0,0.2,0,0.3,0,0.5c0,0.2,0,0.2,0.4,0.3c0.1,0,0.3,0,0.4,0l1.1-0.1c0.2,0,0.4,0,0.5,0c0.4,0,0.7,0.1,0.9,0.2
c0.2,0.1,0.4,0.4,0.5,0.7c0.1,0.2,0.1,0.5,0,0.8c-0.1,0.9-0.5,1.9-1.1,2.5c-0.2,0.2-0.5,0.5-0.9,0.7c-0.1,0.1-0.3,0.2-0.5,0.2
l-0.4,0.2L968,209.1z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="947.2 183.1 174 35" style="enable-background:new 947.2 183.1 174 35;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g>
<g id="XMLID_140_">
<path id="XMLID_166_" class="st0" d="M998.3,209.6l-1.1-11.2l-3.1,11.2h-3.6l-3-11.2l-1.1,11.2l-5,0l2.4-16.5h6.3l2.2,7.8l2.2-7.8
h6.2l2.5,16.5H998.3z"/>
<path id="XMLID_163_" class="st0" d="M1015.2,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1015.1,200.7,1015.2,201.6,1015.2,202.7z M1011.8,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_160_" class="st0" d="M1037.3,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1037.2,200.7,1037.3,201.6,1037.3,202.7z M1033.9,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1L1033.9,202.1z"/>
<path id="XMLID_157_" class="st0" d="M1098.2,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1098.1,200.7,1098.2,201.6,1098.2,202.7z M1094.8,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_154_" class="st0" d="M1120.3,202.7v2.1h-6.5l0,0.4c0,0.8,0.3,1.3,0.8,1.4c0.4,0.1,0.8,0.2,1.3,0.2h0.3
c1.3,0,3.1-0.3,4.5-0.6h0l-0.5,2.9c0,0-0.6,0.3-1.8,0.5c-0.8,0.1-1.6,0.1-2.6,0.1c-2.6,0-4.2-0.9-4.9-2.6
c-0.3-0.7-0.5-1.4-0.5-2.2v-2.8c0-2.1,1-3.4,2.7-4.1c0.8-0.3,1.6-0.4,2.4-0.4c2.4,0,4,0.8,4.7,2.4
C1120.2,200.7,1120.3,201.6,1120.3,202.7z M1116.9,202.1c0-0.8-0.2-1.4-0.6-1.5c-0.3-0.2-0.7-0.2-1-0.2c-1,0-1.4,0.5-1.4,1.4
l-0.1,0.6h3.1V202.1z"/>
<path id="XMLID_152_" class="st0" d="M1025.7,209.6h-2.1c-0.4,0-0.7,0-0.9,0c-0.7-0.1-1.3-0.2-1.7-0.4c-0.5-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c0.4-0.2,0.9-0.3,1.4-0.4c0.4-0.1,0.8-0.1,1.2-0.1c2.1,0,3.2,0.6,3.7,1.7
C1086.2,200.2,1086.5,201.4,1086.5,203.2z"/>
</g>
<g id="XMLID_136_">
<path id="XMLID_137_" class="st0" d="M961.7,184.4l13.7,8v16.1l-13.7,8l-13.7-8v-16.1L961.7,184.4 M961.7,183.9l-14.1,8.3v16.5
l14.1,8.3l14.1-8.3v-16.5L961.7,183.9L961.7,183.9z"/>
</g>
<polygon id="XMLID_132_" class="st0" points="949.8,193.2 961.7,186.3 973.6,193.2 961.7,200.2 "/>
<g id="XMLID_278_">
<g id="XMLID_42_">
<path id="XMLID_43_" class="st0" d="M949.6,193.6v13.9l11.9,6.9v-13.9L949.6,193.6z M957.8,209.4v-4.9l-1.8,3.9l-1.5-0.9
l-0.8-5.4l-0.9,4.3l-2.1-1.3l1.7-6.2l2.6,1.6l0.6,3.8l1.2-2.7l2.6,1.5l0.4,7.5L957.8,209.4z"/>
</g>
</g>
<g id="XMLID_129_">
<g id="XMLID_37_">
<path id="XMLID_38_" class="st0" d="M961.9,200.6v13.9l11.9-6.9v-13.9L961.9,200.6z M971.3,205.3c-0.1,0.9-0.5,1.9-1.1,2.5
c-0.2,0.2-0.5,0.5-0.9,0.7c-0.1,0.1-0.3,0.2-0.5,0.2l-0.4,0.2l-0.3,0.1c-0.4,0.2-0.9,0.3-1.4,0.5c-0.2,0.1-0.4,0.1-0.6,0.2
l-0.8,0.2l0-2l1.2-0.3c0,0,0.5-0.1,0.7-0.2c0.3-0.1,0.5-0.2,0.7-0.3c0.8-0.3,1.2-0.7,1.3-1.1c0.1-0.2,0.1-0.3,0-0.4
c-0.1-0.1-0.2-0.2-0.5-0.2c-0.1,0-0.2,0-0.4,0l-0.5,0c-0.2,0-0.4,0.1-0.5,0.1c-0.2,0-0.4,0-0.6,0c-0.4,0-0.8-0.1-1-0.2
c-0.2-0.1-0.4-0.4-0.5-0.7c-0.1-0.2-0.1-0.5,0-0.8c0.1-0.9,0.4-1.7,1.1-2.3c0.3-0.2,0.5-0.5,0.9-0.7c0.1-0.1,0.3-0.2,0.5-0.2
l0.5-0.2l0.3-0.1c0.4-0.1,0.7-0.3,1.2-0.4l0.5-0.2l0.6-0.2l0.1,1.8c-0.2,0-0.5,0.1-0.9,0.2c-0.4,0.1-0.9,0.3-1.2,0.4
c-0.8,0.3-1.1,0.6-1.2,1c0,0.2,0,0.3,0,0.5c0,0.2,0,0.2,0.4,0.3c0.1,0,0.3,0,0.4,0l1.1-0.1c0.2,0,0.4,0,0.5,0
c0.4,0,0.7,0.1,0.9,0.2c0.2,0.1,0.4,0.4,0.5,0.7C971.3,204.7,971.3,205,971.3,205.3z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -7,6 +7,7 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",

View File

@ -0,0 +1,95 @@
<template>
<div>
<!-- <el-switch v-model="value" active-text="当前用户" /> -->
<treeselect
v-model="value"
:options="options"
:load-options="loadData"
style="width: 200px"
/>
</div>
</template>
<script>
import { ComplexCondition } from 'fit2cloud-ui/src/components/search-bar/model'
import { getDeptTree } from '@/api/system/dept'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
components: { Treeselect },
props: {
// eslint-disable-next-line vue/require-default-prop
field: String,
// eslint-disable-next-line vue/require-default-prop
label: String,
// eslint-disable-next-line vue/require-default-prop
defaultOperator: String
// eslint-disable-next-line vue/require-default-prop
// options: Array
// eslint-disable-next-line vue/require-default-prop
// loadData: Function
},
data() {
return {
value: undefined,
operator: 'dept',
operatorLabel: '组织',
options: null
}
},
computed: {
valueLabel() {
return this.value
}
},
// 2
methods: {
init() { //
//
this.value = undefined
},
getCondition() { //
const { field, label, operator, operatorLabel, value, valueLabel } = this
// ComplexCondition
return new ComplexCondition({ field, label, operator, operatorLabel, value, valueLabel })
},
//
loadData({ action, parentNode, callback }) {
if (action === LOAD_ROOT_OPTIONS) {
const _self = this
!this.options && getDeptTree('0').then(res => {
_self.options = res.data.map(node => _self.normalizer(node))
callback()
})
}
if (action === LOAD_CHILDREN_OPTIONS) {
const _self = this
getDeptTree(parentNode.id).then(res => {
parentNode.children = res.data.map(function(obj) {
return _self.normalizer(obj)
})
callback()
})
}
},
normalizer(node) {
if (node.hasChildren) {
node.children = null
}
return {
id: node.deptId,
label: node.name,
children: node.children
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -11,17 +11,22 @@ import zhLocale from './zh'
import twLocale from './tw'
import esLocale from './es'
import jaLocale from './ja'
import fuZh from 'fit2cloud-ui/src/locale/lang/zh-CN' // 加载fit2cloud的内容
import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内容
Vue.use(VueI18n)
const messages = {
en: {
...enLocale,
...elementEnLocale
...elementEnLocale,
...fuEn
},
zh: {
...zhLocale,
...elementZhLocale
...elementZhLocale,
...fuZh
},
tw: {
...twLocale,

View File

@ -424,6 +424,7 @@ export default {
input_email: '请输入邮箱',
input_password: '请输入密码',
input_phone: '请输入电话号码',
input_roles: '请选择角色',
special_characters_are_not_supported: '不支持特殊字符',
mobile_number_format_is_incorrect: '手机号码格式不正确',
email_format_is_incorrect: '邮箱格式不正确',

View File

@ -1,5 +1,6 @@
import Cookies from 'js-cookie'
import Config from '@/settings'
const TokenKey = Config.TokenKey
export function getToken() {
@ -13,3 +14,4 @@ export function setToken(token) {
export function removeToken() {
return Cookies.remove(TokenKey)
}

View File

@ -136,3 +136,17 @@ export function param2Obj(url) {
'"}'
)
}
export function formatCondition(param) {
if (!param) {
return null
}
const condition = {}
for (const key in param) {
if (Object.hasOwnProperty.call(param, key)) {
const element = param[key]
condition[element.field] = element.value
}
}
return condition
}

View File

@ -0,0 +1,9 @@
import store from '@/store'
export function checkPermission(pers) {
const permissions = store.getters.permissions
const hasPermission = pers.every(needP => {
const result = permissions.includes(needP)
return result
})
return hasPermission
}

View File

@ -18,3 +18,5 @@ export function validUsername(str) {
const valid_map = ['admin', 'cyw']
return valid_map.indexOf(str.trim()) >= 0
}
export const PHONE_REGEX = '^1[3|4|5|7|8][0-9]{9}$'

View File

@ -24,7 +24,7 @@
<el-tab-pane :label="$t('dataset.join_view')" name="joinView">
关联视图 TODO
</el-tab-pane>
<el-tab-pane :label="$t('dataset.update_info')" name="updateInfo">
<el-tab-pane v-if="table.mode === 1" :label="$t('dataset.update_info')" name="updateInfo">
<update-info :table="table"/>
</el-tab-pane>
</el-tabs>

View File

@ -215,10 +215,10 @@
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name"/>
</el-form-item>
<el-form-item :label="$t('dataset.mode')" prop="mode">
<el-radio v-model="tableForm.mode" label="0">{{ $t('dataset.direct_connect') }}</el-radio>
<el-radio v-model="tableForm.mode" label="1">{{ $t('dataset.sync_data') }}</el-radio>
</el-form-item>
<!-- <el-form-item :label="$t('dataset.mode')" prop="mode">-->
<!-- <el-radio v-model="tableForm.mode" label="0">{{ $t('dataset.direct_connect') }}</el-radio>-->
<!-- <el-radio v-model="tableForm.mode" label="1">{{ $t('dataset.sync_data') }}</el-radio>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeTable()">{{ $t('dataset.cancel') }}</el-button>

View File

@ -1,62 +1,44 @@
<template>
<div v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-card class="table-card">
<template v-slot:header>
<ms-table-header
:permission="permission"
:condition.sync="condition"
:create-tip="$t('user.create')"
:title="$t('commons.user')"
@search="search"
@create="create"
/>
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<complex-table
:data="data"
:columns="columns"
:buttons="buttons"
:header="header"
:search-config="searchConfig"
:pagination-config="paginationConfig"
@select="select"
@search="search"
>
<template #buttons>
<fu-table-button icon="el-icon-circle-plus-outline" :label="$t('user.create')" @click="create" />
</template>
<el-table border class="adjust-table" :data="tableData" style="width: 100%">
<el-table-column prop="username" label="ID" />
<el-table-column prop="nickName" :label="$t('commons.name')" width="200" />
<el-table-column prop="gender" label="性别" />
<el-table-column type="selection" fix />
<el-table-column prop="username" label="ID" width="80" />
<el-table-column prop="nickName" :label="$t('commons.name')" width="140" />
<el-table-column prop="gender" label="性别" width="50" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="phone" width="200" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="200" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')" width="60">
<template v-slot:default="scope">
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="160">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<fu-table-operations :buttons="buttons" label="操作" fix />
</complex-table>
<!-- <el-table-column prop="source" :label="$t('user.source')"/> -->
<el-table-column :label="$t('commons.operating')" min-width="120px">
<template v-slot:default="scope">
<ms-table-operator :permission="permission" @editClick="edit(scope.row)" @deleteClick="del(scope.row)">
<template v-slot:behind>
<ms-table-operator-button
v-permission="permission.editPwd"
:tip="$t('member.edit_password')"
icon="el-icon-s-tools"
type="success"
@exec="editPassword(scope.row)"
/>
</template>
</ms-table-operator>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total" />
</el-card>
<el-dialog
append-to-body
:close-on-click-modal="false"
@ -72,7 +54,7 @@
<el-input v-model="form.username" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model.number="form.phone" />
<el-input v-model="form.phone" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="form.nickName" />
@ -102,11 +84,12 @@
placeholder="选择部门"
/>
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
<el-form-item style="margin-bottom: 0;" label="角色" prop="roleIds">
<el-select
v-model="form.roleIds"
style="width: 430px"
multiple
required="true"
placeholder="请选择"
@remove-tag="deleteTag"
@change="changeRole"
@ -120,12 +103,10 @@
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="dialogVisible = false"
@confirm="createUser('createUserForm')"
/>
</template>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="dialogVisible = false">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="createUser('createUserForm')">确认</el-button>
</div>
</el-dialog>
<!--Changing user password in system settings-->
@ -153,60 +134,76 @@
<el-input v-model="ruleForm.userId" autocomplete="off" :disabled="true" style="display:none" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<ms-dialog-footer
@cancel="editPasswordVisible = false"
@confirm="editUserPassword('editPasswordForm')"
/>
</span>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="editPasswordVisible = false">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="editUserPassword('editPasswordForm')">确认</el-button>
</div>
</el-dialog>
</div>
</layout-content>
</template>
<script>
// import MsCreateBox from '@/metersphere/common/components/CreateBox'
import MsTablePagination from '@/metersphere/common/pagination/TablePagination'
import MsTableHeader from '@/metersphere/common/components/MsTableHeader'
import MsTableOperator from '@/metersphere/common/components/MsTableOperator'
import MsDialogFooter from '@/metersphere/common/components/MsDialogFooter'
import MsTableOperatorButton from '@/metersphere/common/components/MsTableOperatorButton'
import { listenGoBack, removeGoBackListener } from '@/metersphere/common/js/utils'
import { PHONE_REGEX } from '@/metersphere/common/js/regex'
import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
// import conditionTable from '@/components/business/condition-table'
// import CustomCondition from './CustomCondtion'
// import { GridButton } from '@/components/GridButton'
import { checkPermission } from '@/utils/permission'
import { formatCondition } from '@/utils/index'
import { PHONE_REGEX } from '@/utils/validate'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { userLists, addUser, editUser, delUser, editPassword, editStatus } from '@/api/system/user'
import { allRoles } from '@/api/system/role'
import { getDeptTree } from '@/api/system/dept'
export default {
name: 'MsUser',
components: {
// MsCreateBox,
MsTablePagination,
MsTableHeader,
MsTableOperator,
MsDialogFooter,
MsTableOperatorButton,
Treeselect
},
export default {
components: { ComplexTable, LayoutContent, Treeselect },
data() {
return {
queryPath: '/api/user/userGrid',
deletePath: '/api/user/delete/',
createPath: '/api/user/create',
updatePath: '/api/user/update',
editPasswordPath: '/api/user/password',
result: {},
header: '',
columns: [],
buttons: [
{
label: this.$t('commons.edit'), icon: 'el-icon-edit', click: this.edit
}, {
label: this.$t('commons.delete'), icon: 'el-icon-delete', type: 'danger', click: this.del
}, {
label: this.$t('member.edit_password'), icon: 'el-icon-s-tools', type: 'danger', click: this.editPassword,
show: checkPermission(['user:editPwd'])
}
],
searchConfig: {
quickPlaceholder: '按姓名搜索',
components: [
// { field: 'name', label: '', component: 'FuComplexInput', defaultOperator: 'eq' },
{ field: 'name', label: '姓名', component: 'FuComplexInput' },
{
field: 'enabled',
label: '状态',
component: 'FuComplexSelect',
options: [
{ label: '启用', value: '1' },
{ label: '禁用', value: '0' }
],
multiple: false
}
// { field: 'deptId', label: '', component: conditionTable }
]
},
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0
},
data: [],
dialogVisible: false,
editPasswordVisible: false,
multipleSelection: [],
currentPage: 1,
pageSize: 10,
total: 0,
condition: {},
tableData: [],
form: {
roles: [{
id: ''
@ -215,7 +212,7 @@ export default {
checkPasswordForm: {},
ruleForm: {},
rule: {
id: [
username: [
{ required: true, message: this.$t('user.input_id'), trigger: 'blur' },
{ min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur' },
{
@ -225,7 +222,7 @@ export default {
trigger: 'blur'
}
],
name: [
nickName: [
{ required: true, message: this.$t('user.input_name'), trigger: 'blur' },
{ min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur' },
{
@ -267,7 +264,9 @@ export default {
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
]
],
roleIds: [{ required: true, message: this.$t('user.input_roles'), trigger: 'blur' }]
},
defaultForm: { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 1, deptId: null, phone: null },
depts: null,
@ -283,7 +282,6 @@ export default {
}
}
},
activated() {
// this.form = Object.assign({}, this.defaultForm);
this.allRoles()
@ -291,25 +289,33 @@ export default {
},
methods: {
select(selection) {
console.log(selection)
},
search(condition) {
console.log(condition) // demo
const param = formatCondition(condition)
const { currentPage, pageSize } = this.paginationConfig
userLists(currentPage, pageSize, param || {}).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
},
create() {
this.formType = 'add'
this.form = Object.assign({}, this.defaultForm)
this.dialogVisible = true
listenGoBack(this.handleClose)
},
edit(row) {
this.formType = 'modify'
this.dialogVisible = true
this.form = Object.assign({}, row)
listenGoBack(this.handleClose)
},
editPassword(row) {
this.editPasswordVisible = true
const tempForm = Object.assign({}, row)
this.ruleForm = { userId: tempForm.userId }
listenGoBack(this.handleClose)
},
del(row) {
this.$confirm(this.$t('user.delete_confirm'), '', {
@ -354,23 +360,9 @@ export default {
}
})
},
search() {
userLists(this.currentPage, this.pageSize, this.condition).then(response => {
const data = response.data
this.total = data.itemCount
this.tableData = data.listObject
})
// this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
// const data = response.data
// this.total = data.itemCount
// this.tableData = data.listObject
// })
},
handleClose() {
this.formType = 'add'
this.form = {}
removeGoBackListener(this.handleClose)
this.editPasswordVisible = false
this.dialogVisible = false
},
@ -381,10 +373,6 @@ export default {
this.$success(this.$t('commons.modify_success'))
})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
//
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_ROOT_OPTIONS) {
@ -434,11 +422,10 @@ export default {
this.roles = res.data
})
}
}
}
</script>
<style scoped>
@import "~@/metersphere/common/css/index.css";
</style>

View File

@ -1,134 +0,0 @@
<template>
<layout-content>
<complex-table
:data="data"
:columns="columns"
:buttons="buttons"
:header="header"
:search-config="searchConfig"
:pagination-config="paginationConfig"
@select="select"
@search="search"
>
<template #buttons>
<fu-table-button icon="el-icon-circle-plus-outline" :label="$t('user.create')" @click="add" />
</template>
<el-table-column type="selection" fix />
<el-table-column prop="username" label="ID" />
<el-table-column prop="nickName" :label="$t('commons.name')" width="200" />
<el-table-column prop="gender" label="性别" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<fu-table-operations :buttons="buttons" label="操作" fix />
</complex-table>
</layout-content>
</template>
<script>
import LayoutContent from '@/components/business/LayoutContent'
import { userLists } from '@/api/system/user'
import ComplexTable from '@/components/business/complex-table'
import CustomCondition from './CustomCondtion'
// import { GridButton } from '@/components/GridButton'
// import { checkPermission } from '@/utils/permisstion'
const buttonClick = function(row) {
console.log(this.label + ': ' + row.id)
}
export default {
name: 'UserManagement',
components: { ComplexTable, LayoutContent },
data() {
return {
header: '',
columns: [],
buttons: [
{
label: '编辑', icon: 'el-icon-edit', click: this.edit
}, {
label: '执行', icon: 'el-icon-video-play', click: buttonClick
}, {
label: '删除', icon: 'el-icon-delete', type: 'danger', click: buttonClick
}, {
label: '删除(权限)', icon: 'el-icon-delete', type: 'danger', click: buttonClick
// show: checkPermission('editor') // editor
}, {
label: '复制', icon: 'el-icon-document-copy', click: buttonClick
}, {
label: '定时任务', icon: 'el-icon-timer', click: buttonClick
}
],
searchConfig: {
quickPlaceholder: '按 姓名/邮箱 搜索',
components: [
{ field: 'name', label: '姓名', component: 'FuComplexInput', defaultOperator: 'eq' },
{ field: 'email', label: 'Email', component: 'FuComplexInput' },
{
field: 'status',
label: '状态',
component: 'FuComplexSelect',
options: [
{ label: '运行中', value: 'Running' },
{ label: '成功', value: 'Success' },
{ label: '失败', value: 'Fail' }
],
multiple: true
},
{ field: 'create_time', label: '创建时间', component: 'FuComplexDateTime' },
{ field: 'user', component: CustomCondition } // CustomCondition
]
},
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0
},
data: []
}
},
created() {
this.search()
},
methods: {
select(selection) {
console.log(selection)
},
edit(row) {
console.log('编辑: ', row)
},
add() {
},
search(condition) {
console.log(condition) // demo
const { currentPage, pageSize } = this.paginationConfig
userLists(currentPage, pageSize, {}).then(response => {
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,444 @@
<template>
<div v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-card class="table-card">
<template v-slot:header>
<ms-table-header
:permission="permission"
:condition.sync="condition"
:create-tip="$t('user.create')"
:title="$t('commons.user')"
@search="search"
@create="create"
/>
</template>
<el-table border class="adjust-table" :data="tableData" style="width: 100%">
<el-table-column prop="username" label="ID" />
<el-table-column prop="nickName" :label="$t('commons.name')" width="200" />
<el-table-column prop="gender" label="性别" />
<el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept.deptName }}</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')" width="120">
<template v-slot:default="scope">
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" inactive-color="#DCDFE6" @change="changeSwitch(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="createTime" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="source" :label="$t('user.source')"/> -->
<el-table-column :label="$t('commons.operating')" min-width="120px">
<template v-slot:default="scope">
<ms-table-operator :permission="permission" @editClick="edit(scope.row)" @deleteClick="del(scope.row)">
<template v-slot:behind>
<ms-table-operator-button
v-permission="permission.editPwd"
:tip="$t('member.edit_password')"
icon="el-icon-s-tools"
type="success"
@exec="editPassword(scope.row)"
/>
</template>
</ms-table-operator>
</template>
</el-table-column>
</el-table>
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize" :total="total" />
</el-card>
<el-dialog
append-to-body
:close-on-click-modal="false"
:title="formType=='add' ? $t('user.create') : $t('user.modify')"
:visible.sync="dialogVisible"
width="570px"
:destroy-on-close="true"
@closed="handleClose"
>
<el-form ref="createUserForm" :inline="true" :model="form" :rules="rule" size="small" label-width="66px">
<el-form-item label="用户名" prop="username">
<el-input v-model="form.username" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model.number="form.phone" />
</el-form-item>
<el-form-item label="昵称" prop="nickName">
<el-input v-model="form.nickName" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" />
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.gender" style="width: 178px">
<el-radio label="男"></el-radio>
<el-radio label="女"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.enabled" style="width: 140px">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="部门" prop="dept">
<treeselect
v-model="form.deptId"
:options="depts"
:load-options="loadDepts"
style="width: 430px"
placeholder="选择部门"
/>
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
<el-select
v-model="form.roleIds"
style="width: 430px"
multiple
placeholder="请选择"
@remove-tag="deleteTag"
@change="changeRole"
>
<el-option
v-for="item in roles"
:key="item.name"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template v-slot:footer>
<ms-dialog-footer
@cancel="dialogVisible = false"
@confirm="createUser('createUserForm')"
/>
</template>
</el-dialog>
<!--Changing user password in system settings-->
<el-dialog
:close-on-click-modal="false"
:title="$t('member.edit_password')"
:visible.sync="editPasswordVisible"
width="30%"
:destroy-on-close="true"
left
@close="handleClose"
>
<el-form
ref="editPasswordForm"
:model="ruleForm"
label-position="right"
label-width="120px"
:rules="rule"
class="demo-ruleForm"
>
<el-form-item :label="$t('member.new_password')" prop="newpassword">
<el-input v-model="ruleForm.newPassword" type="password" autocomplete="off" show-password />
</el-form-item>
<el-form-item>
<el-input v-model="ruleForm.userId" autocomplete="off" :disabled="true" style="display:none" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<ms-dialog-footer
@cancel="editPasswordVisible = false"
@confirm="editUserPassword('editPasswordForm')"
/>
</span>
</el-dialog>
</div>
</template>
<script>
// import MsCreateBox from '@/metersphere/common/components/CreateBox'
import MsTablePagination from '@/metersphere/common/pagination/TablePagination'
import MsTableHeader from '@/metersphere/common/components/MsTableHeader'
import MsTableOperator from '@/metersphere/common/components/MsTableOperator'
import MsDialogFooter from '@/metersphere/common/components/MsDialogFooter'
import MsTableOperatorButton from '@/metersphere/common/components/MsTableOperatorButton'
import { listenGoBack, removeGoBackListener } from '@/metersphere/common/js/utils'
import { PHONE_REGEX } from '@/metersphere/common/js/regex'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { userLists, addUser, editUser, delUser, editPassword, editStatus } from '@/api/system/user'
import { allRoles } from '@/api/system/role'
import { getDeptTree } from '@/api/system/dept'
export default {
name: 'MsUser',
components: {
// MsCreateBox,
MsTablePagination,
MsTableHeader,
MsTableOperator,
MsDialogFooter,
MsTableOperatorButton,
Treeselect
},
data() {
return {
queryPath: '/api/user/userGrid',
deletePath: '/api/user/delete/',
createPath: '/api/user/create',
updatePath: '/api/user/update',
editPasswordPath: '/api/user/password',
result: {},
dialogVisible: false,
editPasswordVisible: false,
multipleSelection: [],
currentPage: 1,
pageSize: 10,
total: 0,
condition: {},
tableData: [],
form: {
roles: [{
id: ''
}]
},
checkPasswordForm: {},
ruleForm: {},
rule: {
id: [
{ required: true, message: this.$t('user.input_id'), trigger: 'blur' },
{ min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur' },
{
required: true,
pattern: '^[^\u4e00-\u9fa5]+$',
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
],
name: [
{ required: true, message: this.$t('user.input_name'), trigger: 'blur' },
{ min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur' },
{
required: true,
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
],
phone: [
{
pattern: PHONE_REGEX,
message: this.$t('user.mobile_number_format_is_incorrect'),
trigger: 'blur'
}
],
email: [
{ required: true, message: this.$t('user.input_email'), trigger: 'blur' },
{
required: true,
pattern: /^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
message: this.$t('user.email_format_is_incorrect'),
trigger: 'blur'
}
],
password: [
{ required: true, message: this.$t('user.input_password'), trigger: 'blur' },
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
],
newPassword: [
{ required: true, message: this.$t('user.input_password'), trigger: 'blur' },
{
required: true,
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,30}$/,
message: this.$t('member.password_format_is_incorrect'),
trigger: 'blur'
}
]
},
defaultForm: { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 1, deptId: null, phone: null },
depts: null,
roles: [],
roleDatas: [],
userRoles: [],
formType: 'add',
permission: {
add: ['user:add'],
edit: ['user:edit'],
del: ['user:del'],
editPwd: ['user:editPwd']
}
}
},
activated() {
// this.form = Object.assign({}, this.defaultForm);
this.allRoles()
this.search()
},
methods: {
create() {
this.formType = 'add'
this.form = Object.assign({}, this.defaultForm)
this.dialogVisible = true
listenGoBack(this.handleClose)
},
edit(row) {
this.formType = 'modify'
this.dialogVisible = true
this.form = Object.assign({}, row)
listenGoBack(this.handleClose)
},
editPassword(row) {
this.editPasswordVisible = true
const tempForm = Object.assign({}, row)
this.ruleForm = { userId: tempForm.userId }
listenGoBack(this.handleClose)
},
del(row) {
this.$confirm(this.$t('user.delete_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
delUser(encodeURIComponent(row.userId)).then(res => {
this.$success(this.$t('commons.delete_success'))
this.search()
})
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'))
})
},
createUser(createUserForm) {
this.$refs[createUserForm].validate(valid => {
if (valid) {
const method = this.formType === 'add' ? addUser : editUser
method(this.form).then(res => {
this.$success(this.$t('commons.save_success'))
this.search()
this.dialogVisible = false
})
} else {
return false
}
})
},
editUserPassword(editPasswordForm) {
this.$refs[editPasswordForm].validate(valid => {
if (valid) {
editPassword(this.ruleForm).then(res => {
this.$success(this.$t('commons.modify_success'))
this.editPasswordVisible = false
this.search()
window.location.reload()
})
} else {
return false
}
})
},
search() {
userLists(this.currentPage, this.pageSize, this.condition).then(response => {
const data = response.data
this.total = data.itemCount
this.tableData = data.listObject
})
// this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
// const data = response.data
// this.total = data.itemCount
// this.tableData = data.listObject
// })
},
handleClose() {
this.formType = 'add'
this.form = {}
removeGoBackListener(this.handleClose)
this.editPasswordVisible = false
this.dialogVisible = false
},
changeSwitch(row) {
const { userId, enabled } = row
const param = { userId: userId, enabled: enabled }
editStatus(param).then(res => {
this.$success(this.$t('commons.modify_success'))
})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
//
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_ROOT_OPTIONS) {
const _self = this
!this.depts && getDeptTree('0').then(res => {
_self.depts = res.data.map(node => _self.normalizer(node))
callback()
})
}
if (action === LOAD_CHILDREN_OPTIONS) {
const _self = this
getDeptTree(parentNode.id).then(res => {
parentNode.children = res.data.map(function(obj) {
return _self.normalizer(obj)
})
callback()
})
}
},
normalizer(node) {
if (node.hasChildren) {
node.children = null
}
return {
id: node.deptId,
label: node.name,
children: node.children
}
},
deleteTag(value) {
this.userRoles.forEach(function(data, index) {
if (data.id === value) {
this.userRoles.splice(index, value)
}
}.bind(this))
},
changeRole(value) {
this.userRoles = []
value.forEach(function(data, index) {
const role = { id: data }
this.userRoles.push(role)
}.bind(this))
},
allRoles() {
allRoles().then(res => {
this.roles = res.data
})
}
}
}
</script>
<style scoped>
@import "~@/metersphere/common/css/index.css";
</style>

View File

@ -18,7 +18,6 @@
<modules>
<module>frontend</module>
<module>backend</module>
</modules>
</project>