update code
parent
e62220744c
commit
cac64f79d5
|
@ -49,7 +49,7 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh_test_2024?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
url: jdbc:mysql://cd-cynosdbmysql-grp-9rqrhxsm.sql.tencentcdb.com:27981/yanzhu_jh_test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: Sxyanzhu@cf
|
password: Sxyanzhu@cf
|
||||||
#url: jdbc:mysql://192.168.126.19:3306/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
#url: jdbc:mysql://192.168.126.19:3306/yanzhu_jh?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="部门" prop="deptid">
|
<el-form-item label="部门" prop="deptid">
|
||||||
<treeselect v-model="form.deptid" :options="deptOptions" :show-count="true"
|
<treeselect v-model="form.deptid" :options="deptOptions" :show-count="true"
|
||||||
placeholder="请选择归属部门" @select="doDeptChange(0)" />
|
placeholder="请选择归属部门" @select="doDeptSelect" />
|
||||||
<!--
|
<!--
|
||||||
<el-select v-model="form.deptid" filterable placeholder="请选择单位" style="width: 100%;"
|
<el-select v-model="form.deptid" filterable placeholder="请选择单位" style="width: 100%;"
|
||||||
@change="doDeptChange()">
|
@change="doDeptChange()">
|
||||||
|
@ -125,13 +125,29 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getDeptTree() {
|
getDeptTree() {
|
||||||
deptTreeSelect().then(response => {
|
deptTreeSelect().then(response => {
|
||||||
this.deptOptions = response.data;
|
let tmps=response.data;
|
||||||
|
let objs=response.data[0].children.filter(d=>d.label.indexOf("产业")>=0);
|
||||||
|
tmps[0].children=tmps[0].children.filter(d=>d.label.indexOf("分包")==-1 && d.label.indexOf("产业")==-1);
|
||||||
|
if(objs.length>0){
|
||||||
|
let names="产发城投,产发置业,产发投资,产发绿能,产发智能,产发医疗,产业发展部".split(",");
|
||||||
|
objs[0].children=objs[0].children.filter(d=>names.indexOf(d.label)>=0);
|
||||||
|
objs[0].children.forEach(d=>{
|
||||||
|
delete d.children;
|
||||||
|
});
|
||||||
|
tmps=[...objs[0].children,...tmps[0].children];
|
||||||
|
}
|
||||||
|
this.deptOptions = tmps;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
doImageInput() {
|
doImageInput() {
|
||||||
this.$refs.fiImage.clearValidate()
|
this.$refs.fiImage.clearValidate()
|
||||||
},
|
},
|
||||||
|
doDeptSelect(){
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.doDeptChange(0);
|
||||||
|
},400);
|
||||||
|
},
|
||||||
doDeptChange(init) {
|
doDeptChange(init) {
|
||||||
let param = {
|
let param = {
|
||||||
deptId: this.form.deptid
|
deptId: this.form.deptid
|
||||||
|
@ -148,18 +164,8 @@ export default {
|
||||||
this.form.authorName="";
|
this.form.authorName="";
|
||||||
this.form.authorPhone="";
|
this.form.authorPhone="";
|
||||||
}else if(init==1){
|
}else if(init==1){
|
||||||
let user=this.$store.state.user;
|
this.form.authorName="";
|
||||||
if(user){
|
this.form.authorPhone="";
|
||||||
let tmps=this.userList.filter(d=>d.userId==user.userId);
|
|
||||||
if(tmps.length>0){
|
|
||||||
let tmp=tmps[0];
|
|
||||||
let phone=tmp.phonenumber;
|
|
||||||
if(!phone){
|
|
||||||
phone=tmp.userId+" --- ";
|
|
||||||
}
|
|
||||||
this.form.authorPhone=phone;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (init==2) {
|
else if (init==2) {
|
||||||
if (this.oldData && this.userList.length > 0) {
|
if (this.oldData && this.userList.length > 0) {
|
||||||
|
@ -210,20 +216,16 @@ export default {
|
||||||
return { name: d, url: d };
|
return { name: d, url: d };
|
||||||
})
|
})
|
||||||
this.form.content = row.content;
|
this.form.content = row.content;
|
||||||
} else {
|
} else {
|
||||||
let user=this.$store.state.user;
|
|
||||||
this.form.title = "";
|
this.form.title = "";
|
||||||
this.form.magid = 0;
|
this.form.magid = 0;
|
||||||
this.form.topic = "1";
|
this.form.topic = "1";
|
||||||
this.form.authorName = user?user.nickname:"";
|
this.form.authorName = "";
|
||||||
this.form.authorPhone = "";
|
this.form.authorPhone = "";
|
||||||
this.form.deptid = user && user.dept?user.dept.deptId:"";
|
this.form.deptid = undefined;
|
||||||
this.form.imageUrl = [];
|
this.form.imageUrl = [];
|
||||||
this.form.content = "";
|
this.form.content = "";
|
||||||
this.form.images = "";
|
this.form.images = "";
|
||||||
if(user){
|
|
||||||
this.doDeptChange(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
@ -238,11 +240,15 @@ export default {
|
||||||
let tmps = this.userList.filter(d => d.phonenumber == this.form.authorPhone);
|
let tmps = this.userList.filter(d => d.phonenumber == this.form.authorPhone);
|
||||||
this.form.authorName = tmps.length > 0 ? tmps[0].nickName : "";
|
this.form.authorName = tmps.length > 0 ? tmps[0].nickName : "";
|
||||||
let user=tmps.length>0?tmps[0]:null;
|
let user=tmps.length>0?tmps[0]:null;
|
||||||
|
let depts=this.deptOptions.filter(d=>d.id== this.form.deptid);
|
||||||
|
|
||||||
if(user){
|
if(user){
|
||||||
this.form.authorName=user.nickName;
|
this.form.authorName=user.nickName;
|
||||||
this.form.authorPhone=user.phonenumber;
|
this.form.authorPhone=user.phonenumber;
|
||||||
if(user.dept){
|
if(user.dept){
|
||||||
this.form.deptid=user.dept.deptId;
|
if(depts.length>0 && depts[0].children &&depts[0].children.length>0){
|
||||||
|
this.form.deptid=user.dept.deptId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.oldData && this.oldData.id) {
|
if (this.oldData && this.oldData.id) {
|
||||||
|
|
|
@ -158,6 +158,6 @@ select * from (select a.id,
|
||||||
select COUNT(1) id, a.deptid ,b.dept_name title from base_mag_detail a,sys_dept b where a.deptid=b.dept_id
|
select COUNT(1) id, a.deptid ,b.dept_name title from base_mag_detail a,sys_dept b where a.deptid=b.dept_id
|
||||||
<if test="magid!=null and magid!='' and magid > 0 ">and magid=#{magid}</if>
|
<if test="magid!=null and magid!='' and magid > 0 ">and magid=#{magid}</if>
|
||||||
group by a.deptid,b.dept_name
|
group by a.deptid,b.dept_name
|
||||||
order by count(1) desc
|
order by count(1) desc,a.deptid
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue