| | |
| | | <template> |
| | | <div class="app-container" style="padding:0"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" class="query-form"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | | label-width="68px" |
| | | class="query-form" |
| | | > |
| | | <el-form-item label="指标编码" prop="code"> |
| | | <el-input |
| | | v-model="queryParams.code" |
| | |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >搜索</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-row :gutter="10" class="mb8"> |
| | |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="tableData" v-loading="loading" border @selection-change="" @cell-click="openDlg" > |
| | | <el-table |
| | | :data="tableData" |
| | | v-loading="loading" |
| | | border |
| | | @selection-change="" |
| | | @cell-click="openDlg" |
| | | > |
| | | <el-table-column label="指标编码" align="center" prop="name"/> |
| | | <el-table-column label="指标名称" align="center" prop="number"/> |
| | | <el-table-column label="实际值" align="center" prop="value"/> |
| | |
| | | <el-table-column label="上限值" align="center" prop="code"/> |
| | | <el-table-column label="报警次数" align="center" prop="what"> |
| | | <template slot-scope="scope"> |
| | | <div style="color:blue;text-decoration:underline ;cursor:pointer">{{scope.row.what}}</div> |
| | | <div style="color:blue;text-decoration:underline ;cursor:pointer"> |
| | | {{ scope.row.what }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--弹框--> |
| | | <el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal="false" > |
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="1000px" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-row style="padding:16px 16px 0;margin-bottom:32px;"> |
| | | <line-chart :chart-data="lineChartData" /> |
| | | </el-row> |
| | | <el-table :data="tableData" :show-header="hiddenTableHeader" border="1px" > |
| | |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | const lineChartData = { |
| | | newVisitis: { |
| | | } |
| | | } |
| | | newVisitis: {} |
| | | }; |
| | | import { |
| | | addEnergyindex, |
| | | delEnergyindex, |
| | |
| | | listEnergyindex, |
| | | updateEnergyindex |
| | | } from "@/api/basicsetting/energyindex"; |
| | | import LineChart from './LiChart' |
| | | |
| | | |
| | | import LineChart from "./LiChart"; |
| | | |
| | | export default { |
| | | name: 'energyIndex', |
| | | name: "energyIndex", |
| | | components: { |
| | | LineChart |
| | | }, |
| | |
| | | unitIdOptions: [], |
| | | // 查询参数 |
| | | lineChartData:{ |
| | | newVisitis:null, |
| | | newVisitis: null |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | }, |
| | | |
| | | tableData: [], |
| | | datas: [{ |
| | | name: 'BUG', |
| | | number: '98013', |
| | | value: '500', |
| | | values: '450', |
| | | code: '480', |
| | | what: '5', |
| | | one: '报警时间', |
| | | two: '0点', |
| | | three: '1点', |
| | | four : '2点', |
| | | five :'3点', |
| | | six : '4点', |
| | | seven :'5点', |
| | | eieght:'6点', |
| | | datas: [ |
| | | { |
| | | name: "BUG", |
| | | number: "98013", |
| | | value: "500", |
| | | values: "450", |
| | | code: "480", |
| | | what: "5", |
| | | one: "报警时间", |
| | | two: "0点", |
| | | three: "1点", |
| | | four: "2点", |
| | | five: "3点", |
| | | six: "4点", |
| | | seven: "5点", |
| | | eieght: "6点" |
| | | }, |
| | | { |
| | | name: 'BUG', |
| | | number: '98013', |
| | | value : '500', |
| | | values : '450', |
| | | code : '480', |
| | | what: '5', |
| | | one :'报警限值', |
| | | two :'210', |
| | | three :'172', |
| | | four : '181', |
| | | five :'224', |
| | | six : '280', |
| | | seven :'310', |
| | | eieght:'300', |
| | | name: "BUG", |
| | | number: "98013", |
| | | value: "500", |
| | | values: "450", |
| | | code: "480", |
| | | what: "5", |
| | | one: "报警限值", |
| | | two: "210", |
| | | three: "172", |
| | | four: "181", |
| | | five: "224", |
| | | six: "280", |
| | | seven: "310", |
| | | eieght: "300" |
| | | }, |
| | | { |
| | | name: 'BUG', |
| | | number: '98013', |
| | | value : '500', |
| | | values : '450', |
| | | code : '480' , |
| | | what: '5', |
| | | one :'报警时值', |
| | | two :'300', |
| | | three :'182', |
| | | four : '191', |
| | | five :'234', |
| | | six : '290', |
| | | seven :'330', |
| | | eieght:'310', |
| | | name: "BUG", |
| | | number: "98013", |
| | | value: "500", |
| | | values: "450", |
| | | code: "480", |
| | | what: "5", |
| | | one: "报警时值", |
| | | two: "300", |
| | | three: "182", |
| | | four: "191", |
| | | five: "234", |
| | | six: "290", |
| | | seven: "330", |
| | | eieght: "310" |
| | | } |
| | | ], |
| | | |
| | |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: "指标名称不能为空", trigger: "blur"}, |
| | | {min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur'} |
| | | ], code: [ |
| | | { min: 2, max: 20, message: "长度在 2 到 20 个字符", trigger: "blur" } |
| | | ], |
| | | code: [ |
| | | {required: true, message: "指标编码不能为空", trigger: "blur"}, |
| | | {min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur'}, |
| | | {pattern: /^[a-zA-Z][A-Za-z0-9_-]+$/, message: '必须为数字、字母、- 或_ ,且首字符只能为字母'} |
| | | ], indexCategory: [ |
| | | { |
| | | min: 2, |
| | | max: 20, |
| | | message: "长度在 2 到 20 个字符", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z][A-Za-z0-9_-]+$/, |
| | | message: "必须为数字、字母、- 或_ ,且首字符只能为字母" |
| | | } |
| | | ], |
| | | indexCategory: [ |
| | | {required: true, message: "请选择指标分类", trigger: "blur"} |
| | | ] |
| | | }, |
| | |
| | | /* this.getList();*/ |
| | | this.getDicts("sys_index_category").then(response => { |
| | | this.indexCategoryOptions = response.data; |
| | | this.indexCategoryDefaultVal = this.indexCategoryOptions.find(f => f.isDefault === 'Y'); |
| | | this.indexCategoryDefaultVal = this.indexCategoryOptions.find( |
| | | f => f.isDefault === "Y" |
| | | ); |
| | | }); |
| | | this.getDicts("sys_unit").then(response => { |
| | | this.unitIdOptions = response.data; |
| | | this.unitDefaultVal = this.unitIdOptions.find(f => f.isDefault === 'Y'); |
| | | this.unitDefaultVal = this.unitIdOptions.find(f => f.isDefault === "Y"); |
| | | }); |
| | | setInterval(this.getList(), 30000); |
| | | |
| | | this.bpy() |
| | | |
| | | this.bpy(); |
| | | }, |
| | | methods: { |
| | | /** 查询指标信息列表 */ |
| | |
| | | } else { |
| | | this.energyindexList = []; |
| | | } |
| | | |
| | | }, |
| | | bpy() { |
| | | this.tableData = this.datas; |
| | |
| | | this.open=true; |
| | | } |
| | | } |
| | | |
| | | }; |
| | | </script> |