This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<script setup lang="ts">
|
||||
import type {Community} from '#/api/property/community/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import {communityInfo} from '#/api/property/community';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
communityDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const communityDetail = shallowRef<null | Community>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await communityInfo(id);
|
||||
// 赋值
|
||||
communityDetail.value = response;
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="小区管理信息" class="w-[70%]">
|
||||
<Descriptions v-if="communityDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="社区名称">
|
||||
{{ communityDetail.communityName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="社区编码">
|
||||
{{ communityDetail.communityCode }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="社区类型" v-if="communityDetail.communityType!=null">
|
||||
<component
|
||||
:is="renderDict(communityDetail.communityType,'wy_sqlx')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="省">
|
||||
{{ communityDetail.province }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="市">
|
||||
{{ communityDetail.city }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="区">
|
||||
{{ communityDetail.district }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="地址">
|
||||
{{ communityDetail.addr }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="经度">
|
||||
{{ communityDetail.lon }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="维度">
|
||||
{{ communityDetail.lat }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="小图图片">
|
||||
{{ communityDetail.img }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="组织编码">
|
||||
{{ communityDetail.orgCode }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="数据状态" v-if="communityDetail.dataState!=null">
|
||||
<component
|
||||
:is="renderDict(communityDetail.dataState,'wy_cqxz')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="修改时间">
|
||||
{{ communityDetail.modifyTime }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -22,63 +22,13 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
options: getDictOptions('wy_sqlx'),
|
||||
},
|
||||
fieldName: 'communityType',
|
||||
label: '社区类型 1:园区,2:小区',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'province',
|
||||
label: '省',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'city',
|
||||
label: '市',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'district',
|
||||
label: '区',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'addr',
|
||||
label: '地址',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'lon',
|
||||
label: '经度',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'lat',
|
||||
label: '维度',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'img',
|
||||
label: '小图图片',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'orgCode',
|
||||
label: '组织编码',
|
||||
label: '社区类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'dataState',
|
||||
label: '数据状态:1有效,0无效',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'modifyTime',
|
||||
label: '修改时间',
|
||||
},
|
||||
label: '数据状态',
|
||||
}
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
@@ -98,7 +48,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'communityCode',
|
||||
},
|
||||
{
|
||||
title: '社区类型 1:园区,2:小区',
|
||||
title: '社区类型',
|
||||
field: 'communityType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
@@ -136,11 +86,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'img',
|
||||
},
|
||||
{
|
||||
title: '组织编码',
|
||||
field: 'orgCode',
|
||||
},
|
||||
{
|
||||
title: '数据状态:1有效,0无效',
|
||||
title: '数据状态',
|
||||
field: 'dataState',
|
||||
},
|
||||
{
|
||||
@@ -179,7 +125,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '社区类型 1:园区,2:小区',
|
||||
label: '社区类型',
|
||||
fieldName: 'communityType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
@@ -234,13 +180,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '组织编码',
|
||||
fieldName: 'orgCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '数据状态:1有效,0无效',
|
||||
label: '数据状态',
|
||||
fieldName: 'dataState',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
|
@@ -1,18 +1,12 @@
|
||||
<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 {
|
||||
@@ -25,6 +19,8 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import communityModal from './community-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import communityDetail from "#/views/property/community/community-detail.vue";
|
||||
import type {BuildingForm} from "#/api/property/building/model";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -87,6 +83,13 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
const [CommunityModal, modalApi] = useVbenModal({
|
||||
connectedComponent: communityModal,
|
||||
});
|
||||
const [communityDetailModal, communityDetailApi] = useVbenModal({
|
||||
connectedComponent: communityDetail,
|
||||
});
|
||||
async function handleInfo(row: Required<BuildingForm>) {
|
||||
// communityDetailApi.setData({ id: row.id });
|
||||
communityDetailApi.open();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
@@ -138,8 +141,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:community:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:community:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
@@ -150,10 +153,21 @@ function handleDownloadExcel() {
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="handleInfo"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:community:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@@ -178,5 +192,6 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<CommunityModal @reload="tableApi.query()" />
|
||||
<communityDetailModal/>
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user