|
@@ -0,0 +1,588 @@
|
|
|
+<template>
|
|
|
+ <div class="heardSearchBox">
|
|
|
+ <el-form label-width="60px" inline>
|
|
|
+ <el-form-item label="类别:">
|
|
|
+ <el-select
|
|
|
+ v-model="tagListNode"
|
|
|
+ style="width: 80px"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ getOrganizationLists(val, true);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-show="item.flag"
|
|
|
+ v-for="(item, indexe) in tagList"
|
|
|
+ :key="indexe"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.type"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构:">
|
|
|
+ <el-select
|
|
|
+ v-model="checkNode"
|
|
|
+ style="width: 140px"
|
|
|
+ :placeholder="parentNode?.aname"
|
|
|
+ clearable
|
|
|
+ :multiple="companyMultiple"
|
|
|
+ collapse-tags
|
|
|
+ @change="
|
|
|
+ (val) => {
|
|
|
+ this.dataChang(val);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, indexe) in OrganizationLists"
|
|
|
+ :key="indexe"
|
|
|
+ :label="item.aname"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="场站:">
|
|
|
+ <el-select
|
|
|
+ v-model="checkStation"
|
|
|
+ style="width: 160px"
|
|
|
+ placeholder="全部场站"
|
|
|
+ clearable
|
|
|
+ :multiple="stationMultiple"
|
|
|
+ collapse-tags
|
|
|
+ @change="getProjectList"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in stationList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.aname"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="项目:" v-if="!hiddenProject">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="projectObj"
|
|
|
+ style="width: 160px"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="GetLineList"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in projectList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.aname"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="线路:" v-if="!hiddenLine">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="lineObj"
|
|
|
+ style="width: 120px"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ @change="getWtList"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in lineList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.aname"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备:">
|
|
|
+ <el-select
|
|
|
+ v-model="wtId"
|
|
|
+ style="width: 120px"
|
|
|
+ placeholder="全部设备"
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ @change="emitProps"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in wtList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.aname"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="日期:">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="dateRange"
|
|
|
+ style="width: 260px"
|
|
|
+ popper-class="heardSearchDatePlcier"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ size="small"
|
|
|
+ format="YYYY/MM/DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ @change="emitProps"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <template v-for="(btn, btnIndex) in buttons">
|
|
|
+ <el-button
|
|
|
+ round
|
|
|
+ size="small"
|
|
|
+ class="buttons"
|
|
|
+ :key="btnIndex"
|
|
|
+ :disabled="btn.disabled"
|
|
|
+ @click="btn.callback"
|
|
|
+ v-if="!btn.hide"
|
|
|
+ >{{ btn.label }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ GetOrganization,
|
|
|
+ GetStationByCompany,
|
|
|
+ GeWtList,
|
|
|
+ GetProjectList,
|
|
|
+ GetLineList,
|
|
|
+} from "@/api/headerNav.js";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "HomeNav", //首页标题栏
|
|
|
+ props: {
|
|
|
+ type: {
|
|
|
+ type: Number,
|
|
|
+ default: -2,
|
|
|
+ },
|
|
|
+ handType: String,
|
|
|
+ codeRight: String,
|
|
|
+ codeNums: String, // 公司Code
|
|
|
+ stationCode: String, // 场站Code
|
|
|
+ shangeColor: String,
|
|
|
+ hiddenStation: {
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ },
|
|
|
+ hiddenProject: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ hiddenLine: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ hiddenWtList: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ hiddenSearch: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ stationMultiple: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ companyMultiple: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ intoCheckNode: {
|
|
|
+ // 是否需要默认选中公司,将codeRight(公司code)传给checkNode,
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ date: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [
|
|
|
+ `${new Date().formatDate("yyyy-MM")}-01`,
|
|
|
+ new Date().formatDate("yyyy-MM-dd"),
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ buttons: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ OrganizationLists: [{ id: "JS_RGN", aname: "江苏区域" }], //公司列表
|
|
|
+ stationList: [], //场站列表
|
|
|
+ checkStation: "", //场站值
|
|
|
+ checkNode: "JS_RGN", //公司值
|
|
|
+ tagList: [
|
|
|
+ { type: -1, flag: true, id: "F", name: "风电" },
|
|
|
+ { type: -2, flag: true, id: "G", name: "光伏" }, //类型
|
|
|
+ ],
|
|
|
+ tagListNode: -2, //类型值
|
|
|
+ projectObj: "",
|
|
|
+ projectList: [],
|
|
|
+ lineObj: "",
|
|
|
+ lineList: [],
|
|
|
+ dateRange: [],
|
|
|
+ wtId: "",
|
|
|
+ wtList: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.dateRange = this.date;
|
|
|
+
|
|
|
+ await this.getOrganizationLists(this.tagListNode, true);
|
|
|
+
|
|
|
+ if (this.shangeColor != "") {
|
|
|
+ this.s = this.shangeColor;
|
|
|
+ } else {
|
|
|
+ this.s = "all";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 获取区域公司
|
|
|
+ async getOrganizationLists(val, flag) {
|
|
|
+ const { data } = await GetOrganization({ type: val });
|
|
|
+ this.OrganizationLists = data;
|
|
|
+ if (!flag) {
|
|
|
+ this.tagList.forEach((item) => {
|
|
|
+ if (item.id != val) {
|
|
|
+ item.flag = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.checkNode = this.checkNode || data?.[0]?.id || "";
|
|
|
+
|
|
|
+ if (this.checkNode) {
|
|
|
+ this.getPowerStation(this.checkNode);
|
|
|
+ } else {
|
|
|
+ this.stationList = [];
|
|
|
+ this.emitProps("checkNode");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deepClone(ob) {
|
|
|
+ var obj = JSON.stringify(ob);
|
|
|
+ var objClone = JSON.parse(obj);
|
|
|
+ return objClone;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 区域切换
|
|
|
+ dataChang(id) {
|
|
|
+ //根据区域公司编码获取场站信息
|
|
|
+ this.checkStation = "";
|
|
|
+ this.checkNode = id;
|
|
|
+ if (id && id != "JS_RGN") {
|
|
|
+ let comp = this.OrganizationLists.find((item) => item.id == id);
|
|
|
+ this.tagList.forEach((item) => {
|
|
|
+ if (item?.id != comp?.eleType) {
|
|
|
+ item.flag = false;
|
|
|
+ } else {
|
|
|
+ item.flag = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tagListNode = comp?.eleType == "F" ? -1 : -2;
|
|
|
+ } else {
|
|
|
+ this.tagList = [
|
|
|
+ { type: -1, flag: true, id: "F", name: "风电" },
|
|
|
+ { type: -2, flag: true, id: "G", name: "光伏" },
|
|
|
+ ];
|
|
|
+ this.tagListNode = this.tagList[0].type;
|
|
|
+ }
|
|
|
+ if (id?.length > 0) {
|
|
|
+ this.getPowerStation(id);
|
|
|
+ } else {
|
|
|
+ this.stationList = [];
|
|
|
+ this.projectList = [];
|
|
|
+ this.lineList = [];
|
|
|
+ this.emitProps("tagListNode");
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取场站信息
|
|
|
+ async getPowerStation(val) {
|
|
|
+ const { data } = await GetStationByCompany({
|
|
|
+ companyids: val,
|
|
|
+ type: this.tagListNode,
|
|
|
+ });
|
|
|
+ this.stationList = data;
|
|
|
+
|
|
|
+ let checkStation = null;
|
|
|
+ if (this.stationMultiple) {
|
|
|
+ if (!Array.isArray(this.checkStation) || !checkStation?.length) {
|
|
|
+ this.checkStation = [data?.[0]?.id || ""];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.checkStation = this.checkStation || data?.[0]?.id;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.checkStation?.length) {
|
|
|
+ this.getProjectList();
|
|
|
+ } else {
|
|
|
+ this.projectList = [];
|
|
|
+ this.lineList = [];
|
|
|
+ this.emitProps("checkStation");
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ async getProjectList() {
|
|
|
+ await GetProjectList(this.checkStation).then((res) => {
|
|
|
+ this.projectList = res.data;
|
|
|
+ this.projectObj = res.data?.[0]?.id;
|
|
|
+ if (this.projectObj) {
|
|
|
+ this.getLineList();
|
|
|
+ } else {
|
|
|
+ this.lineList = [];
|
|
|
+ this.emitProps("projectObj");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ async getLineList() {
|
|
|
+ await GetLineList(this.projectObj).then((res) => {
|
|
|
+ this.lineList = res.data;
|
|
|
+ this.lineObj = res.data?.[0]?.id || "";
|
|
|
+
|
|
|
+ if (this.lineObj) {
|
|
|
+ this.getWtList();
|
|
|
+ } else {
|
|
|
+ this.wtList = [];
|
|
|
+ this.emitProps();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ async getWtList() {
|
|
|
+ await GeWtList(this.lineObj).then((res) => {
|
|
|
+ this.wtList = res.data;
|
|
|
+ this.wtId = res.data?.[0]?.id || "";
|
|
|
+ this.emitProps();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ emitProps(resetKey) {
|
|
|
+ let resetValue = false;
|
|
|
+ const rinseArray = [
|
|
|
+ "tagListNode",
|
|
|
+ "checkNode",
|
|
|
+ "checkStation",
|
|
|
+ "projectObj",
|
|
|
+ "lineObj",
|
|
|
+ "wtId",
|
|
|
+ ];
|
|
|
+ rinseArray.forEach((key) => {
|
|
|
+ if (resetValue) {
|
|
|
+ this[key] = null;
|
|
|
+ }
|
|
|
+ if (key === resetKey) {
|
|
|
+ resetValue = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$emit("firstRender", {
|
|
|
+ category: this.tagListNode,
|
|
|
+ orgId: this.checkNode,
|
|
|
+ station: this.checkStation,
|
|
|
+ wtId: this.wtId,
|
|
|
+ project: this.projectObj,
|
|
|
+ line: this.lineObj,
|
|
|
+ dateRange: this.dateRange,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ type: {
|
|
|
+ handler(val) {
|
|
|
+ if (val == -1) {
|
|
|
+ this.tagListNode = -1;
|
|
|
+ } else if (val == -2) {
|
|
|
+ this.tagListNode = -2;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+::v-deep .el-input__suffix {
|
|
|
+ display: inline-block;
|
|
|
+ right: 0 !important;
|
|
|
+ width: 80px !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-input__suffix .el-icon-circle-close {
|
|
|
+ position: absolute;
|
|
|
+ top: -7px !important;
|
|
|
+ right: 18px !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-input__suffix .el-icon-arrow-up {
|
|
|
+ display: block !important;
|
|
|
+
|
|
|
+ right: -52px !important;
|
|
|
+}
|
|
|
+
|
|
|
+ul {
|
|
|
+ user-select: none;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .headerRight {
|
|
|
+ padding: 0 14px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ background: rgba(0, 70, 199, 0.2);
|
|
|
+ border-radius: 16px;
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 15px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ span {
|
|
|
+ width: 29px;
|
|
|
+ height: 12px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #b3b3b3;
|
|
|
+ }
|
|
|
+
|
|
|
+ i {
|
|
|
+ font-size: 16px;
|
|
|
+ color: #b3b3b3;
|
|
|
+ position: relative;
|
|
|
+ margin-right: 9px;
|
|
|
+ vertical-align: -9%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .forbidden {
|
|
|
+ background: #666666;
|
|
|
+ opacity: 0.5;
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: #b3b3b3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .active {
|
|
|
+ background: rgba(0, 70, 199, 0.4);
|
|
|
+
|
|
|
+ .active_icon {
|
|
|
+ color: rgba(28, 153, 255, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav_right {
|
|
|
+ transition: 0.3s;
|
|
|
+ }
|
|
|
+
|
|
|
+ .nav_right:first-of-type {
|
|
|
+ margin-left: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ p {
|
|
|
+ width: 60px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rightTitle {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.active.light {
|
|
|
+ background: rgba(255, 131, 0, 0.2);
|
|
|
+
|
|
|
+ i {
|
|
|
+ color: rgba(255, 131, 0, 1);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.active.wind {
|
|
|
+ background-color: rgba(0, 70, 199, 0.4);
|
|
|
+
|
|
|
+ i {
|
|
|
+ color: #1c99ff;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.active.hydraulic {
|
|
|
+ background-color: rgba(0, 252, 255, 0.2);
|
|
|
+
|
|
|
+ i {
|
|
|
+ color: #00fcff;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.active.energy {
|
|
|
+ background-color: rgba(230, 59, 13, 0.2);
|
|
|
+
|
|
|
+ i {
|
|
|
+ color: #e63b0d;
|
|
|
+ }
|
|
|
+}
|
|
|
+.station {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Microsoft YaHei;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #b3b3b3;
|
|
|
+ margin-right: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.but {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-content: center;
|
|
|
+ margin-left: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.buttons {
|
|
|
+ background-color: rgba(0, 70, 199, 0.2);
|
|
|
+ border: 1px solid #3b4c6c;
|
|
|
+ color: #b3b3b3;
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ &:hover,
|
|
|
+ &.active {
|
|
|
+ background-color: rgba(0, 70, 199, 0.5);
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+.heardSearchBox {
|
|
|
+ .el-range-input {
|
|
|
+ background: rgba(67, 81, 107, 0.2);
|
|
|
+ color: #b3b3b3;
|
|
|
+ }
|
|
|
+ .el-select .el-input__inner {
|
|
|
+ width: 100%;
|
|
|
+ max-width: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.heardSearchDatePlcier {
|
|
|
+ .el-date-table td.in-range div {
|
|
|
+ background: rgba(67, 81, 107, 0.5);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|