update code

main
haha 2024-05-26 00:36:15 +08:00
parent 1756bc5aa6
commit e087575672
6 changed files with 30 additions and 12 deletions

View File

@ -39,9 +39,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_project?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8 url: jdbc:mysql://62.234.3.186:3306/yanzhu_project?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root username: root
password: Sxyanzhu@cf password: Sxyanzhu@cf123
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

View File

@ -233,7 +233,7 @@ public class SysDeptServiceImpl implements ISysDeptService
dept.setLevel(2); dept.setLevel(2);
dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
int id=deptMapper.insertDept(dept); int id=deptMapper.insertDept(dept);
String[] subDepts="成本部,行政部,工程部".split(","); String[] subDepts="物设部,工程部,商务部,财务部,安质部,领导班子".split(",");
for(String it:subDepts){ for(String it:subDepts){
SysDept dpt=new SysDept(); SysDept dpt=new SysDept();
dpt.setParentId(dept.getDeptId()); dpt.setParentId(dept.getDeptId());
@ -263,7 +263,7 @@ public class SysDeptServiceImpl implements ISysDeptService
dept.setLevel(300); dept.setLevel(300);
dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
int id=deptMapper.insertDept(dept); int id=deptMapper.insertDept(dept);
String[] subDepts="科技部,采购部,商务部,工程部,财务部".split(","); String[] subDepts="物设部,工程部,领导班子".split(",");
for(String it:subDepts){ for(String it:subDepts){
SysDept dpt=new SysDept(); SysDept dpt=new SysDept();
dpt.setParentId(dept.getDeptId()); dpt.setParentId(dept.getDeptId());

View File

@ -425,14 +425,19 @@ public class SysUserServiceImpl implements ISysUserService
List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length); List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
for (Long roleId : roleIds) for (Long roleId : roleIds)
{ {
if(roleId==null){
continue;
}
SysUserRole ur = new SysUserRole(); SysUserRole ur = new SysUserRole();
ur.setUserId(userId); ur.setUserId(userId);
ur.setRoleId(roleId); ur.setRoleId(roleId);
list.add(ur); list.add(ur);
} }
if(list.size()>0){
userRoleMapper.batchUserRole(list); userRoleMapper.batchUserRole(list);
} }
} }
}
/** /**
* ID * ID

View File

@ -56,7 +56,7 @@
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2023 yanZhu.vip All Rights Reserved.</span> <span>Copyright © 2023-2024 yanZhu.vip All Rights Reserved.</span>
</div> </div>
</div> </div>
</template> </template>

View File

@ -61,7 +61,7 @@
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-register-footer"> <div class="el-register-footer">
<span>Copyright © 2018-2023 yanZhu.vip All Rights Reserved.</span> <span>Copyright © 2023-2024 yanZhu.vip All Rights Reserved.</span>
</div> </div>
</div> </div>
</template> </template>

View File

@ -128,7 +128,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="归属部门" prop="deptId"> <el-form-item label="归属部门" prop="deptId">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" @select="doInputDept"/> <treeselect ref="treeSel"v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" @select="doInputDept"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -158,7 +158,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="角色"> <el-form-item label="角色" prop="roleId">
<el-select v-model="form.roleId" placeholder="请选择角色"> <el-select v-model="form.roleId" placeholder="请选择角色">
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
:disabled="item.status == 1"></el-option> :disabled="item.status == 1"></el-option>
@ -332,6 +332,7 @@ export default {
} }
}, },
created() { created() {
window.x99=this
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
this.getConfigKey("sys.user.initPassword").then(response => { this.getConfigKey("sys.user.initPassword").then(response => {
@ -486,6 +487,18 @@ export default {
this.open = true; this.open = true;
this.title = "修改用户"; this.title = "修改用户";
this.form.password = ""; this.form.password = "";
setTimeout(()=>{
let node=this.$refs.treeSel.getNode(this.form.deptId);
this.$refs.treeSel.select(node);
this.doInputDept(node.raw);
const func=p=>{
p.isExpanded=true;
if(p.parentNode){
func(p.parentNode);
}
};
func(node);
},400);
}); });
}, },
/** 重置密码按钮操作 */ /** 重置密码按钮操作 */