|  | @@ -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="avePress.isAuto" name="radioGroup">
 | 
	
		
			
				|  |  | +              <a-radio-group :value="avePress.isAuto" name="radioGroup" @change="changeIsAuto">
 | 
	
		
			
				|  |  |                  <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="modalVisible = true">提交</div>
 | 
	
		
			
				|  |  | +              <div class="btn btn1" @click="openModal">控制密码修改</div>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </ventBox1>
 | 
	
	
		
			
				|  | @@ -71,12 +71,13 @@
 | 
	
		
			
				|  |  |        />
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |      <PasswordModal :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleControl" @handle-cancel="modalVisible = false" />
 | 
	
		
			
				|  |  | +    <UpdatePassword @register="updatePwdRegister" @submit="changePassword" />
 | 
	
		
			
				|  |  |    </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, submitEdit, subList } from '../balancePress.api';
 | 
	
		
			
				|  |  | +  import { list, submitEdit, subList, updatePassword, validPassword } from '../balancePress.api';
 | 
	
		
			
				|  |  |    import ModuleCommon from '../../../home/configurable/components/ModuleCommon.vue';
 | 
	
		
			
				|  |  |    import { useInitConfigs } from '../../../home/configurable/hooks/useInit';
 | 
	
		
			
				|  |  |    import { useGlobSetting } from '/@/hooks/setting';
 | 
	
	
		
			
				|  | @@ -84,7 +85,9 @@
 | 
	
		
			
				|  |  |    import { message } from 'ant-design-vue';
 | 
	
		
			
				|  |  |    import ventBox1 from '/@/components/vent/ventBox1.vue';
 | 
	
		
			
				|  |  |    import PasswordModal from '../../comment/components/PasswordModal.vue';
 | 
	
		
			
				|  |  | +  import UpdatePassword from '../../comment/components/UpdatePassword.vue';
 | 
	
		
			
				|  |  |    import { get } from 'lodash-es';
 | 
	
		
			
				|  |  | +  import { useModal } from '/@/components/Modal';
 | 
	
		
			
				|  |  |    // import { Config } from '../../../deviceManager/configurationTable/types';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    const props = defineProps({
 | 
	
	
		
			
				|  | @@ -325,9 +328,17 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // const { configs, fetchConfigs } = useInitConfigs();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  const formData = ref({});
 | 
	
		
			
				|  |  | +  const formData = ref({
 | 
	
		
			
				|  |  | +    isAuto: false,
 | 
	
		
			
				|  |  | +  });
 | 
	
		
			
				|  |  |    // 默认初始是第一行
 | 
	
		
			
				|  |  |    const isAutoControl = ref('1');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  function changeIsAuto({ target }) {
 | 
	
		
			
				|  |  | +    formData.value.isAuto = target.value;
 | 
	
		
			
				|  |  | +    modalVisible.value = true;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    const changeType = (isAutoControl) => {
 | 
	
		
			
				|  |  |      isAutoControl;
 | 
	
		
			
				|  |  |      //
 | 
	
	
		
			
				|  | @@ -336,20 +347,28 @@
 | 
	
		
			
				|  |  |    const modalVisible = ref(false);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    function handleControl(password) {
 | 
	
		
			
				|  |  | -    submitEdit({
 | 
	
		
			
				|  |  | +    validPassword({
 | 
	
		
			
				|  |  |        id: avePress.value.id,
 | 
	
		
			
				|  |  |        password,
 | 
	
		
			
				|  |  | -      isAuto: avePress.value.isAuto,
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |        .then(() => {
 | 
	
		
			
				|  |  | -        message.success('操作成功');
 | 
	
		
			
				|  |  | -        getAvePress();
 | 
	
		
			
				|  |  | +        return submitEdit({
 | 
	
		
			
				|  |  | +          id: avePress.value.id,
 | 
	
		
			
				|  |  | +          isAuto: formData.value.isAuto,
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +          .then(() => {
 | 
	
		
			
				|  |  | +            message.success('操作成功');
 | 
	
		
			
				|  |  | +          })
 | 
	
		
			
				|  |  | +          .catch(() => {
 | 
	
		
			
				|  |  | +            message.error('操作失败');
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  | -      .catch(() => {
 | 
	
		
			
				|  |  | -        message.error('操作失败');
 | 
	
		
			
				|  |  | +      .catch((e) => {
 | 
	
		
			
				|  |  | +        message.error(e);
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |        .finally(() => {
 | 
	
		
			
				|  |  |          modalVisible.value = false;
 | 
	
		
			
				|  |  | +        getAvePress();
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -364,6 +383,28 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    const { configs, fetchConfigs } = useInitConfigs();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +  const [updatePwdRegister, { openModal, closeModal, setModalProps }] = useModal();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  function changePassword(values) {
 | 
	
		
			
				|  |  | +    setModalProps({ confirmLoading: true });
 | 
	
		
			
				|  |  | +    updatePassword({
 | 
	
		
			
				|  |  | +      id: avePress.value.id,
 | 
	
		
			
				|  |  | +      newPassword: values.password,
 | 
	
		
			
				|  |  | +      oldPassword: values.oldpassword,
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +      .then(() => {
 | 
	
		
			
				|  |  | +        message.success('操作成功');
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      .catch((e) => {
 | 
	
		
			
				|  |  | +        message.error(e);
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      .finally(() => {
 | 
	
		
			
				|  |  | +        setModalProps({ confirmLoading: false });
 | 
	
		
			
				|  |  | +        closeModal();
 | 
	
		
			
				|  |  | +        getAvePress();
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    onMounted(() => {
 | 
	
		
			
				|  |  |      // getMonitor()
 | 
	
		
			
				|  |  |      fetchConfigs('balancePressHome');
 |