|
@@ -1,31 +1,38 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="table">
|
|
|
|
|
|
|
+ <div style="width: 100%">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button type="primary" v-if="!isShowCheckbox" size="small" @click="showCheckbox">批量操作</el-button>
|
|
|
|
|
+ <el-button type="info" v-if="isShowCheckbox" size="small" @click="isShowCheckbox=false">取消操作</el-button>
|
|
|
|
|
+ <el-button type="danger" v-if="isShowCheckbox" size="small" @click="handleDeleteMultiply">批量删除</el-button>
|
|
|
|
|
+ </div>
|
|
|
<el-table
|
|
<el-table
|
|
|
:data="listData"
|
|
:data="listData"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-if="isShowCheckbox"
|
|
v-if="isShowCheckbox"
|
|
|
type="selection"
|
|
type="selection"
|
|
|
- width="55">
|
|
|
|
|
|
|
+ width="60">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="projectCode"
|
|
prop="projectCode"
|
|
|
label="编号"
|
|
label="编号"
|
|
|
- width="150">
|
|
|
|
|
|
|
+ width="180">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="title"
|
|
prop="title"
|
|
|
|
|
+ min-width="180"
|
|
|
label="标题">
|
|
label="标题">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="assignment"
|
|
prop="assignment"
|
|
|
label="优先级"
|
|
label="优先级"
|
|
|
- width="150">
|
|
|
|
|
|
|
+ width="180">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="status"
|
|
prop="status"
|
|
|
label="状态"
|
|
label="状态"
|
|
|
- width="150">
|
|
|
|
|
|
|
+ width="180">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="assignment"
|
|
prop="assignment"
|
|
@@ -47,7 +54,7 @@
|
|
|
style="display: flex;flex-direction: row;justify-content: center;margin-top: 20px"
|
|
style="display: flex;flex-direction: row;justify-content: center;margin-top: 20px"
|
|
|
background
|
|
background
|
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
|
- page-size="10"
|
|
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
layout="prev, pager, next"
|
|
layout="prev, pager, next"
|
|
|
:total="total">
|
|
:total="total">
|
|
|
</el-pagination>
|
|
</el-pagination>
|
|
@@ -60,13 +67,34 @@ export default {
|
|
|
props: {
|
|
props: {
|
|
|
listData: Array,
|
|
listData: Array,
|
|
|
total: Number,
|
|
total: Number,
|
|
|
- isShowCheckbox: Boolean,
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ isShowCheckbox: false,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ selectedId: [],
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ showCheckbox() {
|
|
|
|
|
+ this.isShowCheckbox = true;
|
|
|
|
|
+ },
|
|
|
handleCurrentChange(currentPage) {
|
|
handleCurrentChange(currentPage) {
|
|
|
console.log(currentPage);
|
|
console.log(currentPage);
|
|
|
this.$emit('current-change', currentPage);
|
|
this.$emit('current-change', currentPage);
|
|
|
},
|
|
},
|
|
|
|
|
+ handleDeleteMultiply() {
|
|
|
|
|
+ console.warn('deleteMultiply');
|
|
|
|
|
+ this.$emit('multiple-delete', this.selectedId);
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
|
+ console.warn(val);
|
|
|
|
|
+ const tempArray = [];
|
|
|
|
|
+ val.forEach((item) => {
|
|
|
|
|
+ tempArray.push(item.projectCode);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.selectedId = tempArray;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|