13937891274
2022-07-20 3d17b311e7e7e642bb812494ecaa24aaeb382bdd
src/views/contingencyManagement/contingency/index.vue
@@ -25,7 +25,7 @@
      </div>
      <div class="button_Line">
        <div class="button_Left">
          <el-button size="default" type="primary"  @click="onOpenAdd('新建')">
          <el-button size="default" type="primary"  @click="onOpenAdd('新建','')">
            <el-icon>
              <Plus />
            </el-icon>新建
@@ -42,17 +42,17 @@
          </el-button>
        </div>
        <div class="button_Right">
          <el-button @click="upButton">
          <el-button size="default" @click="upButton">
            <el-icon>
              <Upload />
            </el-icon>
          </el-button>
          <el-button>
          <el-button size="default">
            <el-icon>
              <Download />
            </el-icon>
          </el-button>
          <el-button>
          <el-button size="default">
            <el-icon>
              <Refresh />
            </el-icon>
@@ -70,8 +70,8 @@
        />
        <el-table-column prop="teamName" label="队伍名称" show-overflow-tooltip sortable></el-table-column>
        <el-table-column prop="teamLevel" label="队伍级别" show-overflow-tooltip sortable></el-table-column>
        <el-table-column prop="teamDescription" label="队伍描述" show-overflow-tooltip sortable></el-table-column>
        <el-table-column prop="teamPhone" label="负责人手机" show-overflow-tooltip sortable></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="attachments" label="相关附件" show-overflow-tooltip sortable></el-table-column>
        <el-table-column label="操作" width="200" align="center" fixed="right">
          <template #default="scope">
@@ -80,7 +80,7 @@
                <View />
              </el-icon>查看
            </el-button>
            <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEdit(scope.row)">
            <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenAdd('修改',scope.row)">
              <el-icon style="margin-right: 5px;">
                <EditPen />
              </el-icon>修改
@@ -107,9 +107,9 @@
      >
      </el-pagination>
    </el-card>
    <OpenAdd ref="addRef"  @refreshRoleList="initTableData"/>
    <OpenSee ref="seeRef" />
    <OpenAdd ref="addRef" />
    <OpenEdit ref="editRef" />
<!--    <OpenEdit ref="editRef" />-->
    <upData ref="upShow"></upData>
  </div>
</template>
@@ -137,18 +137,19 @@
  EditPen,
} from '@element-plus/icons-vue'
import OpenAdd from '/@/views/contingencyManagement/contingency/component/openAdd.vue';
import OpenEdit from '/@/views/contingencyManagement/contingency/component/openEdit.vue';
// import OpenEdit from '/@/views/contingencyManagement/contingency/component/openEdit.vue';
import OpenSee from '/@/views/contingencyManagement/contingency/component/openSee.vue';
import UpData from '/@/views/contingencyManagement/contingency/component/upData.vue';
import {contingencyApi} from "/@/api/contingency";
import {useRoleApi} from "/@/api/system/role";
// 定义表格数据类型
interface User {
  teamName: string
  teamLevel: string
  teamDescription: string
  teamPhone: string
  teamDesc: string
  principalPhone: string
  telephone: string;
  describe: string;
  responsibleDepartment: string
@@ -158,11 +159,7 @@
// 定义接口来定义对象的类型
interface TableDataRow {
  // teamName: string;
  // teamLevel: string;
  // teamDescription: string;
  // teamPhone: string;
  // attachments: string;
}
//
@@ -178,7 +175,7 @@
  components: {
    OpenAdd,
    OpenSee,
    OpenEdit,
    // OpenEdit,
    View,
    EditPen,
    Plus,
@@ -202,16 +199,16 @@
    })
    // 搜索按钮
    const onSubmit = async () => {
      // let res = await contingencyApi().getTeamManagementList(formInline)
      // if(res.data.code === '200'){
      //   state.tableData.data = res.data.data;
      //   state.tableData.total = state.tableData.data.length;
      // }else{
      //   ElMessage({
      //     type:'warning',
      //     message:res.data.msg
      //   })
      // }
      let res = await contingencyApi().getTeamManagementList(formInline)
      if(res.data.code === '200'){
        state.tableData.data = res.data.data;
        state.tableData.total = state.tableData.data.length;
      }else{
        ElMessage({
          type:'warning',
          message:res.data.msg
        })
      }
    }
    const multipleTableRef = ref<InstanceType<typeof ElTable>>()
@@ -243,84 +240,43 @@
        })
      }
    };
    // const tableData: User[] = [
    //   {
    //     teamName: '应急救援组',
    //     teamLevel: '公司',
    //     teamDescription: '实施抢险抢险的应急方案和措施实施 ;',
    //     telephone: '051383830321',
    //     teamPhone: '13603812900',
    //     describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' +
    //         '(2)负责现场被困人员、受伤人员抢救工作;\n' +
    //         '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' +
    //         '(4)抢险抢修或救援结束后,对结果进行复查和评估。',
    //     responsibleDepartment: '仪表班',
    //     teamLeader: '王磊',
    //   },
    //   {
    //     teamName: '应急救援组',
    //     teamLevel: '公司',
    //     teamDescription: '实施抢险抢险的应急方案和措施实施 ;',
    //     telephone: '051383830321',
    //     teamPhone: '13603812900',
    //     describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' +
    //         '(2)负责现场被困人员、受伤人员抢救工作;\n' +
    //         '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' +
    //         '(4)抢险抢修或救援结束后,对结果进行复查和评估。',
    //     responsibleDepartment: '仪表班',
    //     teamLeader: '王磊',
    //   },
    //   {
    //     teamName: '应急救援组',
    //     teamLevel: '公司',
    //     teamDescription: '实施抢险抢险的应急方案和措施实施 ;',
    //     telephone: '051383830321',
    //     teamPhone: '13603812900',
    //     describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' +
    //         '(2)负责现场被困人员、受伤人员抢救工作;\n' +
    //         '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' +
    //         '(4)抢险抢修或救援结束后,对结果进行复查和评估。',
    //     responsibleDepartment: '仪表班',
    //     teamLeader: '王磊',
    //   },
    //   {
    //     teamName: '应急救援组',
    //     teamLevel: '公司',
    //     teamDescription: '实施抢险抢险的应急方案和措施实施 ;',
    //     telephone: '051383830321',
    //     teamPhone: '13603812900',
    //     describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' +
    //         '(2)负责现场被困人员、受伤人员抢救工作;\n' +
    //         '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' +
    //         '(4)抢险抢修或救援结束后,对结果进行复查和评估。',
    //     responsibleDepartment: '仪表班',
    //     teamLeader: '王磊',
    //   }
    // ]
    //查看用户弹窗
    const seeRef = ref();
    const onOpenSee = (row: TableDataRow) => {
      seeRef.value.openDialog(row);
    };
    // 打开新增用户弹窗
    // 打开新增应急队伍弹窗
    const addRef = ref();
    const onOpenAdd = () => {
      addRef.value.openDialog();
    const onOpenAdd = (type: string, value: any) => {
      addRef.value.openDialog(type, value);
    };
    // 打开修改用户弹窗
    const editRef = ref();
    const onOpenEdit = (row: TableDataRow) => {
      editRef.value.openDialog(row);
    };
    // const editRef = ref();
    // const onOpenEdit = (row: TableDataRow) => {
    //   editRef.value.openDialog(row);
    // };
    // 删除用户
    const onRowDel = (row: TableDataRow) => {
      ElMessageBox.confirm(`此操作将永久删除账户名称:“${row}”,是否继续?`, '提示', {
    const onRowDel = (row: any) => {
      ElMessageBox.confirm(`此操作将永久删除队伍名称:“${row}”,是否继续?`, '提示', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
      })
          .then(() => {
            ElMessage.success('删除成功');
          .then(async () => {
            let res = await useRoleApi().deleteEmergencyTeam({roleId:row.roleId})
            if(res.data.code ==='200'){
              ElMessage({
                type:'success',
                duration:2000,
                message:'删除成功'
              })
              await initTableData()
            }else{
              ElMessage({
                type:'warning',
                message:res.data.msg
              })
            }
          })
          .catch(() => {});
    };
@@ -331,7 +287,6 @@
    const onHandleCurrentChange = (val: number) => {
      formInline.pageIndex = val;
    };
    // // 分页改变
    // 页面加载时
    onMounted(() => {
      initTableData();
@@ -346,10 +301,11 @@
      upButton,
      upShow,
      // tableData,
      initTableData,
      onOpenSee, //查看
      seeRef,
      onOpenEdit,  //编辑
      editRef,
      // onOpenEdit,  //编辑
      // editRef,
      onOpenAdd,  //新增
      addRef,
      onRowDel,
@@ -373,6 +329,7 @@
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .pages{
    padding-top: 20px;