按钮状态显示

This commit is contained in:
zoujiandong
2023-09-14 12:04:07 +08:00
parent 92489a51ff
commit a42389b4b7
4 changed files with 88 additions and 35 deletions
+18 -10
View File
@@ -59,18 +59,26 @@ const rules = reactive({
});
// Akiraka 20230210 确认按钮 => 开始数据检查
const handleConfirm = () => {
proxy.$refs.modalFormRef.validate((valid) => {
proxy.$refs.modalFormRef.validate(async(valid) => {
if (!valid) {
api.value(id.value,form).then(response => {
// Akiraka 20230210 关闭弹窗
if(response.code==200){
Message.success("取消成功");
const {code}= await api.value(id.value,form);
if(code==200){
Message.success("取消成功");
proxy.$refs.modalFormRef.resetFields();
}else{
proxy.$notification.error(response.message);
}
emits('closeChange',true);
})
}else{
proxy.$notification.error(response.message);
}
emits('closeChange',true);
// api.value(id.value,form).then(response => {
// // Akiraka 20230210 关闭弹窗
// if(response.code==200){
// Message.success("取消成功");
// proxy.$refs.modalFormRef.resetFields();
// }else{
// proxy.$notification.error(response.message);
// }
// emits('closeChange',true);
// })
}
})
}
+20 -12
View File
@@ -13,7 +13,7 @@
</a-modal>
</template>
<script setup>
import { reactive, toRefs, getCurrentInstance } from 'vue';
import {toRefs, getCurrentInstance } from 'vue';
import { Message } from '@arco-design/web-vue';
const { proxy } = getCurrentInstance();
const props = defineProps({
@@ -44,16 +44,24 @@ const handleClose = () => {
}
// Akiraka 20230210 确认按钮 => 开始数据检查
const handleConfirm = () => {
api.value(id.value).then(response => {
// Akiraka 20230210 关闭弹窗
if(response.code==200){
Message.success("成功");
proxy.$refs.modalFormRef.resetFields();
}else{
proxy.$notification.error(response.message);
}
emits('closeChangeOk',true);
})
const handleConfirm = async () => {
const {code}=api.value(id.value);
if(code==200){
Message.success("成功");
proxy.$refs.modalFormRef.resetFields();
}else{
proxy.$notification.error(response.message);
}
emits('closeChangeOk',true);
// api.value(id.value).then(response => {
// // Akiraka 20230210 关闭弹窗
// if(response.code==200){
// Message.success("成功");
// proxy.$refs.modalFormRef.resetFields();
// }else{
// proxy.$notification.error(response.message);
// }
// emits('closeChangeOk',true);
// })
}
</script>