Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
FLL
2025-07-26 17:10:10 +08:00
10 changed files with 140 additions and 50 deletions

View File

@@ -14,6 +14,7 @@
<!-- 由 vite 注入 VITE_APP_TITLE 变量,在 .env 文件内配置 -->
<title><%= VITE_APP_TITLE %></title>
<link rel="icon" href="/favicon.ico" />
<script type="text/javascript" src="/EasyPlayer-element.min.js"></script>
</head>
<body>
<div id="app"></div>

View File

@@ -144,9 +144,9 @@ export interface PersonForm extends BaseEntity {
*/
authGroupId?: string | number
begDate?: string
authBegDate?: string
endDate?: string
authEndDate?: string
}
export interface PersonQuery extends PageQuery {

View File

@@ -5,6 +5,7 @@ import { renderDict } from "#/utils/render"
import { resident_unitList } from "#/api/property/resident/unit"
import { authGroupList } from '#/api/sis/authGroup'
import type { AuthGroupVO, AuthGroupQuery } from '#/api/sis/authGroup/model'
import { toRaw } from 'vue'
export const querySchema: FormSchemaGetter = () => [
@@ -151,15 +152,16 @@ export const modalSchema: FormSchemaGetter = () => [
label: '性别',
fieldName: 'gender',
component: "Select",
componentProps:{
componentProps: {
options: getDictOptions('sys_user_sex')
},
rules: 'required',
},
{
label: '身份证号',
label: '证号',
fieldName: 'idCard',
component: "Input",
rules: 'required',
},
{
label: '邮箱',
@@ -221,12 +223,23 @@ export const modalSchema: FormSchemaGetter = () => [
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
dependencies: {
show: (values) => {
return typeof (values.id) !== 'undefined'
},
triggerFields: ['id'],
}
},
{
label: '通行权限组',
fieldName: 'authGroupId',
component: 'ApiSelect',
dependencies: {
show: (values) => {
return typeof (values.id) !== 'undefined'
},
triggerFields: ['id'],
},
componentProps: {
resultField: 'list', // 根据API返回结构调整
labelField: 'name',
@@ -244,8 +257,7 @@ export const modalSchema: FormSchemaGetter = () => [
}
return authGroupArr
},
},
rules: 'required',
}
},
{
label: '人脸图片',

View File

@@ -1,56 +1,60 @@
<script setup lang="ts">
import {computed, reactive, ref} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {$t} from '@vben/locales';
import {cloneDeep} from '@vben/utils';
import {useVbenForm} from '#/adapter/form';
import {personAdd, personInfo, personUpdate} from '#/api/property/resident/person';
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchema} from './data';
import QueryUserList from './query-user-list.vue'
import QueryUnitList from './query-unit-list.vue'
import { computed, reactive, ref } from "vue";
import { useVbenModal } from "@vben/common-ui";
import { $t } from "@vben/locales";
import { cloneDeep } from "@vben/utils";
import { useVbenForm } from "#/adapter/form";
import {
personAdd,
personInfo,
personUpdate,
} from "#/api/property/resident/person";
import { defaultFormValueGetter, useBeforeCloseDiff } from "#/utils/popup";
import { modalSchema } from "./data";
import QueryUserList from "./query-user-list.vue";
import QueryUnitList from "./query-unit-list.vue";
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
return isUpdate.value ? $t("pages.common.edit") : $t("pages.common.add");
});
let userInfo = reactive({
userId: '',
userName: '',
phone: '',
gender: '',
userId: "",
userName: "",
phone: "",
gender: "",
});
let unitName = ref('');
let unitName = ref("");
const userId = ref<number | string>(0);
const unitId = ref<string>('');
const unitId = ref<string>("");
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-1',
formItemClass: "col-span-1",
// 默认label宽度 px
labelWidth: 100,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
class: "w-full",
},
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
wrapperClass: "grid-cols-2",
});
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
}
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[70%]',
class: "w-[70%]",
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
@@ -61,14 +65,14 @@ const [BasicModal, modalApi] = useVbenModal({
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id?: number | string };
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await personInfo(id);
userId.value = record.userId;
unitId.value = record.unitId.toString();
record.state=record.state?.toString()
record.state = record.state?.toString();
await formApi.setValues(record);
}
await markInitialized();
@@ -80,7 +84,7 @@ const [BasicModal, modalApi] = useVbenModal({
async function handleConfirm() {
try {
modalApi.lock(true);
const {valid} = await formApi.validate();
const { valid } = await formApi.validate();
if (!valid) {
return;
}
@@ -91,15 +95,17 @@ async function handleConfirm() {
// data.phone = userInfo.phone
// data.gender = userInfo.gender
// }
if(unitName.value){
data.unitName = unitName.value
if (unitName.value) {
data.unitName = unitName.value;
}
data.begDate = data.authTime[0]
data.endDate = data.authTime[1]
if (isUpdate.value && data.authTime !== 0) {
data.authBegDate = data.authTime[0];
data.authEndDate = data.authTime[1];
}
await (isUpdate.value ? personUpdate(data) : personAdd(data));
resetInitialized();
emit('reload');
emit("reload");
modalApi.close();
} catch (error) {
console.error(error);
@@ -126,10 +132,16 @@ function getUnitInfo(unit: { name: string }) {
<BasicModal :title="title">
<BasicForm>
<template #userId="slotProps">
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
<QueryUserList @update:userInfo="getUserInfo"
v-bind="slotProps"
:isUpdate="isUpdate"
:userId="userId" />
</template>
<template #unitId="slotProps">
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :isUpdate="isUpdate" :unitId="unitId"/>
<QueryUnitList @update:unitInfo="getUnitInfo"
v-bind="slotProps"
:isUpdate="isUpdate"
:unitId="unitId" />
</template>
</BasicForm>
</BasicModal>

View File

@@ -2,11 +2,11 @@
<Page class="h-full w-full">
<!-- 设备分组区域 -->
<div class="flex h-full gap-[8px]">
<ChannelTree class="w-[260px]" @check="onNodeChecked" />
<ChannelTree class="h-[83vh] w-[260px]" @check="onNodeChecked" />
<!-- 设备分组区域 -->
<div class="bg-background flex-1">
<div class="video-play-area flex h-[calc(100%-40px)] flex-wrap">
<div class="video-play-area flex h-[calc(100%-30px)] flex-wrap">
<div
v-for="i in playerNum"
:style="playerStyle"
@@ -22,11 +22,19 @@
></video>
</div>
</div>
<div class="player-area flex h-[40px] gap-[5px]">
<div @click="onPlayerNumChanged(1)" class="h-[40px] w-[40px]">1</div>
<div @click="onPlayerNumChanged(2)" class="h-[40px] w-[40px]">2</div>
<div @click="onPlayerNumChanged(3)" class="h-[40px] w-[40px]">3</div>
<div @click="onPlayerNumChanged(4)" class="h-[40px] w-[40px]">4</div>
<div class="player-area flex h-[30px] gap-[5px]">
<div @click="onPlayerNumChanged(1)" class="h-[20px] w-[20px]">
<Svg1FrameIcon style="width: 100%; height: 100%" />
</div>
<div @click="onPlayerNumChanged(2)" class="h-[20px] w-[20px]">
<Svg4FrameIcon style="width: 100%; height: 100%" />
</div>
<div @click="onPlayerNumChanged(3)" class="h-[20px] w-[20px]">
<Svg9FrameIcon style="width: 100%; height: 100%" />
</div>
<div @click="onPlayerNumChanged(4)" class="h-[20px] w-[20px]">
<Svg16FrameIcon style="width: 100%; height: 100%" />
</div>
</div>
</div>
</div>
@@ -40,6 +48,12 @@ import ChannelTree from './channel-tree.vue';
import mpegts from 'mpegts.js';
import { message } from 'ant-design-vue';
import { addStreamProxy } from '#/api/sis/stream';
import {
Svg16FrameIcon,
Svg1FrameIcon,
Svg4FrameIcon,
Svg9FrameIcon,
} from '@vben/icons';
const selected = 'selected';
@@ -112,7 +126,6 @@ function onPlayerNumChanged(val: number) {
playerNum.value = changeNum;
// 缩小布局
if (changeBeforeNum > changeNum) {
debugger;
const playerArr = [];
for (let i = 0; i < playerList.length; i++) {
const playerBox = playerList[i];
@@ -176,7 +189,6 @@ function onNodeChecked(
/**
* 如果当前页面有选择播放未知,并且播放视频只有一个,则播放到制定位置
*/
debugger;
if (currentSelectPlayerIndex.value !== -1 && checkNode.length == 1) {
doPlayer(checkNode[0], currentSelectPlayerIndex.value - 1);
}
@@ -360,4 +372,10 @@ onUnmounted(() => {
.player.selected {
border: 2px solid deepskyblue;
}
.player-area {
display: flex;
align-items: center;
cursor: pointer;
}
</style>