Merge branch 'dev'
# Conflicts: # src/components/Layout/components/Notice.vue # src/views/account/Center/components/data.ts # src/views/device/Instance/Detail/Running/Property/Detail/Charts.vue # src/views/device/Product/index.vue # src/views/device/components/Metadata/Import/index.vue # src/views/device/components/Metadata/Import/valideta.ts # src/views/rule-engine/Scene/Save/action/Device/actions/index.vue # src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue # src/views/system/Menu/Detail/BasicInfo.vue # src/views/system/NoticeRule/components/Save/index.vue
This commit is contained in:
commit
8600bbee98
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -529,7 +529,7 @@ export const getPropertiesInfo = (deviceId: string, data: Record<string, unknown
|
||||||
* @param data
|
* @param data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const getPropertiesList = (deviceId: string, property: string, data: Record<string, unknown>) => server.post(`/device-instance/${deviceId}/property/${property}/_query`, data)
|
export const getPropertiesList = (deviceId: string, property: string, data: Record<string, unknown>) => server.post(`/device-instance/${deviceId}/property/${property}/_query/no-paging`, data)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取指定协议
|
* 获取指定协议
|
||||||
|
|
|
@ -37,7 +37,6 @@ const total = ref(0);
|
||||||
// const list = ref<any[]>([]);
|
// const list = ref<any[]>([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
|
||||||
const subscribeNotice = () => {
|
const subscribeNotice = () => {
|
||||||
getWebSocket('notification', '/notifications', {})
|
getWebSocket('notification', '/notifications', {})
|
||||||
?.pipe()
|
?.pipe()
|
||||||
|
@ -88,9 +87,8 @@ const subscribeNotice = () => {
|
||||||
const read = (type: string, data: any) => {
|
const read = (type: string, data: any) => {
|
||||||
changeStatus_api('_read', [data.payload.id]).then((resp: any) => {
|
changeStatus_api('_read', [data.payload.id]).then((resp: any) => {
|
||||||
if (resp.status !== 200) return;
|
if (resp.status !== 200) return;
|
||||||
// notification.close(data.payload.id);
|
notification.close(data.payload.id);
|
||||||
getList();
|
getList();
|
||||||
console.log(data,type)
|
|
||||||
if (type !== '_read') {
|
if (type !== '_read') {
|
||||||
menuStory.routerPush('account/center', {
|
menuStory.routerPush('account/center', {
|
||||||
tabKey: 'StationMessage',
|
tabKey: 'StationMessage',
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@ok="ok"
|
@ok="ok"
|
||||||
:confirmLoading="loading"
|
:confirmLoading="loading"
|
||||||
|
:maskClosable="false"
|
||||||
>
|
>
|
||||||
<div style="height: 300px; width: 100%;">
|
<div style="height: 300px; width: 100%;">
|
||||||
<vue-cropper
|
<vue-cropper
|
||||||
|
|
|
@ -86,4 +86,5 @@ const workflowNotice = [
|
||||||
]
|
]
|
||||||
export const getInitData = () =>{
|
export const getInitData = () =>{
|
||||||
return menuStore.hasMenu('process') ? [...systemNotice,...workflowNotice] : [...systemNotice]
|
return menuStore.hasMenu('process') ? [...systemNotice,...workflowNotice] : [...systemNotice]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,9 @@
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:icon="{
|
:icon="{
|
||||||
image: 'https://a.amap.com/jsapi_demos/static/images/poi-marker.png',
|
image: '/images/marker.png',
|
||||||
anchor: 'bottom-center',
|
anchor: 'bottom-center',
|
||||||
size: [25, 34],
|
size: [25, 34],
|
||||||
clipOrigin: [459, 92],
|
|
||||||
clipSize: [50, 68],
|
|
||||||
}"
|
}"
|
||||||
></el-amap-label-marker
|
></el-amap-label-marker
|
||||||
>
|
>
|
||||||
|
@ -35,6 +33,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import AmapComponent from '@/components/AMapComponent/index.vue';
|
import AmapComponent from '@/components/AMapComponent/index.vue';
|
||||||
import { getGo } from '@/api/device/dashboard';
|
import { getGo } from '@/api/device/dashboard';
|
||||||
|
import { getImage } from '@/utils/comm';
|
||||||
let point = ref();
|
let point = ref();
|
||||||
const getMapData = async () => {
|
const getMapData = async () => {
|
||||||
const res = await getGo({
|
const res = await getGo({
|
||||||
|
|
|
@ -19,13 +19,17 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<j-form layout="vertical" ref="formRef" :model="modelRef">
|
<j-form layout="vertical" ref="formRef" :model="modelRef">
|
||||||
<template v-for="(item, index) in (props.config || [])" :key="index">
|
<template v-for="(item, index) in props.config || []" :key="index">
|
||||||
<j-form-item
|
<j-form-item
|
||||||
v-for="i in item.properties"
|
v-for="i in item.properties"
|
||||||
:name="i.property"
|
:name="i.property"
|
||||||
:key="i.property"
|
:key="i.property"
|
||||||
:required='!!i.type.expands?.required'
|
:required="!!i.type.expands?.required"
|
||||||
:rules='!!i.type.expands?.required ? [{ required: true, message: `请输入${i.name}`}] :[]'
|
:rules="
|
||||||
|
!!i.type.expands?.required
|
||||||
|
? [{ required: true, message: `请输入${i.name}` }]
|
||||||
|
: []
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<span style="margin-right: 5px">{{ i.name }}</span>
|
<span style="margin-right: 5px">{{ i.name }}</span>
|
||||||
|
@ -36,16 +40,7 @@
|
||||||
<ValueItem
|
<ValueItem
|
||||||
v-model:modelValue="modelRef[i.property]"
|
v-model:modelValue="modelRef[i.property]"
|
||||||
:itemType="i.type.type"
|
:itemType="i.type.type"
|
||||||
:options="
|
:options="getOptions(i)"
|
||||||
i.type.type === 'enum'
|
|
||||||
? (i.type?.elements || []).map((item) => {
|
|
||||||
return {
|
|
||||||
label: item?.text,
|
|
||||||
value: item?.value,
|
|
||||||
};
|
|
||||||
})
|
|
||||||
: undefined
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
@ -68,23 +63,44 @@ const instanceStore = useInstanceStore();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
config: {
|
config: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: [],
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
const getOptions = (i: any) => {
|
||||||
const obj = instanceStore.current?.configuration
|
if (i.type.type === 'enum') {
|
||||||
if(obj && Object.keys(obj).length) {
|
return (i.type?.elements || []).map((item) => {
|
||||||
(props?.config || []).map((item: any) => {
|
return {
|
||||||
if(Array.isArray(item.properties) && item?.properties.length){
|
label: item?.text,
|
||||||
item.properties.map((i: any) => {
|
value: item?.value,
|
||||||
modelRef[i.property] = obj[i.property]
|
};
|
||||||
})
|
});
|
||||||
|
} else if (i.type.type === 'boolean') {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: i.type?.falseText,
|
||||||
|
value: i.type?.falseValue,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: i.type?.trueText,
|
||||||
|
value: i.type?.trueValue,
|
||||||
}
|
}
|
||||||
})
|
];
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
})
|
};
|
||||||
|
watchEffect(() => {
|
||||||
|
const obj = instanceStore.current?.configuration;
|
||||||
|
if (obj && Object.keys(obj).length) {
|
||||||
|
(props?.config || []).map((item: any) => {
|
||||||
|
if (Array.isArray(item.properties) && item?.properties.length) {
|
||||||
|
item.properties.map((i: any) => {
|
||||||
|
modelRef[i.property] = obj[i.property];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
emit('close');
|
emit('close');
|
||||||
|
@ -93,17 +109,17 @@ const onClose = () => {
|
||||||
|
|
||||||
const saveBtn = () => {
|
const saveBtn = () => {
|
||||||
formRef.value.validate().then(async (res) => {
|
formRef.value.validate().then(async (res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
const values = toRaw(modelRef);
|
const values = toRaw(modelRef);
|
||||||
const resp = await modify(instanceStore.current?.id || '', {
|
const resp = await modify(instanceStore.current?.id || '', {
|
||||||
id: instanceStore.current?.id,
|
id: instanceStore.current?.id,
|
||||||
configuration: { ...values }
|
configuration: { ...values },
|
||||||
})
|
});
|
||||||
if(resp.status === 200){
|
if (resp.status === 200) {
|
||||||
onlyMessage('操作成功!')
|
onlyMessage('操作成功!');
|
||||||
emit('save');
|
emit('save');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -135,7 +135,6 @@ const queryChartsList = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
const dataList: any[] = [
|
const dataList: any[] = [
|
||||||
{
|
{
|
||||||
|
@ -144,7 +143,7 @@ const queryChartsList = async () => {
|
||||||
type: prop.data?.name || '',
|
type: prop.data?.name || '',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
(resp.result as any)?.data?.forEach((i: any) => {
|
(resp.result as any)?.forEach((i: any) => {
|
||||||
dataList.push({
|
dataList.push({
|
||||||
...i,
|
...i,
|
||||||
year: i.timestamp,
|
year: i.timestamp,
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
{
|
{
|
||||||
required: !!item?.type?.expands?.required,
|
required: !!item?.type?.expands?.required,
|
||||||
message: `${
|
message: `${
|
||||||
item.type.type === 'enum'
|
item.type.type === 'enum' || 'boolean'
|
||||||
? '请选择'
|
? '请选择'
|
||||||
: '请输入'
|
: '请输入'
|
||||||
}${item.name}`,
|
}${item.name}`,
|
||||||
|
@ -129,10 +129,11 @@
|
||||||
></j-input-password>
|
></j-input-password>
|
||||||
<j-select
|
<j-select
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
v-if="item.type.type === 'enum'"
|
v-if="item.type.type === 'enum' || item.type.type === 'boolean'"
|
||||||
v-model:value="formData.data[item.property]"
|
v-model:value="formData.data[item.property]"
|
||||||
|
:options="getOptions(item)"
|
||||||
>
|
>
|
||||||
<j-select-option
|
<!-- <j-select-option
|
||||||
v-for="el in item?.type?.type === 'enum' &&
|
v-for="el in item?.type?.type === 'enum' &&
|
||||||
item?.type?.elements
|
item?.type?.elements
|
||||||
? item?.type?.elements
|
? item?.type?.elements
|
||||||
|
@ -141,8 +142,9 @@
|
||||||
:value="el.value"
|
:value="el.value"
|
||||||
>
|
>
|
||||||
{{ el.text }}
|
{{ el.text }}
|
||||||
</j-select-option>
|
</j-select-option> -->
|
||||||
</j-select>
|
</j-select>
|
||||||
|
<j-input-number v-if="['int','float','double','long'].includes(item.type.type)" v-model:value="formData.data[item.property]" placeholder="请输入"></j-input-number>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-form>
|
</j-form>
|
||||||
<Title data="存储策略">
|
<Title data="存储策略">
|
||||||
|
@ -346,6 +348,29 @@ const form = reactive<Record<string, any>>({
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
data: productStore.current?.configuration || {},
|
data: productStore.current?.configuration || {},
|
||||||
});
|
});
|
||||||
|
//获取物模型下拉选项
|
||||||
|
const getOptions = (i:any) =>{
|
||||||
|
if (i.type.type === 'enum') {
|
||||||
|
return (i.type?.elements || []).map((item) => {
|
||||||
|
return {
|
||||||
|
label: item?.text,
|
||||||
|
value: item?.value,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else if (i.type.type === 'boolean') {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: i.type?.falseText,
|
||||||
|
value: i.type?.falseValue,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: i.type?.trueText,
|
||||||
|
value: i.type?.trueValue,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const fun = () =>{
|
const fun = () =>{
|
||||||
console.log(formData.data,productStore.current?.configuration)
|
console.log(formData.data,productStore.current?.configuration)
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
accept=".json"
|
accept=".json"
|
||||||
:showUploadList="false"
|
:showUploadList="false"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
|
:disabled="!permission"
|
||||||
>
|
>
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
hasPermission="device/Product:import"
|
hasPermission="device/Product:import"
|
||||||
|
@ -197,6 +198,7 @@ import { useMenuStore } from 'store/menu';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useRouterParams } from '@/utils/hooks/useParams';
|
import { useRouterParams } from '@/utils/hooks/useParams';
|
||||||
import { accessConfigTypeFilter } from '@/utils/setting';
|
import { accessConfigTypeFilter } from '@/utils/setting';
|
||||||
|
import { usePermissionStore } from '@/store/permission';
|
||||||
/**
|
/**
|
||||||
* 表格数据
|
* 表格数据
|
||||||
*/
|
*/
|
||||||
|
@ -258,7 +260,9 @@ const columns = [
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
const permission = usePermissionStore().hasPermission(
|
||||||
|
`device/Product:import`,
|
||||||
|
);
|
||||||
const _selectedRowKeys = ref<string[]>([]);
|
const _selectedRowKeys = ref<string[]>([]);
|
||||||
const currentForm = ref({});
|
const currentForm = ref({});
|
||||||
|
|
||||||
|
|
|
@ -70,12 +70,13 @@
|
||||||
v-if="type === 'device' || formModel.type === 'import'"
|
v-if="type === 'device' || formModel.type === 'import'"
|
||||||
>
|
>
|
||||||
<j-select v-model:value="formModel.metadata">
|
<j-select v-model:value="formModel.metadata">
|
||||||
<j-select-option value="jetlinks"
|
<!-- <j-select-option value="jetlinks"
|
||||||
>Jetlinks物模型</j-select-option
|
>Jetlinks物模型</j-select-option
|
||||||
>
|
>
|
||||||
<j-select-option value="alink"
|
<j-select-option value="alink"
|
||||||
>阿里云物模型TSL</j-select-option
|
>阿里云物模型TSL</j-select-option
|
||||||
>
|
> -->
|
||||||
|
<j-select-option v-for="i in codecs" :value="i.id">{{ i.name }}</j-select-option>
|
||||||
</j-select>
|
</j-select>
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
<j-form-item
|
<j-form-item
|
||||||
|
@ -177,6 +178,7 @@
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Import">
|
<script setup lang="ts" name="Import">
|
||||||
|
import { getCodecs } from '@/api/device/product';
|
||||||
import { saveMetadata } from '@/api/device/instance';
|
import { saveMetadata } from '@/api/device/instance';
|
||||||
import {
|
import {
|
||||||
queryNoPagingPost,
|
queryNoPagingPost,
|
||||||
|
@ -214,7 +216,7 @@ interface Emits {
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
const emits = defineEmits<Emits>();
|
const emits = defineEmits<Emits>();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const codecs = ref<any>([])
|
||||||
const _visible = computed({
|
const _visible = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
return props.visible;
|
return props.visible;
|
||||||
|
@ -300,7 +302,7 @@ const requiredCheck = (data:any) =>{
|
||||||
check = true
|
check = true
|
||||||
return
|
return
|
||||||
}else{
|
}else{
|
||||||
check = testType(item,index)
|
check = testType(item.valueType,index)
|
||||||
}
|
}
|
||||||
if(!item?.expands?.source){
|
if(!item?.expands?.source){
|
||||||
onlyMessage(`属性定义第${index + 1}个数组中缺失expands.source属性`,'error');
|
onlyMessage(`属性定义第${index + 1}个数组中缺失expands.source属性`,'error');
|
||||||
|
@ -326,20 +328,20 @@ const requiredCheck = (data:any) =>{
|
||||||
check = true
|
check = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(!item?.async && item?.async !== false){
|
// if(!item?.async && item?.async !== false){
|
||||||
onlyMessage(`方法定义第${index + 1}个数组中缺失async属性`,'error');
|
// onlyMessage(`方法定义第${index + 1}个数组中缺失async属性`,'error');
|
||||||
check = true
|
// check = true
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if(item?.inputs){
|
if(item?.inputs){
|
||||||
testObject(item.inputs,index)
|
testObject(item.inputs,index)
|
||||||
item.inputs.forEach((i:any)=>{
|
// item.inputs.forEach((i:any)=>{
|
||||||
if(!i?.expands?.required && i?.expands?.required !== false){
|
// if(!i?.expands?.required && i?.expands?.required !== false){
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组中缺失expands.required属性`,'error')
|
// onlyMessage(`方法定义inputs第${index+1}个数组中缺失expands.required属性`,'error')
|
||||||
check = true
|
// check = true
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -355,11 +357,11 @@ const requiredCheck = (data:any) =>{
|
||||||
check = true
|
check = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(!item?.async && item?.async !== false){
|
// if(!item?.async && item?.async !== false){
|
||||||
onlyMessage(`事件定义第${index + 1}个数组中缺失async属性`,'error');
|
// onlyMessage(`事件定义第${index + 1}个数组中缺失async属性`,'error');
|
||||||
check = true
|
// check = true
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if(!item?.valueType?.type){
|
if(!item?.valueType?.type){
|
||||||
onlyMessage(`事件定义第${index + 1}个数组中缺失valueType.type属性`,'error');
|
onlyMessage(`事件定义第${index + 1}个数组中缺失valueType.type属性`,'error');
|
||||||
check = true
|
check = true
|
||||||
|
@ -414,7 +416,7 @@ const requiredCheck = (data:any) =>{
|
||||||
check = true
|
check = true
|
||||||
return
|
return
|
||||||
}else{
|
}else{
|
||||||
testType(item?.valueType?.type,index)
|
testType(item?.valueType,index)
|
||||||
}
|
}
|
||||||
if(!item?.expands?.type){
|
if(!item?.expands?.type){
|
||||||
onlyMessage(`标签定义第${index + 1}个数组中缺失expands.type属性`,'error');
|
onlyMessage(`标签定义第${index + 1}个数组中缺失expands.type属性`,'error');
|
||||||
|
@ -595,6 +597,12 @@ const metadataStore = useMetadataStore();
|
||||||
|
|
||||||
const handleImport = async () => {
|
const handleImport = async () => {
|
||||||
formRef.value.validate().then(async (data: any) => {
|
formRef.value.validate().then(async (data: any) => {
|
||||||
|
let check
|
||||||
|
if((props.type === 'device' || formModel.type === 'import') &&
|
||||||
|
formModel.metadataType === 'script'){
|
||||||
|
check = formModel.metadata === 'jetlinks' ? requiredCheck(JSON.parse(formModel.import)) : aliCheck(JSON.parse(formModel.import))
|
||||||
|
}
|
||||||
|
if(!check){
|
||||||
const { id } = route.params || {};
|
const { id } = route.params || {};
|
||||||
if (data.metadata === 'alink') {
|
if (data.metadata === 'alink') {
|
||||||
try {
|
try {
|
||||||
|
@ -723,9 +731,16 @@ const handleImport = async () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(async()=>{
|
||||||
|
const res = await getCodecs()
|
||||||
|
if (res.status === 200) {
|
||||||
|
codecs.value = [{ id: 'jetlinks', name: '标准物模型' }].concat(res.result)
|
||||||
|
}
|
||||||
|
})
|
||||||
// const showProduct = computed(() => formModel.type === 'copy')
|
// const showProduct = computed(() => formModel.type === 'copy')
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
|
@ -4,15 +4,16 @@ export const testProperties = (data:any) =>{
|
||||||
}
|
}
|
||||||
|
|
||||||
export const testType = (data:any,index:number,isArray?:boolean,isObject?:boolean)=>{
|
export const testType = (data:any,index:number,isArray?:boolean,isObject?:boolean)=>{
|
||||||
if(data.valueType.type === 'boolean'){
|
console.log(data,index)
|
||||||
if(!data?.valueType?.trueText || !data?.valueType?.trueValue || !data?.valueType?.falseText || !data?.valueType?.falseValue){
|
if(data.type === 'boolean'){
|
||||||
|
if(!data?.trueText || !data?.trueValue || !data?.falseText || !data?.falseValue){
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失必填属性`,'error')
|
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失必填属性`,'error')
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(data.valueType.type === 'enum' && !isObject){
|
if(data.type === 'enum' && !isObject){
|
||||||
if(data.valueType?.elements?.length > 0){
|
if(data?.elements?.length > 0){
|
||||||
data.valueType.elements.forEach((a:any,b:number)=>{
|
data.elements.forEach((a:any,b:number)=>{
|
||||||
if(!a.value || !a.text){
|
if(!a.value || !a.text){
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中elements缺失必填属性`,'error')
|
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中elements缺失必填属性`,'error')
|
||||||
return true
|
return true
|
||||||
|
@ -23,23 +24,23 @@ export const testType = (data:any,index:number,isArray?:boolean,isObject?:boolea
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(data.valueType.type === 'array' && !isArray && !isObject){
|
if(data.type === 'array' && !isArray && !isObject){
|
||||||
if(data.valueType?.elementType){
|
if(data?.elementType){
|
||||||
testType(data.valueType.elementType,index,true)
|
testType(data.elementType,index,true)
|
||||||
}else{
|
}else{
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失elementType属性`,'error')
|
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失elementType属性`,'error')
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(data.valueType.type === 'file' && !isArray && !isObject){
|
if(data.type === 'file' && !isArray && !isObject){
|
||||||
if(!data.valueType?.fileType){
|
if(!data?.fileType){
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失fileType属性`,'error')
|
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失fileType属性`,'error')
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(data.valueType.type === 'object' && !isArray && !isObject){
|
if(data.type === 'object' && !isArray && !isObject){
|
||||||
if(data?.valueType?.properties?.length > 0){
|
if(data?.valueType?.properties?.length > 0){
|
||||||
return testObject(data.valueType.properties,index)
|
return testObject(data.properties,index)
|
||||||
}else{
|
}else{
|
||||||
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失properties属性`,'error')
|
onlyMessage(`方法定义inputs第${index+1}个数组ValueType中缺失properties属性`,'error')
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -1506,7 +1506,6 @@ export default [
|
||||||
url: '/iot/DataCollect/Dashboard',
|
url: '/iot/DataCollect/Dashboard',
|
||||||
icon: 'icon-keshihua',
|
icon: 'icon-keshihua',
|
||||||
showPage: [
|
showPage: [
|
||||||
'dashboard',
|
|
||||||
'data-collect-channel',
|
'data-collect-channel',
|
||||||
'data-collect-opc',
|
'data-collect-opc',
|
||||||
'data-collector',
|
'data-collector',
|
||||||
|
@ -2836,7 +2835,7 @@ export default [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
buttons: [],
|
buttons: [],
|
||||||
showPage: ['dashboard', 'media-device'],
|
showPage: ['media-device'],
|
||||||
accessSupport: { text: "不支持", value: "unsupported" },
|
accessSupport: { text: "不支持", value: "unsupported" },
|
||||||
supportDataAccess: false
|
supportDataAccess: false
|
||||||
},
|
},
|
||||||
|
|
|
@ -452,8 +452,9 @@ const handleBind = (row: any) => {
|
||||||
* 绑定用户, 用户下拉筛选
|
* 绑定用户, 用户下拉筛选
|
||||||
*/
|
*/
|
||||||
const filterOption = (input: string, option: any) => {
|
const filterOption = (input: string, option: any) => {
|
||||||
|
const text = option?.componentOptions?.children?.[0]?.text || option.label
|
||||||
return (
|
return (
|
||||||
option.componentOptions.children[0].text
|
text
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.indexOf(input.toLowerCase()) >= 0
|
.indexOf(input.toLowerCase()) >= 0
|
||||||
);
|
);
|
||||||
|
|
|
@ -268,7 +268,6 @@ watch(
|
||||||
() => props.productDetail,
|
() => props.productDetail,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
if (newVal?.id) {
|
if (newVal?.id) {
|
||||||
console.log(props.values)
|
|
||||||
if (props.values?.selector === 'fixed' && props.values?.selectorValues?.length === 1) {
|
if (props.values?.selector === 'fixed' && props.values?.selectorValues?.length === 1) {
|
||||||
const id = props.values?.selectorValues?.[0]?.value;
|
const id = props.values?.selectorValues?.[0]?.value;
|
||||||
if (id) {
|
if (id) {
|
||||||
|
@ -300,6 +299,8 @@ watch(
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
queryBuiltIn();
|
queryBuiltIn();
|
||||||
|
}else{
|
||||||
|
modelRef.message.properties = [] as any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
/>
|
/>
|
||||||
<template v-if="shakeLimit.enabled">
|
<template v-if="shakeLimit.enabled">
|
||||||
<j-input-number :min="1" :max="100" :precision="0" size="small" v-model:value="shakeLimit.time" style="width: 38px" />
|
<j-input-number :min="1" :precision="0" size="small" v-model:value="shakeLimit.time" style="width: 38px" />
|
||||||
<span>秒内发送</span>
|
<span>秒内发送</span>
|
||||||
<j-input-number :min="1" :max="100" :precision="0" size="small" v-model:value="shakeLimit.threshold" style="width: 38px" />
|
<j-input-number :min="1" :max="100" :precision="0" size="small" v-model:value="shakeLimit.threshold" style="width: 38px" />
|
||||||
<span>次及以上时,处理</span>
|
<span>次及以上时,处理</span>
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
v-model:value='paramsValue.termType'
|
v-model:value='paramsValue.termType'
|
||||||
@select='termsTypeSelect'
|
@select='termsTypeSelect'
|
||||||
/>
|
/>
|
||||||
|
<div v-if="!['notnull','isnull'].includes(paramsValue.termType)">
|
||||||
<DoubleParamsDropdown
|
<DoubleParamsDropdown
|
||||||
v-if='showDouble'
|
v-if='showDouble'
|
||||||
icon='icon-canshu'
|
icon='icon-canshu'
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
v-model:source='paramsValue.value.source'
|
v-model:source='paramsValue.value.source'
|
||||||
@select='valueSelect'
|
@select='valueSelect'
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<j-popconfirm title='确认删除?' @confirm='onDelete' :overlayStyle='{minWidth: "180px"}'>
|
<j-popconfirm title='确认删除?' @confirm='onDelete' :overlayStyle='{minWidth: "180px"}'>
|
||||||
<div v-show='showDelete' class='button-delete'> <AIcon type='CloseOutlined' /></div>
|
<div v-show='showDelete' class='button-delete'> <AIcon type='CloseOutlined' /></div>
|
||||||
</j-popconfirm>
|
</j-popconfirm>
|
||||||
|
@ -82,12 +84,12 @@ import { ContextKey, arrayParamsKey, timeTypeKeys } from './util'
|
||||||
import { useSceneStore } from 'store/scene'
|
import { useSceneStore } from 'store/scene'
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { Form } from 'jetlinks-ui-components'
|
import { Form } from 'jetlinks-ui-components'
|
||||||
import {indexOf, isArray, isObject, isString, pick , cloneDeep } from 'lodash-es'
|
import {indexOf, isArray, isObject, isString, pick} from 'lodash-es'
|
||||||
|
import {cloneDeep} from "lodash";
|
||||||
|
|
||||||
const sceneStore = useSceneStore()
|
const sceneStore = useSceneStore()
|
||||||
const { data: formModel } = storeToRefs(sceneStore)
|
const { data: formModel } = storeToRefs(sceneStore)
|
||||||
const formItemContext = Form.useInjectFormItemContext();
|
const formItemContext = Form.useInjectFormItemContext();
|
||||||
|
|
||||||
type Emit = {
|
type Emit = {
|
||||||
(e: 'update:value', data: TermsType): void
|
(e: 'update:value', data: TermsType): void
|
||||||
}
|
}
|
||||||
|
@ -328,15 +330,21 @@ const termsTypeSelect = (e: { key: string, name: string }) => {
|
||||||
newValue.value = undefined
|
newValue.value = undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(
|
||||||
|
['isnull','notull'].includes(e.key)
|
||||||
|
){
|
||||||
|
newValue.value.value = 1
|
||||||
|
}
|
||||||
paramsValue.value = newValue
|
paramsValue.value = newValue
|
||||||
|
|
||||||
emit('update:value', { ...paramsValue })
|
emit('update:value', { ...paramsValue })
|
||||||
formItemContext.onFieldChange()
|
formItemContext.onFieldChange()
|
||||||
formModel.value.options!.when[props.branchName].terms[props.whenName].terms[props.termsName][1] = e.name
|
formModel.value.options!.when[props.branchName].terms[props.whenName].terms[props.termsName][1] = e.name
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const valueSelect = (v: any, label: string, labelObj: Record<number, any>, option: any) => {
|
const valueSelect = (v: any, label: string, labelObj: Record<number, any>, option: any) => {
|
||||||
|
console.log(labelObj,option,paramsValue.value,'____123')
|
||||||
if (paramsValue.value?.source === 'metric') {
|
if (paramsValue.value?.source === 'metric') {
|
||||||
paramsValue.value.metric = option?.id
|
paramsValue.value.metric = option?.id
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,11 @@
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</j-col>
|
</j-col>
|
||||||
<j-col :span="12">
|
<j-col :span="12">
|
||||||
<j-form-item label="编码" name="code" :rules="[
|
<j-form-item
|
||||||
|
label="编码"
|
||||||
|
name="code"
|
||||||
|
:validateFirst="true"
|
||||||
|
:rules="[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入编码',
|
message: '请输入编码',
|
||||||
|
|
|
@ -60,14 +60,14 @@
|
||||||
ref="variableRef"
|
ref="variableRef"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="current === 4 && isNoCommunity ">
|
<template v-if="current === 4">
|
||||||
<div class="alert">
|
<div class="alert">
|
||||||
<AIcon type="InfoCircleOutlined" />
|
<AIcon type="InfoCircleOutlined" />
|
||||||
通过角色控制哪些用户可以订阅从【{{ name }}】接收到【{{ showName }}】通知
|
通过角色控制哪些用户可以订阅从【{{ name }}】接收到【{{ showName }}】通知
|
||||||
</div>
|
</div>
|
||||||
<Role type="add" v-model="formModel.grant.role.idList" />
|
<Role type="add" v-model="formModel.grant.role.idList" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="current === 5 || current === 4 && !isNoCommunity">
|
<template v-if="current === 5">
|
||||||
<div>
|
<div>
|
||||||
<div class="alert">
|
<div class="alert">
|
||||||
<AIcon type="InfoCircleOutlined" />
|
<AIcon type="InfoCircleOutlined" />
|
||||||
|
@ -170,20 +170,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const stepList = isNoCommunity ? [
|
const stepList = [
|
||||||
'选择通知方式',
|
'选择通知方式',
|
||||||
'选择通知配置',
|
'选择通知配置',
|
||||||
'选择通知模板',
|
'选择通知模板',
|
||||||
'配置模板变量',
|
'配置模板变量',
|
||||||
'配置用户权限',
|
'配置用户权限',
|
||||||
'完成',
|
'完成',
|
||||||
] : [
|
]
|
||||||
'选择通知方式',
|
|
||||||
'选择通知配置',
|
|
||||||
'选择通知模板',
|
|
||||||
'配置模板变量',
|
|
||||||
'完成',
|
|
||||||
]
|
|
||||||
const current = ref<number>(0);
|
const current = ref<number>(0);
|
||||||
const variable = ref([]);
|
const variable = ref([]);
|
||||||
const formModel = reactive<{
|
const formModel = reactive<{
|
||||||
|
|
Loading…
Reference in New Issue