|
@@ -14,7 +14,14 @@ import MonthSetting from './MonthSetting.vue';
|
|
|
import SetInterval from './SetInterval.vue';
|
|
|
|
|
|
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
|
|
-import type { AlgorithmConfigInfo, AlgorithmForm, ChillersItem, TemperatureRange, TemperatureRangeItem } from '@/types';
|
|
|
+import type {
|
|
|
+ AlgorithmConfigInfo,
|
|
|
+ AlgorithmForm,
|
|
|
+ ChillersItem,
|
|
|
+ DeviceCop,
|
|
|
+ TemperatureRange,
|
|
|
+ TemperatureRangeItem,
|
|
|
+} from '@/types';
|
|
|
|
|
|
const { dictData: algTempCtrlMinStep, getDictData: getAlgTempCtrlMinStep } = useDictData(DictCode.AlgTempCtrlMinStep);
|
|
|
const { dictData: algTempHumCollectPeriod, getDictData: getAlgTempHumCollectPeriod } = useDictData(
|
|
@@ -46,6 +53,7 @@ const temperatureRangeList = ref<TemperatureRange[]>([]);
|
|
|
const chillersList = ref<ChillersItem[]>([]);
|
|
|
const algorithmId = ref<number>();
|
|
|
const groupId = ref<number>();
|
|
|
+const deviceCopItem = ref<DeviceCop[]>([]);
|
|
|
const algorithmForm = ref<AlgorithmForm>({
|
|
|
enabled: false,
|
|
|
sendCtrlCmd: true,
|
|
@@ -97,6 +105,7 @@ const rules: Record<string, Rule[]> = {
|
|
|
const editorAlgorithmChange = (info: AlgorithmConfigInfo) => {
|
|
|
temperatureRangeList.value = [];
|
|
|
chillersList.value = [];
|
|
|
+ deviceCopItem.value = [];
|
|
|
const {
|
|
|
id: algId,
|
|
|
enabled,
|
|
@@ -125,7 +134,17 @@ const editorAlgorithmChange = (info: AlgorithmConfigInfo) => {
|
|
|
chilledWaterOutletTempRangeList,
|
|
|
chilledWaterOutletTempSet,
|
|
|
devGroupId,
|
|
|
+ deviceCOPList,
|
|
|
} = info;
|
|
|
+ deviceCOPList.forEach((item) => {
|
|
|
+ const { id, enableCopSet, deviceName } = item;
|
|
|
+ deviceCopItem.value.push({
|
|
|
+ id,
|
|
|
+ enableCopSet,
|
|
|
+ deviceName,
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
groupId.value = devGroupId;
|
|
|
algorithmId.value = algId;
|
|
|
Object.assign(algorithmForm.value, {
|
|
@@ -271,14 +290,23 @@ const addAlgorithm = async () => {
|
|
|
upper,
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+ const deviceCopList: { deviceId: number; enableCopSet: boolean }[] = [];
|
|
|
+ deviceCopItem.value.forEach((item) => {
|
|
|
+ const { id, enableCopSet } = item;
|
|
|
+ deviceCopList.push({
|
|
|
+ deviceId: id,
|
|
|
+ enableCopSet,
|
|
|
+ });
|
|
|
+ });
|
|
|
await addAlgorithmConfigUpdate({
|
|
|
...algorithmForm.value,
|
|
|
id: algorithmId.value,
|
|
|
chillers: chillersList.value,
|
|
|
chilledWaterOutletTempRangeList: timeList,
|
|
|
chilledWaterOutletTempSet: monthSettingRefs.value ? monthSettingRefs.value.stringConversion() : '',
|
|
|
+ deviceCopUpdateDTOS: deviceCopList,
|
|
|
});
|
|
|
+
|
|
|
if (groupId.value) {
|
|
|
emit('confirmClick', groupId.value);
|
|
|
}
|
|
@@ -499,7 +527,7 @@ onMounted(() => {
|
|
|
<ASwitch class="analysis-margin" v-model:checked="algorithmForm.analysis" />
|
|
|
<div @click="analysisEditor" class="editor-style">{{ $t('common.editor') }}</div>
|
|
|
</AFlex>
|
|
|
- <AFlex align="center">
|
|
|
+ <AFlex align="center" class="system-functions">
|
|
|
<div class="div-width">{{ $t('algorithmManage.dynamicAdjustment') }}</div>
|
|
|
<AFlex align="center" class="adjustment-div">
|
|
|
<div class="adjustment-text">{{ $t('algorithmManage.freezingSetValue') }}</div>
|
|
@@ -509,6 +537,15 @@ onMounted(() => {
|
|
|
<div @click="setEditor" class="editor-style editor-left">{{ $t('common.editor') }}</div>
|
|
|
</AFlex>
|
|
|
</AFlex>
|
|
|
+ <AFlex align="center">
|
|
|
+ <div class="div-width">{{ t('algorithmManage.copAlgorithm') }}</div>
|
|
|
+ <AFlex align="center" class="adjustment-div" wrap="wrap">
|
|
|
+ <AFlex v-for="item in deviceCopItem" :key="item.id" class="adjustment-right">
|
|
|
+ <div>{{ item.deviceName }}: </div>
|
|
|
+ <ASwitch v-model:checked="item.enableCopSet" />
|
|
|
+ </AFlex>
|
|
|
+ </AFlex>
|
|
|
+ </AFlex>
|
|
|
</div>
|
|
|
</ACollapsePanel>
|
|
|
</ACollapse>
|
|
@@ -586,6 +623,14 @@ onMounted(() => {
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.system-functions {
|
|
|
+ margin-bottom: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.adjustment-right {
|
|
|
+ margin-right: 40px;
|
|
|
+}
|
|
|
+
|
|
|
.button-width {
|
|
|
width: 128px;
|
|
|
height: 40px;
|