fix: bug#14090
* style: 更换首页图片 * fix: bug#12031 * fix: 修复产品跳转设备列表,查询显示错误问题 * fix: 修复修改密码错误提示 * fix: bug#14088 * fix: bug#14090
This commit is contained in:
parent
23becbc2f1
commit
ac45596551
|
@ -42,7 +42,7 @@ export default {
|
|||
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),
|
||||
|
||||
// 查询本地回放记录
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<j-advanced-search
|
||||
<AdvancedSearch
|
||||
:target='target'
|
||||
:type='type'
|
||||
:request='saveSearchHistory'
|
||||
|
@ -16,6 +16,7 @@
|
|||
import { PropType } from 'vue'
|
||||
import { JColumnsProps } from 'components/Table/types'
|
||||
import { saveSearchHistory, getSearchHistory, deleteSearchHistory } from '@/api/comm'
|
||||
import { AdvancedSearch } from 'jetlinks-ui-components'
|
||||
|
||||
interface Emit {
|
||||
(e: 'search', data: any): void
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
name="oldPassword"
|
||||
:rules="[
|
||||
{ required: true, message: '请输入密码' },
|
||||
{ validator: checkMothods.old, trigger: 'blur' },
|
||||
{ validator: checkMethods.old, trigger: 'blur' },
|
||||
]"
|
||||
>
|
||||
<j-input
|
||||
|
@ -24,9 +24,10 @@
|
|||
<j-form-item
|
||||
label="密码"
|
||||
name="newPassword"
|
||||
|
||||
:rules="[
|
||||
{ required: true, message: '请输入密码' },
|
||||
{ validator: checkMothods.new, trigger: 'blur' },
|
||||
{ validator: checkMethods.new, trigger: 'blur' },
|
||||
]"
|
||||
>
|
||||
<j-input-password
|
||||
|
@ -39,7 +40,7 @@
|
|||
name="confirmPassword"
|
||||
:rules="[
|
||||
{ required: true, message: '请输入确认密码' },
|
||||
{ validator: checkMothods.confirm, trigger: 'blur' },
|
||||
{ validator: checkMethods.confirm, trigger: 'blur' },
|
||||
]"
|
||||
>
|
||||
<j-input-password
|
||||
|
@ -72,9 +73,9 @@ const form = ref<formType>({
|
|||
confirmPassword: '',
|
||||
});
|
||||
|
||||
const checkMothods = {
|
||||
const checkMethods = {
|
||||
old: async (_rule: Rule, value: string) => {
|
||||
if (!value) return Promise.reject();
|
||||
if (!value) return Promise.reject('请输入密码');
|
||||
try {
|
||||
const resp: any = await checkOldPassword_api(value);
|
||||
if (resp.status === 200 && !resp.result.passed)
|
||||
|
@ -85,7 +86,7 @@ const checkMothods = {
|
|||
}
|
||||
},
|
||||
new: async (_rule: Rule, value: string) => {
|
||||
if (!value) return Promise.reject();
|
||||
if (!value) return Promise.reject('请输入密码');
|
||||
else if (
|
||||
form.value.confirmPassword &&
|
||||
value !== form.value.confirmPassword
|
||||
|
@ -134,7 +135,7 @@ const handleOk = () => {
|
|||
.finally(() => (loading.value = false));
|
||||
});
|
||||
};
|
||||
console.clear();
|
||||
|
||||
type formType = {
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
|
|
|
@ -81,6 +81,7 @@ watchEffect(() => {
|
|||
dataIndex: `${i.id}_format`,
|
||||
search: {
|
||||
type: i?.valueType?.type || 'string',
|
||||
rename: i.id
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
@ -89,7 +89,11 @@
|
|||
{{ JSON.stringify(value?.formatValue) }}
|
||||
</div>
|
||||
<div v-else :class="valueClass">
|
||||
<div style='width: 100%;white-space: normal;'>
|
||||
<j-ellipsis>
|
||||
{{ String(value?.formatValue) }}
|
||||
</j-ellipsis>
|
||||
</div>
|
||||
</div>
|
||||
<ValueDetail
|
||||
v-if="visible"
|
||||
|
|
|
@ -758,10 +758,17 @@ const updateAccessData = async (id: string, values: any) => {
|
|||
const result: any = {};
|
||||
flatObj(values, result);
|
||||
const { storePolicy, ...extra } = result;
|
||||
// 产品有物模型,设备接入没有,取产品物模型;设备接入有物模型,产品没有,取设备接入的物模型;否则取空字符串;不能为undefined或者null
|
||||
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 = {
|
||||
...productStore.current,
|
||||
metadata: JSON.stringify(productData.metadata || "{}"),
|
||||
metadata: _metadata,
|
||||
transportProtocol: access.value?.transport,
|
||||
protocolName: access.value?.protocolDetail?.name,
|
||||
accessId: access.value?.id,
|
||||
|
|
|
@ -293,7 +293,7 @@ const getProtocol = async () => {
|
|||
const jumpDevice = () => {
|
||||
// console.log(productStore.current?.id);
|
||||
const searchParams = {
|
||||
column: 'productId',
|
||||
column: 'productName',
|
||||
termType: 'eq',
|
||||
value: productStore.current?.id,
|
||||
};
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<j-col :span="12"><DeviceCountCard /></j-col>
|
||||
<j-col :span="12"><BasicCountCard /></j-col>
|
||||
<j-col :span="24" style="margin-top: 24px">
|
||||
<PlatformPicCard image="/images/home/content1.svg" />
|
||||
<PlatformPicCard image="/images/home/content.png" />
|
||||
</j-col>
|
||||
</j-row>
|
||||
</j-col>
|
||||
|
|
|
@ -122,6 +122,7 @@
|
|||
:name='["configuration", item.name]'
|
||||
:label='item.label'
|
||||
:rules='item.rules'
|
||||
:required='!!item.type?.expands?.required'
|
||||
>
|
||||
<ValueItem v-model:modelValue='formData.configuration[item.name]' :itemType='item.type' />
|
||||
</j-form-item>
|
||||
|
@ -237,7 +238,7 @@ const getRules = (item: any) => {
|
|||
typeName = '选择'
|
||||
}
|
||||
|
||||
if (item.required) {
|
||||
if (item.type?.expands?.required) {
|
||||
rules.push(
|
||||
{
|
||||
required: true,
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
|
||||
&:hover {
|
||||
&.media-tool-show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,16 +12,41 @@
|
|||
>
|
||||
<div class="media-live">
|
||||
<div class="media-live-video">
|
||||
<div class="media-tool">
|
||||
<div class="tool-item" @click.stop="handleRecord">
|
||||
{{
|
||||
isRecord === 0
|
||||
? '开始录像'
|
||||
: isRecord === 1
|
||||
? '请求录像中'
|
||||
: '停止录像'
|
||||
}}
|
||||
<div :class="mediaToolClass" @mouseleave='mouseleave' @mouseenter='showTool = true' >
|
||||
<div class="tool-item" >
|
||||
<template v-if='isRecord === 0'>
|
||||
<j-dropdown trigger='click' @visibleChange='visibleChange' @click='showToolLock = true'>
|
||||
<div>
|
||||
开始录像
|
||||
</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 v-else-if='isRecord === 2' @click.stop="recordStop">
|
||||
停止录像
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="tool-item" @click.stop="handleRefresh">
|
||||
刷新
|
||||
</div>
|
||||
|
@ -91,6 +116,30 @@ const player = ref();
|
|||
const url = ref('');
|
||||
// 视频类型
|
||||
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.channelId,
|
||||
mediaType.value,
|
||||
);
|
||||
)
|
||||
};
|
||||
|
||||
// 录像状态
|
||||
|
@ -116,32 +165,38 @@ const getIsRecord = async () => {
|
|||
};
|
||||
|
||||
/**
|
||||
* 点击录像/停止录像
|
||||
* 开始录像
|
||||
*/
|
||||
const handleRecord = async () => {
|
||||
if (isRecord.value === 0) {
|
||||
const recordStart = async ({ key }: { key: string}) => {
|
||||
showToolLock.value = false
|
||||
showTool.value = false
|
||||
isRecord.value = 1;
|
||||
const local = key === 'true'
|
||||
const res = await channelApi.recordStart(
|
||||
props.data.deviceId,
|
||||
props.data.channelId,
|
||||
{ local: false },
|
||||
);
|
||||
{ local },
|
||||
).catch(() => ({ success: false }))
|
||||
if (res.success) {
|
||||
isRecord.value = 2;
|
||||
} else {
|
||||
isRecord.value = 0;
|
||||
}
|
||||
} else if (isRecord.value === 2) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止录像
|
||||
*/
|
||||
const recordStop = async () => {
|
||||
const res = await channelApi.recordStop(
|
||||
props.data.deviceId,
|
||||
props.data.channelId,
|
||||
{ local: false },
|
||||
props.data.channelId
|
||||
);
|
||||
if (res.success) {
|
||||
isRecord.value = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
|
|
|
@ -94,8 +94,8 @@ export default defineConfig(({ mode}) => {
|
|||
[env.VITE_APP_BASE_API]: {
|
||||
// target: 'http://192.168.32.226:8844',
|
||||
// target: 'http://192.168.32.244:8881',
|
||||
// target: 'http://120.77.179.54:8844', // 120测试
|
||||
target: 'http://192.168.33.46:8844', // 本地开发环境
|
||||
target: 'http://120.77.179.54:8844', // 120测试
|
||||
// target: 'http://192.168.33.46:8844', // 本地开发环境
|
||||
ws: 'ws://192.168.33.46:8844',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
|
|
Loading…
Reference in New Issue