assetssMag.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <div class="global-variable">
  3. <div class="condition">
  4. <el-form
  5. :inline="true"
  6. ref="ruleForm"
  7. :model="formInline"
  8. class="demo-form-inline"
  9. :rules="rules"
  10. >
  11. <el-form-item label="风场名称:" prop="fieldName">
  12. <el-input
  13. size="small"
  14. v-model="formInline.fieldName"
  15. placeholder="请输入风场名称"
  16. ></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" @click="onSubmit" size="small"
  20. >查询</el-button
  21. >
  22. <el-button @click="reset('ruleForm')" size="small">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25. </div>
  26. <div class="list-page">
  27. <el-table
  28. v-loading="loading"
  29. class="center-align-table"
  30. :data="tableData"
  31. border
  32. :cell-style="rowStyle"
  33. >
  34. <el-table-column
  35. align="center"
  36. fixed
  37. prop="fieldName"
  38. label="风场名称"
  39. width="100"
  40. >
  41. </el-table-column>
  42. <el-table-column align="center" label="批次编号" prop="batchCode">
  43. </el-table-column>
  44. <el-table-column prop="loginName" align="center" label="分析状态">
  45. <template slot-scope="scope">
  46. <span>
  47. {{
  48. scope.row.analysisState == 0
  49. ? "分析中"
  50. : scope.row.analysisState == -1
  51. ? "未分析"
  52. : scope.row.analysisState == 1
  53. ? "分析完成"
  54. : "/"
  55. }}</span
  56. >
  57. </template>
  58. </el-table-column>
  59. <el-table-column
  60. prop="errState"
  61. align="center"
  62. label="异常状态"
  63. width="100"
  64. >
  65. <template slot-scope="scope">
  66. <span>
  67. {{
  68. scope.row.errState == 0
  69. ? "未异常"
  70. : scope.row.errState == 1
  71. ? "异常"
  72. : "/"
  73. }}</span
  74. >
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="roleName" align="center" label="异常信息">
  78. <template slot-scope="scope">
  79. <el-button
  80. v-if="scope.row.errState == 1"
  81. @click="abnormalDialog(scope.row, '异常详情')"
  82. type="text"
  83. size="small"
  84. >异常详情</el-button
  85. >
  86. <span v-else>/</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="roleName" align="center" label="分析记录">
  90. <template slot-scope="scope">
  91. <el-button
  92. v-if="scope.row.analysisState == 1 && scope.row.errState !== 1"
  93. @click="handleAssetssDetail(scope.row)"
  94. type="text"
  95. size="small"
  96. >分析详情</el-button
  97. >
  98. <span v-else>/</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column prop="createTime" align="center" label="创建时间">
  102. </el-table-column>
  103. <el-table-column
  104. prop="transition"
  105. align="center"
  106. fixed="right"
  107. label="操作"
  108. width="200"
  109. >
  110. <template slot-scope="scope">
  111. <el-button
  112. @click="handleAssetss(scope.row)"
  113. type="text"
  114. size="small"
  115. >分析</el-button
  116. >
  117. <el-button
  118. @click="abnormalDialog(scope.row, '异常描述')"
  119. type="text"
  120. size="small"
  121. >异常描述</el-button
  122. >
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <div class="pagination-container">
  127. <el-pagination
  128. @current-change="handleCurrentChange"
  129. :current-page.sync="formInline.pageNum"
  130. layout="total, prev, pager, next"
  131. :page-size="formInline.pageSize"
  132. :total="formInline.totalSize"
  133. >
  134. </el-pagination>
  135. </div>
  136. </div>
  137. <!-- 弹出层 -->
  138. <!-- 异常信息 /异常描述-->
  139. <my-dialog
  140. :visible="dialogVisible"
  141. :errorInfo="errorInfo"
  142. :title="title"
  143. :rowInfo="rowInfo"
  144. @confirm="handleConfirm"
  145. >
  146. <div slot="tableEl">
  147. <el-empty description="暂无数据"></el-empty>
  148. </div>
  149. </my-dialog>
  150. </div>
  151. </template>
  152. <script>
  153. import MyDialog from "./components/dialogCom.vue";
  154. import { getAnalysisResultList } from "@/api/performance";
  155. export default {
  156. components: {
  157. MyDialog,
  158. },
  159. data() {
  160. return {
  161. dialogVisible: false,
  162. loadingView: false,
  163. loading: false, //数据加载中
  164. errorInfo: "",
  165. rules: {
  166. fieldName: { trigger: "blur" },
  167. },
  168. roleList: [],
  169. formInline: {
  170. fieldName: undefined,
  171. pageNum: 1,
  172. pageSize: 10,
  173. totalSize: 0,
  174. },
  175. tableData: [],
  176. rowInfo: {},
  177. title: "",
  178. };
  179. },
  180. created() {
  181. this.getTableList();
  182. },
  183. methods: {
  184. //分析
  185. handleAssetss(row) {
  186. this.$router.push({
  187. path: "/home/performance/editAssets",
  188. query: {
  189. batchCode: row.batchCode,
  190. analysisTypeCode: row.analysisTypeCode,
  191. fieldEngineCode: row.fieldCode,
  192. },
  193. });
  194. },
  195. //分析详情
  196. handleAssetssDetail(row) {
  197. this.$router.push({
  198. path: "/home/performance/assetssDetail",
  199. query: {
  200. batchCode: row.batchCode,
  201. analysisTypeCode: row.analysisTypeCode,
  202. fieldEngineCode: row.fieldEngineCode,
  203. },
  204. });
  205. },
  206. abnormalDialog(row, title) {
  207. this.dialogVisible = true;
  208. if (title === "异常详情") {
  209. this.errorInfo = row.errInfo;
  210. this.rowInfo = {};
  211. } else if (title === "异常描述") {
  212. this.errorInfo = "";
  213. this.rowInfo = row;
  214. }
  215. this.title = title;
  216. },
  217. handleConfirm(slotContent) {
  218. this.dialogVisible = false;
  219. },
  220. //分页数据切换
  221. handleCurrentChange(val) {
  222. this.formInline.pageNum = val;
  223. this.getTableList();
  224. },
  225. async getTableList() {
  226. try {
  227. this.loading = true;
  228. const result = await getAnalysisResultList({
  229. ...this.formInline,
  230. totalSize: undefined,
  231. });
  232. this.tableData = result.data.list;
  233. this.formInline.totalSize = result.data.totalSize;
  234. this.loading = false;
  235. } catch (error) {
  236. this.$message({
  237. type: "error",
  238. message: "请检查是否连接网络",
  239. });
  240. }
  241. },
  242. rowStyle() {
  243. return "text-align:center";
  244. },
  245. // 查询
  246. onSubmit() {
  247. this.getTableList();
  248. },
  249. // 重置
  250. reset(formName) {
  251. this.$refs[formName].resetFields();
  252. this.getTableList();
  253. },
  254. },
  255. };
  256. </script>
  257. <style lang="scss" scoped>
  258. .general {
  259. display: flex;
  260. flex-wrap: wrap;
  261. .condition {
  262. width: 50%;
  263. display: flex;
  264. p {
  265. width: 100px;
  266. text-align: right;
  267. line-height: 40px;
  268. }
  269. span {
  270. line-height: 40px;
  271. padding-left: 20px;
  272. }
  273. .el-select {
  274. width: 100%;
  275. margin-bottom: 20px;
  276. }
  277. .el-input {
  278. margin-bottom: 20px;
  279. }
  280. }
  281. }
  282. .attachment {
  283. display: flex;
  284. padding-top: 10px;
  285. p {
  286. margin-right: 20px;
  287. color: #409eff;
  288. }
  289. }
  290. .addition {
  291. display: flex;
  292. justify-content: flex-end;
  293. margin-bottom: 10px;
  294. }
  295. .demo-ruleForm {
  296. .el-form-item {
  297. margin-bottom: 25px;
  298. }
  299. }
  300. </style>