1
|
1
|
import { FormSchema } from '/@/components/Form';
|
2
|
2
|
import { findDictItemByCode } from '/@/api/system/dict';
|
3
|
|
-import { h, ref } from 'vue';
|
|
3
|
+import { h, ref, unref } from 'vue';
|
4
|
4
|
import { isExistDataManagerNameApi } from '/@/api/datamanager/dataManagerApi';
|
5
|
5
|
import { getDeviceProfile } from '/@/api/alarm/position';
|
6
|
6
|
import { BasicColumn, BasicTableProps } from '/@/components/Table';
|
...
|
...
|
@@ -8,6 +8,8 @@ import { devicePage } from '/@/api/device/deviceManager'; |
8
|
8
|
import { Tag } from 'ant-design-vue';
|
9
|
9
|
import { DeviceRecord } from '/@/api/device/model/deviceModel';
|
10
|
10
|
import { FETCH_SETTING } from '/@/components/Table/src/const';
|
|
11
|
+import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
12
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
11
|
13
|
|
12
|
14
|
const typeValue = ref('');
|
13
|
15
|
export enum CredentialsEnum {
|
...
|
...
|
@@ -100,7 +102,8 @@ const deviceTableFormSchema: FormSchema[] = [ |
100
|
102
|
},
|
101
|
103
|
},
|
102
|
104
|
];
|
103
|
|
-
|
|
105
|
+const { clipboardRef, isSuccessRef } = useCopyToClipboard();
|
|
106
|
+const { createMessage } = useMessage();
|
104
|
107
|
const deviceTableColumn: BasicColumn[] = [
|
105
|
108
|
{
|
106
|
109
|
title: '状态',
|
...
|
...
|
@@ -125,8 +128,20 @@ const deviceTableColumn: BasicColumn[] = [ |
125
|
128
|
dataIndex: 'name',
|
126
|
129
|
customRender: ({ record }) => {
|
127
|
130
|
return h('div', [
|
128
|
|
- h('div', `${record.alias}/${record.name}`),
|
129
|
|
- // h('div', { class: 'text-blue-400 truncate', title: record.sn }, record.sn),
|
|
131
|
+ h(
|
|
132
|
+ 'div',
|
|
133
|
+ {
|
|
134
|
+ class: 'cursor-pointer',
|
|
135
|
+ onClick: () => {
|
|
136
|
+ clipboardRef.value = record.name;
|
|
137
|
+ if (unref(isSuccessRef)) createMessage.success('复制成功~');
|
|
138
|
+ },
|
|
139
|
+ },
|
|
140
|
+ [
|
|
141
|
+ h('div', { class: 'text-blue-400 truncate' }, record.alias),
|
|
142
|
+ h('div', { class: 'text-blue-400 truncate' }, record.name),
|
|
143
|
+ ]
|
|
144
|
+ ),
|
130
|
145
|
]);
|
131
|
146
|
},
|
132
|
147
|
},
|
...
|
...
|
|