fix: 太阳能网控设置,功能优化。

This commit is contained in:
tianyongbao
2026-07-01 23:50:55 +08:00
parent c6db9f94d6
commit a430ee6f7f
2 changed files with 7 additions and 52 deletions

View File

@@ -13,21 +13,14 @@ declare module 'vue' {
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
DictTag: typeof import('./../components/DictTag/index.vue')['default'] DictTag: typeof import('./../components/DictTag/index.vue')['default']
Editor: typeof import('./../components/Editor/index.vue')['default'] Editor: typeof import('./../components/Editor/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElBadge: typeof import('element-plus/es')['ElBadge'] ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard'] ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker'] ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog'] ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider'] ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -38,18 +31,14 @@ declare module 'vue' {
ElForm: typeof import('element-plus/es')['ElForm'] ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup'] ElOptionGroup: typeof import('element-plus/es')['ElOptionGroup']
ElPagination: typeof import('element-plus/es')['ElPagination'] ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover'] ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow'] ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect'] ElSelect: typeof import('element-plus/es')['ElSelect']
@@ -57,22 +46,14 @@ declare module 'vue' {
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
FileUpload: typeof import('./../components/FileUpload/index.vue')['default'] FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
FlowChart: typeof import('./../components/Process/flowChart.vue')['default'] FlowChart: typeof import('./../components/Process/flowChart.vue')['default']
FlowChartImg: typeof import('./../components/Process/flowChartImg.vue')['default'] FlowChartImg: typeof import('./../components/Process/flowChartImg.vue')['default']
Hamburger: typeof import('./../components/Hamburger/index.vue')['default'] Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
IFrame: typeof import('./../components/iFrame/index.vue')['default'] IFrame: typeof import('./../components/iFrame/index.vue')['default']
ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default'] ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default'] ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

View File

@@ -55,7 +55,7 @@
{{ formatValue(scope.row.salinityCompensation) }} {{ formatValue(scope.row.salinityCompensation) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="线性补偿" align="center" prop="phaseCompensation" width="120"> <!-- <el-table-column label="线性补偿" align="center" prop="phaseCompensation" width="120">
<template #default="scope"> <template #default="scope">
{{ formatValue(scope.row.phaseCompensation) }} {{ formatValue(scope.row.phaseCompensation) }}
</template> </template>
@@ -69,13 +69,13 @@
<template #default="scope"> <template #default="scope">
{{ formatValue(scope.row.temperatureCompensation) }} {{ formatValue(scope.row.temperatureCompensation) }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="最后上数时间" align="center" prop="lastReportTime" min-width="170"> <el-table-column label="最后上数时间" align="center" prop="lastReportTime" min-width="170">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.lastReportTime, '{y}-{m}-{d} {h}:{i}:{s}') || '-' }}</span> <span>{{ parseTime(scope.row.lastReportTime, '{y}-{m}-{d} {h}:{i}:{s}') || '-' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="170"> <el-table-column label="操作" align="center" fixed="right" width="260">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="Refresh" :loading="statusLoadingId === scope.row.id" @click="refreshStatus(scope.row)">刷新状态</el-button> <el-button link type="primary" icon="Refresh" :loading="statusLoadingId === scope.row.id" @click="refreshStatus(scope.row)">刷新状态</el-button>
<el-button link type="primary" icon="Position" @click="openCommand(scope.row)" v-hasPermi="['fishery:solarControl:command']">下发指令</el-button> <el-button link type="primary" icon="Position" @click="openCommand(scope.row)" v-hasPermi="['fishery:solarControl:command']">下发指令</el-button>
@@ -96,14 +96,6 @@
<el-tag :type="getStatusTagType(currentDevice)" size="large">{{ getStatusText(currentDevice) }}</el-tag> <el-tag :type="getStatusTagType(currentDevice)" size="large">{{ getStatusText(currentDevice) }}</el-tag>
</div> </div>
<el-alert
class="mb-[12px]"
:title="currentDevice.online ? '设备在线,将直接下发到太阳能网控。' : '设备离线,将写入缓存,待设备上线后自动下发。'"
:type="currentDevice.online ? 'success' : 'warning'"
show-icon
:closable="false"
/>
<el-form ref="commandFormRef" :model="commandForm" :rules="commandRules" label-width="130px"> <el-form ref="commandFormRef" :model="commandForm" :rules="commandRules" label-width="130px">
<el-form-item label="下发属性" prop="identifier"> <el-form-item label="下发属性" prop="identifier">
<el-select v-model="commandForm.identifier" filterable placeholder="请选择属性" style="width: 100%" @change="handlePropertyChange"> <el-select v-model="commandForm.identifier" filterable placeholder="请选择属性" style="width: 100%" @change="handlePropertyChange">
@@ -167,24 +159,7 @@
<template #footer> <template #footer>
<div class="command-footer"> <div class="command-footer">
<el-button @click="commandOpen = false">取消</el-button> <el-button @click="commandOpen = false">取消</el-button>
<el-button <el-button type="primary" icon="Position" :loading="submitLoading" @click="submitCommand">下发</el-button>
v-if="currentDevice?.online"
type="primary"
icon="Position"
:loading="submitLoading"
@click="submitCommand(false)"
>
直接下发
</el-button>
<el-button
v-else
type="warning"
icon="Clock"
:loading="submitLoading"
@click="submitCommand(true)"
>
缓存下发
</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
@@ -484,7 +459,7 @@ const handlePropertyChange = (identifier: string) => {
} }
}; };
const submitCommand = async (cache: boolean) => { const submitCommand = async () => {
if (!currentDevice.value || !selectedProperty.value) { if (!currentDevice.value || !selectedProperty.value) {
return; return;
} }
@@ -497,10 +472,9 @@ const submitCommand = async (cache: boolean) => {
id: currentDevice.value.id, id: currentDevice.value.id,
properties: { properties: {
[property.identifier]: value [property.identifier]: value
}, }
cache
}); });
ElMessage.success(cache ? '已写入缓存,设备上线后自动下发' : '下发成功'); ElMessage.success('下发成功');
commandOpen.value = false; commandOpen.value = false;
await getList(); await getList();
} finally { } finally {