| | |
| | | |
| | | // 查询chart列表 |
| | | export const getPointDaChart = (data: DaPointChartReqVO) => { |
| | | return request.post({ url: '/data/api/data/point/history', data }) |
| | | return request.post({ url: '/data/api/query-points/chart', data }) |
| | | } |
| | | |
| | | //导出DaPointValue |
| | |
| | | COM_IS_INT = 'com_is_int', |
| | | DATA_POINT_TYPE = 'data_point_type', |
| | | MINFREQID = 'minfreqid', |
| | | VALUETYPE = 'value_type', |
| | | MEASURE_VALUE_TYPE = 'measure_value_type', |
| | | NVR_ONLINE_STATUS = 'nvr_online_status', |
| | | CAMERA_BRAND = 'camera_brand', |
| | | } |
| | |
| | | endTime: undefined, |
| | | }); |
| | | const queryParams = reactive({ |
| | | pointNo: "", |
| | | start: undefined, |
| | | end: undefined, |
| | | codes: [], |
| | | startDate: undefined, |
| | | endDate: undefined, |
| | | }) |
| | | function getYMDHMS() { |
| | | let timestamp = new Date().getTime(); |
| | |
| | | visible.value = true; |
| | | if (dataForm.value.id) { |
| | | try { |
| | | queryParams.pointNo=dataForm.value.pointNo; |
| | | queryParams.start = dataForm.value.startTime; |
| | | queryParams.end = dataForm.value.endTime; |
| | | queryParams.codes=[dataForm.value.pointNo]; |
| | | queryParams.startDate = dataForm.value.startTime; |
| | | queryParams.endDate = dataForm.value.endTime; |
| | | const data = await DaPoint.getPointDaChart(queryParams) |
| | | const dataList = []; |
| | | const xAxisData = []; |
| | | data[dataForm.value.pointNo].forEach(function (value) { |
| | | // 判断数据是否为布尔型 |
| | | if (typeof value["value"] === "boolean") { |
| | | value["value"] = value["value"]? 1 : 0; |
| | | } |
| | | dataList.push([value["time"], value["value"]]); |
| | | xAxisData.push(value["time"]); |
| | | }); |
| | | let seriesData = []; |
| | | seriesData.push({ |
| | | name: "采集值", |
| | | type: "line", |
| | | data: dataList, |
| | | showSymbol: false, |
| | | smooth: false, |
| | | lineStyle: { |
| | | normal: { |
| | | color: "#5B8FF9", |
| | | width: 1, |
| | | let seriesData = [] |
| | | data.series.forEach(item => { |
| | | seriesData.push({ |
| | | name: item.name, |
| | | type: "line", |
| | | data: item.data, |
| | | showSymbol: true, |
| | | smooth: false, |
| | | lineStyle: { |
| | | normal: { |
| | | color: "#5B8FF9", |
| | | width: 1, |
| | | }, |
| | | }, |
| | | }, |
| | | }); |
| | | }); |
| | | }) |
| | | |
| | | myChart = echarts.init(chartDom.value); |
| | | const option = { |
| | | title: { |
| | |
| | | xAxis: { |
| | | type: "category", |
| | | boundaryGap: false, |
| | | data: xAxisData, |
| | | data: data.categories, |
| | | }, |
| | | yAxis: { |
| | | type: "value", |
| | |
| | | ], |
| | | series: seriesData, |
| | | }; |
| | | myChart.clear(); |
| | | myChart.setOption(option); |
| | | } catch (error) { |
| | | console.error(error) |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="50%"> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="60%"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | |
| | | </el-row> |
| | | <el-row v-if="formData.pointType === 'MEASURE'"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="值类型" prop="valueType"> |
| | | <el-form-item label="测量值类型" prop="measurePoint.valueType"> |
| | | <el-select |
| | | v-model="formData.measurePoint.valueType" |
| | | clearable |
| | | placeholder="请选择值类型" |
| | | > |
| | | <el-option |
| | | v-for="dict in getDictOptions(DICT_TYPE.VALUETYPE)" |
| | | v-for="dict in getDictOptions(DICT_TYPE.MEASURE_VALUE_TYPE)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="平滑尺度" prop="dimension"> |
| | | <el-input-number v-model="formData.measurePoint.dimension" style="width: 100%" :controls="false"/> |
| | | <el-form-item label="平滑尺度(min)" prop="measurePoint.dimension"> |
| | | <el-input-number v-model="formData.measurePoint.dimension" style="width: 100%" |
| | | :min="0" :max="100" |
| | | :controls="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | :data="expressionList" |
| | | border |
| | | style="width: 100%"> |
| | | <!-- <el-table-column |
| | | <el-table-column |
| | | type="index" |
| | | align="center" |
| | | width="50" |
| | | label="序号"/>--> |
| | | width="60" |
| | | label="序号"/> |
| | | <el-table-column |
| | | prop="" |
| | | label="左括号" |
| | |
| | | <el-table-column |
| | | prop="" |
| | | label="测点" |
| | | min-width="160" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-select |
| | |
| | | <el-table-column |
| | | prop="" |
| | | label="运算值" |
| | | min-width="120" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-input |
| | |
| | | <el-table-column |
| | | prop="" |
| | | label="运算符" |
| | | width="120" |
| | | width="100" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.operator" clearable> |
| | |
| | | <el-table-column |
| | | prop="" |
| | | label="操作" |
| | | width="140" |
| | | width="120" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | @click="addExpressionRow(scope.$index, expressionList)" |
| | | type="text" |
| | | size="small"> |
| | | size="mini"> |
| | | 添加 |
| | | </el-button> |
| | | <el-button |
| | | @click="deleteExpressionRow(scope.$index, expressionList)" |
| | | type="text" |
| | | size="small"> |
| | | size="mini"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | |
| | | pointName: [{required: true, message: '测点名称不能为空', trigger: 'blur'}], |
| | | pointType: [{required: true, message: '测点类型不能为空', trigger: 'blur'}], |
| | | dataType: [{required: true, message: '数据类型不能为空', trigger: 'blur'}], |
| | | minfreqid: [{required: true, message: '采集频率不能为空', trigger: 'blur'}], |
| | | "measurePoint.valueType": [{required: true, message: '采集频率不能为空', trigger: 'blur'}], |
| | | "measurePoint.dimension": [{required: true, message: '采集频率不能为空', trigger: 'blur'}], |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | |
| | | storeType: undefined, |
| | | unit: undefined, |
| | | unittransfactor: 1, |
| | | defaultValue: 10, |
| | | maxValue: 10000000, |
| | | defaultValue: 0, |
| | | maxValue: 100000000, |
| | | minValue: 0, |
| | | minfreqid: undefined, |
| | | remark: undefined, |
| | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table border stripe v-loading="loading" :data="list"> |
| | | <el-table-column fixed label="测点编码" header-align="center" align="left" min-width="100" prop="pointNo" /> |
| | | <el-table-column fixed label="测点编码" header-align="center" align="left" min-width="120" prop="pointNo" /> |
| | | <el-table-column label="测点名称" header-align="center" align="left" min-width="200" prop="pointName" /> |
| | | <el-table-column label="测点类型" align="center" prop="pointType" width="100"> |
| | | <template #default="scope"> |
| | |
| | | <dict-tag :type="DICT_TYPE.VALUETYPE" :value="scope.row.valueType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="测量单位" align="center" prop="unit" width="100"/> |
| | | <el-table-column label="测量单位" align="center" prop="unit" width="80"/> |
| | | <el-table-column label="单位转换" align="center" prop="unittransfactor" /> |
| | | <el-table-column label="默认值" align="center" prop="defaultValue" /> |
| | | <el-table-column label="默认值" align="center" prop="defaultValue" width="100"/> |
| | | <el-table-column label="采集频率" align="center" prop="minfreqid" width="100"/> |
| | | <el-table-column label="数据源类型" align="center" prop="sourceType" width="100"/> |
| | | <el-table-column label="数据源名称" align="center" prop="sourceName" width="100"/> |
| | | <el-table-column label="数据源类型" align="center" prop="sourceType" min-width="100"/> |
| | | <el-table-column label="数据源名称" align="center" prop="sourceName" min-width="100"/> |
| | | <el-table-column label="测点Tag" header-align="center" align="left" prop="tagNo" min-width="150"/> |
| | | <el-table-column label="是否启用" align="center" prop="isEnable" width="100"> |
| | | <template #default="scope"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" align="center" min-width="130" fixed="right" width="120"> |
| | | <el-table-column label="操作" align="center" min-width="130" fixed="right" width="160"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | | size="mini" |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | v-hasPermi="['data:point:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="primary" @click="chartHandle(scope.row)">数据查看</el-button> |
| | | <el-button link size="mini" type="primary" @click="chartHandle(scope.row)">数据</el-button> |
| | | <el-button |
| | | link |
| | | size="mini" |
| | | type="danger" |
| | | @click="handleDelete(scope.row.id)" |
| | | v-hasPermi="['data:point:delete']" |