Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2021-09-27 16:54:17 +08:00
commit bc23fb6306
11 changed files with 52 additions and 15 deletions

View File

@ -70,12 +70,12 @@ public class AuthServer implements AuthApi {
DataEaseException.throwException(validateResult.getMsg());
}
XpackLdapUserEntity ldapUserEntity = validateResult.getData();
SysUserEntity user = authUserService.getUserByName(username);
SysUserEntity user = authUserService.getLdapUserByName(username);
if(ObjectUtils.isEmpty(user) || ObjectUtils.isEmpty(user.getUserId())) {
LdapAddRequest ldapAddRequest = new LdapAddRequest();
ldapAddRequest.setUsers(new ArrayList<XpackLdapUserEntity>(){{add(ldapUserEntity);}});
ldapAddRequest.setEnabled(1L);
ldapAddRequest.setDeptId(1L);
// ldapAddRequest.setDeptId(1L);
ldapAddRequest.setRoleIds(new ArrayList<Long>(){{add(2L);}});
sysUserService.validateExistUser(ldapUserEntity.getUserName(), ldapUserEntity.getEmail());
sysUserService.saveLdapUsers(ldapAddRequest);

View File

@ -13,6 +13,8 @@ public interface AuthUserService {
SysUserEntity getUserByName(String username);
SysUserEntity getLdapUserByName(String username);
SysUserEntity getUserBySub(String sub);
List<String> roles(Long userId);

View File

@ -52,6 +52,12 @@ public class AuthUserServiceImpl implements AuthUserService {
return authMapper.findUserByName(username);
}
@Override
public SysUserEntity getLdapUserByName(String username) {
return authMapper.findLdapUserByName(username);
}
@Override
public SysUserEntity getUserBySub(String sub) {
return authMapper.findUserBySub(sub);

View File

@ -25,6 +25,8 @@ public interface AuthMapper {
SysUserEntity findUserByName(@Param("username") String username);
SysUserEntity findLdapUserByName(@Param("username") String username);
SysUserEntity findUserBySub(@Param("sub") String sub);

View File

@ -28,6 +28,10 @@
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin from sys_user where username = #{username}
</select>
<select id="findLdapUserByName" resultMap="baseMap">
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin from sys_user a where username = #{username} and a.from = 1
</select>
<select id="findUserBySub" resultMap="baseMap">
select user_id, username,nick_name, dept_id, password, enabled,email, phone, language ,is_admin from sys_user where sub = #{sub}
</select>

View File

@ -12,7 +12,7 @@
<el-dropdown-item icon="el-icon-arrow-up" @click.native="upComponent">{{ $t('panel.upComponent') }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-arrow-down" @click.native="downComponent">{{ $t('panel.downComponent') }}</el-dropdown-item>
<el-dropdown-item v-if="'view'===curComponent.type" icon="el-icon-link" @click.native="linkageSetting">{{ $t('panel.linkage_setting') }}</el-dropdown-item>
<el-dropdown-item v-if="'de-tabs'===curComponent.type" icon="el-icon-link" @click.native="addTab">新增Tab</el-dropdown-item>
<el-dropdown-item v-if="'de-tabs'===curComponent.type" icon="el-icon-link" @click.native="addTab">{{ $t('panel.add_tab') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@ -87,13 +87,13 @@ export default {
paste() {
this.$store.commit('paste', true)
this.$store.commit('recordSnapshot','paste')
this.$store.commit('recordSnapshot', 'paste')
},
deleteComponent() {
this.deleteCurCondition()
this.$store.commit('deleteComponent')
this.$store.commit('recordSnapshot','deleteComponent')
this.$store.commit('recordSnapshot', 'deleteComponent')
this.$store.commit('setCurComponent', { component: null, index: null })
},
@ -106,22 +106,22 @@ export default {
upComponent() {
this.$store.commit('upComponent')
this.$store.commit('recordSnapshot','upComponent')
this.$store.commit('recordSnapshot', 'upComponent')
},
downComponent() {
this.$store.commit('downComponent')
this.$store.commit('recordSnapshot','downComponent')
this.$store.commit('recordSnapshot', 'downComponent')
},
topComponent() {
this.$store.commit('topComponent')
this.$store.commit('recordSnapshot','topComponent')
this.$store.commit('recordSnapshot', 'topComponent')
},
bottomComponent() {
this.$store.commit('bottomComponent')
this.$store.commit('recordSnapshot','bottomComponent')
this.$store.commit('recordSnapshot', 'bottomComponent')
},
linkageSetting() {
debugger

View File

@ -46,12 +46,16 @@
:append-to-body="true"
:visible.sync="dialogVisible"
width="30%"
:show-close="false"
:close-on-click-modal="false"
center
>
<el-input
v-model="textarea"
type="textarea"
:rows="2"
maxlength="10"
show-word-limit
:placeholder="$t('dataset.input_content')"
/>
<span slot="footer" class="dialog-footer">
@ -66,6 +70,8 @@
:visible.sync="viewDialogVisible"
width="20%"
height="400px"
:show-close="false"
:close-on-click-modal="false"
center
>
<div style="width: 100%;min-height: 250px; max-height: 300px; overflow-y: auto;">
@ -251,8 +257,8 @@ export default {
}
}
}
.de-tab-i {
transition: 0.3s;
/* .de-tab-i {
transition: 0.1s;
opacity: 0;
transform: translateY(100%);
}
@ -260,7 +266,7 @@ export default {
.de-tab-drop:hover .de-tab-i {
opacity: 1;
transform: translateY(0);
}
} */
.de-tab-content {
width: 100%;
height: 100%;

View File

@ -1257,6 +1257,7 @@ export default {
upComponent: 'Up One Level',
downComponent: 'Down One Level',
linkage_setting: 'Linkage Setting',
add_tab: 'Add Tab',
open_aided_design: 'Open Component Aided Design',
close_aided_design: 'Close Component Aided Design',
open_style_design: 'Open Style Design',

View File

@ -1260,6 +1260,7 @@ export default {
upComponent: '上移',
downComponent: '下移',
linkage_setting: '聯動設置',
add_tab: '新增Tab',
open_aided_design: '打開組件輔助設計',
close_aided_design: '關閉組件輔助設計',
open_style_design: '打開樣式設計',

View File

@ -1265,6 +1265,7 @@ export default {
upComponent: '上移',
downComponent: '下移',
linkage_setting: '联动设置',
add_tab: '新增Tab',
open_aided_design: '打开组件辅助设计',
close_aided_design: '关闭组件辅助设计',
open_style_design: '打开样式设计',

View File

@ -36,7 +36,6 @@
@check="checkChanged"
@node-drag-end="dragEnd"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span>
@ -84,7 +83,8 @@ export default {
defaultExpandedKeys: [],
defaultProps: {
children: 'children',
label: 'name'
label: 'name',
disabled: 'disabled'
},
data: [],
showdetail: false,
@ -114,7 +114,11 @@ export default {
const param = {}
this.loading = true
tree(param).then(res => {
this.data = res.data
const nodeDatas = res.data
if (this.selectModel) {
this.setParentDisable(nodeDatas)
}
this.data = nodeDatas
this.loading = false
})
},
@ -156,6 +160,16 @@ export default {
const nodes = this.$refs.templateTree.getCheckedNodes(true, false)
return nodes
},
setParentDisable(nodes) {
nodes.forEach(node => {
if (node.type === 'group') {
node.disabled = true
}
if (node.children && node.children.length > 0) {
this.setParentDisable(node.children)
}
})
},
viewComponentInfo() {
let component
//