diff --git a/.gitignore b/.gitignore index 8ee54e8..0ef6628 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,9 @@ coverage *.sw? *.tsbuildinfo + +# AI 工具生成的文件和文件夹 +.video_agent/ +.mimosa/ +.v2c/ +.zcode/ diff --git a/src/components/PreviewJson/index.vue b/src/components/PreviewJson/index.vue index f91964e..4b30e4f 100644 --- a/src/components/PreviewJson/index.vue +++ b/src/components/PreviewJson/index.vue @@ -3,14 +3,17 @@
{{ jsonView }}
-
查看json
+
{{ props.buttonText }}
- -
-
{{ displayData.content }}
- + +
+ +
+
{{ displayData.content }}
+ +
@@ -25,7 +28,9 @@ import "vue-json-pretty/lib/styles.css" type Props = { width?: number json?: string - lazyJson?: () => Promise + lazyJson?: () => Promise + buttonText?: string + dialogTitle?: string } const state = reactive({ @@ -35,9 +40,12 @@ const state = reactive({ const props = withDefaults(defineProps(), { width: 0, json: "", + buttonText: "查看json", + dialogTitle: "JSON 详情", }) const jsonViewVisible = ref(false) +const loading = ref(false) const displayData = computed(() => { // 优先使用 lazyJson 返回的数据,如果没有则使用 props.json @@ -74,16 +82,17 @@ const jsonViewStyle = computed(() => { // 点击事件 const clickJsonView = async () => { jsonViewVisible.value = true - console.log("props:", props); if (props.lazyJson) { + state.jsonData = null + loading.value = true try { const string = await props.lazyJson() - if (string) { - state.jsonData = string - } + state.jsonData = string || "" } catch (error) { console.error("lazyJson error:", error) + } finally { + loading.value = false } } } @@ -109,14 +118,18 @@ const clickJsonView = async () => { } .html-preview { - max-height: 60vh; - overflow: auto; -} - -.text-preview { - max-height: 60vh; - overflow: auto; white-space: pre-wrap; word-break: break-all; } + +.text-preview { + white-space: pre-wrap; + word-break: break-all; +} + +.json-preview-content { + min-height: 80px; + max-height: 60vh; + overflow: auto; +} diff --git a/src/views/area/_components/bindCameraForm.vue b/src/views/area/_components/bindCameraForm.vue index 16b00ee..69e45b1 100644 --- a/src/views/area/_components/bindCameraForm.vue +++ b/src/views/area/_components/bindCameraForm.vue @@ -48,6 +48,12 @@ :controls="false" class="w-full" placeholder="请输入0-359度,留空则朝向当前视角" /> + + + + + @@ -87,6 +93,7 @@ const form = reactive({ y: '', z: '', cameraDirection: null, + cameraPitch: null, }); // 定义校验规则 @@ -111,6 +118,7 @@ const openDialog = (areaHouseId: string, bindId?: string) => { y: '', z: '', cameraDirection: null, + cameraPitch: null, }) // 表单值已在上方重置,这里只清除上次打开残留的校验状态 nextTick(() => { @@ -178,6 +186,7 @@ const getareaHouseDeviceData = async (bindId: any, areaHouseId: any) => { form.y = houseDeviceRes.y form.z = houseDeviceRes.z form.cameraDirection = houseDeviceRes.cameraDirection ?? null + form.cameraPitch = houseDeviceRes.cameraPitch ?? null } } else if (areaHouseId) { const { data: houseRes } = await AreaHouseApi.getObj(areaHouseId) diff --git a/src/views/area/_components/bindCameraTable.vue b/src/views/area/_components/bindCameraTable.vue index 574e61b..e2e8936 100644 --- a/src/views/area/_components/bindCameraTable.vue +++ b/src/views/area/_components/bindCameraTable.vue @@ -33,6 +33,14 @@ 默认朝向视角 + + + diff --git a/src/views/collection/car/components/gate-log-list.vue b/src/views/collection/car/components/gate-log-list.vue index 91d0aab..88901f9 100644 --- a/src/views/collection/car/components/gate-log-list.vue +++ b/src/views/collection/car/components/gate-log-list.vue @@ -28,6 +28,16 @@ + + + @@ -40,8 +50,20 @@ import { BasicTableProps, useTable } from "/@/hooks/table"; const queryRef = ref(); const state: BasicTableProps = reactive({ queryForm: {}, pageList: ComDhLogApi.fetchList }); const { getDataList, sizeChangeHandle, currentChangeHandle, tableStyle } = useTable(state); +const getFullJson = (id: string, field: "req" | "res") => async () => { + const { data } = await ComDhLogApi.getObj(id); + return data?.[field] || ""; +}; const resetQuery = () => { queryRef.value?.resetFields(); getDataList(); }; + + diff --git a/src/views/collection/door/components/door-log-list.vue b/src/views/collection/door/components/door-log-list.vue index 832518c..0611eda 100644 --- a/src/views/collection/door/components/door-log-list.vue +++ b/src/views/collection/door/components/door-log-list.vue @@ -32,6 +32,16 @@ + + + @@ -51,9 +61,21 @@ const initialQuery = () => ({ }); const state: BasicTableProps = reactive({ queryForm: initialQuery(), pageList: ComDhLogApi.fetchList }); const { getDataList, sizeChangeHandle, currentChangeHandle, tableStyle } = useTable(state); +const getFullJson = (id: string, field: "req" | "res") => async () => { + const { data } = await ComDhLogApi.getObj(id); + return data?.[field] || ""; +}; const resetQuery = () => { queryRef.value?.resetFields(); Object.assign(state.queryForm, initialQuery()); getDataList(); }; + +