From 0bb5991231cf387b4c75a82389511ca867140cab Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Thu, 20 Apr 2023 20:10:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF-=E9=92=89=E9=92=89=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/link/accessConfig.ts | 4 ++++ src/api/link/plugin.ts | 8 ++++++-- .../Template/Detail/components/VariableDefinitions.vue | 2 +- src/views/notice/Template/Detail/index.vue | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/api/link/accessConfig.ts b/src/api/link/accessConfig.ts index 86d03762..929a2d45 100644 --- a/src/api/link/accessConfig.ts +++ b/src/api/link/accessConfig.ts @@ -47,3 +47,7 @@ export const getClusters = () => export const getPluginList = (data: any) => server.post('/plugin/driver/_query/no-paging', data) export const getPluginConfig = (id: string) => server.get(`/plugin/driver/${id}/description`) + +export const getCommandsByAccess = (id: string) => server.get(`/gateway/device/${id}/commands`) + +export const getCommandsDevicesByAccessId = (id: string, data: any) => server.post(`/gateway/device/${id}/command/QueryDevicePage`, data) diff --git a/src/api/link/plugin.ts b/src/api/link/plugin.ts index 7cf5b335..b7fcce6d 100644 --- a/src/api/link/plugin.ts +++ b/src/api/link/plugin.ts @@ -7,6 +7,8 @@ export const uploadFile = `${BASE_API_PATH}/plugin/driver/upload` export const add = (data: any) => post('/plugin/driver', data) +export const update = (data: any) => patch('/plugin/driver', data) + export const removeFn = (id: string) => remove(`/plugin/driver/${id}`) export const detail = (id: string) => get(`/plugin/driver/${id}`) @@ -19,7 +21,7 @@ export const detail = (id: string) => get(`/plugin/driver/${id}`) */ export const getProductsById = (id: string) => get(`/plugin/driver/${id}/products`) -export const savePluginData = (type: string, pluginId: string, internalId: string, externalId: string ) => patch(`/plugin/mapping/${type}/${pluginId}/${internalId}`, externalId) +export const savePluginData = (type: string, pluginId: string, internalId: string, externalId: string ) => patch(`/plugin/mapping/${type}/${pluginId}/${internalId}`, externalId, { headers: {'Content-Type': "text/plain"}}) export const getPluginData = (type: string, pluginId: string, internalId: string ) => get(`/plugin/mapping/${type}/${pluginId}/${internalId}`) @@ -27,4 +29,6 @@ export const getPublic = (id: string, path: string) => get(`/plugin/driver/${id} export const getTypes = () => get(`/dictionary/internal-plugin-type/items`) -export const vailIdFn = (id: string ) => get(`/plugin/driver/id/_validate`, { id }) \ No newline at end of file +export const vailIdFn = (id: string ) => get(`/plugin/driver/id/_validate`, { id }) + +export const getProductByPluginId = (id: string) => get(`/plugin/driver/${id}/products`) \ No newline at end of file diff --git a/src/views/notice/Template/Detail/components/VariableDefinitions.vue b/src/views/notice/Template/Detail/components/VariableDefinitions.vue index 82510ebc..d557ce3b 100644 --- a/src/views/notice/Template/Detail/components/VariableDefinitions.vue +++ b/src/views/notice/Template/Detail/components/VariableDefinitions.vue @@ -143,7 +143,7 @@ const handleTypeChange = (record: IVariable) => { record.format = 'timestamp'; break; case 'double': - record.format = '%.xf'; + record.format = '%.2f'; break; } }; diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue index babc0e11..b958019a 100644 --- a/src/views/notice/Template/Detail/index.vue +++ b/src/views/notice/Template/Detail/index.vue @@ -1219,6 +1219,10 @@ const handleSubmit = () => { delete formData.value.template.ttsmessage; } + if (formData.value.provider === 'dingTalkRobotWebHook' && formData.value.template?.messageType === 'text') { + formData.value.template.text!.content = formData.value.template.message as string + } + formRef.value?.validate() .then(async () => { btnLoading.value = true;