|
|
@ -1,54 +1,84 @@ |
|
|
|
<template> |
|
|
|
<div style="padding: 16px;min-height: calc(100vh - 84px);display: flex; justify-content: center;align-items: center;"> |
|
|
|
<div class="div-box"> |
|
|
|
<div class="div-box-title"> 考勤签到管理系统 </div> |
|
|
|
<div class="div-ul"> |
|
|
|
<div class="div-li"> |
|
|
|
<div> |
|
|
|
<span>温度:</span>22.2℃ |
|
|
|
</div> |
|
|
|
<div> <span>湿度:</span>50% |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- ON:开启 OFF:关闭 --> |
|
|
|
<div class="div-li"> |
|
|
|
<div> |
|
|
|
<span>CO:</span>5PPM |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<span>预警:</span> |
|
|
|
<el-switch v-model="value2" active-color="#13ce66" inactive-color="#ff4949"> |
|
|
|
</el-switch> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="div-tips"><span>阈值设定:</span>30 <i class="el-icon-edit" |
|
|
|
style="color: rgb(64, 158, 255);margin-left: 4px;cursor: pointer;" @click="handleSettings"></i></div> |
|
|
|
</div> |
|
|
|
<!-- 添加或修改公告对话框 --> |
|
|
|
<el-dialog title="阈值设定" :visible.sync="open" width="780px" append-to-body> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
<div class="app-container"> |
|
|
|
<!-- <el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
plain |
|
|
|
size="mini" |
|
|
|
@click="handleAdd" |
|
|
|
>远程开锁</el-button> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> --> |
|
|
|
|
|
|
|
<el-form-item label="阈值" prop="noticeTitle"> |
|
|
|
<el-input v-model="form.noticeTitle" placeholder="请输入阈值" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
<el-button @click="open = false">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-table v-loading="loading" :data="noticeList" max-height="600"> |
|
|
|
<el-table-column label="序号" align="center" prop="noticeId" width="100" /> |
|
|
|
<el-table-column |
|
|
|
label="ID" |
|
|
|
align="center" |
|
|
|
prop="noticeTitle" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
min-width="100" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
label="时间" |
|
|
|
align="center" |
|
|
|
prop="noticeTitle" |
|
|
|
:show-overflow-tooltip="true" |
|
|
|
min-width="100" |
|
|
|
/> |
|
|
|
<el-table-column label="类型" align="center" prop="noticeType" min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { updateNotice } from "@/api/system/notice"; |
|
|
|
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "Index", |
|
|
|
name: "Notice", |
|
|
|
dicts: ['sys_notice_status', 'sys_notice_type'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
loading: true, |
|
|
|
// 选中数组 |
|
|
|
ids: [], |
|
|
|
// 非单个禁用 |
|
|
|
single: true, |
|
|
|
// 非多个禁用 |
|
|
|
multiple: true, |
|
|
|
// 显示搜索条件 |
|
|
|
showSearch: true, |
|
|
|
// 总条数 |
|
|
|
total: 0, |
|
|
|
// 公告表格数据 |
|
|
|
noticeList: [], |
|
|
|
// 弹出层标题 |
|
|
|
title: "", |
|
|
|
// 是否显示弹出层 |
|
|
|
open: false, |
|
|
|
value2: false, |
|
|
|
// 查询参数 |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
noticeTitle: undefined, |
|
|
|
createBy: undefined, |
|
|
|
status: undefined |
|
|
|
}, |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
// 表单校验 |
|
|
@ -59,85 +89,26 @@ export default { |
|
|
|
noticeType: [ |
|
|
|
{ required: true, message: "公告类型不能为空", trigger: "change" } |
|
|
|
] |
|
|
|
}, |
|
|
|
// 版本号 |
|
|
|
version: "3.8.9", |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 阈值设定弹窗 |
|
|
|
handleSettings() { |
|
|
|
this.open = true; |
|
|
|
this.form = { |
|
|
|
noticeTitle: "30", |
|
|
|
}; |
|
|
|
// this.$message.success(''); |
|
|
|
}, |
|
|
|
/** 提交按钮 */ |
|
|
|
submitForm: function() { |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
updateNotice(this.form).then(response => { |
|
|
|
this.$modal.msgSuccess("操作成功"); |
|
|
|
this.open = false; |
|
|
|
this.getList(); |
|
|
|
}); |
|
|
|
} |
|
|
|
/** 查询公告列表 */ |
|
|
|
getList() { |
|
|
|
this.loading = true; |
|
|
|
listNotice(this.queryParams).then(response => { |
|
|
|
this.noticeList = response.rows; |
|
|
|
this.total = response.total; |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd() { |
|
|
|
this.$message.success('操作成功'); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.div-box { |
|
|
|
width: 500px; |
|
|
|
box-sizing: border-box; |
|
|
|
padding: 16px; |
|
|
|
border: 1px solid #ccc; |
|
|
|
border-radius: 10px; |
|
|
|
|
|
|
|
.div-box-title { |
|
|
|
font-size: 20px; |
|
|
|
font-weight: bold; |
|
|
|
margin-bottom: 20px; |
|
|
|
text-align: center; |
|
|
|
border-bottom: 1px solid #ccc; |
|
|
|
padding-bottom: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.div-ul { |
|
|
|
.div-li>div:nth-of-type(1) { |
|
|
|
border-right: 1px solid #ccc; |
|
|
|
margin-right: 16px; |
|
|
|
} |
|
|
|
|
|
|
|
.div-li { |
|
|
|
font-size: 18px; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
margin-bottom: 12px; |
|
|
|
|
|
|
|
div { |
|
|
|
flex: 1; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
span { |
|
|
|
color: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.div-tips { |
|
|
|
font-size: 18px; |
|
|
|
line-height: 22px; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
span { |
|
|
|
color: #666; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|