Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
JiangQiming 2023-03-23 15:36:46 +08:00
commit 1f6f7d23b4
13 changed files with 82 additions and 82 deletions

View File

@ -148,6 +148,9 @@ const extraRouteObj = {
'edge/Device': { 'edge/Device': {
children: [{ code: 'Remote', name: '远程控制' }], 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[]) => { export const findCodeRoute = (asyncRouterMap: any[]) => {
const routeMeta = {} const routeMeta = {}
function getDetail( code: string, url: string) { function getDetail(code: string, url: string) {
const detail = findDetailRouteItem(code, url) const detail = findDetailRouteItem(code, url)
if (!detail) return if (!detail) return
routeMeta[(detail as MenuItem).code] = { 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 => { data.forEach(route => {
routeMeta[route.code] = { routeMeta[route.code] = {
path: route.url || route.path, path: route.url || route.path,
@ -254,7 +257,7 @@ export const findCodeRoute = (asyncRouterMap: any[]) => {
return routeMeta 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 _asyncRouterMap = cloneDeep(asyncRouterMap)
const menusData: any[] = [] const menusData: any[] = []
const silderMenus: 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) route.children = findChildrenRoute(route.code, route.url, route.children)

View File

@ -162,7 +162,7 @@ import {
} from '@/api/device/instance'; } from '@/api/device/instance';
import MSelect from './MSelect.vue'; import MSelect from './MSelect.vue';
import PatchMapping from './PatchMapping.vue'; import PatchMapping from './PatchMapping.vue';
import { message } from 'ant-design-vue/es'; import { onlyMessage } from '@/utils/comm';
const columns = [ const columns = [
{ {
@ -280,7 +280,7 @@ const unbind = async (id: string) => {
}, },
); );
if (resp.status === 200) { if (resp.status === 200) {
message.success('操作成功!'); onlyMessage('操作成功!', 'success');
handleSearch(); handleSearch();
} }
} }
@ -313,7 +313,7 @@ const onSave = () => {
submitData, submitData,
); );
if (resp.status === 200) { if (resp.status === 200) {
message.success('操作成功!'); onlyMessage('操作成功!', 'success');
handleSearch(); handleSearch();
} }
} }
@ -342,7 +342,7 @@ const onAction = async (record: any) => {
submitData, submitData,
); );
if (resp.status === 200) { if (resp.status === 200) {
message.success('操作成功!'); onlyMessage('操作成功!', 'success');
handleSearch(); handleSearch();
} }
}; };

View File

@ -13,6 +13,7 @@
<j-image :src="value?.formatValue" /> <j-image :src="value?.formatValue" />
</template> </template>
<template v-else-if="['.flv', '.m3u8', '.mp4'].includes(type)"> <template v-else-if="['.flv', '.m3u8', '.mp4'].includes(type)">
<LivePlayer :url="value?.formatValue" autoplay />
</template> </template>
<template v-else> <template v-else>
<JsonViewer <JsonViewer
@ -25,6 +26,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import JsonViewer from 'vue-json-viewer'; import JsonViewer from 'vue-json-viewer';
import LivePlayer from '@/components/Player/index.vue';
const _data = defineProps({ const _data = defineProps({
type: { type: {

View File

@ -13,7 +13,7 @@
</div> </div>
<div v-else> <div v-else>
<p>{{ type === 'active' ? '启用' : '同步' }}成功{{ count }}</p> <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>
</div> </div>
<template #footer> <template #footer>
@ -56,13 +56,13 @@ const getData = (api: string) => {
source.value = _source; source.value = _source;
_source.onmessage = (e: any) => { _source.onmessage = (e: any) => {
const res = JSON.parse(e.data); const res = JSON.parse(e.data);
// console.log(res)
switch (props.type) { switch (props.type) {
case 'active': case 'active':
if (res.success) { if (res.success) {
_source.close(); _source.close();
dt += res.total; dt += res.total;
count.value = dt; count.value = dt;
flag.value = false;
} else { } else {
if (res.source) { if (res.source) {
errCount.value = 1 errCount.value = 1
@ -76,6 +76,7 @@ const getData = (api: string) => {
case 'sync': case 'sync':
dt += res; dt += res;
count.value = dt; count.value = dt;
flag.value = false;
break; break;
default: default:
break; break;

View File

@ -328,6 +328,7 @@ const columns = [
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
ellipsis: true,
search: { search: {
type: 'string', type: 'string',
defaultTermType: 'eq', defaultTermType: 'eq',
@ -337,6 +338,7 @@ const columns = [
title: '设备名称', title: '设备名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
ellipsis: true,
search: { search: {
type: 'string', type: 'string',
first: true, first: true,
@ -346,6 +348,7 @@ const columns = [
title: '产品名称', title: '产品名称',
dataIndex: 'productName', dataIndex: 'productName',
key: 'productName', key: 'productName',
ellipsis: true,
search: { search: {
type: 'select', type: 'select',
rename: 'productId', rename: 'productId',
@ -367,6 +370,7 @@ const columns = [
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
scopedSlots: true, scopedSlots: true,
width: 200,
search: { search: {
type: 'date', type: 'date',
}, },

View File

@ -33,7 +33,7 @@
" "
> >
<j-button <j-button
style="margin: 0 0 0 20px" class="changeBtn"
size="small" size="small"
:disabled=" :disabled="
productStore.current?.count && productStore.current?.count &&
@ -1085,4 +1085,10 @@ nextTick(() => {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
} }
.changeBtn{
margin: 0 0 0 20px;
color: #315EFB;
background: #ffffff;
border: 1px solid #315EFB
}
</style> </style>

View File

@ -1,7 +1,6 @@
<template> <template>
<page-container <page-container
:tabList="list" :tabList="list"
@back="onBack"
:tabActiveKey="productStore.tabActiveKey" :tabActiveKey="productStore.tabActiveKey"
@tabChange="onTabChange" @tabChange="onTabChange"
showBack="true" showBack="true"
@ -51,7 +50,17 @@
</div> </div>
<div style="padding-top: 10px"> <div style="padding-top: 10px">
<j-descriptions size="small" :column="4"> <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">{{ ><span @click="jumpDevice">{{
productStore.current?.count productStore.current?.count
? productStore.current?.count ? productStore.current?.count
@ -62,18 +71,6 @@
</div> </div>
</template> </template>
<template #extra> <template #extra>
<!-- <j-popconfirm
title="确认应用配置"
@confirm="handleCofig"
okText="确定"
cancelText="取消"
>
<j-button
:disabled="productStore.current.state === 0"
type="primary"
>应用配置</j-button
>
</j-popconfirm> -->
<PermissionButton <PermissionButton
type="primary" type="primary"
:popConfirm="{ :popConfirm="{
@ -172,7 +169,9 @@ watch(
getProtocol(); getProtocol();
}, },
); );
const onBack = () => {}; const onBack = () => {
history.back();
};
const onTabChange = (e: string) => { const onTabChange = (e: string) => {
productStore.tabActiveKey = e; productStore.tabActiveKey = e;
@ -250,7 +249,7 @@ const getProtocol = async () => {
tab: '数据解析', tab: '数据解析',
}, },
]; ];
}else{ } else {
list.value = [ list.value = [
{ {
key: 'Info', key: 'Info',
@ -264,7 +263,8 @@ const getProtocol = async () => {
{ {
key: 'Device', key: 'Device',
tab: '设备接入', tab: '设备接入',
},] },
];
} }
} }
} }

View File

@ -84,7 +84,7 @@
> >
<template #title="item"> <template #title="item">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
<a-tooltip :title="item" <a-tooltip :title="item.option.tooltip"
><AIcon ><AIcon
type="QuestionCircleOutlined" type="QuestionCircleOutlined"
style="margin-left: 2px" style="margin-left: 2px"

View File

@ -267,26 +267,26 @@ const columns = [
}), }),
}, },
}, },
{ // {
key: 'productId$product-info', // key: 'productId$product-info',
dataIndex: 'productId$product-info', // dataIndex: 'productId$product-info',
title: '接入方式', // title: '',
hideInTable: true, // hideInTable: true,
search: { // search: {
type: 'select', // type: 'select',
options: () => // options: () =>
new Promise((resolve) => { // new Promise((resolve) => {
queryGatewayList({}).then((resp: any) => { // queryGatewayList({}).then((resp: any) => {
resolve( // resolve(
resp.result.map((item: any) => ({ // resp.result.map((item: any) => ({
label: item.name, // label: item.name,
value: `accessId is ${item.id}`, // value: `accessId is ${item.id}`,
})), // })),
); // );
}); // });
}), // }),
}, // },
}, // },
{ {
dataIndex: 'deviceType', dataIndex: 'deviceType',
title: '设备类型', title: '设备类型',

View File

@ -20,7 +20,7 @@
<j-col :span="8">已下发数量{{ countErr + count }}</j-col> <j-col :span="8">已下发数量{{ countErr + count }}</j-col>
</j-row> </j-row>
<div v-if="!flag"> <div v-if="!flag">
<j-textarea :rows="20" :value="JSON.stringify(errMessage)" /> <j-textarea :rows="10" :value="JSON.stringify(errMessage)" />
</div> </div>
</j-modal> </j-modal>
</template> </template>
@ -86,7 +86,7 @@ const getData = () => {
et += 1; et += 1;
countErr.value = et; countErr.value = et;
flag.value = false; flag.value = false;
if (errMessages.length <= 5) { if (errMessages.length < 5) {
errMessages.push({ ...res }); errMessages.push({ ...res });
errMessage.value = [...errMessages]; errMessage.value = [...errMessages];
} }

View File

@ -169,7 +169,8 @@ const onCancel = () => {
<style lang="less" scoped> <style lang="less" scoped>
.search { .search {
padding: 0 0 0 24px; padding: 0px;
margin: 0px;
} }
.alert { .alert {
height: 40px; height: 40px;

View File

@ -1,13 +1,5 @@
<template> <template>
<j-modal <page-container>
visible
title="处理记录"
:width="1200"
cancelText="取消"
okText="确定"
@ok="clsoeModal"
@cancel="clsoeModal"
>
<pro-search <pro-search
:columns="columns" :columns="columns"
target="bind-channel" target="bind-channel"
@ -30,7 +22,7 @@
<span> <span>
{{ {{
dayjs(slotsProps.handleTime).format( dayjs(slotsProps.handleTime).format(
'YYYY-MM-DD HH:mm:ss' 'YYYY-MM-DD HH:mm:ss',
) )
}} }}
</span> </span>
@ -41,29 +33,25 @@
<template #alarmTime="slotProps"> <template #alarmTime="slotProps">
<span> <span>
{{ {{
dayjs(slotProps.alarmTime).format( dayjs(slotProps.alarmTime).format('YYYY-MM-DD HH:mm:ss')
'YYYY-MM-DD HH:mm:ss',
)
}} }}
</span> </span>
</template> </template>
</JProTable> </JProTable>
</j-modal> </page-container>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { queryHandleHistory } from '@/api/rule-engine/log'; import { queryHandleHistory } from '@/api/rule-engine/log';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
const props = defineProps({ import { useRoute } from 'vue-router';
data: { const route = useRoute();
type: Object, const id = route.query?.id;
},
});
const terms = [ const terms = [
{ {
column: 'alarmRecordId', column: 'alarmRecordId',
termType: 'eq', termType: 'eq',
value: props.data.id, value: id,
type: 'and', type: 'and',
}, },
]; ];
@ -119,9 +107,6 @@ const emit = defineEmits(['closeLog']);
/** /**
* 关闭弹窗 * 关闭弹窗
*/ */
const clsoeModal = () => {
emit('closeLog');
};
const handleSearch = (e: any) => { const handleSearch = (e: any) => {
params.value = e; params.value = e;

View File

@ -136,11 +136,6 @@
v-if="data.solveVisible" v-if="data.solveVisible"
@closeSolve="closeSolve" @closeSolve="closeSolve"
/> />
<SolveLog
:data="data.current"
v-if="data.logVisible"
@closeLog="closeLog"
/>
</div> </div>
</template> </template>
@ -412,8 +407,11 @@ const getActions = (
}, },
icon: 'FileTextOutlined', icon: 'FileTextOutlined',
onClick: () => { onClick: () => {
data.value.current = currentData; menuStory.jumpPage(
data.value.logVisible = true; 'rule-engine/Alarm/Log/Record',
{},
{ id: currentData.id },
);
}, },
}, },
]; ];