|
@@ -1,16 +1,18 @@
|
|
<template>
|
|
<template>
|
|
<div id="index">
|
|
<div id="index">
|
|
<list-frame :title="pageTitle" @query="search" :total="total" :needFilter="false" :needAdd="false" :returns="toReturns">
|
|
<list-frame :title="pageTitle" @query="search" :total="total" :needFilter="false" :needAdd="false" :returns="toReturns">
|
|
- <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 :fields="fields" :data="list" @handleSelect="handleSelect" :select="true" :opera="opera" @edit="toEdit" @delete="toDelete"></data-table>
|
|
<data-table :fields="fields" :data="list" @handleSelect="handleSelect" :select="true" :opera="opera" @edit="toEdit" @delete="toDelete"></data-table>
|
|
</list-frame>
|
|
</list-frame>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import _ from 'lodash';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import dataTable from '@frame/components/data-table';
|
|
import dataTable from '@frame/components/data-table';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
@@ -60,9 +62,8 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapStu(['query', 'delete']),
|
|
|
|
|
|
+ ...mapStu(['query', 'delete', 'removeAll']),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
- console.log('in function:');
|
|
|
|
const res = await this.query({ skip, limit, ...info, termid: this.termid, schid: this.user.code });
|
|
const res = await this.query({ skip, limit, ...info, termid: this.termid, schid: this.user.code });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, `list`, res.data);
|
|
this.$set(this, `list`, res.data);
|
|
@@ -77,18 +78,12 @@ export default {
|
|
this.$set(this, `batchdet`, idlist);
|
|
this.$set(this, `batchdet`, idlist);
|
|
},
|
|
},
|
|
//批量删除
|
|
//批量删除
|
|
- batchdelete() {
|
|
|
|
- console.log(this.batchdet);
|
|
|
|
-
|
|
|
|
- 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();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|