储能智慧云平台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.

index.vue 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div>
  3. <div class="title">
  4. 电站管理
  5. <div class="title_time">{{ currentDate }}</div>
  6. </div>
  7. <!-- -->
  8. <el-card>
  9. <div class="selectsite">
  10. <el-button v-if="BUTTONS.powerStationadd" type="primary" size="large" color="#0052d9" @click="newaddition">
  11. 新增
  12. </el-button>
  13. <div class="selectsite_right">
  14. <div class="tabpane_1">电站状态:</div>
  15. <el-select v-model="Singlevalue" placeholder="Select" size="large" style="width: 240px" @change="postemsDevice">
  16. <el-option v-for="item in cities" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. &ensp;&ensp;&ensp;
  19. <el-input v-model="stationinput" style="width: 340px" size="large" placeholder="输入电站名称" />
  20. &ensp;&ensp;&ensp;
  21. <!-- newition -->
  22. <el-button type="primary" size="large" color="#0052d9" @click="getstationmanage">查询</el-button>
  23. <el-button size="large" @click="onselectreset">重置</el-button>
  24. </div>
  25. </div>
  26. <el-table :data="tableData.records" style="width: 100%" border>
  27. <el-table-column type="index" prop="date" label="序号" width="60" />
  28. <el-table-column prop="stationName" label="电站名称" width="180" />
  29. <el-table-column prop="installerName" label="安装人" />
  30. <el-table-column prop="contactPhone" label="安装人电话">
  31. <!-- <template #default="scope">
  32. {{ scope.row.pcsStatus == "" ? "-" : scope.row.pcsStatus }}
  33. </template> -->
  34. </el-table-column>
  35. <el-table-column prop="installedPower" label="装机功率(MW)" />
  36. <el-table-column prop="installedCap" label="装机容量(MWh)" />
  37. <el-table-column prop="country" label="电站地址">
  38. <template #default="scope"> {{ scope.row.country }} {{ scope.row.province }} {{ scope.row.city }} </template>
  39. </el-table-column>
  40. <el-table-column prop="operationDate" label="投运时间" />
  41. <el-table-column label="操作">
  42. <template #default="scope">
  43. <el-button @click="details(scope.row)">查看</el-button>
  44. <!-- <el-button type="primary" color="#0052d9" @click="newition(scope.row)">编辑</el-button> -->
  45. </template>
  46. </el-table-column>
  47. </el-table>
  48. <div class="example_block">
  49. <!-- 共&ensp;{{ tableData.records.length }}&ensp;<el-pagination
  50. layout="prev, pager, next"
  51. :total="tableData.records.length"
  52. @change="changemultiStationpagebase"
  53. /> -->
  54. <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
  55. </div>
  56. </el-card>
  57. <el-dialog v-model="dialogVisible" title="查看电站" width="800" :before-close="handleClose">
  58. <div class="dialog">
  59. <div :class="informationtype == 1 ? 'information' : 'more'" @click="nonformation">基础信息</div>
  60. <div :class="informationtype == 2 ? 'information' : 'more'" @click="onmoreinformation">更多信息</div>
  61. </div>
  62. <div v-if="informationtype == 1">
  63. <div class="more_img">
  64. <div class="more_name">电站图片:</div>
  65. <img class="dialogimg" :src="carditem.absoluteStationPicUrl" alt="" />
  66. </div>
  67. <div class="dialog_title">
  68. <div class="more_name">电站名称:</div>
  69. <div class="more_theme">{{ carditem.stationName }}</div>
  70. </div>
  71. <div class="dialog_title">
  72. <div class="more_name">装机功率:</div>
  73. <div class="more_theme">{{ carditem.installedPower }}MW</div>
  74. </div>
  75. <div class="dialog_title">
  76. <div class="more_name">装机容量:</div>
  77. <div class="more_theme">{{ carditem.installedCap }}MWh</div>
  78. </div>
  79. <div class="dialog_title">
  80. <div class="more_name">电站地址:</div>
  81. <div class="more_theme">{{ carditem.province }}</div>
  82. </div>
  83. <div class="dialog_title">
  84. <div class="more_name">投运时间:</div>
  85. <div class="more_theme">{{ carditem.operationDate }}</div>
  86. </div>
  87. <div class="dialog_title">
  88. <div class="more_name">电站联系电话:</div>
  89. <div class="more_theme">-</div>
  90. </div>
  91. </div>
  92. <div v-if="informationtype == 2">
  93. <div class="dialog_title">
  94. <div class="more_name">安装图片:</div>
  95. <div class="more_theme">-</div>
  96. </div>
  97. <div class="dialog_title">
  98. <div class="more_name">并网点信息:</div>
  99. <div class="more_theme">-</div>
  100. </div>
  101. <div class="dialog_title">
  102. <div class="more_name">变压器信息:</div>
  103. <div class="more_theme">-</div>
  104. </div>
  105. <div class="dialog_title">
  106. <div class="more_name">站点变压器容量:</div>
  107. <div class="more_theme">-</div>
  108. </div>
  109. <div class="dialog_title">
  110. <div class="more_name">安装人:</div>
  111. <div class="more_theme">-</div>
  112. </div>
  113. <div class="dialog_title">
  114. <div class="more_name">安装人联系号码:</div>
  115. <div class="more_theme">-</div>
  116. </div>
  117. </div>
  118. <div class="dialog_footer">
  119. <el-button @click="dialogVisible = false" size="large">关闭</el-button>
  120. </div>
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script setup lang="ts">
  125. import { onMounted, ref } from "vue";
  126. import { stationmanage } from "@/api/home/Multisite";
  127. import Pagination from "@/components/ProTable/components/Pagination.vue";
  128. import { useRouter } from "vue-router";
  129. import { useAuthButtons } from "@/hooks/useAuthButtons";
  130. const { BUTTONS } = useAuthButtons();
  131. console.log(BUTTONS);
  132. const router = useRouter();
  133. const currentDate = ref();
  134. const Singlevalue = ref("");
  135. const onlineStatus = ref("");
  136. const stationinput = ref("");
  137. const cities = ref([
  138. {
  139. name: "全部",
  140. id: ""
  141. },
  142. {
  143. name: "在线",
  144. id: "0"
  145. },
  146. {
  147. name: "离线",
  148. id: "1"
  149. }
  150. ]);
  151. const tableData = ref();
  152. const getstationmanage = async () => {
  153. let params = {
  154. onlineStatus: onlineStatus.value,
  155. keyword: stationinput.value,
  156. pn: pageable.value.pn,
  157. ps: pageable.value.ps
  158. };
  159. const { data } = await stationmanage(params);
  160. tableData.value = data;
  161. pageable.value.total = tableData.value.total;
  162. };
  163. const postemsDevice = async (value: any) => {
  164. onlineStatus.value = value;
  165. };
  166. const onselectreset = () => {
  167. onlineStatus.value = "";
  168. stationinput.value = "";
  169. pageable.value.pn = 1;
  170. getstationmanage();
  171. };
  172. const pageable = ref({
  173. ps: 10,
  174. pn: 1,
  175. total: 0
  176. });
  177. const handleSizeChange = async (e: any) => {
  178. pageable.value.ps = e;
  179. getstationmanage();
  180. };
  181. const handleCurrentChange = async (e: any) => {
  182. pageable.value.pn = e;
  183. getstationmanage();
  184. };
  185. // const changemultiStationpagebase = async (value: any) => {
  186. // pageSize.value = value;
  187. // getstationmanage();
  188. // };
  189. // 卡片详情对话框
  190. const dialogVisible = ref(false);
  191. const carditem = ref();
  192. const details = (item: any) => {
  193. carditem.value = item;
  194. console.log(carditem);
  195. dialogVisible.value = true;
  196. };
  197. const informationtype = ref(1);
  198. const nonformation = () => {
  199. informationtype.value = 1;
  200. };
  201. const onmoreinformation = () => {
  202. informationtype.value = 2;
  203. };
  204. const handleClose = () => {
  205. dialogVisible.value = false;
  206. };
  207. // 新增
  208. const newaddition = () => {
  209. router.push({
  210. path: "/powerStation/addition",
  211. query: {
  212. type: "电站新增", // 传递的参数
  213. id: ""
  214. }
  215. });
  216. };
  217. // 编辑
  218. // const newition = (row: any) => {
  219. // router.push({
  220. // path: "/powerStation/addition",
  221. // query: {
  222. // type: "电站编辑", // 传递的参数
  223. // id: row.id
  224. // }
  225. // });
  226. // };
  227. onMounted(() => {
  228. const current = localStorage.getItem("currentDate");
  229. if (current) {
  230. currentDate.value = current;
  231. }
  232. getstationmanage();
  233. });
  234. </script>
  235. <style scoped lang="scss">
  236. @import "./index.scss";
  237. </style>
  238. <!--
  239. -->