<template>
|
<el-dialog v-model="dialogVisible" title="选择应急预案" width="900px" draggable :fullscreen="full" @close="closeDialog">
|
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
|
<el-row>
|
<el-col :span="18">
|
<el-row>
|
<el-col :span="24">
|
<el-form ref="ruleFormRef" :inline="true" :model="ruleForm" status-icon>
|
<el-form-item>
|
<el-input size="default" v-model="listQuery.searchParams.name" placeholder="预案名称" style="max-width: 215px" />
|
</el-form-item>
|
<el-form-item>
|
<el-select
|
size="default"
|
v-model="listQuery.searchParams.type"
|
placeholder="请选择预案类型"
|
class="ml10"
|
style="max-width: 215px; margin-right: 12px"
|
>
|
<el-option label="综合应急预案" value="1"></el-option>
|
<el-option label="现场处置方案" value="2"></el-option>
|
<el-option label="专项应急预案" value="3"></el-option>
|
<el-option label="其他预案" value="4"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="default" type="primary" @click="onSubmit">查询</el-button>
|
<el-button size="default" @click="submitReset">重置</el-button>
|
</el-form-item>
|
</el-form>
|
</el-col>
|
<el-col :span="24">
|
<el-button size="default" :icon="Delete" @click="submitReset" style="margin-top: 15px">清除选择</el-button>
|
</el-col>
|
</el-row>
|
<el-table :data="tableData" style="width: 100%; margin-top: 20px" @cell-click="radio">
|
<el-table-column width="55">
|
<template #default="scope">
|
<el-radio-group v-model="radio1">
|
<el-radio :label="scope.row" size="large">{{ null }}</el-radio>
|
</el-radio-group>
|
</template>
|
</el-table-column>
|
<el-table-column align="center" prop="name" label="预案名称" />
|
<el-table-column align="center" prop="type" label="预案类型">
|
<template #default="scope">
|
<span v-if="scope.row.type == '1'">综合应急预案</span>
|
<span v-if="scope.row.type == '2'">现场处置方案</span>
|
<span v-if="scope.row.type == '3'">专项应急预案</span>
|
<span v-if="scope.row.type == '4'">其他预案</span>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="pages">
|
<el-pagination
|
v-model:currentPage="pageIndex"
|
v-model:page-size="pageSize"
|
:page-sizes="[10, 20, 30]"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="total"
|
@size-change="onHandleSizeChange"
|
@current-change="onHandleCurrentChange"
|
/>
|
</div>
|
</el-col>
|
<el-col :span="6">
|
<div v-if="dynamicTags[0] == '' ? false : true">
|
<el-tag
|
v-for="tag in dynamicTags"
|
:key="tag"
|
class="mx-1"
|
style="margin: 5px"
|
closable
|
:disable-transitions="false"
|
@close="handleClose(tag)"
|
>
|
{{ tag.name }}
|
</el-tag>
|
</div>
|
</el-col>
|
</el-row>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button @click="dialogVisible = false" size="default">关闭</el-button>
|
<el-button type="primary" @click="submitForm" size="default">确定</el-button>
|
</span>
|
</template>
|
</el-dialog>
|
</template>
|
<script lang="ts">
|
import { defineComponent, reactive, ref, onMounted } from 'vue';
|
import { ElMessage } from 'element-plus';
|
import { Delete, FullScreen } from '@element-plus/icons-vue';
|
import { emergencyPlanLogApi } from '/@/api/contingencyManagement/emergencyPlanLog';
|
import { emergencyPlanApi } from '/@/api/contingencyManagement/emergencyPlan';
|
export default defineComponent({
|
setup(props, { emit }) {
|
const dialogVisible = ref<boolean>(false);
|
const openDailog = () => {
|
dialogVisible.value = true;
|
onSubmit();
|
};
|
// 搜索条件
|
const listQuery = reactive({
|
pageIndex: 1,
|
pageSize: 10,
|
searchParams: {
|
name: '',
|
type: '',
|
abolishStatus: false,
|
},
|
});
|
// 定义表格数据
|
const tableData = ref([]);
|
// 请求列表数据
|
const onSubmit = async () => {
|
let res = await emergencyPlanApi().getEmergencyPlanList(listQuery);
|
if (res.data.code === '200') {
|
tableData.value = res.data.data;
|
pageIndex.value = res.data.pageIndex;
|
pageSize.value = res.data.pageSize;
|
total.value = res.data.total;
|
} else {
|
ElMessage({
|
showClose: true,
|
type: 'error',
|
message: res.data.msg,
|
});
|
}
|
};
|
// 重置
|
const submitReset = () => {
|
listQuery.searchParams.name = '';
|
listQuery.searchParams.type = '';
|
radio1.value=""
|
dynamicTags.value[0]=""
|
onSubmit();
|
};
|
// 分页
|
const pageIndex = ref();
|
const pageSize = ref();
|
const total = ref();
|
// 分页改变
|
const onHandleSizeChange = (val: number) => {
|
listQuery.pageSize = val;
|
};
|
// 分页未改变
|
const onHandleCurrentChange = (val: number) => {
|
listQuery.pageIndex = val;
|
};
|
// 右方点击添加后显示标签
|
const dynamicTags = ref(['']);
|
const handleClose = (tag: string) => {
|
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
|
radio1.value = '';
|
};
|
const closeDialog = () => {
|
handleClose('')
|
}
|
const radio1 = ref('');
|
const radio = (event: any) => {
|
dynamicTags.value[0] = event;
|
};
|
//全屏
|
const full = ref(false);
|
const toggleFullscreen = () => {
|
if (full.value == false) {
|
full.value = true;
|
} else {
|
full.value = false;
|
}
|
};
|
|
const submitForm = () => {
|
let obj = JSON.parse(JSON.stringify(dynamicTags.value));
|
emit('SearchUser', obj[0]);
|
dialogVisible.value = false;
|
};
|
onMounted(() => {
|
onSubmit();
|
});
|
return {
|
dialogVisible,
|
openDailog,
|
tableData,
|
pageSize,
|
pageIndex,
|
onHandleSizeChange,
|
onHandleCurrentChange,
|
dynamicTags,
|
handleClose,
|
Delete,
|
radio1,
|
radio,
|
toggleFullscreen,
|
FullScreen,
|
full,
|
submitReset,
|
onMounted,
|
listQuery,
|
onSubmit,
|
submitForm,
|
total,
|
closeDialog
|
};
|
},
|
});
|
</script>
|
<style scoped>
|
.el-form--inline .el-form-item {
|
margin-bottom: 0;
|
margin-right: 0;
|
}
|
/*分页*/
|
.pages {
|
margin-top: 15px;
|
}
|
::v-deep .el-pagination .el-pager li {
|
margin: 0 5px;
|
background-color: #f4f4f5;
|
color: #606266;
|
min-width: 30px;
|
border-radius: 2px;
|
}
|
::v-deep .el-pagination .el-pager li.is-active {
|
background-color: #409eff;
|
color: #fff;
|
}
|
::v-deep .el-pagination .btn-prev {
|
margin: 0 5px;
|
background-color: #f4f4f5;
|
color: #606266;
|
min-width: 30px;
|
border-radius: 2px;
|
}
|
::v-deep .el-pagination button:disabled {
|
color: #c0c4cc;
|
}
|
::v-deep .el-pagination .btn-next {
|
margin: 0 5px;
|
background-color: #f4f4f5;
|
color: #606266;
|
min-width: 30px;
|
border-radius: 2px;
|
}
|
</style>
|