|
...
|
...
|
@@ -4,13 +4,15 @@ |
|
4
|
4
|
<template #toolbar>
|
|
5
|
5
|
<Authority :value="DeviceListAuthEnum.DELETE">
|
|
6
|
6
|
<Popconfirm
|
|
7
|
|
- title="您确定要批量删除数据"
|
|
8
|
|
- ok-text="确定"
|
|
9
|
|
- cancel-text="取消"
|
|
|
7
|
+ :title="t('common.batchDeleteConfirmText')"
|
|
|
8
|
+ :ok-text="t('common.okText')"
|
|
|
9
|
+ :cancel-text="t('common.cancelText')"
|
|
10
|
10
|
@confirm="handleDelete()"
|
|
11
|
11
|
:disabled="disabledDeleteFlag"
|
|
12
|
12
|
>
|
|
13
|
|
- <Button danger :disabled="disabledDeleteFlag"> 批量删除 </Button>
|
|
|
13
|
+ <Button danger :disabled="disabledDeleteFlag">
|
|
|
14
|
+ {{ t('common.batchDeleteText') }}
|
|
|
15
|
+ </Button>
|
|
14
|
16
|
</Popconfirm>
|
|
15
|
17
|
</Authority>
|
|
16
|
18
|
</template>
|
|
...
|
...
|
@@ -23,11 +25,11 @@ |
|
23
|
25
|
<TableAction
|
|
24
|
26
|
:actions="[
|
|
25
|
27
|
{
|
|
26
|
|
- label: '删除',
|
|
|
28
|
+ label: t('common.delText'),
|
|
27
|
29
|
auth: DeviceListAuthEnum.DETAIL,
|
|
28
|
30
|
icon: 'ant-design:eye-outlined',
|
|
29
|
31
|
popConfirm: {
|
|
30
|
|
- title: '是否确认删除',
|
|
|
32
|
+ title: t('common.deleteConfirmText'),
|
|
31
|
33
|
confirm: handleDelete.bind(null, record),
|
|
32
|
34
|
},
|
|
33
|
35
|
},
|
|
...
|
...
|
@@ -48,6 +50,8 @@ |
|
48
|
50
|
import { DeviceListAuthEnum } from '../../config/device.data';
|
|
49
|
51
|
import { Authority } from '/@/components/Authority';
|
|
50
|
52
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
53
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
54
|
+
|
|
51
|
55
|
export default defineComponent({
|
|
52
|
56
|
name: 'DeviceManagement',
|
|
53
|
57
|
components: {
|
|
...
|
...
|
@@ -65,6 +69,7 @@ |
|
65
|
69
|
},
|
|
66
|
70
|
emits: ['openTbDeviceDetail'],
|
|
67
|
71
|
setup(props, { emit }) {
|
|
|
72
|
+ const { t } = useI18n();
|
|
68
|
73
|
const [registerTable, { getSelectRowKeys, reload, setLoading }] = useTable({
|
|
69
|
74
|
api: getChildDevicePage,
|
|
70
|
75
|
columns: childDeviceColumns,
|
|
...
|
...
|
@@ -83,7 +88,7 @@ |
|
83
|
88
|
clickToRowSelect: false,
|
|
84
|
89
|
actionColumn: {
|
|
85
|
90
|
width: 200,
|
|
86
|
|
- title: '操作',
|
|
|
91
|
+ title: t('common.operateTable'),
|
|
87
|
92
|
slots: { customRender: 'action' },
|
|
88
|
93
|
fixed: 'right',
|
|
89
|
94
|
},
|
|
...
|
...
|
@@ -123,7 +128,7 @@ |
|
123
|
128
|
try {
|
|
124
|
129
|
setLoading(true);
|
|
125
|
130
|
await deleteDevice(ids);
|
|
126
|
|
- createMessage.success('删除成功');
|
|
|
131
|
+ createMessage.success(t('common.deleteSuccessText'));
|
|
127
|
132
|
reload();
|
|
128
|
133
|
} catch (error) {
|
|
129
|
134
|
throw error;
|
|
...
|
...
|
@@ -139,6 +144,7 @@ |
|
139
|
144
|
DeviceListAuthEnum,
|
|
140
|
145
|
handleDelete,
|
|
141
|
146
|
disabledDeleteFlag,
|
|
|
147
|
+ t,
|
|
142
|
148
|
};
|
|
143
|
149
|
},
|
|
144
|
150
|
});
|
...
|
...
|
|