Pārlūkot izejas kodu

fix: 修复场景详情中部分情况下会自动调用保存接口的情况

yanglzh 3 mēneši atpakaļ
vecāks
revīzija
b3e956943a

+ 3 - 3
src/views/iot/scene/manage/component/actionType/deviceOut.vue

@@ -162,9 +162,9 @@ const selectAction = (val: string) => {
   getAction(val);
 }
 
-function changeFunc(functionName: string) {
+function changeFunc(functionName: string, notSave?: boolean) {
   inputs.value = functionCallList.value.find(item => item.key === functionName)?.inputs || []
-  saveData()
+  if (!notSave) saveData()
 }
 
 //获取类型数据
@@ -174,7 +174,7 @@ const getAction = (val: string) => {
       functionCallList.value = []
       product.tabDeviceFucntion.getList({ productKey: productKey.value }).then((res: any) => {
         functionCallList.value = res
-        if (fromData.value.functionCall?.functionName) changeFunc(fromData.value.functionCall?.functionName)
+        if (fromData.value.functionCall?.functionName) changeFunc(fromData.value.functionCall?.functionName, true)
       })
       break;
     case 'getProperties':

+ 0 - 1
src/views/iot/scene/manage/detail.vue

@@ -160,7 +160,6 @@ export default defineComponent({
 			const id = route.params && route.params.id;
 			if (state.detail.sceneType == 'device') {
 				api.manage.getOneDetail({ "sceneId": id, 'group': 'definition' }).then((res: any) => {
-					console.log(res)
 					if (!res) {
 						addScenesDetail('definition');
 						// getOneDetail();