1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131 |
- <template>
- <!-- 计量点信息维护 -->
- <div class="measurementPlace">
- <div class="box">
- <div class="box-top">
- <el-form
- style="overflow: hidden;"
- :style="filterForm.show ? null : { height: '0px' }"
- size="mini"
- label-width="80px"
- >
- <el-row>
- <el-col :span="6">
- <el-form-item label="能介类型">
- <el-select
- filterable clearable
- v-model="filterForm.data.energytypeid"
- multiple
- collapse-tags
- placeholder="能介类型"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.energytypeid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="能介">
- <el-select
- filterable clearable
- v-model="filterForm.data.energyid"
- multiple
- collapse-tags
- placeholder="能介"
- style="width: 100%;"
- >
- <template v-for="item of nameObj.energyid.arr">
- <el-option
- v-if="filterForm.data.energytypeid.indexOf(item.energytypeid) !== -1 || Object.keys(filterForm.data.energytypeid).length === 0"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </template>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="用能属性">
- <el-select
- filterable clearable
- v-model="filterForm.data.propertyid"
- placeholder="用能属性"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.propertyid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="手抄或自动">
- <el-select
- filterable clearable
- v-model="filterForm.data.itemtype"
- placeholder="手抄或自动"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.itemtype.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="6">
- <el-form-item label="工序">
- <el-select
- filterable clearable
- v-model="filterForm.data.costid"
- placeholder="工序"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.workprocid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="站所">
- <el-select
- filterable clearable
- v-model="filterForm.data.networkid"
- placeholder="站所"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.networkid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="计量点编号">
- <el-input clearable
- v-model.trim="filterForm.data.itemid"
- placeholder="计量点编号"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="计量点名称">
- <el-input clearable
- v-model.trim="filterForm.data.itemname"
- placeholder="计量点名称"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <!-- <el-col :span="6">
- <el-form-item label="计量层级">
- <el-select
- filterable clearable
- v-model="filterForm.data.hierarchy"
- placeholder="计量层级"
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.hierarchy.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col> -->
- <el-col :span="6">
- <el-form-item label="位置">
- <el-select
- filterable clearable
- v-model="filterForm.data.locateid"
- placeholder="位置"
- multiple
- collapse-tags
- style="width: 100%;"
- >
- <el-option
- v-for="item of nameObj.locateid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="TAG点别名">
- <el-input clearable
- v-model.trim="filterForm.data.tagAlias"
- placeholder="TAG点别名"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="数据表">
- <el-input clearable
- v-model.trim="filterForm.data.tagTable"
- placeholder="小时数据表"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="数据列">
- <el-input clearable
- v-model.trim="filterForm.data.tagCol"
- placeholder="小时表列(TAG)"
- style="width: 100%;"
- @keyup.enter.native="getTableData(1)"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <!-- <div style="text-align: right;margin-bottom: 13px;">
- </div> -->
- </el-form>
- <div class="box-top-gjl">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- v-if="butPrivilege.ADD"
- @click="but_add"
- >新增</el-button>
- <!-- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-upload2"
- >导入计量点</el-button>
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-download"
- >导出全部计量点</el-button> -->
- <div style="float:right; text-align: right;">
- <el-button
- class="button"
- type="primary"
- size="mini"
- icon="el-icon-search"
- v-if="butPrivilege.QUERY"
- @click="filterForm.useflag='';getTableData(1);"
- >查询全部</el-button>
- <el-button
- class="button"
- type="primary"
- icon="el-icon-search"
- size="mini"
- v-if="butPrivilege.QUERY"
- @click="filterForm.useflag='1';getTableData(1)"
- >查询</el-button>
- <el-button
- class="button"
- type="primary"
- icon="el-icon-refresh"
- size="mini"
- v-if="butPrivilege.QUERY"
- @click="tableDataCancel();"
- >重置</el-button>
- <el-button
- size="mini"
- :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
- :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
- @click="filterForm.show = !filterForm.show;
- $nextTick(() => {
- singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
- }
- );"
- >{{ filterForm.show ? '收起' : '展开' }}</el-button>
- </div>
- </div>
- </div>
- <div class="box-bottom">
- <el-table
- stripe
- id="singleTable"
- ref="singleTable"
- :data="tableData"
- v-loading="tableLoading"
- style="width: 100%;"
- :height="singleTableHeight"
- border
- size="mini"
- highlight-current-row
- @current-change="handleCurrentChange"
- :row-class-name="rowClassName"
- >
- <el-table-column
- sortable
- prop="itemid"
- label="计量点编号"
- width="120px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="itemname"
- label="计量点名称"
- min-width="150px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="tagAlias"
- label="TAG别名"
- min-width="150px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="itemdesc"
- label="描述信息"
- min-width="150px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="itemtype"
- label="手抄自动"
- width="72px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.itemtype.obj[scope.row.itemtype] ? nameObj.itemtype.obj[scope.row.itemtype] : scope.row.itemtype }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="costid"
- label="工序"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.workprocid.obj[scope.row.costid] ? nameObj.workprocid.obj[scope.row.costid] : scope.row.costid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="locateid"
- label="位置"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.locateid.obj[scope.row.locateid] ? nameObj.locateid.obj[scope.row.locateid] : scope.row.locateid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="networkid"
- label="站所"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.networkid.obj[scope.row.networkid] ? nameObj.networkid.obj[scope.row.networkid] : scope.row.networkid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="energytypeid"
- label="能介类型"
- width="75px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.energytypeid.obj[scope.row.energytypeid] ? nameObj.energytypeid.obj[scope.row.energytypeid] : scope.row.energytypeid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="energyid"
- label="能介"
- width="85px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.energyid.obj[scope.row.energyid] ? nameObj.energyid.obj[scope.row.energyid].name : scope.row.energyid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="propertyid"
- label="用能属性"
- width="80px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.propertyid.obj[scope.row.propertyid] ? nameObj.propertyid.obj[scope.row.propertyid] : scope.row.propertyid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="unitid"
- label="计量单位"
- min-width="80px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="mintimegranid"
- label="最小时间粒度"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{ nameObj.mintimegranid.obj[scope.row.mintimegranid] ? nameObj.mintimegranid.obj[scope.row.mintimegranid] : scope.row.mintimegranid }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- sortable
- prop="isschedule"
- label="是否调度项"
- width="90px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span :class="{color_yes: scope.row.isschedule === '1', color_no: scope.row.isschedule === '0'}">{{ scope.row.isschedule === '0' ? '否' : scope.row.isschedule === '1' ? '是' : '' }}</span>
- </template>
- </el-table-column>
- <el-table-column
- sortable
- prop="issettle"
- label="是否结算项"
- width="90px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span :class="{color_yes: scope.row.issettle === '1', color_no: scope.row.issettle === '0'}">{{ scope.row.issettle === '0' ? '否' : scope.row.issettle === '1' ? '是' : '' }}</span>
- </template>
- </el-table-column> -->
- <el-table-column
- sortable
- prop="useflag"
- label="启用"
- width="60px"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span :class="{color_yes: scope.row.useflag === '1', color_no: scope.row.useflag === '0'}">{{ scope.row.useflag === '0' ? '否' : scope.row.useflag === '1' ? '是' : '' }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column
- sortable
- prop="showno"
- label="顺序号"
- width="90px"
- :show-overflow-tooltip="true"
- ></el-table-column> -->
- <el-table-column
- sortable
- prop="sourceType"
- label="数据来源"
- min-width="100px"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- sortable
- prop="bdesc1"
- label="das地址"
- min-width="100px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="tagTable"
- label="对应数据表"
- width="200px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- sortable
- prop="tagCol"
- label="对应数据列"
- width="90px"
- :show-overflow-tooltip="true"
- ></el-table-column>
- <el-table-column
- class-name="gn-TableDownloadExcel-none"
- v-if="butPrivilege.PUT || butPrivilege.DELETE"
- label="操作"
- align="center"
- min-width="236px"
- fixed="right"
- >
- <template slot-scope="scope">
- <div>
- <el-button
- type="primary"
- size="mini"
- @click="but_equationEditing(scope.row)"
- v-if="butPrivilege.PUT && scope.row.itemtype === 'VIRTUAL'"
- >公式</el-button>
- <el-button
- type="primary"
- size="mini"
- v-if="butPrivilege.PUT"
- @click="but_edit(scope.row)"
- >修改</el-button>
- <el-button
- v-if="butPrivilege.PUT && scope.row.useflag === '1'"
- type="danger"
- size="mini"
- @click="upUseflag(scope.row, '0')"
- >禁用</el-button>
- <el-button
- v-if="butPrivilege.PUT && scope.row.useflag !== '1'"
- type="primary"
- size="mini"
- @click="upUseflag(scope.row, '1')"
- >启用</el-button>
- <el-button
- type="danger"
- size="mini"
- v-if="butPrivilege.DELETE"
- @click="but_del(scope.row)"
- >删除</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- :page-sizes="[10, 20, 50, 100, 500, 1000]"
- :page-size="pageSize"
- :current-page.sync="pageNum"
- @size-change="tableSizeChange"
- @current-change="getTableData()"
- style="text-align: right;margin-top: 10px;"
- ></el-pagination>
- </div>
- </div>
- <el-dialog
- :title="'计量点信息 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
- :visible.sync="dialog.editorBox.show"
- width="950px"
- :close-on-click-modal="false"
- :show-close="!loading"
- >
- <el-tabs
- v-model="dialog.editorBox.activeName"
- type="border-card"
- >
- <el-tab-pane
- label="基础信息"
- name="1"
- >
- <div>
- <el-form
- ref="dialog_form"
- :model="dialog.editorBox.form.data"
- :rules="dialog.editorBox.form.rules"
- size="mini"
- label-width="90px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item
- label="计量点编号"
- prop="itemid"
- >
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.itemid"
- disabled
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="计量点名称"
- prop="itemname"
- >
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.itemname"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="TAG别名"
- prop="tagAlias"
- >
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.tagAlias"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item
- label="位置"
- prop="locateid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.locateid"
- @change="autoSetName()"
- >
- <el-option
- v-for="item of nameObj.locateid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="能介类型"
- prop="energytypeid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.energytypeid"
- @change="dialog.editorBox.form.data.energyid='';"
- >
- <el-option
- v-for="item of nameObj.energytypeid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="能介"
- prop="energyid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.energyid"
- @change="dialog.editorBox.form.data.unitid = nameObj.energyid.obj[dialog.editorBox.form.data.energyid].unitid; autoSetName()"
- >
- <template v-for="item of nameObj.energyid.arr">
- <el-option
- v-if="item.energytypeid === dialog.editorBox.form.data.energytypeid || dialog.editorBox.form.data.energytypeid === ''"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </template>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item
- label="用能属性"
- prop="propertyid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.propertyid"
- @change="autoSetName()"
- >
- <el-option
- v-for="item of nameObj.propertyid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="手抄或自动"
- prop="itemtype"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.itemtype"
- >
- <el-option
- v-for="item of nameObj.itemtype.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="站所"
- prop="networkid"
- :rules="[{required: dialog.editorBox.form.data.energytypeid === 'E', message:'该项不能为空'}]"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.networkid"
- >
- <el-option
- v-for="item of nameObj.networkid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item
- label="描述信息"
- prop="itemdesc"
- >
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form.data.itemdesc"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="计量单位"
- prop="unitid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.unitid"
- >
- <el-option
- v-for="item of nameObj.unitid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="最小时间粒度"
- prop="mintimegranid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.mintimegranid"
- >
- <el-option
- v-for="item of nameObj.mintimegranid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <!-- <el-col :span="8">
- <el-form-item
- label="是否调度项"
- prop="isschedule"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.isschedule"
- >
- <el-option
- label="是"
- value="1"
- ></el-option>
- <el-option
- label="否"
- value="0"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col> -->
- <el-col :span="8">
- <el-form-item
- label="工序"
- prop="costid"
- >
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form.data.costid"
- >
- <el-option
- v-for="item of nameObj.workprocid.arr"
- :key="item.id"
- :value="item.id"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item
- label="数据来源"
- prop="sourceType"
- >
- <el-input filterable clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form.data.sourceType"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </el-tab-pane>
- <el-tab-pane
- label="计量点属性"
- name="2"
- >
- <div class="attribute-box">
- <div class="item">
- <p class="bt">基本属性</p>
- <el-form
- ref="dialog_form1"
- :model="dialog.editorBox.form1.data"
- :rules="dialog.editorBox.form1.rules"
- class="nr"
- label-width="90px"
- size="mini"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="默认值" prop="defaultvalue">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.defaultvalue"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="精度" prop="digits">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.digits"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="级别" prop="node">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.node"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="顺序号" prop="showno">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.showno"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="父级ID" prop="parentid">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.parentid"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="记录创建时间" prop="recTime">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form1.data.recTime"
- disabled
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="启用" prop="useflag">
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form1.data.useflag"
- >
- <el-option
- label="是"
- value="1"
- ></el-option>
- <el-option
- label="否"
- value="0"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="点状态" prop="status">
- <el-select
- filterable clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form1.data.status"
- >
- <el-option
- label="是"
- value="1"
- ></el-option>
- <el-option
- label="否"
- value="0"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="item">
- <p class="bt">扩展属性</p>
- <el-form
- class="nr"
- label-width="90px"
- size="mini"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="仪表ID" prop="tagid">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagid"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="仪表名称" prop="tagname">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagname"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="跳变范围" prop="rangeVal">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.rangeVal"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="异常点标签" prop="tagBadSymbol">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagBadSymbol"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="倍率" prop="tagModulus">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagModulus"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="瞬时信号ID" prop="tagIdMap">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagIdMap"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="计算模式" prop="calcMod">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.calcMod"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="数据类型" prop="dataType">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.dataType"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="仪表类型" prop="meterType">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.meterType"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="准点精度" prop="meterScale">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.meterScale"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="仪表位置" prop="meterLoc">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.meterLoc"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="item">
- <p class="bt">特殊属性</p>
- <el-form
- class="nr"
- label-width="90px"
- size="mini"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="对应数据表" prop="tagTable">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagTable"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="对应数据列" prop="tagCol">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.tagCol"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="最大值标志位" prop="maxVal">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.maxVal"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="最小值标志位" prop="minVal">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.minVal"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="平均值标志位" prop="avgVal">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.avgVal"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="累计值标志位" prop="sumVal">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.sumVal"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="电开关号" prop="bcode">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.bcode"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="das地址" prop="bdesc1">
- <el-input clearable
- style="width: 100%;"
- v-model="dialog.editorBox.form1.data.bdesc1"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入序号" prop="bdesc2">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.bdesc2"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="备用描述" prop="btype1">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.btype1"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="十分钟表字段" prop="btype2">
- <el-input clearable
- style="width: 100%;"
- v-model.trim="dialog.editorBox.form1.data.btype2"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
- <span
- slot="footer"
- class="dialog-footer"
- >
- <el-button
- size="mini"
- @click="dialog.editorBox.show = false"
- :loading="loading"
- >取 消</el-button>
- <el-button
- size="mini"
- type="primary"
- @click="dataSave"
- :loading="loading"
- >保 存</el-button>
- </span>
- </el-dialog>
- <zj-formulaEditor :equationEditing="dialog.equationEditing"></zj-formulaEditor>
- </div>
- </template>
- <script>
- import formulaEditor from '@/components/zg/formulaEditor.vue'
- import { zCheckNumber2 } from '@/utils/validator.js'
- import { formatDate } from '@/utils/util.js';
- export default {
- name: 'measurementPlace',
- components: {
- 'zj-formulaEditor': formulaEditor
- },
- data () {
- return {
- activeMenu: '',
- filterForm: {
- show: true,
- useflag: '1',
- data: {
- energytypeid: '',
- energyid: '',
- propertyid: '',
- itemtype: '',
- locateid: '',
- itemid: '',
- itemname: '',
- networkid: '',
- costid: '',
- hierarchy: '',
- tagAlias: '',
- version: formatDate(new Date(), 'yyyyMM00'),
- tagTable: '',
- tagCol: ''
- },
- rules: {
- }
- },
- pageNum: 1,
- pageSize: 20,
- total: 0,
- singleTableHeight: 100,
- tableData: [],
- nameObj: {
- workprocid: {
- obj: {},
- arr: []
- },
- energytypeid: {
- obj: {},
- arr: []
- },
- energyid: {
- obj: {},
- arr: []
- },
- propertyid: {
- obj: {},
- arr: []
- },
- locateid: {
- obj: {},
- arr: []
- },
- networkid: {
- obj: {},
- arr: []
- },
- unitid: {
- obj: {},
- arr: []
- },
- hierarchy: {
- obj: {},
- arr: []
- },
- itemtype: {
- obj: {
- 'AUTO': '自动上传',
- 'MANUAL': '手抄',
- 'VIRTUAL': '虚拟'
- },
- arr: [
- {
- id: 'AUTO',
- name: '自动上传'
- },
- {
- id: 'MANUAL',
- name: '手抄'
- },
- {
- id: 'VIRTUAL',
- name: '虚拟'
- }
- ]
- },
- mintimegranid: {
- obj: {
- 'SHIFT': '班',
- 'DAY': '日',
- 'MONTH': '月',
- 'YEAR': '年'
- },
- arr: [
- // {
- // id: 'SHIFT',
- // name: '班'
- // },
- {
- id: 'DAY',
- name: '日'
- },
- {
- id: 'MONTH',
- name: '月'
- },
- {
- id: 'YEAR',
- name: '年'
- }
- ]
- }
- },
- loading: false,
- tableLoading: false,
- dialog: {
- editorBox: {
- show: false,
- activeName: '1',
- type: '',
- addRow: null,
- form: {
- data: {
- itemid: '',
- itemname: '',
- tagAlias: '',
- itemdesc: '',
- itemtype: '',
- locateid: '',
- networkid: '',
- energytypeid: '',
- energyid: '',
- propertyid: '',
- unitid: '',
- isschedule: '0',
- costid: '',
- sourceType: '',
- mintimegranid: 'DAY'
- },
- rules: {
- // itemid: [
- // { required: true, message: '该项不能为空', trigger: 'change' }
- // ],
- itemname: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- // tagAlias: [
- // { required: true, message: '该项不能为空', trigger: 'change' }
- // ],
- locateid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- networkid: [],
- energytypeid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- energyid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- propertyid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- itemtype: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- mintimegranid: [
- { required: true, message: '该项不能为空', trigger: 'change' }
- ],
- bdesc2: [
- { validator: zCheckNumber2, trigger: 'change' }
- ]
- }
- },
- form1: {
- data: {
- // 基础
- defaultvalue: '',
- digits: '',
- node: '',
- showno: '',
- parentid: '',
- recTime: '',
- useflag: '',
- status: '',
- // 扩展
- tagid: '',
- tagname: '',
- rangeVal: '',
- tagBadSymbol: '',
- tagModulus: '',
- tagIdMap: '',
- calcMod: '',
- dataType: '',
- meterType: '',
- meterScale: '',
- meterLoc: '',
- // 特殊
- tagTable: '',
- tagCol: '',
- maxVal: '',
- minVal: '',
- avgVal: '',
- sumVal: '',
- bcode: '',
- bdesc1: '',
- bdesc2: '',
- btype1: '',
- btype2: ''
- },
- rules: {
- showno: [
- { validator: zCheckNumber2, trigger: 'change' }
- ]
- }
- }
- },
- equationEditing: {
- show: false,
- form: {
- data: {
- clock: '',
- code: ''
- }
- }
- }
- },
- butPrivilege: {
- QUERY: false,
- ADD: false,
- PUT: false,
- DELETE: false
- }
- }
- },
- created () {
- // 获取按钮权限
- this.activeMenu = window.localStorage.getItem('activeMenu');
- for (let key in this.butPrivilege) {
- this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
- }
- },
- mounted () {
- let that = this;
- window.PEDataObj = {
- // 将数据绑定到window上,供main页面使用
- vm: that,
- // tableArr:用于导出成Excel的表格的信息
- tableArr: [
- {
- name: '',
- id: 'singleTable'
- }
- ]
- };
- that.$nextTick(() => {
- // 立即获取的height有一定偏差,通过setTimeout延迟来解决
- setTimeout(() => {
- that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
- }, 1);
- });
- that.getEnergyTypeIdData();
- that.getEnergyIdData();
- that.getPropertyIdData();
- that.getLocateIdData();
- that.getNetworkIdData();
- // that.getSourceTypeData();
- that.getworkprocidData();
- that.getUnitIdData();
- that.getHierarchyData();
- that.getTableData();
- },
- methods: {
- // 计算树区域高度
- getRoleHeight (dom) {
- return window.innerHeight - dom.offsetTop;
- },
- // 获取工序
- getworkprocidData () {
- let that = this
- let url = 'pass/ems/v1/trmworkprocs/getIdAndName';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.workprocid.arr = arr;
- that.nameObj.workprocid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取能介类型
- getEnergyTypeIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergytypes/selectNameAndId/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.energytypeid.arr = arr;
- that.nameObj.energytypeid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- connn () {
- // this.filterForm.data.energytypeid = this.filterForm.data.energytypeid.join(',')
- // console.log(this.filterForm.data.energytypeid)
- // console.log(111)
- // let that = this;
- // let set = new Set();
- // console.log(that.filterForm.data.energytypeid)
- // if (!that.filterForm.data.energytypeid || that.filterForm.data.energytypeid.length === 0) {
- // that.nameObj.energytypeid.showDataArr = that.nameObj.energytypeid.arr;
- // } else {
- // for (let key of that.filterForm.data.energytypeid) {
- // if (that.nameObj.energytypeid.obj[key]) {
- // for (let name of that.nameObj.energytypeid.obj[key]) {
- // set.add(name);
- // }
- // }
- // }
- // that.nameObj.energytypeid.showDataArr = [...set];
- // // console.log(that.nameObj.energytypeid.showDataArr)
- // }
- },
- // 获取能介
- getEnergyIdData () {
- let that = this;
- let url = 'pass/ems/v1/trmenergys/selectNameAndId/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name,
- energytypeid: item.energytypeid,
- unitid: item.unitid
- })
- obj[item.id] = {
- name: item.name,
- unitid: item.unitid
- }
- }
- that.nameObj.energyid.arr = arr;
- that.nameObj.energyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取属性
- getPropertyIdData () {
- let that = this
- let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.propertyid.arr = arr;
- that.nameObj.propertyid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取位置
- getLocateIdData () {
- let that = this
- let url = 'pass/ems/v1/trmlocations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.locateid.arr = arr;
- that.nameObj.locateid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取站所
- getNetworkIdData () {
- let that = this
- let url = 'pass/ems/v1/trmstations/getidandname/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.networkid.arr = arr;
- that.nameObj.networkid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // // 获取数据来源
- // getSourceTypeData () {
- // let that = this
- // let url = 'pass/ems/v1/trml1sources/getidandname/';
- // that.axios.get(url)
- // .then(function (res) {
- // if (res.code === '0') {
- // let arr = [];
- // let obj = {};
- // for (let item of res.data) {
- // arr.push({
- // id: item.id,
- // name: item.name
- // })
- // obj[item.id] = item.name;
- // }
- // that.nameObj.sourceType.arr = arr;
- // that.nameObj.sourceType.obj = obj;
- // } else {
- // that.$message.error(res.message);
- // }
- // });
- // },
- // 获取标准计量单位
- getUnitIdData () {
- let that = this
- let url = 'pass/ems/v1/trmunits/getIdAndName';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- // if (item.name === '吨') {
- // that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
- // }
- }
- that.nameObj.unitid.arr = arr;
- that.nameObj.unitid.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取计量层级
- getHierarchyData () {
- let that = this
- let url = 'pass/ems/v1/trmcalpoints/getRmCalpoint/';
- that.axios.get(url)
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- let obj = {};
- for (let item of res.data) {
- arr.push({
- id: item.id,
- name: item.name
- })
- obj[item.id] = item.name;
- }
- that.nameObj.hierarchy.arr = arr;
- that.nameObj.hierarchy.obj = obj;
- } else {
- that.$message.error(res.message);
- }
- });
- },
- // 获取表格中的数据
- getTableData (pageNum) {
- let that = this,
- params = {
- energytypeid: that.filterForm.data.energytypeid.join(','),
- energyid: that.filterForm.data.energyid.join(','),
- propertyid: that.filterForm.data.propertyid.join(','),
- itemtype: that.filterForm.data.itemtype,
- locateid: that.filterForm.data.locateid.join(','),
- itemid: that.filterForm.data.itemid,
- itemname: that.filterForm.data.itemname,
- networkid: that.filterForm.data.networkid.join(','),
- costid: that.filterForm.data.costid.join(','),
- node: that.filterForm.data.hierarchy,
- tagAlias: that.filterForm.data.tagAlias,
- version: that.filterForm.data.version,
- tagTable: that.filterForm.data.tagTable,
- tagCol: that.filterForm.data.tagCol,
- useflag: that.filterForm.useflag
- };
- that.pageNum = pageNum || that.pageNum;
- that.tableLoading = true;
- let url = 'pass/ems/v1/trmcalpoints/like/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
- that.axios.get(url, {
- params: params
- })
- .then(function (res) {
- if (res.code === '0') {
- let arr = [];
- for (let item of res.data.list) {
- arr.push({
- itemid: item.itemid,
- itemname: item.itemname,
- tagAlias: item.tagAlias,
- itemdesc: item.itemdesc,
- itemtype: item.itemtype,
- locateid: item.locateid,
- networkid: item.networkid,
- energytypeid: item.energytypeid,
- energyid: item.energyid,
- propertyid: item.propertyid,
- unitid: item.unitid,
- isschedule: item.isschedule,
- // issettle: item.issettle,
- costid: item.costid,
- sourceType: item.sourceType,
- mintimegranid: item.mintimegranid,
- // 基础
- defaultvalue: item.defaultvalue,
- digits: item.digits,
- node: item.node,
- showno: item.showno,
- parentid: item.parentid,
- recTime: item.recTime,
- useflag: item.useflag,
- status: item.status,
- // 扩展
- tagid: item.tagid,
- tagname: item.tagname,
- rangeVal: item.rangeVal,
- tagBadSymbol: item.tagBadSymbol,
- tagModulus: item.tagModulus,
- tagIdMap: item.tagIdMap,
- calcMod: item.calcMod,
- dataType: item.dataType,
- meterType: item.meterType,
- meterScale: item.meterScale,
- meterLoc: item.meterLoc,
- // 特殊
- tagTable: item.tagTable,
- tagCol: item.tagCol,
- maxVal: item.maxVal,
- minVal: item.minVal,
- avgVal: item.avgVal,
- sumVal: item.sumVal,
- bcode: item.bcode,
- bdesc1: item.bdesc1,
- bdesc2: item.bdesc2,
- btype1: item.btype1,
- btype2: item.btype2
- })
- }
- that.tableData = arr;
- that.total = res.data.total;
- } else {
- that.$message.error(res.message);
- }
- that.tableLoading = false;
- }).catch(function () {
- that.tableLoading = false;
- });
- },
- // 改变表格显示条数
- tableSizeChange (val) {
- let that = this;
- that.pageSize = val;
- that.getTableData(1);
- },
- // 重置搜索
- tableDataCancel () {
- let that = this;
- for (let key in that.filterForm.data) {
- if (that.filterForm.data[key] instanceof Array) {
- that.filterForm.data[key] = [];
- } else {
- that.filterForm.data[key] = '';
- }
- }
- that.getTableData(1);
- },
- // 选择添加时的模板
- handleCurrentChange (row) {
- let that = this;
- that.dialog.editorBox.addRow = row;
- },
- // 自动生成名称
- autoSetName () {
- let that = this;
- if (that.dialog.editorBox.form.data.itemname === '') {
- if (that.dialog.editorBox.form.data.locateid && that.dialog.editorBox.form.data.energyid && that.dialog.editorBox.form.data.propertyid) {
- that.dialog.editorBox.form.data.itemname += that.nameObj.locateid.obj[that.dialog.editorBox.form.data.locateid];
- that.dialog.editorBox.form.data.itemname += that.nameObj.energyid.obj[that.dialog.editorBox.form.data.energyid].name;
- that.dialog.editorBox.form.data.itemname += that.nameObj.propertyid.obj[that.dialog.editorBox.form.data.propertyid];
- }
- }
- },
- but_add () {
- let that = this;
- if (that.dialog.editorBox.addRow) {
- for (let key in that.dialog.editorBox.form.data) {
- if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
- that.dialog.editorBox.form.data[key] = that.dialog.editorBox.addRow[key];
- } else {
- that.dialog.editorBox.form.data[key] = '';
- }
- }
- for (let key in that.dialog.editorBox.form1.data) {
- if (that.dialog.editorBox.addRow[key] || that.dialog.editorBox.addRow[key] === 0) {
- that.dialog.editorBox.form1.data[key] = that.dialog.editorBox.addRow[key];
- } else {
- that.dialog.editorBox.form1.data[key] = '';
- }
- }
- this.$refs['singleTable'].setCurrentRow();
- } else {
- for (let key in that.dialog.editorBox.form.data) {
- if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
- that.dialog.editorBox.form.data[key] = that.filterForm.data[key];
- } else {
- that.dialog.editorBox.form.data[key] = '';
- }
- }
- for (let key in that.dialog.editorBox.form1.data) {
- if (that.filterForm.data[key] || that.filterForm.data[key] === 0) {
- that.dialog.editorBox.form1.data[key] = that.filterForm.data[key];
- } else {
- that.dialog.editorBox.form1.data[key] = '';
- }
- }
- 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 : '';
- // that.dialog.editorBox.form.data.unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
- that.dialog.editorBox.form.data.isschedule = '0';
- that.dialog.editorBox.form1.data.useflag = '1';
- that.dialog.editorBox.form1.data.status = '0';
- }
- that.dialog.editorBox.form.data.itemid = '';
- // that.dialog.editorBox.form.data.itemname = '';
- that.dialog.editorBox.form1.data.recTime = '';
- that.dialog.editorBox.activeName = '1';
- that.dialog.editorBox.type = 'add';
- that.dialog.editorBox.show = true;
- setTimeout(() => {
- that.$refs['dialog_form'].clearValidate();
- }, 100);
- },
- but_edit (row) {
- let that = this;
- for (let key in that.dialog.editorBox.form.data) {
- if (typeof row[key] !== 'undefined') {
- that.dialog.editorBox.form.data[key] = row[key];
- }
- }
- for (let key in that.dialog.editorBox.form1.data) {
- if (typeof row[key] !== 'undefined') {
- that.dialog.editorBox.form1.data[key] = row[key];
- }
- }
- that.dialog.editorBox.activeName = '1';
- that.dialog.editorBox.type = 'edit';
- that.dialog.editorBox.show = true;
- },
- but_del (row) {
- let that = this;
- that.$confirm('是否删除该条数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- state: 'warning'
- }).then(() => {
- that.axios.delete('pass/ems/v1/trmcalpoints/' + row.itemid)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '删除成功',
- type: 'success'
- });
- that.getTableData();
- } else {
- that.$message.error(res.message);
- }
- }).catch(function () {
- });
- }).catch(() => {
- });
- },
- dataSave () {
- let that = this;
- let SubmitData = {
- itemid: that.dialog.editorBox.form.data.itemid,
- itemname: that.dialog.editorBox.form.data.itemname,
- tagAlias: that.dialog.editorBox.form.data.tagAlias,
- itemdesc: that.dialog.editorBox.form.data.itemdesc,
- itemtype: that.dialog.editorBox.form.data.itemtype,
- locateid: that.dialog.editorBox.form.data.locateid,
- networkid: that.dialog.editorBox.form.data.networkid,
- energytypeid: that.dialog.editorBox.form.data.energytypeid,
- energyid: that.dialog.editorBox.form.data.energyid,
- propertyid: that.dialog.editorBox.form.data.propertyid,
- unitid: that.dialog.editorBox.form.data.unitid,
- isschedule: that.dialog.editorBox.form.data.isschedule,
- costid: that.dialog.editorBox.form.data.costid,
- sourceType: that.dialog.editorBox.form.data.sourceType,
- mintimegranid: that.dialog.editorBox.form.data.mintimegranid,
- // 基础
- defaultvalue: that.dialog.editorBox.form1.data.defaultvalue,
- digits: that.dialog.editorBox.form1.data.digits,
- node: that.dialog.editorBox.form1.data.node,
- showno: that.dialog.editorBox.form1.data.showno,
- parentid: that.dialog.editorBox.form1.data.parentid,
- recTime: that.dialog.editorBox.form1.data.recTime,
- useflag: that.dialog.editorBox.form1.data.useflag,
- status: that.dialog.editorBox.form1.data.status,
- // 扩展
- tagid: that.dialog.editorBox.form1.data.tagid,
- tagname: that.dialog.editorBox.form1.data.tagname,
- rangeVal: that.dialog.editorBox.form1.data.rangeVal,
- tagBadSymbol: that.dialog.editorBox.form1.data.tagBadSymbol,
- tagModulus: that.dialog.editorBox.form1.data.tagModulus,
- tagIdMap: that.dialog.editorBox.form1.data.tagIdMap,
- calcMod: that.dialog.editorBox.form1.data.calcMod,
- dataType: that.dialog.editorBox.form1.data.dataType,
- meterType: that.dialog.editorBox.form1.data.meterType,
- meterScale: that.dialog.editorBox.form1.data.meterScale,
- meterLoc: that.dialog.editorBox.form1.data.meterLoc,
- // 特殊
- tagTable: that.dialog.editorBox.form1.data.tagTable,
- tagCol: that.dialog.editorBox.form1.data.tagCol,
- maxVal: that.dialog.editorBox.form1.data.maxVal,
- minVal: that.dialog.editorBox.form1.data.minVal,
- avgVal: that.dialog.editorBox.form1.data.avgVal,
- sumVal: that.dialog.editorBox.form1.data.sumVal,
- bcode: that.dialog.editorBox.form1.data.bcode,
- bdesc1: that.dialog.editorBox.form1.data.bdesc1,
- bdesc2: that.dialog.editorBox.form1.data.bdesc2,
- btype1: that.dialog.editorBox.form1.data.btype1,
- btype2: that.dialog.editorBox.form1.data.btype2
- };
- that.$refs['dialog_form'].validate((valid) => {
- if (valid) {
- that.$refs['dialog_form1'].validate((valid1) => {
- if (valid1) {
- if (that.dialog.editorBox.type === 'add') {
- let foorData = new FormData();
- for (let key in SubmitData) {
- foorData.append(key, SubmitData[key]);
- }
- that.loading = true;
- that.axios.post('pass/ems/v1/trmcalpoints/', foorData, {
- headers: {
- 'Content-Type': 'multipart/form-data'
- }
- })
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: '新增成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- } else {
- that.loading = true;
- that.axios.put('pass/ems/v1/trmcalpoints/' + SubmitData.itemid, SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- let msg = res.message
- if (!msg || msg === '操作成功') {
- that.$message({
- message: '修改成功',
- type: 'success'
- });
- } else {
- that.$message.warning('修改成功,注意:' + msg);
- }
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- that.loading = false;
- }).catch(function () {
- that.loading = false;
- });
- }
- } else {
- that.dialog.editorBox.activeName = '2';
- }
- });
- } else {
- that.dialog.editorBox.activeName = '1';
- }
- });
- },
- but_equationEditing (row) {
- let that = this;
- that.dialog.equationEditing.form.data.clock = that.filterForm.data.version;
- that.dialog.equationEditing.form.data.code = row.itemid;
- that.dialog.equationEditing.show = true;
- },
- rowClassName ({row, rowIndex}) {
- return row.useflag !== '1' ? 'rowDisable' : ''
- },
- upUseflag (row, useflag = 0) {
- let that = this;
- let SubmitData = {
- itemname: row.itemname,
- tagAlias: row.tagAlias,
- itemdesc: row.itemdesc,
- itemtype: row.itemtype,
- locateid: row.locateid,
- networkid: row.networkid,
- energytypeid: row.energytypeid,
- energyid: row.energyid,
- propertyid: row.propertyid,
- unitid: row.unitid,
- isschedule: row.isschedule,
- sourceType: row.sourceType,
- useflag: useflag,
- mintimegranid: row.mintimegranid
- };
- that.$confirm('是否' + (useflag === '1' ? '启用' : '禁用') + '?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- that.axios.put('pass/ems/v1/trmcalpoints/' + row.itemid, SubmitData)
- .then(function (res) {
- if (res.code === '0') {
- that.$message({
- message: useflag === '1' ? '启用成功' : '禁用成功',
- type: 'success'
- });
- that.getTableData();
- that.dialog.editorBox.show = false;
- } else {
- that.$message.error(res.message);
- }
- }).catch(function () {
- });
- }).catch(() => {
- })
- }
- }
- }
- </script>
- <style lang="less">
- .measurementPlace {
- min-width: 700px;
- height: 100%;
- .box {
- height: 100%;
- padding: 15px 15px 0 15px;
- .box-top {
- .el-form-item {
- margin-bottom: 7px;
- }
- .box-top-gjl {
- overflow: hidden;
- // margin-top: -7px;
- padding: 7px 0;
- border-top: 1px solid #ccc;
- // border-bottom: 1px solid #ccc;
- // margin-bottom: 6px;
- }
- }
- .rowDisable td {
- background-color: #dfdfdf !important;
- }
- }
- .attribute-box {
- .item {
- border: #ccc 1px solid;
- padding: 5px;
- margin-bottom: 6px;
- .bt {
- font-size: 14px;
- font-weight: 600;
- color: #000;
- padding-left: 10px;
- border-left: #008fe0 5px solid;
- }
- }
- }
- .color_no {
- color: #7a7a7a;
- }
- .color_yes {
- color: #1a9f17;
- }
- .el-button--mini {
- padding: 7px 12px;
- }
- }
- </style>
|