diff --git a/src/components/index.ts b/src/components/index.ts
index 3e8f4b57..fdbb2309 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -8,7 +8,7 @@ import CardBox from './CardBox/index.vue';
// import Search from './Search'
import NormalUpload from './NormalUpload/index.vue'
import FileFormat from './FileFormat/index.vue'
-// import JUpload from './JUpload/index.vue'
+import JProUpload from './JUpload/index.vue'
import { BasicLayoutPage, BlankLayoutPage } from './Layout'
import { PageContainer } from 'jetlinks-ui-components/es/components'
import Ellipsis from './Ellipsis/index.vue'
@@ -27,7 +27,7 @@ export default {
// .component('Search', Search)
.component('NormalUpload', NormalUpload)
.component('FileFormat', FileFormat)
- // .component('JUpload', JUpload)
+ .component('JProUpload', JProUpload)
.component('BasicLayoutPage', BasicLayoutPage)
.component('BlankLayoutPage', BlankLayoutPage)
.component('PageContainer', PageContainer)
diff --git a/src/views/device/Instance/Export/index.vue b/src/views/device/Instance/Export/index.vue
index 9f49c011..1b422fde 100644
--- a/src/views/device/Instance/Export/index.vue
+++ b/src/views/device/Instance/Export/index.vue
@@ -1,5 +1,12 @@
-
+
-
-
-
-
-
-
-
-
- xlsx
- csv
-
-
-
+
+
+
+ {{ item.name }}
+
+
+
+
+ xlsx
+ csv
+
+
+
-
+
\ No newline at end of file
diff --git a/src/views/device/Instance/Import/index.vue b/src/views/device/Instance/Import/index.vue
index 899cdb61..335ff68d 100644
--- a/src/views/device/Instance/Import/index.vue
+++ b/src/views/device/Instance/Import/index.vue
@@ -1,36 +1,35 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/views/device/Instance/Save/index.vue b/src/views/device/Instance/Save/index.vue
index b49cd0ba..00bf127c 100644
--- a/src/views/device/Instance/Save/index.vue
+++ b/src/views/device/Instance/Save/index.vue
@@ -18,7 +18,7 @@
-
+
@@ -60,15 +60,14 @@
{{item.name}}
@@ -105,16 +104,12 @@ const formRef = ref();
const modelRef = reactive({
productId: undefined,
- id: '',
+ id: undefined,
name: '',
describe: '',
photoUrl: getImage('/device/instance/device-card.png'),
});
-const filterOption = (input: string, option: any) => {
- return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-};
-
const vailId = async (_: Record, value: string) => {
if (!props?.data?.id && value) {
const resp = await isExists(value);
@@ -202,10 +197,15 @@ const handleCancel = () => {
const handleSave = () => {
formRef.value
.validate()
- .then(async () => {
+ .then(async (_data: any) => {
loading.value = true;
- const resp = await update(toRaw(modelRef));
- loading.value = false;
+ const obj = {...toRaw(modelRef), ..._data}
+ if(!obj.id){
+ delete obj.id
+ }
+ const resp = await update(obj).finally(() => {
+ loading.value = false;
+ })
if (resp.status === 200) {
message.success('操作成功!');
emit('save');
diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue
index d28d075d..5320be4e 100644
--- a/src/views/device/Instance/index.vue
+++ b/src/views/device/Instance/index.vue
@@ -229,7 +229,7 @@
-
+
>({});
@@ -696,4 +696,8 @@ const saveBtn = () => {
const handleSearch = (_params: any) => {
params.value = _params;
};
+
+const onRefresh = () => {
+ instanceRef.value?.reload();
+}
diff --git a/src/views/device/Instance/typings.d.ts b/src/views/device/Instance/typings.d.ts
index e00c9319..035c56f0 100644
--- a/src/views/device/Instance/typings.d.ts
+++ b/src/views/device/Instance/typings.d.ts
@@ -83,4 +83,17 @@ type InstanceModel = {
params: Set; // 处理无限循环Card
active?: string; // 当前编辑的Card
selectedRows: Map;
+}
+
+export interface ActionsType {
+ key: string;
+ text?: string;
+ disabled?: boolean;
+ permission?: boolean;
+ onClick?: (data: any) => void;
+ style?: CSSProperties;
+ tooltip?: TooltipProps;
+ popConfirm?: PopconfirmProps;
+ icon?: string;
+ children?: ActionsType[];
}
\ No newline at end of file
diff --git a/src/views/rule-engine/Scene/index.vue b/src/views/rule-engine/Scene/index.vue
index 9d49e85d..1ec7c88f 100644
--- a/src/views/rule-engine/Scene/index.vue
+++ b/src/views/rule-engine/Scene/index.vue
@@ -1,6 +1,6 @@
-
+
{{ slotProps.name }}
@@ -126,7 +125,7 @@
import SaveModal from './Save/save.vue';
import type { SceneItem } from './typings';
import { useMenuStore } from 'store/menu';
-import { query, _delete, _action } from '@/api/rule-engine/scene';
+import { query, _delete, _action, _execute } from '@/api/rule-engine/scene';
import { message } from 'ant-design-vue';
import type { ActionsType } from '@/components/Table';
import { getImage } from '@/utils/comm';
@@ -180,10 +179,12 @@ const columns = [
scopedSlots: true,
search: {
type: 'select',
- options: Array.from(typeMap).map((item) => ({
- label: item[1],
- value: item[0],
- })),
+ options: Array.from(typeMap).map((item) => {
+ return {
+ label: item[1]?.text,
+ value: item[0],
+ }
+ }),
},
},
{
@@ -305,9 +306,18 @@ const getActions = (
: '未启用,不能手动触发',
},
icon: 'LikeOutlined',
- onClick: () => {
- // handleView(data.id, data.triggerType);
- },
+ popConfirm: {
+ title: '',
+ onConfirm: async () => {
+ const resp = await _execute(data.id)
+ if (resp.status === 200) {
+ message.success('操作成功!');
+ sceneRef.value?.reload();
+ } else {
+ message.error('操作失败!');
+ }
+ }
+ }
};
actions.splice(1, 0, _item);
}
diff --git a/yarn.lock b/yarn.lock
index 04660101..1bda2b9a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3903,8 +3903,8 @@ jetlinks-store@^0.0.3:
jetlinks-ui-components@^1.0.4:
version "1.0.4"
- resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#38f2abbb6c686ce1e1d7c08a318a6c2f50267adc"
- integrity sha512-bpmSoKVpdgZ2FUxIBaqBpewt2T9g1tTf4tECam9uTdww6SDxyvLzWmeKIUfVIwp2Ts7uKpHPFsCtI8fPmZuRjw==
+ resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#31f6879f83d394ba45bfd6e94ce0b20de817d490"
+ integrity sha512-5X26+GsqsduCUSmlaYOAw/MDwKRsZFnifzzRqHcm5qbCi0KrrkID9aKatsMRaeTVEEca1/nzPaPGgXAo6bEpfQ==
dependencies:
"@vueuse/core" "^9.12.0"
ant-design-vue "^3.2.15"
From 7ed42f8acc8df44b47a2cf5e1ff0c5fdf4d19afe Mon Sep 17 00:00:00 2001
From: JiangQiming <291854119@qq.com>
Date: Mon, 6 Mar 2023 11:29:56 +0800
Subject: [PATCH 4/4] =?UTF-8?q?update:=20=E6=90=9C=E7=B4=A2=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/media/Cascade/Channel/BindChannel/index.vue | 2 +-
src/views/media/Cascade/Channel/index.vue | 2 +-
src/views/media/Cascade/index.vue | 2 +-
src/views/media/Device/Channel/index.vue | 2 +-
src/views/media/Device/index.vue | 2 +-
src/views/notice/Config/Log/index.vue | 2 +-
src/views/notice/Config/index.vue | 2 +-
src/views/notice/Template/Log/index.vue | 2 +-
src/views/notice/Template/index.vue | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/views/media/Cascade/Channel/BindChannel/index.vue b/src/views/media/Cascade/Channel/BindChannel/index.vue
index 137a0b19..18145a37 100644
--- a/src/views/media/Cascade/Channel/BindChannel/index.vue
+++ b/src/views/media/Cascade/Channel/BindChannel/index.vue
@@ -10,7 +10,7 @@
@cancel="_vis = false"
:confirmLoading="loading"
>
-
-
-
-
-
-
-
-
-