储能智慧云平台web端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <template>
  2. <div>
  3. <div>
  4. <div class="title">
  5. {{ $t("station.SiteCard") }}
  6. <div class="title_time">{{ currentDate }}</div>
  7. </div>
  8. <el-card>
  9. <div class="search">
  10. <div class="search_choice">
  11. <div :class="searchtype == '' ? 'search_choice2' : 'search_choice1'" @click.stop="searchwhole('')">
  12. {{ $t("station.All") }}
  13. ({{ postmultinfo.stationPicArray.totalCnt }})
  14. </div>
  15. <div :class="searchtype == '1' ? 'search_choice2' : 'search_choice1'" @click.stop="searchwhole('1')">
  16. {{ $t("station.Online") }}
  17. ({{ postmultinfo.stationPicArray.onlineCnt }})
  18. </div>
  19. <div :class="searchtype == '0' ? 'search_choice2' : 'search_choice1'" @click.stop="searchwhole('0')">
  20. {{ $t("station.Offline") }}
  21. ({{ postmultinfo.stationPicArray.offlineCnt }})
  22. </div>
  23. </div>
  24. <div class="search_right">
  25. <div class="search_right" v-if="!foldtype" @click.stop="foldopen">
  26. <el-icon style="padding-top: 2px; margin-right: 8px"><ArrowDown /></el-icon>{{ $t("station.Expand") }}
  27. </div>
  28. <div class="search_right" v-if="foldtype" @click.stop="foldopen">
  29. <el-icon style="margin-top: 2px; margin-right: 8px"><ArrowUp /></el-icon>{{ $t("station.Collapse") }}
  30. </div>
  31. </div>
  32. </div>
  33. <div class="search_bottom" v-show="foldtype">
  34. <div>
  35. <el-cascader
  36. :props="props"
  37. v-model="selectedOptions"
  38. clearable
  39. size="large"
  40. placeholder="请选择服务地区"
  41. @change="oncascader"
  42. style="width: 360px; margin-right: 20px"
  43. />
  44. <el-button type="primary" size="large" color="#0052d9" @click="query(0)">{{ $t("station.Query") }}</el-button>
  45. <el-button size="large" @click="query(1)">{{ $t("station.Reset") }}</el-button>
  46. </div>
  47. <div>
  48. <el-popover placement="bottom-start" :width="400" :visible="visible">
  49. <template #reference>
  50. <el-input
  51. v-model="keyword"
  52. style="width: 400px"
  53. :placeholder="$t('station.SearchAddress')"
  54. size="large"
  55. clearable
  56. suffix-icon="Search"
  57. @focus="onfocusinput"
  58. @blur="onblurinput"
  59. @change="onchange"
  60. >
  61. </el-input>
  62. </template>
  63. <!-- <div class="popover_name" @click="onCategory(0)">全部:{{ keyword }}</div> -->
  64. <div class="popover_name" @click="onCategory(1)">{{ $t("station.PlantName") }}:{{ keyword }}</div>
  65. <!-- <div class="popover_name" @click="onCategory(2)">电站地址:{{ keyword }}</div> -->
  66. </el-popover>
  67. </div>
  68. </div>
  69. </el-card>
  70. <div class="topcard">
  71. <el-card
  72. v-for="(item, index) in postmultinfo.data.records"
  73. :key="index"
  74. :class="(index + 1) % 4 == 0 && index != 0 ? 'topcard_div1' : 'topcard_div2'"
  75. >
  76. <div>
  77. <img
  78. @click.stop="onJump(item.powerId)"
  79. class="topcard_img"
  80. :src="item.absoluteStationPicUrl"
  81. alt=""
  82. @mouseover.stop="handleMouseOver(index)"
  83. @mouseleave.stop="handleMouseLeave"
  84. />
  85. <div v-if="item.onlineStatus == 1" class="topcard_online">
  86. <div class="topcard_online1"></div>
  87. {{ $t("station.Online") }}
  88. </div>
  89. <div v-else class="topcard_online">
  90. <div class="topcard_online2"></div>
  91. {{ $t("station.Offline") }}
  92. </div>
  93. <div class="topcard_zhong">
  94. <el-card>
  95. <div class="el_card">
  96. <div>
  97. <div class="el_cardname">{{ item.installedCap }} <span class="el_cardunit">kWh</span></div>
  98. <div class="topcard_title">{{ $t("station.InstalledCapacity") }}</div>
  99. </div>
  100. <!-- <div>
  101. <div class="el_cardname">{{ item.installedCap }} <span class="el_cardunit">台/套</span></div>
  102. <div class="topcard_title">装机设备</div>
  103. </div> -->
  104. <div>
  105. <div class="el_cardname">{{ item.installedPower }} <span class="el_cardunit">kW</span></div>
  106. <div class="topcard_title">{{ $t("station.RatedPower") }}</div>
  107. </div>
  108. </div>
  109. </el-card>
  110. </div>
  111. <el-card class="topcard_bottom">
  112. <!-- <div class="topcard_bottom"> -->
  113. <div class="topcard_bottom_">
  114. <div class="topcard_bottom1">
  115. <div><i class="iconfont">&#xe62d;</i>{{ item.stationName }}</div>
  116. <i class="iconfont iconfontfont" @click="details(item)">&#xe61b;</i>
  117. </div>
  118. <div class="topcard_bottom2">
  119. <div class="topcard_title">{{ $t("station.CommissioningDate") }}:</div>
  120. <div>{{ item.operationDate }}</div>
  121. </div>
  122. <div class="topcard_bottom3">
  123. <div class="topcard_title">{{ $t("station.PlantAddress") }}:</div>
  124. <div class="topcard_Location">
  125. &nbsp;{{ item.detailedaddress }}
  126. <!-- <el-icon><Location /></el-icon> -->
  127. </div>
  128. </div>
  129. </div>
  130. <!-- </div> -->
  131. </el-card>
  132. <div v-if="isHovered == index" class="overlay"><i class="iconfont">&#xe62d;</i>{{ $t("station.EnterPlant") }}</div>
  133. </div>
  134. </el-card>
  135. </div>
  136. <el-dialog v-model="dialogVisible" :title="$t('station.ViewPlant')" width="800" :before-close="handleClose">
  137. <div class="dialog">
  138. <div :class="informationtype == 1 ? 'information' : 'more'" @click="oninformation">
  139. {{ $t("station.BasicInformation") }}
  140. </div>
  141. <div :class="informationtype == 2 ? 'information' : 'more'" @click="onmoreinformation">
  142. {{ $t("station.MoreDetails") }}
  143. </div>
  144. </div>
  145. <div v-if="informationtype == 1">
  146. <div class="more_img">
  147. <div class="more_name">{{ $t("station.PlantPhotos") }}:</div>
  148. <img class="dialogimg" :src="carditem.absoluteStationPicUrl" alt="" />
  149. </div>
  150. <div class="dialog_title">
  151. <div class="more_name">{{ $t("station.PlantName") }}:</div>
  152. <div class="more_theme">{{ carditem.stationName }}</div>
  153. </div>
  154. <div class="dialog_title">
  155. <div class="more_name">{{ $t("station.RatedPower") }}:</div>
  156. <div class="more_theme">{{ carditem.installedPower }}MW</div>
  157. </div>
  158. <div class="dialog_title">
  159. <div class="more_name">{{ $t("station.InstalledCapacity") }}:</div>
  160. <div class="more_theme">{{ carditem.installedCap }}kWh</div>
  161. </div>
  162. <div class="dialog_title">
  163. <div class="more_name">{{ $t("station.PlantAddress") }}:</div>
  164. <div class="more_theme">{{ carditem.province }}</div>
  165. </div>
  166. <div class="dialog_title">
  167. <div class="more_name">{{ $t("station.CommissioningDate") }}:</div>
  168. <div class="more_theme">{{ carditem.operationDate }}</div>
  169. </div>
  170. <div class="dialog_title">
  171. <div class="more_name">{{ $t("station.ContactNumber") }}:</div>
  172. <div class="more_theme">-</div>
  173. </div>
  174. </div>
  175. <div v-if="informationtype == 2">
  176. <div class="dialog_title">
  177. <div class="more_name">{{ $t("station.InstallationPhotos") }}:</div>
  178. <div class="more_theme">-</div>
  179. </div>
  180. <div class="dialog_title">
  181. <div class="more_name">{{ $t("station.GridConnectionInfo") }}:</div>
  182. <div class="more_theme">-</div>
  183. </div>
  184. <div class="dialog_title">
  185. <div class="more_name">{{ $t("station.TransformerSpecifications") }}:</div>
  186. <div class="more_theme">-</div>
  187. </div>
  188. <div class="dialog_title">
  189. <div class="more_name">{{ $t("station.TransformerCapacity") }}:</div>
  190. <div class="more_theme">-</div>
  191. </div>
  192. <div class="dialog_title">
  193. <div class="more_name">{{ $t("station.Installer") }}:</div>
  194. <div class="more_theme">-</div>
  195. </div>
  196. <div class="dialog_title">
  197. <div class="more_name">{{ $t("station.InstallerContact") }}:</div>
  198. <div class="more_theme">-</div>
  199. </div>
  200. </div>
  201. <div class="dialog_footer">
  202. <el-button @click="dialogVisible = false" size="large">{{ $t("station.Close") }}</el-button>
  203. </div>
  204. </el-dialog>
  205. </div>
  206. </div>
  207. </template>
  208. <!--
  209. -->
  210. <script setup lang="ts">
  211. import { multiStationpageinfo, getlistcountry, getliststate, getlistcity, getlistcounty } from "@/api/home/Multisite";
  212. import { CascaderOption, ElCascader, CascaderProps } from "element-plus";
  213. import { onMounted, Ref, ref } from "vue";
  214. import { useRouter } from "vue-router";
  215. const router = useRouter();
  216. const currentDate = ref();
  217. const postmultinfo = ref();
  218. const isHovered = ref(-1);
  219. const foldtype = ref(true);
  220. const visible = ref(false);
  221. const searchtype = ref("");
  222. const keyword = ref("");
  223. const keywordCategory = ref(0);
  224. const statecitycounty: Ref<any> = ref([]);
  225. const countrydata = ref();
  226. const statedata = ref();
  227. const citydata = ref();
  228. const countydata = ref();
  229. const selectedValue = ref();
  230. const postmultiStationpageinfo = async () => {
  231. let countryobj = { chineseName: "", code: "" };
  232. let stateobj = { chineseName: "", id: "" };
  233. let cityobj = { chineseName: "", id: "" };
  234. let countyobj = { chineseName: "", id: "" };
  235. if (selectedValue.value) {
  236. if (selectedValue.value[0]) {
  237. for (let index = 0; index < countrydata.value.length; index++) {
  238. if (selectedValue.value[0] == countrydata.value[index].id) {
  239. countryobj.chineseName = countrydata.value[index].chineseName;
  240. countryobj.code = countrydata.value[index].code;
  241. }
  242. }
  243. }
  244. if (selectedValue.value[1]) {
  245. for (let a = 0; a < statedata.value.length; a++) {
  246. if (selectedValue.value[1] == statedata.value[a].id) {
  247. stateobj.chineseName = statedata.value[a].chineseName;
  248. stateobj.id = statedata.value[a].id;
  249. }
  250. }
  251. }
  252. if (selectedValue.value[2]) {
  253. for (let i = 0; i < citydata.value.length; i++) {
  254. if (selectedValue.value[2] == citydata.value[i].id) {
  255. cityobj.chineseName = citydata.value[i].chineseName;
  256. cityobj.id = citydata.value[i].id;
  257. }
  258. }
  259. }
  260. if (selectedValue.value[3]) {
  261. for (let j = 0; j < countydata.value.length; j++) {
  262. if (selectedValue.value[3] == countydata.value[j].id) {
  263. countyobj.chineseName = countydata.value[j].chineseName;
  264. countyobj.id = countydata.value[j].id;
  265. }
  266. }
  267. }
  268. }
  269. let params = {
  270. state: stateobj.chineseName,
  271. city: cityobj.chineseName,
  272. country: countryobj.chineseName,
  273. county: countyobj.chineseName,
  274. keyword: keyword.value,
  275. keywordCategory: keywordCategory.value,
  276. countryCode: countryobj.code,
  277. provinceCode: stateobj.id,
  278. cityCode: cityobj.id,
  279. countyCode: countyobj.id,
  280. pn: 1,
  281. ps: 99,
  282. onlineStatus: searchtype.value
  283. };
  284. const { data } = await multiStationpageinfo(params);
  285. postmultinfo.value = data;
  286. };
  287. const handleMouseOver = (index: number) => {
  288. isHovered.value = index;
  289. };
  290. const handleMouseLeave = async () => {
  291. isHovered.value = -1;
  292. };
  293. // 收起
  294. const foldopen = () => {
  295. foldtype.value = !foldtype.value;
  296. };
  297. // 切换
  298. const searchwhole = (val: string) => {
  299. searchtype.value = val;
  300. postmultiStationpageinfo();
  301. };
  302. const props: CascaderProps = {
  303. lazy: true,
  304. checkStrictly: true,
  305. async lazyLoad(node, resolve) {
  306. // countrydata.value = [];
  307. // statedata.value = [];
  308. // citydata.value = [];
  309. // countydata.value = [];
  310. if (node.level == 0) {
  311. // node为当前点击的节点,resolve为数据加载完成的回调(必须调用)
  312. let nodes: CascaderOption[] | undefined = [];
  313. // 构造查询条件 => 接口入参
  314. let params = {
  315. id: node.value // 入参名按照自己的接口来改
  316. };
  317. // 请求接口
  318. let { data } = await getlistcountry(params);
  319. // console.log(Object.values(data));
  320. if (data) {
  321. countrydata.value = data;
  322. countrydata.value.map((item: { id: any; chineseName: any }) => {
  323. let obj = {
  324. value: item.id,
  325. label: item.chineseName,
  326. leaf: node.level >= 3 // 当 node.level 层级达到2级时, 就不再请求接口
  327. // 具体要多少级才不请求接口, 根据层级修改
  328. };
  329. nodes?.push(obj);
  330. });
  331. }
  332. //重新加载节点
  333. resolve(nodes);
  334. } else if (node.level == 1) {
  335. // node为当前点击的节点,resolve为数据加载完成的回调(必须调用)
  336. let nodes: CascaderOption[] | undefined = [];
  337. // 构造查询条件 => 接口入参
  338. let params = {
  339. countryId: node.value // 入参名按照自己的接口来改
  340. };
  341. // 请求接口
  342. let { data } = await getliststate(params);
  343. if (data) {
  344. statedata.value = data;
  345. statedata.value.map((item: { id: any; chineseName: any }) => {
  346. let obj = {
  347. value: item.id,
  348. label: item.chineseName,
  349. leaf: node.level >= 3 // 当 node.level 层级达到2级时, 就不再请求接口
  350. // 具体要多少级才不请求接口, 根据层级修改
  351. };
  352. nodes?.push(obj);
  353. });
  354. }
  355. //重新加载节点
  356. resolve(nodes);
  357. } else if (node.level == 2) {
  358. // node为当前点击的节点,resolve为数据加载完成的回调(必须调用)
  359. let nodes: CascaderOption[] | undefined = [];
  360. // 构造查询条件 => 接口入参
  361. let params = {
  362. stateId: node.value // 入参名按照自己的接口来改
  363. };
  364. // 请求接口
  365. let { data } = await getlistcity(params);
  366. if (data) {
  367. citydata.value = data;
  368. citydata.value.map((item: { id: any; chineseName: any }) => {
  369. let obj = {
  370. value: item.id,
  371. label: item.chineseName,
  372. leaf: node.level >= 3 // 当 node.level 层级达到2级时, 就不再请求接口
  373. // 具体要多少级才不请求接口, 根据层级修改
  374. };
  375. nodes?.push(obj);
  376. });
  377. }
  378. //重新加载节点
  379. resolve(nodes);
  380. } else if (node.level == 3) {
  381. // node为当前点击的节点,resolve为数据加载完成的回调(必须调用)
  382. let nodes: CascaderOption[] | undefined = [];
  383. // 构造查询条件 => 接口入参
  384. let params = {
  385. cityId: node.value // 入参名按照自己的接口来改
  386. };
  387. // 请求接口
  388. let { data } = await getlistcounty(params);
  389. countydata.value = data;
  390. if (data) {
  391. countydata.value.map((item: { id: any; chineseName: any }) => {
  392. let obj = {
  393. value: item.id,
  394. label: item.chineseName,
  395. leaf: true // 当 node.level 层级达到2级时, 就不再请求接口
  396. // 具体要多少级才不请求接口, 根据层级修改
  397. };
  398. nodes?.push(obj);
  399. });
  400. }
  401. //重新加载节点
  402. resolve(nodes);
  403. }
  404. }
  405. };
  406. const selectedOptions = ref(44);
  407. // 中国省市县
  408. const oncascader = async (selectedValues: any) => {
  409. selectedValue.value = selectedValues;
  410. };
  411. // 查询
  412. const query = (val: number) => {
  413. if (val == 1) {
  414. keyword.value = "";
  415. keywordCategory.value = 0;
  416. searchtype.value = "";
  417. statecitycounty.value = [];
  418. selectedOptions.value = 44;
  419. selectedValue.value = [44];
  420. }
  421. postmultiStationpageinfo();
  422. };
  423. // 搜索弹窗
  424. const onCategory = (val: number) => {
  425. keywordCategory.value = val;
  426. postmultiStationpageinfo();
  427. };
  428. // 获取焦点
  429. const onfocusinput = () => {
  430. visible.value = true;
  431. };
  432. // 获取失去
  433. const onblurinput = () => {
  434. visible.value = false;
  435. };
  436. // 获取失去
  437. const onchange = () => {
  438. postmultiStationpageinfo();
  439. };
  440. // 跳转页面
  441. const onJump = (e: any) => {
  442. console.log(e);
  443. router.push({
  444. path: "/overview/index",
  445. query: {
  446. powerId: e
  447. }
  448. });
  449. };
  450. const dialogVisible = ref(false);
  451. // 卡片详情对话框
  452. const carditem = ref();
  453. const details = (item: any) => {
  454. carditem.value = item;
  455. dialogVisible.value = true;
  456. };
  457. const informationtype = ref(1);
  458. const oninformation = () => {
  459. informationtype.value = 1;
  460. };
  461. const onmoreinformation = () => {
  462. informationtype.value = 2;
  463. };
  464. const handleClose = () => {
  465. dialogVisible.value = false;
  466. };
  467. onMounted(() => {
  468. const current = localStorage.getItem("currentDate");
  469. if (current) {
  470. currentDate.value = current;
  471. }
  472. postmultiStationpageinfo();
  473. });
  474. </script>
  475. <style scoped lang="scss">
  476. @import "./index.scss";
  477. </style>
  478. <!--
  479. -->