Commit d5e87c97 authored by 黄奎's avatar 黄奎

页面修改

parent 56e662bf
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<template v-if="multiple"> <template v-if="multiple">
<q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText" <q-select filled v-model="resultObj" :options="selectList" clearable @clear="clearData()" :label="tipText"
:multiple="multiple" emit-value map-options> :multiple="multiple" emit-value map-options>
<template v-slot:option="scope"> <template v-slot:option="scope">
<q-item v-if="scope.index==-1"> <q-item v-if="scope.index==-1">
<q-item-section> <q-item-section>
<q-tree :nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey" <q-tree :nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey"
...@@ -117,23 +117,20 @@ ...@@ -117,23 +117,20 @@
this.setTreeCheckNode() this.setTreeCheckNode()
}, },
//有默认值 //有默认值
defaultArray: { defaultArray(newValue) {
handler(newValue) { this.chooseTreeNodeArray = [];
this.chooseTreeNodeArray = []; if (this.defaultArray && this.defaultArray.length > 0) {
if (this.defaultArray && this.defaultArray.length > 0) { this.defaultArray.forEach(item => {
this.defaultArray.forEach(item => { if (item != '') {
if (item != '') { if (this.multiple) {
if (this.multiple) { this.chooseTreeNodeArray.push(item)
this.chooseTreeNodeArray.push(item) } else {
} else { this.chooseTreeNodeArray = [item];
this.chooseTreeNodeArray = [item];
}
} }
}) }
} })
this.setTreeCheckNode(); }
}, this.setTreeCheckNode();
immediate: true
}, },
resultObj(val) { resultObj(val) {
var resultStr = ""; var resultStr = "";
......
...@@ -11,20 +11,20 @@ ...@@ -11,20 +11,20 @@
class="col-6 q-pr-lg q-pb-lg" label="助教名称" :rules="[val => !!val || '请填写助教姓名']" /> class="col-6 q-pr-lg q-pb-lg" label="助教名称" :rules="[val => !!val || '请填写助教姓名']" />
<q-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id" <q-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id"
ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pb-lg" emit-value ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pb-lg" emit-value
map-options @input="schoolChagne" /> map-options @input="schoolChagne" />
<q-input type="tel" filled stack-label maxlength="20" :dense="false" v-model="objOption.AssistTel" <q-input type="tel" filled stack-label maxlength="20" :dense="false" v-model="objOption.AssistTel"
ref="AssistTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" :rules="[val => !!val || '请填写助教联系电话']" /> ref="AssistTel" class="col-6 q-pr-lg q-pb-lg" label="联系电话" :rules="[val => !!val || '请填写助教联系电话']" />
<selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString" <selectTree :treeData='DeptList' :defaultArray="returnString" nodeKey="DeptId" :multiple="false"
nodeKey="DeptId" :multiple="false" labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild" classStr="col-6 q-pb-lg">
@getChild="getChild" classStr="col-6 q-pr-lg q-pb-lg"></selectTree> </selectTree>
<q-select filled stack-label option-value="PostId" option-label="PostName" v-model="objOption.Post_Id" <q-select filled stack-label option-value="PostId" option-label="PostName" v-model="objOption.Post_Id"
ref="Post_Id" :options="PostList" label="岗位" :dense="false" class="col-6 q-pb-lg q-pb-lg" emit-value ref="Post_Id" :options="PostList" label="岗位" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options /> map-options />
<div class="col-6 q-pb-lg"> <div class="col-6 q-pb-lg">
<q-uploader style="display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat" <q-uploader style="display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat"
:style="{'background-image':'url(' + objOption.AssistIcon + ')'}" max-files="1" hide-upload-btn :style="{'background-image':'url(' + objOption.AssistIcon + ')'}" max-files="1" hide-upload-btn
@rejected="onRejected" label="助教头像" accept=".jpg, image/*" auto-upload @rejected="onRejected" label="助教头像" accept=".jpg, image/*" auto-upload :factory="uploadFile"
:factory="uploadFile" no-thumbnails> no-thumbnails>
</q-uploader> </q-uploader>
</div> </div>
</div> </div>
...@@ -130,14 +130,17 @@ ...@@ -130,14 +130,17 @@
//获取部门结构树 //获取部门结构树
queryDeptTree() { queryDeptTree() {
var msg = { var msg = {
School_Id: 0 School_Id: -1
}; };
if (this.objOption.School_Id && this.objOption.School_Id != '') { if (this.objOption.School_Id != '' && this.objOption.School_Id >= 0) {
msg.School_Id = this.objOption.School_Id; msg.School_Id = this.objOption.School_Id;
} }
getDeptTree(msg).then(res => { getDeptTree(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.DeptList = res.Data; this.DeptList = res.Data;
if (this.objOption.Dept_Id) {
this.returnString.push(this.objOption.Dept_Id.toString());
}
} }
}) })
}, },
...@@ -171,7 +174,7 @@ ...@@ -171,7 +174,7 @@
this.objOption.AssistIntro = this.saveObj.AssistIntro; this.objOption.AssistIntro = this.saveObj.AssistIntro;
this.objOption.Dept_Id = this.saveObj.Dept_Id; this.objOption.Dept_Id = this.saveObj.Dept_Id;
this.objOption.Post_Id = this.saveObj.Post_Id; this.objOption.Post_Id = this.saveObj.Post_Id;
if (this.objOption.School_Id) { if (this.objOption.School_Id>=0) {
this.queryDeptTree(); this.queryDeptTree();
} }
if (this.saveObj.Dept_Id) { if (this.saveObj.Dept_Id) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment