Commit ca1b07733a47384b915f8e65ddc770648977c420
Merge branch 'ft_local_dev' into 'main'
pref:优化转换函数 修改状态传递参数 See merge request huang/yun-teng-iot-front!415
Showing
2 changed files
with
3 additions
and
5 deletions
1 | import { defHttp } from '/@/utils/http/axios'; | 1 | import { defHttp } from '/@/utils/http/axios'; |
2 | import { ScriptParam, ScriptQueryParam, ScriptRecord } from './model/scriptModel'; | 2 | import { ScriptParam, ScriptQueryParam, ScriptRecord } from './model/scriptModel'; |
3 | import { PaginationResult } from '/#/axios'; | 3 | import { PaginationResult } from '/#/axios'; |
4 | -import { IChangeStatus } from '../ruleengine/model/ruleengineModel'; | ||
5 | 4 | ||
6 | enum ScriptManagerApi { | 5 | enum ScriptManagerApi { |
7 | SCRIPT_POST_URL = '/js', | 6 | SCRIPT_POST_URL = '/js', |
@@ -23,10 +22,9 @@ export const ScriptPage = (params: ScriptQueryParam) => { | @@ -23,10 +22,9 @@ export const ScriptPage = (params: ScriptQueryParam) => { | ||
23 | * 改变转换函数状态 | 22 | * 改变转换函数状态 |
24 | * @param params id status | 23 | * @param params id status |
25 | */ | 24 | */ |
26 | -export const scriptPagePutApi = (params: IChangeStatus) => | 25 | +export const scriptPagePutApi = (id, status) => |
27 | defHttp.post({ | 26 | defHttp.post({ |
28 | - url: ScriptManagerApi.SCRIPT_STATUS, | ||
29 | - data: params, | 27 | + url: ScriptManagerApi.SCRIPT_STATUS + '/' + id + '/' + status, |
30 | }); | 28 | }); |
31 | 29 | ||
32 | //删除脚本 | 30 | //删除脚本 |
@@ -180,7 +180,7 @@ | @@ -180,7 +180,7 @@ | ||
180 | const newStatus = checked ? 1 : 0; | 180 | const newStatus = checked ? 1 : 0; |
181 | const { createMessage } = useMessage(); | 181 | const { createMessage } = useMessage(); |
182 | try { | 182 | try { |
183 | - await scriptPagePutApi({ id: record.id, status: newStatus }); | 183 | + await scriptPagePutApi(record.id, newStatus); |
184 | if (newStatus) { | 184 | if (newStatus) { |
185 | createMessage.success(`启用成功`); | 185 | createMessage.success(`启用成功`); |
186 | } else { | 186 | } else { |