This commit is contained in:
1378012178@qq.com 2025-07-02 20:17:37 +08:00
commit 5bec7eb5ee
8 changed files with 811 additions and 0 deletions

View File

@ -0,0 +1,42 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/housingestateInfo/blHousingestateInfo/list',
save='/housingestateInfo/blHousingestateInfo/add',
edit='/housingestateInfo/blHousingestateInfo/edit',
deleteOne = '/housingestateInfo/blHousingestateInfo/delete',
deleteBatch = '/housingestateInfo/blHousingestateInfo/deleteBatch',
importExcel = '/housingestateInfo/blHousingestateInfo/importExcel',
exportXls = '/housingestateInfo/blHousingestateInfo/exportXls',
queryXqHyXzList = '/housingestateInfo/blHousingestateInfo/queryXqHyXzList',
queryXqHyTdcsList = '/housingestateInfo/blHousingestateInfo/queryXqHyTdcsList',
queryXqHyTdzlList = '/housingestateInfo/blHousingestateInfo/queryXqHyTdzlList',
housingestateList = '/zh/hy/queryHousingestateList',
}
/**
*
* @param params
*/
export const housingestateList = (params) => defHttp.get({ url: Api.housingestateList, params });
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
export const queryXqHyXzList = (params) => defHttp.get({ url: Api.queryXqHyXzList, params });
export const queryXqHyTdcsList = (params) => defHttp.get({ url: Api.queryXqHyTdcsList, params });
export const queryXqHyTdzlList = (params) => defHttp.get({ url: Api.queryXqHyTdzlList, params });

View File

@ -0,0 +1,42 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '小区标识',
align: "center",
dataIndex: 'housingestateId'
},
{
title: '小区名称',
align: "center",
dataIndex: 'name'
},
{
title: '地址',
align: "center",
dataIndex: 'address'
},
{
title: '状态',
align: "center",
dataIndex: 'status'
},
{
title: '类型',
align: "center",
dataIndex: 'type'
},
];
// 高级查询数据
export const superQuerySchema = {
housingestateId: {title: '小区ID',order: 0,view: 'text', type: 'string',},
name: {title: '小区名称',order: 1,view: 'text', type: 'string',},
address: {title: '地址',order: 2,view: 'text', type: 'string',},
status: {title: '状态',order: 3,view: 'text', type: 'string',},
type: {title: '类型',order: 4,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,149 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="name">
<template #label><span title="区域名称">区域名称</span></template>
<j-input placeholder="请输入区域名称" v-model:value="queryParam.name" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="状态">状态</span></template>
<j-input placeholder="请输入状态" v-model:value="queryParam.status" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
</div>
</template>
<script lang="ts" name="housingestateInfo-blHousingestateInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './HousingestateInfo.data';
import { list, getExportUrl } from './HousingestateInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '小区信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
showIndexColumn: true,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "小区信息",
url: getExportUrl,
params: queryParam,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,169 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlHousingestateInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="区域ID" v-bind="validateInfos.housingestateId" id="BlHousingestateInfoForm-housingestateId" name="housingestateId">
<a-input v-model:value="formData.housingestateId" placeholder="请输入区域ID" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="区域名称" v-bind="validateInfos.name" id="BlHousingestateInfoForm-name" name="name">
<a-input v-model:value="formData.name" placeholder="请输入区域名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="地址" v-bind="validateInfos.address" id="BlHousingestateInfoForm-address" name="address">
<a-input v-model:value="formData.address" placeholder="请输入地址" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="状态" v-bind="validateInfos.status" id="BlHousingestateInfoForm-status" name="status">
<a-input v-model:value="formData.status" placeholder="请输入状态" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="类型" v-bind="validateInfos.type" id="BlHousingestateInfoForm-type" name="type">
<a-input v-model:value="formData.type" placeholder="请输入类型" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../HousingestateInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
housingestateId: '',
name: '',
address: '',
status: '',
type: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<BlHousingestateInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlHousingestateInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import BlHousingestateInfoForm from './HousingestateInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,110 @@
<template>
<div class="p-4">
<a-card :bordered="false" style="height: 100%">
<a-row>
<a-col :span="20">
<a-radio-group v-model:value="parmas.type" @change="changeType">
<a-radio-button value="0">当天</a-radio-button>
<a-radio-button value="1">近3天</a-radio-button>
<a-radio-button value="2">近7天</a-radio-button>
<a-radio-button value="3">近30天</a-radio-button>
<a-radio-button value="4">自定义</a-radio-button>
</a-radio-group>
<span v-show="parmas.type=='4'" style="margin-left: 5px;">
<a-range-picker :value-format="valueFormat" @change="changeDate" />
</span>
<!-- <a-select ref="select"
placeholder="请选区域"
v-model:value="parmas.housingestateId"
style="width: 200px;margin-left: 5px;"
@change="handleHousinges">
<a-select-option value="" >全部</a-select-option>
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{item.housingestateName}}</a-select-option>
</a-select> -->
</a-col>
</a-row>
<Bar :chartData="dataSource" height="80vh" :option="{ title: { text: '小区新增会员统计', left: 'center' }}" :seriesLabel="{show: true, position: 'top'}" :seriesName="'个数'"></Bar>
</a-card>
</div>
</template>
<script lang="ts" setup>
import {ref, unref, reactive, onMounted} from 'vue';
import Bar from '/@/components/chart/Bar.vue';
import { queryXqHyXzList,housingestateList } from './HousingestateInfo.api';
import type { Dayjs } from 'dayjs';
const valueFormat = 'YYYY-MM-DD';
const dataSource = ref([]);
const dateValue = ref();
const housingestates = ref();
const parmas = reactive<any>({
beginTime: '',
endTime: '',
type: '0',
})
async function getHousingestates(){
housingestates.value = await housingestateList(null);
}
function changeType (){
parmas.endTime=getPreviousDate(0)+' 23:59:59';
if (parmas.type === '0') {
parmas.beginTime=getPreviousDate(0)+' 00:00:00';
loadDate();
}
if (parmas.type === '1') {
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
loadDate();
}
if (parmas.type === '2') {
parmas.beginTime=getPreviousDate(6)+' 00:00:00';
loadDate();
}
if (parmas.type === '3') {
parmas.beginTime=getPreviousDate(29)+' 00:00:00';
loadDate();
}
}
const changeDate = (date, dateString) => {
parmas.beginTime=dateString[0]+' 00:00:00';
parmas.endTime=dateString[1]+' 23:59:59';
loadDate();
};
function handleHousinges(){
loadDate();
}
async function loadDate() {
const res = await queryXqHyXzList(parmas);
dataSource.value = [];
for (let i = 0; i < res.length; i++) {
dataSource.value.push({
name: `${res[i].shortDay}`,
value: res[i].cn,
});
}
}
function getPreviousDate(days){
const date = new Date();
date.setDate(date.getDate() - days);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // +10-indexed
const day = String(date.getDate()).padStart(2, '0'); //
const formattedDate = `${year}-${month}-${day}`;
return formattedDate;
}
onMounted(() => {
// getHousingestates();
if(parmas.type=='0'){
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
parmas.endTime=getPreviousDate(0)+' 23:59:59';
}
loadDate();
})
</script>

View File

@ -0,0 +1,111 @@
<template>
<div class="p-4">
<a-card :bordered="false" style="height: 100%">
<a-row>
<a-col :span="20">
<a-radio-group v-model:value="parmas.type" @change="changeType">
<a-radio-button value="1">当天</a-radio-button>
<a-radio-button value="2">近3天</a-radio-button>
<a-radio-button value="3">近7天</a-radio-button>
<a-radio-button value="4">近30天</a-radio-button>
<a-radio-button value="5">自定义</a-radio-button>
</a-radio-group>
<span v-show="parmas.type=='5'" style="margin-left: 5px;">
<a-range-picker :value-format="valueFormat" @change="changeDate" />
</span>
<!-- <a-select ref="select"
placeholder="请选区域"
v-model:value="parmas.housingestateId"
style="width: 200px;margin-left: 5px;"
@change="handleHousinges">
<a-select-option value="" >全部</a-select-option>
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{item.housingestateName}}</a-select-option>
</a-select> -->
</a-col>
</a-row>
<Bar :chartData="dataSource" height="80vh" :option="{ title: { text: '小区投递次数排行榜', left: 'center' }}" :itemStyle="{ normal: {label : {show: true, position: 'top'}}}" :seriesName="'投递次数'"></Bar>
</a-card>
</div>
</template>
<script lang="ts" setup>
import {ref, unref, reactive, onMounted} from 'vue';
import Bar from '/@/components/chart/Bar.vue';
import { queryXqHyTdcsList,housingestateList } from './HousingestateInfo.api';
import type { Dayjs } from 'dayjs';
const valueFormat = 'YYYY-MM-DD';
const dataSource = ref([]);
const dateValue = ref();
const housingestates = ref();
async function getHousingestates(){
housingestates.value = await housingestateList(null);
}
const parmas = reactive<any>({
beginTime: '',
endTime: '',
type: '1',
})
function changeType (){
parmas.endTime=getPreviousDate(0)+' 23:59:59';
if (parmas.type === '1') {
parmas.beginTime=getPreviousDate(0)+' 00:00:00';
loadDate();
}
if (parmas.type === '2') {
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
loadDate();
}
if (parmas.type === '3') {
parmas.beginTime=getPreviousDate(6)+' 00:00:00';
loadDate();
}
if (parmas.type === '4') {
parmas.beginTime=getPreviousDate(29)+' 00:00:00';
loadDate();
}
}
const changeDate = (date, dateString) => {
parmas.beginTime=dateString[0]+' 00:00:00';
parmas.endTime=dateString[1]+' 23:59:59';
loadDate();
};
function handleHousinges(){
loadDate();
};
async function loadDate() {
const res = await queryXqHyTdcsList(parmas);
dataSource.value = [];
for (let i = 0; i < res.length; i++) {
dataSource.value.push({
name: res[i].phone,
value: res[i].cn
});
}
}
function getPreviousDate(days){
const date = new Date();
date.setDate(date.getDate() - days);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // +10-indexed
const day = String(date.getDate()).padStart(2, '0'); //
const formattedDate = `${year}-${month}-${day}`;
return formattedDate;
}
onMounted(() => {
getHousingestates();
if(parmas.type=='1'){
parmas.beginTime=getPreviousDate(0)+' 00:00:00';
parmas.endTime=getPreviousDate(0)+' 23:59:59';
}
loadDate();
})
</script>

View File

@ -0,0 +1,111 @@
<template>
<div class="p-4">
<a-card :bordered="false" style="height: 100%">
<a-row>
<a-col :span="20">
<a-radio-group v-model:value="parmas.type" @change="changeType">
<a-radio-button value="0">当天</a-radio-button>
<a-radio-button value="1">近3天</a-radio-button>
<a-radio-button value="2">近7天</a-radio-button>
<a-radio-button value="3">近30天</a-radio-button>
<a-radio-button value="4">自定义</a-radio-button>
</a-radio-group>
<span v-show="parmas.type=='4'" style="margin-left: 5px;">
<a-range-picker :value-format="valueFormat" @change="changeDate" />
</span>
<!-- <a-select ref="select"
placeholder="请选区域"
v-model:value="parmas.housingestateId"
style="width: 200px;margin-left: 5px;"
@change="handleHousinges">
<a-select-option value="" >全部</a-select-option>
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{item.housingestateName}}</a-select-option>
</a-select> -->
</a-col>
</a-row>
<Bar :chartData="dataSource" height="80vh" :option="{ title: { text: '小区投递重量排行榜', left: 'center' }}" :itemStyle="{ normal: {label : {show: true, position: 'top'}}}" :seriesName="'投递重量'"></Bar>
</a-card>
</div>
</template>
<script lang="ts" setup>
import {ref, unref, reactive, onMounted} from 'vue';
import Bar from '/@/components/chart/Bar.vue';
import { queryXqHyTdzlList,housingestateList } from './HousingestateInfo.api';
import type { Dayjs } from 'dayjs';
const valueFormat = 'YYYY-MM-DD';
const dataSource = ref([]);
const dateValue = ref();
const housingestates = ref();
async function getHousingestates(){
housingestates.value = await housingestateList(null);
}
const parmas = reactive<any>({
beginTime: '',
endTime: '',
type: '0',
})
function changeType (){
parmas.endTime=getPreviousDate(0)+' 23:59:59';
if (parmas.type === '0') {
parmas.beginTime=getPreviousDate(0)+' 00:00:00';
loadDate();
}
if (parmas.type === '1') {
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
loadDate();
}
if (parmas.type === '2') {
parmas.beginTime=getPreviousDate(6)+' 00:00:00';
loadDate();
}
if (parmas.type === '3') {
parmas.beginTime=getPreviousDate(29)+' 00:00:00';
loadDate();
}
}
const changeDate = (date, dateString) => {
parmas.beginTime=dateString[0]+' 00:00:00';
parmas.endTime=dateString[1]+' 23:59:59';
loadDate();
};
function handleHousinges(){
loadDate();
};
async function loadDate() {
const res = await queryXqHyTdzlList(parmas);
dataSource.value = [];
for (let i = 0; i < res.length; i++) {
dataSource.value.push({
name: `${res[i].shortHour}`,
value: res[i].cn,
});
}
}
function getPreviousDate(days){
const date = new Date();
date.setDate(date.getDate() - days);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // +10-indexed
const day = String(date.getDate()).padStart(2, '0'); //
const formattedDate = `${year}-${month}-${day}`;
return formattedDate;
}
onMounted(() => {
// getHousingestates();
if(parmas.type=='0'){
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
parmas.endTime=getPreviousDate(0)+' 23:59:59';
}
loadDate();
})
</script>