多选重试对接完成

This commit is contained in:
xiayuping666
2024-05-31 09:43:37 +08:00
parent 8357146548
commit 9d82c89c66
3 changed files with 60 additions and 14 deletions
@@ -1,14 +1,17 @@
<template>
<div>
<el-button @click="newlyClick" type="primary" size="mini" icon="el-icon-plus"
<!-- <el-button @click="newlyClick" type="primary" size="mini" icon="el-icon-plus"
>新增</el-button
>
<el-button @click="resetClick" type="info" size="mini" icon="iconfont icon-biaodan"
> -->
<!-- <el-button @click="resetClick" type="info" size="mini" icon="iconfont icon-biaodan"
>重置</el-button
>
> -->
<el-button @click="afreshClick" type="warning" size="mini" icon="el-icon-refresh-left"
>重试</el-button
>
<el-button @click="refreshClick" type="primary" size="mini" icon="el-icon-refresh-right"
>刷新</el-button
>
<el-input
v-if="false"
v-model="searchData"
@@ -38,8 +41,12 @@ export default {
this.$emit("reset-data");
},
afreshClick() {
this.$emit("afresh-data", this.searchData);
this.$emit("afresh-data");
},
refreshClick () {
this.$emit("refresh-data");
}
},
};
</script>
@@ -1,5 +1,6 @@
<template>
<el-table
@selection-change="handleSelectionChange"
ref="table"
border
:header-cell-style="{
@@ -10,8 +11,10 @@
height="650"
size="mini"
:row-key="getRowKeys"
>
<el-table-column
:selectable="selectable"
type="selection"
width="55">
</el-table-column>
@@ -26,7 +29,7 @@
></el-table-column>
<el-table-column align="left" prop="zip" label="操作" width="160">
<template slot-scope="scope">
<el-button
<!-- <el-button
@click="handleEdit(scope.row)"
class="el-icon-edit"
type="text"
@@ -43,11 +46,11 @@
size="small"
>删除</el-button
>
</el-popconfirm>
</el-popconfirm> -->
<el-button
v-if="scope.row.success == '失败'"
@click="afreshClick(scope.row)"
@click="afreshClick(multipleSelection)"
style="margin-left: 10px;"
class="el-icon-refresh-left"
type="text"
@@ -82,12 +85,24 @@ export default {
type: Function,
default: () => {},
},
afreshAllFunc: {
type: Function,
default: () => {},
},
},
name: "CommonTables",
data() {
return {};
return {
multipleSelection: []
};
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val.map(item =>{
return item.id
})
this.afreshAllFunc(this.multipleSelection)
},
// 删除事件
handleDelete(row) {
this.deleteFunc(row);
@@ -104,7 +119,7 @@ export default {
return row.id
},
selectable(row, index) {
if (row.success == 0 || row.status == 1) {
if (row.success == '失败' ) {
return true;
} else {
return false;
@@ -8,6 +8,8 @@
@search-data="searchForm"
@reset-data="reset"
@newly-data="add"
@afresh-data="afreshClickAll"
@refresh-data="refreshClick"
></CommonHead>
<!-- newly-data删除所选事件 -->
<!-- reset-data重置表单内容 -->
@@ -20,6 +22,7 @@
:delete-func="deleteData"
:edit-func="editData"
:afreshFunc ="afreshClick"
:afreshAllFunc="afreshAllFunc"
:columns="columns"
:data="equipmentList"
></CommonTables>
@@ -128,6 +131,7 @@ export default {
label: [{ required: true, message: "请输入标签", trigger: "change" }],
welcome: [{ required: true, message: "请输入欢迎词", trigger: "change" }],
},
multipleSelection: []
};
},
components: {
@@ -139,6 +143,22 @@ export default {
this.deviceList()
},
methods: {
// 点击刷新
refreshClick() {
this.getAttendanceFormData();
},
// 多选重试
afreshClickAll(item) {
console.log(this.multipleSelection)
putRetry(this.multipleSelection).then(res => {
this.$message({
message: "重试成功",
type: "success",
});
this.getAttendanceFormData();
})
},
// 单选重试
afreshClick(item) {
console.log(item)
putRetry([item.id]).then(res => {
@@ -149,6 +169,10 @@ export default {
this.getAttendanceFormData();
})
},
// 选中的表单数据
afreshAllFunc(selectableArr) {
this.multipleSelection = selectableArr
},
// 搜索按钮
searchForm() {
this.$message("正在搜索");