Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/CaiYuanYiTiHua
commit
6235b3f34e
|
|
@ -72,6 +72,12 @@ export const columns: BasicColumn[] = [
|
|||
fixed: 'right',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '上报率',
|
||||
dataIndex: 'sbl',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
},
|
||||
];
|
||||
|
||||
// 无人机发现违法行为情况统计明细表-搜索
|
||||
|
|
@ -84,7 +90,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
placeholder: ['开始日期', '结束日期'],
|
||||
defaultValue: [dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD'), dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD')]
|
||||
defaultValue: [dayjs('2024-08-01', 'YYYY-MM-DD'), dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD')]
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,16 +6,13 @@
|
|||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<!-- 整改率 -->
|
||||
<template v-if="column.key === 'zgl'">
|
||||
{{ record.zgl }}%
|
||||
</template>
|
||||
<template v-if="column.key === 'zgl'"> {{ record.zgl }}% </template>
|
||||
<!-- 驳回率 -->
|
||||
<template v-if="column.key === 'bhl'">
|
||||
{{ record.bhl }}%
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.key === 'bhl'"> {{ record.bhl }}% </template>
|
||||
<!-- 上报率 -->
|
||||
<template v-if="column.key === 'sbl'"> {{ record.sbl }}% </template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -56,17 +53,28 @@
|
|||
pagination: false,
|
||||
beforeFetch: (data) => {
|
||||
// 接口请求前 参数处理
|
||||
// 默认展示昨天的
|
||||
var temp = {
|
||||
startTime: data.startTime
|
||||
? dayjs(data.startTime).startOf('day').format('YYYY-MM-DD')
|
||||
: dayjs().startOf('day').add(-1, 'day').format('YYYY-MM-DD'),
|
||||
endTime: data.endTime
|
||||
? dayjs(data.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
: dayjs().endOf('day').add(-1, 'day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
};
|
||||
searchParams.value = temp;
|
||||
return temp;
|
||||
console.log(data);
|
||||
// 默认时间
|
||||
if (Object.keys(data).length == 0) {
|
||||
var temp = {
|
||||
startTime: dayjs('2024-08-01').startOf('day').format('YYYY-MM-DD'),
|
||||
endTime: dayjs().endOf('day').add(-1, 'day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
};
|
||||
searchParams.value = temp;
|
||||
return temp;
|
||||
}
|
||||
// 起始时间和结束时间格式和精确值
|
||||
if (data.startTime && data.endTime) {
|
||||
var temp = {
|
||||
startTime: dayjs(data.startTime).startOf('day').format('YYYY-MM-DD'),
|
||||
endTime: dayjs(data.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
};
|
||||
searchParams.value = temp;
|
||||
return temp;
|
||||
}
|
||||
if (data.startTime === null || data.endTime === undefined) {
|
||||
searchParams.value = {};
|
||||
}
|
||||
},
|
||||
afterFetch: (res) => {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref, h, nextTick, unref } from 'vue';
|
||||
import { BasicTree, TreeItem, TreeActionItem, TreeActionType } from '@/components/Tree';
|
||||
import { getMenuList, deleteMenu, getMenuDetail, getSpecialData } from '@/api/demo/system';
|
||||
import { getMenuList, deleteMenu, getAllModuleDetail, getSpecialData } from '@/api/demo/system';
|
||||
import { FormOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
||||
import { router } from '@/router';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
|
|
@ -33,29 +33,27 @@
|
|||
const asyncExpandTreeRef = ref<Nullable<TreeActionType>>(null);
|
||||
async function fetch() {
|
||||
treeData.value = (await getMenuList()) as unknown as TreeItem[];
|
||||
treeData.value.forEach((item, index) => {
|
||||
getMenuDetailById(item).then((res) => {
|
||||
let title = specialMenu.value.find((sp) => {
|
||||
return sp.id == res.moduleTypeId;
|
||||
})?.title;
|
||||
if (title) {
|
||||
treeData.value[index].name = item.name = item.name + ' (' + title + ')';
|
||||
setTimeout(() => {
|
||||
treeData.value.forEach((item, index) => {
|
||||
let moduleDetail = allModuleDetail.value.find((detail) => {
|
||||
return detail.id == item.id;
|
||||
});
|
||||
if (moduleDetail) {
|
||||
let title = specialMenu.value.find((sp) => {
|
||||
return sp.id == moduleDetail.moduleTypeId;
|
||||
})?.title;
|
||||
if (title) {
|
||||
treeData.value[index].name = item.name = item.name + ' (' + title + ')';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}, 500);
|
||||
// 展开全部
|
||||
nextTick(() => {
|
||||
unref(asyncExpandTreeRef)?.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
async function getMenuDetailById(node) {
|
||||
return await getMenuDetail({
|
||||
id: node.id,
|
||||
});
|
||||
}
|
||||
|
||||
function handleSelect(keys) {
|
||||
emit('select', keys[0]);
|
||||
}
|
||||
|
|
@ -120,10 +118,15 @@
|
|||
async function specialData() {
|
||||
specialMenu.value = await getSpecialData();
|
||||
}
|
||||
const allModuleDetail = ref();
|
||||
async function funGetAllModuleDetail() {
|
||||
allModuleDetail.value = await getAllModuleDetail();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetch();
|
||||
funGetAllModuleDetail();
|
||||
specialData();
|
||||
fetch();
|
||||
});
|
||||
defineExpose({
|
||||
fetch,
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch, createVNode, unref } from 'vue';
|
||||
import { Modal, message } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { useModal } from '@/components/Modal';
|
||||
import { BasicTable, useTable } from '@/components/Table';
|
||||
import { PermissionBtn } from '@/components/PermissionBtn/index';
|
||||
|
|
@ -92,7 +93,7 @@
|
|||
// 分页信息
|
||||
let nowPage = 0;
|
||||
let nowLimit = 0;
|
||||
let total = 0;
|
||||
const total = ref(0);
|
||||
// 表格数据
|
||||
const registerTableData = ref([]);
|
||||
|
||||
|
|
@ -121,11 +122,21 @@
|
|||
// 分页信息
|
||||
nowPage = pagination.current;
|
||||
nowLimit = pagination.pageSize || pagination.defaultPageSize;
|
||||
total = pagination.total;
|
||||
if (pagination.total) {
|
||||
total.value = pagination.total;
|
||||
} else {
|
||||
getTotal();
|
||||
}
|
||||
// 表格数据
|
||||
registerTableData.value = res;
|
||||
},
|
||||
});
|
||||
// 分页信息-总数
|
||||
async function getTotal() {
|
||||
let res = await LoadDataBaseInfo({ page: nowPage, limit: nowLimit });
|
||||
total.value = res.total;
|
||||
}
|
||||
|
||||
// 修改是否显示状态
|
||||
const changeIsShow = (record) => {
|
||||
UpdateIsShow({ id: record.id, isshow: record.isShow })
|
||||
|
|
@ -155,7 +166,7 @@
|
|||
appShow: false,
|
||||
isExternal: false,
|
||||
linkOrApi: '',
|
||||
sort: total + 1,
|
||||
sort: total.value + 1,
|
||||
imgUrl: '',
|
||||
};
|
||||
openModal(true, temp_add);
|
||||
|
|
@ -175,9 +186,21 @@
|
|||
message.warning('请选择一条数据');
|
||||
return;
|
||||
}
|
||||
await DeleteEntity({ id: getSelectRows()[0].id });
|
||||
closeModal();
|
||||
reload();
|
||||
Modal.confirm({
|
||||
title: '是否确认删除?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
onCancel() {},
|
||||
onOk() {
|
||||
DeleteEntity({ id: getSelectRows()[0].id }).then((res) => {
|
||||
if (res) {
|
||||
reload();
|
||||
setTimeout(() => {
|
||||
getTotal();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
@ -186,6 +209,9 @@
|
|||
await AddOrUpdateForm(data);
|
||||
closeModal();
|
||||
reload();
|
||||
setTimeout(() => {
|
||||
getTotal();
|
||||
}, 500);
|
||||
}
|
||||
// 向上排序
|
||||
async function sortUp(index, record) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue