+
-
-
-
+
+
+
{
showType.value = param.type;
provider.value = param;
type.value = false;
- console.log(1123, showType.value, param);
};
const goBack = () => {
@@ -61,80 +72,77 @@ const goBack = () => {
type.value = true;
};
+const getTypeList = (result: any[]) => {
+ const list = [];
+ const media: any[] = [];
+ const network: any[] = [];
+ const cloud: any[] = [];
+ const channel: any[] = [];
+ const edge: any[] = [];
+ result.map((item) => {
+ if (item.id === 'fixed-media' || item.id === 'gb28181-2016') {
+ item.type = 'media';
+ media.push(item);
+ } else if (item.id === 'OneNet' || item.id === 'Ctwing') {
+ item.type = 'cloud';
+ cloud.push(item);
+ } else if (item.id === 'modbus-tcp' || item.id === 'opc-ua') {
+ item.type = 'channel';
+ channel.push(item);
+ } else if (
+ item.id === 'official-edge-gateway' ||
+ item.id === 'edge-child-device'
+ ) {
+ item.type = 'edge';
+ edge.push(item);
+ } else {
+ item.type = 'network';
+ network.push(item);
+ }
+ });
+
+ network.length &&
+ list.push({
+ list: [...network],
+ title: '自定义设备接入',
+ });
+ media.length &&
+ list.push({
+ list: [...media],
+ title: '视频类设备接入',
+ });
+ cloud.length &&
+ list.push({
+ list: [...cloud],
+ title: '云平台接入',
+ });
+ channel.length &&
+ list.push({
+ list: [...channel],
+ title: '通道类设备接入',
+ });
+ edge.length &&
+ list.push({
+ list: [...edge],
+ title: '官方接入',
+ });
+
+ return list;
+};
+
const queryProviders = async () => {
const resp = await getProviders();
if (resp.status === 200) {
- const media: any[] = [];
- const network: any[] = [];
- const cloud: any[] = [];
- const channel: any[] = [];
- const edge: any[] = [];
- resp.result.map((item) => {
- if (item.id === 'fixed-media' || item.id === 'gb28181-2016') {
- item.type = 'media';
- media.push(item);
- } else if (item.id === 'OneNet' || item.id === 'Ctwing') {
- item.type = 'cloud';
- cloud.push(item);
- } else if (item.id === 'modbus-tcp' || item.id === 'opc-ua') {
- item.type = 'channel';
- channel.push(item);
- } else if (
- item.id === 'official-edge-gateway' ||
- item.id === 'edge-child-device'
- ) {
- item.type = 'edge';
- edge.push(item);
- } else {
- item.type = 'network';
- network.push(item);
- }
- });
- const list = [];
- if (network.length) {
- list.push({
- // type: 'network',
- list: [...network],
- title: '自定义设备接入',
- });
- }
- if (media.length) {
- list.push({
- // type: 'media',
- list: [...media],
- title: '视频类设备接入',
- });
- }
- if (cloud.length) {
- list.push({
- // type: 'cloud',
- list: [...cloud],
- title: '云平台接入',
- });
- }
- if (channel.length) {
- list.push({
- // type: 'channel',
- list: [...channel],
- title: '通道类设备接入',
- });
- }
- if (edge.length) {
- list.push({
- // type: 'edge',
- list: [...edge],
- title: '官方接入',
- });
- }
- dataSource.value = list;
+ dataSource.value = getTypeList(resp.result);
}
};
const getProvidersData = async () => {
- if (id) {
+ if (id && modeType !== 'add') {
getProviders().then((response) => {
if (response.status === 200) {
- dataSource.value = response.result.filter(
+ const list = getTypeList(response.result);
+ dataSource.value = list.filter(
(item) =>
item.channel === 'network' ||
item.channel === 'child-device',
@@ -144,15 +152,21 @@ const getProvidersData = async () => {
const dt = response.result.find(
(item) => item?.id === resp.result.provider,
);
+
+ response.result.forEach((item) => {
+ if (item.id === resp.result.provider) {
+ resp.result.type = item.type;
+ showType.value = item.type;
+ }
+ });
+
provider.value = dt;
data.value = resp.result;
type.value = false;
}
});
- loading.value = false;
- } else {
- loading.value = false;
}
+ loading.value = false;
});
} else {
type.value = true;
diff --git a/src/views/link/AccessConfig/components/Channel/index.vue b/src/views/link/AccessConfig/components/Channel/index.vue
index 15b30253..8e8ffd74 100644
--- a/src/views/link/AccessConfig/components/Channel/index.vue
+++ b/src/views/link/AccessConfig/components/Channel/index.vue
@@ -39,7 +39,10 @@
/>
- 保存
@@ -93,18 +96,23 @@ interface FormState {
description: string;
}
const route = useRoute();
-const id = route.query.id;
+const modeType = route.params.type as string;
+const id = route.params.id as string;
const props = defineProps({
provider: {
type: Object,
default: () => {},
},
+ data: {
+ type: Object,
+ default: () => {},
+ },
});
const type = ref(props.provider.type);
-const formState = reactive({
+const formState = ref({
name: '',
description: '',
});
@@ -117,7 +125,10 @@ const onFinish = async (values: any) => {
transport: ProtocolMapping.get(providerId),
channel: providerId === 'modbus-tcp' ? 'modbus' : 'opc-ua',
};
- const resp = !!id ? await update({ ...params, id }) : await save(params);
+ const resp =
+ !!id && modeType !== 'add'
+ ? await update({ ...params, id })
+ : await save(params);
if (resp.status === 200) {
message.success('操作成功!');
// if (params.get('save')) {
@@ -132,6 +143,15 @@ const onFinish = async (values: any) => {
// }
}
};
+
+onMounted(() => {
+ if (modeType !== 'add') {
+ formState.value = {
+ name: props.data.name,
+ description: props.data?.description || '',
+ };
+ }
+});
\ No newline at end of file
+
diff --git a/src/views/system/Menu/components/ButtonAddDialog.vue b/src/views/system/Menu/components/ButtonAddDialog.vue
new file mode 100644
index 00000000..0099a601
--- /dev/null
+++ b/src/views/system/Menu/components/ButtonAddDialog.vue
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/Menu/components/PermissChoose.vue b/src/views/system/Menu/components/PermissChoose.vue
index b4abf16f..2657443e 100644
--- a/src/views/system/Menu/components/PermissChoose.vue
+++ b/src/views/system/Menu/components/PermissChoose.vue
@@ -5,43 +5,207 @@
style="width: 300px"
allowClear
placeholder="请输入权限名称"
+ @input="search.search"
/>
-
-
+
+
+ 权限名称权限操作
+
+
+
+
+ permission.selectAllOpions(rowItem)"
+ >
+ {{ rowItem.name }}
+
+
+
+ permission.selectOption(rowItem, checkValue))"
+ />
+
+
+
+
-
+
diff --git a/src/views/system/Menu/index.vue b/src/views/system/Menu/index.vue
index 648b29cc..c218aa80 100644
--- a/src/views/system/Menu/index.vue
+++ b/src/views/system/Menu/index.vue
@@ -19,7 +19,7 @@
菜单实例
- {{ slotProps.createTime }}
+ {{ moment(slotProps.createTime).format('YYYY-MM-DD HH:mm:ss') }}
@@ -30,7 +30,7 @@
type="link"
@click="table.toDetails(slotProps)"
>
-
+
@@ -40,7 +40,7 @@
type="link"
@click="table.toDetails(slotProps)"
>
-
+
@@ -66,6 +66,13 @@
\ No newline at end of file
diff --git a/src/views/device/components/Metadata/Cat/index.vue b/src/views/device/components/Metadata/Cat/index.vue
index e0292159..bde3f7fd 100644
--- a/src/views/device/components/Metadata/Cat/index.vue
+++ b/src/views/device/components/Metadata/Cat/index.vue
@@ -19,7 +19,7 @@
- {{ value }}
+
diff --git a/src/views/device/components/Metadata/Import/index.vue b/src/views/device/components/Metadata/Import/index.vue
index 5fcf73d7..eb5de412 100644
--- a/src/views/device/components/Metadata/Import/index.vue
+++ b/src/views/device/components/Metadata/Import/index.vue
@@ -36,7 +36,7 @@
+ :headers="{ 'X-Access-Token': getToken()}">
@@ -45,7 +45,7 @@
-
+
@@ -64,8 +64,8 @@ import { useInstanceStore } from '@/store/instance'
import { useProductStore } from '@/store/product';
import { UploadOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { FILE_UPLOAD } from '@/api/comm';
-import { LocalStore } from '@/utils/comm';
-import { TOKEN_KEY } from '@/utils/variable';
+import { LocalStore, getToken } from '@/utils/comm';
+import MonacoEditor from '@/components/MonacoEditor/index.vue'
const route = useRoute()
const instanceStore = useInstanceStore()
@@ -147,7 +147,6 @@ const onSubmit = () => {
})
}
const fileList = ref([])
-const token = ref(LocalStore.get(TOKEN_KEY));
const productList = ref([])
diff --git a/src/views/device/components/Metadata/index.vue b/src/views/device/components/Metadata/index.vue
index 9250a832..e592d304 100644
--- a/src/views/device/components/Metadata/index.vue
+++ b/src/views/device/components/Metadata/index.vue
@@ -32,16 +32,16 @@
-
+
-
+
-
+
-
+
@@ -58,6 +58,7 @@ import { SystemConst } from '@/utils/consts'
import { useInstanceStore } from '@/store/instance'
import Import from './Import/index.vue'
import Cat from './Cat/index.vue'
+import BaseMetadata from './Base/index.vue'
const route = useRoute()
const instanceStore = useInstanceStore()
From c55d3cd0de8265528fcdb32abfecfe2695883328 Mon Sep 17 00:00:00 2001
From: easy <1358086367@qq.com>
Date: Tue, 31 Jan 2023 18:25:51 +0800
Subject: [PATCH 09/14] =?UTF-8?q?update:=20=E5=88=A0=E9=99=A4=E5=A4=9A?=
=?UTF-8?q?=E4=BD=99=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/Menu/index.d.ts | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 src/views/system/Menu/index.d.ts
diff --git a/src/views/system/Menu/index.d.ts b/src/views/system/Menu/index.d.ts
deleted file mode 100644
index e69de29b..00000000
From 53dd9322931791c9c06e01633d2567acf4d3818d Mon Sep 17 00:00:00 2001
From: 100011797 <2642441182@qq.com>
Date: Wed, 1 Feb 2023 09:45:28 +0800
Subject: [PATCH 10/14] =?UTF-8?q?fix:=20JTable=E7=9A=84=E5=88=87=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Table/index.module.less | 24 +-
src/components/Table/index.tsx | 27 +-
src/views/device/Instance/index.vue | 437 +++++++++++++------------
3 files changed, 259 insertions(+), 229 deletions(-)
diff --git a/src/components/Table/index.module.less b/src/components/Table/index.module.less
index a0e94e07..98a53a92 100644
--- a/src/components/Table/index.module.less
+++ b/src/components/Table/index.module.less
@@ -10,17 +10,23 @@
.jtable-body-header-right {
display: flex;
gap: 8px;
- .jtable-setting-item {
- color: rgba(0, 0, 0, 0.75);
- font-size: 16px;
- cursor: pointer;
+ align-items: center;
+ .jtable-body-header-right-button {
+ display: flex;
+ margin-left: 10px;
+ gap: 8px;
+ .jtable-setting-item {
+ color: rgba(0, 0, 0, 0.75);
+ font-size: 16px;
+ cursor: pointer;
- &:hover {
- color: @primary-color-hover;
- }
+ &:hover {
+ color: @primary-color-hover;
+ }
- &.active {
- color: @primary-color-active;
+ &.active {
+ color: @primary-color-active;
+ }
}
}
}
diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx
index fb778495..774b95b8 100644
--- a/src/components/Table/index.tsx
+++ b/src/components/Table/index.tsx
@@ -73,6 +73,7 @@ const JTable = defineComponent({
slots: [
'headerTitle', // 顶部左边插槽
'card', // 卡片内容
+ 'rightExtraRender'
],
emits: [
'modelChange', // 切换卡片和表格
@@ -254,16 +255,22 @@ const JTable = defineComponent({
{slots.headerTitle && slots.headerTitle()}
-
{
- _model.value = ModelEnum.CARD
- }}>
-
-
-
{
- _model.value = ModelEnum.TABLE
- }}>
-
-
+ {/* 顶部右边插槽 */}
+ {slots.rightExtraRender && slots.rightExtraRender()}
+ {
+ !props.model &&
+
{
+ _model.value = ModelEnum.CARD
+ }}>
+
+
+
{
+ _model.value = ModelEnum.TABLE
+ }}>
+
+
+
+ }
{/* content */}
diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue
index 11656160..4792f526 100644
--- a/src/views/device/Instance/index.vue
+++ b/src/views/device/Instance/index.vue
@@ -1,222 +1,234 @@