index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <div class="siteManage-main variableList">
  3. <!-- 筛选start -->
  4. <div class="filter-container mb-20">
  5. <div class="left">
  6. <div>
  7. <a class="" style="margin-right: 30px">【测试站点1】站点的所有变量</a>
  8. <el-button icon="el-icon-plus" type="success" @click="addItem()"
  9. >新增</el-button
  10. >
  11. <el-button icon="el-icon-refresh" type="primary"
  12. >同步配置到采集器</el-button
  13. >
  14. </div>
  15. <div style="margin-top: 20px">
  16. <el-button @click="select=1" :type="select==1 ? 'primary' : ''" >模拟量</el-button>
  17. <el-button @click="select=2" :type="select==2 ? 'primary' : ''">状态量</el-button>
  18. <el-button @click="select=3" :type="select==3 ? 'primary' : ''">参数量</el-button>
  19. <el-input
  20. placeholder="搜索变量或编码"
  21. style="width: 200px"
  22. ></el-input>
  23. <el-button type="primary" icon="el-icon-search" class="search-button"
  24. >搜索</el-button
  25. >
  26. </div>
  27. <!-- <el-radio-group v-model="tabPosition" style="margin-top: 20px">
  28. <el-radio-button label="one">模拟量</el-radio-button>
  29. <el-radio-button label="two">状态量</el-radio-button>
  30. <el-radio-button label="three">参数量</el-radio-button>
  31. </el-radio-group> -->
  32. </div>
  33. <div class="right">
  34. <el-button type="primary">导入</el-button>
  35. <el-button type="primary">导出</el-button>
  36. </div>
  37. </div>
  38. <!-- 筛选end -->
  39. <!-- 表格start -->
  40. <el-table :data="tableData" border stripe :header-cell-style="headClass" :default-sort="{prop: 'date', order: 'descending'}">
  41. <el-table-column
  42. fixed
  43. prop="watchStatus"
  44. label="状态"
  45. width="50"
  46. align="center"
  47. >
  48. <template #default >
  49. <el-avatar class="status"></el-avatar>
  50. </template>
  51. </el-table-column>
  52. <el-table-column prop="watchName" label="序号" width="" sortable>
  53. </el-table-column>
  54. <el-table-column prop="watchCode" label="变量名" width="" sortable>
  55. </el-table-column>
  56. <el-table-column prop="ratedVoltage" label="变量编号" width="" sortable>
  57. </el-table-column>
  58. <el-table-column prop="ratedCurrent" label="监控设备" width="">
  59. </el-table-column>
  60. <el-table-column prop="fzlMx" label="通信设备" width="">
  61. </el-table-column>
  62. <el-table-column prop="powerAnalysis" label="数据地址" width="">
  63. </el-table-column>
  64. <el-table-column prop="watchAddress" label="数据类型" width="">
  65. </el-table-column>
  66. <el-table-column prop="watchAddress" label="系数" width="">
  67. </el-table-column>
  68. <el-table-column prop="watchAddress" label="存盘周期" width="">
  69. </el-table-column>
  70. <el-table-column fixed="right" label="操作" width="180">
  71. <template #default="scope">
  72. <el-button
  73. type="text"
  74. size="small"
  75. @click.prevent="editRow(scope.row)"
  76. >修改</el-button
  77. >
  78. <el-button
  79. @click="handleDelete(scope.$index, scope.row)"
  80. type="text"
  81. size="small"
  82. class="delete-text"
  83. >删除</el-button
  84. >
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <!-- 表格end -->
  89. <!-- 分页start -->
  90. <div class="paginationBlock">
  91. <el-pagination
  92. @size-change="handleSizeChange"
  93. @current-change="handleCurrentChange"
  94. :current-page="currentPage4"
  95. :page-sizes="[100, 200, 300, 400]"
  96. :page-size="100"
  97. layout="total, sizes, prev, pager, next, jumper"
  98. :total="400"
  99. >
  100. </el-pagination>
  101. </div>
  102. <!-- 分页end -->
  103. <!--弹框组件开始-----------------------start-->
  104. <dialog-component
  105. v-if="showDialog"
  106. ref="dialogComponent"
  107. :dialog-title="dialogTitle"
  108. :item-info="tableItem"
  109. @closeDialog="closeDialog"
  110. ></dialog-component>
  111. <!--弹框组件开始-----------------------end-->
  112. </div>
  113. </template>
  114. <script>
  115. import DialogComponent from "./dialogComponent";
  116. export default {
  117. name: "VariableList",
  118. components: { DialogComponent },
  119. data() {
  120. return {
  121. select:1,
  122. currentPage4: 4,
  123. showDialog: false,
  124. tabPosition: "one",
  125. input: "请输入状态",
  126. tableData: [
  127. {
  128. ratedVoltage: "10KV",
  129. watchName: "测试设备1",
  130. watchCode: "cssb1",
  131. ratedCurrent: "58A",
  132. fzlMx: "80%",
  133. powerAnalysis: "开启",
  134. watchAddress: "1",
  135. },
  136. {
  137. ratedVoltage: "10KV",
  138. watchName: "测试设备1",
  139. watchCode: "cssb1",
  140. ratedCurrent: "58A",
  141. fzlMx: "80%",
  142. powerAnalysis: "开启",
  143. watchAddress: "1",
  144. },
  145. {
  146. ratedVoltage: "10KV",
  147. watchName: "测试设备1",
  148. watchCode: "cssb1",
  149. ratedCurrent: "58A",
  150. fzlMx: "80%",
  151. powerAnalysis: "开启",
  152. watchAddress: "1",
  153. },
  154. {
  155. ratedVoltage: "10KV",
  156. watchName: "测试设备1",
  157. watchCode: "cssb1",
  158. ratedCurrent: "58A",
  159. fzlMx: "80%",
  160. powerAnalysis: "开启",
  161. watchAddress: "1",
  162. },
  163. {
  164. ratedVoltage: "10KV",
  165. watchName: "测试设备1",
  166. watchCode: "cssb1",
  167. ratedCurrent: "58A",
  168. fzlMx: "80%",
  169. powerAnalysis: "开启",
  170. watchAddress: "1",
  171. },
  172. {
  173. ratedVoltage: "10KV",
  174. watchName: "测试设备1",
  175. watchCode: "cssb1",
  176. ratedCurrent: "58A",
  177. fzlMx: "80%",
  178. powerAnalysis: "开启",
  179. watchAddress: "1",
  180. },
  181. {
  182. ratedVoltage: "10KV",
  183. watchName: "测试设备1",
  184. watchCode: "cssb1",
  185. ratedCurrent: "58A",
  186. fzlMx: "80%",
  187. powerAnalysis: "开启",
  188. watchAddress: "1",
  189. },
  190. {
  191. ratedVoltage: "10KV",
  192. watchName: "测试设备1",
  193. watchCode: "cssb1",
  194. ratedCurrent: "58A",
  195. fzlMx: "80%",
  196. powerAnalysis: "开启",
  197. watchAddress: "1",
  198. },
  199. {
  200. ratedVoltage: "10KV",
  201. watchName: "测试设备1",
  202. watchCode: "cssb1",
  203. ratedCurrent: "58A",
  204. fzlMx: "80%",
  205. powerAnalysis: "开启",
  206. watchAddress: "1",
  207. },
  208. {
  209. ratedVoltage: "10KV",
  210. watchName: "测试设备1",
  211. watchCode: "cssb1",
  212. ratedCurrent: "58A",
  213. fzlMx: "80%",
  214. powerAnalysis: "开启",
  215. watchAddress: "1",
  216. },
  217. {
  218. ratedVoltage: "10KV",
  219. watchName: "测试设备1",
  220. watchCode: "cssb1",
  221. ratedCurrent: "58A",
  222. fzlMx: "80%",
  223. powerAnalysis: "开启",
  224. watchAddress: "1",
  225. },
  226. {
  227. ratedVoltage: "10KV",
  228. watchName: "测试设备1",
  229. watchCode: "cssb1",
  230. ratedCurrent: "58A",
  231. fzlMx: "80%",
  232. powerAnalysis: "开启",
  233. watchAddress: "1",
  234. },
  235. {
  236. ratedVoltage: "10KV",
  237. watchName: "测试设备1",
  238. watchCode: "cssb1",
  239. ratedCurrent: "58A",
  240. fzlMx: "80%",
  241. powerAnalysis: "开启",
  242. watchAddress: "1",
  243. },
  244. {
  245. ratedVoltage: "10KV",
  246. watchName: "测试设备1",
  247. watchCode: "cssb1",
  248. ratedCurrent: "58A",
  249. fzlMx: "80%",
  250. powerAnalysis: "开启",
  251. watchAddress: "1",
  252. },
  253. {
  254. ratedVoltage: "10KV",
  255. watchName: "测试设备1",
  256. watchCode: "cssb1",
  257. ratedCurrent: "58A",
  258. fzlMx: "80%",
  259. powerAnalysis: "开启",
  260. watchAddress: "1",
  261. },
  262. {
  263. ratedVoltage: "10KV",
  264. watchName: "测试设备1",
  265. watchCode: "cssb1",
  266. ratedCurrent: "58A",
  267. fzlMx: "80%",
  268. powerAnalysis: "开启",
  269. watchAddress: "1",
  270. },
  271. ],
  272. };
  273. },
  274. methods: {
  275. handleSizeChange(val) {
  276. console.log(`每页 ${val} 条`);
  277. },
  278. handleCurrentChange(val) {
  279. console.log(`当前页: ${val}`);
  280. },
  281. // 表头样式设置
  282. goVariableList() {
  283. // 跳转至订单列表页面传参
  284. this.$router.push({
  285. path: "../siteManage/variableList/index.vue",
  286. });
  287. // this.$router.push({ name:'variableList'})
  288. },
  289. headClass() {
  290. return "background:#FAFAFA;";
  291. },
  292. // 添加操作
  293. addItem() {
  294. this.tableItem = {
  295. id: "",
  296. stationName: "",
  297. watchName: "",
  298. watchCode: "",
  299. siteList: [],
  300. done: "",
  301. guaZai: "",
  302. checked: true,
  303. };
  304. this.dialogTitle = "新增";
  305. this.showDialog = true;
  306. this.$nextTick(() => {
  307. this.$refs["dialogComponent"].showDialog = true;
  308. });
  309. },
  310. // 编辑操作
  311. editRow(row) {
  312. console.log(row);
  313. this.tableItem = row;
  314. this.dialogTitle = "编辑";
  315. this.showDialog = true;
  316. this.$nextTick(() => {
  317. this.$refs["dialogComponent"].showDialog = true;
  318. });
  319. },
  320. // 关闭操作
  321. closeDialog(flag) {
  322. if (flag) {
  323. // 重新刷新表格内容
  324. this.fetchData();
  325. }
  326. this.showDialog = false;
  327. },
  328. //删除操作
  329. handleDelete(index, row) {
  330. console.log(index, row);
  331. alert(index);
  332. },
  333. },
  334. };
  335. </script>
  336. <style lang="scss" scoped>
  337. </style>