<template>
|
<el-dialog v-model="dialogVisible" title="选择区域" width="900px" draggable :fullscreen="full">
|
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
|
<el-row>
|
<el-col :span="18">
|
<el-form :inline="true" ref="ruleFormRef" :model="ruleForm" status-icon>
|
<el-form-item>
|
<el-input size="default" v-model="ruleForm.checkPass" placeholder="风险区域名称" style="max-width: 215px;" />
|
</el-form-item>
|
<el-form-item>
|
<el-button size="default" type="primary" @click="submitForm(ruleFormRef)" style="margin-left: 12px;">查询</el-button>
|
<el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button>
|
</el-form-item>
|
<el-button size="default" :icon="Delete" style="margin-left: 12px;">清除选择</el-button>
|
</el-form>
|
<el-table :data="tableData" style="width: 100%;margin-top:20px;">
|
<el-table-column type="selection" width="55" />
|
<el-table-column align="center" prop="name" label="风险区域名称"/>
|
</el-table>
|
<el-pagination
|
style="padding:20px 0;"
|
v-model:currentPage="currentPage4"
|
v-model:page-size="pageSize4"
|
:page-sizes="[100, 200, 300, 400]"
|
:small="small"
|
:disabled="disabled"
|
:background="background"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="400"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</el-col>
|
<el-col :span="6" style="padding-left: 15px;">
|
<el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)">
|
{{ tag }}
|
</el-tag>
|
</el-col>
|
</el-row>
|
<template #footer>
|
<span class="dialog-footer">
|
<el-button @click="dialogVisible = false" size="default">关闭</el-button>
|
<el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button>
|
</span>
|
</template>
|
</el-dialog>
|
</template>
|
<script lang="ts">
|
import {
|
defineComponent,
|
reactive,
|
ref
|
} from 'vue';
|
import {
|
Delete,
|
FullScreen
|
} from '@element-plus/icons-vue';
|
export default defineComponent({
|
setup() {
|
const dialogVisible = ref<boolean>(false);
|
const openDailog = () => {
|
dialogVisible.value = true;
|
};
|
// 搜索条件
|
const ruleForm = reactive({
|
checkPass: '',
|
});
|
// 表格
|
const tableData = [
|
{
|
name: '1#LNG储罐单元',
|
},
|
{
|
name: 'LNG装车区',
|
},
|
{
|
name: '丙烷储罐区',
|
},
|
{
|
name: '4#LNG储罐单元',
|
},
|
];
|
const pageSize4 = ref(100);
|
const handleSizeChange = (val: number) => {
|
console.log(`${val} items per page`);
|
};
|
const handleCurrentChange = (val: number) => {
|
console.log(`current page: ${val}`);
|
};
|
// 右方点击添加后显示标签
|
const dynamicTags = ref(['应急救援组', '工艺抢险组', '后勤保障组']);
|
const handleClose = (tag: string) => {
|
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
|
};
|
//全屏
|
const full = ref(false);
|
const toggleFullscreen = () => {
|
if (full.value == false) {
|
full.value = true;
|
} else {
|
full.value = false;
|
}
|
};
|
return {
|
dialogVisible,
|
openDailog,
|
ruleForm,
|
tableData,
|
pageSize4,
|
handleSizeChange,
|
handleCurrentChange,
|
dynamicTags,
|
handleClose,
|
Delete,
|
toggleFullscreen,
|
FullScreen,
|
full,
|
};
|
},
|
});
|
</script>
|
<style scoped>
|
.el-row {
|
padding: 0 0 20px 0;
|
}
|
.el-form--inline .el-form-item{
|
margin: 0;
|
}
|
</style>
|