bug
Your Name
2022-09-06 da462d6d0874a7171347d983df9f5366a009a4b2
src/views/contingencyManagement/contingency/index.vue
@@ -14,21 +14,31 @@
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <el-button size="default" type="primary" class="ml10" @click="onSubmit"> 查询 </el-button>
                        <el-button size="default" class="ml10" @click="submitReset"> 重置 </el-button>
             <el-button size="default" type="primary" class="ml10" @click="onSubmit">
               查询
             </el-button>
             <el-button size="default" class="ml10"  @click="submitReset">
               重置
             </el-button>
                    </el-form-item>
                </el-form>
            </div>
            <div class="button_Line">
                <div class="button_Left">
                    <el-button size="default" type="primary" @click="onOpenAdd">
                        <el-icon> <Plus /> </el-icon>新建
            <el-icon>
              <Plus />
            </el-icon>新建
                    </el-button>
                    <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deleteAll[0])">
                        <el-icon> <Edit /> </el-icon>修改
            <el-icon>
              <Edit />
            </el-icon>修改
                    </el-button>
                    <el-button size="default" type="danger" plain :disabled="danger" @click="onDeleteAll">
                        <el-icon> <Delete /> </el-icon>删除
            <el-icon>
              <Delete />
            </el-icon>删除
                    </el-button>
                </div>
                <!--        <div class="button_Right">-->
@@ -49,8 +59,16 @@
                <!--          </el-button>-->
                <!--        </div>-->
            </div>
            <el-table :data="tableData" style="width: 100%" ref="multipleTableRef" @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55" />
      <el-table
          :data="tableData"
          style="width: 100%"
          ref="multipleTableRef"
          @selection-change="handleSelectionChange"
      >
        <el-table-column
            type="selection"
            width="55"
        />
                <el-table-column prop="teamName" label="队伍名称" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="teamLevel" label="队伍级别" show-overflow-tooltip sortable>
                    <template #default="scope">
@@ -61,23 +79,44 @@
                </el-table-column>
                <el-table-column prop="teamDesc" label="队伍描述" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="principalPhone" label="负责人手机" show-overflow-tooltip sortable></el-table-column>
                <el-table-column prop="fileList" label="相关附件" show-overflow-tooltip sortable> </el-table-column>
        <el-table-column prop="fileList" label="相关附件" show-overflow-tooltip sortable>
        </el-table-column>
                <el-table-column label="操作" width="200" align="center" fixed="right">
                    <template #default="scope">
                        <el-button size="small" text type="primary" @click="onEdit('详情', scope.row.id)">
                            <el-icon style="margin-right: 5px"> <View /> </el-icon>查看
              <el-icon style="margin-right: 5px;">
                <View />
              </el-icon>查看
                        </el-button>
                        <el-button size="small" text type="primary" @click="onEdit('修改', scope.row.id)">
                            <el-icon style="margin-right: 5px"> <EditPen /> </el-icon>修改
              <el-icon style="margin-right: 5px;">
                <EditPen />
              </el-icon>修改
                        </el-button>
                        <el-button size="small" text type="primary" @click="onRowDel(scope.row.id)">
                            <el-icon> <Delete /> </el-icon>删除
              <el-icon>
                <Delete />
              </el-icon>删除
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pages">
                <el-pagination v-if="tableData.length == 0 ? false : true" @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:currentPage="pageIndex" background v-model:page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
        <el-pagination
            v-if="tableData.length == 0 ? false : true"
            @size-change="onHandleSizeChange"
            @current-change="onHandleCurrentChange"
            class="mt15"
            :pager-count="5"
            :page-sizes="[10, 20, 30]"
            v-model:currentPage="pageIndex"
            background
            v-model:page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
        >
        </el-pagination>
            </div>
        </el-card>
        <OpenAdd ref="addRef" @myAdd="onMyAdd" />
@@ -93,7 +132,10 @@
    ref,
    defineComponent
} from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import {
  ElMessageBox,
  ElMessage,
} from 'element-plus';
import {
    Plus,
    Delete,
@@ -102,12 +144,12 @@
    // Refresh,
    Edit,
    View,
    EditPen
} from '@element-plus/icons-vue';
  EditPen,
} from '@element-plus/icons-vue'
import OpenAdd from '../../contingencyManagement/contingency/component/openAdd.vue';
import OpenAdd from '../../contingencyManagement/contingency/component/openAdd.vue'
import UpData from '../../contingencyManagement/contingency/component/upData.vue';
import { contingencyApi } from '../../../api/contingencyManagement/contingency';
import {contingencyApi} from "../../../api/contingencyManagement/contingency";
export default defineComponent({
    name: 'systemUser',
@@ -130,20 +172,20 @@
            pageIndex: 1,
            pageSize: 10,
            searchParams: {
                teamName: '',
                teamLevel: ''
        teamName: "",
        teamLevel: "",
            }
        });
    })
        // 定义表格数据
        const tableData = ref([]);
        // 列表数据请求
        const onSubmit = async () => {
            let res = await contingencyApi().getTeamManagementList(listQuery);
      let res = await contingencyApi().getTeamManagementList(listQuery)
            if (res.data.code === '200') {
                tableData.value = JSON.parse(JSON.stringify(res.data.data));
        tableData.value = res.data.data;
                for (var a = 0; a < tableData.value.length; a++) {
                    if (tableData.value[a].fileList != null && tableData.value[a].fileList != '' && tableData.value[a].fileList.length != 0) {
                        tableData.value[a].fileList = tableData.value[a].fileList[0].fileName;
            tableData.value[a].fileList = tableData.value[a].fileList[0].fileName
                    }
                }
                pageIndex.value = res.data.pageIndex;
@@ -154,9 +196,9 @@
                    showClose: true,
                    type: 'error',
                    message: res.data.msg
                });
        })
            }
        };
    }
        // 重置
        const submitReset = () => {
            listQuery.searchParams.teamName = '';
@@ -216,9 +258,8 @@
            ElMessageBox.confirm('确定删除所选项吗?', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
        type: 'warning',
      }).then(() => {
                    contingencyApi()
                        .deleteEmergencyTeam([data])
                        .then((res) => {
@@ -226,27 +267,26 @@
                                ElMessage({
                                    showClose: true,
                                    message: res.data.msg,
                                    type: 'success'
                type: 'success',
                                });
                                onSubmit();
                            } else {
                                ElMessage({
                                    showClose: true,
                                    message: res.data.msg,
                                    type: 'error'
                type: 'error',
                                });
                                onSubmit();
                            }
                        });
                })
                .catch(() => {});
      }).catch(() => {});
        };
        // 多选删除
        const onDeleteAll = () => {
            ElMessageBox.confirm('确定删除所选项吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
        type: 'warning',
            })
                .then(() => {
                    contingencyApi()
@@ -256,14 +296,14 @@
                                ElMessage({
                                    showClose: true,
                                    message: res.data.msg,
                                    type: 'success'
                      type: 'success',
                                });
                                onSubmit();
                            } else {
                                ElMessage({
                                    showClose: true,
                                    message: res.data.msg,
                                    type: 'error'
                      type: 'error',
                                });
                                onSubmit();
                            }
@@ -309,9 +349,9 @@
            onHandleCurrentChange,
            deleteAll,
            warning,
            danger
      danger,
        };
    }
  },
});
</script>
<style scoped lang="scss">