nwpparsing.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. <template>
  2. <div class="app-container">
  3. <div class="dark-el-button">
  4. <el-button type="primary" icon="el-icon-plus" @click="handleAdd" class="myButton">新增</el-button>
  5. </div>
  6. <!--上报对象表格-->
  7. <el-table
  8. :data="tableData"
  9. :header-cell-style="{background:'#ECF1FE'}"
  10. v-loading="tableLoading" border style="width: 100%">
  11. <el-table-column type="expand">
  12. <template slot-scope="props">
  13. <table style="width: 100%;text-align: left">
  14. <tr>
  15. <td>温度公式:{{ props.row.t }}</td>
  16. <td>湿度公式:{{ props.row.rh }}</td>
  17. <td>气压公式:{{ props.row.pressure }}</td>
  18. </tr>
  19. <tr>
  20. <td>总辐射公式:{{ props.row.globalRadiation }}</td>
  21. <td>直辐射公式:{{ props.row.directRadiation }}</td>
  22. <td>散辐射公式:{{ props.row.diffuseRadiation }}</td>
  23. </tr>
  24. <tr>
  25. <td>10米风速公式:{{ props.row.ws10 }}</td>
  26. <td>10米风向公式:{{ props.row.wd10 }}</td>
  27. <td>30米风速公式:{{ props.row.ws30 }}</td>
  28. <td>30米风向公式:{{ props.row.wd30 }}</td>
  29. </tr>
  30. <tr>
  31. <td>50米风速公式:{{ props.row.ws50 }}</td>
  32. <td>50米风向公式:{{ props.row.wd50 }}</td>
  33. <td>70米风速公式:{{ props.row.ws70 }}</td>
  34. <td>70米风向公式:{{ props.row.wd70 }}</td>
  35. </tr>
  36. <tr>
  37. <td>80米风速公式:{{ props.row.ws80 }}</td>
  38. <td>80米风向公式:{{ props.row.wd80 }}</td>
  39. <td>90米风速公式:{{ props.row.ws90 }}</td>
  40. <td>90米风向公式:{{ props.row.wd90 }}</td>
  41. </tr>
  42. <tr>
  43. <td>100米风速公式:{{ props.row.ws100 }}</td>
  44. <td>100米风向公式:{{ props.row.wd100 }}</td>
  45. <td>轮毂高风速公式:{{ props.row.wsHubHeight }}</td>
  46. <td>轮毂高风向公式:{{ props.row.wdHubHeight }}</td>
  47. </tr>
  48. </table>
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="dataType" align="center" label="数据类型" width="100px" :formatter="formatDataType"></el-table-column>
  52. <el-table-column prop="time" align="center" label="预测时间公式"></el-table-column>
  53. <!-- <el-table-column prop="stationCode" align="center" label="场站编号"></el-table-column>-->
  54. <el-table-column label="操作" align="center" width="150px">
  55. <template slot-scope="scope">
  56. <el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
  57. <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="block">
  62. <el-pagination
  63. @size-change="handleSizeChange"
  64. @current-change="handleCurrentChange"
  65. :current-page=this.page.currentPage
  66. :page-sizes="[10, 15, 30, 50]"
  67. :page-size=this.page.pageSize
  68. layout="total, sizes, prev, pager, next, jumper"
  69. :total=this.page.total>
  70. </el-pagination>
  71. </div>
  72. <!--编辑框-->
  73. <div class="dark-el-dialog">
  74. <el-dialog :title="saveFlag==1?'新增':'编辑'" :visible.sync="visible" width="100%" :fullscreen="true">
  75. <el-row :gutter="20">
  76. <el-col :span="16">
  77. <div>
  78. <span style="color: red">
  79. <font size="4px">灰色文本框需要点击后,在右侧进行编辑录入!</font>
  80. </span>
  81. </div>
  82. &nbsp;
  83. <div class="grid-content bg-purple">
  84. <el-form v-model="form" ref="form" :key="timer">
  85. <el-row :gutter="16">
  86. <el-col :span="8">
  87. <el-form-item prop="dataType" label-width="110px">
  88. <span slot="label">
  89. <font color="red">*</font>数据类型
  90. </span>
  91. <el-select popper-class="cpp-popper" v-model="form.dataType" clearable @focus="clearformula">
  92. <el-option
  93. v-for="item in this.dataTypes"
  94. :key="item.value"
  95. :label="item.label"
  96. :value="item.value"/>
  97. </el-select>
  98. </el-form-item>
  99. </el-col>
  100. </el-row>
  101. <!-- <el-row>-->
  102. <!-- <el-col :span="24">-->
  103. <!-- <el-form-item prop="stationCode" label-width="110px">-->
  104. <!-- <span slot="label">-->
  105. <!-- <font color="red">*</font>场站编号-->
  106. <!-- </span>-->
  107. <!-- <el-select popper-class="cpp-popper" v-model="form.stationCode" multiple clearable @focus="clearformula" style="width: 100%">-->
  108. <!-- <el-option-->
  109. <!-- v-for="item in this.stationCodeList"-->
  110. <!-- :key="item.stationCode"-->
  111. <!-- :label="item.stationCode"-->
  112. <!-- :value="item.stationCode"/>-->
  113. <!-- </el-select>-->
  114. <!-- </el-form-item>-->
  115. <!-- </el-col>-->
  116. <!-- </el-row>-->
  117. <el-row :gutter="16">
  118. <el-col :span="8">
  119. <el-form-item prop="time" label-width="110px" class="formulaColor">
  120. <span slot="label">
  121. <font color="red">*</font>预测时间公式
  122. </span>
  123. <el-input v-model="form.time" readonly
  124. @click.native="ftck(form.time,'form.time','(预测时间)')"></el-input>
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="8">
  128. <el-form-item prop="globalRadiation" label-width="110px" class="formulaColor">
  129. <span slot="label">
  130. 总辐射公式
  131. </span>
  132. <el-input v-model="form.globalRadiation" readonly
  133. @click.native="ftck(form.globalRadiation,'form.globalRadiation','(总辐射)')"></el-input>
  134. </el-form-item>
  135. </el-col>
  136. <el-col :span="8">
  137. <el-form-item prop="directRadiation" label-width="110px" class="formulaColor">
  138. <span slot="label">
  139. 直辐射公式
  140. </span>
  141. <el-input v-model="form.directRadiation" readonly
  142. @click.native="ftck(form.directRadiation,'form.directRadiation','(直辐射)')"></el-input>
  143. </el-form-item>
  144. </el-col>
  145. </el-row>
  146. <el-row :gutter="16">
  147. <el-col :span="8">
  148. <el-form-item prop="diffuseRadiation" label-width="110px" class="formulaColor">
  149. <span slot="label">
  150. 散辐射公式
  151. </span>
  152. <el-input v-model="form.diffuseRadiation" readonly
  153. @click.native="ftck(form.diffuseRadiation,'form.diffuseRadiation','(散辐射)')"></el-input>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="8">
  157. <el-form-item prop="ws10" label-width="110px" class="formulaColor">
  158. <span slot="label">
  159. 10米风速
  160. </span>
  161. <el-input v-model="form.ws10" readonly
  162. @click.native="ftck(form.ws10,'form.ws10','(10米风速)')"></el-input>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="8">
  166. <el-form-item prop="wd10" label-width="110px" class="formulaColor">
  167. <span slot="label">
  168. 10米风向
  169. </span>
  170. <el-input v-model="form.wd10" readonly
  171. @click.native="ftck(form.wd10,'form.wd10','(10米风向)')"></el-input>
  172. </el-form-item>
  173. </el-col>
  174. </el-row>
  175. <el-row :gutter="16">
  176. <el-col :span="8">
  177. <el-form-item prop="ws30" label-width="110px" class="formulaColor">
  178. <span slot="label">
  179. 30米风速
  180. </span>
  181. <el-input v-model="form.ws30" readonly
  182. @click.native="ftck(form.ws30,'form.ws30','(30米风速)')"></el-input>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="8">
  186. <el-form-item prop="wd30" label-width="110px" class="formulaColor">
  187. <span slot="label">
  188. 30米风向
  189. </span>
  190. <el-input v-model="form.wd30" readonly
  191. @click.native="ftck(form.wd30,'form.wd30','(30米风向)')"></el-input>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="8">
  195. <el-form-item prop="ws50" label-width="110px" class="formulaColor">
  196. <span slot="label">
  197. 50米风速
  198. </span>
  199. <el-input v-model="form.ws50" readonly
  200. @click.native="ftck(form.ws50,'form.ws50','(50米风速)')"></el-input>
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. <el-row :gutter="16">
  205. <el-col :span="8">
  206. <el-form-item prop="wd50" label-width="110px" class="formulaColor">
  207. <span slot="label">
  208. 50米风向
  209. </span>
  210. <el-input v-model="form.wd50" readonly
  211. @click.native="ftck(form.wd50,'form.wd50','(50米风向)')"></el-input>
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="8">
  215. <el-form-item prop="ws70" label-width="110px" class="formulaColor">
  216. <span slot="label">
  217. 70米风速
  218. </span>
  219. <el-input v-model="form.ws70" readonly
  220. @click.native="ftck(form.ws70,'form.ws70','(70米风速)')"></el-input>
  221. </el-form-item>
  222. </el-col>
  223. <el-col :span="8">
  224. <el-form-item prop="wd70" label-width="110px" class="formulaColor">
  225. <span slot="label">
  226. 70米风向
  227. </span>
  228. <el-input v-model="form.wd70" readonly
  229. @click.native="ftck(form.wd70,'form.wd70','(70米风向)')"></el-input>
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. <el-row :gutter="16">
  234. <el-col :span="8">
  235. <el-form-item prop="ws80" label-width="110px" class="formulaColor">
  236. <span slot="label">
  237. 80米风速
  238. </span>
  239. <el-input v-model="form.ws80" readonly
  240. @click.native="ftck(form.ws80,'form.ws80','(80米风速)')"></el-input>
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="8">
  244. <el-form-item prop="wd80" label-width="110px" class="formulaColor">
  245. <span slot="label">
  246. 80米风向
  247. </span>
  248. <el-input v-model="form.wd80" readonly
  249. @click.native="ftck(form.wd80,'form.wd80','(80米风向)')"></el-input>
  250. </el-form-item>
  251. </el-col>
  252. <el-col :span="8">
  253. <el-form-item prop="ws90" label-width="110px" class="formulaColor">
  254. <span slot="label">
  255. 90米风速
  256. </span>
  257. <el-input v-model="form.ws90" readonly
  258. @click.native="ftck(form.ws90,'form.ws90','(90米风速)')"></el-input>
  259. </el-form-item>
  260. </el-col>
  261. </el-row>
  262. <el-row :gutter="16">
  263. <el-col :span="8">
  264. <el-form-item prop="wd90" label-width="110px" class="formulaColor">
  265. <span slot="label">
  266. 90米风向
  267. </span>
  268. <el-input v-model="form.wd90" readonly
  269. @click.native="ftck(form.wd90,'form.wd90','(90米风向)')"></el-input>
  270. </el-form-item>
  271. </el-col>
  272. <el-col :span="8">
  273. <el-form-item prop="ws100" label-width="110px" class="formulaColor">
  274. <span slot="label">
  275. 100米风速
  276. </span>
  277. <el-input v-model="form.ws100" readonly
  278. @click.native="ftck(form.ws100,'form.ws100','(100米风速)')"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="8">
  282. <el-form-item prop="wd100" label-width="110px" class="formulaColor">
  283. <span slot="label">
  284. 100米风向
  285. </span>
  286. <el-input v-model="form.wd100" readonly
  287. @click.native="ftck(form.wd100,'form.wd100','(100米风向)')"></el-input>
  288. </el-form-item>
  289. </el-col>
  290. </el-row>
  291. <el-row :gutter="16">
  292. <el-col :span="8">
  293. <el-form-item prop="wsHubHeight" label-width="110px" class="formulaColor">
  294. <span slot="label">
  295. 100米风速
  296. </span>
  297. <el-input v-model="form.wsHubHeight" readonly
  298. @click.native="ftck(form.wsHubHeight,'form.wsHubHeight','(轮毂高风速)')"></el-input>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="8">
  302. <el-form-item prop="wdHubHeight" label-width="110px" class="formulaColor">
  303. <span slot="label">
  304. 100米风向
  305. </span>
  306. <el-input v-model="form.wdHubHeight" readonly
  307. @click.native="ftck(form.wdHubHeight,'form.wdHubHeight','(轮毂高风向)')"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. </el-row>
  311. <el-row :gutter="16">
  312. <el-col :span="8">
  313. <el-form-item prop="t" label-width="110px" class="formulaColor">
  314. <span slot="label">
  315. 温度公式
  316. </span>
  317. <el-input v-model="form.t" readonly
  318. @click.native="ftck(form.t,'form.t','(温度)')"></el-input>
  319. </el-form-item>
  320. </el-col>
  321. <el-col :span="8">
  322. <el-form-item prop="rh" label-width="110px" class="formulaColor">
  323. <span slot="label">
  324. 湿度公式
  325. </span>
  326. <el-input v-model="form.rh" readonly
  327. @click.native="ftck(form.rh,'form.rh','(湿度)')"></el-input>
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="8">
  331. <el-form-item prop="pressure" label-width="110px" class="formulaColor">
  332. <span slot="label">
  333. 气压公式
  334. </span>
  335. <el-input v-model="form.pressure" readonly
  336. @click.native="ftck(form.pressure,'form.pressure','(气压)')"></el-input>
  337. </el-form-item>
  338. </el-col>
  339. </el-row>
  340. </el-form>
  341. <div slot="footer" class="dialog-footer">
  342. <el-button type="primary" @click="handleSave('form')">
  343. <span v-if="saveFlag == 1">保 存</span>
  344. <span v-else>修 改</span>
  345. </el-button>
  346. <el-button @click="visible = false">取 消</el-button>
  347. </div>
  348. </div>
  349. </el-col>
  350. <el-col :span="1">
  351. <el-divider direction="vertical" style="height: 200px"></el-divider>
  352. </el-col>
  353. <el-col :span="5">
  354. <h2>公式编辑区{{ this.editinfo }}</h2>
  355. <el-form>
  356. <el-row>
  357. <el-col>
  358. <el-form-item prop="rownumber" label-width="110px">
  359. <span slot="label">
  360. <font color="red">*</font>解析行
  361. </span>
  362. <el-input v-model="pfform.rownumber"></el-input>
  363. </el-form-item>
  364. </el-col>
  365. </el-row>
  366. <el-row>
  367. <el-col>
  368. <el-form-item prop="columnumber" label-width="110px">
  369. <span slot="label">
  370. <font color="red">*</font>解析列
  371. </span>
  372. <el-input v-model="pfform.columnumber"></el-input>
  373. </el-form-item>
  374. </el-col>
  375. </el-row>
  376. <el-row>
  377. <el-col>
  378. <el-form-item label="标签名" prop="signname" label-width="110px">
  379. <el-input v-model="pfform.signname"></el-input>
  380. </el-form-item>
  381. </el-col>
  382. </el-row>
  383. <el-row>
  384. <el-col>
  385. <el-form-item label="时间格式" prop="timeformat" label-width="110px">
  386. <el-select popper-class="cpp-popper" v-model="pfform.timeformat" clearable>
  387. <el-option
  388. v-for="item in this.timeFormat"
  389. :key="item.value"
  390. :label="item.label"
  391. :value="item.value"/>
  392. </el-select>
  393. </el-form-item>
  394. </el-col>
  395. </el-row>
  396. <el-row>
  397. <el-button type="primary" @click="genformula">
  398. <span>生成公式</span>
  399. </el-button>
  400. <el-button type="primary" @click="destoryformula">
  401. <span>清除录入</span>
  402. </el-button>
  403. </el-row>
  404. </el-form>
  405. </el-col>
  406. </el-row>
  407. </el-dialog>
  408. </div>
  409. </div>
  410. </template>
  411. <script>
  412. export default {
  413. name: "index",
  414. data() {
  415. return {
  416. // stationCodeList: [],
  417. dataTypes: [
  418. {value: 's', label: '时间单行'},
  419. {value: 'm', label: '时间多行'}
  420. ],
  421. timeFormat: [
  422. {value: 'yyyy-MM-dd HH:mm:ss', label: 'yyyy-MM-dd HH:mm:ss'},
  423. {value: 'yyyy-MM-dd', label: 'yyyy-MM-dd'},
  424. {value: 'yyyy-MM-dd_HH:mm', label: 'yyyy-MM-dd_HH:mm'},
  425. {value: 'yyyy-MM-dd HH:mm', label: 'yyyy-MM-dd HH:mm'}
  426. ],
  427. editinfo: '',
  428. timer: new Date().getTime(),
  429. props: {multiple: true},
  430. staionList: [],//场站集合
  431. tableLoading: false,
  432. tableData: [],
  433. page: {
  434. total: 0, // 总页数
  435. currentPage: 1, // 当前页数
  436. pageSize: 10 // 每页显示多少条
  437. },
  438. info: '',
  439. visible: false,
  440. form: {
  441. // fileName: '',
  442. time: '',
  443. dataType: 'm',
  444. // stationCode: '',
  445. t: '',
  446. rh: '',
  447. pressure: '',
  448. globalRadiation: '',
  449. directRadiation: '',
  450. diffuseRadiation: '',
  451. ws10: '',
  452. wd10: '',
  453. ws30: '',
  454. wd30: '',
  455. ws50: '',
  456. wd50: '',
  457. ws70: '',
  458. wd70: '',
  459. ws80: '',
  460. wd80: '',
  461. ws90: '',
  462. wd90: '',
  463. ws100: '',
  464. wd100: '',
  465. wsHubHeight: '',
  466. wdHubHeight: ''
  467. },
  468. pfform: {
  469. rownumber: '',
  470. columnumber: '',
  471. signname: '',
  472. timeformat: ''
  473. },
  474. tempformulasign: '',
  475. saveFlag: 1
  476. };
  477. },
  478. mounted() {
  479. // this.getElectricFieldList()
  480. this.getTableList()
  481. },
  482. methods: {
  483. formatDataType(row, column) {
  484. let belongTo = '未知类型'
  485. for (let i = 0; i < this.dataTypes.length; i++) {
  486. if (row.dataType === this.dataTypes[i].value) {
  487. belongTo = this.dataTypes[i].label
  488. }
  489. }
  490. return belongTo
  491. },
  492. getTableList() {
  493. this.tableLoading = true
  494. this.$axios.get("/parsingNwp/page", {
  495. params: {
  496. currentPage: this.page.currentPage,
  497. pageSize: this.page.pageSize
  498. }
  499. }).then(response => {
  500. this.tableData = response.data.records
  501. this.page.total = response.data.total
  502. this.tableLoading = false
  503. }).catch((e) => {
  504. this.tableLoading = false
  505. })
  506. },
  507. // getElectricFieldList() {
  508. // // 获取所有场站
  509. // fetchElectricFieldList().then(response => {
  510. // this.stationCodeList = response.data
  511. // this.tableLoading = false
  512. // }).catch((e) => {
  513. // this.tableLoading = false
  514. // })
  515. // },
  516. destoryformula() {
  517. // 清空公式区字段
  518. if (this.tempformulasign == 'form.time') {
  519. this.form.time = ''
  520. }
  521. else if (this.tempformulasign == 'form.t') {
  522. this.form.t = ''
  523. }
  524. else if (this.tempformulasign == 'form.rh') {
  525. this.form.rh = ''
  526. }
  527. else if (this.tempformulasign == 'form.pressure') {
  528. this.form.pressure = ''
  529. }
  530. else if (this.tempformulasign == 'form.globalRadiation') {
  531. this.form.globalRadiation = ''
  532. }
  533. else if (this.tempformulasign == 'form.directRadiation') {
  534. this.form.directRadiation = ''
  535. }
  536. else if (this.tempformulasign == 'form.diffuseRadiation') {
  537. this.form.diffuseRadiation = ''
  538. }
  539. else if (this.tempformulasign == 'form.ws10') {
  540. this.form.ws10 = ''
  541. }
  542. else if (this.tempformulasign == 'form.wd10') {
  543. this.form.wd10 = ''
  544. }
  545. else if (this.tempformulasign == 'form.ws30') {
  546. this.form.ws30 = ''
  547. }
  548. else if (this.tempformulasign == 'form.wd30') {
  549. this.form.wd30 = ''
  550. }
  551. else if (this.tempformulasign == 'form.ws50') {
  552. this.form.ws50 = ''
  553. }
  554. else if (this.tempformulasign == 'form.wd50') {
  555. this.form.wd50 = ''
  556. }
  557. else if (this.tempformulasign == 'form.ws70') {
  558. this.form.ws70 = ''
  559. }
  560. else if (this.tempformulasign == 'form.wd70') {
  561. this.form.wd70 = ''
  562. }
  563. else if (this.tempformulasign == 'form.ws80') {
  564. this.form.ws80 = ''
  565. }
  566. else if (this.tempformulasign == 'form.wd80') {
  567. this.form.wd80 = ''
  568. }
  569. else if (this.tempformulasign == 'form.ws90') {
  570. this.form.ws90 = ''
  571. }
  572. else if (this.tempformulasign == 'form.wd90') {
  573. this.form.wd90 = ''
  574. }
  575. else if (this.tempformulasign == 'form.ws100') {
  576. this.form.ws100 = ''
  577. }
  578. else if (this.tempformulasign == 'form.wd100') {
  579. this.form.wd100 = ''
  580. }
  581. else if (this.tempformulasign == 'form.wsHubHeight') {
  582. this.form.wsHubHeight = ''
  583. }
  584. else if (this.tempformulasign == 'form.wdHubHeight') {
  585. this.form.wdHubHeight = ''
  586. }
  587. this.clearformula()
  588. },
  589. clearformula() {
  590. // 清空公式区字段
  591. this.pfform.rownumber = ''
  592. this.pfform.columnumber = ''
  593. this.pfform.signname = ''
  594. this.pfform.timeformat = ''
  595. this.editinfo = ''
  596. this.tempformulasign = ''
  597. },
  598. ftck(obj, sign, editname) {
  599. this.clearformula()
  600. if (obj != undefined && obj != null) {
  601. var objs = obj.split('<=>')
  602. for (let i = 0; i < objs.length; i++) {
  603. if (objs[i] != "") {
  604. if (i == 0) {
  605. this.pfform.rownumber = objs[i]
  606. } else if (i == 1) {
  607. this.pfform.columnumber = objs[i]
  608. } else if (i == 2) {
  609. this.pfform.signname = objs[i]
  610. } else if (i == 3) {
  611. this.pfform.timeformat = objs[i]
  612. }
  613. }
  614. }
  615. }
  616. this.tempformulasign = sign;
  617. this.editinfo = editname
  618. },
  619. genformula() {
  620. if (this.tempformulasign==''){
  621. this.$message.warning('请先选定左侧公式项')
  622. return
  623. }
  624. if (!this.pfform.rownumber || !this.pfform.columnumber) {
  625. this.$message.warning('填写必填项')
  626. return
  627. }
  628. if ((this.pfform.signname && !this.pfform.timeformat) || (!this.pfform.signname && this.pfform.timeformat)) {
  629. this.$message.warning('标签名称和时间格式要同时填写')
  630. return
  631. }
  632. // 拼装公式
  633. var resultStr = ''
  634. if (this.pfform.rownumber) {
  635. resultStr = this.pfform.rownumber
  636. }
  637. if (this.pfform.columnumber) {
  638. resultStr = resultStr + '<=>' + this.pfform.columnumber
  639. }
  640. if (this.pfform.signname) {
  641. resultStr = resultStr + '<=>' + this.pfform.signname
  642. }
  643. if (this.pfform.timeformat) {
  644. resultStr = resultStr + '<=>' + this.pfform.timeformat
  645. }
  646. // 将生成的公式赋值到左侧表格中
  647. if (this.tempformulasign == 'form.time') {
  648. this.form.time = resultStr
  649. }
  650. else if (this.tempformulasign == 'form.t') {
  651. this.form.t = resultStr
  652. }
  653. else if (this.tempformulasign == 'form.rh') {
  654. this.form.rh = resultStr
  655. }
  656. else if (this.tempformulasign == 'form.pressure') {
  657. this.form.pressure = resultStr
  658. }
  659. else if (this.tempformulasign == 'form.globalRadiation') {
  660. this.form.globalRadiation = resultStr
  661. }
  662. else if (this.tempformulasign == 'form.directRadiation') {
  663. this.form.directRadiation = resultStr
  664. }
  665. else if (this.tempformulasign == 'form.diffuseRadiation') {
  666. this.form.diffuseRadiation = resultStr
  667. }
  668. else if (this.tempformulasign == 'form.ws10') {
  669. this.form.ws10 = resultStr
  670. }
  671. else if (this.tempformulasign == 'form.wd10') {
  672. this.form.wd10 = resultStr
  673. }
  674. else if (this.tempformulasign == 'form.ws30') {
  675. this.form.ws30 = resultStr
  676. }
  677. else if (this.tempformulasign == 'form.wd30') {
  678. this.form.wd30 = resultStr
  679. }
  680. else if (this.tempformulasign == 'form.ws50') {
  681. this.form.ws50 = resultStr
  682. }
  683. else if (this.tempformulasign == 'form.wd50') {
  684. this.form.wd50 = resultStr
  685. }
  686. else if (this.tempformulasign == 'form.ws70') {
  687. this.form.ws70 = resultStr
  688. }
  689. else if (this.tempformulasign == 'form.wd70') {
  690. this.form.wd70 = resultStr
  691. }
  692. else if (this.tempformulasign == 'form.ws80') {
  693. this.form.ws80 = resultStr
  694. }
  695. else if (this.tempformulasign == 'form.wd80') {
  696. this.form.wd80 = resultStr
  697. }
  698. else if (this.tempformulasign == 'form.ws90') {
  699. this.form.ws90 = resultStr
  700. }
  701. else if (this.tempformulasign == 'form.wd90') {
  702. this.form.wd90 = resultStr
  703. }
  704. else if (this.tempformulasign == 'form.ws100') {
  705. this.form.ws100 = resultStr
  706. }
  707. else if (this.tempformulasign == 'form.wd100') {
  708. this.form.wd100 = resultStr
  709. }
  710. else if (this.tempformulasign == 'form.wsHubHeight') {
  711. this.form.wsHubHeight = resultStr
  712. }
  713. else if (this.tempformulasign == 'form.wdHubHeight') {
  714. this.form.wdHubHeight = resultStr
  715. }
  716. this.timer = new Date().getTime()
  717. this.clearformula()
  718. },
  719. /*保存*/
  720. handleSave(formName) {
  721. if (
  722. // !this.form.fileName ||
  723. !this.form.time || !this.form.dataType
  724. // || this.form.stationCode==""
  725. ) {
  726. this.$message.warning('填写必填项');
  727. return false;
  728. } else {
  729. if (this.saveFlag === 1) {
  730. this.$axios.post("/parsingNwp", this.form).then(response => {
  731. this.dialogVisible = false
  732. this.getTableList()
  733. this.tableLoading = false
  734. this.$message.success(response.data)
  735. }).catch(() => {
  736. this.tableLoading = false
  737. })
  738. } else {
  739. this.$axios.put("/parsingNwp", this.form).then(response => {
  740. this.dialogVisible = false
  741. this.getTableList()
  742. this.tableLoading = false
  743. this.$message.success(response.data)
  744. }).catch(() => {
  745. this.tableLoading = false
  746. })
  747. }
  748. this.visible = false
  749. }
  750. },
  751. /*上报对象*/
  752. handleAdd() {
  753. this.saveFlag = 1
  754. this.info = ''
  755. this.form = {
  756. // fileName: '',
  757. time: '',
  758. dataType: 'm',
  759. // stationCode: '',
  760. t: '',
  761. rh: '',
  762. pressure: '',
  763. globalRadiation: '',
  764. directRadiation: '',
  765. diffuseRadiation: '',
  766. ws10: '',
  767. wd10: '',
  768. ws30: '',
  769. wd30: '',
  770. ws50: '',
  771. wd50: '',
  772. ws70: '',
  773. wd70: '',
  774. ws80: '',
  775. wd80: '',
  776. ws90: '',
  777. wd90: '',
  778. ws100: '',
  779. wd100: '',
  780. wsHubHeight: '',
  781. wdHubHeight: ''
  782. }
  783. this.clearformula()
  784. this.visible = true
  785. },
  786. /*上报对象编辑*/
  787. handleEdit(row) {
  788. this.saveFlag = 2
  789. let newRow = Object.assign({},row)
  790. // let tempStationCode = newRow.stationCode.split(',')
  791. this.form = newRow
  792. // this.form.stationCode = tempStationCode
  793. this.clearformula()
  794. this.visible = true
  795. },
  796. /*上报对象删除*/
  797. handleDelete(row) {
  798. this.$confirm('是否确认删除此条配置?', '提示', {
  799. confirmButtonText: '确定',
  800. cancelButtonText: '取消',
  801. type: 'warning'
  802. }).then(() => {
  803. this.$axios.delete("/parsingNwp/" + row.id).then(response => {
  804. this.getTableList()
  805. this.$message.success(response.data)
  806. })
  807. })
  808. },
  809. /*上报对象pageSize改变*/
  810. handleSizeChange(val) {
  811. this.page.pageSize = val
  812. this.page.currentPage = 1
  813. this.getTableList()
  814. },
  815. /*上报对象currentPage改变*/
  816. handleCurrentChange(val) {
  817. this.page.currentPage = val
  818. this.getTableList()
  819. }
  820. }
  821. }
  822. </script>
  823. <style scoped>
  824. .block {
  825. float: right;
  826. }
  827. .myButton {
  828. margin-bottom: .5%;
  829. }
  830. .uploadno {
  831. background: #2d8cf0;
  832. width: 20px;
  833. height: 20px;
  834. border-radius: 50%;
  835. text-align: center;
  836. display: inline-block;
  837. color: #fff;
  838. }
  839. .el-divider--vertical {
  840. display: inline-block;
  841. width: 1px;
  842. height: 35em;
  843. margin: 0 8px;
  844. vertical-align: middle;
  845. position: relative;
  846. }
  847. /deep/ .formulaColor .el-input--small .el-input__inner {
  848. height: 32px;
  849. line-height: 32px;
  850. background-color: rgba(204, 204, 204, 0.5);
  851. }
  852. </style>