SafetyAlertSystem-ui/src/views/base/warnAlert/index.vue

105 lines
2.7 KiB
Vue
Raw Normal View History

2024-09-20 14:34:45 +08:00
<template>
<!-- 工程管理页面 -->
<div class="app-container">
<!-- 表格 -->
<TableModel
:formLabel="formLabel"
:columnsList="columnsList"
:request-api="queryWarnAlertListApi"
ref="tableRef"
>
2024-09-20 18:05:19 +08:00
<template slot="btn" slot-scope="{ queryParams }">
2024-09-20 14:34:45 +08:00
<el-button
2024-09-20 18:05:19 +08:00
@click="
handleExportData(
exportList,
'base/tbDevAttribute/export',
'异常记录',
queryParams
)
"
2024-09-20 14:34:45 +08:00
icon="el-icon-upload2"
size="mini"
2024-09-20 18:05:19 +08:00
>导出数据</el-button
2024-09-20 14:34:45 +08:00
>
2024-09-20 18:05:19 +08:00
</template>
2024-09-20 14:34:45 +08:00
<template slot="handle" slot-scope="{ data }">
<el-button
type="primary"
size="mini"
v-if="data.status === '未处置'"
@click="handleWarnData(data)"
2024-09-20 18:05:19 +08:00
>处理</el-button
2024-09-20 14:34:45 +08:00
>
2024-09-24 16:37:50 +08:00
<span v-else>-</span>
2024-09-20 14:34:45 +08:00
</template>
<template slot="warnName" slot-scope="{ data }">
2024-09-20 18:05:19 +08:00
<span v-if="data.warnName == null || data.warnName === ''"></span>
2024-09-20 14:34:45 +08:00
<span v-else>{{ data.warnName }}</span>
</template>
<template slot="remarks" slot-scope="{ data }">
2024-09-24 16:37:50 +08:00
<!-- <span v-if="data.remarks == null || data.remarks === ''">-</span>-->
<span>{{ data.remarks || '-' }}</span>
2024-09-20 14:34:45 +08:00
</template>
</TableModel>
2024-09-20 18:05:19 +08:00
<!-- 处理时的弹框 -->
<DialogModel
2024-09-20 14:34:45 +08:00
:dialogConfig="dialogConfig"
@closeDialogOuter="closeDialogOuter"
>
<template slot="outerContent">
<!-- 新增以及修改数据的表单组件 -->
2024-09-20 18:05:19 +08:00
<FormWarnAlert :editParams="editParams" @closeDialog="closeDialog" />
2024-09-20 14:34:45 +08:00
</template>
</DialogModel>
</div>
</template>
<script>
import {
2024-09-20 18:05:19 +08:00
formLabel,
columnsList,
dialogConfig,
queryDeviceTypes,
} from "./config";
import { commonMixin } from "../mixins/common";
import { queryWarnAlertListApi } from "@/api/base/warnAlert";
import FormWarnAlert from "./components/form-warnAlert.vue";
2024-09-20 14:34:45 +08:00
export default {
2024-09-20 18:05:19 +08:00
name: "WarnAlert",
2024-09-20 14:34:45 +08:00
methods: {
queryWarnAlertListApi,
handleWarnData(v) {
2024-09-20 18:05:19 +08:00
this.editParams = v;
this.dialogConfig.outerVisible = true;
this.dialogConfig.outerTitle = "处理异常记录";
2024-09-20 14:34:45 +08:00
// this.dialogConfig.dialogWidth = '50%'
// this.dialogConfig.dialogHeight = '50%'
// this.dialogConfig.dialogType = 'exam'
},
},
mixins: [commonMixin],
components: {
2024-09-20 18:05:19 +08:00
FormWarnAlert,
2024-09-20 14:34:45 +08:00
},
created() {
2024-09-20 18:05:19 +08:00
queryDeviceTypes();
2024-09-20 14:34:45 +08:00
},
data() {
return {
// 搜索区表单配置项
formLabel,
// 表格导出id列表
dialogConfig,
exportList: [],
// 列表区配置项
columnsList,
// 弹框区配置项
2024-09-20 18:05:19 +08:00
};
2024-09-20 14:34:45 +08:00
},
2024-09-20 18:05:19 +08:00
};
2024-09-20 14:34:45 +08:00
</script>