Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
1f6f7d23b4
|
@ -148,6 +148,9 @@ const extraRouteObj = {
|
|||
'edge/Device': {
|
||||
children: [{ code: 'Remote', name: '远程控制' }],
|
||||
},
|
||||
'rule-engine/Alarm/Log': {
|
||||
children: [{ code: 'Record', name: '处理记录' }]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -206,7 +209,7 @@ const findDetailRoutes = (routes: any[]): any[] => {
|
|||
export const findCodeRoute = (asyncRouterMap: any[]) => {
|
||||
const routeMeta = {}
|
||||
|
||||
function getDetail( code: string, url: string) {
|
||||
function getDetail(code: string, url: string) {
|
||||
const detail = findDetailRouteItem(code, url)
|
||||
if (!detail) return
|
||||
routeMeta[(detail as MenuItem).code] = {
|
||||
|
@ -217,7 +220,7 @@ export const findCodeRoute = (asyncRouterMap: any[]) => {
|
|||
}
|
||||
}
|
||||
|
||||
function findChildren (data: any[], code: string = '') {
|
||||
function findChildren(data: any[], code: string = '') {
|
||||
data.forEach(route => {
|
||||
routeMeta[route.code] = {
|
||||
path: route.url || route.path,
|
||||
|
@ -254,7 +257,7 @@ export const findCodeRoute = (asyncRouterMap: any[]) => {
|
|||
return routeMeta
|
||||
}
|
||||
|
||||
export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = 1): { menusData: any, silderMenus: any} {
|
||||
export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = 1): { menusData: any, silderMenus: any } {
|
||||
const _asyncRouterMap = cloneDeep(asyncRouterMap)
|
||||
const menusData: any[] = []
|
||||
const silderMenus: any[] = []
|
||||
|
@ -270,7 +273,7 @@ export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level =
|
|||
},
|
||||
}
|
||||
|
||||
const silder = {..._route}
|
||||
const silder = { ..._route }
|
||||
|
||||
// 查看是否有隐藏子路由
|
||||
route.children = findChildrenRoute(route.code, route.url, route.children)
|
||||
|
|
|
@ -162,7 +162,7 @@ import {
|
|||
} from '@/api/device/instance';
|
||||
import MSelect from './MSelect.vue';
|
||||
import PatchMapping from './PatchMapping.vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { onlyMessage } from '@/utils/comm';
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -280,7 +280,7 @@ const unbind = async (id: string) => {
|
|||
},
|
||||
);
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功!');
|
||||
onlyMessage('操作成功!', 'success');
|
||||
handleSearch();
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ const onSave = () => {
|
|||
submitData,
|
||||
);
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功!');
|
||||
onlyMessage('操作成功!', 'success');
|
||||
handleSearch();
|
||||
}
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ const onAction = async (record: any) => {
|
|||
submitData,
|
||||
);
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功!');
|
||||
onlyMessage('操作成功!', 'success');
|
||||
handleSearch();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<j-image :src="value?.formatValue" />
|
||||
</template>
|
||||
<template v-else-if="['.flv', '.m3u8', '.mp4'].includes(type)">
|
||||
<LivePlayer :url="value?.formatValue" autoplay />
|
||||
</template>
|
||||
<template v-else>
|
||||
<JsonViewer
|
||||
|
@ -25,6 +26,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import JsonViewer from 'vue-json-viewer';
|
||||
import LivePlayer from '@/components/Player/index.vue';
|
||||
|
||||
const _data = defineProps({
|
||||
type: {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div v-else>
|
||||
<p>{{ type === 'active' ? '启用' : '同步' }}成功:{{ count }}条</p>
|
||||
<p v-if="type === 'active'">启用失败:{{ errCount }}条<j-tooltip title="实例信息页面中的配置项未完善"><AIcon type="QuestionCircleOutlined" /></j-tooltip></p>
|
||||
<p v-if="type === 'active'">启用失败:{{ errCount }}条<j-tooltip title="实例信息页面中的配置项未完善"><AIcon style="margin-left: 5px" type="QuestionCircleOutlined" /></j-tooltip></p>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
@ -56,13 +56,13 @@ const getData = (api: string) => {
|
|||
source.value = _source;
|
||||
_source.onmessage = (e: any) => {
|
||||
const res = JSON.parse(e.data);
|
||||
// console.log(res)
|
||||
switch (props.type) {
|
||||
case 'active':
|
||||
if (res.success) {
|
||||
_source.close();
|
||||
dt += res.total;
|
||||
count.value = dt;
|
||||
flag.value = false;
|
||||
} else {
|
||||
if (res.source) {
|
||||
errCount.value = 1
|
||||
|
@ -76,6 +76,7 @@ const getData = (api: string) => {
|
|||
case 'sync':
|
||||
dt += res;
|
||||
count.value = dt;
|
||||
flag.value = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -328,6 +328,7 @@ const columns = [
|
|||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
defaultTermType: 'eq',
|
||||
|
@ -337,6 +338,7 @@ const columns = [
|
|||
title: '设备名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
first: true,
|
||||
|
@ -346,6 +348,7 @@ const columns = [
|
|||
title: '产品名称',
|
||||
dataIndex: 'productName',
|
||||
key: 'productName',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'select',
|
||||
rename: 'productId',
|
||||
|
@ -367,6 +370,7 @@ const columns = [
|
|||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
scopedSlots: true,
|
||||
width: 200,
|
||||
search: {
|
||||
type: 'date',
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"
|
||||
>
|
||||
<j-button
|
||||
style="margin: 0 0 0 20px"
|
||||
class="changeBtn"
|
||||
size="small"
|
||||
:disabled="
|
||||
productStore.current?.count &&
|
||||
|
@ -1085,4 +1085,10 @@ nextTick(() => {
|
|||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
}
|
||||
.changeBtn{
|
||||
margin: 0 0 0 20px;
|
||||
color: #315EFB;
|
||||
background: #ffffff;
|
||||
border: 1px solid #315EFB
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<page-container
|
||||
:tabList="list"
|
||||
@back="onBack"
|
||||
:tabActiveKey="productStore.tabActiveKey"
|
||||
@tabChange="onTabChange"
|
||||
showBack="true"
|
||||
|
@ -51,7 +50,17 @@
|
|||
</div>
|
||||
<div style="padding-top: 10px">
|
||||
<j-descriptions size="small" :column="4">
|
||||
<j-descriptions-item label="设备数量"
|
||||
<j-descriptions-item
|
||||
label="设备数量"
|
||||
:labelStyle="{
|
||||
fontSize: '14px',
|
||||
opacity: 0.55,
|
||||
}"
|
||||
:contentStyle="{
|
||||
fontSize: '14px',
|
||||
color: '#092EE7',
|
||||
cursor: 'pointer',
|
||||
}"
|
||||
><span @click="jumpDevice">{{
|
||||
productStore.current?.count
|
||||
? productStore.current?.count
|
||||
|
@ -62,18 +71,6 @@
|
|||
</div>
|
||||
</template>
|
||||
<template #extra>
|
||||
<!-- <j-popconfirm
|
||||
title="确认应用配置"
|
||||
@confirm="handleCofig"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<j-button
|
||||
:disabled="productStore.current.state === 0"
|
||||
type="primary"
|
||||
>应用配置</j-button
|
||||
>
|
||||
</j-popconfirm> -->
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
:popConfirm="{
|
||||
|
@ -172,7 +169,9 @@ watch(
|
|||
getProtocol();
|
||||
},
|
||||
);
|
||||
const onBack = () => {};
|
||||
const onBack = () => {
|
||||
history.back();
|
||||
};
|
||||
|
||||
const onTabChange = (e: string) => {
|
||||
productStore.tabActiveKey = e;
|
||||
|
@ -250,7 +249,7 @@ const getProtocol = async () => {
|
|||
tab: '数据解析',
|
||||
},
|
||||
];
|
||||
}else{
|
||||
} else {
|
||||
list.value = [
|
||||
{
|
||||
key: 'Info',
|
||||
|
@ -264,7 +263,8 @@ const getProtocol = async () => {
|
|||
{
|
||||
key: 'Device',
|
||||
tab: '设备接入',
|
||||
},]
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
>
|
||||
<template #title="item">
|
||||
<span>{{ item.title }}</span>
|
||||
<a-tooltip :title="item"
|
||||
<a-tooltip :title="item.option.tooltip"
|
||||
><AIcon
|
||||
type="QuestionCircleOutlined"
|
||||
style="margin-left: 2px"
|
||||
|
|
|
@ -267,26 +267,26 @@ const columns = [
|
|||
}),
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'productId$product-info',
|
||||
dataIndex: 'productId$product-info',
|
||||
title: '接入方式',
|
||||
hideInTable: true,
|
||||
search: {
|
||||
type: 'select',
|
||||
options: () =>
|
||||
new Promise((resolve) => {
|
||||
queryGatewayList({}).then((resp: any) => {
|
||||
resolve(
|
||||
resp.result.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: `accessId is ${item.id}`,
|
||||
})),
|
||||
);
|
||||
});
|
||||
}),
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'productId$product-info',
|
||||
// dataIndex: 'productId$product-info',
|
||||
// title: '接入方式',
|
||||
// hideInTable: true,
|
||||
// search: {
|
||||
// type: 'select',
|
||||
// options: () =>
|
||||
// new Promise((resolve) => {
|
||||
// queryGatewayList({}).then((resp: any) => {
|
||||
// resolve(
|
||||
// resp.result.map((item: any) => ({
|
||||
// label: item.name,
|
||||
// value: `accessId is ${item.id}`,
|
||||
// })),
|
||||
// );
|
||||
// });
|
||||
// }),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
dataIndex: 'deviceType',
|
||||
title: '设备类型',
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<j-col :span="8">已下发数量:{{ countErr + count }}</j-col>
|
||||
</j-row>
|
||||
<div v-if="!flag">
|
||||
<j-textarea :rows="20" :value="JSON.stringify(errMessage)" />
|
||||
<j-textarea :rows="10" :value="JSON.stringify(errMessage)" />
|
||||
</div>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
@ -86,7 +86,7 @@ const getData = () => {
|
|||
et += 1;
|
||||
countErr.value = et;
|
||||
flag.value = false;
|
||||
if (errMessages.length <= 5) {
|
||||
if (errMessages.length < 5) {
|
||||
errMessages.push({ ...res });
|
||||
errMessage.value = [...errMessages];
|
||||
}
|
||||
|
|
|
@ -169,7 +169,8 @@ const onCancel = () => {
|
|||
|
||||
<style lang="less" scoped>
|
||||
.search {
|
||||
padding: 0 0 0 24px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
.alert {
|
||||
height: 40px;
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
<template>
|
||||
<j-modal
|
||||
visible
|
||||
title="处理记录"
|
||||
:width="1200"
|
||||
cancelText="取消"
|
||||
okText="确定"
|
||||
@ok="clsoeModal"
|
||||
@cancel="clsoeModal"
|
||||
>
|
||||
<page-container>
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="bind-channel"
|
||||
|
@ -30,7 +22,7 @@
|
|||
<span>
|
||||
{{
|
||||
dayjs(slotsProps.handleTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss'
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
|
@ -41,29 +33,25 @@
|
|||
<template #alarmTime="slotProps">
|
||||
<span>
|
||||
{{
|
||||
dayjs(slotProps.alarmTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
dayjs(slotProps.alarmTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</JProTable>
|
||||
</j-modal>
|
||||
</page-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { queryHandleHistory } from '@/api/rule-engine/log';
|
||||
import dayjs from 'dayjs';
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
},
|
||||
});
|
||||
import { useRoute } from 'vue-router';
|
||||
const route = useRoute();
|
||||
const id = route.query?.id;
|
||||
const terms = [
|
||||
{
|
||||
column: 'alarmRecordId',
|
||||
termType: 'eq',
|
||||
value: props.data.id,
|
||||
value: id,
|
||||
type: 'and',
|
||||
},
|
||||
];
|
||||
|
@ -119,9 +107,6 @@ const emit = defineEmits(['closeLog']);
|
|||
/**
|
||||
* 关闭弹窗
|
||||
*/
|
||||
const clsoeModal = () => {
|
||||
emit('closeLog');
|
||||
};
|
||||
|
||||
const handleSearch = (e: any) => {
|
||||
params.value = e;
|
|
@ -136,11 +136,6 @@
|
|||
v-if="data.solveVisible"
|
||||
@closeSolve="closeSolve"
|
||||
/>
|
||||
<SolveLog
|
||||
:data="data.current"
|
||||
v-if="data.logVisible"
|
||||
@closeLog="closeLog"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -412,8 +407,11 @@ const getActions = (
|
|||
},
|
||||
icon: 'FileTextOutlined',
|
||||
onClick: () => {
|
||||
data.value.current = currentData;
|
||||
data.value.logVisible = true;
|
||||
menuStory.jumpPage(
|
||||
'rule-engine/Alarm/Log/Record',
|
||||
{},
|
||||
{ id: currentData.id },
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue