|
@@ -35,7 +35,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="btn-box" style="text-align: center">
|
|
|
- <div class="btn btn1" @click="onSubmit">提交</div>
|
|
|
+ <div class="btn btn1" @click="modalVisible = true">提交</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</ventBox1>
|
|
@@ -48,13 +48,13 @@
|
|
|
<template #container>
|
|
|
<div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
<div class="title">自动调节:</div>
|
|
|
- <a-radio-group v-model:value="isAutoControl" name="radioGroup" @change="changeType(isAutoControl)">
|
|
|
- <a-radio value="1">关闭</a-radio>
|
|
|
- <a-radio value="2">开启</a-radio>
|
|
|
+ <a-radio-group v-model:value="avePress.isAuto" name="radioGroup">
|
|
|
+ <a-radio :value="false">关闭</a-radio>
|
|
|
+ <a-radio :value="true">开启</a-radio>
|
|
|
</a-radio-group>
|
|
|
</div>
|
|
|
<div class="btn-box" style="text-align: center">
|
|
|
- <div class="btn btn1" @click="onSubmit">提交</div>
|
|
|
+ <div class="btn btn1" @click="modalVisible = true">提交</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</ventBox1>
|
|
@@ -70,18 +70,21 @@
|
|
|
:visible="true"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <PasswordModal :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleControl" @handle-cancel="modalVisible = false" />
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted, onUnmounted, defineProps } from 'vue';
|
|
|
import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
|
|
|
- import { list } from '../balancePress.api';
|
|
|
+ import { list, submitEdit, subList } from '../balancePress.api';
|
|
|
import ModuleCommon from '../../../home/configurable/components/ModuleCommon.vue';
|
|
|
import { useInitConfigs } from '../../../home/configurable/hooks/useInit';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import { settingParam1, settingParam2, settingParam3 } from '../balancePress.data';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue';
|
|
|
+ import PasswordModal from '../../comment/components/PasswordModal.vue';
|
|
|
+ import { get } from 'lodash-es';
|
|
|
// import { Config } from '../../../deviceManager/configurationTable/types';
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -330,15 +333,41 @@
|
|
|
//
|
|
|
};
|
|
|
|
|
|
- function onSubmit() {
|
|
|
- message.success('提交成功');
|
|
|
+ const modalVisible = ref(false);
|
|
|
+
|
|
|
+ function handleControl(password) {
|
|
|
+ submitEdit({
|
|
|
+ id: avePress.value.id,
|
|
|
+ password,
|
|
|
+ isAuto: avePress.value.isAuto,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ message.success('操作成功');
|
|
|
+ getAvePress();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ message.error('操作失败');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ modalVisible.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ const avePress = ref<any>({ isAuto: false });
|
|
|
+ function getAvePress() {
|
|
|
+ subList({
|
|
|
+ strType: 'sdg_fan_sys_gate',
|
|
|
+ }).then(({ records }) => {
|
|
|
+ avePress.value = get(records, '[0]');
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const { configs, fetchConfigs } = useInitConfigs();
|
|
|
|
|
|
onMounted(() => {
|
|
|
// getMonitor()
|
|
|
- fetchConfigs('balancePressHome');
|
|
|
+ // fetchConfigs('balancePressHome');
|
|
|
+ getAvePress();
|
|
|
loading.value = true;
|
|
|
mountedThree().then(async () => {
|
|
|
await setModelType('balancePressBase'); //balancePressBase
|