Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
leiqiaochu 2023-07-13 09:29:30 +08:00
commit d63766fef6
13 changed files with 109 additions and 62 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,42 +66,44 @@
{{ slotProps.name }}
</h3>
</Ellipsis>
<j-row>
<j-col :span="12" v-if="slotProps.channelInfo">
<div class="card-item-content-text">
{{ slotProps.channelInfo?.name }}
</div>
<Ellipsis style="width: calc(100% - 20px)">
<div>
<div style="height: 95px">
<j-row>
<j-col :span="12" v-if="slotProps.channelInfo">
<div class="card-item-content-text">
{{ slotProps.channelInfo?.name }}
</div>
<Ellipsis style="width: calc(100% - 20px)">
<div>
{{
slotProps.channelInfo?.addresses
? slotProps.channelInfo
?.addresses[0].address
: ''
}}
</div>
</Ellipsis>
</j-col>
<j-col :span="12">
<div class="card-item-content-text">协议</div>
<div>{{ slotProps.protocolDetail?.name }}</div>
</j-col>
</j-row>
<j-row>
<j-col :span="24">
<Ellipsis style="width: calc(100% - 50px)"
>
<div class="context-access">
{{
slotProps.channelInfo?.addresses
? slotProps.channelInfo
?.addresses[0].address
: ''
getDescription(
slotProps,
)
}}
</div>
</Ellipsis>
</j-col>
<j-col :span="12">
<div class="card-item-content-text">协议</div>
<div>{{ slotProps.protocolDetail?.name }}</div>
</j-col>
</j-row>
<j-row>
<j-col :span="24">
<Ellipsis style="width: calc(100% - 50px)"
>
<div class="context-access">
{{
getDescription(
slotProps,
)
}}
</div>
</Ellipsis
>
</j-col>
</j-row>
</Ellipsis
>
</j-col>
</j-row>
</div>
</template>
</CardBox>
</template>

View File

@ -17,12 +17,12 @@
:hasPermission="`${permission}:update`"
key="add"
:disabled="hasOperate('add', type) || !editStatus"
:disabled="hasOperate('add', type)"
:tooltip="{
placement: hasOperate('add', type) ? 'topRight' : 'top',
title: hasOperate('add', type)
? '当前的存储方式不支持新增'
: !editStatus ? '暂无改动数据': '新增',
: '新增',
}"
@click="handleAddClick()"
>

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;
}
}

View File

@ -3837,8 +3837,8 @@ jetlinks-ui-components@^1.0.23:
jetlinks-ui-components@^1.0.24:
version "1.0.24"
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#42eea061b08a87f9bb58cb6a2f2dd94daa17499b"
integrity sha512-+QWKtOqAFs8TneJSE5dGswT3qZ/OHAz6U8AVzRAAict2r6FIYmSJ90CF4a3JTCRbF9yQ3rnhGnmUAMbyGR9BBQ==
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#bc536b4ebe5970804216be00fa2e636caf266b05"
integrity sha512-XsxAnU/0fmvhFm9CrYnLxwvpoXKOYnz9D1eA82e/qCqn2QGhiq6h84uuTAkS/hBWnbZurJkj2P5Pl+rnzXD4AA==
dependencies:
"@vueuse/core" "^9.12.0"
"@vueuse/router" "^9.13.0"