fix: bug#18002、17889、17665、17684

* fix: bug#17781、17791、17847、17849、17666、17667、17670

* fix: bug#17617

* fix: bug#17665、17684

* fix: bug#17889

* fix: bug#18002
This commit is contained in:
qiaochuLei 2023-09-08 10:12:08 +08:00 committed by GitHub
parent 7f0d66c486
commit 0dc60d125f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 260 additions and 187 deletions

View File

@ -10,7 +10,7 @@ export const updateMeInfo_api = (data:object) => server.put(`/user/detail`,data)
// 修改登录用户密码
export const updateMepsd_api = (data:object) => server.put(`/user/passwd`,data);
// 第三方账号解绑
export const unBind_api = (appId: string) => server.post(`/application/sso/${appId}/unbind/me`);
export const unBind_api = (appId: string) => server.post(`/application/sso/${appId}/unbind/me`,[]);
/**
*
* @param type

View File

@ -270,6 +270,11 @@ export const queryDeviceMapping = (deviceId: string, data?: any) => server.post(
*/
export const saveDeviceMapping = (deviceId: string, data: any) => server.post(`/edge/operations/${deviceId}/device-mapping-save-batch/invoke`, data)
/**
*
*/
export const deleteDeviceMapping = (deviceId: string, data:any) => server.post(`/edge/operations/${deviceId}/device-mapping-delete/invoke`, data)
/**
*
* @param data
@ -279,7 +284,7 @@ export const getProductListNoPage = (data: any) => server.post('/device/product/
/**
*
*/
export const editDevice = (parmas: any) => server.patch('/device-instance', parmas)
export const editDevice = (params: any) => server.patch('/device-instance', params)
/**
*

View File

@ -5,6 +5,7 @@
visible
@ok="handleClick"
@cancel="handleClose"
:confirmLoading="confirmLoading"
>
<div class="map-tree">
<div class="map-tree-top">
@ -99,6 +100,7 @@ const rightList = ref<any[]>([]);
const dataSource = ref<any[]>([]);
const loading = ref<boolean>(false);
const confirmLoading = ref(false)
const handleData = (data: any[], type: string) => {
data.forEach((item) => {
item.key = item.id;
@ -212,6 +214,7 @@ const _delete = (_key: string) => {
};
const handleClick = async () => {
confirmLoading.value = true
if (!rightList.value.length) {
onlyMessage('请选择采集器', 'warning');
} else {
@ -271,6 +274,7 @@ const handleClick = async () => {
}
}
}
confirmLoading.value = false
};
const handleClose = () => {
_emits('close');

View File

@ -280,7 +280,9 @@ const onSave = async () => {
{ deviceId: resq.result?.id, deviceName: formData.name }
]
}
if(!instanceStore.current.parentId){
const res = await saveDeviceMapping(instanceStore.current.id, params)
}
const submitData = {
deviceId: instanceStore.current.parentId
? instanceStore.current.parentId

View File

@ -113,7 +113,7 @@
<script setup lang="ts">
import moment from 'moment';
import type { ActionsType } from '@/components/Table';
import {query, unbindDevice, unbindBatchDevice, queryByParent} from '@/api/device/instance';
import {query, unbindDevice, unbindBatchDevice, queryByParent , deleteDeviceMapping} from '@/api/device/instance';
import { useInstanceStore } from '@/store/instance';
import { storeToRefs } from 'pinia';
import BindChildDevice from './BindChildDevice/index.vue';
@ -241,6 +241,10 @@ const getActions = (data: Partial<Record<string, any>>): ActionsType[] => {
data.id,
{},
);
const res = await deleteDeviceMapping(
detail.value.id,
{ids:[data.id]}
)
if (resp.status === 200) {
childDeviceRef.value?.reload();
onlyMessage('操作成功!');
@ -282,6 +286,10 @@ const handleUnBind = async () => {
_selectedRowKeys.value,
);
if (resp.status === 200) {
const res = await deleteDeviceMapping(
detail.value.id,
{ids:[_selectedRowKeys.value]}
)
onlyMessage('操作成功!');
cancelSelect();
childDeviceRef.value?.reload();

View File

@ -210,7 +210,6 @@ import PatchMapping from './PatchMapping.vue';
import { onlyMessage } from '@/utils/comm';
import { cloneDeep } from 'lodash-es';
import { usePermissionStore } from '@/store/permission';
const columns = [
{
title: '名称',
@ -313,6 +312,14 @@ const handleSearch = async (_array: any[]) => {
Object.assign(item, metadataId);
return item
})
resp.result?.[0].forEach((item:any)=>{
const differ = array.every((i:any)=>{
return item.metadataId !== i.metadataId
})
if(!differ){
array.push(item)
}
})
// const array = resp.result?.[0].reduce((x: any, y: any) => {
// const metadataId = _metadata.find(
// (item: any) => item.metadataId === y.metadataId,
@ -324,6 +331,7 @@ const handleSearch = async (_array: any[]) => {
// }
// return x;
// }, _metadata);
console.log(array)
modelRef.dataSource = array;
}
}

View File

@ -37,7 +37,7 @@
<AIcon type="EditOutlined" />
</j-button>
</j-popconfirm-modal>
<j-dropdown v-if="myValue === 'rule' && target === 'device' && showReset" :getPopupContainer="(triggerNode) => triggerNode.parentNode">
<j-dropdown v-if="myValue === 'rule' && target === 'device' && showReset" :getPopupContainer="(node) => fullRef || node" placement="bottom">
<span style="width: 20px;" @click.prevent>
<AIcon type="MoreOutlined" />
</span>
@ -100,7 +100,13 @@ import { resetRule } from '@/api/device/instance';
import { updata } from '@/api/rule-engine/configuration';
import { onlyMessage } from '@/utils/comm';
import { provide } from 'vue';
import { queryDeviceVirtualProperty } from '@/api/device/instance';
import {
queryProductVirtualProperty
} from '@/api/device/product';
import { useProductStore } from '@/store/product';
const instanceStore = useInstanceStore();
const productStore = useProductStore();
const PropertySource: { label: string; value: string }[] = isNoCommunity
? [
{
@ -133,6 +139,7 @@ type Emit = {
(e: 'update:value', data: Record<string, any>): void;
};
const fullRef = inject(FULL_CODE);
const showReset = ref(false);
const props = defineProps({
@ -243,6 +250,32 @@ const cancel = () => {
type.value = props.value?.expands?.type || [];
}
const handleSearch = async () => {
let resp: any = undefined;
if (props.target === 'product') {
resp = await queryProductVirtualProperty(
productStore.current?.id,
props.value?.id,
);
} else {
resp = await queryDeviceVirtualProperty(
instanceStore.current?.productId,
instanceStore.current?.id,
props.value?.id,
);
}
if (resp && resp.status === 200 && resp.result) {
const _triggerProperties = props.value?.expands?.virtualRule?.triggerProperties?.length ? props.value?.expands?.virtualRule?.triggerProperties : resp.result.triggerProperties
updateValue({
source: myValue.value,
virtualRule:{
triggerProperties: _triggerProperties?.length ? _triggerProperties : ['*'],
...resp.result.rule
}
});
}
};
watch(
() => props.value,
() => {
@ -261,6 +294,7 @@ onMounted(()=>{
item === props.value?.id ? showReset.value = true : ''
})
}
handleSearch()
})
</script>

View File

@ -43,6 +43,7 @@
:actions="getActions(slotProps, 'card')"
:status="slotProps.state?.value"
:statusText="slotProps.state?.text"
@click="handleView(slotProps.id)"
:statusNames="{
online: 'processing',
offline: 'error',
@ -63,7 +64,6 @@
<Ellipsis style="width: calc(100% - 100px)">
<span
style="font-size: 16px; font-weight: 600"
@click.stop="handleView(slotProps.id)"
>
{{ slotProps.name }}
</span>
@ -101,7 +101,7 @@
:key="i"
>
<PermissionButton
:disabled="o.disabled"
:disabled="o.disabled || item.state !== 'online'"
:popConfirm="o.popConfirm"
:tooltip="{
...o.tooltip,
@ -470,7 +470,7 @@ const getActions = (
},
icon: 'RedoOutlined',
popConfirm: {
title: '确认重置密码为P@ssw0rd',
title: '确认重置密码为Jetlinks123',
onConfirm: async () => {
restPassword(data.id).then((resp: any) => {
if (resp.status === 200) {

View File

@ -283,6 +283,11 @@
cluster
.configuration
.port
"
:options="
portOptionsIndex[
index
]
"
placeholder="请选择本地端口"
allowClear
@ -291,7 +296,7 @@
filterPortOption
"
>
<j-select-option
<!-- <j-select-option
v-for="i in getPortList( portOptionsIndex[
index
], cluster
@ -300,7 +305,7 @@
:value="i.value"
>
{{ i.label }}
</j-select-option>
</j-select-option> -->
</j-select>
</j-form-item>
</j-col>
@ -1231,11 +1236,11 @@ const filterPortOption = (input: string, option: any) => {
return JSON.stringify(option.label).indexOf(input) >= 0;
};
const getPortList = (list: any[], id: string) => {
const keys = dynamicValidateForm?.cluster?.map?.(item => item.configuration?.port) || []
// console.log(dynamicValidateForm?.cluster, id, keys)
return (list || []).filter(item => item.value === id || !keys.includes(item.value) )
}
// const getPortList = (list: any[], id: string) => {
// const keys = dynamicValidateForm?.cluster?.map?.(item => item.configuration?.port) || []
// // console.log(dynamicValidateForm?.cluster, id, keys)
// return (list || []).filter(item => item.value === id || !keys.includes(item.value) )
// }
const filterConfigByType = (data: any[], type: string) => {
let _temp = type;

View File

@ -130,7 +130,7 @@
</template>
</MediaTool>
</div>
<Preset :data="data" @refresh="onRefresh" />
<Preset v-if='data.ptzType.value ===0 || data.ptzType.value === 1' :data="data" @refresh="onRefresh" />
</div>
</div>
<template #footer>

View File

@ -1,5 +1,6 @@
<template>
<page-container>
<FullPage>
<div class="manager-container">
<div class="left">
<j-input-search
@ -18,6 +19,7 @@
:show-icon="true"
>
<template #title="{ dataRef }">
<Ellipsis>
<div
v-if="dataRef.root"
style="
@ -39,6 +41,7 @@
<span v-else>
{{ dataRef.title }}
</span>
</Ellipsis>
</template>
</j-tree>
</div>
@ -171,6 +174,7 @@
</j-button>
</div>
</div>
</FullPage>
<j-modal
:visible="true"
v-if="dialog.visible"
@ -495,12 +499,15 @@ const checkName = (_: any, value: any) =>
padding: 24px;
background-color: #fff;
display: flex;
min-height: 500px;
height: 100%;
.left {
flex-basis: 280px;
padding: 0 24px;
box-sizing: border-box;
width:300px;
height:100%;
overflow-y: auto;
}
.right {
width: calc(100% - 280px);

View File

@ -8,7 +8,7 @@
>
<div class="alert">
<AIcon type="InfoCircleOutlined" />
通过角色控制{{ name }}的所有的通知方式可被哪些用户订阅
通过角色控制哪些用户可以订阅{{ name }}下所有的通知方式
</div>
<Role v-model="_selectedRowKeys" :gridColumn="2" />
</j-modal>

View File

@ -63,7 +63,7 @@
<template v-if="current === 4">
<div class="alert">
<AIcon type="InfoCircleOutlined" />
已规定固定收信人的模板在当前页面将被过滤
通过角色控制哪些用户可以订阅从{{ name }}接收到{{ showName }}通知
</div>
<Role type="add" v-model="formModel.grant.role.idList" />
</template>

View File

@ -109,7 +109,7 @@
</j-button>
</j-form-item>
</j-form>
<div class="other">
<div class="other" v-if="bindings.length">
<j-divider plain>
<div class="other-text">
其他登录方式
@ -245,7 +245,7 @@ const codeUrl = ref('');
const codeConfig = ref(false);
const loading = ref(false);
const bindings = ref<any[]>();
const bindings = ref<any[]>([]);
// const basis = ref<any>({});
const defaultImg = getImage('/apply/internal-standalone.png');