|
@@ -16,6 +16,9 @@
|
|
</div>
|
|
</div>
|
|
<div class="cp-conent" v-if="type == 1">
|
|
<div class="cp-conent" v-if="type == 1">
|
|
<van-field v-model="message" rows="20" autosize type="textarea" placeholder="请输入..." />
|
|
<van-field v-model="message" rows="20" autosize type="textarea" placeholder="请输入..." />
|
|
|
|
+ <div>
|
|
|
|
+ <image-component @getImage="getImage"></image-component>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="cp-audio" v-if="type == 2">
|
|
<div class="cp-audio" v-if="type == 2">
|
|
<audio-component @addPz="addPz"></audio-component>
|
|
<audio-component @addPz="addPz"></audio-component>
|
|
@@ -25,6 +28,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import ImageComponent from './ImageComponent.vue'
|
|
import AudioComponent from './AudioComponent.vue'
|
|
import AudioComponent from './AudioComponent.vue'
|
|
import { addPz2 } from '@/api/course'
|
|
import { addPz2 } from '@/api/course'
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
@@ -48,12 +52,14 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
- AudioComponent
|
|
|
|
|
|
+ AudioComponent,
|
|
|
|
+ ImageComponent
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
type: 1,
|
|
type: 1,
|
|
- message: ''
|
|
|
|
|
|
+ message: '',
|
|
|
|
+ imgList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -66,18 +72,30 @@ export default {
|
|
setType(type) {
|
|
setType(type) {
|
|
this.type = type
|
|
this.type = type
|
|
},
|
|
},
|
|
|
|
+ getImage(imgList) {
|
|
|
|
+ this.imgList = imgList;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
addPz(type, content) {
|
|
addPz(type, content) {
|
|
|
|
+ var a = ''
|
|
if (type === 1 && this.message === '') {
|
|
if (type === 1 && this.message === '') {
|
|
this.$toast({ message: '批注不能为空!', type: 'fail' })
|
|
this.$toast({ message: '批注不能为空!', type: 'fail' })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if (type === 1 && this.message != '') {
|
|
|
|
+ var img = ''
|
|
|
|
+ for (var i = 0; i < this.imgList.length; i++) {
|
|
|
|
+ img += "<img src='" + this.imgList[i] + "' />"
|
|
|
|
+ }
|
|
|
|
+ a = this.message.replaceAll(/%/g, '%25') + img
|
|
|
|
+ }
|
|
const params = [
|
|
const params = [
|
|
{
|
|
{
|
|
cid: this.courseid,
|
|
cid: this.courseid,
|
|
uid: this.userinfo.userid,
|
|
uid: this.userinfo.userid,
|
|
s: this.courseType,
|
|
s: this.courseType,
|
|
t: this.taskCount,
|
|
t: this.taskCount,
|
|
- c: type === 1 ? this.message.replaceAll(/%/g, '%25') : content,
|
|
|
|
|
|
+ c: type === 1 ? a : content,
|
|
type: type
|
|
type: type
|
|
}
|
|
}
|
|
]
|
|
]
|
|
@@ -156,7 +174,7 @@ export default {
|
|
transition: all 0.5s;
|
|
transition: all 0.5s;
|
|
|
|
|
|
+ .type-nav-box {
|
|
+ .type-nav-box {
|
|
- margin-left: .3rem;
|
|
|
|
|
|
+ margin-left: 0.3rem;
|
|
}
|
|
}
|
|
|
|
|
|
&.active {
|
|
&.active {
|
|
@@ -172,6 +190,9 @@ export default {
|
|
overflow: auto;
|
|
overflow: auto;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
+ /deep/ .van-field__control {
|
|
|
|
+ height: 399px !important;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.cp-audio {
|
|
.cp-audio {
|
|
height: calc(100% - 60px);
|
|
height: calc(100% - 60px);
|