fix: bug#14090

* style: 更换首页图片

* fix: bug#12031

* fix: 修复产品跳转设备列表,查询显示错误问题

* fix: 修复修改密码错误提示

* fix: bug#14088

* fix: bug#14090
This commit is contained in:
XieYongHong 2023-05-23 10:15:25 +08:00 committed by GitHub
parent 23becbc2f1
commit ac45596551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 122 additions and 52 deletions

View File

@ -42,7 +42,7 @@ export default {
server.post(`/media/device/${deviceId}/${channelId}/_record`, data), server.post(`/media/device/${deviceId}/${channelId}/_record`, data),
// 停止录像 // 停止录像
recordStop: (deviceId: string, channelId: string, data: any) => recordStop: (deviceId: string, channelId: string, data?: any) =>
server.post(`/media/device/${deviceId}/${channelId}/_stop-record`, data), server.post(`/media/device/${deviceId}/${channelId}/_stop-record`, data),
// 查询本地回放记录 // 查询本地回放记录

View File

@ -1,5 +1,5 @@
<template> <template>
<j-advanced-search <AdvancedSearch
:target='target' :target='target'
:type='type' :type='type'
:request='saveSearchHistory' :request='saveSearchHistory'
@ -16,6 +16,7 @@
import { PropType } from 'vue' import { PropType } from 'vue'
import { JColumnsProps } from 'components/Table/types' import { JColumnsProps } from 'components/Table/types'
import { saveSearchHistory, getSearchHistory, deleteSearchHistory } from '@/api/comm' import { saveSearchHistory, getSearchHistory, deleteSearchHistory } from '@/api/comm'
import { AdvancedSearch } from 'jetlinks-ui-components'
interface Emit { interface Emit {
(e: 'search', data: any): void (e: 'search', data: any): void

View File

@ -13,7 +13,7 @@
name="oldPassword" name="oldPassword"
:rules="[ :rules="[
{ required: true, message: '请输入密码' }, { required: true, message: '请输入密码' },
{ validator: checkMothods.old, trigger: 'blur' }, { validator: checkMethods.old, trigger: 'blur' },
]" ]"
> >
<j-input <j-input
@ -24,9 +24,10 @@
<j-form-item <j-form-item
label="密码" label="密码"
name="newPassword" name="newPassword"
:rules="[ :rules="[
{ required: true, message: '请输入密码' }, { required: true, message: '请输入密码' },
{ validator: checkMothods.new, trigger: 'blur' }, { validator: checkMethods.new, trigger: 'blur' },
]" ]"
> >
<j-input-password <j-input-password
@ -39,7 +40,7 @@
name="confirmPassword" name="confirmPassword"
:rules="[ :rules="[
{ required: true, message: '请输入确认密码' }, { required: true, message: '请输入确认密码' },
{ validator: checkMothods.confirm, trigger: 'blur' }, { validator: checkMethods.confirm, trigger: 'blur' },
]" ]"
> >
<j-input-password <j-input-password
@ -72,9 +73,9 @@ const form = ref<formType>({
confirmPassword: '', confirmPassword: '',
}); });
const checkMothods = { const checkMethods = {
old: async (_rule: Rule, value: string) => { old: async (_rule: Rule, value: string) => {
if (!value) return Promise.reject(); if (!value) return Promise.reject('请输入密码');
try { try {
const resp: any = await checkOldPassword_api(value); const resp: any = await checkOldPassword_api(value);
if (resp.status === 200 && !resp.result.passed) if (resp.status === 200 && !resp.result.passed)
@ -85,7 +86,7 @@ const checkMothods = {
} }
}, },
new: async (_rule: Rule, value: string) => { new: async (_rule: Rule, value: string) => {
if (!value) return Promise.reject(); if (!value) return Promise.reject('请输入密码');
else if ( else if (
form.value.confirmPassword && form.value.confirmPassword &&
value !== form.value.confirmPassword value !== form.value.confirmPassword
@ -134,7 +135,7 @@ const handleOk = () => {
.finally(() => (loading.value = false)); .finally(() => (loading.value = false));
}); });
}; };
console.clear();
type formType = { type formType = {
oldPassword: string; oldPassword: string;
newPassword: string; newPassword: string;

View File

@ -81,6 +81,7 @@ watchEffect(() => {
dataIndex: `${i.id}_format`, dataIndex: `${i.id}_format`,
search: { search: {
type: i?.valueType?.type || 'string', type: i?.valueType?.type || 'string',
rename: i.id
}, },
}); });
}); });

View File

@ -89,7 +89,11 @@
{{ JSON.stringify(value?.formatValue) }} {{ JSON.stringify(value?.formatValue) }}
</div> </div>
<div v-else :class="valueClass"> <div v-else :class="valueClass">
{{ String(value?.formatValue) }} <div style='width: 100%;white-space: normal;'>
<j-ellipsis>
{{ String(value?.formatValue) }}
</j-ellipsis>
</div>
</div> </div>
<ValueDetail <ValueDetail
v-if="visible" v-if="visible"

View File

@ -758,10 +758,17 @@ const updateAccessData = async (id: string, values: any) => {
const result: any = {}; const result: any = {};
flatObj(values, result); flatObj(values, result);
const { storePolicy, ...extra } = result; const { storePolicy, ...extra } = result;
// undefinednull
let _metadata = ''
if (productStore.current?.metadata) {
_metadata = productStore.current?.metadata
} else if (productData.metadata && Object.keys(productData.metadata).length) {
_metadata = JSON.stringify(productData.metadata)
}
// () // ()
const accessObj = { const accessObj = {
...productStore.current, ...productStore.current,
metadata: JSON.stringify(productData.metadata || "{}"), metadata: _metadata,
transportProtocol: access.value?.transport, transportProtocol: access.value?.transport,
protocolName: access.value?.protocolDetail?.name, protocolName: access.value?.protocolDetail?.name,
accessId: access.value?.id, accessId: access.value?.id,

View File

@ -293,7 +293,7 @@ const getProtocol = async () => {
const jumpDevice = () => { const jumpDevice = () => {
// console.log(productStore.current?.id); // console.log(productStore.current?.id);
const searchParams = { const searchParams = {
column: 'productId', column: 'productName',
termType: 'eq', termType: 'eq',
value: productStore.current?.id, value: productStore.current?.id,
}; };

View File

@ -14,7 +14,7 @@
<j-col :span="12"><DeviceCountCard /></j-col> <j-col :span="12"><DeviceCountCard /></j-col>
<j-col :span="12"><BasicCountCard /></j-col> <j-col :span="12"><BasicCountCard /></j-col>
<j-col :span="24" style="margin-top: 24px"> <j-col :span="24" style="margin-top: 24px">
<PlatformPicCard image="/images/home/content1.svg" /> <PlatformPicCard image="/images/home/content.png" />
</j-col> </j-col>
</j-row> </j-row>
</j-col> </j-col>

View File

@ -122,6 +122,7 @@
:name='["configuration", item.name]' :name='["configuration", item.name]'
:label='item.label' :label='item.label'
:rules='item.rules' :rules='item.rules'
:required='!!item.type?.expands?.required'
> >
<ValueItem v-model:modelValue='formData.configuration[item.name]' :itemType='item.type' /> <ValueItem v-model:modelValue='formData.configuration[item.name]' :itemType='item.type' />
</j-form-item> </j-form-item>
@ -237,7 +238,7 @@ const getRules = (item: any) => {
typeName = '选择' typeName = '选择'
} }
if (item.required) { if (item.type?.expands?.required) {
rules.push( rules.push(
{ {
required: true, required: true,

View File

@ -27,7 +27,7 @@
opacity: 0; opacity: 0;
transition: opacity 0.3s; transition: opacity 0.3s;
&:hover { &.media-tool-show {
opacity: 1; opacity: 1;
} }

View File

@ -12,16 +12,41 @@
> >
<div class="media-live"> <div class="media-live">
<div class="media-live-video"> <div class="media-live-video">
<div class="media-tool"> <div :class="mediaToolClass" @mouseleave='mouseleave' @mouseenter='showTool = true' >
<div class="tool-item" @click.stop="handleRecord"> <div class="tool-item" >
{{ <template v-if='isRecord === 0'>
isRecord === 0 <j-dropdown trigger='click' @visibleChange='visibleChange' @click='showToolLock = true'>
? '开始录像' <div>
: isRecord === 1 开始录像
? '请求录像中' </div>
: '停止录像' <template #overlay>
}} <j-menu @click="recordStart">
<j-menu-item key='false'>
<span style='padding-right: 12px;'>本地存储</span>
<j-tooltip title='存储在设备本地'>
<a-icon type='QuestionCircleOutlined' />
</j-tooltip>
</j-menu-item>
<j-menu-item key='true'>
<span style='padding-right: 12px;'>云端存储</span>
<j-tooltip title='存储在服务器中'>
<a-icon type='QuestionCircleOutlined' />
</j-tooltip>
</j-menu-item>
</j-menu>
</template>
</j-dropdown>
</template>
<div v-else-if='isRecord === 1'>
请求录像中
</div> </div>
<div v-else-if='isRecord === 2' @click.stop="recordStop">
停止录像
</div>
</div>
<div class="tool-item" @click.stop="handleRefresh"> <div class="tool-item" @click.stop="handleRefresh">
刷新 刷新
</div> </div>
@ -91,6 +116,30 @@ const player = ref();
const url = ref(''); const url = ref('');
// //
const mediaType = ref<'mp4' | 'flv' | 'hls'>('mp4'); const mediaType = ref<'mp4' | 'flv' | 'hls'>('mp4');
const showTool = ref(false)
const showToolLock = ref(false)
const mouseleave = () => {
if (!showToolLock.value) {
showTool.value = false
}
}
const visibleChange = (v: boolean) => {
showTool.value = v
}
const getPopupContainer = (trigger: HTMLElement) => {
return trigger?.parentNode || document.body
}
const mediaToolClass = computed(() => {
return {
'media-tool': true,
'media-tool-show': showTool.value
}
})
/** /**
* 媒体开始播放 * 媒体开始播放
*/ */
@ -99,7 +148,7 @@ const mediaStart = () => {
props.data.deviceId, props.data.deviceId,
props.data.channelId, props.data.channelId,
mediaType.value, mediaType.value,
); )
}; };
// //
@ -116,32 +165,38 @@ const getIsRecord = async () => {
}; };
/** /**
* 点击录像/停止录像 * 开始录像
*/ */
const handleRecord = async () => { const recordStart = async ({ key }: { key: string}) => {
if (isRecord.value === 0) { showToolLock.value = false
isRecord.value = 1; showTool.value = false
const res = await channelApi.recordStart( isRecord.value = 1;
props.data.deviceId, const local = key === 'true'
props.data.channelId, const res = await channelApi.recordStart(
{ local: false }, props.data.deviceId,
); props.data.channelId,
if (res.success) { { local },
isRecord.value = 2; ).catch(() => ({ success: false }))
} else { if (res.success) {
isRecord.value = 0; isRecord.value = 2;
} } else {
} else if (isRecord.value === 2) { isRecord.value = 0;
const res = await channelApi.recordStop( }
props.data.deviceId, }
props.data.channelId,
{ local: false }, /**
); * 停止录像
if (res.success) { */
isRecord.value = 0; const recordStop = async () => {
} const res = await channelApi.recordStop(
} props.data.deviceId,
}; props.data.channelId
);
if (res.success) {
isRecord.value = 0;
}
}
/** /**
* 刷新 * 刷新

View File

@ -94,8 +94,8 @@ export default defineConfig(({ mode}) => {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
// target: 'http://192.168.32.226:8844', // target: 'http://192.168.32.226:8844',
// target: 'http://192.168.32.244:8881', // target: 'http://192.168.32.244:8881',
// target: 'http://120.77.179.54:8844', // 120测试 target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境 // target: 'http://192.168.33.46:8844', // 本地开发环境
ws: 'ws://192.168.33.46:8844', ws: 'ws://192.168.33.46:8844',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')