Merge remote-tracking branch 'origin/master'
| | |
| | | pointName?: string |
| | | } |
| | | |
| | | |
| | | // 查询DaPoint列表 |
| | | export const getDaPointPage = (params: DaPointPageReqVO) => { |
| | | return request.get({ url: '/data/da/point/page', params }) |
| | |
| | | export const importPointTemplate = () => { |
| | | return request.download({ url: '/data/da/point/get-import-template' }) |
| | | } |
| | | |
| | | // 启用 |
| | | export const enable = (ids) => { |
| | | const data = ids |
| | | return request.put({ url: '/data/da/point/enable', data }) |
| | | } |
| | | |
| | | // 禁用 |
| | | export const disable = (ids) => { |
| | | const data = ids |
| | | return request.put({ url: '/data/da/point/disable', data }) |
| | | } |
| | |
| | | |
| | | // 导出Plan值 |
| | | export const exportPlanValue = (data: PlanChartReqVO) => { |
| | | return request.post({ url: '/data/api/export-plan/history-value', data }) |
| | | return request.downloadByPost({ url: '/data/api/export-plan/history-value', data }) |
| | | } |
| | |
| | | const res = await request({ method: 'GET', responseType: 'blob', ...option }) |
| | | return res as unknown as Promise<T> |
| | | }, |
| | | downloadByPost: async <T = any>(option: any) => { |
| | | const res = await request({ method: 'POST', responseType: 'blob', ...option }) |
| | | return res as unknown as Promise<T> |
| | | }, |
| | | upload: async <T = any>(option: any) => { |
| | | option.headersType = 'multipart/form-data' |
| | | const res = await request({ method: 'POST', ...option }) |
| | |
| | | cancelButtonText: t('common.cancel'), |
| | | type: 'warning' |
| | | }) |
| | | }, |
| | | // 启用窗体 |
| | | enableConfirm(ids, content?: string, tip?: string) { |
| | | return ElMessageBox.confirm( |
| | | content ? content : t('确定启用选中的'+ ids.length +'项数据?'), |
| | | tip ? tip : t('common.confirmTitle'), |
| | | { |
| | | confirmButtonText: t('common.ok'), |
| | | cancelButtonText: t('common.cancel'), |
| | | type: 'warning' |
| | | } |
| | | ) |
| | | }, |
| | | // 禁用窗体 |
| | | disableConfirm(ids, content?: string, tip?: string) { |
| | | return ElMessageBox.confirm( |
| | | content ? content : t('确定禁用选中的'+ ids.length +'项数据?'), |
| | | tip ? tip : t('common.confirmTitle'), |
| | | { |
| | | confirmButtonText: t('common.ok'), |
| | | cancelButtonText: t('common.cancel'), |
| | | type: 'warning' |
| | | } |
| | | ) |
| | | } |
| | | } |
| | | } |
| | |
| | | updateTime: '更新时间', |
| | | copy: '复制', |
| | | copySuccess: '复制成功', |
| | | copyError: '复制失败' |
| | | copyError: '复制失败', |
| | | enableSuccess: '启用成功', |
| | | disableSuccess: '禁用成功', |
| | | }, |
| | | lock: { |
| | | lockScreen: '锁定屏幕', |
| | |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div ref="chartDomPlan" class="result-chart"></div> |
| | | <div ref="chartDomPlan" class="result-chart" v-loading="loading"></div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | start: undefined, |
| | | end: undefined, |
| | | }) |
| | | const loading = ref(true) // 列表的加载中 |
| | | |
| | | function getYMDHMS() { |
| | | let timestamp = new Date().getTime(); |
| | |
| | | |
| | | async function getDataList() { |
| | | visible.value = true; |
| | | loading.value = true |
| | | if (dataForm.value.id) { |
| | | try { |
| | | queryParams.itemNos = [dataForm.value.itemNo]; |
| | | queryParams.start = dataForm.value.startTime; |
| | | queryParams.end = dataForm.value.endTime; |
| | | const data = await ItemApi.getPlanChart(queryParams) |
| | | loading.value = false |
| | | let seriesData = [] |
| | | data.series.forEach(item => { |
| | | seriesData.push({ |
| | |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div ref="chartDom" class="result-chart"></div> |
| | | <div ref="chartDom" class="result-chart" v-loading="loading"></div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | async function getDataList() { |
| | | visible.value = true; |
| | | if (dataForm.value.id) { |
| | | try { |
| | | chartParams.codes = [dataForm.value.pointNo]; |
| | | chartParams.startDate = dataForm.value.startTime; |
| | | chartParams.endDate = dataForm.value.endTime; |
| | | const data = await DaPoint.getPointDaChart(chartParams) |
| | | 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, |
| | | async function getDataList() { |
| | | visible.value = true; |
| | | loading.value = true |
| | | if (dataForm.value.id) { |
| | | try { |
| | | chartParams.codes=[dataForm.value.pointNo]; |
| | | chartParams.startDate = dataForm.value.startTime; |
| | | chartParams.endDate = dataForm.value.endTime; |
| | | const data = await DaPoint.getPointDaChart(chartParams) |
| | | loading.value = false |
| | | 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 = { |
| | |
| | | placeholder="请输入测点编码" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-240px" |
| | | class="!w-200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="测点名称" prop="pointName"> |
| | |
| | | placeholder="请输入测点名称" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-240px" |
| | | class="!w-200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="测点Tag" prop="tagNo"> |
| | |
| | | placeholder="请输入测点Tag" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-240px" |
| | | class="!w-200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | > |
| | | <Icon icon="ep:download" />导出 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | @click="enable" |
| | | v-hasPermi="['data:point:update']" |
| | | >启用 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | @click="disable" |
| | | v-hasPermi="['data:point:update']" |
| | | >禁用 |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table border stripe v-loading="loading" :data="list"> |
| | | <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 border stripe v-loading="loading" :data="list" @selection-change="selectionChangeHandle"> |
| | | <el-table-column type="selection" header-align="center" align="center" width="50"/> |
| | | <el-table-column fixed label="测点编码" header-align="center" align="left" min-width="130" prop="pointNo" /> |
| | | <el-table-column label="测点名称" header-align="center" align="left" min-width="220" prop="pointName" /> |
| | | <el-table-column label="测点类型" align="center" prop="pointType" width="100"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.DATA_POINT_TYPE" :value="scope.row.pointType" /> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="值类型" align="center" prop="valueType" width="120"> |
| | | <template #default="scope"> |
| | | <dict-tag :type="DICT_TYPE.VALUETYPE" :value="scope.row.valueType" /> |
| | | <dict-tag :type="DICT_TYPE.MEASURE_VALUE_TYPE" :value="scope.row.valueType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="测量单位" align="center" prop="unit" width="80"/> |
| | |
| | | <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"> |
| | | <el-table-column label="是否启用" align="center" prop="isEnable" width="85"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.isEnable === 1" size="small">是</el-tag> |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" align="center" min-width="130" fixed="right" width="160"> |
| | | <el-table-column label="操作" align="center" min-width="130" fixed="right" width="120"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as DaPoint from '@/api/data/da/point' |
| | | import {ref} from "vue"; |
| | | import {ref, reactive} from "vue"; |
| | | import download from "@/utils/download"; |
| | | import {DICT_TYPE, getDictOptions} from "@/utils/dict"; |
| | | import DaPointForm from './DaPointForm.vue' |
| | |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | |
| | | let dataListSelections = reactive([]) |
| | | // 多选 |
| | | function selectionChangeHandle (val) { |
| | | dataListSelections = val |
| | | } |
| | | // 启用 |
| | | async function enable() { |
| | | let ids = dataListSelections.map(item => { |
| | | return item.id |
| | | }) |
| | | // 启用的二次确认 |
| | | await message.enableConfirm(ids) |
| | | |
| | | await DaPoint.enable(ids) |
| | | message.success(t('common.enableSuccess')) |
| | | await getList() |
| | | } |
| | | // 禁用 |
| | | async function disable(){ |
| | | let ids = dataListSelections.map(item => { |
| | | return item.id |
| | | }) |
| | | // 启用的二次确认 |
| | | await message.disableConfirm(ids,) |
| | | |
| | | await DaPoint.disable(ids) |
| | | message.success(t('common.disableSuccess')) |
| | | await getList() |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(async () => { |
| | | await getList() |
| | |
| | | @click="updateSetting(scope.row)" |
| | | key="danger" |
| | | type="primary" |
| | | :disabled="scope.row.settingKey === 'pyFile'" |
| | | link |
| | | >修改 |
| | | </el-button> |
| | |
| | | @click="deleteSetting(props.row.methodSettings,scope.$index)" |
| | | key="danger" |
| | | type="danger" |
| | | :disabled="scope.row.settingKey === 'pyFile'" |
| | | link |
| | | >删除 |
| | | </el-button> |
| | |
| | | label="参数value" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-input size="small" v-model="scope.row.settingValue" maxlength="50" clearable /> |
| | | <el-input size="small" v-model="scope.row.settingValue" :disabled="scope.row.settingKey === 'pyFile'" maxlength="50" clearable /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" fixed="right" header-align="center" align="center" width="100"> |
| | |
| | | @click="deleteRow(scope.$index)" |
| | | key="danger" |
| | | type="danger" |
| | | :disabled="scope.row.settingKey === 'pyFile'" |
| | | link |
| | | >删除</el-button> |
| | | </template> |
| | |
| | | ], |
| | | className: [ |
| | | {required: true, message: '全类名不能为空', trigger: 'blur'} |
| | | ], |
| | | model: [ |
| | | {required: true, message: 'model不能为空', trigger: 'blur'} |
| | | ] |
| | | }) |
| | | |
| | |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | |
| | | if (hasModel.value) { |
| | | debugger |
| | | if (!formData.model || formData.model === '') { |
| | | message.error("model为必填项!") |
| | | return |
| | | } |
| | | |
| | | try { |
| | | JSON.parse(formData.model) |
| | | } catch (e) { |
| | | message.error("model参数异常!") |
| | | return |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | // 提交请求 |
| | | modelRunloading.value = true |
| | | try { |
| | |
| | | }) |
| | | offset = offset + 40 |
| | | if (chartCheckArray.indexOf('真实值') !== -1) { |
| | | let legendName = dataView.resultstr + '(真实)'; |
| | | let legendName = dataView.resultName + '(真实)'; |
| | | legendData.push(legendName); |
| | | seriesData.push({ |
| | | name: legendName, |
| | |
| | | }); |
| | | } |
| | | if (chartCheckArray.indexOf('T+N') !== -1) { |
| | | let legendName = dataView.resultstr + '(T+N)'; |
| | | let legendName = dataView.resultName + '(T+N)'; |
| | | seriesData.push({ |
| | | name: legendName, |
| | | data: dataView.preDataN || [], |
| | |
| | | }); |
| | | } |
| | | if (chartCheckArray.indexOf('T+L') !== -1) { |
| | | let legendName = dataView.resultstr + '(T+L)'; |
| | | let legendName = dataView.resultName + '(T+L)'; |
| | | legendData.push(legendName); |
| | | seriesData.push({ |
| | | name: legendName, |
| | |
| | | }); |
| | | } |
| | | if (chartCheckArray.indexOf('当时') !== -1) { |
| | | let legendName = dataView.resultstr + '(当时)'; |
| | | let legendName = dataView.resultName + '(当时)'; |
| | | legendData.push(legendName); |
| | | seriesData.push({ |
| | | name: legendName, |
| | |
| | | }); |
| | | } |
| | | if (chartCheckArray.indexOf('调整值') !== -1) { |
| | | let legendName = dataView.resultstr + '(调整值)'; |
| | | let legendName = dataView.resultName + '(调整值)'; |
| | | legendData.push(legendName); |
| | | seriesData.push({ |
| | | name: legendName, |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="50%"> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle" width="60%"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | |
| | | border |
| | | style="width: 100%; margin-top: 5px;"> |
| | | <el-table-column prop="outputorder" label="排序" align="center" width="80px"/> |
| | | <el-table-column label="结果" align="center" width="150px"> |
| | | <el-table-column label="结果KEY" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.resultstr" placeholder="请输入"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结果数据类型" align="center" width="150px"> |
| | | <el-table-column label="结果类型" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <el-select |
| | | v-model="scope.row.resultType" |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="索引" align="center" width="120px"> |
| | | <el-table-column label="索引" align="center" width="100px"> |
| | | <template #default="scope"> |
| | | <el-input-number style="width:100%;hight:100%" :disabled="scope.row.resultType !== 2" |
| | | v-model="scope.row.resultIndex" :min="0" step-strictly |
| | | controls-position="right"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结果名称" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.resultName" placeholder="请输入"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数据点" align="center"> |
| | |
| | | <el-table-column prop="key" label="键" align="center" min-width="150"/> |
| | | <el-table-column prop="name" label="名称" align="center" min-width="150"/> |
| | | <el-table-column prop="valuetype" label="类型" align="center" min-width="150"/> |
| | | <el-table-column prop="" label="值" align="center" min-width="150"> |
| | | <el-table-column prop="" label="值" align="center" min-width="200"> |
| | | <template #default="scope"> |
| | | <el-input size="mini" v-model="scope.row.value" maxlength="256" |
| | | style="width:100%;height:100%"/> |
| | |
| | | <dict-tag :type="DICT_TYPE.ITEM_RUN_STATUS" :value="scope.row.runStatus" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="运行耗时(s)" align="center" prop="duration"/> |
| | | <el-table-column label="运行耗时(ms)" align="center" prop="duration"/> |
| | | <el-table-column label="操作" align="center" min-width="120" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |