measurementPlace.vue 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131
  1. <template>
  2. <!-- 计量点信息维护 -->
  3. <div class="measurementPlace">
  4. <div class="box">
  5. <div class="box-top">
  6. <el-form
  7. style="overflow: hidden;"
  8. :style="filterForm.show ? null : { height: '0px' }"
  9. size="mini"
  10. label-width="80px"
  11. >
  12. <el-row>
  13. <el-col :span="6">
  14. <el-form-item label="能介类型">
  15. <el-select
  16. filterable clearable
  17. v-model="filterForm.data.energytypeid"
  18. multiple
  19. collapse-tags
  20. placeholder="能介类型"
  21. style="width: 100%;"
  22. >
  23. <el-option
  24. v-for="item of nameObj.energytypeid.arr"
  25. :key="item.id"
  26. :value="item.id"
  27. :label="item.name"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="能介">
  34. <el-select
  35. filterable clearable
  36. v-model="filterForm.data.energyid"
  37. multiple
  38. collapse-tags
  39. placeholder="能介"
  40. style="width: 100%;"
  41. >
  42. <template v-for="item of nameObj.energyid.arr">
  43. <el-option
  44. v-if="filterForm.data.energytypeid.indexOf(item.energytypeid) !== -1 || Object.keys(filterForm.data.energytypeid).length === 0"
  45. :key="item.id"
  46. :value="item.id"
  47. :label="item.name"
  48. ></el-option>
  49. </template>
  50. </el-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <el-form-item label="用能属性">
  55. <el-select
  56. filterable clearable
  57. v-model="filterForm.data.propertyid"
  58. placeholder="用能属性"
  59. multiple
  60. collapse-tags
  61. style="width: 100%;"
  62. >
  63. <el-option
  64. v-for="item of nameObj.propertyid.arr"
  65. :key="item.id"
  66. :value="item.id"
  67. :label="item.name"
  68. ></el-option>
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="6">
  73. <el-form-item label="手抄或自动">
  74. <el-select
  75. filterable clearable
  76. v-model="filterForm.data.itemtype"
  77. placeholder="手抄或自动"
  78. style="width: 100%;"
  79. >
  80. <el-option
  81. v-for="item of nameObj.itemtype.arr"
  82. :key="item.id"
  83. :value="item.id"
  84. :label="item.name"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. <el-row>
  91. <el-col :span="6">
  92. <el-form-item label="工序">
  93. <el-select
  94. filterable clearable
  95. v-model="filterForm.data.costid"
  96. placeholder="工序"
  97. multiple
  98. collapse-tags
  99. style="width: 100%;"
  100. >
  101. <el-option
  102. v-for="item of nameObj.workprocid.arr"
  103. :key="item.id"
  104. :value="item.id"
  105. :label="item.name"
  106. ></el-option>
  107. </el-select>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="6">
  111. <el-form-item label="站所">
  112. <el-select
  113. filterable clearable
  114. v-model="filterForm.data.networkid"
  115. placeholder="站所"
  116. multiple
  117. collapse-tags
  118. style="width: 100%;"
  119. >
  120. <el-option
  121. v-for="item of nameObj.networkid.arr"
  122. :key="item.id"
  123. :value="item.id"
  124. :label="item.name"
  125. ></el-option>
  126. </el-select>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="6">
  130. <el-form-item label="计量点编号">
  131. <el-input clearable
  132. v-model.trim="filterForm.data.itemid"
  133. placeholder="计量点编号"
  134. style="width: 100%;"
  135. @keyup.enter.native="getTableData(1)"
  136. ></el-input>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="6">
  140. <el-form-item label="计量点名称">
  141. <el-input clearable
  142. v-model.trim="filterForm.data.itemname"
  143. placeholder="计量点名称"
  144. style="width: 100%;"
  145. @keyup.enter.native="getTableData(1)"
  146. ></el-input>
  147. </el-form-item>
  148. </el-col>
  149. </el-row>
  150. <el-row>
  151. <!-- <el-col :span="6">
  152. <el-form-item label="计量层级">
  153. <el-select
  154. filterable clearable
  155. v-model="filterForm.data.hierarchy"
  156. placeholder="计量层级"
  157. style="width: 100%;"
  158. >
  159. <el-option
  160. v-for="item of nameObj.hierarchy.arr"
  161. :key="item.id"
  162. :value="item.id"
  163. :label="item.name"
  164. ></el-option>
  165. </el-select>
  166. </el-form-item>
  167. </el-col> -->
  168. <el-col :span="6">
  169. <el-form-item label="位置">
  170. <el-select
  171. filterable clearable
  172. v-model="filterForm.data.locateid"
  173. placeholder="位置"
  174. multiple
  175. collapse-tags
  176. style="width: 100%;"
  177. >
  178. <el-option
  179. v-for="item of nameObj.locateid.arr"
  180. :key="item.id"
  181. :value="item.id"
  182. :label="item.name"
  183. ></el-option>
  184. </el-select>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="6">
  188. <el-form-item label="TAG点别名">
  189. <el-input clearable
  190. v-model.trim="filterForm.data.tagAlias"
  191. placeholder="TAG点别名"
  192. style="width: 100%;"
  193. @keyup.enter.native="getTableData(1)"
  194. ></el-input>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="6">
  198. <el-form-item label="数据表">
  199. <el-input clearable
  200. v-model.trim="filterForm.data.tagTable"
  201. placeholder="小时数据表"
  202. style="width: 100%;"
  203. @keyup.enter.native="getTableData(1)"
  204. ></el-input>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="6">
  208. <el-form-item label="数据列">
  209. <el-input clearable
  210. v-model.trim="filterForm.data.tagCol"
  211. placeholder="小时表列(TAG)"
  212. style="width: 100%;"
  213. @keyup.enter.native="getTableData(1)"
  214. ></el-input>
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. <!-- <div style="text-align: right;margin-bottom: 13px;">
  219. </div> -->
  220. </el-form>
  221. <div class="box-top-gjl">
  222. <el-button
  223. class="button"
  224. type="primary"
  225. size="mini"
  226. icon="el-icon-plus"
  227. v-if="butPrivilege.ADD"
  228. @click="but_add"
  229. >新增</el-button>
  230. <!-- <el-button
  231. class="button"
  232. type="primary"
  233. size="mini"
  234. icon="el-icon-upload2"
  235. >导入计量点</el-button>
  236. <el-button
  237. class="button"
  238. type="primary"
  239. size="mini"
  240. icon="el-icon-download"
  241. >导出全部计量点</el-button> -->
  242. <div style="float:right; text-align: right;">
  243. <el-button
  244. class="button"
  245. type="primary"
  246. size="mini"
  247. icon="el-icon-search"
  248. v-if="butPrivilege.QUERY"
  249. @click="filterForm.useflag='';getTableData(1);"
  250. >查询全部</el-button>
  251. <el-button
  252. class="button"
  253. type="primary"
  254. icon="el-icon-search"
  255. size="mini"
  256. v-if="butPrivilege.QUERY"
  257. @click="filterForm.useflag='1';getTableData(1)"
  258. >查询</el-button>
  259. <el-button
  260. class="button"
  261. type="primary"
  262. icon="el-icon-refresh"
  263. size="mini"
  264. v-if="butPrivilege.QUERY"
  265. @click="tableDataCancel();"
  266. >重置</el-button>
  267. <el-button
  268. size="mini"
  269. :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
  270. :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
  271. @click="filterForm.show = !filterForm.show;
  272. $nextTick(() => {
  273. singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
  274. }
  275. );"
  276. >{{ filterForm.show ? '收起' : '展开' }}</el-button>
  277. </div>
  278. </div>
  279. </div>
  280. <div class="box-bottom">
  281. <el-table
  282. stripe
  283. id="singleTable"
  284. ref="singleTable"
  285. :data="tableData"
  286. v-loading="tableLoading"
  287. style="width: 100%;"
  288. :height="singleTableHeight"
  289. border
  290. size="mini"
  291. highlight-current-row
  292. @current-change="handleCurrentChange"
  293. :row-class-name="rowClassName"
  294. >
  295. <el-table-column
  296. sortable
  297. prop="itemid"
  298. label="计量点编号"
  299. width="120px"
  300. :show-overflow-tooltip="true"
  301. ></el-table-column>
  302. <el-table-column
  303. sortable
  304. prop="itemname"
  305. label="计量点名称"
  306. min-width="150px"
  307. :show-overflow-tooltip="true"
  308. ></el-table-column>
  309. <el-table-column
  310. sortable
  311. prop="tagAlias"
  312. label="TAG别名"
  313. min-width="150px"
  314. :show-overflow-tooltip="true"
  315. ></el-table-column>
  316. <el-table-column
  317. sortable
  318. prop="itemdesc"
  319. label="描述信息"
  320. min-width="150px"
  321. :show-overflow-tooltip="true"
  322. ></el-table-column>
  323. <el-table-column
  324. sortable
  325. prop="itemtype"
  326. label="手抄自动"
  327. width="72px"
  328. :show-overflow-tooltip="true"
  329. >
  330. <template slot-scope="scope">
  331. <span>{{ nameObj.itemtype.obj[scope.row.itemtype] ? nameObj.itemtype.obj[scope.row.itemtype] : scope.row.itemtype }}</span>
  332. </template>
  333. </el-table-column>
  334. <el-table-column
  335. sortable
  336. prop="costid"
  337. label="工序"
  338. min-width="100px"
  339. :show-overflow-tooltip="true"
  340. >
  341. <template slot-scope="scope">
  342. <span>{{ nameObj.workprocid.obj[scope.row.costid] ? nameObj.workprocid.obj[scope.row.costid] : scope.row.costid }}</span>
  343. </template>
  344. </el-table-column>
  345. <el-table-column
  346. sortable
  347. prop="locateid"
  348. label="位置"
  349. min-width="100px"
  350. :show-overflow-tooltip="true"
  351. >
  352. <template slot-scope="scope">
  353. <span>{{ nameObj.locateid.obj[scope.row.locateid] ? nameObj.locateid.obj[scope.row.locateid] : scope.row.locateid }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column
  357. sortable
  358. prop="networkid"
  359. label="站所"
  360. min-width="100px"
  361. :show-overflow-tooltip="true"
  362. >
  363. <template slot-scope="scope">
  364. <span>{{ nameObj.networkid.obj[scope.row.networkid] ? nameObj.networkid.obj[scope.row.networkid] : scope.row.networkid }}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. sortable
  369. prop="energytypeid"
  370. label="能介类型"
  371. width="75px"
  372. :show-overflow-tooltip="true"
  373. >
  374. <template slot-scope="scope">
  375. <span>{{ nameObj.energytypeid.obj[scope.row.energytypeid] ? nameObj.energytypeid.obj[scope.row.energytypeid] : scope.row.energytypeid }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. sortable
  380. prop="energyid"
  381. label="能介"
  382. width="85px"
  383. :show-overflow-tooltip="true"
  384. >
  385. <template slot-scope="scope">
  386. <span>{{ nameObj.energyid.obj[scope.row.energyid] ? nameObj.energyid.obj[scope.row.energyid].name : scope.row.energyid }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column
  390. sortable
  391. prop="propertyid"
  392. label="用能属性"
  393. width="80px"
  394. :show-overflow-tooltip="true"
  395. >
  396. <template slot-scope="scope">
  397. <span>{{ nameObj.propertyid.obj[scope.row.propertyid] ? nameObj.propertyid.obj[scope.row.propertyid] : scope.row.propertyid }}</span>
  398. </template>
  399. </el-table-column>
  400. <el-table-column
  401. sortable
  402. prop="unitid"
  403. label="计量单位"
  404. min-width="80px"
  405. :show-overflow-tooltip="true"
  406. >
  407. <template slot-scope="scope">
  408. <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column
  412. sortable
  413. prop="mintimegranid"
  414. label="最小时间粒度"
  415. min-width="100px"
  416. :show-overflow-tooltip="true"
  417. >
  418. <template slot-scope="scope">
  419. <span>{{ nameObj.mintimegranid.obj[scope.row.mintimegranid] ? nameObj.mintimegranid.obj[scope.row.mintimegranid] : scope.row.mintimegranid }}</span>
  420. </template>
  421. </el-table-column>
  422. <!-- <el-table-column
  423. sortable
  424. prop="isschedule"
  425. label="是否调度项"
  426. width="90px"
  427. :show-overflow-tooltip="true"
  428. >
  429. <template slot-scope="scope">
  430. <span :class="{color_yes: scope.row.isschedule === '1', color_no: scope.row.isschedule === '0'}">{{ scope.row.isschedule === '0' ? '否' : scope.row.isschedule === '1' ? '是' : '' }}</span>
  431. </template>
  432. </el-table-column>
  433. <el-table-column
  434. sortable
  435. prop="issettle"
  436. label="是否结算项"
  437. width="90px"
  438. :show-overflow-tooltip="true"
  439. >
  440. <template slot-scope="scope">
  441. <span :class="{color_yes: scope.row.issettle === '1', color_no: scope.row.issettle === '0'}">{{ scope.row.issettle === '0' ? '否' : scope.row.issettle === '1' ? '是' : '' }}</span>
  442. </template>
  443. </el-table-column> -->
  444. <el-table-column
  445. sortable
  446. prop="useflag"
  447. label="启用"
  448. width="60px"
  449. :show-overflow-tooltip="true"
  450. >
  451. <template slot-scope="scope">
  452. <span :class="{color_yes: scope.row.useflag === '1', color_no: scope.row.useflag === '0'}">{{ scope.row.useflag === '0' ? '否' : scope.row.useflag === '1' ? '是' : '' }}</span>
  453. </template>
  454. </el-table-column>
  455. <!-- <el-table-column
  456. sortable
  457. prop="showno"
  458. label="顺序号"
  459. width="90px"
  460. :show-overflow-tooltip="true"
  461. ></el-table-column> -->
  462. <el-table-column
  463. sortable
  464. prop="sourceType"
  465. label="数据来源"
  466. min-width="100px"
  467. :show-overflow-tooltip="true"
  468. >
  469. </el-table-column>
  470. <el-table-column
  471. sortable
  472. prop="bdesc1"
  473. label="das地址"
  474. min-width="100px"
  475. :show-overflow-tooltip="true"
  476. ></el-table-column>
  477. <el-table-column
  478. sortable
  479. prop="tagTable"
  480. label="对应数据表"
  481. width="200px"
  482. :show-overflow-tooltip="true"
  483. ></el-table-column>
  484. <el-table-column
  485. sortable
  486. prop="tagCol"
  487. label="对应数据列"
  488. width="90px"
  489. :show-overflow-tooltip="true"
  490. ></el-table-column>
  491. <el-table-column
  492. class-name="gn-TableDownloadExcel-none"
  493. v-if="butPrivilege.PUT || butPrivilege.DELETE"
  494. label="操作"
  495. align="center"
  496. min-width="236px"
  497. fixed="right"
  498. >
  499. <template slot-scope="scope">
  500. <div>
  501. <el-button
  502. type="primary"
  503. size="mini"
  504. @click="but_equationEditing(scope.row)"
  505. v-if="butPrivilege.PUT && scope.row.itemtype === 'VIRTUAL'"
  506. >公式</el-button>
  507. <el-button
  508. type="primary"
  509. size="mini"
  510. v-if="butPrivilege.PUT"
  511. @click="but_edit(scope.row)"
  512. >修改</el-button>
  513. <el-button
  514. v-if="butPrivilege.PUT && scope.row.useflag === '1'"
  515. type="danger"
  516. size="mini"
  517. @click="upUseflag(scope.row, '0')"
  518. >禁用</el-button>
  519. <el-button
  520. v-if="butPrivilege.PUT && scope.row.useflag !== '1'"
  521. type="primary"
  522. size="mini"
  523. @click="upUseflag(scope.row, '1')"
  524. >启用</el-button>
  525. <el-button
  526. type="danger"
  527. size="mini"
  528. v-if="butPrivilege.DELETE"
  529. @click="but_del(scope.row)"
  530. >删除</el-button>
  531. </div>
  532. </template>
  533. </el-table-column>
  534. </el-table>
  535. <el-pagination
  536. layout="total, sizes, prev, pager, next, jumper"
  537. :total="total"
  538. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  539. :page-size="pageSize"
  540. :current-page.sync="pageNum"
  541. @size-change="tableSizeChange"
  542. @current-change="getTableData()"
  543. style="text-align: right;margin-top: 10px;"
  544. ></el-pagination>
  545. </div>
  546. </div>
  547. <el-dialog
  548. :title="'计量点信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
  549. :visible.sync="dialog.editorBox.show"
  550. width="950px"
  551. :close-on-click-modal="false"
  552. :show-close="!loading"
  553. >
  554. <el-tabs
  555. v-model="dialog.editorBox.activeName"
  556. type="border-card"
  557. >
  558. <el-tab-pane
  559. label="基础信息"
  560. name="1"
  561. >
  562. <div>
  563. <el-form
  564. ref="dialog_form"
  565. :model="dialog.editorBox.form.data"
  566. :rules="dialog.editorBox.form.rules"
  567. size="mini"
  568. label-width="90px"
  569. >
  570. <el-row>
  571. <el-col :span="8">
  572. <el-form-item
  573. label="计量点编号"
  574. prop="itemid"
  575. >
  576. <el-input clearable
  577. style="width: 100%;"
  578. v-model="dialog.editorBox.form.data.itemid"
  579. disabled
  580. ></el-input>
  581. </el-form-item>
  582. </el-col>
  583. <el-col :span="8">
  584. <el-form-item
  585. label="计量点名称"
  586. prop="itemname"
  587. >
  588. <el-input clearable
  589. style="width: 100%;"
  590. v-model="dialog.editorBox.form.data.itemname"
  591. ></el-input>
  592. </el-form-item>
  593. </el-col>
  594. <el-col :span="8">
  595. <el-form-item
  596. label="TAG别名"
  597. prop="tagAlias"
  598. >
  599. <el-input clearable
  600. style="width: 100%;"
  601. v-model="dialog.editorBox.form.data.tagAlias"
  602. ></el-input>
  603. </el-form-item>
  604. </el-col>
  605. </el-row>
  606. <el-row>
  607. <el-col :span="8">
  608. <el-form-item
  609. label="位置"
  610. prop="locateid"
  611. >
  612. <el-select
  613. filterable clearable
  614. style="width: 100%;"
  615. v-model="dialog.editorBox.form.data.locateid"
  616. @change="autoSetName()"
  617. >
  618. <el-option
  619. v-for="item of nameObj.locateid.arr"
  620. :key="item.id"
  621. :value="item.id"
  622. :label="item.name"
  623. ></el-option>
  624. </el-select>
  625. </el-form-item>
  626. </el-col>
  627. <el-col :span="8">
  628. <el-form-item
  629. label="能介类型"
  630. prop="energytypeid"
  631. >
  632. <el-select
  633. filterable clearable
  634. style="width: 100%;"
  635. v-model="dialog.editorBox.form.data.energytypeid"
  636. @change="dialog.editorBox.form.data.energyid='';"
  637. >
  638. <el-option
  639. v-for="item of nameObj.energytypeid.arr"
  640. :key="item.id"
  641. :value="item.id"
  642. :label="item.name"
  643. ></el-option>
  644. </el-select>
  645. </el-form-item>
  646. </el-col>
  647. <el-col :span="8">
  648. <el-form-item
  649. label="能介"
  650. prop="energyid"
  651. >
  652. <el-select
  653. filterable clearable
  654. style="width: 100%;"
  655. v-model="dialog.editorBox.form.data.energyid"
  656. @change="dialog.editorBox.form.data.unitid = nameObj.energyid.obj[dialog.editorBox.form.data.energyid].unitid; autoSetName()"
  657. >
  658. <template v-for="item of nameObj.energyid.arr">
  659. <el-option
  660. v-if="item.energytypeid === dialog.editorBox.form.data.energytypeid || dialog.editorBox.form.data.energytypeid === ''"
  661. :key="item.id"
  662. :value="item.id"
  663. :label="item.name"
  664. ></el-option>
  665. </template>
  666. </el-select>
  667. </el-form-item>
  668. </el-col>
  669. </el-row>
  670. <el-row>
  671. <el-col :span="8">
  672. <el-form-item
  673. label="用能属性"
  674. prop="propertyid"
  675. >
  676. <el-select
  677. filterable clearable
  678. style="width: 100%;"
  679. v-model="dialog.editorBox.form.data.propertyid"
  680. @change="autoSetName()"
  681. >
  682. <el-option
  683. v-for="item of nameObj.propertyid.arr"
  684. :key="item.id"
  685. :value="item.id"
  686. :label="item.name"
  687. ></el-option>
  688. </el-select>
  689. </el-form-item>
  690. </el-col>
  691. <el-col :span="8">
  692. <el-form-item
  693. label="手抄或自动"
  694. prop="itemtype"
  695. >
  696. <el-select
  697. filterable clearable
  698. style="width: 100%;"
  699. v-model="dialog.editorBox.form.data.itemtype"
  700. >
  701. <el-option
  702. v-for="item of nameObj.itemtype.arr"
  703. :key="item.id"
  704. :value="item.id"
  705. :label="item.name"
  706. ></el-option>
  707. </el-select>
  708. </el-form-item>
  709. </el-col>
  710. <el-col :span="8">
  711. <el-form-item
  712. label="站所"
  713. prop="networkid"
  714. :rules="[{required: dialog.editorBox.form.data.energytypeid === 'E', message:'该项不能为空'}]"
  715. >
  716. <el-select
  717. filterable clearable
  718. style="width: 100%;"
  719. v-model="dialog.editorBox.form.data.networkid"
  720. >
  721. <el-option
  722. v-for="item of nameObj.networkid.arr"
  723. :key="item.id"
  724. :value="item.id"
  725. :label="item.name"
  726. ></el-option>
  727. </el-select>
  728. </el-form-item>
  729. </el-col>
  730. </el-row>
  731. <el-row>
  732. <el-col :span="8">
  733. <el-form-item
  734. label="描述信息"
  735. prop="itemdesc"
  736. >
  737. <el-input clearable
  738. style="width: 100%;"
  739. v-model.trim="dialog.editorBox.form.data.itemdesc"
  740. ></el-input>
  741. </el-form-item>
  742. </el-col>
  743. <el-col :span="8">
  744. <el-form-item
  745. label="计量单位"
  746. prop="unitid"
  747. >
  748. <el-select
  749. filterable clearable
  750. style="width: 100%;"
  751. v-model="dialog.editorBox.form.data.unitid"
  752. >
  753. <el-option
  754. v-for="item of nameObj.unitid.arr"
  755. :key="item.id"
  756. :value="item.id"
  757. :label="item.name"
  758. ></el-option>
  759. </el-select>
  760. </el-form-item>
  761. </el-col>
  762. <el-col :span="8">
  763. <el-form-item
  764. label="最小时间粒度"
  765. prop="mintimegranid"
  766. >
  767. <el-select
  768. filterable clearable
  769. style="width: 100%;"
  770. v-model="dialog.editorBox.form.data.mintimegranid"
  771. >
  772. <el-option
  773. v-for="item of nameObj.mintimegranid.arr"
  774. :key="item.id"
  775. :value="item.id"
  776. :label="item.name"
  777. ></el-option>
  778. </el-select>
  779. </el-form-item>
  780. </el-col>
  781. </el-row>
  782. <el-row>
  783. <!-- <el-col :span="8">
  784. <el-form-item
  785. label="是否调度项"
  786. prop="isschedule"
  787. >
  788. <el-select
  789. filterable clearable
  790. style="width: 100%;"
  791. v-model="dialog.editorBox.form.data.isschedule"
  792. >
  793. <el-option
  794. label="是"
  795. value="1"
  796. ></el-option>
  797. <el-option
  798. label="否"
  799. value="0"
  800. ></el-option>
  801. </el-select>
  802. </el-form-item>
  803. </el-col> -->
  804. <el-col :span="8">
  805. <el-form-item
  806. label="工序"
  807. prop="costid"
  808. >
  809. <el-select
  810. filterable clearable
  811. style="width: 100%;"
  812. v-model="dialog.editorBox.form.data.costid"
  813. >
  814. <el-option
  815. v-for="item of nameObj.workprocid.arr"
  816. :key="item.id"
  817. :value="item.id"
  818. :label="item.name"
  819. ></el-option>
  820. </el-select>
  821. </el-form-item>
  822. </el-col>
  823. <el-col :span="16">
  824. <el-form-item
  825. label="数据来源"
  826. prop="sourceType"
  827. >
  828. <el-input filterable clearable
  829. style="width: 100%;"
  830. v-model.trim="dialog.editorBox.form.data.sourceType"
  831. >
  832. </el-input>
  833. </el-form-item>
  834. </el-col>
  835. </el-row>
  836. </el-form>
  837. </div>
  838. </el-tab-pane>
  839. <el-tab-pane
  840. label="计量点属性"
  841. name="2"
  842. >
  843. <div class="attribute-box">
  844. <div class="item">
  845. <p class="bt">基本属性</p>
  846. <el-form
  847. ref="dialog_form1"
  848. :model="dialog.editorBox.form1.data"
  849. :rules="dialog.editorBox.form1.rules"
  850. class="nr"
  851. label-width="90px"
  852. size="mini"
  853. >
  854. <el-row>
  855. <el-col :span="8">
  856. <el-form-item label="默认值" prop="defaultvalue">
  857. <el-input clearable
  858. style="width: 100%;"
  859. v-model.trim="dialog.editorBox.form1.data.defaultvalue"
  860. ></el-input>
  861. </el-form-item>
  862. </el-col>
  863. <el-col :span="8">
  864. <el-form-item label="精度" prop="digits">
  865. <el-input clearable
  866. style="width: 100%;"
  867. v-model.trim="dialog.editorBox.form1.data.digits"
  868. ></el-input>
  869. </el-form-item>
  870. </el-col>
  871. <el-col :span="8">
  872. <el-form-item label="级别" prop="node">
  873. <el-input clearable
  874. style="width: 100%;"
  875. v-model.trim="dialog.editorBox.form1.data.node"
  876. ></el-input>
  877. </el-form-item>
  878. </el-col>
  879. </el-row>
  880. <el-row>
  881. <el-col :span="8">
  882. <el-form-item label="顺序号" prop="showno">
  883. <el-input clearable
  884. style="width: 100%;"
  885. v-model.trim="dialog.editorBox.form1.data.showno"
  886. ></el-input>
  887. </el-form-item>
  888. </el-col>
  889. <el-col :span="8">
  890. <el-form-item label="父级ID" prop="parentid">
  891. <el-input clearable
  892. style="width: 100%;"
  893. v-model.trim="dialog.editorBox.form1.data.parentid"
  894. ></el-input>
  895. </el-form-item>
  896. </el-col>
  897. <el-col :span="8">
  898. <el-form-item label="记录创建时间" prop="recTime">
  899. <el-input clearable
  900. style="width: 100%;"
  901. v-model="dialog.editorBox.form1.data.recTime"
  902. disabled
  903. ></el-input>
  904. </el-form-item>
  905. </el-col>
  906. </el-row>
  907. <el-row>
  908. <el-col :span="8">
  909. <el-form-item label="启用" prop="useflag">
  910. <el-select
  911. filterable clearable
  912. style="width: 100%;"
  913. v-model="dialog.editorBox.form1.data.useflag"
  914. >
  915. <el-option
  916. label="是"
  917. value="1"
  918. ></el-option>
  919. <el-option
  920. label="否"
  921. value="0"
  922. ></el-option>
  923. </el-select>
  924. </el-form-item>
  925. </el-col>
  926. <el-col :span="8">
  927. <el-form-item label="点状态" prop="status">
  928. <el-select
  929. filterable clearable
  930. style="width: 100%;"
  931. v-model="dialog.editorBox.form1.data.status"
  932. >
  933. <el-option
  934. label="是"
  935. value="1"
  936. ></el-option>
  937. <el-option
  938. label="否"
  939. value="0"
  940. ></el-option>
  941. </el-select>
  942. </el-form-item>
  943. </el-col>
  944. </el-row>
  945. </el-form>
  946. </div>
  947. <div class="item">
  948. <p class="bt">扩展属性</p>
  949. <el-form
  950. class="nr"
  951. label-width="90px"
  952. size="mini"
  953. >
  954. <el-row>
  955. <el-col :span="8">
  956. <el-form-item label="仪表ID" prop="tagid">
  957. <el-input clearable
  958. style="width: 100%;"
  959. v-model.trim="dialog.editorBox.form1.data.tagid"
  960. ></el-input>
  961. </el-form-item>
  962. </el-col>
  963. <el-col :span="8">
  964. <el-form-item label="仪表名称" prop="tagname">
  965. <el-input clearable
  966. style="width: 100%;"
  967. v-model.trim="dialog.editorBox.form1.data.tagname"
  968. ></el-input>
  969. </el-form-item>
  970. </el-col>
  971. <el-col :span="8">
  972. <el-form-item label="跳变范围" prop="rangeVal">
  973. <el-input clearable
  974. style="width: 100%;"
  975. v-model.trim="dialog.editorBox.form1.data.rangeVal"
  976. ></el-input>
  977. </el-form-item>
  978. </el-col>
  979. </el-row>
  980. <el-row>
  981. <el-col :span="8">
  982. <el-form-item label="异常点标签" prop="tagBadSymbol">
  983. <el-input clearable
  984. style="width: 100%;"
  985. v-model.trim="dialog.editorBox.form1.data.tagBadSymbol"
  986. ></el-input>
  987. </el-form-item>
  988. </el-col>
  989. <el-col :span="8">
  990. <el-form-item label="倍率" prop="tagModulus">
  991. <el-input clearable
  992. style="width: 100%;"
  993. v-model.trim="dialog.editorBox.form1.data.tagModulus"
  994. ></el-input>
  995. </el-form-item>
  996. </el-col>
  997. <el-col :span="8">
  998. <el-form-item label="瞬时信号ID" prop="tagIdMap">
  999. <el-input clearable
  1000. style="width: 100%;"
  1001. v-model.trim="dialog.editorBox.form1.data.tagIdMap"
  1002. ></el-input>
  1003. </el-form-item>
  1004. </el-col>
  1005. </el-row>
  1006. <el-row>
  1007. <el-col :span="8">
  1008. <el-form-item label="计算模式" prop="calcMod">
  1009. <el-input clearable
  1010. style="width: 100%;"
  1011. v-model.trim="dialog.editorBox.form1.data.calcMod"
  1012. ></el-input>
  1013. </el-form-item>
  1014. </el-col>
  1015. <el-col :span="8">
  1016. <el-form-item label="数据类型" prop="dataType">
  1017. <el-input clearable
  1018. style="width: 100%;"
  1019. v-model.trim="dialog.editorBox.form1.data.dataType"
  1020. ></el-input>
  1021. </el-form-item>
  1022. </el-col>
  1023. <el-col :span="8">
  1024. <el-form-item label="仪表类型" prop="meterType">
  1025. <el-input clearable
  1026. style="width: 100%;"
  1027. v-model.trim="dialog.editorBox.form1.data.meterType"
  1028. ></el-input>
  1029. </el-form-item>
  1030. </el-col>
  1031. </el-row>
  1032. <el-row>
  1033. <el-col :span="8">
  1034. <el-form-item label="准点精度" prop="meterScale">
  1035. <el-input clearable
  1036. style="width: 100%;"
  1037. v-model.trim="dialog.editorBox.form1.data.meterScale"
  1038. ></el-input>
  1039. </el-form-item>
  1040. </el-col>
  1041. <el-col :span="8">
  1042. <el-form-item label="仪表位置" prop="meterLoc">
  1043. <el-input clearable
  1044. style="width: 100%;"
  1045. v-model.trim="dialog.editorBox.form1.data.meterLoc"
  1046. ></el-input>
  1047. </el-form-item>
  1048. </el-col>
  1049. </el-row>
  1050. </el-form>
  1051. </div>
  1052. <div class="item">
  1053. <p class="bt">特殊属性</p>
  1054. <el-form
  1055. class="nr"
  1056. label-width="90px"
  1057. size="mini"
  1058. >
  1059. <el-row>
  1060. <el-col :span="8">
  1061. <el-form-item label="对应数据表" prop="tagTable">
  1062. <el-input clearable
  1063. style="width: 100%;"
  1064. v-model.trim="dialog.editorBox.form1.data.tagTable"
  1065. ></el-input>
  1066. </el-form-item>
  1067. </el-col>
  1068. <el-col :span="8">
  1069. <el-form-item label="对应数据列" prop="tagCol">
  1070. <el-input clearable
  1071. style="width: 100%;"
  1072. v-model.trim="dialog.editorBox.form1.data.tagCol"
  1073. ></el-input>
  1074. </el-form-item>
  1075. </el-col>
  1076. <el-col :span="8">
  1077. <el-form-item label="最大值标志位" prop="maxVal">
  1078. <el-input clearable
  1079. style="width: 100%;"
  1080. v-model.trim="dialog.editorBox.form1.data.maxVal"
  1081. ></el-input>
  1082. </el-form-item>
  1083. </el-col>
  1084. </el-row>
  1085. <el-row>
  1086. <el-col :span="8">
  1087. <el-form-item label="最小值标志位" prop="minVal">
  1088. <el-input clearable
  1089. style="width: 100%;"
  1090. v-model.trim="dialog.editorBox.form1.data.minVal"
  1091. ></el-input>
  1092. </el-form-item>
  1093. </el-col>
  1094. <el-col :span="8">
  1095. <el-form-item label="平均值标志位" prop="avgVal">
  1096. <el-input clearable
  1097. style="width: 100%;"
  1098. v-model.trim="dialog.editorBox.form1.data.avgVal"
  1099. ></el-input>
  1100. </el-form-item>
  1101. </el-col>
  1102. <el-col :span="8">
  1103. <el-form-item label="累计值标志位" prop="sumVal">
  1104. <el-input clearable
  1105. style="width: 100%;"
  1106. v-model.trim="dialog.editorBox.form1.data.sumVal"
  1107. ></el-input>
  1108. </el-form-item>
  1109. </el-col>
  1110. </el-row>
  1111. <el-row>
  1112. <el-col :span="8">
  1113. <el-form-item label="电开关号" prop="bcode">
  1114. <el-input clearable
  1115. style="width: 100%;"
  1116. v-model.trim="dialog.editorBox.form1.data.bcode"
  1117. ></el-input>
  1118. </el-form-item>
  1119. </el-col>
  1120. <el-col :span="8">
  1121. <el-form-item label="das地址" prop="bdesc1">
  1122. <el-input clearable
  1123. style="width: 100%;"
  1124. v-model="dialog.editorBox.form1.data.bdesc1"
  1125. ></el-input>
  1126. </el-form-item>
  1127. </el-col>
  1128. <el-col :span="8">
  1129. <el-form-item label="录入序号" prop="bdesc2">
  1130. <el-input clearable
  1131. style="width: 100%;"
  1132. v-model.trim="dialog.editorBox.form1.data.bdesc2"
  1133. ></el-input>
  1134. </el-form-item>
  1135. </el-col>
  1136. </el-row>
  1137. <el-row>
  1138. <el-col :span="8">
  1139. <el-form-item label="备用描述" prop="btype1">
  1140. <el-input clearable
  1141. style="width: 100%;"
  1142. v-model.trim="dialog.editorBox.form1.data.btype1"
  1143. ></el-input>
  1144. </el-form-item>
  1145. </el-col>
  1146. <el-col :span="16">
  1147. <el-form-item label="十分钟表字段" prop="btype2">
  1148. <el-input clearable
  1149. style="width: 100%;"
  1150. v-model.trim="dialog.editorBox.form1.data.btype2"
  1151. ></el-input>
  1152. </el-form-item>
  1153. </el-col>
  1154. </el-row>
  1155. </el-form>
  1156. </div>
  1157. </div>
  1158. </el-tab-pane>
  1159. </el-tabs>
  1160. <span
  1161. slot="footer"
  1162. class="dialog-footer"
  1163. >
  1164. <el-button
  1165. size="mini"
  1166. @click="dialog.editorBox.show = false"
  1167. :loading="loading"
  1168. >取 消</el-button>
  1169. <el-button
  1170. size="mini"
  1171. type="primary"
  1172. @click="dataSave"
  1173. :loading="loading"
  1174. >保 存</el-button>
  1175. </span>
  1176. </el-dialog>
  1177. <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
  1178. </div>
  1179. </template>
  1180. <script>
  1181. import formulaEditor from '@/components/zg/formulaEditor.vue'
  1182. import { zCheckNumber2 } from '@/utils/validator.js'
  1183. import { formatDate } from '@/utils/util.js';
  1184. export default {
  1185. name: 'measurementPlace',
  1186. components: {
  1187. 'zj-formulaEditor': formulaEditor
  1188. },
  1189. data () {
  1190. return {
  1191. activeMenu: '',
  1192. filterForm: {
  1193. show: true,
  1194. useflag: '1',
  1195. data: {
  1196. energytypeid: '',
  1197. energyid: '',
  1198. propertyid: '',
  1199. itemtype: '',
  1200. locateid: '',
  1201. itemid: '',
  1202. itemname: '',
  1203. networkid: '',
  1204. costid: '',
  1205. hierarchy: '',
  1206. tagAlias: '',
  1207. version: formatDate(new Date(), 'yyyyMM00'),
  1208. tagTable: '',
  1209. tagCol: ''
  1210. },
  1211. rules: {
  1212. }
  1213. },
  1214. pageNum: 1,
  1215. pageSize: 20,
  1216. total: 0,
  1217. singleTableHeight: 100,
  1218. tableData: [],
  1219. nameObj: {
  1220. workprocid: {
  1221. obj: {},
  1222. arr: []
  1223. },
  1224. energytypeid: {
  1225. obj: {},
  1226. arr: []
  1227. },
  1228. energyid: {
  1229. obj: {},
  1230. arr: []
  1231. },
  1232. propertyid: {
  1233. obj: {},
  1234. arr: []
  1235. },
  1236. locateid: {
  1237. obj: {},
  1238. arr: []
  1239. },
  1240. networkid: {
  1241. obj: {},
  1242. arr: []
  1243. },
  1244. unitid: {
  1245. obj: {},
  1246. arr: []
  1247. },
  1248. hierarchy: {
  1249. obj: {},
  1250. arr: []
  1251. },
  1252. itemtype: {
  1253. obj: {
  1254. 'AUTO': '自动上传',
  1255. 'MANUAL': '手抄',
  1256. 'VIRTUAL': '虚拟'
  1257. },
  1258. arr: [
  1259. {
  1260. id: 'AUTO',
  1261. name: '自动上传'
  1262. },
  1263. {
  1264. id: 'MANUAL',
  1265. name: '手抄'
  1266. },
  1267. {
  1268. id: 'VIRTUAL',
  1269. name: '虚拟'
  1270. }
  1271. ]
  1272. },
  1273. mintimegranid: {
  1274. obj: {
  1275. 'SHIFT': '班',
  1276. 'DAY': '日',
  1277. 'MONTH': '月',
  1278. 'YEAR': '年'
  1279. },
  1280. arr: [
  1281. // {
  1282. // id: 'SHIFT',
  1283. // name: '班'
  1284. // },
  1285. {
  1286. id: 'DAY',
  1287. name: '日'
  1288. },
  1289. {
  1290. id: 'MONTH',
  1291. name: '月'
  1292. },
  1293. {
  1294. id: 'YEAR',
  1295. name: '年'
  1296. }
  1297. ]
  1298. }
  1299. },
  1300. loading: false,
  1301. tableLoading: false,
  1302. dialog: {
  1303. editorBox: {
  1304. show: false,
  1305. activeName: '1',
  1306. type: '',
  1307. addRow: null,
  1308. form: {
  1309. data: {
  1310. itemid: '',
  1311. itemname: '',
  1312. tagAlias: '',
  1313. itemdesc: '',
  1314. itemtype: '',
  1315. locateid: '',
  1316. networkid: '',
  1317. energytypeid: '',
  1318. energyid: '',
  1319. propertyid: '',
  1320. unitid: '',
  1321. isschedule: '0',
  1322. costid: '',
  1323. sourceType: '',
  1324. mintimegranid: 'DAY'
  1325. },
  1326. rules: {
  1327. // itemid: [
  1328. // { required: true, message: '该项不能为空', trigger: 'change' }
  1329. // ],
  1330. itemname: [
  1331. { required: true, message: '该项不能为空', trigger: 'change' }
  1332. ],
  1333. // tagAlias: [
  1334. // { required: true, message: '该项不能为空', trigger: 'change' }
  1335. // ],
  1336. locateid: [
  1337. { required: true, message: '该项不能为空', trigger: 'change' }
  1338. ],
  1339. networkid: [],
  1340. energytypeid: [
  1341. { required: true, message: '该项不能为空', trigger: 'change' }
  1342. ],
  1343. energyid: [
  1344. { required: true, message: '该项不能为空', trigger: 'change' }
  1345. ],
  1346. propertyid: [
  1347. { required: true, message: '该项不能为空', trigger: 'change' }
  1348. ],
  1349. itemtype: [
  1350. { required: true, message: '该项不能为空', trigger: 'change' }
  1351. ],
  1352. mintimegranid: [
  1353. { required: true, message: '该项不能为空', trigger: 'change' }
  1354. ],
  1355. bdesc2: [
  1356. { validator: zCheckNumber2, trigger: 'change' }
  1357. ]
  1358. }
  1359. },
  1360. form1: {
  1361. data: {
  1362. // 基础
  1363. defaultvalue: '',
  1364. digits: '',
  1365. node: '',
  1366. showno: '',
  1367. parentid: '',
  1368. recTime: '',
  1369. useflag: '',
  1370. status: '',
  1371. // 扩展
  1372. tagid: '',
  1373. tagname: '',
  1374. rangeVal: '',
  1375. tagBadSymbol: '',
  1376. tagModulus: '',
  1377. tagIdMap: '',
  1378. calcMod: '',
  1379. dataType: '',
  1380. meterType: '',
  1381. meterScale: '',
  1382. meterLoc: '',
  1383. // 特殊
  1384. tagTable: '',
  1385. tagCol: '',
  1386. maxVal: '',
  1387. minVal: '',
  1388. avgVal: '',
  1389. sumVal: '',
  1390. bcode: '',
  1391. bdesc1: '',
  1392. bdesc2: '',
  1393. btype1: '',
  1394. btype2: ''
  1395. },
  1396. rules: {
  1397. showno: [
  1398. { validator: zCheckNumber2, trigger: 'change' }
  1399. ]
  1400. }
  1401. }
  1402. },
  1403. equationEditing: {
  1404. show: false,
  1405. form: {
  1406. data: {
  1407. clock: '',
  1408. code: ''
  1409. }
  1410. }
  1411. }
  1412. },
  1413. butPrivilege: {
  1414. QUERY: false,
  1415. ADD: false,
  1416. PUT: false,
  1417. DELETE: false
  1418. }
  1419. }
  1420. },
  1421. created () {
  1422. // 获取按钮权限
  1423. this.activeMenu = window.localStorage.getItem('activeMenu');
  1424. for (let key in this.butPrivilege) {
  1425. this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
  1426. }
  1427. },
  1428. mounted () {
  1429. let that = this;
  1430. window.PEDataObj = {
  1431. // 将数据绑定到window上,供main页面使用
  1432. vm: that,
  1433. // tableArr:用于导出成Excel的表格的信息
  1434. tableArr: [
  1435. {
  1436. name: '',
  1437. id: 'singleTable'
  1438. }
  1439. ]
  1440. };
  1441. that.$nextTick(() => {
  1442. // 立即获取的height有一定偏差,通过setTimeout延迟来解决
  1443. setTimeout(() => {
  1444. that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
  1445. }, 1);
  1446. });
  1447. that.getEnergyTypeIdData();
  1448. that.getEnergyIdData();
  1449. that.getPropertyIdData();
  1450. that.getLocateIdData();
  1451. that.getNetworkIdData();
  1452. // that.getSourceTypeData();
  1453. that.getworkprocidData();
  1454. that.getUnitIdData();
  1455. that.getHierarchyData();
  1456. that.getTableData();
  1457. },
  1458. methods: {
  1459. // 计算树区域高度
  1460. getRoleHeight (dom) {
  1461. return window.innerHeight - dom.offsetTop;
  1462. },
  1463. // 获取工序
  1464. getworkprocidData () {
  1465. let that = this
  1466. let url = 'pass/ems/v1/trmworkprocs/getIdAndName';
  1467. that.axios.get(url)
  1468. .then(function (res) {
  1469. if (res.code === '0') {
  1470. let arr = [];
  1471. let obj = {};
  1472. for (let item of res.data) {
  1473. arr.push({
  1474. id: item.id,
  1475. name: item.name
  1476. })
  1477. obj[item.id] = item.name;
  1478. }
  1479. that.nameObj.workprocid.arr = arr;
  1480. that.nameObj.workprocid.obj = obj;
  1481. } else {
  1482. that.$message.error(res.message);
  1483. }
  1484. });
  1485. },
  1486. // 获取能介类型
  1487. getEnergyTypeIdData () {
  1488. let that = this
  1489. let url = 'pass/ems/v1/trmenergytypes/selectNameAndId/';
  1490. that.axios.get(url)
  1491. .then(function (res) {
  1492. if (res.code === '0') {
  1493. let arr = [];
  1494. let obj = {};
  1495. for (let item of res.data) {
  1496. arr.push({
  1497. id: item.id,
  1498. name: item.name
  1499. })
  1500. obj[item.id] = item.name;
  1501. }
  1502. that.nameObj.energytypeid.arr = arr;
  1503. that.nameObj.energytypeid.obj = obj;
  1504. } else {
  1505. that.$message.error(res.message);
  1506. }
  1507. });
  1508. },
  1509. connn () {
  1510. // this.filterForm.data.energytypeid = this.filterForm.data.energytypeid.join(',')
  1511. // console.log(this.filterForm.data.energytypeid)
  1512. // console.log(111)
  1513. // let that = this;
  1514. // let set = new Set();
  1515. // console.log(that.filterForm.data.energytypeid)
  1516. // if (!that.filterForm.data.energytypeid || that.filterForm.data.energytypeid.length === 0) {
  1517. // that.nameObj.energytypeid.showDataArr = that.nameObj.energytypeid.arr;
  1518. // } else {
  1519. // for (let key of that.filterForm.data.energytypeid) {
  1520. // if (that.nameObj.energytypeid.obj[key]) {
  1521. // for (let name of that.nameObj.energytypeid.obj[key]) {
  1522. // set.add(name);
  1523. // }
  1524. // }
  1525. // }
  1526. // that.nameObj.energytypeid.showDataArr = [...set];
  1527. // // console.log(that.nameObj.energytypeid.showDataArr)
  1528. // }
  1529. },
  1530. // 获取能介
  1531. getEnergyIdData () {
  1532. let that = this;
  1533. let url = 'pass/ems/v1/trmenergys/selectNameAndId/';
  1534. that.axios.get(url)
  1535. .then(function (res) {
  1536. if (res.code === '0') {
  1537. let arr = [];
  1538. let obj = {};
  1539. for (let item of res.data) {
  1540. arr.push({
  1541. id: item.id,
  1542. name: item.name,
  1543. energytypeid: item.energytypeid,
  1544. unitid: item.unitid
  1545. })
  1546. obj[item.id] = {
  1547. name: item.name,
  1548. unitid: item.unitid
  1549. }
  1550. }
  1551. that.nameObj.energyid.arr = arr;
  1552. that.nameObj.energyid.obj = obj;
  1553. } else {
  1554. that.$message.error(res.message);
  1555. }
  1556. });
  1557. },
  1558. // 获取属性
  1559. getPropertyIdData () {
  1560. let that = this
  1561. let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
  1562. that.axios.get(url)
  1563. .then(function (res) {
  1564. if (res.code === '0') {
  1565. let arr = [];
  1566. let obj = {};
  1567. for (let item of res.data) {
  1568. arr.push({
  1569. id: item.id,
  1570. name: item.name
  1571. })
  1572. obj[item.id] = item.name;
  1573. }
  1574. that.nameObj.propertyid.arr = arr;
  1575. that.nameObj.propertyid.obj = obj;
  1576. } else {
  1577. that.$message.error(res.message);
  1578. }
  1579. });
  1580. },
  1581. // 获取位置
  1582. getLocateIdData () {
  1583. let that = this
  1584. let url = 'pass/ems/v1/trmlocations/getidandname/';
  1585. that.axios.get(url)
  1586. .then(function (res) {
  1587. if (res.code === '0') {
  1588. let arr = [];
  1589. let obj = {};
  1590. for (let item of res.data) {
  1591. arr.push({
  1592. id: item.id,
  1593. name: item.name
  1594. })
  1595. obj[item.id] = item.name;
  1596. }
  1597. that.nameObj.locateid.arr = arr;
  1598. that.nameObj.locateid.obj = obj;
  1599. } else {
  1600. that.$message.error(res.message);
  1601. }
  1602. });
  1603. },
  1604. // 获取站所
  1605. getNetworkIdData () {
  1606. let that = this
  1607. let url = 'pass/ems/v1/trmstations/getidandname/';
  1608. that.axios.get(url)
  1609. .then(function (res) {
  1610. if (res.code === '0') {
  1611. let arr = [];
  1612. let obj = {};
  1613. for (let item of res.data) {
  1614. arr.push({
  1615. id: item.id,
  1616. name: item.name
  1617. })
  1618. obj[item.id] = item.name;
  1619. }
  1620. that.nameObj.networkid.arr = arr;
  1621. that.nameObj.networkid.obj = obj;
  1622. } else {
  1623. that.$message.error(res.message);
  1624. }
  1625. });
  1626. },
  1627. // // 获取数据来源
  1628. // getSourceTypeData () {
  1629. // let that = this
  1630. // let url = 'pass/ems/v1/trml1sources/getidandname/';
  1631. // that.axios.get(url)
  1632. // .then(function (res) {
  1633. // if (res.code === '0') {
  1634. // let arr = [];
  1635. // let obj = {};
  1636. // for (let item of res.data) {
  1637. // arr.push({
  1638. // id: item.id,
  1639. // name: item.name
  1640. // })
  1641. // obj[item.id] = item.name;
  1642. // }
  1643. // that.nameObj.sourceType.arr = arr;
  1644. // that.nameObj.sourceType.obj = obj;
  1645. // } else {
  1646. // that.$message.error(res.message);
  1647. // }
  1648. // });
  1649. // },
  1650. // 获取标准计量单位
  1651. getUnitIdData () {
  1652. let that = this
  1653. let url = 'pass/ems/v1/trmunits/getIdAndName';
  1654. that.axios.get(url)
  1655. .then(function (res) {
  1656. if (res.code === '0') {
  1657. let arr = [];
  1658. let obj = {};
  1659. for (let item of res.data) {
  1660. arr.push({
  1661. id: item.id,
  1662. name: item.name
  1663. })
  1664. obj[item.id] = item.name;
  1665. // if (item.name === '吨') {
  1666. // that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
  1667. // }
  1668. }
  1669. that.nameObj.unitid.arr = arr;
  1670. that.nameObj.unitid.obj = obj;
  1671. } else {
  1672. that.$message.error(res.message);
  1673. }
  1674. });
  1675. },
  1676. // 获取计量层级
  1677. getHierarchyData () {
  1678. let that = this
  1679. let url = 'pass/ems/v1/trmcalpoints/getRmCalpoint/';
  1680. that.axios.get(url)
  1681. .then(function (res) {
  1682. if (res.code === '0') {
  1683. let arr = [];
  1684. let obj = {};
  1685. for (let item of res.data) {
  1686. arr.push({
  1687. id: item.id,
  1688. name: item.name
  1689. })
  1690. obj[item.id] = item.name;
  1691. }
  1692. that.nameObj.hierarchy.arr = arr;
  1693. that.nameObj.hierarchy.obj = obj;
  1694. } else {
  1695. that.$message.error(res.message);
  1696. }
  1697. });
  1698. },
  1699. // 获取表格中的数据
  1700. getTableData (pageNum) {
  1701. let that = this,
  1702. params = {
  1703. energytypeid: that.filterForm.data.energytypeid.join(','),
  1704. energyid: that.filterForm.data.energyid.join(','),
  1705. propertyid: that.filterForm.data.propertyid.join(','),
  1706. itemtype: that.filterForm.data.itemtype,
  1707. locateid: that.filterForm.data.locateid.join(','),
  1708. itemid: that.filterForm.data.itemid,
  1709. itemname: that.filterForm.data.itemname,
  1710. networkid: that.filterForm.data.networkid.join(','),
  1711. costid: that.filterForm.data.costid.join(','),
  1712. node: that.filterForm.data.hierarchy,
  1713. tagAlias: that.filterForm.data.tagAlias,
  1714. version: that.filterForm.data.version,
  1715. tagTable: that.filterForm.data.tagTable,
  1716. tagCol: that.filterForm.data.tagCol,
  1717. useflag: that.filterForm.useflag
  1718. };
  1719. that.pageNum = pageNum || that.pageNum;
  1720. that.tableLoading = true;
  1721. let url = 'pass/ems/v1/trmcalpoints/like/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
  1722. that.axios.get(url, {
  1723. params: params
  1724. })
  1725. .then(function (res) {
  1726. if (res.code === '0') {
  1727. let arr = [];
  1728. for (let item of res.data.list) {
  1729. arr.push({
  1730. itemid: item.itemid,
  1731. itemname: item.itemname,
  1732. tagAlias: item.tagAlias,
  1733. itemdesc: item.itemdesc,
  1734. itemtype: item.itemtype,
  1735. locateid: item.locateid,
  1736. networkid: item.networkid,
  1737. energytypeid: item.energytypeid,
  1738. energyid: item.energyid,
  1739. propertyid: item.propertyid,
  1740. unitid: item.unitid,
  1741. isschedule: item.isschedule,
  1742. // issettle: item.issettle,
  1743. costid: item.costid,
  1744. sourceType: item.sourceType,
  1745. mintimegranid: item.mintimegranid,
  1746. // 基础
  1747. defaultvalue: item.defaultvalue,
  1748. digits: item.digits,
  1749. node: item.node,
  1750. showno: item.showno,
  1751. parentid: item.parentid,
  1752. recTime: item.recTime,
  1753. useflag: item.useflag,
  1754. status: item.status,
  1755. // 扩展
  1756. tagid: item.tagid,
  1757. tagname: item.tagname,
  1758. rangeVal: item.rangeVal,
  1759. tagBadSymbol: item.tagBadSymbol,
  1760. tagModulus: item.tagModulus,
  1761. tagIdMap: item.tagIdMap,
  1762. calcMod: item.calcMod,
  1763. dataType: item.dataType,
  1764. meterType: item.meterType,
  1765. meterScale: item.meterScale,
  1766. meterLoc: item.meterLoc,
  1767. // 特殊
  1768. tagTable: item.tagTable,
  1769. tagCol: item.tagCol,
  1770. maxVal: item.maxVal,
  1771. minVal: item.minVal,
  1772. avgVal: item.avgVal,
  1773. sumVal: item.sumVal,
  1774. bcode: item.bcode,
  1775. bdesc1: item.bdesc1,
  1776. bdesc2: item.bdesc2,
  1777. btype1: item.btype1,
  1778. btype2: item.btype2
  1779. })
  1780. }
  1781. that.tableData = arr;
  1782. that.total = res.data.total;
  1783. } else {
  1784. that.$message.error(res.message);
  1785. }
  1786. that.tableLoading = false;
  1787. }).catch(function () {
  1788. that.tableLoading = false;
  1789. });
  1790. },
  1791. // 改变表格显示条数
  1792. tableSizeChange (val) {
  1793. let that = this;
  1794. that.pageSize = val;
  1795. that.getTableData(1);
  1796. },
  1797. // 重置搜索
  1798. tableDataCancel () {
  1799. let that = this;
  1800. for (let key in that.filterForm.data) {
  1801. if (that.filterForm.data[key] instanceof Array) {
  1802. that.filterForm.data[key] = [];
  1803. } else {
  1804. that.filterForm.data[key] = '';
  1805. }
  1806. }
  1807. that.getTableData(1);
  1808. },
  1809. // 选择添加时的模板
  1810. handleCurrentChange (row) {
  1811. let that = this;
  1812. that.dialog.editorBox.addRow = row;
  1813. },
  1814. // 自动生成名称
  1815. autoSetName () {
  1816. let that = this;
  1817. if (that.dialog.editorBox.form.data.itemname === '') {
  1818. if (that.dialog.editorBox.form.data.locateid && that.dialog.editorBox.form.data.energyid && that.dialog.editorBox.form.data.propertyid) {
  1819. that.dialog.editorBox.form.data.itemname += that.nameObj.locateid.obj[that.dialog.editorBox.form.data.locateid];
  1820. that.dialog.editorBox.form.data.itemname += that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid].name;
  1821. that.dialog.editorBox.form.data.itemname += that.nameObj.propertyid.obj[that.dialog.editorBox.form.data.propertyid];
  1822. }
  1823. }
  1824. },
  1825. but_add () {
  1826. let that = this;
  1827. if (that.dialog.editorBox.addRow) {
  1828. for (let key in that.dialog.editorBox.form.data) {
  1829. if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
  1830. that.dialog.editorBox.form.data[key] = that.dialog.editorBox.addRow[key];
  1831. } else {
  1832. that.dialog.editorBox.form.data[key] = '';
  1833. }
  1834. }
  1835. for (let key in that.dialog.editorBox.form1.data) {
  1836. if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
  1837. that.dialog.editorBox.form1.data[key] = that.dialog.editorBox.addRow[key];
  1838. } else {
  1839. that.dialog.editorBox.form1.data[key] = '';
  1840. }
  1841. }
  1842. this.$refs['singleTable'].setCurrentRow();
  1843. } else {
  1844. for (let key in that.dialog.editorBox.form.data) {
  1845. if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
  1846. that.dialog.editorBox.form.data[key] = that.filterForm.data[key];
  1847. } else {
  1848. that.dialog.editorBox.form.data[key] = '';
  1849. }
  1850. }
  1851. for (let key in that.dialog.editorBox.form1.data) {
  1852. if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
  1853. that.dialog.editorBox.form1.data[key] = that.filterForm.data[key];
  1854. } else {
  1855. that.dialog.editorBox.form1.data[key] = '';
  1856. }
  1857. }
  1858. that.dialog.editorBox.form.data.unitid = that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid] ? that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid].unitid : '';
  1859. // that.dialog.editorBox.form.data.unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
  1860. that.dialog.editorBox.form.data.isschedule = '0';
  1861. that.dialog.editorBox.form1.data.useflag = '1';
  1862. that.dialog.editorBox.form1.data.status = '0';
  1863. }
  1864. that.dialog.editorBox.form.data.itemid = '';
  1865. // that.dialog.editorBox.form.data.itemname = '';
  1866. that.dialog.editorBox.form1.data.recTime = '';
  1867. that.dialog.editorBox.activeName = '1';
  1868. that.dialog.editorBox.type = 'add';
  1869. that.dialog.editorBox.show = true;
  1870. setTimeout(() => {
  1871. that.$refs['dialog_form'].clearValidate();
  1872. }, 100);
  1873. },
  1874. but_edit (row) {
  1875. let that = this;
  1876. for (let key in that.dialog.editorBox.form.data) {
  1877. if (typeof row[key] !== 'undefined') {
  1878. that.dialog.editorBox.form.data[key] = row[key];
  1879. }
  1880. }
  1881. for (let key in that.dialog.editorBox.form1.data) {
  1882. if (typeof row[key] !== 'undefined') {
  1883. that.dialog.editorBox.form1.data[key] = row[key];
  1884. }
  1885. }
  1886. that.dialog.editorBox.activeName = '1';
  1887. that.dialog.editorBox.type = 'edit';
  1888. that.dialog.editorBox.show = true;
  1889. },
  1890. but_del (row) {
  1891. let that = this;
  1892. that.$confirm('是否删除该条数据?', '提示', {
  1893. confirmButtonText: '确定',
  1894. cancelButtonText: '取消',
  1895. state: 'warning'
  1896. }).then(() => {
  1897. that.axios.delete('pass/ems/v1/trmcalpoints/' + row.itemid)
  1898. .then(function (res) {
  1899. if (res.code === '0') {
  1900. that.$message({
  1901. message: '删除成功',
  1902. type: 'success'
  1903. });
  1904. that.getTableData();
  1905. } else {
  1906. that.$message.error(res.message);
  1907. }
  1908. }).catch(function () {
  1909. });
  1910. }).catch(() => {
  1911. });
  1912. },
  1913. dataSave () {
  1914. let that = this;
  1915. let SubmitData = {
  1916. itemid: that.dialog.editorBox.form.data.itemid,
  1917. itemname: that.dialog.editorBox.form.data.itemname,
  1918. tagAlias: that.dialog.editorBox.form.data.tagAlias,
  1919. itemdesc: that.dialog.editorBox.form.data.itemdesc,
  1920. itemtype: that.dialog.editorBox.form.data.itemtype,
  1921. locateid: that.dialog.editorBox.form.data.locateid,
  1922. networkid: that.dialog.editorBox.form.data.networkid,
  1923. energytypeid: that.dialog.editorBox.form.data.energytypeid,
  1924. energyid: that.dialog.editorBox.form.data.energyid,
  1925. propertyid: that.dialog.editorBox.form.data.propertyid,
  1926. unitid: that.dialog.editorBox.form.data.unitid,
  1927. isschedule: that.dialog.editorBox.form.data.isschedule,
  1928. costid: that.dialog.editorBox.form.data.costid,
  1929. sourceType: that.dialog.editorBox.form.data.sourceType,
  1930. mintimegranid: that.dialog.editorBox.form.data.mintimegranid,
  1931. // 基础
  1932. defaultvalue: that.dialog.editorBox.form1.data.defaultvalue,
  1933. digits: that.dialog.editorBox.form1.data.digits,
  1934. node: that.dialog.editorBox.form1.data.node,
  1935. showno: that.dialog.editorBox.form1.data.showno,
  1936. parentid: that.dialog.editorBox.form1.data.parentid,
  1937. recTime: that.dialog.editorBox.form1.data.recTime,
  1938. useflag: that.dialog.editorBox.form1.data.useflag,
  1939. status: that.dialog.editorBox.form1.data.status,
  1940. // 扩展
  1941. tagid: that.dialog.editorBox.form1.data.tagid,
  1942. tagname: that.dialog.editorBox.form1.data.tagname,
  1943. rangeVal: that.dialog.editorBox.form1.data.rangeVal,
  1944. tagBadSymbol: that.dialog.editorBox.form1.data.tagBadSymbol,
  1945. tagModulus: that.dialog.editorBox.form1.data.tagModulus,
  1946. tagIdMap: that.dialog.editorBox.form1.data.tagIdMap,
  1947. calcMod: that.dialog.editorBox.form1.data.calcMod,
  1948. dataType: that.dialog.editorBox.form1.data.dataType,
  1949. meterType: that.dialog.editorBox.form1.data.meterType,
  1950. meterScale: that.dialog.editorBox.form1.data.meterScale,
  1951. meterLoc: that.dialog.editorBox.form1.data.meterLoc,
  1952. // 特殊
  1953. tagTable: that.dialog.editorBox.form1.data.tagTable,
  1954. tagCol: that.dialog.editorBox.form1.data.tagCol,
  1955. maxVal: that.dialog.editorBox.form1.data.maxVal,
  1956. minVal: that.dialog.editorBox.form1.data.minVal,
  1957. avgVal: that.dialog.editorBox.form1.data.avgVal,
  1958. sumVal: that.dialog.editorBox.form1.data.sumVal,
  1959. bcode: that.dialog.editorBox.form1.data.bcode,
  1960. bdesc1: that.dialog.editorBox.form1.data.bdesc1,
  1961. bdesc2: that.dialog.editorBox.form1.data.bdesc2,
  1962. btype1: that.dialog.editorBox.form1.data.btype1,
  1963. btype2: that.dialog.editorBox.form1.data.btype2
  1964. };
  1965. that.$refs['dialog_form'].validate((valid) => {
  1966. if (valid) {
  1967. that.$refs['dialog_form1'].validate((valid1) => {
  1968. if (valid1) {
  1969. if (that.dialog.editorBox.type === 'add') {
  1970. let foorData = new FormData();
  1971. for (let key in SubmitData) {
  1972. foorData.append(key, SubmitData[key]);
  1973. }
  1974. that.loading = true;
  1975. that.axios.post('pass/ems/v1/trmcalpoints/', foorData, {
  1976. headers: {
  1977. 'Content-Type': 'multipart/form-data'
  1978. }
  1979. })
  1980. .then(function (res) {
  1981. if (res.code === '0') {
  1982. that.$message({
  1983. message: '新增成功',
  1984. type: 'success'
  1985. });
  1986. that.getTableData();
  1987. that.dialog.editorBox.show = false;
  1988. } else {
  1989. that.$message.error(res.message);
  1990. }
  1991. that.loading = false;
  1992. }).catch(function () {
  1993. that.loading = false;
  1994. });
  1995. } else {
  1996. that.loading = true;
  1997. that.axios.put('pass/ems/v1/trmcalpoints/' + SubmitData.itemid, SubmitData)
  1998. .then(function (res) {
  1999. if (res.code === '0') {
  2000. let msg = res.message
  2001. if (!msg || msg === '操作成功') {
  2002. that.$message({
  2003. message: '修改成功',
  2004. type: 'success'
  2005. });
  2006. } else {
  2007. that.$message.warning('修改成功,注意:' + msg);
  2008. }
  2009. that.getTableData();
  2010. that.dialog.editorBox.show = false;
  2011. } else {
  2012. that.$message.error(res.message);
  2013. }
  2014. that.loading = false;
  2015. }).catch(function () {
  2016. that.loading = false;
  2017. });
  2018. }
  2019. } else {
  2020. that.dialog.editorBox.activeName = '2';
  2021. }
  2022. });
  2023. } else {
  2024. that.dialog.editorBox.activeName = '1';
  2025. }
  2026. });
  2027. },
  2028. but_equationEditing (row) {
  2029. let that = this;
  2030. that.dialog.equationEditing.form.data.clock = that.filterForm.data.version;
  2031. that.dialog.equationEditing.form.data.code = row.itemid;
  2032. that.dialog.equationEditing.show = true;
  2033. },
  2034. rowClassName ({row, rowIndex}) {
  2035. return row.useflag !== '1' ? 'rowDisable' : ''
  2036. },
  2037. upUseflag (row, useflag = 0) {
  2038. let that = this;
  2039. let SubmitData = {
  2040. itemname: row.itemname,
  2041. tagAlias: row.tagAlias,
  2042. itemdesc: row.itemdesc,
  2043. itemtype: row.itemtype,
  2044. locateid: row.locateid,
  2045. networkid: row.networkid,
  2046. energytypeid: row.energytypeid,
  2047. energyid: row.energyid,
  2048. propertyid: row.propertyid,
  2049. unitid: row.unitid,
  2050. isschedule: row.isschedule,
  2051. sourceType: row.sourceType,
  2052. useflag: useflag,
  2053. mintimegranid: row.mintimegranid
  2054. };
  2055. that.$confirm('是否' + (useflag === '1' ? '启用' : '禁用') + '?', '提示', {
  2056. confirmButtonText: '确定',
  2057. cancelButtonText: '取消',
  2058. type: 'warning'
  2059. }).then(() => {
  2060. that.axios.put('pass/ems/v1/trmcalpoints/' + row.itemid, SubmitData)
  2061. .then(function (res) {
  2062. if (res.code === '0') {
  2063. that.$message({
  2064. message: useflag === '1' ? '启用成功' : '禁用成功',
  2065. type: 'success'
  2066. });
  2067. that.getTableData();
  2068. that.dialog.editorBox.show = false;
  2069. } else {
  2070. that.$message.error(res.message);
  2071. }
  2072. }).catch(function () {
  2073. });
  2074. }).catch(() => {
  2075. })
  2076. }
  2077. }
  2078. }
  2079. </script>
  2080. <style lang="less">
  2081. .measurementPlace {
  2082. min-width: 700px;
  2083. height: 100%;
  2084. .box {
  2085. height: 100%;
  2086. padding: 15px 15px 0 15px;
  2087. .box-top {
  2088. .el-form-item {
  2089. margin-bottom: 7px;
  2090. }
  2091. .box-top-gjl {
  2092. overflow: hidden;
  2093. // margin-top: -7px;
  2094. padding: 7px 0;
  2095. border-top: 1px solid #ccc;
  2096. // border-bottom: 1px solid #ccc;
  2097. // margin-bottom: 6px;
  2098. }
  2099. }
  2100. .rowDisable td {
  2101. background-color: #dfdfdf !important;
  2102. }
  2103. }
  2104. .attribute-box {
  2105. .item {
  2106. border: #ccc 1px solid;
  2107. padding: 5px;
  2108. margin-bottom: 6px;
  2109. .bt {
  2110. font-size: 14px;
  2111. font-weight: 600;
  2112. color: #000;
  2113. padding-left: 10px;
  2114. border-left: #008fe0 5px solid;
  2115. }
  2116. }
  2117. }
  2118. .color_no {
  2119. color: #7a7a7a;
  2120. }
  2121. .color_yes {
  2122. color: #1a9f17;
  2123. }
  2124. .el-button--mini {
  2125. padding: 7px 12px;
  2126. }
  2127. }
  2128. </style>