fix: bug#16782;修改数采值为COLLECTOR_GATEWAY;

This commit is contained in:
XieYongHong 2023-07-27 14:49:15 +08:00
parent 5205755817
commit 94a2a2c5ec
7 changed files with 24 additions and 24 deletions

View File

@ -55,5 +55,5 @@ export const USER_CENTER_MENU_BUTTON_CODE = 'user-center-passwd-update'
export const protocolList = [ export const protocolList = [
{ label: 'OPC-UA', value: 'OPC_UA', alias: 'opc-ua' }, { label: 'OPC-UA', value: 'OPC_UA', alias: 'opc-ua' },
{ label: 'Modbus/TCP', value: 'MODBUS_TCP', alias: 'modbus-tcp' }, { label: 'Modbus/TCP', value: 'MODBUS_TCP', alias: 'modbus-tcp' },
{ label: 'GATEWAY', value: 'GATEWAY', alias: 'collector-gateway' }, { label: 'GATEWAY', value: 'COLLECTOR_GATEWAY', alias: 'collector-gateway' },
] ]

View File

@ -93,7 +93,7 @@
/> />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
v-if="formData.provider === 'GATEWAY'" v-if="formData.provider === 'COLLECTOR_GATEWAY'"
:name="['configuration','deviceId']" :name="['configuration','deviceId']"
:rules="[{ required: true, message: '请选择网关设备'}]" :rules="[{ required: true, message: '请选择网关设备'}]"
label="选择网关设备" label="选择网关设备"
@ -235,7 +235,7 @@ const formData = ref<FormDataType>(cloneDeep(FormState));
const handleOk = async () => { const handleOk = async () => {
const params: any = await formRef.value?.validate(); const params: any = await formRef.value?.validate();
if (params?.provider === 'GATEWAY') { if (params?.provider === 'COLLECTOR_GATEWAY') {
params.configuration.deviceName = formData.value.configuration.deviceName params.configuration.deviceName = formData.value.configuration.deviceName
} }

View File

@ -347,7 +347,7 @@ const handleOk = async () => {
address: data?.pointKey, address: data?.pointKey,
}; };
if (props.data.provider === 'GATEWAY') { if (props.data.provider === 'COLLECTOR_GATEWAY') {
const configuration = cloneDeep(params.configuration) const configuration = cloneDeep(params.configuration)
params.configuration = { params.configuration = {
configuration: configuration, configuration: configuration,
@ -447,12 +447,12 @@ watch(
watch( watch(
() => props.data, () => props.data,
(value) => { (value) => {
if (value.id && ['MODBUS_TCP', 'GATEWAY'].includes(value.provider)) { if (value.id && ['MODBUS_TCP', 'COLLECTOR_GATEWAY'].includes(value.provider)) {
const _value: any = cloneDeep(value); const _value: any = cloneDeep(value);
const { writeByteCount, byteCount } = const { writeByteCount, byteCount } =
props.data.provider === 'GATEWAY' ? _value.configuration.configuration.parameter: _value.configuration.parameter; props.data.provider === 'COLLECTOR_GATEWAY' ? _value.configuration.configuration.parameter: _value.configuration.parameter;
if (props.data.provider === 'GATEWAY') { if (props.data.provider === 'COLLECTOR_GATEWAY') {
formData.value = { formData.value = {
...omit(_value, ['configuration']), ...omit(_value, ['configuration']),
..._value.configuration, ..._value.configuration,

View File

@ -20,7 +20,7 @@
<template #headerTitle> <template #headerTitle>
<j-space> <j-space>
<PermissionButton <PermissionButton
v-if="['MODBUS_TCP', 'GATEWAY'].includes(data?.provider)" v-if="['MODBUS_TCP', 'COLLECTOR_GATEWAY'].includes(data?.provider)"
type="primary" type="primary"
@click="handlAdd" @click="handlAdd"
hasPermission="DataCollect/Collector:add" hasPermission="DataCollect/Collector:add"

View File

@ -41,7 +41,7 @@
/> />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
v-if="provider === 'GATEWAY'" v-if="provider === 'COLLECTOR_GATEWAY'"
label="通讯协议" label="通讯协议"
:name="['collectorProvider']" :name="['collectorProvider']"
:rules="[{ required: true, message: '请选择通讯协议' }]" :rules="[{ required: true, message: '请选择通讯协议' }]"
@ -72,7 +72,7 @@
/> />
</j-form-item> </j-form-item>
<j-form-item <j-form-item
v-if="provider !== 'GATEWAY'" v-if="provider !== 'COLLECTOR_GATEWAY'"
:name="['configuration', 'inheritBreakerSpec', 'type']" :name="['configuration', 'inheritBreakerSpec', 'type']"
:rules="LeftTreeRules.type" :rules="LeftTreeRules.type"
label="点位熔断处理" label="点位熔断处理"
@ -88,7 +88,7 @@
@change="changeCardSelectType" @change="changeCardSelectType"
/> />
</j-form-item> </j-form-item>
<p style="color: #616161" v-if="provider !== 'GATEWAY'"> <p style="color: #616161" v-if="provider !== 'COLLECTOR_GATEWAY'">
{{ getTypeTooltip(formData.configuration.inheritBreakerSpec.type) }} {{ getTypeTooltip(formData.configuration.inheritBreakerSpec.type) }}
</p> </p>
<j-form-item <j-form-item
@ -273,7 +273,7 @@ const handleOk = async () => {
let _copyData = _data let _copyData = _data
if (['GATEWAY'].includes(provider.value)) { if (['COLLECTOR_GATEWAY'].includes(provider.value)) {
const copyData = cloneDeep(_data) const copyData = cloneDeep(_data)
_copyData = omit(copyData, ['configuration', 'collectorProvider']) _copyData = omit(copyData, ['configuration', 'collectorProvider'])
@ -345,7 +345,7 @@ watch(
(value) => { (value) => {
const dt = _channelListAll.value.find((item) => item.id === value); const dt = _channelListAll.value.find((item) => item.id === value);
visibleUnitId.value = visibleEndian.value = visibleUnitId.value = visibleEndian.value =
dt?.provider && ['MODBUS_TCP', 'GATEWAY'].includes(dt?.provider); dt?.provider && ['MODBUS_TCP', 'COLLECTOR_GATEWAY'].includes(dt?.provider);
}, },
{ deep: true }, { deep: true },
); );
@ -355,7 +355,7 @@ watch(
(value) => { (value) => {
if (value.id) { if (value.id) {
let copyValue = cloneDeep(value) let copyValue = cloneDeep(value)
if (!copyValue?.configuration?.inheritBreakerSpec && copyValue.provider !== 'GATEWAY') { if (!copyValue?.configuration?.inheritBreakerSpec && copyValue.provider !== 'COLLECTOR_GATEWAY') {
copyValue.configuration = { copyValue.configuration = {
...copyValue.configuration, ...copyValue.configuration,
inheritBreakerSpec: { inheritBreakerSpec: {
@ -365,7 +365,7 @@ watch(
copyValue.circuitBreaker.type = 'Ignore' copyValue.circuitBreaker.type = 'Ignore'
} }
if (copyValue.provider === 'GATEWAY') { if (copyValue.provider === 'COLLECTOR_GATEWAY') {
formData.value = { formData.value = {
...omit(copyValue, ['configuration']), ...omit(copyValue, ['configuration']),
...copyValue.configuration, ...copyValue.configuration,
@ -381,7 +381,7 @@ watch(
); );
watchEffect(() => { watchEffect(() => {
if (provider.value === 'GATEWAY') { if (provider.value === 'COLLECTOR_GATEWAY') {
geyProviderList() geyProviderList()
} }
}) })

View File

@ -104,12 +104,12 @@ const handleData = (data: any[], type: string) => {
const handleSearch = async () => { const handleSearch = async () => {
loading.value = true; loading.value = true;
const resp = await treeMapping({ const resp = await treeMapping({
terms: [ // terms: [
{ // {
column: 'provider', // column: 'provider',
value: _props.type, // value: _props.type,
}, // },
], // ],
}); });
loading.value = false; loading.value = false;
if (resp.status === 200) { if (resp.status === 200) {

View File

@ -94,9 +94,9 @@ export default defineConfig(({ mode}) => {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
// target: 'http://192.168.32.226:8844', // target: 'http://192.168.32.226:8844',
// target: 'http://192.168.32.244:8881', // target: 'http://192.168.32.244:8881',
// target: 'http://192.168.32.163:8844', //张季本地 target: 'http://192.168.32.163:8844', //张季本地
// target: 'http://120.77.179.54:8844', // 120测试 // target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境 // target: 'http://192.168.33.46:8844', // 本地开发环境
ws: 'ws://192.168.33.46:8844', ws: 'ws://192.168.33.46:8844',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')