|
@@ -3,137 +3,229 @@
|
|
|
<div class="query mg-b-8">
|
|
|
<div class="query-items">
|
|
|
<div class="query-item">
|
|
|
- <div class="lable">场站:</div>
|
|
|
+ <div class="lable">风场:</div>
|
|
|
<div class="search-input">
|
|
|
- <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select" @change="(wpId) => { getLine(); }">
|
|
|
+ <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select" @change="getWtArray">
|
|
|
<el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="query-item">
|
|
|
- <div class="lable">线路:</div>
|
|
|
+ <div class="lable">风机:</div>
|
|
|
<div class="search-input">
|
|
|
- <el-select v-model="lineId" clearable placeholder="请选择" popper-class="select">
|
|
|
- <el-option v-for="item in lineArray" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
+ <el-select v-model="wtId" clearable placeholder="请选择" popper-class="select">
|
|
|
+ <el-option v-for="item in wtArray" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="query-item">
|
|
|
- <div class="lable">日期:</div>
|
|
|
- <div class="search-input">
|
|
|
- <el-date-picker v-model="recorddate" type="date"
|
|
|
- value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
|
|
|
- </el-date-picker>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="lable">开始日期:</div>
|
|
|
+ <div class="search-input">
|
|
|
+ <el-date-picker v-model="starttime" type="date" value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <div class="lable">结束日期:</div>
|
|
|
+ <div class="search-input">
|
|
|
+ <el-date-picker v-model="endtime" type="date" value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="query-item">
|
|
|
+ <div class="lable">类型:</div>
|
|
|
+ <div class="search-input">
|
|
|
+ <el-select v-model="type" clearable placeholder="请选择" popper-class="select">
|
|
|
+ <el-option v-for="item in typeArray" :key="item.id" :value="item.id" :label="item.name" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="query-actions">
|
|
|
- <button class="btn green" @click="search">搜索</button>
|
|
|
+ <button class="btn green" @click="search()">查询</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <NormalScatterChart height="650px" :data="chartData" :showLegend="true" />
|
|
|
+ <div class="df-table">
|
|
|
+ <ComTable height="78vh" :data="tableData"></ComTable>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
|
|
|
+import ComTable from "@com/coms/table/table.vue";
|
|
|
export default {
|
|
|
// 名称
|
|
|
name: "cutAnalyse",
|
|
|
|
|
|
// 使用组件
|
|
|
components: {
|
|
|
- NormalScatterChart
|
|
|
+ ComTable
|
|
|
},
|
|
|
|
|
|
// 数据
|
|
|
data () {
|
|
|
+ const that = this;
|
|
|
return {
|
|
|
- isAsc: "asc",
|
|
|
wpArray: [],
|
|
|
- lineArray: [],
|
|
|
wpId: "",
|
|
|
- lineId:"",
|
|
|
- wtId: "MG01_01",
|
|
|
- recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
|
|
|
- chartData: [{
|
|
|
- title: "风资源分析",
|
|
|
- value: []
|
|
|
- }]
|
|
|
+ wtArray: [],
|
|
|
+ wtId: "",
|
|
|
+ type: "异动",
|
|
|
+ typeArray:[{
|
|
|
+ id: "检修",
|
|
|
+ label: "检修",
|
|
|
+ value: "检修"
|
|
|
+ }, {
|
|
|
+ id: "异动",
|
|
|
+ label: "异动",
|
|
|
+ value: "异动"
|
|
|
+ }, {
|
|
|
+ id: "故障",
|
|
|
+ label: "故障",
|
|
|
+ value: "故障"
|
|
|
+ }],
|
|
|
+ starttime: new Date().formatDate("yyyy-MM") + "-01",
|
|
|
+ endtime: new Date().formatDate("yyyy-MM-dd"),
|
|
|
+ tableData: {
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ name: "检修负责人",
|
|
|
+ field: "leader",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "检修类型",
|
|
|
+ field: "type",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "风机编号",
|
|
|
+ field: "wtnum",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "开始时间",
|
|
|
+ field: "starttime",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "结束时间",
|
|
|
+ field: "endtime",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "检修原因",
|
|
|
+ field: "problem",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "检修方式",
|
|
|
+ field: "solveway",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "设备唯一编号",
|
|
|
+ field: "eqnum",
|
|
|
+ is_num: false,
|
|
|
+ is_light: false,
|
|
|
+ sortable: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ data: [],
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
|
|
|
// 函数
|
|
|
methods: {
|
|
|
// 获取风场
|
|
|
- getWp (reGetWp) {
|
|
|
+ getWpArray () {
|
|
|
let that = this;
|
|
|
that.API.requestData({
|
|
|
method: "GET",
|
|
|
subUrl: "powercompare/windfarmAjax",
|
|
|
success (res) {
|
|
|
that.wpArray = res.data;
|
|
|
- that.wpId = res.data[0].id;
|
|
|
- that.getLine();
|
|
|
+ that.wpId = that.wpId || res.data[0].id;
|
|
|
+ that.getWtArray(that.wpId, true);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 获取线路
|
|
|
- getLine(){
|
|
|
+ // 获取风机
|
|
|
+ getWtArray (wpId, keepRequest) {
|
|
|
let that = this;
|
|
|
- that.API.requestData({
|
|
|
- method: "GET",
|
|
|
- subUrl: "powercompare/lineWpIdAjax",
|
|
|
- data:{
|
|
|
- wpId: that.wpId
|
|
|
- },
|
|
|
- success (res) {
|
|
|
- that.lineArray = res.data;
|
|
|
- that.lineId = res.data[0].id;
|
|
|
- that.getChartData();
|
|
|
- }
|
|
|
- });
|
|
|
+ if (wpId) {
|
|
|
+ that.API.requestData({
|
|
|
+ method: "GET",
|
|
|
+ subUrl: "powercompare/windturbineAjax",
|
|
|
+ data: {
|
|
|
+ wpId
|
|
|
+ },
|
|
|
+ success (res) {
|
|
|
+ that.wtArray = res.data;
|
|
|
+ const findRes = res.data.some(ele => {
|
|
|
+ return ele.id === that.wtId;
|
|
|
+ });
|
|
|
+ that.wtId = (findRes ? that.wtId : res.data[0].id);
|
|
|
+ that.getTableData();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.wtArray = [];
|
|
|
+ that.wtId = "";
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- // 获取图表数据
|
|
|
- getChartData () {
|
|
|
+ getTableData () {
|
|
|
let that = this;
|
|
|
- that.API.requestData({
|
|
|
- method: "POST",
|
|
|
- subUrl: "scatter/scatterAjax",
|
|
|
- data: {
|
|
|
- wpId: that.wpId,
|
|
|
- pjId: "",
|
|
|
- lnId: that.lineId,
|
|
|
- year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
|
|
|
- month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
|
|
|
- },
|
|
|
- success (res) {
|
|
|
- let chartData = [{
|
|
|
- title: "风资源分析",
|
|
|
- value: (res.data || [])
|
|
|
- }];
|
|
|
- that.$nextTick(()=>{
|
|
|
- that.chartData = chartData;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- search () {
|
|
|
- if (!this.wpId || !this.lineId) {
|
|
|
- this.BASE.showMsg({
|
|
|
- msg: '场站与线路为必选项'
|
|
|
+ if (!that.wpId || !that.starttime || !that.endtime) {
|
|
|
+ that.BASE.showMsg({
|
|
|
+ msg: "场站与日期不可为空"
|
|
|
});
|
|
|
} else {
|
|
|
- this.getChartData();
|
|
|
+ that.API.requestData({
|
|
|
+ method: "GET",
|
|
|
+ baseURL:"http://192.168.10.18:9988/",
|
|
|
+ subUrl: "equoperationrecord/list",
|
|
|
+ data: {
|
|
|
+ wtid: that.wtId,
|
|
|
+ starttime: that.starttime,
|
|
|
+ endtime: that.endtime,
|
|
|
+ type: that.type,
|
|
|
+ pagenum:1,
|
|
|
+ pagesize:50000
|
|
|
+ },
|
|
|
+ success (res) {
|
|
|
+ that.tableData.data = res.data.records;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ search () {
|
|
|
+ this.getTableData();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
created () {
|
|
|
- this.getWp();
|
|
|
+ this.getWpArray();
|
|
|
},
|
|
|
|
|
|
mounted () { },
|
|
@@ -164,7 +256,6 @@ export default {
|
|
|
overflow: auto;
|
|
|
flex-grow: 1;
|
|
|
margin-top: 1.481vh;
|
|
|
- height: 30vh;
|
|
|
|
|
|
&:before {
|
|
|
content: '';
|
|
@@ -181,4 +272,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|