|
@@ -16,9 +16,11 @@
|
|
<el-button type="primary" @click="search">查询</el-button>
|
|
<el-button type="primary" @click="search">查询</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div style="margin: 20px 0 5px 0">
|
|
|
|
- <el-button type="danger" size="mini" @click="batchdelete">批量删除</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-row style="margin: 20px 0 5px 0" type="flex" align="middle" justify="end">
|
|
|
|
+ <el-col :span="2">
|
|
|
|
+ <el-button type="danger" size="mini" :disabled="batchdet.length <= 0" @click="batchdelete">批量删除</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
<data-table
|
|
<data-table
|
|
:fields="fields"
|
|
:fields="fields"
|
|
@handleSelect="handleSelect"
|
|
@handleSelect="handleSelect"
|
|
@@ -43,6 +45,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import _ from 'lodash';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import dataForm from '@frame/components/form';
|
|
import dataForm from '@frame/components/form';
|
|
import dataTable from '@frame/components/data-table';
|
|
import dataTable from '@frame/components/data-table';
|
|
@@ -115,7 +118,7 @@ export default {
|
|
computed: { ...mapState(['user', 'defaultOption']) },
|
|
computed: { ...mapState(['user', 'defaultOption']) },
|
|
methods: {
|
|
methods: {
|
|
...trainplan({ planfetch: 'fetch' }),
|
|
...trainplan({ planfetch: 'fetch' }),
|
|
- ...mapActions(['query', 'delete', 'update']),
|
|
|
|
|
|
+ ...mapActions(['query', 'delete', 'update', 'removeAll']),
|
|
...classes({ classesquery: 'query' }),
|
|
...classes({ classesquery: 'query' }),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
const res = await this.query({ skip, limit, termid: this.form.termid, classid: this.form.classid });
|
|
const res = await this.query({ skip, limit, termid: this.form.termid, classid: this.form.classid });
|
|
@@ -131,16 +134,12 @@ export default {
|
|
this.$set(this, `batchdet`, idlist);
|
|
this.$set(this, `batchdet`, idlist);
|
|
},
|
|
},
|
|
//批量删除
|
|
//批量删除
|
|
- batchdelete() {
|
|
|
|
- if (this.batchdet.length == 0) {
|
|
|
|
- this.$message({
|
|
|
|
- showClose: true,
|
|
|
|
- message: '请选择要批量删除的信息',
|
|
|
|
- type: 'warning',
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- //此处写方法
|
|
|
|
- console.log('ccc');
|
|
|
|
|
|
+ async batchdelete() {
|
|
|
|
+ let duplicate = _.cloneDeep(this.batchdet);
|
|
|
|
+ let res = await this.removeAll(duplicate);
|
|
|
|
+ if (this.$checkRes(res, '删除成功', res.errmsg)) {
|
|
|
|
+ this.batchdet = [];
|
|
|
|
+ this.search();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|