|
@@ -3,6 +3,7 @@ import { onMounted, ref } from 'vue';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
|
|
|
import { useRequest } from '@/hooks/request';
|
|
|
+import { t } from '@/i18n';
|
|
|
import {
|
|
|
deviceGatewayUpdate,
|
|
|
gatewayLinkGetList,
|
|
@@ -26,124 +27,124 @@ import type {
|
|
|
|
|
|
const columns = [
|
|
|
{
|
|
|
- title: '关联网关参数',
|
|
|
+ title: t('createDevice.associationGatewayParameters'),
|
|
|
dataIndex: 'index',
|
|
|
key: 'index',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关序列号',
|
|
|
+ title: t('createDevice.gatewaySerialNumber'),
|
|
|
dataIndex: 'snCode',
|
|
|
key: 'snCode',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关型号',
|
|
|
+ title: t('createDevice.gatewayModel'),
|
|
|
dataIndex: 'modelName',
|
|
|
key: 'modelName',
|
|
|
},
|
|
|
{
|
|
|
- title: '物理接口',
|
|
|
+ title: t('createDevice.physicalInterface'),
|
|
|
dataIndex: 'linkName',
|
|
|
key: 'linkName',
|
|
|
},
|
|
|
{
|
|
|
- title: '组号',
|
|
|
+ title: t('createDevice.groupNumber'),
|
|
|
dataIndex: 'number',
|
|
|
key: 'interface',
|
|
|
},
|
|
|
{
|
|
|
- title: '参数',
|
|
|
+ title: t('createDevice.parameters'),
|
|
|
key: 'tags',
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('common.operation'),
|
|
|
key: 'action',
|
|
|
},
|
|
|
];
|
|
|
|
|
|
const devColumns = [
|
|
|
{
|
|
|
- title: '序列号',
|
|
|
+ title: t('common.serialNumber'),
|
|
|
dataIndex: 'index',
|
|
|
key: 'index',
|
|
|
},
|
|
|
{
|
|
|
- title: '设备参数编码',
|
|
|
+ title: t('createDevice.equipmentParameterCoding'),
|
|
|
dataIndex: 'deviceNum',
|
|
|
},
|
|
|
{
|
|
|
- title: '设备参数名称',
|
|
|
+ title: t('createDevice.equipmentParameterName'),
|
|
|
dataIndex: 'deviceName',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关参数序号',
|
|
|
+ title: t('createDevice.gatewayParameterSequenceNumber'),
|
|
|
dataIndex: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关参数编码',
|
|
|
+ title: t('createDevice.gatewayParameterEncoding'),
|
|
|
dataIndex: 'gatewayParamCode',
|
|
|
},
|
|
|
{
|
|
|
- title: '单位',
|
|
|
+ title: t('setupProtocol.protocolParamFields.unit'),
|
|
|
dataIndex: 'unit',
|
|
|
},
|
|
|
{
|
|
|
- title: '分组名称',
|
|
|
+ title: t('createDevice.groupName'),
|
|
|
dataIndex: 'module',
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('common.operation'),
|
|
|
key: 'action',
|
|
|
},
|
|
|
];
|
|
|
|
|
|
const customizationColumns = [
|
|
|
{
|
|
|
- title: '设备参数序号',
|
|
|
+ title: t('createDevice.equipmentSequenceNumber'),
|
|
|
dataIndex: 'index',
|
|
|
key: 'index',
|
|
|
},
|
|
|
{
|
|
|
- title: '设备参数编码',
|
|
|
+ title: t('createDevice.equipmentParameterCoding'),
|
|
|
dataIndex: 'name1',
|
|
|
key: 'name1',
|
|
|
},
|
|
|
{
|
|
|
- title: '设备参数名称',
|
|
|
+ title: t('createDevice.equipmentParameterName'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '自定义公式',
|
|
|
+ title: t('createDevice.customFormula'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '保留小数位',
|
|
|
+ title: t('createDevice.keepDecimalPlaces'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '分组名称',
|
|
|
+ title: t('createDevice.groupName'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '组别排序',
|
|
|
+ title: t('createDevice.groupRanking'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '组内排序',
|
|
|
+ title: t('createDevice.withinGroupRanking'),
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
},
|
|
|
{
|
|
|
- title: '是否过程数据',
|
|
|
+ title: t('createDevice.whetherProcessData'),
|
|
|
dataIndex: 'switch',
|
|
|
key: 'switch',
|
|
|
},
|
|
|
{
|
|
|
- title: '操作',
|
|
|
+ title: t('common.operation'),
|
|
|
dataIndex: 'action',
|
|
|
key: 'action',
|
|
|
},
|
|
@@ -151,17 +152,17 @@ const customizationColumns = [
|
|
|
|
|
|
const protocolEquipmentColumns = [
|
|
|
{
|
|
|
- title: '序列号',
|
|
|
+ title: t('common.serialNumber'),
|
|
|
dataIndex: 'index',
|
|
|
key: 'index',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关参数编码',
|
|
|
+ title: t('createDevice.gatewayParameterEncoding'),
|
|
|
dataIndex: 'gatewayParamCode',
|
|
|
key: 'gatewayParamCode',
|
|
|
},
|
|
|
{
|
|
|
- title: '网关参数名称',
|
|
|
+ title: t('setupProtocol.protocolParamFields.gatewayParamName'),
|
|
|
dataIndex: 'paramName',
|
|
|
key: 'paramName',
|
|
|
},
|
|
@@ -217,7 +218,7 @@ const selectParameters = (value: string) => {
|
|
|
open.value = true;
|
|
|
});
|
|
|
} else {
|
|
|
- message.warning('请选择物理接口');
|
|
|
+ message.warning(t('createDevice.pleasePhysicalInterface'));
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -341,13 +342,15 @@ onMounted(() => {
|
|
|
<template>
|
|
|
<div style="width: 1092px">
|
|
|
<div>
|
|
|
- <div class="use-guide-title">选择网关参数</div>
|
|
|
- <div class="use-guide-description" style="margin-bottom: 40px">在设备铭牌上可以找到SN码和设备密码</div>
|
|
|
+ <div class="use-guide-title">{{ $t('createDevice.selectGatewayParameters') }}</div>
|
|
|
+ <div class="use-guide-description" style="margin-bottom: 40px">描述文本</div>
|
|
|
<ADivider />
|
|
|
</div>
|
|
|
<AFlex justify="space-between" style="margin-bottom: 15px">
|
|
|
- <span class="header-text">关联网关参数</span>
|
|
|
- <AButton ghost style="color: #32bac0; border-color: #32bac0" @click="addGateway">新增</AButton>
|
|
|
+ <span class="header-text">{{ $t('createDevice.associationGatewayParameters') }}</span>
|
|
|
+ <AButton ghost style="color: #32bac0; border-color: #32bac0" @click="addGateway">{{
|
|
|
+ $t('common.newAddition')
|
|
|
+ }}</AButton>
|
|
|
</AFlex>
|
|
|
|
|
|
<div>
|
|
@@ -377,18 +380,20 @@ onMounted(() => {
|
|
|
</template>
|
|
|
|
|
|
<template v-if="column.key === 'tags'">
|
|
|
- <span class="select-parameters" @click="selectParameters(record.linkName)">选择参数</span>
|
|
|
+ <span class="select-parameters" @click="selectParameters(record.linkName)">{{
|
|
|
+ $t('createDevice.selectParameters')
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template v-if="column.key === 'action'">
|
|
|
- <AButton @click="gatewayDelete(index)">删除</AButton>
|
|
|
+ <AButton @click="gatewayDelete(index)">{{ $t('common.delete') }}</AButton>
|
|
|
</template>
|
|
|
</template>
|
|
|
</ATable>
|
|
|
</div>
|
|
|
|
|
|
<AFlex justify="space-between" style="margin-top: 40px; margin-bottom: 15px">
|
|
|
- <span class="header-text">关联网关参数</span>
|
|
|
- <AButton ghost style="color: #32bac0; border-color: #32bac0">分组设置</AButton>
|
|
|
+ <span class="header-text">{{ $t('createDevice.associationGatewayParameters') }}</span>
|
|
|
+ <AButton ghost style="color: #32bac0; border-color: #32bac0">{{ $t('createDevice.groupSettings') }}</AButton>
|
|
|
</AFlex>
|
|
|
<ATable :columns="devColumns" :data-source="gatewayData" :pagination="false">
|
|
|
<template #bodyCell="{ column, index }">
|
|
@@ -396,16 +401,18 @@ onMounted(() => {
|
|
|
{{ index + 1 }}
|
|
|
</template>
|
|
|
<template v-else-if="column.key === 'action'">
|
|
|
- <AButton @click="gatewayDevDelete(index)">删除</AButton>
|
|
|
+ <AButton @click="gatewayDevDelete(index)">{{ $t('common.delete') }}</AButton>
|
|
|
</template>
|
|
|
</template>
|
|
|
</ATable>
|
|
|
|
|
|
<AFlex justify="space-between" style="margin-top: 40px; margin-bottom: 15px">
|
|
|
- <span class="header-text">自定义监控参数</span>
|
|
|
+ <span class="header-text">{{ $t('createDevice.customizedMonitoringParameters') }}</span>
|
|
|
<div>
|
|
|
- <AButton ghost style="margin-right: 20px; color: #32bac0; border-color: #32bac0">新增</AButton>
|
|
|
- <AButton ghost style="color: #32bac0; border-color: #32bac0">快速匹配</AButton>
|
|
|
+ <AButton ghost style="margin-right: 20px; color: #32bac0; border-color: #32bac0">{{
|
|
|
+ $t('common.newAddition')
|
|
|
+ }}</AButton>
|
|
|
+ <AButton ghost style="color: #32bac0; border-color: #32bac0">{{ $t('createDevice.quickMatching') }}</AButton>
|
|
|
</div>
|
|
|
</AFlex>
|
|
|
|
|
@@ -418,14 +425,14 @@ onMounted(() => {
|
|
|
<ASwitch v-model:checked="record.switch" />
|
|
|
</template>
|
|
|
<template v-else-if="column.key === 'action'">
|
|
|
- <AButton>删除</AButton>
|
|
|
+ <AButton>{{ $t('common.delete') }}</AButton>
|
|
|
</template>
|
|
|
</template>
|
|
|
</ATable>
|
|
|
|
|
|
<AModal
|
|
|
v-model:open="open"
|
|
|
- title="选择网关协议参数"
|
|
|
+ :title="$t('createDevice.selectGatewayProtocolParameters')"
|
|
|
@ok="handleOk"
|
|
|
width="920px"
|
|
|
:mask-closable="false"
|
|
@@ -456,8 +463,8 @@ onMounted(() => {
|
|
|
|
|
|
<div class="gateway-parameters-right">
|
|
|
<AFlex justify="space-between" style="width: 100%; padding-bottom: 24px">
|
|
|
- <div>已选 ({{ equipmentLsit.length }}/80)</div>
|
|
|
- <div style="margin-right: 10px">删除</div>
|
|
|
+ <div>{{ $t('common.selected') }} ({{ equipmentLsit.length }}/80)</div>
|
|
|
+ <div style="margin-right: 10px">{{ $t('common.delete') }}</div>
|
|
|
</AFlex>
|
|
|
|
|
|
<AFlex :vertical="true" class="main-container" style="height: 390px">
|
|
@@ -468,7 +475,9 @@ onMounted(() => {
|
|
|
class="gateway-parameters-right-dev"
|
|
|
>
|
|
|
<span>{{ item.paramName }}</span>
|
|
|
- <span style="margin-right: 2px; cursor: pointer" @click="addEquipment(index)">删除</span>
|
|
|
+ <span style="margin-right: 2px; cursor: pointer" @click="addEquipment(index)">{{
|
|
|
+ $t('common.delete')
|
|
|
+ }}</span>
|
|
|
</AFlex>
|
|
|
</AFlex>
|
|
|
</div>
|