| | |
| | | <template> |
| | | <div> |
| | | <basic-container> |
| | | <el-form :model="queryParams" ref="queryForm" label-width="120px" class="special-form"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | label-width="120px" |
| | | class="special-form" |
| | | > |
| | | <el-row :gutter="24"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="限值类型名称" prop="limitName"> |
| | | <el-input |
| | | v-model="queryParams.limitName" |
| | | placeholder="请输入限值类型名称" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | v-model="queryParams.limitName" |
| | | placeholder="请输入限值类型名称" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18"> |
| | | <el-form-item class="operation"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >搜索</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >重置</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row :gutter="10" class="mb8" style="margin-bottom: 19px"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['basicsetting:limitType:add']" |
| | | >新增 |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['basicsetting:limitType:add']" |
| | | >新增 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['basicsetting:limitType:edit']" |
| | | >修改 |
| | | type="success" |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['basicsetting:limitType:edit']" |
| | | >修改 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['basicsetting:limitType:remove']" |
| | | >删除 |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['basicsetting:limitType:remove']" |
| | | >删除 |
| | | </el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | |
| | | <!-- >导出</el-button>--> |
| | | <!-- </el-col>--> |
| | | </el-row> |
| | | <el-table :height="height" v-loading="loading" :data="limitTypeList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center"/> |
| | | <el-table-column label="限值类型名称" align="center" prop="limitName"/> |
| | | <el-table-column label="限值类型编号" align="center" prop="limitCode"/> |
| | | <el-table-column label="报警限制类型" align="center" prop="alarmType" :formatter="typeFormat"/> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="limitTypeList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="限值类型名称" align="center" prop="limitName" /> |
| | | <el-table-column label="限值类型编号" align="center" prop="limitCode" /> |
| | | <el-table-column |
| | | label="报警限制类型" |
| | | align="center" |
| | | prop="alarmType" |
| | | :formatter="typeFormat" |
| | | /> |
| | | <el-table-column label="色号" align="center" prop="colorNumber"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :color="scope.row.colorNumber" disable-transitions></el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="比较运算符" align="center" prop="comparatorOperator"/> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column |
| | | label="比较运算符" |
| | | align="center" |
| | | prop="comparatorOperator" |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['basicsetting:limitType:edit']" |
| | | >修改 |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['basicsetting:limitType:edit']" |
| | | >修改 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['basicsetting:limitType:remove']" |
| | | >删除 |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['basicsetting:limitType:remove']" |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </basic-container> |
| | | <!-- 添加或修改报警限值类型维护对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="限值类型名称" prop="limitName"> |
| | | <el-input v-model="form.limitName" placeholder="请输入限值类型名称"/> |
| | | <el-input v-model="form.limitName" placeholder="请输入限值类型名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="限值类型编号" prop="limitCode"> |
| | | <el-input v-model="form.limitCode" placeholder="请输入限值类型编码"/> |
| | | <el-input v-model="form.limitCode" placeholder="请输入限值类型编码" /> |
| | | </el-form-item> |
| | | <el-form-item label="报警限制类型" prop="alarmType"> |
| | | <el-select v-model="form.alarmType" placeholder="请选择报警限制类型" clearable size="small"> |
| | | <el-select |
| | | v-model="form.alarmType" |
| | | placeholder="请选择报警限制类型" |
| | | clearable |
| | | size="small" |
| | | > |
| | | <el-option |
| | | v-for="item in alarmTypeList" |
| | | :key="item.dictValue" |
| | | :label="item.dictLabel" |
| | | :value="item.dictValue"> |
| | | v-for="item in alarmTypeList" |
| | | :key="item.dictValue" |
| | | :label="item.dictLabel" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="色号" prop="colorNumber"> |
| | | <el-color-picker |
| | | v-model="form.colorNumber" |
| | | color-format="hex" |
| | | :predefine="predefineColors"> |
| | | v-model="form.colorNumber" |
| | | color-format="hex" |
| | | :predefine="predefineColors" |
| | | > |
| | | </el-color-picker> |
| | | </el-form-item> |
| | | <el-form-item label="比较运算符" prop="comparatorOperator"> |
| | | <el-select v-model="form.comparatorOperator" placeholder="比较运算符" clearable size="small"> |
| | | <el-option label="大于" value=">"/> |
| | | <el-option label="大于等于" value=">="/> |
| | | <el-option label="小于" value="<"/> |
| | | <el-option label="小于等于" value="<="/> |
| | | <el-option label="等于" value="="/> |
| | | <el-select |
| | | v-model="form.comparatorOperator" |
| | | placeholder="比较运算符" |
| | | clearable |
| | | size="small" |
| | | > |
| | | <el-option label="大于" value=">" /> |
| | | <el-option label="大于等于" value=">=" /> |
| | | <el-option label="小于" value="<" /> |
| | | <el-option label="小于等于" value="<=" /> |
| | | <el-option label="等于" value="=" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | mixins: [mixins], |
| | | data() { |
| | | return { |
| | | height:null, |
| | | height: null, |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | limitName: undefined, |
| | | limitName: undefined |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | limitName: [ |
| | | {required: true, message: "限值类型名称不能为空", trigger: "blur"} |
| | | { required: true, message: "限值类型名称不能为空", trigger: "blur" } |
| | | ], |
| | | limitCode: [ |
| | | {required: true, message: "限值类型编码不能为空", trigger: "blur"} |
| | | ], |
| | | { required: true, message: "限值类型编码不能为空", trigger: "blur" } |
| | | ] |
| | | }, |
| | | //色号选择器 |
| | | predefineColors: [ |
| | | '#ff4500', |
| | | '#ff8c00', |
| | | '#ffd700', |
| | | '#90ee90', |
| | | '#00ced1', |
| | | '#1e90ff', |
| | | '#c71585' |
| | | "#ff4500", |
| | | "#ff8c00", |
| | | "#ffd700", |
| | | "#90ee90", |
| | | "#00ced1", |
| | | "#1e90ff", |
| | | "#c71585" |
| | | ] |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getDicts("alarm_type").then(response => { |
| | | this.alarmTypeList = response.data; |
| | | this.alarmTypeDefaultVal = this.alarmTypeList.find(f => f.isDefault === 'Y'); |
| | | this.alarmTypeDefaultVal = this.alarmTypeList.find( |
| | | f => f.isDefault === "Y" |
| | | ); |
| | | }); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | setCharts() { |
| | | this.bodyStyle = { |
| | | height: window.innerHeight - 210 + 'px', |
| | | overflow: 'hidden' |
| | | } |
| | | this.height = window.innerHeight - 370; |
| | | height: window.innerHeight - 220 + "px", |
| | | overflow: "hidden" |
| | | }; |
| | | // this.height = window.innerHeight - 370; |
| | | }, |
| | | /** 查询报警限值类型维护列表 */ |
| | | getList() { |
| | |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.limitName = selection.map(item => item.limitName) |
| | | this.single = selection.length != 1 |
| | | this.multiple = !selection.length |
| | | this.ids = selection.map(item => item.id); |
| | | this.limitName = selection.map(item => item.limitName); |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | console.log(JSON.stringify(selection)); |
| | | }, |
| | | /** 新增按钮操作 */ |
| | |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | const id = row.id || this.ids; |
| | | getLimitType(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm: function () { |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | // console.log(JSON.stringify(this.form)) |
| | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$confirm('是否确认删除报警限值类型维护名称为"' + ids + '"的数据项?', "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(function () { |
| | | return delLimitType(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("删除成功"); |
| | | }).catch(function () { |
| | | }); |
| | | this.$confirm( |
| | | '是否确认删除报警限值类型维护名称为"' + ids + '"的数据项?', |
| | | "警告", |
| | | { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | } |
| | | ) |
| | | .then(function() { |
| | | return delLimitType(ids); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(function() {}); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | const queryParams = this.queryParams; |
| | | this.$confirm('是否确认导出所有报警限值类型维护数据项?', "警告", { |
| | | this.$confirm("是否确认导出所有报警限值类型维护数据项?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(function () { |
| | | return exportLimitType(queryParams); |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | }).catch(function () { |
| | | }); |
| | | }) |
| | | .then(function() { |
| | | return exportLimitType(queryParams); |
| | | }) |
| | | .then(response => { |
| | | this.download(response.msg); |
| | | }) |
| | | .catch(function() {}); |
| | | }, |
| | | initAlarmType() { |
| | | for (let i = 0; i < this.model.energyindexList.length; i++) { |
| | | let ndy = ""; |
| | | getAlarmType(this.model.energyindexList[i].indexId).then(response => { |
| | | if (response.code == '200') { |
| | | if (response.code == "200") { |
| | | if (response.msg == "1") { |
| | | this.model.energyindexList[i].indexCategory = "启动"; |
| | | } else if (response.msg == "2") { |
| | |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |