Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
d63766fef6
|
@ -58,7 +58,7 @@
|
||||||
placeholder="请输入地址"
|
placeholder="请输入地址"
|
||||||
v-model:value="formData.pointKey"
|
v-model:value="formData.pointKey"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="999999999"
|
:max="999999"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
placeholder="请输入小数保留位数"
|
placeholder="请输入小数保留位数"
|
||||||
:min="0"
|
:min="0"
|
||||||
:max="255"
|
:max="65535"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
v-model:value="
|
v-model:value="
|
||||||
formData.configuration.codec.configuration.scale
|
formData.configuration.codec.configuration.scale
|
||||||
|
@ -222,7 +222,7 @@
|
||||||
v-model:value="formData.configuration.interval"
|
v-model:value="formData.configuration.interval"
|
||||||
addon-after="ms"
|
addon-after="ms"
|
||||||
:max="2147483648"
|
:max="2147483648"
|
||||||
:min="1"
|
:min="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
|
|
||||||
|
@ -380,8 +380,7 @@ const changeWriteByteCount = (value: Array<string>) => {
|
||||||
formData.value.configuration.parameter.writeByteCount = value[0];
|
formData.value.configuration.parameter.writeByteCount = value[0];
|
||||||
};
|
};
|
||||||
const changeFunction = (value: string) => {
|
const changeFunction = (value: string) => {
|
||||||
formData.value.accessModes =
|
formData.value.accessModes = ['InputRegisters', 'DiscreteInputs'].includes(value) ? ['read'] : ['read', 'write'];
|
||||||
value === 'InputRegisters' ? ['read'] : ['read', 'write'];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkProvider = (_rule: Rule, value: string): Promise<any> =>
|
const checkProvider = (_rule: Rule, value: string): Promise<any> =>
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
v-model:value="formData.configuration.interval"
|
v-model:value="formData.configuration.interval"
|
||||||
addon-after="ms"
|
addon-after="ms"
|
||||||
:max="2147483648"
|
:max="2147483648"
|
||||||
:min="1"
|
:min="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-form-item label="" :name="['features']">
|
<j-form-item label="" :name="['features']">
|
||||||
|
|
|
@ -111,6 +111,10 @@
|
||||||
'value',
|
'value',
|
||||||
]"
|
]"
|
||||||
:rules="[
|
:rules="[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
pattern: regOnlyNumber,
|
pattern: regOnlyNumber,
|
||||||
message: '请输入0或者正整数',
|
message: '请输入0或者正整数',
|
||||||
|
@ -126,7 +130,7 @@
|
||||||
allowClear
|
allowClear
|
||||||
addon-after="ms"
|
addon-after="ms"
|
||||||
:max="2147483647"
|
:max="2147483647"
|
||||||
:min="1"
|
:min="0"
|
||||||
:disabled="
|
:disabled="
|
||||||
index !== 0 &&
|
index !== 0 &&
|
||||||
record.configuration[dataIndex].check
|
record.configuration[dataIndex].check
|
||||||
|
@ -229,7 +233,7 @@ const checkLength = (_rule: Rule, value: string): Promise<any> =>
|
||||||
? reject('最多可输入64个字符')
|
? reject('最多可输入64个字符')
|
||||||
: resolve('');
|
: resolve('');
|
||||||
} else {
|
} else {
|
||||||
reject('请输入');
|
resolve('')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,8 @@
|
||||||
v-model:value="formData.interval"
|
v-model:value="formData.interval"
|
||||||
addon-after="ms"
|
addon-after="ms"
|
||||||
:max="2147483648"
|
:max="2147483648"
|
||||||
:min="1"
|
:min="0"
|
||||||
|
:precision="0"
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,8 @@ const handlUpdate = async (data: any) => {
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
handleSearch(params.value);
|
handleSearch(params.value);
|
||||||
|
const _item = collectorAll.value.find((i: any) => i?.id === selectedKeys.value?.[0])
|
||||||
|
emits('change', _item)
|
||||||
onlyMessage('操作成功', 'success');
|
onlyMessage('操作成功', 'success');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -146,13 +146,13 @@ import {
|
||||||
_undeploy,
|
_undeploy,
|
||||||
_deploy,
|
_deploy,
|
||||||
_delete,
|
_delete,
|
||||||
queryProductList,
|
|
||||||
queryTypes,
|
queryTypes,
|
||||||
} from '@/api/northbound/dueros';
|
} from '@/api/northbound/dueros';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { getImage, onlyMessage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
||||||
|
import { queryNoPagingPost } from '@/api/device/product';
|
||||||
|
|
||||||
const instanceRef = ref<Record<string, any>>({});
|
const instanceRef = ref<Record<string, any>>({});
|
||||||
const params = ref<Record<string, any>>({});
|
const params = ref<Record<string, any>>({});
|
||||||
|
@ -174,9 +174,10 @@ const columns = [
|
||||||
key: 'productName',
|
key: 'productName',
|
||||||
search: {
|
search: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
rename: 'id',
|
||||||
options: () =>
|
options: () =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
queryProductList().then((resp: any) => {
|
queryNoPagingPost({}).then((resp: any) => {
|
||||||
resolve(
|
resolve(
|
||||||
resp.result.map((item: any) => ({
|
resp.result.map((item: any) => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
<div class="label">通知流水:</div>
|
<div class="label">通知流水:</div>
|
||||||
<div style="padding: 10px; background-color: #fafafa">
|
<div style="padding: 10px; background-color: #fafafa">
|
||||||
<j-scrollbar height="200px">
|
<j-scrollbar height="200px">
|
||||||
<JsonViewer :value="JSON.parse(data?.alarmInfo || '{}')" />
|
<JsonViewer :value="data" />
|
||||||
</j-scrollbar>
|
</j-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -199,9 +199,9 @@ const getOptions = (arr: any[]) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [cycle, agg],
|
() => [cycle.value, agg.value, prop.time],
|
||||||
([newCycle, newAgg]) => {
|
([newCycle]) => {
|
||||||
if (newCycle.value === '*' && _type.value) {
|
if (newCycle === '*' && _type.value) {
|
||||||
queryChartsList();
|
queryChartsList();
|
||||||
} else {
|
} else {
|
||||||
queryChartsAggList();
|
queryChartsAggList();
|
||||||
|
|
|
@ -66,42 +66,44 @@
|
||||||
{{ slotProps.name }}
|
{{ slotProps.name }}
|
||||||
</h3>
|
</h3>
|
||||||
</Ellipsis>
|
</Ellipsis>
|
||||||
<j-row>
|
<div style="height: 95px">
|
||||||
<j-col :span="12" v-if="slotProps.channelInfo">
|
<j-row>
|
||||||
<div class="card-item-content-text">
|
<j-col :span="12" v-if="slotProps.channelInfo">
|
||||||
{{ slotProps.channelInfo?.name }}
|
<div class="card-item-content-text">
|
||||||
</div>
|
{{ slotProps.channelInfo?.name }}
|
||||||
<Ellipsis style="width: calc(100% - 20px)">
|
</div>
|
||||||
<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
|
getDescription(
|
||||||
? slotProps.channelInfo
|
slotProps,
|
||||||
?.addresses[0].address
|
)
|
||||||
: ''
|
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</Ellipsis>
|
</Ellipsis
|
||||||
</j-col>
|
>
|
||||||
<j-col :span="12">
|
</j-col>
|
||||||
<div class="card-item-content-text">协议</div>
|
</j-row>
|
||||||
<div>{{ slotProps.protocolDetail?.name }}</div>
|
</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>
|
|
||||||
</template>
|
</template>
|
||||||
</CardBox>
|
</CardBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
:hasPermission="`${permission}:update`"
|
:hasPermission="`${permission}:update`"
|
||||||
key="add"
|
key="add"
|
||||||
|
|
||||||
:disabled="hasOperate('add', type) || !editStatus"
|
:disabled="hasOperate('add', type)"
|
||||||
:tooltip="{
|
:tooltip="{
|
||||||
placement: hasOperate('add', type) ? 'topRight' : 'top',
|
placement: hasOperate('add', type) ? 'topRight' : 'top',
|
||||||
title: hasOperate('add', type)
|
title: hasOperate('add', type)
|
||||||
? '当前的存储方式不支持新增'
|
? '当前的存储方式不支持新增'
|
||||||
: !editStatus ? '暂无改动数据': '新增',
|
: '新增',
|
||||||
}"
|
}"
|
||||||
@click="handleAddClick()"
|
@click="handleAddClick()"
|
||||||
>
|
>
|
||||||
|
|
|
@ -87,7 +87,7 @@ import { bindScene } from '@/api/rule-engine/configuration';
|
||||||
import { getImage, onlyMessage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '场景名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
search: {
|
search: {
|
||||||
|
|
|
@ -15,19 +15,27 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">通知模板</div>
|
<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>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">模版内容</div>
|
<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>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">模板变量</div>
|
<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>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">用户权限</div>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -39,6 +47,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import ConfigApi from '@/api/notice/config';
|
import ConfigApi from '@/api/notice/config';
|
||||||
import TemplateApi from '@/api/notice/template';
|
import TemplateApi from '@/api/notice/template';
|
||||||
|
import { queryConfigVariables } from '@/api/system/noticeRule';
|
||||||
import { getRoleList_api } from '@/api/system/user';
|
import { getRoleList_api } from '@/api/system/user';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -48,6 +57,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
|
const builtInList = ref<any[]>([]);
|
||||||
|
|
||||||
const obj = reactive<{
|
const obj = reactive<{
|
||||||
notifier: string;
|
notifier: string;
|
||||||
|
@ -85,14 +95,42 @@ const handleSearch = async () => {
|
||||||
resp.result?.variableDefinitions?.length &&
|
resp.result?.variableDefinitions?.length &&
|
||||||
props.data?.channelConfiguration?.variables
|
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(
|
obj.variables = (resp.result?.variableDefinitions || []).map(
|
||||||
(item: any) => {
|
(item: any) => {
|
||||||
|
const _item =
|
||||||
|
config?.[
|
||||||
|
item?.id
|
||||||
|
];
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
value:
|
value: _item?.value || builtInList.value.find(i => _item.upperKey === i.id)?.name || _item.upperKey,
|
||||||
props.data?.channelConfiguration?.variables?.[
|
|
||||||
item?.id
|
|
||||||
]?.value || '',
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -149,7 +187,7 @@ onMounted(() => {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child{
|
&:last-child {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3837,8 +3837,8 @@ jetlinks-ui-components@^1.0.23:
|
||||||
|
|
||||||
jetlinks-ui-components@^1.0.24:
|
jetlinks-ui-components@^1.0.24:
|
||||||
version "1.0.24"
|
version "1.0.24"
|
||||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#42eea061b08a87f9bb58cb6a2f2dd94daa17499b"
|
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#bc536b4ebe5970804216be00fa2e636caf266b05"
|
||||||
integrity sha512-+QWKtOqAFs8TneJSE5dGswT3qZ/OHAz6U8AVzRAAict2r6FIYmSJ90CF4a3JTCRbF9yQ3rnhGnmUAMbyGR9BBQ==
|
integrity sha512-XsxAnU/0fmvhFm9CrYnLxwvpoXKOYnz9D1eA82e/qCqn2QGhiq6h84uuTAkS/hBWnbZurJkj2P5Pl+rnzXD4AA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@vueuse/core" "^9.12.0"
|
"@vueuse/core" "^9.12.0"
|
||||||
"@vueuse/router" "^9.13.0"
|
"@vueuse/router" "^9.13.0"
|
||||||
|
|
Loading…
Reference in New Issue