Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
d63766fef6
|
@ -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> =>
|
||||
|
|
|
@ -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']">
|
||||
|
|
|
@ -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('')
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
v-model:value="formData.interval"
|
||||
addon-after="ms"
|
||||
:max="2147483648"
|
||||
:min="1"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
/>
|
||||
</j-form-item>
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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()"
|
||||
>
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue