* fix: bug#21034

* fix: bug#21033
This commit is contained in:
qiaochuLei 2024-01-09 11:50:09 +08:00 committed by GitHub
parent 97363057f0
commit 7bf000925b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 89 additions and 74 deletions

View File

@ -529,7 +529,7 @@ export const getPropertiesInfo = (deviceId: string, data: Record<string, unknown
* @param data
* @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)
/**
*

View File

@ -37,7 +37,6 @@ const total = ref(0);
// const list = ref<any[]>([]);
const loading = ref(false);
const visible = ref(false);
const subscribeNotice = () => {
getWebSocket('notification', '/notifications', {})
?.pipe()
@ -88,9 +87,8 @@ const subscribeNotice = () => {
const read = (type: string, data: any) => {
changeStatus_api('_read', [data.payload.id]).then((resp: any) => {
if (resp.status !== 200) return;
// notification.close(data.payload.id);
notification.close(data.payload.id);
getList();
console.log(data,type)
if (type !== '_read') {
menuStory.routerPush('account/center', {
tabKey: 'StationMessage',

View File

@ -6,6 +6,7 @@
@cancel="cancel"
@ok="ok"
:confirmLoading="loading"
:maskClosable="false"
>
<div style="height: 300px; width: 100%;">
<vue-cropper

View File

@ -86,4 +86,5 @@ const workflowNotice = [
]
export const getInitData = () =>{
return menuStore.hasMenu('process') ? [...systemNotice,...workflowNotice] : [...systemNotice]
}

View File

@ -19,13 +19,17 @@
</div>
</template>
<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
v-for="i in item.properties"
:name="i.property"
:key="i.property"
:required='!!i.type.expands?.required'
:rules='!!i.type.expands?.required ? [{ required: true, message: `请输入${i.name}`}] :[]'
:required="!!i.type.expands?.required"
:rules="
!!i.type.expands?.required
? [{ required: true, message: `请输入${i.name}` }]
: []
"
>
<template #label>
<span style="margin-right: 5px">{{ i.name }}</span>
@ -36,16 +40,7 @@
<ValueItem
v-model:modelValue="modelRef[i.property]"
:itemType="i.type.type"
:options="
i.type.type === 'enum'
? (i.type?.elements || []).map((item) => {
return {
label: item?.text,
value: item?.value,
};
})
: undefined
"
:options="getOptions(i)"
/>
</j-form-item>
</template>
@ -68,23 +63,44 @@ const instanceStore = useInstanceStore();
const props = defineProps({
config: {
type: Array,
default: []
}
})
default: [],
},
});
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;
};
watchEffect(() => {
const obj = instanceStore.current?.configuration
if(obj && Object.keys(obj).length) {
const obj = instanceStore.current?.configuration;
if (obj && Object.keys(obj).length) {
(props?.config || []).map((item: any) => {
if(Array.isArray(item.properties) && item?.properties.length){
if (Array.isArray(item.properties) && item?.properties.length) {
item.properties.map((i: any) => {
modelRef[i.property] = obj[i.property]
})
modelRef[i.property] = obj[i.property];
});
}
})
});
}
})
});
const onClose = () => {
emit('close');
@ -97,10 +113,10 @@ const saveBtn = () => {
const values = toRaw(modelRef);
const resp = await modify(instanceStore.current?.id || '', {
id: instanceStore.current?.id,
configuration: { ...values }
})
if(resp.status === 200){
onlyMessage('操作成功!')
configuration: { ...values },
});
if (resp.status === 200) {
onlyMessage('操作成功!');
emit('save');
}
}

View File

@ -328,20 +328,20 @@ const requiredCheck = (data:any) =>{
check = true
return
}
if(!item?.async && item?.async !== false){
onlyMessage(`方法定义第${index + 1}个数组中缺失async属性`,'error');
check = true
return
}
// if(!item?.async && item?.async !== false){
// onlyMessage(`${index + 1}async`,'error');
// check = true
// return
// }
if(item?.inputs){
testObject(item.inputs,index)
item.inputs.forEach((i:any)=>{
if(!i?.expands?.required && i?.expands?.required !== false){
onlyMessage(`方法定义inputs第${index+1}个数组中缺失expands.required属性`,'error')
check = true
return
}
})
// item.inputs.forEach((i:any)=>{
// if(!i?.expands?.required && i?.expands?.required !== false){
// onlyMessage(`inputs${index+1}expands.required`,'error')
// check = true
// return
// }
// })
}
})
}
@ -357,11 +357,11 @@ const requiredCheck = (data:any) =>{
check = true
return
}
if(!item?.async && item?.async !== false){
onlyMessage(`事件定义第${index + 1}个数组中缺失async属性`,'error');
check = true
return
}
// if(!item?.async && item?.async !== false){
// onlyMessage(`${index + 1}async`,'error');
// check = true
// return
// }
if(!item?.valueType?.type){
onlyMessage(`事件定义第${index + 1}个数组中缺失valueType.type属性`,'error');
check = true

View File

@ -1506,7 +1506,6 @@ export default [
url: '/iot/DataCollect/Dashboard',
icon: 'icon-keshihua',
showPage: [
'dashboard',
'data-collect-channel',
'data-collect-opc',
'data-collector',
@ -2836,7 +2835,7 @@ export default [
},
],
buttons: [],
showPage: ['dashboard', 'media-device'],
showPage: ['media-device'],
accessSupport: { text: "不支持", value: "unsupported" },
supportDataAccess: false
},

View File

@ -452,8 +452,9 @@ const handleBind = (row: any) => {
* 绑定用户, 用户下拉筛选
*/
const filterOption = (input: string, option: any) => {
const text = option?.componentOptions?.children?.[0]?.text || option.label
return (
option.componentOptions.children[0].text
text
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
);

View File

@ -268,7 +268,6 @@ watch(
() => props.productDetail,
(newVal) => {
if (newVal?.id) {
console.log(props.values)
if (props.values?.selector === 'fixed' && props.values?.selectorValues?.length === 1) {
const id = props.values?.selectorValues?.[0]?.value;
if (id) {
@ -300,6 +299,8 @@ watch(
)
) {
queryBuiltIn();
}else{
modelRef.message.properties = [] as any;
}
}
},

View File

@ -41,7 +41,11 @@
</j-form-item>
</j-col>
<j-col :span="12">
<j-form-item label="编码" name="code" :rules="[
<j-form-item
label="编码"
name="code"
:validateFirst="true"
:rules="[
{
required: true,
message: '请输入编码',

View File

@ -60,14 +60,14 @@
ref="variableRef"
/>
</template>
<template v-if="current === 4 && isNoCommunity ">
<template v-if="current === 4">
<div class="alert">
<AIcon type="InfoCircleOutlined" />
通过角色控制哪些用户可以订阅从{{ name }}接收到{{ showName }}通知
</div>
<Role type="add" v-model="formModel.grant.role.idList" />
</template>
<template v-if="current === 5 || current === 4 && !isNoCommunity">
<template v-if="current === 5">
<div>
<div class="alert">
<AIcon type="InfoCircleOutlined" />
@ -170,19 +170,13 @@ const props = defineProps({
},
});
const stepList = isNoCommunity ? [
const stepList = [
'选择通知方式',
'选择通知配置',
'选择通知模板',
'配置模板变量',
'配置用户权限',
'完成',
] : [
'选择通知方式',
'选择通知配置',
'选择通知模板',
'配置模板变量',
'完成',
]
const current = ref<number>(0);
const variable = ref([]);