index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选start -->
  4. <div class="filter-container mb-20">
  5. <div>
  6. <span class="" style="margin-right: 30px">现场档案列表</span>
  7. <el-button icon="Plus" type="success" @click="addItem()">新增</el-button>
  8. </div>
  9. </div>
  10. <div class="filter-container mb-20">
  11. <div class="filter-item">
  12. 站点:
  13. <el-select v-model="region" placeholder="请选择" style="width: 150px">
  14. <el-option label="站点一" value="1"></el-option>
  15. <el-option label="站点二" value="2"></el-option>
  16. </el-select>
  17. </div>
  18. <div class="filter-item">
  19. 电试日期:
  20. <el-date-picker v-model="value4" type="dates" placeholder="请选择" style="width: 150px">
  21. </el-date-picker>
  22. </div>
  23. <div class="filter-item">
  24. 状态:
  25. <el-select v-model="region" placeholder="请选择" style="width: 200px">
  26. <el-option label="已执行" value="1"></el-option>
  27. <el-option label="未执行" value="2"></el-option>
  28. </el-select>
  29. </div>
  30. <el-button type="primary" icon="Search" class="search-button">搜索</el-button>
  31. <el-button type="primary">导出</el-button>
  32. </div>
  33. <!-- 筛选end -->
  34. <!-- 表格start -->
  35. <el-table :data="tableData" border stripe :header-cell-style="headClass" :cell-style="cellStyle">
  36. <el-table-column prop="xh" label="序号" width="">
  37. </el-table-column>
  38. <el-table-column prop="siteName" label="站点名称" width="">
  39. </el-table-column>
  40. <el-table-column prop="siteCode" label="站点编号" width="">
  41. </el-table-column>
  42. <el-table-column prop="siteRoute" label="线路" width="">
  43. </el-table-column>
  44. <el-table-column prop="supervision" label="监察" width="">
  45. </el-table-column>
  46. <el-table-column prop="updataTime" label="更新时间" width="">
  47. </el-table-column>
  48. <el-table-column prop="defect" label="缺陷统计" width="">
  49. </el-table-column>
  50. <el-table-column fixed="right" label="操作" width="180">
  51. <template #default="scope">
  52. <el-button @click="checkVideo(scope.$index, scope.row)" type="danger" size="small" link>查看</el-button>
  53. <el-button type="primary" size="small" @click.prevent="editRow(scope.row)" link>编辑</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <!-- 表格end -->
  58. <!-- 分页start -->
  59. <div class="paginationBlock">
  60. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage4"
  61. :page-sizes="[100, 200, 300, 400]" :page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="400">
  62. </el-pagination>
  63. </div>
  64. <!-- 分页end -->
  65. <!--弹框组件开始-----------------------start-->
  66. <dialog-component v-if="showDialog" ref="dialogComponent" :dialog-title="dialogTitle" :item-info="tableItem"
  67. @closeDialog="closeDialog"></dialog-component>
  68. <!--弹框组件开始-----------------------end-->
  69. <!--弹框组件开始-----------------------start-->
  70. <check-video v-if="showDialog" ref="checkVideo" :dialog-title="dialogTitle" :item-info="tableItem"
  71. @closeDialog="closeDialog"></check-video>
  72. <!--视频弹框组件开始-----------------------end-->
  73. </div>
  74. </template>
  75. <script>
  76. import DialogComponent from "./dialogComponent";
  77. import checkVideo from "./checkVideo";
  78. export default {
  79. name: "VariableList",
  80. components: { DialogComponent, checkVideo },
  81. data() {
  82. return {
  83. select: 1,
  84. currentPage4: 4,
  85. value4: "请选择",
  86. showDialog: true,
  87. region: "",
  88. tableData: [
  89. {
  90. xh: "1",
  91. siteName: "测试站点1",
  92. siteCode: "cszd1",
  93. siteRoute: "变线1",
  94. supervision: "李四",
  95. updataTime: "2021-09-22 18:22:22",
  96. defect: "5",
  97. },
  98. {
  99. xh: "1",
  100. siteName: "测试站点1",
  101. siteCode: "cszd1",
  102. siteRoute: "变线1",
  103. supervision: "李四",
  104. updataTime: "2021-09-22 18:22:22",
  105. defect: "10",
  106. },
  107. {
  108. xh: "1",
  109. siteName: "测试站点1",
  110. siteCode: "cszd1",
  111. siteRoute: "变线1",
  112. supervision: "李四",
  113. updataTime: "2021-09-22 18:22:22",
  114. defect: "4",
  115. },
  116. {
  117. xh: "1",
  118. siteName: "测试站点1",
  119. siteCode: "cszd1",
  120. siteRoute: "变线1",
  121. supervision: "李四",
  122. updataTime: "2021-09-22 18:22:22",
  123. defect: "3",
  124. },
  125. {
  126. xh: "1",
  127. siteName: "测试站点1",
  128. siteCode: "cszd1",
  129. siteRoute: "变线1",
  130. supervision: "李四",
  131. updataTime: "2021-09-22 18:22:22",
  132. defect: "2",
  133. },
  134. ],
  135. };
  136. },
  137. methods: {
  138. handleSizeChange(val) {
  139. console.log(`每页 ${val} 条`);
  140. },
  141. handleCurrentChange(val) {
  142. console.log(`当前页: ${val}`);
  143. },
  144. // 表头样式设置
  145. headClass() {
  146. return "background:#FAFAFA;";
  147. },
  148. // 查看视频
  149. checkVideo() {
  150. this.tableItem = {
  151. id: "",
  152. stationName: "",
  153. watchName: "",
  154. watchCode: "",
  155. siteList: [],
  156. done: "",
  157. guaZai: "",
  158. checked: true,
  159. resource: ''
  160. };
  161. this.dialogTitle = "现场档案详情";
  162. this.showDialog = true;
  163. this.$nextTick(() => {
  164. this.$refs["checkVideo"].showDialog = true;
  165. });
  166. },
  167. // 添加操作
  168. addItem() {
  169. this.tableItem = {
  170. id: "",
  171. stationName: "",
  172. xh: "",
  173. siteName: "",
  174. siteList: [],
  175. done: "",
  176. guaZai: "",
  177. checked: true,
  178. };
  179. this.dialogTitle = "新增";
  180. this.showDialog = true;
  181. this.$nextTick(() => {
  182. this.$refs["dialogComponent"].showDialog = true;
  183. });
  184. },
  185. // 编辑操作
  186. editRow(row) {
  187. console.log(row);
  188. this.tableItem = row;
  189. this.dialogTitle = "编辑";
  190. this.showDialog = true;
  191. this.$nextTick(() => {
  192. this.$refs["dialogComponent"].showDialog = true;
  193. });
  194. },
  195. // 关闭操作
  196. closeDialog(flag) {
  197. if (flag) {
  198. // 重新刷新表格内容
  199. this.fetchData();
  200. }
  201. this.showDialog = false;
  202. },
  203. },
  204. };
  205. </script>
  206. <style lang="scss" scoped></style>