fix: 修改bug

This commit is contained in:
100011797 2023-07-12 20:56:13 +08:00
parent 8aeed477a9
commit 3a46d3e979
11 changed files with 105 additions and 58 deletions

View File

@ -58,7 +58,7 @@
placeholder="请输入地址"
v-model:value="formData.pointKey"
:min="0"
:max="999999999"
:max="999999"
:precision="0"
/>
</j-form-item>
@ -132,7 +132,7 @@
style="width: 100%"
placeholder="请输入小数保留位数"
:min="0"
:max="255"
:max="65535"
:precision="0"
v-model:value="
formData.configuration.codec.configuration.scale
@ -222,7 +222,7 @@
v-model:value="formData.configuration.interval"
addon-after="ms"
:max="2147483648"
:min="1"
:min="0"
/>
</j-form-item>
@ -380,8 +380,7 @@ const changeWriteByteCount = (value: Array<string>) => {
formData.value.configuration.parameter.writeByteCount = value[0];
};
const changeFunction = (value: string) => {
formData.value.accessModes =
value === 'InputRegisters' ? ['read'] : ['read', 'write'];
formData.value.accessModes = ['InputRegisters', 'DiscreteInputs'].includes(value) ? ['read'] : ['read', 'write'];
};
const checkProvider = (_rule: Rule, value: string): Promise<any> =>

View File

@ -59,7 +59,7 @@
v-model:value="formData.configuration.interval"
addon-after="ms"
:max="2147483648"
:min="1"
:min="0"
/>
</j-form-item>
<j-form-item label="" :name="['features']">

View File

@ -111,6 +111,10 @@
'value',
]"
:rules="[
{
required: true,
message: '请输入',
},
{
pattern: regOnlyNumber,
message: '请输入0或者正整数',
@ -126,7 +130,7 @@
allowClear
addon-after="ms"
:max="2147483647"
:min="1"
:min="0"
:disabled="
index !== 0 &&
record.configuration[dataIndex].check
@ -229,7 +233,7 @@ const checkLength = (_rule: Rule, value: string): Promise<any> =>
? reject('最多可输入64个字符')
: resolve('');
} else {
reject('请输入');
resolve('')
}
});

View File

@ -55,7 +55,8 @@
v-model:value="formData.interval"
addon-after="ms"
:max="2147483648"
:min="1"
:min="0"
:precision="0"
/>
</j-form-item>

View File

@ -190,6 +190,8 @@ const handlUpdate = async (data: any) => {
});
if (resp.status === 200) {
handleSearch(params.value);
const _item = collectorAll.value.find((i: any) => i?.id === selectedKeys.value?.[0])
emits('change', _item)
onlyMessage('操作成功', 'success');
}
};

View File

@ -146,13 +146,13 @@ import {
_undeploy,
_deploy,
_delete,
queryProductList,
queryTypes,
} from '@/api/northbound/dueros';
import type { ActionsType } from '@/views/device/Instance/typings';
import { getImage, onlyMessage } from '@/utils/comm';
import { useMenuStore } from 'store/menu';
import BadgeStatus from '@/components/BadgeStatus/index.vue';
import { queryNoPagingPost } from '@/api/device/product';
const instanceRef = ref<Record<string, any>>({});
const params = ref<Record<string, any>>({});
@ -174,9 +174,10 @@ const columns = [
key: 'productName',
search: {
type: 'select',
rename: 'id',
options: () =>
new Promise((resolve) => {
queryProductList().then((resp: any) => {
queryNoPagingPost({}).then((resp: any) => {
resolve(
resp.result.map((item: any) => ({
label: item.name,

View File

@ -61,7 +61,7 @@
<div class="label">通知流水:</div>
<div style="padding: 10px; background-color: #fafafa">
<j-scrollbar height="200px">
<JsonViewer :value="JSON.parse(data?.alarmInfo || '{}')" />
<JsonViewer :value="data" />
</j-scrollbar>
</div>
</div>

View File

@ -199,9 +199,9 @@ const getOptions = (arr: any[]) => {
};
watch(
() => [cycle, agg],
([newCycle, newAgg]) => {
if (newCycle.value === '*' && _type.value) {
() => [cycle.value, agg.value, prop.time],
([newCycle]) => {
if (newCycle === '*' && _type.value) {
queryChartsList();
} else {
queryChartsAggList();

View File

@ -66,6 +66,7 @@
{{ slotProps.name }}
</h3>
</Ellipsis>
<div style="height: 95px">
<j-row>
<j-col :span="12" v-if="slotProps.channelInfo">
<div class="card-item-content-text">
@ -102,6 +103,7 @@
>
</j-col>
</j-row>
</div>
</template>
</CardBox>
</template>

View File

@ -87,7 +87,7 @@ import { bindScene } from '@/api/rule-engine/configuration';
import { getImage, onlyMessage } from '@/utils/comm';
const columns = [
{
title: '名称',
title: '场景名称',
dataIndex: 'name',
key: 'name',
search: {

View File

@ -15,19 +15,27 @@
</div>
<div class="item">
<div class="label">通知模板</div>
<div class="value"><j-ellipsis :lineClamp="2">{{ obj.template }}</j-ellipsis></div>
<div class="value">
<j-ellipsis :lineClamp="2">{{ obj.template }}</j-ellipsis>
</div>
</div>
<div class="item">
<div class="label">模版内容</div>
<div class="value"><j-ellipsis :lineClamp="2">{{ obj.content }}</j-ellipsis></div>
<div class="value">
<j-ellipsis :lineClamp="2">{{ obj.content }}</j-ellipsis>
</div>
</div>
<div class="item">
<div class="label">模板变量</div>
<div class="value"><j-ellipsis :lineClamp="2">{{ variables }}</j-ellipsis></div>
<div class="value">
<j-ellipsis :lineClamp="2">{{ variables }}</j-ellipsis>
</div>
</div>
<div class="item">
<div class="label">用户权限</div>
<div class="value"><j-ellipsis :lineClamp="2">{{ obj.role }}</j-ellipsis></div>
<div class="value">
<j-ellipsis :lineClamp="2">{{ obj.role }}</j-ellipsis>
</div>
</div>
</div>
<template #footer>
@ -39,6 +47,7 @@
<script lang="ts" setup>
import ConfigApi from '@/api/notice/config';
import TemplateApi from '@/api/notice/template';
import { queryConfigVariables } from '@/api/system/noticeRule';
import { getRoleList_api } from '@/api/system/user';
const props = defineProps({
@ -48,6 +57,7 @@ const props = defineProps({
},
});
const emit = defineEmits(['close', 'save']);
const builtInList = ref<any[]>([]);
const obj = reactive<{
notifier: string;
@ -85,14 +95,42 @@ const handleSearch = async () => {
resp.result?.variableDefinitions?.length &&
props.data?.channelConfiguration?.variables
) {
const config = props.data?.channelConfiguration?.variables
const t = Object.keys(config)?.find(
(i: any) => config?.[i]?.source === 'upper',
);
if (t && !builtInList.value.length) {
const _variables = await queryConfigVariables(
props.data.providerId,
);
if (_variables.status === 200) {
// id
const _set = new Set(
(_variables.result as any[]).map(
(item) => item?.id,
),
);
const arr = [..._set.values()].map((item) => {
const _arr = (_variables.result as any[]).reverse();
return _arr.find((i) => i.id === item);
});
builtInList.value = arr.map((item) => {
return {
...item,
id: 'detail.' + item.id, // 便
};
});
}
}
obj.variables = (resp.result?.variableDefinitions || []).map(
(item: any) => {
const _item =
config?.[
item?.id
];
return {
name: item.name,
value:
props.data?.channelConfiguration?.variables?.[
item?.id
]?.value || '',
value: _item?.value || builtInList.value.find(i => _item.upperKey === i.id)?.name || _item.upperKey,
};
},
);
@ -149,7 +187,7 @@ onMounted(() => {
text-align: right;
}
&:last-child{
&:last-child {
border: none;
}
}