This commit is contained in:
@@ -5,6 +5,8 @@ import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
import { addFullName } from '@vben/utils';
|
||||
import { deviceManageList } from '#/api/sis/deviceManage';
|
||||
import type { DeviceManageQuery } from '#/api/sis/deviceManage/model';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -82,6 +84,10 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '外部编码',
|
||||
field: 'outCode',
|
||||
},
|
||||
{
|
||||
title: '绑定设备',
|
||||
field: 'bindDeviceIp',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@@ -139,4 +145,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '绑定设备',
|
||||
fieldName: 'bindDeviceIp',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
resultField: 'list', // 根据API返回结构调整
|
||||
labelField: 'deviceName',
|
||||
valueField: 'id',
|
||||
api: async () => {
|
||||
const params: DeviceManageQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 500,
|
||||
};
|
||||
const res = await deviceManageList(params);
|
||||
return res.rows;
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@@ -3,8 +3,6 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getPopupContainer } from '@vben/utils';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { DictEnum } from '@vben/constants';
|
||||
import { accessControlList } from '#/api/sis/accessControl';
|
||||
import type { AccessControlQuery } from '#/api/sis/accessControl/model';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -65,10 +63,10 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '录像机端口',
|
||||
field: 'vcrPort',
|
||||
},
|
||||
{
|
||||
/*{
|
||||
title: '门禁id',
|
||||
field: 'accessControlId',
|
||||
},
|
||||
},*/
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@@ -148,7 +146,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'vcrPwd',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
/*{
|
||||
label: '绑定门禁',
|
||||
fieldName: 'accessControlId',
|
||||
component: 'ApiSelect',
|
||||
@@ -166,5 +164,5 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
return res.rows;
|
||||
},
|
||||
},
|
||||
},
|
||||
},*/
|
||||
];
|
||||
|
@@ -1,18 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
@@ -76,7 +71,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'sis-deviceManage-index'
|
||||
id: 'sis-deviceManage-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@@ -118,9 +113,14 @@ function handleMultiDelete() {
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(deviceManageExport, '设备管理数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
commonDownloadExcel(
|
||||
deviceManageExport,
|
||||
'设备管理数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -138,9 +138,10 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['sis:deviceManage:remove']"
|
||||
@click="handleMultiDelete">
|
||||
type="primary"
|
||||
v-access:code="['sis:deviceManage:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import type { FormSchemaGetter, VbenFormSchema } from '#/adapter/form';
|
||||
import { type FormSchemaGetter, type VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { DictEnum } from '@vben/constants';
|
||||
@@ -20,7 +20,7 @@ const labelText: VbenFormSchema = {
|
||||
valueField: 'id',
|
||||
// immediate: true,
|
||||
api: async () => {
|
||||
if(!libArr || libArr.length == 0){
|
||||
if (!libArr || libArr.length == 0) {
|
||||
const params: PersonLibQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 500,
|
||||
@@ -35,11 +35,11 @@ const labelText: VbenFormSchema = {
|
||||
);
|
||||
item.labelText = (
|
||||
<span>
|
||||
{item.libName} {tag}
|
||||
</span>
|
||||
{item.libName} {tag}
|
||||
</span>
|
||||
);
|
||||
});
|
||||
libArr = res.rows
|
||||
libArr = res.rows;
|
||||
}
|
||||
return libArr;
|
||||
},
|
||||
|
129
apps/web-antd/src/views/sis/personLibImg/imgAuth-modal.vue
Normal file
129
apps/web-antd/src/views/sis/personLibImg/imgAuth-modal.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { useBeforeCloseDiff } from '#/utils/popup';
|
||||
import type { TransferProps, TreeProps } from 'ant-design-vue';
|
||||
import { Switch, Transfer, Tree } from 'ant-design-vue';
|
||||
import { queryTree } from '#/api/sis/accessControl';
|
||||
import type { TreeNode } from '#/api/common';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const title = ref('门禁授权');
|
||||
|
||||
const { onBeforeClose } = useBeforeCloseDiff({});
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[700px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
|
||||
/*const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value ? personLibImgUpdate(data) : personLibImgAdd(data));*/
|
||||
|
||||
// resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
// await formApi.resetForm();
|
||||
// resetInitialized();
|
||||
}
|
||||
|
||||
const checked = ref(false);
|
||||
const targetKeys = ref<string[]>([]);
|
||||
const dataSource = ref<TreeNode[]>([]);
|
||||
|
||||
onMounted(() => {
|
||||
queryAcTree();
|
||||
});
|
||||
|
||||
function queryAcTree() {
|
||||
queryTree().then((res = []) => {
|
||||
dataSource.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
const onChecked = (
|
||||
e: Parameters<TreeProps['onCheck']>[1] | Parameters<TreeProps['onSelect']>[1],
|
||||
checkedKeys: string[],
|
||||
onItemSelect: (n: any, c: boolean) => void,
|
||||
) => {
|
||||
const { eventKey } = e.node;
|
||||
onItemSelect(eventKey, !isChecked(checkedKeys, eventKey));
|
||||
};
|
||||
|
||||
function isChecked(
|
||||
selectedKeys: (string | number)[],
|
||||
eventKey: string | number,
|
||||
) {
|
||||
return selectedKeys.indexOf(eventKey) !== -1;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<div class="p-4">
|
||||
<span>AI盒子授权: </span>
|
||||
<Switch v-model:checked="checked" />
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<Transfer
|
||||
v-model:target-keys="targetKeys"
|
||||
class="tree-transfer h-[400px]"
|
||||
:data-source="dataSource"
|
||||
:render="(item) => item.title"
|
||||
:show-select-all="true"
|
||||
:showSearch="true"
|
||||
>
|
||||
<template #children="{ direction, selectedKeys, onItemSelect }">
|
||||
<Tree
|
||||
v-if="direction === 'left'"
|
||||
block-node
|
||||
checkable
|
||||
check-strictly
|
||||
default-expand-all
|
||||
:checked-keys="[...selectedKeys, ...targetKeys]"
|
||||
:tree-data="dataSource"
|
||||
@check="
|
||||
(_, props) => {
|
||||
onChecked(
|
||||
props,
|
||||
[...selectedKeys, ...targetKeys],
|
||||
onItemSelect,
|
||||
);
|
||||
}
|
||||
"
|
||||
@select="
|
||||
(_, props) => {
|
||||
onChecked(
|
||||
props,
|
||||
[...selectedKeys, ...targetKeys],
|
||||
onItemSelect,
|
||||
);
|
||||
}
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</Transfer>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -17,6 +17,7 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import { columns, querySchema } from './data';
|
||||
import personLibImgModal from './personLibImg-modal.vue';
|
||||
import imgAuthModal from './imgAuth-modal.vue';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -80,6 +81,10 @@ const [PersonLibImgModal, modalApi] = useVbenModal({
|
||||
connectedComponent: personLibImgModal,
|
||||
});
|
||||
|
||||
const [ImgAuthModal, authModalApi] = useVbenModal({
|
||||
connectedComponent: imgAuthModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
@@ -123,7 +128,10 @@ function handleDownloadExcel() {
|
||||
/**
|
||||
* 对图像进行门禁授权
|
||||
*/
|
||||
function accessControlAuth() {}
|
||||
function accessControlAuth() {
|
||||
authModalApi.setData({});
|
||||
authModalApi.open();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -190,5 +198,6 @@ function accessControlAuth() {}
|
||||
</template>
|
||||
</BasicTable>
|
||||
<PersonLibImgModal @reload="tableApi.query()" />
|
||||
<ImgAuthModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user