|
@@ -32,7 +32,17 @@
|
|
<template v-else>
|
|
<template v-else>
|
|
<h3>{{ saveName }}</h3>
|
|
<h3>{{ saveName }}</h3>
|
|
<div class="btn-box">
|
|
<div class="btn-box">
|
|
- <el-button @click="changeRowLength">{{ showRoeText[showRowLength] }}</el-button>
|
|
|
|
|
|
+ <!-- <el-button @click="changeRowLength">{{ showRoeText[showRowLength] }}</el-button> -->
|
|
|
|
+ <el-button small @click="handleSureFilt" v-if="filtCardflag">类举</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ small
|
|
|
|
+ @click="
|
|
|
|
+ filtCardflag = true;
|
|
|
|
+ showRowLength = newEditTable.length > 4 ? 6 : newEditTable.length;
|
|
|
|
+ "
|
|
|
|
+ v-else
|
|
|
|
+ >筛选</el-button
|
|
|
|
+ >
|
|
<el-button small @click="editCardflag = true"><i class="el-icon-edit"></i>编辑</el-button>
|
|
<el-button small @click="editCardflag = true"><i class="el-icon-edit"></i>编辑</el-button>
|
|
<el-button small @click="download2"><img src="../../assets/teacherdev/word-eyes.png" alt="" />打印</el-button>
|
|
<el-button small @click="download2"><img src="../../assets/teacherdev/word-eyes.png" alt="" />打印</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -41,9 +51,13 @@
|
|
<div
|
|
<div
|
|
class="content"
|
|
class="content"
|
|
:class="[editCardflag ? '' : 'content-flex content-flex-' + showRowLength]"
|
|
:class="[editCardflag ? '' : 'content-flex content-flex-' + showRowLength]"
|
|
- :style="{ minHeight: innerHeight - 172 + 'px' }"
|
|
|
|
|
|
+ :style="{ minHeight: innerHeight - 220 + 'px' }"
|
|
>
|
|
>
|
|
- <div v-for="(item, index) in newEditTable" :key="index" :class="[editCardflag ? '' : 'item-flex']">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-for="(item, index) in filtCardflag ? newEditTable : filtTableShow"
|
|
|
|
+ :key="index"
|
|
|
|
+ :class="[editCardflag ? '' : 'item-flex']"
|
|
|
|
+ >
|
|
<writeTable
|
|
<writeTable
|
|
:editCardflag="editCardflag"
|
|
:editCardflag="editCardflag"
|
|
:dataConfig="writeTableData"
|
|
:dataConfig="writeTableData"
|
|
@@ -52,9 +66,23 @@
|
|
:totalNumber="showRowLength"
|
|
:totalNumber="showRowLength"
|
|
:isPreview="true"
|
|
:isPreview="true"
|
|
@handleDelItem="handleDelItem"
|
|
@handleDelItem="handleDelItem"
|
|
|
|
+ :filtCardflag="filtCardflag"
|
|
|
|
+ :filtId="filtId"
|
|
|
|
+ :filtTable="filtTable"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-pagination
|
|
|
|
+ background
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="showRowLength"
|
|
|
|
+ :page-sizes="[1, 2, 3, 4, 6]"
|
|
|
|
+ :total="filtTable.length"
|
|
|
|
+ layout="total, prev, pager, next, sizes, jumper"
|
|
|
|
+ @size-change="(val) => handleSizeChange(val, 'showRowLength', 'currentPage')"
|
|
|
|
+ @current-change="(val) => handleCurrentChange(val, 'currentPage')"
|
|
|
|
+ v-if="!filtCardflag"
|
|
|
|
+ />
|
|
<!-- <div class="preview_dv" v-if="isPreview" :style="{ top: userID ? '0' : '' }">
|
|
<!-- <div class="preview_dv" v-if="isPreview" :style="{ top: userID ? '0' : '' }">
|
|
<img class="close" src="../../assets/teacherdev/creadCad-close.png" alt="" @click="closepreviewEvent" />
|
|
<img class="close" src="../../assets/teacherdev/creadCad-close.png" alt="" @click="closepreviewEvent" />
|
|
<el-button type="primary" class="print-btn" small @click="download2">打印</el-button>
|
|
<el-button type="primary" class="print-btn" small @click="download2">打印</el-button>
|
|
@@ -153,6 +181,11 @@ export default {
|
|
5: '两行三列',
|
|
5: '两行三列',
|
|
},
|
|
},
|
|
innerHeight: window.innerHeight,
|
|
innerHeight: window.innerHeight,
|
|
|
|
+ filtCardflag: true, // 筛选状态
|
|
|
|
+ filtTable: [], // 筛选卡片
|
|
|
|
+ filtTableShow: [], //分页后的筛选卡片
|
|
|
|
+ filtId: [], // 筛选卡片id数组
|
|
|
|
+ currentPage: 1,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
@@ -192,6 +225,7 @@ export default {
|
|
cixing: '',
|
|
cixing: '',
|
|
hideHanzi: false,
|
|
hideHanzi: false,
|
|
},
|
|
},
|
|
|
|
+ id: Math.random().toString(36).substring(2, 10),
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 删除一条卡片
|
|
// 删除一条卡片
|
|
@@ -237,7 +271,7 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.editCardflag = false;
|
|
this.editCardflag = false;
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
- this.showRowLength = this.newEditTable.length > 3 ? 4 : this.newEditTable.length;
|
|
|
|
|
|
+ this.showRowLength = this.newEditTable.length > 4 ? 6 : this.newEditTable.length;
|
|
})
|
|
})
|
|
.catch((res) => {
|
|
.catch((res) => {
|
|
this.loading.close();
|
|
this.loading.close();
|
|
@@ -265,7 +299,7 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.editCardflag = false;
|
|
this.editCardflag = false;
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
- this.showRowLength = this.newEditTable.length > 3 ? 4 : this.newEditTable.length;
|
|
|
|
|
|
+ this.showRowLength = this.newEditTable.length > 4 ? 6 : this.newEditTable.length;
|
|
})
|
|
})
|
|
.catch((res) => {
|
|
.catch((res) => {
|
|
this.loading.close();
|
|
this.loading.close();
|
|
@@ -282,11 +316,15 @@ export default {
|
|
id: this.$route.query.id,
|
|
id: this.$route.query.id,
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- console.log(789);
|
|
|
|
this.saveName = res.name;
|
|
this.saveName = res.name;
|
|
this.newEditTable = JSON.parse(res.content);
|
|
this.newEditTable = JSON.parse(res.content);
|
|
|
|
+ this.newEditTable.forEach((item) => {
|
|
|
|
+ if (!item.hasOwnProperty('id')) {
|
|
|
|
+ this.$set(item, 'id', Math.random().toString(36).substring(2, 10));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- this.showRowLength = this.newEditTable.length > 3 ? 4 : this.newEditTable.length;
|
|
|
|
|
|
+ this.showRowLength = this.newEditTable.length > 4 ? 6 : this.newEditTable.length;
|
|
})
|
|
})
|
|
.catch((res) => {
|
|
.catch((res) => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -325,9 +363,13 @@ export default {
|
|
this.showLeft = !this.showLeft;
|
|
this.showLeft = !this.showLeft;
|
|
},
|
|
},
|
|
download2() {
|
|
download2() {
|
|
|
|
+ if (this.filtTable.length === 0) {
|
|
|
|
+ this.$message.warning('未选中卡片');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- if (this.newEditTable) {
|
|
|
|
- let str = JSON.stringify(this.newEditTable);
|
|
|
|
|
|
+ if (this.filtTable) {
|
|
|
|
+ let str = JSON.stringify(this.filtTable);
|
|
localStorage.setItem('newEditTable', str);
|
|
localStorage.setItem('newEditTable', str);
|
|
this.$router.replace({
|
|
this.$router.replace({
|
|
path: '/wordcard/printNew',
|
|
path: '/wordcard/printNew',
|
|
@@ -424,12 +466,39 @@ export default {
|
|
this.$message.warning(`当前限制选择 9999 个文件,本次选择了 ${files.length} 个文件`);
|
|
this.$message.warning(`当前限制选择 9999 个文件,本次选择了 ${files.length} 个文件`);
|
|
},
|
|
},
|
|
changeRowLength() {
|
|
changeRowLength() {
|
|
- if (this.showRowLength === 5) {
|
|
|
|
|
|
+ if (this.showRowLength === 4) {
|
|
|
|
+ this.showRowLength = 6;
|
|
|
|
+ } else if (this.showRowLength === 6) {
|
|
this.showRowLength = 1;
|
|
this.showRowLength = 1;
|
|
} else {
|
|
} else {
|
|
this.showRowLength++;
|
|
this.showRowLength++;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ handleSureFilt() {
|
|
|
|
+ if (this.filtTable.length === 0) {
|
|
|
|
+ this.$message.warning('请勾选要类举的卡片');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.filtTable.slice().reverse();
|
|
|
|
+ this.filtCardflag = false;
|
|
|
|
+ this.showRowLength = this.filtTable.length > 4 ? 6 : this.filtTable.length;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val, type, page) {
|
|
|
|
+ this[type] = val;
|
|
|
|
+ this[page] = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(val, type) {
|
|
|
|
+ this[type] = val;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ this.filtTableShow = JSON.parse(JSON.stringify(this.filtTable)).splice(
|
|
|
|
+ (this.currentPage - 1) * this.showRowLength,
|
|
|
|
+ this.showRowLength,
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
created() {},
|
|
created() {},
|
|
@@ -589,7 +658,7 @@ export default {
|
|
}
|
|
}
|
|
&-2,
|
|
&-2,
|
|
&-4,
|
|
&-4,
|
|
- &-5 {
|
|
|
|
|
|
+ &-6 {
|
|
justify-content: start;
|
|
justify-content: start;
|
|
}
|
|
}
|
|
&-1 {
|
|
&-1 {
|
|
@@ -601,7 +670,7 @@ export default {
|
|
&-4 {
|
|
&-4 {
|
|
width: 780px;
|
|
width: 780px;
|
|
}
|
|
}
|
|
- &-5 {
|
|
|
|
|
|
+ &-6 {
|
|
width: 1120px;
|
|
width: 1120px;
|
|
gap: 50px 80px;
|
|
gap: 50px 80px;
|
|
.item-flex {
|
|
.item-flex {
|
|
@@ -657,6 +726,11 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+:deep .el-pagination {
|
|
|
|
+ text-align: right;
|
|
|
|
+ width: 1200px;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.cread {
|
|
.cread {
|