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 | 1 | import { defHttp } from '/@/utils/http/axios'; |
2 | 2 | import { ScriptParam, ScriptQueryParam, ScriptRecord } from './model/scriptModel'; |
3 | 3 | import { PaginationResult } from '/#/axios'; |
4 | -import { IChangeStatus } from '../ruleengine/model/ruleengineModel'; | |
5 | 4 | |
6 | 5 | enum ScriptManagerApi { |
7 | 6 | SCRIPT_POST_URL = '/js', |
... | ... | @@ -23,10 +22,9 @@ export const ScriptPage = (params: ScriptQueryParam) => { |
23 | 22 | * 改变转换函数状态 |
24 | 23 | * @param params id status |
25 | 24 | */ |
26 | -export const scriptPagePutApi = (params: IChangeStatus) => | |
25 | +export const scriptPagePutApi = (id, status) => | |
27 | 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 | 180 | const newStatus = checked ? 1 : 0; |
181 | 181 | const { createMessage } = useMessage(); |
182 | 182 | try { |
183 | - await scriptPagePutApi({ id: record.id, status: newStatus }); | |
183 | + await scriptPagePutApi(record.id, newStatus); | |
184 | 184 | if (newStatus) { |
185 | 185 | createMessage.success(`启用成功`); |
186 | 186 | } else { | ... | ... |