fix: 优化查询条件;合并dev部分代码
This commit is contained in:
parent
ac074990cb
commit
5f41a9a125
|
@ -29,7 +29,7 @@ const handleTermsToString = (queryTerms: any, terms: Array<TermsType>, parentKey
|
||||||
Object.keys(a).forEach((b) => {
|
Object.keys(a).forEach((b) => {
|
||||||
const key = `${parentKey}[${aIndex}].${b}`
|
const key = `${parentKey}[${aIndex}].${b}`
|
||||||
if (b === 'terms') {
|
if (b === 'terms') {
|
||||||
handleTermsToString(queryTerms, a[b], `${key}.`)
|
handleTermsToString(queryTerms, a[b], `${key}`)
|
||||||
} else {
|
} else {
|
||||||
queryTerms[key] = a[b]
|
queryTerms[key] = a[b]
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ export const paramsEncodeQuery = (params?: ParamsType) => {
|
||||||
const { sorts, terms } = params
|
const { sorts, terms } = params
|
||||||
|
|
||||||
if (terms) {
|
if (terms) {
|
||||||
handleTermsToString(queryParams, terms, 'terms.')
|
handleTermsToString(queryParams, terms, 'terms')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sorts) {
|
if (sorts) {
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
checkable
|
checkable
|
||||||
@check="onCheck"
|
@check="onCheck"
|
||||||
:height="600"
|
:height="600"
|
||||||
:showLine="{ showLeafIcon: false }"
|
|
||||||
:show-icon="true"
|
|
||||||
>
|
>
|
||||||
<template #title="{ name, key }">
|
<template #title="{ name, key }">
|
||||||
<span
|
<span
|
||||||
|
|
|
@ -63,7 +63,7 @@ const Status = defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
const jumpAccessConfig = () => {
|
const jumpAccessConfig = () => {
|
||||||
menuStory.jumpPage('device/Product/Detail', { id: unref(device).productId, tab: 'access' });
|
menuStory.jumpPage('device/Product/Detail', { id: unref(device).productId, tab: 'Device' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const jumpDeviceConfig = () => {
|
const jumpDeviceConfig = () => {
|
||||||
|
|
|
@ -259,4 +259,6 @@ urlMap.set('mqtt-client-gateway', 'topic');
|
||||||
urlMap.set('http-server-gateway', 'url');
|
urlMap.set('http-server-gateway', 'url');
|
||||||
urlMap.set('websocket-server', 'url');
|
urlMap.set('websocket-server', 'url');
|
||||||
urlMap.set('coap-server-gateway', 'url');
|
urlMap.set('coap-server-gateway', 'url');
|
||||||
|
urlMap.set('udp-device-gateway', 'url');
|
||||||
|
urlMap.set('tcp-server-gateway', 'url');
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
:tree-data="dataSource"
|
:tree-data="dataSource"
|
||||||
:checkedKeys="checkedKeys"
|
:checkedKeys="checkedKeys"
|
||||||
@check="onCheck"
|
@check="onCheck"
|
||||||
:showLine="{ showLeafIcon: false }"
|
|
||||||
:show-icon="true"
|
|
||||||
/>
|
/>
|
||||||
</j-card>
|
</j-card>
|
||||||
<div style="width: 100px">
|
<div style="width: 100px">
|
||||||
|
|
|
@ -510,17 +510,10 @@ const beforeUpload: UploadProps['beforeUpload'] = (file) => {
|
||||||
reader.onload = (json) => {
|
reader.onload = (json) => {
|
||||||
if(json.target?.result){
|
if(json.target?.result){
|
||||||
const data = JSON.parse(json.target?.result);
|
const data = JSON.parse(json.target?.result);
|
||||||
Object.keys(data).forEach((i:any)=>{
|
|
||||||
const map = new Map()
|
|
||||||
data[i].forEach((item:any)=>(
|
|
||||||
map.set(item.id,item)
|
|
||||||
))
|
|
||||||
data[i] = [...map.values()]
|
|
||||||
})
|
|
||||||
let check = formModel.metadata === 'jetlinks' ? requiredCheck(data) : aliCheck(data)
|
let check = formModel.metadata === 'jetlinks' ? requiredCheck(data) : aliCheck(data)
|
||||||
if(!check){
|
if(!check){
|
||||||
onlyMessage('操作成功!')
|
onlyMessage('操作成功!')
|
||||||
formModel.import = JSON.stringify(data);
|
formModel.import = json.target?.result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onlyMessage('文件内容不能为空', 'error')
|
onlyMessage('文件内容不能为空', 'error')
|
||||||
|
@ -587,7 +580,13 @@ const handleImport = async () => {
|
||||||
if (data.metadata === 'alink') {
|
if (data.metadata === 'alink') {
|
||||||
try {
|
try {
|
||||||
const _import = JSON.parse(data.import);
|
const _import = JSON.parse(data.import);
|
||||||
|
Object.keys(_import).forEach((i:any)=>{
|
||||||
|
const map = new Map()
|
||||||
|
_import[i].forEach((item:any)=>(
|
||||||
|
map.set(item.id,item)
|
||||||
|
))
|
||||||
|
_import[i] = [...map.values()]
|
||||||
|
})
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await convertMetadata(
|
const res = await convertMetadata(
|
||||||
'from',
|
'from',
|
||||||
|
@ -638,7 +637,15 @@ const handleImport = async () => {
|
||||||
data[data?.type === 'copy' ? 'copy' : 'import'] ||
|
data[data?.type === 'copy' ? 'copy' : 'import'] ||
|
||||||
'{}',
|
'{}',
|
||||||
);
|
);
|
||||||
|
if(data?.type === 'import'){
|
||||||
|
Object.keys(_object).forEach((i:any)=>{
|
||||||
|
const map = new Map()
|
||||||
|
_object[i].forEach((item:any)=>(
|
||||||
|
map.set(item.id,item)
|
||||||
|
))
|
||||||
|
_object[i] = [...map.values()]
|
||||||
|
})
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
!!_object?.properties ||
|
!!_object?.properties ||
|
||||||
|
|
|
@ -30,17 +30,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="media-live">
|
<div class="media-live">
|
||||||
<div class="media-live-video">
|
<div class="media-live-video" @mouseenter="visibleChange" @mouseleave="mouseleave">
|
||||||
<div
|
<div
|
||||||
:class="mediaToolClass"
|
:class="mediaToolClass"
|
||||||
@mouseleave="mouseleave"
|
|
||||||
@mouseenter="showTool = true"
|
@mouseenter="showTool = true"
|
||||||
>
|
>
|
||||||
<div class="tool-item" v-if="type !== 'share'">
|
<div class="tool-item" v-if="type !== 'share'">
|
||||||
<template v-if="isRecord === 0">
|
<template v-if="isRecord === 0">
|
||||||
<j-dropdown
|
<j-dropdown
|
||||||
trigger="click"
|
trigger="click"
|
||||||
@visibleChange="visibleChange"
|
|
||||||
@click="showToolLock = true"
|
@click="showToolLock = true"
|
||||||
>
|
>
|
||||||
<div>开始录像</div>
|
<div>开始录像</div>
|
||||||
|
@ -212,8 +210,8 @@ const mouseleave = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const visibleChange = (v: boolean) => {
|
const visibleChange = () => {
|
||||||
showTool.value = v;
|
showTool.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPopupContainer = (trigger: HTMLElement) => {
|
const getPopupContainer = (trigger: HTMLElement) => {
|
||||||
|
|
|
@ -7,6 +7,8 @@ import { LocalStore } from '@/utils/comm';
|
||||||
import { TOKEN_KEY } from '@/utils/variable';
|
import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import ShareLive from '../Live/shareLive.vue';
|
import ShareLive from '../Live/shareLive.vue';
|
||||||
|
|
||||||
|
import { useSystem } from '@/store/system';
|
||||||
|
const system = useSystem();
|
||||||
const playData = ref({
|
const playData = ref({
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
channelId: '',
|
channelId: '',
|
||||||
|
@ -18,6 +20,7 @@ const playData = ref({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
system.getSystemConfig()
|
||||||
const obj: any = unref(route.query) || {};
|
const obj: any = unref(route.query) || {};
|
||||||
playData.value = {
|
playData.value = {
|
||||||
deviceId: obj?.deviceId || '',
|
deviceId: obj?.deviceId || '',
|
||||||
|
|
|
@ -38,8 +38,6 @@
|
||||||
:height='450'
|
:height='450'
|
||||||
:virtual='true'
|
:virtual='true'
|
||||||
@select='treeSelect'
|
@select='treeSelect'
|
||||||
:showLine="{ showLeafIcon: false }"
|
|
||||||
:show-icon="true"
|
|
||||||
>
|
>
|
||||||
<template #title="{ name, description }">
|
<template #title="{ name, description }">
|
||||||
<j-space>
|
<j-space>
|
||||||
|
|
|
@ -55,8 +55,6 @@
|
||||||
:height='450'
|
:height='450'
|
||||||
:virtual='true'
|
:virtual='true'
|
||||||
@select='treeSelect'
|
@select='treeSelect'
|
||||||
:showLine="{ showLeafIcon: false }"
|
|
||||||
:show-icon="true"
|
|
||||||
>
|
>
|
||||||
<template #title="{ name, description }">
|
<template #title="{ name, description }">
|
||||||
<j-space>
|
<j-space>
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
:selectedKeys="selectedKeys"
|
:selectedKeys="selectedKeys"
|
||||||
@drop="onDrop"
|
@drop="onDrop"
|
||||||
@dragend="onDragend"
|
@dragend="onDragend"
|
||||||
:showLine="{ showLeafIcon: false }"
|
|
||||||
:show-icon="true"
|
|
||||||
>
|
>
|
||||||
<template #title="row">
|
<template #title="row">
|
||||||
<div class="tree-content">
|
<div class="tree-content">
|
||||||
|
|
Loading…
Reference in New Issue