|
@@ -153,6 +153,7 @@
|
|
|
{{ item.con }}
|
|
|
</span>
|
|
|
</div>
|
|
|
+ <el-checkbox v-if="previewType && previewType == 'previewCheck'" class="NNPE-Book-content-item-checkbox" :indeterminate="isIndeterminate" v-model="checkAllNPC" @change="handleCheckAllChangeNPC" style="margin:20px 0 0 10px">全选</el-checkbox>
|
|
|
<div v-if="cur" class="NNPE-Book-content-inner">
|
|
|
<div
|
|
|
v-for="(item, index) in cur.cur_fn_data"
|
|
@@ -1055,6 +1056,8 @@ export default {
|
|
|
judgeAnswersList: [],
|
|
|
visiblePreviewDialog: false,
|
|
|
titleChsFhList:[",", "”","。",":", "》", "?", "!", ";"],
|
|
|
+ checkAllNPC: false,
|
|
|
+ isIndeterminate: false
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -1100,7 +1103,7 @@ export default {
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
- console.log("2023-10-07");
|
|
|
+ console.log("2023-10-08");
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
@@ -1163,7 +1166,7 @@ export default {
|
|
|
initContextData() {
|
|
|
const _this = this;
|
|
|
// _this.$root.isRecording = false;
|
|
|
-
|
|
|
+ _this.checkAllNPC = false
|
|
|
_this.contextData = JSON.parse(JSON.stringify(_this.context));
|
|
|
_this.queIndex = 0;
|
|
|
_this.NNPENewWordList = [];
|
|
@@ -1484,31 +1487,50 @@ export default {
|
|
|
submitPreviewGroupId() {
|
|
|
return JSON.stringify(this.groupIndexList);
|
|
|
},
|
|
|
- forupdata(indexI) {
|
|
|
- if (
|
|
|
- this.groupIndexList
|
|
|
- .toString()
|
|
|
- .indexOf(this.cur.cur_fn_data[indexI].group_id.toString()) == -1
|
|
|
- ) {
|
|
|
- this.groupIndexList.push(this.cur.cur_fn_data[indexI].group_id);
|
|
|
- } else {
|
|
|
- this.groupIndexList.forEach((items, indexs) => {
|
|
|
- if (
|
|
|
- items.toString() == this.cur.cur_fn_data[indexI].group_id.toString()
|
|
|
- ) {
|
|
|
- this.groupIndexList.splice(indexs, 1);
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ forupdata(indexI,type) {
|
|
|
+ if(type==='all'){
|
|
|
+ this.groupIndexList = []
|
|
|
+ this.cur.cur_fn_data.forEach((item,index)=>{
|
|
|
+ this.groupIndexList.push(this.cur.cur_fn_data[index].group_id);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if (
|
|
|
+ this.groupIndexList
|
|
|
+ .toString()
|
|
|
+ .indexOf(this.cur.cur_fn_data[indexI].group_id.toString()) == -1
|
|
|
+ ) {
|
|
|
+ this.groupIndexList.push(this.cur.cur_fn_data[indexI].group_id);
|
|
|
+ } else {
|
|
|
+ this.groupIndexList.forEach((items, indexs) => {
|
|
|
+ if (
|
|
|
+ items.toString() == this.cur.cur_fn_data[indexI].group_id.toString()
|
|
|
+ ) {
|
|
|
+ this.groupIndexList.splice(indexs, 1);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
this.groupCheckList.forEach((item, index) => {
|
|
|
this.groupCheckList[index] = false;
|
|
|
});
|
|
|
+ if(type==='all'){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.isIndeterminate = false
|
|
|
+ }
|
|
|
+ this.checkAllNPC = this.groupIndexList.length===this.cur.cur_fn_data.length
|
|
|
this.cur.cur_fn_data.forEach((item, index) => {
|
|
|
if (
|
|
|
this.groupIndexList.toString().indexOf(item.group_id.toString()) > -1
|
|
|
) {
|
|
|
this.groupCheckList[index] = true;
|
|
|
+ if(type==='all'){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.isIndeterminate = true
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
this.$forceUpdate();
|
|
@@ -1525,6 +1547,17 @@ export default {
|
|
|
this.visiblePreviewDialog = true;
|
|
|
// this.submitUserAnswerNPC();
|
|
|
},
|
|
|
+ handleCheckAllChangeNPC(val){
|
|
|
+ if(val){
|
|
|
+ this.forupdata('','all')
|
|
|
+ }else{
|
|
|
+ this.groupCheckList.forEach((item, index) => {
|
|
|
+ this.groupCheckList[index] = false;
|
|
|
+ });
|
|
|
+ this.groupIndexList = []
|
|
|
+ this.isIndeterminate = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
@@ -1938,6 +1971,9 @@ export default {
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.NNPE-Book-content-item-checkbox {
|
|
|
+ .el-checkbox__input.is-indeterminate .el-checkbox__inner::before{
|
|
|
+ top: 9px;
|
|
|
+ }
|
|
|
.el-checkbox__inner {
|
|
|
border: 2px solid #4a99ea;
|
|
|
width: 24px;
|