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

This commit is contained in:
wangjiahao 2021-06-02 16:30:19 +08:00
commit bfe902d371
29 changed files with 201 additions and 76 deletions

View File

@ -7,6 +7,7 @@ import io.dataease.auth.service.AuthUserService;
import io.dataease.auth.util.JWTUtils;
import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.commons.utils.ServletUtils;
import io.dataease.i18n.Translator;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.subject.Subject;
@ -26,7 +27,7 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
public final static String expireMessage = "login token is expire";
public final static String expireMessage = "Login token is expire.";
/*@Autowired
private AuthUserService authUserService;*/
@ -102,6 +103,9 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
TokenInfo tokenInfo = JWTUtils.tokenInfoByToken(token);
AuthUserService authUserService = CommonBeanFactory.getBean(AuthUserService.class);
SysUserEntity user = authUserService.getUserById(tokenInfo.getUserId());
if(user == null){
throw new Exception(Translator.get("i18n_not_find_user"));
}
String password = user.getPassword();
// 删除老token操作时间

View File

@ -18,7 +18,7 @@ public class DorisTableUtils {
return "f_" + Md5Utils.md5(dorisName);
}
public static String excelColumnName(String filedName) {
public static String columnName(String filedName) {
return "C_" + Md5Utils.md5(filedName);
}
}

View File

@ -3,6 +3,7 @@ package io.dataease.controller.sys.base;
import io.dataease.base.mapper.ext.query.GridExample;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.List;
@ -13,12 +14,20 @@ public class BaseGridRequest implements Serializable {
private List<ConditionEntity> conditions;
private List<String> orders;
public GridExample convertExample(){
GridExample gridExample = new GridExample();
if (CollectionUtils.isEmpty(conditions))return gridExample;
if (CollectionUtils.isNotEmpty(conditions)) {
GridExample.Criteria criteria = gridExample.createCriteria();
conditions.forEach(criteria::addCondtion);
}
if (CollectionUtils.isNotEmpty(orders)){
String orderByClause = String.join(", ", orders);
gridExample.setOrderByClause(orderByClause);
}
GridExample.Criteria criteria = gridExample.createCriteria();
conditions.forEach(criteria::addCondtion);
return gridExample;
}
}

View File

@ -232,7 +232,7 @@ public class JdbcProvider extends DatasourceProvider {
} catch (Exception e) {
throw new Exception("ERROR: " + e.getMessage(), e);
} finally {
con.close();
if(con != null){con.close();}
}
}

View File

@ -144,7 +144,7 @@ public class DatasourceService {
datasourceRequest.setDatasource(datasource);
datasourceProvider.initDataSource(datasourceRequest);
LogUtil.info("Succsss to init datasource connection pool: " + datasource.getName());
}catch (Exception e){
} catch (Exception e) {
LogUtil.error("Failed to init datasource connection pool: " + datasource.getName(), e);
}
});

View File

@ -2,9 +2,16 @@ package io.dataease.job.sechedule;
import io.dataease.commons.utils.LogUtil;
import org.quartz.*;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -73,7 +80,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);
triggerBuilder.startAt(startTime);
if (startTime.before(new Date())) {
triggerBuilder.startAt(getNTimeByCron(cron));
}
if (endTime != null) {
triggerBuilder.endAt(endTime);
@ -149,7 +158,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组
triggerBuilder.startAt(startTime);
if (startTime.before(new Date())) {
triggerBuilder.startAt(getNTimeByCron(cron));
}
if (endTime != null) {
triggerBuilder.endAt(endTime);
@ -395,4 +406,23 @@ public class ScheduleManager {
return returnMap;
}
public static Date getNTimeByCron(String cron) {
try {
CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
cronTriggerImpl.setCronExpression(cron);
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
// calendar.add(java.util.Calendar.YEAR, 1);
calendar.add(Calendar.MONTH, 2);
List<Date> dates = TriggerUtils.computeFireTimesBetween(cronTriggerImpl, null, now, calendar.getTime());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nextTime = dateFormat.format(dates.get(0));
Date date = dateFormat.parse(nextTime);
return date;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -102,10 +102,6 @@ public class DataSetTableService {
datasetTable.setCreateBy(AuthUtils.getUser().getUsername());
datasetTable.setCreateTime(System.currentTimeMillis());
DataTableInfoDTO dataTableInfoDTO = new DataTableInfoDTO();
if (StringUtils.equalsIgnoreCase("db", datasetTable.getType())) {
dataTableInfoDTO.setTable(datasetTable.getName());
datasetTable.setInfo(new Gson().toJson(dataTableInfoDTO));
}
int insert = datasetTableMapper.insert(datasetTable);
// 添加表成功后获取当前表字段和类型抽象到dataease数据库
if (insert == 1) {
@ -545,11 +541,7 @@ public class DataSetTableService {
datasetTableField.setTableId(datasetTable.getId());
datasetTableField.setOriginName(filed.getFieldName());
datasetTableField.setName(filed.getRemarks());
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "excel")) {
datasetTableField.setDataeaseName(DorisTableUtils.excelColumnName(filed.getFieldName()));
} else {
datasetTableField.setDataeaseName(filed.getFieldName());
}
datasetTableField.setDataeaseName(DorisTableUtils.columnName(filed.getFieldName()));
datasetTableField.setType(filed.getFieldType());
if (ObjectUtils.isEmpty(ds)) {
datasetTableField.setDeType(transFieldType(filed.getFieldType()));

View File

@ -119,7 +119,7 @@ public class PanelLinkService {
public Boolean validateHeads(PanelLink panelLink) throws Exception{
HttpServletRequest request = ServletUtils.request();
String token = request.getHeader("LINK-PWD-TOKEN");
if (StringUtils.isEmpty(token)) return false;
if (StringUtils.isEmpty(token) || StringUtils.equals("undefined", token) || StringUtils.equals("null", token)) return false;
boolean verify = JWTUtils.verifyLink(token, panelLink.getResourceId(), decryptParam(panelLink.getPwd()));
return verify;
}

View File

@ -51,16 +51,16 @@ public class SysUserService {
public List<SysUserGridResponse> query(BaseGridRequest request) {
List<SysUser> sysUsers = sysUserMapper.selectByExample(new SysUserExample());
/* List<SysUser> sysUsers = sysUserMapper.selectByExample(new SysUserExample());
List<SysUserGridResponse> lists = sysUsers.stream().map(ele -> {
SysUserGridResponse response = new SysUserGridResponse();
BeanUtils.copyBean(response, ele);
return response;
}).collect(Collectors.toList());
}).collect(Collectors.toList());*/
GridExample gridExample = request.convertExample();
List<SysUserGridResponse> query = extSysUserMapper.query(gridExample);
List<SysUserGridResponse> lists = extSysUserMapper.query(gridExample);
lists.forEach(item -> {
for (SysUserGridResponse response : query) {
/*for (SysUserGridResponse response : query) {
if (item.getUserId().equals(response.getUserId())) {
item.setId(response.getId());
List<SysUserRole> roles = response.getRoles();
@ -69,10 +69,10 @@ public class SysUserService {
item.setRoleIds(roleIds);
item.setDept(response.getDept());
}
}
// List<SysUserRole> roles = item.getRoles();
// List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
// item.setRoleIds(roleIds);
}*/
List<SysUserRole> roles = item.getRoles();
List<Long> roleIds = roles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
item.setRoleIds(roleIds);
});
return lists;
}

View File

@ -243,3 +243,5 @@ i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled
i18n_username_exists=ID is already exists
i18n_ds_name_exists=Datasource name exists
i18n_sync_job_exists=There is already a synchronization task running, please try again later
i18n_datasource_check_fail=Invalid,please check config
i18n_not_find_user=Can not find user.

View File

@ -232,8 +232,8 @@ i18n_template_system=系统模板
i18n_template_self=用户模板
i18n_name_cant_repeat_same_group=同一分组下名称不能重复
i18n_chart_count=记录数*
i18n_excel_have_merge_region=Excel存在合并单元格
i18n_cron_expression_error=Cron表达式校验错误
i18n_excel_have_merge_region=Excel 存在合并单元格
i18n_cron_expression_error=Cron 表达式校验错误
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
i18n_default_panel=默认仪表板
i18n_panel_list=仪表板
@ -242,6 +242,8 @@ i18n_union_already_exists=关联关系已存在
i18n_union_field_exists=两个数据集之间关联不能出现多次相同字段
i18n_cron_time_error=开始时间不能大于结束时间
i18n_auth_source_be_canceled=当前资源授权权限已经被取消
i18n_username_exists=用户ID已存在
i18n_username_exists=用户 ID 已存在
i18n_ds_name_exists=数据源名称已存在
i18n_sync_job_exists=已经有同步任务在运行,稍后重试
i18n_datasource_check_fail=校验失败,请检查配置信息
i18n_not_find_user=未找到用户

View File

@ -245,3 +245,5 @@ i18n_auth_source_be_canceled=當前資源授權權限已經被取消
i18n_username_exists=用戶ID已存在
i18n_ds_name_exists=數據源名稱已存在
i18n_sync_job_exists=已經有同步任務在運行,稍後重試
i18n_datasource_check_fail=校驗失敗,請檢查配置信息
i18n_not_find_user=未找到用戶

View File

@ -268,6 +268,10 @@ export default {
not_equals: 'Not equals',
between: 'between',
current_user: 'Current User'
},
message_box: {
alert: 'Alert',
confirm: 'Confirm'
}
},
monitor: 'Monitor',
@ -482,13 +486,12 @@ export default {
create: 'Create',
modify: 'Modify',
delete: 'Delete',
delete_confirm: '删除该组织会关联删除该组织下的所有资源(如:相关工作空间,项目,测试用例等),确定要删除吗?',
delete_confirm: 'Deleting the organization will be associated with deleting the subordinate organization, Are you sure you want to delete it?',
input_name: 'Please enter name',
select_organization: 'Please select organization',
search_by_name: 'Search by name',
special_characters_are_not_supported: 'Format error (special characters are not supported and cannot start and end with \'-\')',
select: 'Select organization',
delete_warning: '删除该组织将同步删除该组织下所有相关工作空间和相关工作空间下的所有项目,以及项目中的所有用例、接口测试、性能测试等,确定要删除吗?'
select: 'Select organization'
},
system_parameter_setting: {
mailbox_service_settings: 'Mail Settings',
@ -986,7 +989,8 @@ export default {
loginLogo: 'Login page header logo',
loginImage: 'Picture on the right side of the login page',
loginTitle: 'Login page title',
title: 'System name'
title: 'System name',
advice_size: 'Advice picture size'
},
auth: {
authConfig: 'Auth Config',

View File

@ -83,8 +83,8 @@ export default {
thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!',
expires: '登陸信息过期,请重新登陸',
tokenError: '信息错误,请重新登陸',
username_error: '請輸入正確的ID',
password_error: '密碼不小於8位'
username_error: '請輸入正確的 ID',
password_error: '密碼不小於 8 位'
},
commons: {
close: '关闭',
@ -268,6 +268,10 @@ export default {
not_equals: '不等與',
between: '之间',
current_user: '是当前用戶'
},
message_box: {
alert: '警告',
confirm: '確認'
}
},
monitor: '监控',
@ -482,13 +486,12 @@ export default {
create: '創建組織',
modify: '修改組織',
delete: '删除組織',
delete_confirm: '删除該組織會關聯刪除該組織的所有資源,確定要删除吗?',
delete_confirm: '删除該組織會關聯刪除該組織的下屬組織,確定要删除吗?',
input_name: '請輸入組織名稱',
select_organization: '请選擇組織',
search_by_name: '根据名稱搜索',
special_characters_are_not_supported: '格式錯誤(不支持特殊字符,且不能以\'-\'開頭結尾)',
select: '選擇組織',
delete_warning: '確定要删除組織吗?'
select: '選擇組織'
},
system_parameter_setting: {
mailbox_service_settings: '郵件設置',
@ -986,7 +989,8 @@ export default {
loginLogo: '登陸頁面頭部 Logo',
loginImage: '登陸頁面右側圖片',
loginTitle: '登陸頁面標題',
title: '系統名稱'
title: '系統名稱',
advice_size: '建議圖片大小'
},
auth: {
authConfig: '權限配置',

View File

@ -81,10 +81,10 @@ export default {
any: '随便填',
thirdparty: '第三方登录',
thirdpartyTips: '本地不能模拟,请结合自己业务进行模拟!!!',
expires: '登录token过期,请重新登录',
tokenError: 'token错误,请重新登录',
username_error: '请输入正确的ID',
password_error: '密码不小于8位'
expires: '登录信息过期,请重新登录',
tokenError: '登陆信息错误,请重新登录',
username_error: '请输入正确的 ID',
password_error: '密码不小于 8 位'
},
commons: {
close: '关闭',
@ -268,6 +268,10 @@ export default {
not_equals: '不等于',
between: '之间',
current_user: '是当前用户'
},
message_box: {
alert: '警告',
confirm: '确认'
}
},
monitor: '监控',
@ -482,13 +486,12 @@ export default {
create: '创建组织',
modify: '修改组织',
delete: '删除组织',
delete_confirm: '删除该组织会关联删除该组织下的所有资源(如:相关工作空间,项目,测试用例等),确定要删除吗?',
delete_confirm: '删除该组织会关联删除该组织的下属组织,确定要删除吗?',
input_name: '请输入组织名称',
select_organization: '请选择组织',
search_by_name: '根据名称搜索',
special_characters_are_not_supported: '格式错误(不支持特殊字符,且不能以\'-\'开头结尾)',
select: '选择组织',
delete_warning: '删除该组织将同步删除该组织下所有相关工作空间和相关工作空间下的所有项目,以及项目中的所有用例、接口测试、性能测试等,确定要删除吗?'
select: '选择组织'
},
system_parameter_setting: {
mailbox_service_settings: '邮件设置',
@ -986,7 +989,8 @@ export default {
loginLogo: '登录页面头部logo',
loginImage: '登录页面右侧图片',
loginTitle: '登录页面标题',
title: '系统名称'
title: '系统名称',
advice_size: '建议图片大小'
},
auth: {
authConfig: '权限配置',

View File

@ -90,11 +90,15 @@ div:focus {
width: 50% !important;
.el-dialog__header{
background-color: #f4f4f5;
// background-color: #f4f4f5;
padding: 10px 20px !important;
.el-dialog__headerbtn {
top: 15px !important;
}
}
.el-dialog__body{
padding: 1px 20px !important;
padding: 1px 15px !important;
}
}

View File

@ -19,6 +19,10 @@
// color: rgb(191, 203, 217);
color: rgba(255,255,255,0.87);
float: left;
img{
width: auto;
max-height: 45px;
}
}
.el-menu {
float: left;

View File

@ -1,7 +1,4 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
export function timeSection(date, type) {
if (!date) {
return null
@ -221,6 +218,35 @@ export function formatCondition(param) {
}
return result
}
/**
* 驼峰转下划线
* @param {*} name
* @returns
*/
export function toLine(name) {
return name.replace(/([A-Z])/g, '_$1').toLowerCase()
}
export function addOrder(order, orders) {
order.field = toLine(order.field)
if (order.value.startsWith('desc')) {
order.value = 'desc'
} else {
order.value = 'asc'
}
orders = orders || []
for (let index = 0; index < orders.length; index++) {
const element = orders[index]
if (order.field === element.field) {
orders[index] = order
return
}
}
orders.push(order)
}
export function formatOrders(orders) {
return orders.map(order => order.field + ' ' + order.value)
}
export function formatQuickCondition(param, quickField) {
let quickObj = null

View File

@ -1,7 +1,7 @@
import { MessageBox, Message } from 'element-ui'
import i18n from '@/lang'
export const $alert = (message, callback, options) => {
const title = i18n.t('common.message_box.alert')
const title = i18n.t('commons.message_box.alert')
MessageBox.alert(message, title, options).then(() => {
callback()
})
@ -14,7 +14,7 @@ export const $confirm = (message, callback, options = {}) => {
type: 'warning',
...options
}
const title = i18n.t('common.message_box.confirm')
const title = i18n.t('commons.message_box.confirm')
MessageBox.confirm(message, title, defaultOptions).then(() => {
callback()
})

View File

@ -445,6 +445,7 @@ export default {
},
close() {
this.$refs['groupForm'].resetFields()
this.editGroup = false
this.groupForm = {
name: '',

View File

@ -120,17 +120,24 @@ export default {
save() {
// console.log(this.checkTableList);
// console.log(this.scene);
let ds = {}
this.options.forEach(ele => {
if (ele.id === this.dataSource) {
ds = ele
}
})
const sceneId = this.param.id
const dataSourceId = this.dataSource
const tables = []
const mode = this.mode
this.checkTableList.forEach(function(name) {
tables.push({
name: name,
name: ds.name + '_' + name,
sceneId: sceneId,
dataSourceId: dataSourceId,
type: 'db',
mode: parseInt(mode)
mode: parseInt(mode),
info: JSON.stringify({ table: name })
})
})
post('/dataset/table/batchAdd', tables).then(response => {

View File

@ -458,6 +458,7 @@ export default {
},
close() {
this.$refs['groupForm'].resetFields()
this.editGroup = false
this.groupForm = {
name: '',

View File

@ -180,9 +180,13 @@ export default {
margin-top: 20px;
}
img{
width: 240px;
/*width: 240px;*/
width: auto;
max-height: 60px;
@media only screen and (max-width: 1280px) {
width: 200px;
/*width: 200px;*/
width: auto;
max-height: 50px;
}
}
}

View File

@ -127,7 +127,7 @@
:in-draw="false"
/>
</filter-dialog>
<div style="text-align: end !important;margin: 0 15px !important;">
<div style="text-align: end !important;margin: 0 15px 10px !important;">
<span slot="footer">
<el-button size="mini" @click="cancelFilter">{{ $t('commons.cancel') }}</el-button>
<el-button :disabled="!currentFilterCom.options.attrs.fieldId" type="primary" size="mini" @click="sureFilter">{{ $t('commons.confirm') }}</el-button>

View File

@ -401,7 +401,10 @@ export default {
},
loadTable(sceneId) {
loadTable({ sceneId: sceneId, sort: 'type asc,create_time desc,name asc' }).then(res => {
this.sceneDatas = res.data
res && res.data && (this.sceneDatas = res.data.map(tb => {
tb.type = 'db'
return tb
}))
})
},
@ -518,7 +521,7 @@ export default {
.ms-main-container {
height: 100%;
min-height: 400px;
padding: 5px 10px;
}
.filter-field {
@ -585,23 +588,32 @@ export default {
}
.filter-content {
height: calc(50vh - 130px);
height: calc(50vh - 120px);
top: 160px;
}
.filter-dialog-tabs {
border: 1px solid #E6E6E6;
padding: 10px;
height: 100%;
>>> div.el-tabs__content {
height: calc(100% - 55px);
}
}
.filter-common {
margin: 10px 10px;
margin: 10px 5px;
}
.component-header {
margin: 20px 10px !important;
margin: 5px 5px 15px;
}
.component-result-content {
height: calc(50vh - 150px);
overflow-y: auto;
}
.link-text {

View File

@ -99,7 +99,7 @@ export default {
padding-top: 0px;
padding-bottom: 0px;
position: relative;
height: 940px;
// height: 940px;
max-height: 976px;
}
.filter-header {

View File

@ -115,7 +115,7 @@
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-paperclip" :command="beforeClickMore('link',data,node)">
{{ $t('panel.create_public_links') }}
</el-dropdown-item>
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-paperclip" :command="beforeClickMore('toDefaultPanel',data,node)">
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-copy-document" :command="beforeClickMore('toDefaultPanel',data,node)">
{{ $t('panel.to_default_panel') }}
</el-dropdown-item>
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)">

View File

@ -29,10 +29,10 @@
<el-input v-model="form.configuration.username" autocomplete="off" :disabled="formType=='modify'" />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.password')" prop="configuration.password">
<el-input v-model="form.configuration.password" autocomplete="off" show-password />
<el-input v-model="form.configuration.password" autocomplete="off" show-password />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.port')" prop="configuration.port">
<el-input v-model="form.configuration.port" autocomplete="off" />
<el-input v-model="form.configuration.port" autocomplete="off" />
</el-form-item>
<el-form-item>

View File

@ -8,6 +8,7 @@
:pagination-config="paginationConfig"
@select="select"
@search="search"
@sort-change="sortChange"
>
<template #toolbar>
<el-button v-permission="['user:add']" icon="el-icon-circle-plus-outline" @click="create">{{ $t('user.create') }}</el-button>
@ -15,12 +16,12 @@
</template>
<el-table-column prop="username" label="ID" />
<el-table-column prop="nickName" :label="$t('commons.nick_name')" />
<el-table-column prop="nickName" sortable="custom" :label="$t('commons.nick_name')" />
<el-table-column prop="gender" :label="$t('commons.gender')" />
<el-table-column :show-overflow-tooltip="true" prop="phone" :label="$t('commons.phone')" />
<el-table-column :show-overflow-tooltip="true" prop="email" :label="$t('commons.email')" />
<el-table-column :show-overflow-tooltip="true" prop="dept" :label="$t('commons.organization')">
<el-table-column :show-overflow-tooltip="true" prop="dept" sortable="custom" :label="$t('commons.organization')">
<template slot-scope="scope">
<div>{{ scope.row.dept && scope.row.dept.deptName }}</div>
</template>
@ -43,12 +44,12 @@
</div>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')">
<el-table-column prop="status" sortable="custom" :label="$t('commons.status')">
<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')">
<el-table-column prop="createTime" sortable="custom" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
@ -163,7 +164,7 @@ import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
// import { checkPermission } from '@/utils/permission'
import { formatCondition, formatQuickCondition } from '@/utils/index'
import { formatCondition, formatQuickCondition, addOrder, formatOrders } 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'
@ -295,7 +296,9 @@ export default {
edit: ['user:edit'],
del: ['user:del'],
editPwd: ['user:editPwd']
}
},
orderConditions: [],
last_condition: null
}
},
mounted() {
@ -305,13 +308,23 @@ export default {
},
methods: {
sortChange({ column, prop, order }) {
if (prop === 'dept') {
prop = 'deptId'
}
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.search(this.last_condition)
},
select(selection) {
},
search(condition) {
condition = formatQuickCondition(condition, 'username')
this.last_condition = condition
condition = formatQuickCondition(condition, 'nick_name')
const temp = formatCondition(condition)
const param = temp || {}
param['orders'] = formatOrders(this.orderConditions)
const { currentPage, pageSize } = this.paginationConfig
userLists(currentPage, pageSize, param).then(response => {
this.data = response.data.listObject