|
@@ -9,6 +9,7 @@
|
|
|
<span v-for="(item,index) in cusType" :key="index" @click="tabClick(item.value)" :class="{ active: item.value == listType }" class="cus-type-item pane">
|
|
|
{{item.label}}
|
|
|
</span>
|
|
|
+
|
|
|
<div style="margin-top:0px;float:right;">
|
|
|
<Icon type="md-add" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.addCus')" @click="addCusStatus = true" />
|
|
|
<Icon type="md-trash" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.delCus')" @click="delCourse" />
|
|
@@ -152,7 +153,10 @@
|
|
|
<ListItemMeta @click.native="toClassRecoerd(index)" style="cursor: pointer;">
|
|
|
<div slot="avatar" class="record-poster-wrap" :style="{backgroundImage:`url(${item.poster})`}">
|
|
|
</div>
|
|
|
- <p slot="title" class="record-name" style="padding-left:10px">{{item.name}}</p>
|
|
|
+ <p slot="title" class="record-name" style="padding-left:10px">
|
|
|
+ {{item.name}}
|
|
|
+ <Icon type="md-create" class="edit-ev-name" @click.stop="editRecordName(index)" :title="$t('cusMgt.edRdName')" />
|
|
|
+ </p>
|
|
|
<div slot="description" style="padding-left:10px;margin-top:10px">
|
|
|
<!-- 出席率 -->
|
|
|
<span class="record-info">
|
|
@@ -295,50 +299,58 @@
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
<!-- 创建名单 -->
|
|
|
- <Modal v-model="newSlStatus" width="600" @on-ok="confirmCreateList" :loading="modalLoading">
|
|
|
- <div slot="header">
|
|
|
- <span class="create-list-title">
|
|
|
- {{$t('cusMgt.addStuList')}}
|
|
|
- </span>
|
|
|
+ <Modal v-model="newSlStatus" width="600" footer-hide className="ed-name-modal">
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('cusMgt.addStuList')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <Form label-position="left" :label-width="70" label-colon @submit.native.prevent>
|
|
|
+ <FormItem :label="$t('cusMgt.addListType')">
|
|
|
+ <RadioGroup v-model="type">
|
|
|
+ <Radio label="create">
|
|
|
+ <span>
|
|
|
+ {{$t('cusMgt.addListType1')}}
|
|
|
+ </span>
|
|
|
+ </Radio>
|
|
|
+ <Radio label="select">
|
|
|
+ <span>
|
|
|
+ {{$t('cusMgt.addListType2')}}
|
|
|
+ </span>
|
|
|
+ </Radio>
|
|
|
+ </RadioGroup>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label="$t('cusMgt.name')" v-if="type == 'create'">
|
|
|
+ <Input v-special-char v-model="listName" :placeholder="$t('cusMgt.nameHolder')" style="width: 300px" />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label="$t('cusMgt.listLabel')" v-else>
|
|
|
+ <Select v-model="listId" style="width:300px">
|
|
|
+ <Option v-for="(item,index) in groupList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <span class="create-list-tips">{{$store.state.userInfo.hasSchool ? $t('cusMgt.createTips1') : $t('cusMgt.createTips2')}}</span>
|
|
|
+ <Button :loading="btnLoading" @click="confirmCreateList" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
</div>
|
|
|
- <Form :label-width="80" label-colon @submit.native.prevent>
|
|
|
- <FormItem :label="$t('cusMgt.addListType')">
|
|
|
- <RadioGroup v-model="type">
|
|
|
- <Radio label="create">
|
|
|
- <span>
|
|
|
- {{$t('cusMgt.addListType1')}}
|
|
|
- </span>
|
|
|
- </Radio>
|
|
|
- <Radio label="select">
|
|
|
- <span>
|
|
|
- {{$t('cusMgt.addListType2')}}
|
|
|
- </span>
|
|
|
- </Radio>
|
|
|
- </RadioGroup>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('cusMgt.name')" v-if="type == 'create'">
|
|
|
- <Input v-special-char v-model="listName" :placeholder="$t('cusMgt.nameHolder')" style="width: 300px" />
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('cusMgt.listLabel')" v-else>
|
|
|
- <Select v-model="listId" style="width:300px">
|
|
|
- <Option v-for="(item,index) in groupList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- <span class="create-list-tips">{{$store.state.userInfo.hasSchool ? $t('cusMgt.createTips1') : $t('cusMgt.createTips2')}}</span>
|
|
|
</Modal>
|
|
|
- <Modal v-model="addCusStatus" :title="addCusInfo.id ? $t('cusMgt.editCus') : $t('cusMgt.addCus')" @on-cancel="initCusInfo" @on-ok="confirmAddCus" :loading="modalLoading">
|
|
|
- <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
|
|
|
- <FormItem prop="name" :label="$t('cusMgt.cusName')">
|
|
|
- <Input v-special-char type="text" v-model="addCusInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('cusMgt.cusCode')" prop="no">
|
|
|
- <Input v-special-char type="text" v-model="addCusInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('cusMgt.cusDesc')" prop="desc">
|
|
|
- <Input v-special-char v-model="addCusInfo.desc" type="textarea" :maxlength="200" show-word-limit :autosize="{ minRows: 4, maxRows: 6 }" :placeholder="$t('cusMgt.descHolder')" />
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
+ <!-- 添加或修改课程 -->
|
|
|
+ <Modal v-model="addCusStatus" footer-hide @on-cancel="initCusInfo" className="ed-name-modal">
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{addCusInfo.id ? $t('cusMgt.editCus') : $t('cusMgt.addCus')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
|
|
|
+ <FormItem prop="name" :label="$t('cusMgt.cusName')">
|
|
|
+ <Input v-special-char type="text" v-model="addCusInfo.name" :placeholder="$t('cusMgt.nameHolder')"></Input>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label="$t('cusMgt.cusCode')" prop="no">
|
|
|
+ <Input v-special-char type="text" v-model="addCusInfo.no" :placeholder="$t('cusMgt.codeHolder')"></Input>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem :label="$t('cusMgt.cusDesc')" prop="desc">
|
|
|
+ <Input v-special-char v-model="addCusInfo.desc" type="textarea" :maxlength="200" show-word-limit :autosize="{ minRows: 4, maxRows: 6 }" :placeholder="$t('cusMgt.descHolder')" />
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ <Button :loading="btnLoading" @click="confirmAddCus" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
<Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu">
|
|
|
<!-- 添加学生 -->
|
|
@@ -346,29 +358,32 @@
|
|
|
<!-- 跨校不能添加学生 -->
|
|
|
<TipsInfo v-else-if="addStuStatus" :msg="crossSchool"></TipsInfo>
|
|
|
</Modal>
|
|
|
- <div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
|
|
|
- <div class="qr-code-info" @click.stop>
|
|
|
- <p class="qr-code-title">
|
|
|
- {{$t('cusMgt.qrCodeLabel')}}
|
|
|
- </p>
|
|
|
- <div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:15px 25px 20px 25px;background-color:white;width:330px;margin:auto;">
|
|
|
- </div>
|
|
|
- <p class="qr-code-text">
|
|
|
- (<span style="font-size:17px">{{$t('cusMgt.qrCodeText')}}</span>
|
|
|
- {{stuListNo}})
|
|
|
- </p>
|
|
|
- <p class="invite-url-text" v-show="inviteUrl" @click="copyUrl">
|
|
|
- <Icon type="md-copy" class="copy-link-icon" :title="$t('cusMgt.copyUrl')" />
|
|
|
- <span style="font-size:14px">{{$t('cusMgt.inviteUrl')}}</span>
|
|
|
- <!-- {{inviteUrl}} -->
|
|
|
+ <QrcodeModal v-model="showQrStatus" :config="qrConfig">
|
|
|
+ <!-- 支持自定义内容 -->
|
|
|
+ <p class="qr-code-text">
|
|
|
+ (<span style="font-size:17px">{{$t('cusMgt.qrCodeText')}}</span>
|
|
|
+ {{stuListNo}})
|
|
|
+ </p>
|
|
|
+ </QrcodeModal>
|
|
|
+ <!-- 修改名单名称 -->
|
|
|
+ <Modal v-model="editClassStatus" footer-hide :title="$t('cusMgt.renameListTitle')" className="ed-name-modal">
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('cusMgt.renameListTitle')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <p class="edit-name-label">
|
|
|
+ {{$t('cusMgt.listName')}}
|
|
|
</p>
|
|
|
+ <Input v-model="edName" :placeholder="renameBefore" />
|
|
|
+ <Button :loading="btnLoading" @click="confirmRename" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <Modal v-model="editClassStatus" :title="$t('cusMgt.renameListTitle')" @on-ok="confirmRename">
|
|
|
- {{$t('cusMgt.listName')}}: <Input v-model="edName" :placeholder="renameBefore" style="width: 300px" />
|
|
|
</Modal>
|
|
|
- <Modal v-model="removeListStatus" :title="$t('cusMgt.remvListTitle')" @on-ok="removeStuList">
|
|
|
- <div v-if="removeListStatus" style="padding:20px">
|
|
|
+ <!-- 删除课程名单 -->
|
|
|
+ <Modal v-model="removeListStatus" footer-hide :title="$t('cusMgt.remvListTitle')" @on-ok="removeStuList" className="ed-name-modal">
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('cusMgt.remvListTitle')}}
|
|
|
+ </div>
|
|
|
+ <div v-if="removeListStatus" class="edit-name-content">
|
|
|
<RadioGroup v-model="isPermanent">
|
|
|
<Radio label="remove">
|
|
|
<span>{{$t('cusMgt.justRmList')}}</span>
|
|
@@ -377,23 +392,51 @@
|
|
|
<span>{{$t('cusMgt.permDelList')}}</span>
|
|
|
</Radio>
|
|
|
</RadioGroup>
|
|
|
+ <Button :loading="btnLoading" @click="removeStuList" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
<!-- 快速设置IRS -->
|
|
|
- <Modal v-model="setIrsStatus" :title="$t('cusMgt.editStu')" @on-ok="confirmFastSet">
|
|
|
- <p class="set-irs-tips">{{$t('cusMgt.irsTips1')}}</p>
|
|
|
- <p class="set-irs-tips">{{$t('cusMgt.irsTips2')}}</p>
|
|
|
+ <Modal v-model="setIrsStatus" footer-hide @on-ok="confirmFastSet" className="ed-name-modal">
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('cusMgt.editStu')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <p class="set-irs-tips">{{$t('cusMgt.irsTips1')}}</p>
|
|
|
+ <p class="set-irs-tips">{{$t('cusMgt.irsTips2')}}</p>
|
|
|
+ <Button :loading="btnLoading" @click="confirmFastSet" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
+ </div>
|
|
|
+
|
|
|
</Modal>
|
|
|
<!-- 修改评测名称 -->
|
|
|
- <Modal v-model="editNameStatus" :title="$t('learnActivity.mgtScEv.edName')" @on-ok="confirmEditName" :loading="modalLoading">
|
|
|
- <Input v-model="editName" :placeholder="$t('learnActivity.mgtScEv.edNameHolder')" />
|
|
|
+ <Modal v-model="editNameStatus" className="ed-name-modal" footer-hide>
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('learnActivity.mgtScEv.edName')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <p class="edit-name-label">
|
|
|
+ {{$t('cusMgt.listName')}}
|
|
|
+ </p>
|
|
|
+ <Input v-model="editName" :placeholder="$t('learnActivity.mgtScEv.edNameHolder')" />
|
|
|
+ <Button :loading="btnLoading" @click="confirmEditName" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ <!-- 修改课堂记录名称 -->
|
|
|
+ <Modal v-model="editRdStatus" className="ed-name-modal" footer-hide>
|
|
|
+ <div slot="header" class="modal-header">
|
|
|
+ {{$t('cusMgt.edRdName')}}
|
|
|
+ </div>
|
|
|
+ <div class="edit-name-content">
|
|
|
+ <p class="edit-name-label">
|
|
|
+ {{$t('cusMgt.listName')}}
|
|
|
+ </p>
|
|
|
+ <Input v-model="editName" :placeholder="$t('cusMgt.edRdName')" />
|
|
|
+ <Button :loading="btnLoading" @click="confirmEditRd" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import BlobTool from '@/utils/blobTool.js'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
-import QRCode from 'qrcodejs2'
|
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
|
import StudentList from '@/components/coursemgt/StudentList.vue'
|
|
|
import TeaTable from './TeaTable.vue'
|
|
@@ -416,6 +459,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ qrConfig: {
|
|
|
+ title: this.$t('cusMgt.qrCodeLabel'),
|
|
|
+ url: '',//二维码内容 不用转短网址,组件内部处理
|
|
|
+ shareContent: '',//复制链接内容,支持字符串模板,如果包含网址需要处理好短网址
|
|
|
+ },
|
|
|
+ edRdIndex: 0,
|
|
|
+ editRdStatus: false,
|
|
|
edNameIndex: 0,
|
|
|
editName: '',
|
|
|
editNameStatus: false,
|
|
@@ -579,7 +629,6 @@ export default {
|
|
|
tabName: 'activity',
|
|
|
addCusStatus: false,
|
|
|
addStuStatus: false,
|
|
|
- joinQRcode: undefined,
|
|
|
curCusIndex: 0,
|
|
|
curClassIndex: 0,
|
|
|
courseList: [],
|
|
@@ -615,13 +664,54 @@ export default {
|
|
|
}
|
|
|
return this.$t('cusMgt.listSchoolTips3')
|
|
|
},
|
|
|
+ editRecordName(index) {
|
|
|
+ this.editRdStatus = true
|
|
|
+ this.edRdIndex = index
|
|
|
+ this.editName = this.curRecordList[index]?.name
|
|
|
+ },
|
|
|
editEvName(index) {
|
|
|
this.editNameStatus = true
|
|
|
this.edNameIndex = index
|
|
|
this.editName = this.acList[index]?.name
|
|
|
},
|
|
|
+ // 修改记录名称
|
|
|
+ confirmEditRd() {
|
|
|
+ if (this.editName) {
|
|
|
+ console.log(this.curRecordList[this.edRdIndex])
|
|
|
+ let recordInfo = this.curRecordList[this.edRdIndex]
|
|
|
+ this.btnLoading = true
|
|
|
+ this.$api.lessonRecord.updateLesson({
|
|
|
+ "lesson_id": recordInfo.id,
|
|
|
+ "tmdid": recordInfo.tmdid,
|
|
|
+ "school": recordInfo.school,
|
|
|
+ "scope": recordInfo.scope,
|
|
|
+ "grant_types": [{
|
|
|
+ "grant_type": "up-baseinfo",
|
|
|
+ "data": {
|
|
|
+ "name": this.editName,
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }).then(
|
|
|
+ res => {
|
|
|
+ if (!res.error) {
|
|
|
+ this.$Message.success(this.$t('cusMgt.editOk'))
|
|
|
+ let i = this.recordList.findIndex(item => item.id == recordInfo.id)
|
|
|
+ if (i > -1) {
|
|
|
+ this.$set(this.recordList[i], 'name', this.editName)
|
|
|
+ }
|
|
|
+ this.editRdStatus = false
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(this.$t('learnActivity.mgtScEv.edNameHolder'))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 修改活动名称
|
|
|
confirmEditName() {
|
|
|
if (this.editName) {
|
|
|
+ this.btnLoading = true
|
|
|
this.acList[this.edNameIndex].code = this.acList[this.edNameIndex].code.replace('Exam-', '')
|
|
|
this.$api.learnActivity.updExamEndtime({
|
|
|
id: this.acList[this.edNameIndex].id,
|
|
@@ -641,13 +731,10 @@ export default {
|
|
|
}
|
|
|
).finally(() => {
|
|
|
this.editNameStatus = false
|
|
|
+ this.btnLoading = false
|
|
|
})
|
|
|
} else {
|
|
|
this.$Message.warning(this.$t('learnActivity.mgtScEv.edNameHolder'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- })
|
|
|
}
|
|
|
},
|
|
|
//导出名单
|
|
@@ -853,9 +940,12 @@ export default {
|
|
|
stulist.type = 'teach'
|
|
|
stulist.scope = 'private'
|
|
|
let params = stulist
|
|
|
+ this.btnLoading = true
|
|
|
this.$api.common.upsertGroupInfo(params).then(
|
|
|
res => {
|
|
|
this.$Message.success(this.$t('cusMgt.updOk'))
|
|
|
+ this.btnLoading = false
|
|
|
+ this.editClassStatus = false
|
|
|
this.teaClassList[this.curClassIndex].listName = this.edName
|
|
|
//更新其他课程数据
|
|
|
this.courseListShow.forEach(item => {
|
|
@@ -881,46 +971,6 @@ export default {
|
|
|
this.renameBefore = this.teaClassList[this.curClassIndex].listName
|
|
|
this.editClassStatus = true
|
|
|
},
|
|
|
- async copyUrl() {
|
|
|
- //邀请加入醍摩豆云平台IES教师个人课程
|
|
|
-
|
|
|
- // 课程名称:英语能力检测
|
|
|
- // 课程名单:501班
|
|
|
- // 授课教师:Power
|
|
|
-
|
|
|
- // 快速加入教师个人课程链接:
|
|
|
- // https://www.teammodel.net/joinclass?listName=502%E7%8F%AD&tName=Power&listNo=859738&cusName=%E8%8B%B1%E8%AA%9E%E8%83%BD%E5%8A%9B%E6%AA%A2%E6%B8%AC
|
|
|
-
|
|
|
- // 或登入醍摩豆云平台IES学习主页,输入课程码加入课程:
|
|
|
- // URL:https://www.teammodel.net/login/student
|
|
|
-
|
|
|
- // 输入课程邀请码,加入课程 :859738
|
|
|
-
|
|
|
- let loginUrl = window.location.host
|
|
|
- let tName = this.$store.state.userInfo.name
|
|
|
- let listId = this.teaClassList[this.curClassIndex].stulist
|
|
|
- let listName = this.teaClassList[this.curClassIndex].listName
|
|
|
- let cusName = this.courseListShow[this.curCusIndex].name
|
|
|
- let stulistInfo = this.groupList.find(item => {
|
|
|
- return item.id == listId
|
|
|
- })
|
|
|
- let listNo = stulistInfo.no
|
|
|
- try {
|
|
|
- let shortUrl = await this.$api.getShortUrl(encodeURI(this.inviteUrl)) //暂不替换,等路由处理好了再替换
|
|
|
- let shareText = `${this.$t('cusMgt.inviteInfo1')}\n\n${this.$t('cusMgt.inviteInfo2')}${cusName}\n${this.$t('cusMgt.inviteInfo3')}${listName}\n${this.$t('cusMgt.inviteInfo4')}${tName}\n\n${this.$t('cusMgt.inviteInfo5')}\n${shortUrl.result}\n\n${this.$t('cusMgt.inviteInfo6')}\nURL:https://${loginUrl}/login/student\n${this.$t('cusMgt.inviteInfo7')}${listNo}`
|
|
|
- this.$copyText(shareText).then(
|
|
|
- ok => {
|
|
|
- this.$Message.success(this.$t("settings.copyModal1"))
|
|
|
- },
|
|
|
- fail => {
|
|
|
- this.$Message.error(this.$t("settings.copyModal2"))
|
|
|
- }
|
|
|
- )
|
|
|
- } catch (e) {
|
|
|
- this.$Message.error(this.$t("settings.copyModal2"))
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
initData() {
|
|
|
this.cusType = [
|
|
|
{
|
|
@@ -1371,6 +1421,7 @@ export default {
|
|
|
let index = this.curClassIndex
|
|
|
this.curClassIndex = 0
|
|
|
this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
+ this.btnLoading = true
|
|
|
this.updCusInfo()
|
|
|
if (this.isPermanent == 'delete') {
|
|
|
//删除名单
|
|
@@ -1404,40 +1455,17 @@ export default {
|
|
|
err => {
|
|
|
this.$Message.error(this.$t('teachermgmt.rmvErr'))
|
|
|
}
|
|
|
- )
|
|
|
+ ).finally(() => {
|
|
|
+ this.btnLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
editCus() {
|
|
|
this.addCusInfo = this._.cloneDeep(this.courseListShow[this.curCusIndex])
|
|
|
this.addCusStatus = true
|
|
|
},
|
|
|
- //创建二维码
|
|
|
- createQRCode(url) {
|
|
|
- this.$nextTick(async () => {
|
|
|
- // 此时已经渲染完成
|
|
|
- try {
|
|
|
- let shortUrl = await this.$api.getShortUrl(encodeURI(url)) //暂不替换,等路由处理好了再替换
|
|
|
- if (this.joinQRcode == undefined) {
|
|
|
- let qrcode = new QRCode('qrcode', {
|
|
|
- width: 280, // 设置宽度,单位像素
|
|
|
- height: 280, // 设置高度,单位像素
|
|
|
- // text: encodeURI(url), // 编码处理
|
|
|
- text: shortUrl.result, // 编码处理
|
|
|
- correctLevel: QRCode.CorrectLevel.Q //解决编码后网址太长的问题
|
|
|
- })
|
|
|
- this.joinQRcode = qrcode
|
|
|
- } else {
|
|
|
- this.joinQRcode.clear()
|
|
|
- this.joinQRcode.makeCode(shortUrl.result)
|
|
|
- }
|
|
|
- let dom = document.getElementById('qrcode')
|
|
|
- if (dom) dom.title = ''
|
|
|
- } catch (e) {
|
|
|
- this.$Message.error(this.$t('cusMgt.qrcodeErr'))
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- showQrCode(index) {
|
|
|
+ async showQrCode(index) {
|
|
|
+ let loginUrl = window.location.host
|
|
|
let tName = this.$store.state.userInfo.name
|
|
|
let listId = this.teaClassList[index].stulist
|
|
|
let listName = this.teaClassList[index].listName
|
|
@@ -1446,15 +1474,22 @@ export default {
|
|
|
return item.id == listId
|
|
|
})
|
|
|
if (stulistInfo) {
|
|
|
- this.showQrStatus = true
|
|
|
+ //二维码链接
|
|
|
this.stuListNo = stulistInfo.no
|
|
|
- // //这里需要根据站点动态拼接域名
|
|
|
- console.log(window.location)
|
|
|
let host = window.location.origin
|
|
|
let callbackUrl = `${host}/joinclass?listName=${listName}&tName=${tName}&listNo=${this.stuListNo}&cusName=${cusName}`
|
|
|
this.inviteUrl = callbackUrl
|
|
|
- console.log(callbackUrl)
|
|
|
- this.createQRCode(callbackUrl)
|
|
|
+ this.qrConfig.url = callbackUrl
|
|
|
+
|
|
|
+ // 处理分享内容
|
|
|
+ try {
|
|
|
+ let shortUrl = await this.$api.getShortUrl(encodeURI(this.inviteUrl))
|
|
|
+ let shareText = `${this.$t('cusMgt.inviteInfo1')}\n\n${this.$t('cusMgt.inviteInfo2')}${cusName}\n${this.$t('cusMgt.inviteInfo3')}${listName}\n${this.$t('cusMgt.inviteInfo4')}${tName}\n\n${this.$t('cusMgt.inviteInfo5')}\n${shortUrl.result}\n\n${this.$t('cusMgt.inviteInfo6')}\nURL:https://${loginUrl}/login/student\n${this.$t('cusMgt.inviteInfo7')}${this.stuListNo}`
|
|
|
+ this.qrConfig.shareContent = shareText
|
|
|
+ } catch (e) {
|
|
|
+ this.qrConfig.shareContent = ''
|
|
|
+ }
|
|
|
+ this.showQrStatus = true
|
|
|
} else {
|
|
|
this.$Message.error(this.$t('cusMgt.listExp'))
|
|
|
}
|
|
@@ -1463,17 +1498,9 @@ export default {
|
|
|
confirmCreateList() {
|
|
|
if (!this.listName && this.type == 'create') {
|
|
|
this.$Message.warning(this.$t('cusMgt.nameWarning'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
}
|
|
|
else if (!this.listId && this.type == 'select') {
|
|
|
this.$Message.warning(this.$t('cusMgt.selectListTips'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
}
|
|
|
else if (this.type == 'create') {
|
|
|
let stuList = {
|
|
@@ -1485,6 +1512,7 @@ export default {
|
|
|
leader: this.$store.state.userInfo.TEAMModelId,
|
|
|
members: []
|
|
|
}
|
|
|
+ this.btnLoading = true
|
|
|
this.saveStuList(stuList, true)
|
|
|
}
|
|
|
else if (this.type == 'select') {
|
|
@@ -1499,10 +1527,6 @@ export default {
|
|
|
})
|
|
|
if (res) {
|
|
|
this.$Message.warning(`${res.listName}${this.$t('cusMgt.alreadyExist')}`)
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
} else {
|
|
|
this.courseListShow[this.curCusIndex].schedule.push({
|
|
|
classId: '',
|
|
@@ -1514,6 +1538,7 @@ export default {
|
|
|
students: s.students,
|
|
|
time: []
|
|
|
})
|
|
|
+ this.btnLoading = true
|
|
|
this.updCusInfo()
|
|
|
this.listId = ''
|
|
|
}
|
|
@@ -1554,6 +1579,8 @@ export default {
|
|
|
}
|
|
|
).finally(() => {
|
|
|
this.listLoading = false
|
|
|
+ this.btnLoading = false
|
|
|
+ this.setIrsStatus = false
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -1703,6 +1730,7 @@ export default {
|
|
|
creatorId: this.$store.state.userInfo.schoolCode
|
|
|
}
|
|
|
}
|
|
|
+ this.btnLoading = true
|
|
|
this.$api.courseMgmt.saveOrUpdateCourse(requestData).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
@@ -1732,25 +1760,17 @@ export default {
|
|
|
this.$refs['addCusInfo'].resetFields()
|
|
|
} else {
|
|
|
this.$Message.error(this.addCusInfo.id ? this.$t('cusMgt.editErr') : this.$t('cusMgt.addErr'))
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
}
|
|
|
},
|
|
|
(err) => {
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
+ this.btnLoading = false
|
|
|
}
|
|
|
- )
|
|
|
+ ).finally(() => {
|
|
|
+ this.btnLoading = false
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$Message.error(this.$t('cusMgt.formTips'));
|
|
|
- this.modalLoading = false
|
|
|
- setTimeout(() => {
|
|
|
- this.modalLoading = true
|
|
|
- }, 0)
|
|
|
+ this.btnLoading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1771,6 +1791,7 @@ export default {
|
|
|
}).finally(() => {
|
|
|
this.listLoading = false
|
|
|
this.newSlStatus = false
|
|
|
+ this.btnLoading = false
|
|
|
this.listName = ''
|
|
|
})
|
|
|
},
|
|
@@ -1964,33 +1985,6 @@ export default {
|
|
|
},
|
|
|
activated() {
|
|
|
this.getActivityList()
|
|
|
- // let delId = this.$route.query.delId
|
|
|
- // console.log(this.curAcType)
|
|
|
- // if (delId) {
|
|
|
- // let index, data
|
|
|
- // switch (this.curAcType) {
|
|
|
- // case 'ev':
|
|
|
- // data = this.evList
|
|
|
- // break
|
|
|
- // case 'vote':
|
|
|
- // data = this.voteList
|
|
|
- // break
|
|
|
- // case 'qu':
|
|
|
- // data = this.quList
|
|
|
- // break
|
|
|
- // case 'hw':
|
|
|
- // data = this.hwList
|
|
|
- // break
|
|
|
- // case 'sl':
|
|
|
- // data = this.slList
|
|
|
- // break
|
|
|
- // default:
|
|
|
- // break
|
|
|
- // }
|
|
|
- // if (data) index = data.findIndex(item => item.id === delId)
|
|
|
- // console.log(index)
|
|
|
- // if (index > -1) data.splice(index, 1)
|
|
|
- // }
|
|
|
},
|
|
|
watch: {
|
|
|
'$store.state.userInfo.schoolCode': {
|
|
@@ -2168,7 +2162,7 @@ export default {
|
|
|
<style scoped lang="less">
|
|
|
@import "./MyCourse.less";
|
|
|
</style>
|
|
|
-<style>
|
|
|
+<style lang="less">
|
|
|
.ivu-table-row-hover .item-tools {
|
|
|
display: inline-block;
|
|
|
}
|
|
@@ -2197,5 +2191,8 @@ export default {
|
|
|
}
|
|
|
.class-record-wrap .ivu-list-item:hover {
|
|
|
background: var(--active-item-start);
|
|
|
+ .edit-ev-name {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|