|
@@ -18,7 +18,7 @@
|
|
|
</template>
|
|
|
<template slot-scope="{ row }" slot="action">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <i-switch true-color="#13ce66"></i-switch>
|
|
|
+ <i-switch true-color="#13ce66" :value="hasAuth(row.id)" :before-change="handleBeforeChange" @on-change="onSwitchChange(row,$event)"></i-switch>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Table>
|
|
@@ -34,6 +34,7 @@
|
|
|
</div>
|
|
|
<p v-if="!curTeacher && hasSearchResult" class="search-none">暂未查询到相关结果</p>
|
|
|
<p v-if="hasSearchResult" class="re-search" @click="onReSearch">重新搜索</p>
|
|
|
+ <Button type="success" v-if="hasSearchResult" @click="doShare">确认分享</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -112,7 +113,7 @@
|
|
|
if (res.code == 0) {
|
|
|
this.$Message.error('無法取得使用者資料')
|
|
|
} else {
|
|
|
- this.teacherList = this.$store.state.user.schoolUserList.filter(i => i.status === 'join')
|
|
|
+ this.teacherList = this.$store.state.user.schoolUserList.filter(i => i.status === 'join' && i.id !== this.$store.state.userInfo.TEAMModelId)
|
|
|
this.originList = JSON.parse(JSON.stringify(this.teacherList))
|
|
|
}
|
|
|
},
|
|
@@ -151,11 +152,72 @@
|
|
|
this.searchIdVal = ''
|
|
|
this.curTeacher = null
|
|
|
this.hasSearchResult = false
|
|
|
+ },
|
|
|
+ /* 修改共编权限前回调 */
|
|
|
+ handleBeforeChange(){
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: '修改确认',
|
|
|
+ content: '确认修改当前用户的共编状态?',
|
|
|
+ onOk: () => {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 修改共编权限 */
|
|
|
+ onSwitchChange(val,e){
|
|
|
+ let curVolume = this.$parent.$parent.curVolume
|
|
|
+ this.$api.syllabus.ShareTree({
|
|
|
+ "school": curVolume.school,
|
|
|
+ "scope": curVolume.scope,
|
|
|
+ "tmdInfo": [
|
|
|
+ {
|
|
|
+ "tmdid": val.id,
|
|
|
+ "tmdname": val.name
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "coedit": true,
|
|
|
+ "share": false,
|
|
|
+ "issuer": this.$store.state.userInfo.TEAMModelId,
|
|
|
+ "opt": e ? 'add' : 'del',
|
|
|
+ "syllabusId": this.nodeInfo.id,
|
|
|
+ "syllabusName": this.nodeInfo.title,
|
|
|
+ "volumeId": curVolume.id,
|
|
|
+ "volumeName": curVolume.name
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code === 200){
|
|
|
+ this.$Message.success('操作成功!')
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ this.$Message.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /* 分享课纲操作 */
|
|
|
+ doShare(){
|
|
|
+ console.log(this.curTeacher);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.isSchool && this.getAllTeacher()
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ hasAuth(){
|
|
|
+ return id => {
|
|
|
+ if(!this.nodeInfo.auth){
|
|
|
+ return false
|
|
|
+ }else{
|
|
|
+ let matchItem = this.nodeInfo.auth.filter(i => i.tmdid === id)
|
|
|
+ console.log(matchItem)
|
|
|
+ if(matchItem.length && matchItem[0].coedit){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
node: {
|
|
|
handler(n, o) {
|
|
@@ -211,7 +273,7 @@
|
|
|
}
|
|
|
|
|
|
.id-search{
|
|
|
- height: 400px;
|
|
|
+ min-height: 400px;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|