shj
2022-07-22 355bddf13631205f0e997e04cea2489cbe37e391
src/views/contingencyManagement/contingency/index.vue
@@ -17,7 +17,7 @@
             <el-button size="default" type="primary" class="ml10" @click="onSubmit">
               查询
             </el-button>
             <el-button size="default" class="ml10" @click="submitReset">
             <el-button size="default" class="ml10">
               重置
             </el-button>
          </el-form-item>
@@ -75,12 +75,12 @@
        <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">
            <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenSee(scope.row)">
            <el-button size="small" text type="primary" @click="onOpenAdd('查看',scope.row)">
              <el-icon style="margin-right: 5px;">
                <View />
              </el-icon>查看
            </el-button>
            <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenAdd('修改',scope.row)">
            <el-button size="small" text type="primary" @click="onOpenAdd('修改',scope.row)">
              <el-icon style="margin-right: 5px;">
                <EditPen />
              </el-icon>修改
@@ -93,6 +93,7 @@
          </template>
        </el-table-column>
      </el-table>
      <div class="pages">
      <el-pagination
          @size-change="onHandleSizeChange"
          @current-change="onHandleCurrentChange"
@@ -106,10 +107,10 @@
          :total="tableData.total"
      >
      </el-pagination>
      </div>
    </el-card>
    <OpenAdd ref="addRef"  @refreshRoleList="initTableData"/>
    <OpenSee ref="seeRef" />
<!--    <OpenEdit ref="editRef" />-->
    <OpenSee ref="seeRef" @refreshRoleList="initTableData"/>
    <upData ref="upShow"></upData>
  </div>
</template>
@@ -137,11 +138,9 @@
  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 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";
// 定义表格数据类型
@@ -175,7 +174,6 @@
  components: {
    OpenAdd,
    OpenSee,
    // OpenEdit,
    View,
    EditPen,
    Plus,
@@ -242,19 +240,14 @@
    };
    //查看用户弹窗
    const seeRef = ref();
    const onOpenSee = (row: TableDataRow) => {
      seeRef.value.openDialog(row);
    const onOpenSee = (type: string, value: any) => {
      seeRef.value.openDialog(type, value);
    };
    // 打开新增应急队伍弹窗
    const addRef = ref();
    const onOpenAdd = (type: string, value: any) => {
      addRef.value.openDialog(type, value);
    };
    // 打开修改用户弹窗
    // const editRef = ref();
    // const onOpenEdit = (row: TableDataRow) => {
    //   editRef.value.openDialog(row);
    // };
    // 删除用户
    const onRowDel = (row: any) => {
      ElMessageBox.confirm(`此操作将永久删除队伍名称:“${row}”,是否继续?`, '提示', {
@@ -263,7 +256,7 @@
        type: 'warning',
      })
          .then(async () => {
            let res = await useRoleApi().deleteEmergencyTeam({roleId:row.roleId})
            let res = await contingencyApi().deleteEmergencyTeam({principalUid:row.principalUid})
            if(res.data.code ==='200'){
              ElMessage({
                type:'success',
@@ -304,8 +297,6 @@
      initTableData,
      onOpenSee, //查看
      seeRef,
      // onOpenEdit,  //编辑
      // editRef,
      onOpenAdd,  //新增
      addRef,
      onRowDel,
@@ -331,13 +322,14 @@
    justify-content: space-between;
    margin-bottom: 10px;
  }
//分页
  .pages{
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
  margin-top: 15px;
  }
.el-form .el-form-item:last-of-type{
  margin-bottom: 22px!important;
.el-form .el-form-item{
  margin-bottom: 0px!important;
}
//弹窗底部边框线
::v-deep .el-dialog__footer{