综合查询相关接口不再使用中文categoryName统一使用deviceCategory

This commit is contained in:
白菜
2025-10-16 16:10:29 +08:00
parent fb0eda4565
commit f4e6821484
14 changed files with 130 additions and 141 deletions

View File

@ -54,7 +54,13 @@ export function deleteService(id) {
method: 'delete', method: 'delete',
}) })
} }
// 获取上级设备id列表
export function getParentDeviceId({siteId,deviceCategory}) {
return request({
url: `/ems/siteConfig/getParentDeviceId?siteId=${siteId}&deviceCategory=${deviceCategory}`,
method: 'get',
})
}
//获取所有设备 //获取所有设备
export function getDeviceList(siteId) { export function getDeviceList(siteId) {
return request({ return request({
@ -64,9 +70,9 @@ export function getDeviceList(siteId) {
} }
//获取设备点位table //获取设备点位table
export function getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName='',sortMethod,sortData,dataPoint,lower,upper}) { export function getDevicePointList({siteId,deviceId,deviceCategory,parentDeviceId,pageNum,pageSize,dataPointName='',sortMethod,sortData,dataPoint,lower,upper}) {
return request({ return request({
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}&dataPoint=${dataPoint}&lower=${lower}&upper=${upper}&pageNum=${pageNum}&sortMethod=${sortMethod}&sortData=${sortData}`, url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}&parentDeviceId=${parentDeviceId}&dataPoint=${dataPoint}&lower=${lower}&upper=${upper}&pageNum=${pageNum}&sortMethod=${sortMethod}&sortData=${sortData}`,
method: 'get', method: 'get',
}) })
} }

View File

@ -42,43 +42,43 @@ export const dzjk=[
path: 'ssyx', path: 'ssyx',
component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'),
name: 'DzjkSbjkSsyx', name: 'DzjkSbjkSsyx',
meta: { title: '实时运行',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'SSYX'}, meta: { title: '实时运行',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'SSYX'},
}, },
{ {
path: 'pcs', path: 'pcs',
component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'),
name: 'DzjkSbjkPcs', name: 'DzjkSbjkPcs',
meta: { title: 'PCS',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'PCS'}, meta: { title: 'PCS',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'PCS'},
}, },
{ {
path: 'bmszl', path: 'bmszl',
component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'),
name: 'DzjkSbjkBmszl', name: 'DzjkSbjkBmszl',
meta: { title: 'BMS总览',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk', categoryName:'STACK'}, meta: { title: 'BMS总览',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk', deviceCategory:'STACK'},
}, },
{ {
path: 'bmsdcc', path: 'bmsdcc',
component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'),
name: 'DzjkSbjkBmsdcc', name: 'DzjkSbjkBmsdcc',
meta: { title: 'BMS电池簇',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'CLUSTER'}, meta: { title: 'BMS电池簇',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'CLUSTER'},
}, },
{ {
path: 'dtdc', path: 'dtdc',
component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'),
name: 'DzjkSbjkDtdc', name: 'DzjkSbjkDtdc',
meta: { title: '单体电池',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'BATTERY'}, meta: { title: '单体电池',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'BATTERY'},
}, },
{ {
path: 'db', path: 'db',
component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'),
name: 'DzjkSbjkDb', name: 'DzjkSbjkDb',
meta: { title: '电表',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'AMMETER'}, meta: { title: '电表',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'AMMETER'},
}, },
{ {
path: 'yl', path: 'yl',
component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'), component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'),
name: 'DzjkSbjkYl', name: 'DzjkSbjkYl',
meta: { title: '液冷',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',categoryName:'COOLING'}, meta: { title: '液冷',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'COOLING'},
} }
] ]
}, },

View File

@ -10,7 +10,7 @@
append-to-body append-to-body
width="1000px" width="1000px"
class="ems-dialog" class="ems-dialog"
:before-close="handleColsed" :before-close="handleClosed"
> >
<el-card <el-card
shadow="always" shadow="always"
@ -50,14 +50,14 @@ export default {
}, },
computed: { computed: {
isDtdc() { isDtdc() {
return this.categoryName === "单体电池"; return this.deviceCategory === "BATTERY";
}, },
}, },
watch: { watch: {
show(val) { show(val) {
if (!val) { if (!val) {
this.pointName = ""; this.pointName = "";
this.categoryName = ""; this.deviceCategory = "";
this.deviceId = ""; this.deviceId = "";
this.dataUnit = 1; this.dataUnit = 1;
this.child = ""; this.child = "";
@ -88,15 +88,15 @@ export default {
dataRange: [], dataRange: [],
child: "", //单体电池需要数据 child: "", //单体电池需要数据
pointName: "", pointName: "",
categoryName: "", deviceCategory: "",
deviceId: "", deviceId: "",
}; };
}, },
methods: { methods: {
showChart({ pointName, categoryName, deviceId, child = "" }) { showChart({ pointName, deviceCategory, deviceId, child = "" }) {
//初始化数据 //初始化数据
this.pointName = pointName; this.pointName = pointName;
this.categoryName = categoryName; this.deviceCategory = deviceCategory;
this.deviceId = deviceId; this.deviceId = deviceId;
child && (this.child = child); child && (this.child = child);
this.show = true; this.show = true;
@ -123,7 +123,7 @@ export default {
dataRange: [start = "", end = ""], dataRange: [start = "", end = ""],
child, child,
deviceId, deviceId,
categoryName, deviceCategory,
pointName, pointName,
} = this; } = this;
let siteDeviceMap = {}; let siteDeviceMap = {};
@ -146,7 +146,7 @@ export default {
siteIds: [siteId], siteIds: [siteId],
deviceId, deviceId,
dataUnit, dataUnit,
categoryName, deviceCategory,
pointName, pointName,
startDate, startDate,
endDate, endDate,
@ -170,9 +170,9 @@ export default {
dataset.push({ dataset.push({
name: `${ name: `${
this.isDtdc this.isDtdc
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}` ? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}${inner.deviceId}`
: "" : `${inner.deviceId}`
}${this.isDtdc ? inner.deviceId : this.pointName}`, }`,
type: "line", type: "line",
xdata: [], xdata: [],
data: [], data: [],
@ -228,7 +228,7 @@ export default {
this.dataRange = val || []; this.dataRange = val || [];
this.getDate(); this.getDate();
}, },
handleColsed(done) { handleClosed(done) {
if (!this.chart) { if (!this.chart) {
return done(); return done();
} }

View File

@ -20,7 +20,7 @@
<div class="descriptions-main descriptions-main-bg-color"> <div class="descriptions-main descriptions-main-bg-color">
<el-descriptions direction="vertical" :column="3" :colon="false"> <el-descriptions direction="vertical" :column="3" :colon="false">
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label"> <el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label">
<span class="pointer" @click="showChart(item.pointName || '','电池簇',baseInfo.deviceId)"> <span class="pointer" @click="showChart(item.pointName || '',baseInfo.deviceId)">
{{baseInfo[item.attr] | formatNumber}} <span v-if="item.unit" v-html="item.unit"></span> {{baseInfo[item.attr] | formatNumber}} <span v-if="item.unit" v-html="item.unit"></span>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
@ -30,7 +30,7 @@
<div class="process-line-bg"> <div class="process-line-bg">
<div class="process-line" :style="{height:baseInfo.currentSoc+'%'}"></div> <div class="process-line" :style="{height:baseInfo.currentSoc+'%'}"></div>
</div> </div>
<div class="process pointer" @click="showChart( '当前SOC','电池簇',baseInfo.deviceId)">当前SOC : {{baseInfo.currentSoc}}%</div> <div class="process pointer" @click="showChart( '当前SOC',baseInfo.deviceId)">当前SOC : {{baseInfo.currentSoc}}%</div>
</div> </div>
</div> </div>
<el-table <el-table
@ -50,14 +50,14 @@
label="单体平均值" label="单体平均值"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],'电池簇',baseInfo.deviceId)">{{scope.row.avgData}}</span> <span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.avgData}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="minData" prop="minData"
label="单体最小值"> label="单体最小值">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],'电池簇',baseInfo.deviceId)">{{scope.row.minData}}</span> <span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.minData}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -68,7 +68,7 @@
prop="maxData" prop="maxData"
label="单体最大值"> label="单体最大值">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer " @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],'电池簇',baseInfo.deviceId)">{{scope.row.maxData}}</span> <span class="pointer " @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.maxData}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -127,9 +127,8 @@ export default {
} }
}, },
methods:{ methods:{
showChart(pointName,categoryName,deviceId){ showChart(pointName,deviceId){
console.log('点击查询图表',pointName,categoryName,deviceId) pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'CLUSTER',deviceId})
pointName && this.$refs.pointChart.showChart({pointName,categoryName,deviceId})
}, },
updateData(){ updateData(){
this.loading = true this.loading = true

View File

@ -47,26 +47,26 @@
label="簇电压" label="簇电压"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('簇电压','电池簇',scope.row.clusterId)">{{scope.row.clusterVoltage}} V</span> <span class="pointer" @click="showChart('簇电压',scope.row.clusterId)">{{scope.row.clusterVoltage}} V</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="簇电流"> label="簇电流">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('簇电流','电池簇',scope.row.clusterId)">{{scope.row.clusterCurrent}} A</span> <span class="pointer" @click="showChart('簇电流',scope.row.clusterId)">{{scope.row.clusterCurrent}} A</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="簇SOC"> label="簇SOC">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('当前SOC','电池簇',scope.row.clusterId)">{{scope.row.currentSoc}} %</span> <span class="pointer" @click="showChart('当前SOC',scope.row.clusterId)">{{scope.row.currentSoc}} %</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="单体最高电压" label="单体最高电压"
prop="maxVoltage"> prop="maxVoltage">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('最高单体电压','电池簇',scope.row.clusterId)">{{scope.row.maxCellVoltage}} V</span> <span class="pointer" @click="showChart('最高单体电压',scope.row.clusterId)">{{scope.row.maxCellVoltage}} V</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -77,7 +77,7 @@
label="单体最低电压" label="单体最低电压"
prop="minVoltage"> prop="minVoltage">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('最低单体电压','电池簇',scope.row.clusterId)">{{scope.row.minCellVoltage}} V</span> <span class="pointer" @click="showChart('最低单体电压',scope.row.clusterId)">{{scope.row.minCellVoltage}} V</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -87,7 +87,7 @@
<el-table-column <el-table-column
label="单体最高温度"> label="单体最高温度">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('最高单体温度','电池簇',scope.row.clusterId)">{{scope.row.maxCellTemp}} &#8451;</span> <span class="pointer" @click="showChart('最高单体温度',scope.row.clusterId)">{{scope.row.maxCellTemp}} &#8451;</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -98,7 +98,7 @@
label="单体最低温度" label="单体最低温度"
prop="minTemperature"> prop="minTemperature">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="pointer" @click="showChart('最低单体温度','电池簇',scope.row.clusterId)">{{scope.row.minCellTemp}} &#8451;</span> <span class="pointer" @click="showChart('最低单体温度',scope.row.clusterId)">{{scope.row.minCellTemp}} &#8451;</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -141,9 +141,8 @@ export default {
} }
}, },
methods:{ methods:{
showChart(pointName,categoryName,deviceId){ showChart(pointName,deviceId){
console.log('点击查询图表',pointName,categoryName,deviceId) pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'STACK',deviceId})
pointName && this.$refs.pointChart.showChart({pointName,categoryName,deviceId})
}, },
updateData(){ updateData(){
this.loading = true this.loading = true

View File

@ -25,7 +25,7 @@
</div> </div>
<el-row> <el-row>
<el-col v-for="(tempDataItem,tempDataIndex) in deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'" :span="8"> <el-col v-for="(tempDataItem,tempDataIndex) in deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'" :span="8">
<span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceName,item.deviceId)"> <span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceId)">
{{tempDataItem.name}}{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span> {{tempDataItem.name}}{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span>
</span> </span>
</el-col> </el-col>
@ -140,9 +140,8 @@ export default {
}; };
}, },
methods: { methods: {
showChart(pointName,categoryName,deviceId){ showChart(pointName,deviceId){
console.log('点击查询图表',pointName,categoryName,deviceId) pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'AMMETER',deviceId})
pointName && this.$refs.pointChart.showChart({pointName,categoryName,deviceId})
}, },
updateData(){ updateData(){
this.loading = true; this.loading = true;

View File

@ -174,7 +174,7 @@ export default {
dataType && dataType &&
this.$refs.pointChart.showChart({ this.$refs.pointChart.showChart({
pointName: dataType, pointName: dataType,
categoryName: "单体电池", deviceCategory:'BATTERY',
deviceId: clusterDeviceId, deviceId: clusterDeviceId,
child: [deviceId], child: [deviceId],
}); });

View File

@ -38,10 +38,10 @@ export default {
return this.zdDeviceCategoryOptions[this.siteId] || [] return this.zdDeviceCategoryOptions[this.siteId] || []
}, },
categoryRouter(){ categoryRouter(){
const routeData =this.childrenRoute.filter(item=>this.locationSiteCategory.includes(item.meta.categoryName)) const routeData =this.childrenRoute.filter(item=>this.locationSiteCategory.includes(item.meta.deviceCategory))
if(this.siteId && routeData.length > 0 && this.locationSiteCategory && this.locationSiteCategory.length >1){ if(this.siteId && routeData.length > 0 && this.locationSiteCategory && this.locationSiteCategory.length >1){
const locationPageCategoryName = this.$route.meta?.categoryName || '' const locationPageDeviceCategory = this.$route.meta?.deviceCategory || ''
if(!routeData.some(item=> item.meta.categoryName===locationPageCategoryName)){ if(!routeData.some(item=> item.meta.deviceCategory===locationPageDeviceCategory)){
this.$router.replace({path:'/dzjk/sbjk/ssyx',query:this.$route.query}) this.$router.replace({path:'/dzjk/sbjk/ssyx',query:this.$route.query})
} }
} }

View File

@ -100,7 +100,7 @@
<span <span
class="pointer" class="pointer"
@click=" @click="
showChart(item.pointName || '', 'PCS', pcsItem.deviceId) showChart(item.pointName || '', pcsItem.deviceId)
" "
> >
{{ pcsItem[item.attr] | formatNumber }} {{ pcsItem[item.attr] | formatNumber }}
@ -136,7 +136,7 @@
> >
<span <span
class="pointer" class="pointer"
@click="showChart('直流功率', 'PCS分支设备', item.deviceId)" @click="showChart('直流功率', item.deviceId,true)"
>{{ item.dcPower }}kW</span >{{ item.dcPower }}kW</span
> >
</el-descriptions-item> </el-descriptions-item>
@ -148,7 +148,7 @@
> >
<span <span
class="pointer" class="pointer"
@click="showChart('直流电压', 'PCS分支设备', item.deviceId)" @click="showChart('直流电压', item.deviceId,true)"
>{{ item.dcVoltage }}V</span >{{ item.dcVoltage }}V</span
> >
</el-descriptions-item> </el-descriptions-item>
@ -160,7 +160,7 @@
> >
<span <span
class="pointer" class="pointer"
@click="showChart('直流电流', 'PCS分支设备', item.deviceId)" @click="showChart('直流电流', item.deviceId,true)"
>{{ item.dcCurrent }}A</span >{{ item.dcCurrent }}A</span
> >
</el-descriptions-item> </el-descriptions-item>
@ -169,7 +169,6 @@
</el-card> </el-card>
</div> </div>
<el-empty v-show="pcsList.length <= 0" :image-size="200"></el-empty> <el-empty v-show="pcsList.length <= 0" :image-size="200"></el-empty>
<!-- 电位图表 showChart({pointName:点位名称,categoryName:设备名称})-->
<point-chart ref="pointChart" :site-id="siteId" /> <point-chart ref="pointChart" :site-id="siteId" />
</div> </div>
</template> </template>
@ -270,10 +269,9 @@ export default {
}; };
}, },
methods: { methods: {
showChart(pointName, categoryName, deviceId) { showChart(pointName, deviceId,isBranch=false) {
console.log("点击查询图表", pointName, categoryName, deviceId);
pointName && pointName &&
this.$refs.pointChart.showChart({ pointName, categoryName, deviceId }); this.$refs.pointChart.showChart({ pointName,deviceCategory:isBranch ? 'BRANCH' : 'PCS', deviceId });
}, },
//6个方块数据 //6个方块数据
getRunningHeadData() { getRunningHeadData() {

View File

@ -11,7 +11,7 @@
</div> </div>
<el-row> <el-row>
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8"> <el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8">
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceName,item.deviceId)"> <span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
{{tempDataItem.title}}{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span> {{tempDataItem.title}}{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span>
</span> </span>
</el-col> </el-col>
@ -48,9 +48,8 @@ export default {
} }
}, },
methods:{ methods:{
showChart(pointName,deviceName,deviceId){ showChart(pointName,deviceId){
console.log('点击查询图表',pointName,deviceName,deviceId) pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'COOLING',deviceId})
pointName && this.$refs.pointChart.showChart({pointName,deviceName,deviceId})
}, },
updateData(){ updateData(){
this.loading = true this.loading = true

View File

@ -22,16 +22,16 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="设备" label="设备"
prop="categoryName" prop="deviceCategory"
:rules="[{ required: true, message: '请选择设备' }]" :rules="[{ required: true, message: '请选择设备' }]"
> >
<el-radio-group v-model="form.categoryName" @input="changeSiteIds"> <el-radio-group v-model="form.deviceCategory" @input="changeSiteIds">
<el-radio <el-radio
v-for="(key, index) in deviceCategoryList" v-for="(item, index) in deviceCategoryList"
:key="index + 'sbListSearch'" :key="index + 'sbListSearch'"
:label="key" :label="item.code"
> >
{{ key }} {{ item.name }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -65,13 +65,6 @@
@select="handleSelect" @select="handleSelect"
></el-autocomplete> ></el-autocomplete>
</el-form-item> </el-form-item>
<!-- <el-form-item label="横坐标" prop="dataUnit" :rules="[{ required: true, message: '请选择横坐标' }]">-->
<!-- <el-radio-group v-model="form.dataUnit">-->
<!-- <el-radio :label="1">分钟</el-radio>-->
<!-- <el-radio :label="2">小时</el-radio>-->
<!-- <el-radio :label="3"></el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
</div> </div>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm">生成图表</el-button> <el-button type="primary" @click="submitForm">生成图表</el-button>
@ -118,7 +111,7 @@ export default {
components: { DateTimeSelect }, components: { DateTimeSelect },
computed: { computed: {
isDtdc() { isDtdc() {
return this.form.categoryName === "单体电池"; return this.form.deviceCategory === "BATTERY";
}, },
}, },
watch: { watch: {
@ -140,7 +133,6 @@ export default {
this.$refs.dateTimeSelect.init(); this.$refs.dateTimeSelect.init();
this.getDate(); this.getDate();
}); });
// this.submitForm()
}, },
}, },
}, },
@ -154,7 +146,7 @@ export default {
dataRange: [], //时间选择范围 dataRange: [], //时间选择范围
child: [], child: [],
siteIds: "", //当前选中的站点id 默认选中第一个站点 siteIds: "", //当前选中的站点id 默认选中第一个站点
categoryName: "", //设备 deviceCategory: "", //设备
pointName: "", //点位 pointName: "", //点位
dataUnit: 1, //横坐标 dataUnit: 1, //横坐标
}, },
@ -294,7 +286,7 @@ export default {
}, },
querySearchAsync(query, cb) { querySearchAsync(query, cb) {
console.log("查询数据", query); console.log("查询数据", query);
if (!this.form.siteIds || !this.form.categoryName) { if (!this.form.siteIds || !this.form.deviceCategory) {
this.$message({ this.$message({
type: "warning", type: "warning",
message: "请先选择站点和设备", message: "请先选择站点和设备",
@ -303,7 +295,7 @@ export default {
} }
pointFuzzyQuery({ pointFuzzyQuery({
siteIds: [this.form.siteIds], siteIds: [this.form.siteIds],
categoryName: this.form.categoryName, deviceCategory: this.form.deviceCategory,
pointName: query, pointName: query,
}).then((response) => { }).then((response) => {
const data = response?.data || []; const data = response?.data || [];
@ -342,7 +334,7 @@ export default {
const { const {
siteIds, siteIds,
dataUnit, dataUnit,
categoryName, deviceCategory,
pointName, pointName,
dataRange: [start = "", end = ""], dataRange: [start = "", end = ""],
child, child,
@ -374,7 +366,7 @@ export default {
getPointValueList({ getPointValueList({
siteIds: [siteIds], siteIds: [siteIds],
dataUnit, dataUnit,
categoryName, deviceCategory,
pointName, pointName,
startDate, startDate,
endDate, endDate,

View File

@ -1,13 +1,13 @@
<template> <template>
<el-dialog :visible.sync="dialogTableVisible" :close-on-click-modal="false" :show-close="false" destroy-on-close lock-scroll append-to-body width="600px" class="ems-dialog" :title="mode === 'add'?'新增设备':`编辑设备` " > <el-dialog :visible.sync="dialogTableVisible" :close-on-press-escape="false" :close-on-click-modal="false" :show-close="false" destroy-on-close lock-scroll append-to-body width="600px" class="ems-dialog" :title="mode === 'add'?'新增设备':`编辑设备` " >
<el-form v-loading="loading>0" ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px"> <el-form v-loading="loading>0" ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="140px">
<el-form-item label="站点" prop="siteId"> <el-form-item label="站点" prop="siteId">
<el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}"> <el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'siteOptions'"></el-option> <el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'siteOptions'"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备id" prop="deviceId" > <el-form-item label="设备id" prop="deviceId" >
<el-input v-model="formData.deviceId" maxlength="60" clearable :style="{width: '100%'}"> <el-input v-model="formData.deviceId" placeholder="请输入" maxlength="60" clearable :style="{width: '100%'}">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
@ -29,11 +29,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类别" prop="deviceCategory"> <el-form-item label="设备类别" prop="deviceCategory">
<el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}"> <el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
<el-option :label="item" :value="item" v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"></el-option> <el-option :label="item.name" :value="item.code" v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="上级设备" prop="parentId" v-if="formData.deviceCategory === dccDeviceCategory"> <el-form-item label="上级设备" prop="parentId" v-if="dccDeviceCategoryList.includes(formData.deviceCategory)">
<el-select v-model="formData.parentId" :placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'" :style="{width: '100%'}"> <el-select v-model="formData.parentId" :placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'" :style="{width: '100%'}">
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList" :key="index+'parentDeviceList'" ></el-option> <el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList" :key="index+'parentDeviceList'" ></el-option>
</el-select> </el-select>
@ -80,10 +80,10 @@
</template> </template>
<script> <script>
import {mapState} from "vuex"; import {mapState} from "vuex";
import {getStackNameList} from '@/api/ems/dzjk'
import {getAllSites} from '@/api/ems/zddt' import {getAllSites} from '@/api/ems/zddt'
import {validText} from '@/utils/validate' import {validText} from '@/utils/validate'
import {getDeviceDetailInfo,getDeviceCategory,updateDevice,addDevice} from "@/api/ems/site"; import {getDeviceDetailInfo,updateDevice,addDevice,getParentDeviceId} from "@/api/ems/site";
import {getAllDeviceCategory} from '@/api/ems/search'
export default { export default {
props:{ props:{
mode:{ mode:{
@ -112,7 +112,7 @@ export default {
} }
return { return {
loading:0, loading:0,
dccDeviceCategory:'CLUSTER', dccDeviceCategoryList:['CLUSTER','BATTERY'],//需要展示上级设备的设备类型
dialogTableVisible:false, dialogTableVisible:false,
parentDeviceList:[],//上级设备列表 从接口获取数据 parentDeviceList:[],//上级设备列表 从接口获取数据
siteList:[],//站点列表 从接口获取数据 siteList:[],//站点列表 从接口获取数据
@ -195,24 +195,6 @@ export default {
}) })
}, },
watch:{ watch:{
'formData.deviceCategory':{
handler(newVal){
// 只有电池簇需要选择上级设备 调用接口获取电池堆列表
if(newVal && newVal === this.dccDeviceCategory){
this.getParentDeviceList()
}
},
immediate:true
},
'formData.siteId':{
handler(newVal,oldVal){
// 只有电池簇需要选择上级设备 调用接口获取电池堆列表
if(newVal && oldVal!== newVal && this.formData.deviceCategory === this.dccDeviceCategory){
this.getParentDeviceList()
}
},
immediate:true
},
dialogTableVisible:{ dialogTableVisible:{
handler(newVal){ handler(newVal){
//打开弹窗 //打开弹窗
@ -229,6 +211,9 @@ export default {
this.loading+=1 this.loading+=1
getDeviceDetailInfo(newVal).then(response => { getDeviceDetailInfo(newVal).then(response => {
this.formData = JSON.parse(JSON.stringify(response?.data || {})); this.formData = JSON.parse(JSON.stringify(response?.data || {}));
if(this.dccDeviceCategoryList.includes(this.formData.deviceCategory)){
this.getParentDeviceList(true)
}
}).finally(() => {this.loading-=1}) }).finally(() => {this.loading-=1})
} }
}, },
@ -236,6 +221,11 @@ export default {
} }
}, },
methods: { methods: {
changeType(){
if(this.dccDeviceCategoryList.includes(this.formData.deviceCategory)){
this.getParentDeviceList()
}
},
uploadImage(data){ uploadImage(data){
this.formData.pictureUrl = data this.formData.pictureUrl = data
}, },
@ -249,18 +239,18 @@ export default {
// 获取设备类别 // 获取设备类别
getDeviceCategoryList(){ getDeviceCategoryList(){
this.loading+=1 this.loading+=1
getDeviceCategory().then(response => { getAllDeviceCategory().then(response => {
this.deviceCategoryList = response?.data || [] this.deviceCategoryList = response?.data || []
}).finally(() => {this.loading-=1}) }).finally(() => {this.loading-=1})
}, },
//获取上级id列表 //获取上级id列表
getParentDeviceList(){ getParentDeviceList(init=false){
if(!this.formData.siteId){ if(!this.formData.siteId){
return console.log('请先选择站点') return console.log('请先选择站点')
} }
this.formData.parentId='' !init && (this.formData.parentId='')
this.loading= this.loading+1 this.loading= this.loading+1
getStackNameList(this.formData.siteId).then(response => { getParentDeviceId({siteId:this.formData.siteId,deviceCategory:this.formData.deviceCategory}).then(response => {
this.parentDeviceList = JSON.parse(JSON.stringify(response?.data || [])); this.parentDeviceList = JSON.parse(JSON.stringify(response?.data || []));
}).finally(() => { }).finally(() => {
this.loading=this.loading -1 this.loading=this.loading -1
@ -318,26 +308,26 @@ export default {
closeDialog(){ closeDialog(){
this.$emit('clear') this.$emit('clear')
// 清空所有数据 // 清空所有数据
this.$refs.addTempForm.resetFields()
this.formData= { this.formData= {
id:'',//设备唯一标识 id:'',//设备唯一标识
siteId:'',//站点ID siteId:'',//站点ID
deviceId:'',//设备id deviceId:'',//设备id
deviceName:'',//设备名称 deviceName:'',//设备名称
description:'',//设备描述 description:'',//设备描述
communicationStatus:'',//工作状态 communicationStatus:'',//工作状态
deviceType:'',//设备类型 deviceType:'',//设备类型
deviceCategory:'',//设备类别 deviceCategory:'',//设备类别
parentId:'',//上级设备id parentId:'',//上级设备id
ipAddress:'',//TCP设备的ip地址 ipAddress:'',//TCP设备的ip地址
ipPort:"",//TCP端口号 ipPort:"",//TCP端口号
serialPort:'',//串口路径 serialPort:'',//串口路径
baudRate:'',//波特率 baudRate:'',//波特率
dataBits:'',//数据位 dataBits:'',//数据位
stopBits:'',//停止位 stopBits:'',//停止位
parity:'',//校验位 parity:'',//校验位
pictureUrl:'',//设备图片 pictureUrl:'',//设备图片
} }
this.$refs.addTempForm.resetFields()
this.dialogTableVisible=false this.dialogTableVisible=false
} }
} }

View File

@ -75,9 +75,7 @@
class="pointer" class="pointer"
@click=" @click="
showChart( showChart(
scope.row.pointName, scope.row
scope.row.deviceName,
scope.row.deviceId
) )
" "
>{{ scope.row.pointValue }}</span >{{ scope.row.pointValue }}</span
@ -118,7 +116,7 @@ export default {
if (!val) { if (!val) {
this.tableData = []; this.tableData = [];
this.deviceId = ""; this.deviceId = "";
this.deviceName = ""; this.parentId='';
this.siteId = ""; this.siteId = "";
this.pageSize = 10; this.pageSize = 10;
this.pageNum = 1; this.pageNum = 1;
@ -135,6 +133,11 @@ export default {
} }
}, },
}, },
computed:{
isDtdc(){
return this.deviceCategory === 'BATTERY'
}
},
data() { data() {
return { return {
// 默认排序 // 默认排序
@ -150,8 +153,8 @@ export default {
upper: "", // upper: "", //
}, },
deviceCategory: "", deviceCategory: "",
deviceName: "",
deviceId: "", deviceId: "",
parentId:'',
siteId: "", siteId: "",
tableData: [], tableData: [],
pageSize: 10, //分页栏当前每个数据总数 pageSize: 10, //分页栏当前每个数据总数
@ -160,10 +163,12 @@ export default {
}; };
}, },
methods: { methods: {
showChart(pointName, deviceName, deviceId) { showChart({pointName}) {
console.log("点击查询图表", pointName, deviceName, deviceId); if(pointName){
pointName && const {deviceCategory,deviceId}=this
this.$refs.pointChart.showChart({ pointName, deviceName, deviceId }); if(this.isDtdc) this.$refs.pointChart.showChart({ pointName, deviceCategory, deviceId:this.parentId,child:[deviceId] });
else this.$refs.pointChart.showChart({ pointName, deviceCategory, deviceId });
}
}, },
handleSortChange(column) { handleSortChange(column) {
this.form.sortData = column.prop this.form.sortData = column.prop
@ -175,11 +180,11 @@ export default {
this.pageNum = 1; this.pageNum = 1;
this.getData(); this.getData();
}, },
showTable({ deviceCategory, siteId, deviceId, deviceName }) { showTable({ deviceCategory, siteId, deviceId ,parentId=''}) {
this.deviceCategory = deviceCategory; this.deviceCategory = deviceCategory;
this.siteId = siteId; this.siteId = siteId;
this.deviceId = deviceId; this.deviceId = deviceId;
this.deviceName = deviceName; this.parentId=deviceCategory === 'BATTERY' ? parentId : ''//只有单体电池需要这个值
this.show = true; this.show = true;
this.getData(); this.getData();
}, },
@ -189,6 +194,7 @@ export default {
siteId, siteId,
deviceId, deviceId,
deviceCategory, deviceCategory,
parentId,
pageNum, pageNum,
pageSize, pageSize,
form: { form: {
@ -204,6 +210,7 @@ export default {
siteId, siteId,
deviceId, deviceId,
deviceCategory, deviceCategory,
parentDeviceId: parentId,
pageNum, pageNum,
pageSize, pageSize,
sortData, sortData,

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单` " :close-on-click-modal="false" :show-close="false"> <el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单`" :close-on-press-escape="false" :close-on-click-modal="false" :show-close="false">
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="120px"> <el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="120px">
<el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'"> <el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'">
<el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}"> <el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}">