diff --git a/src/api/earlywarning/index.ts b/src/api/earlywarning/index.ts new file mode 100644 index 0000000..b7efdf7 --- /dev/null +++ b/src/api/earlywarning/index.ts @@ -0,0 +1,30 @@ +import { defHttp } from '@/utils/http/axios'; +enum Api { + TimeoutWarning = '/api/DroneSsny/TimeoutWarning', + TimeOutAlarmList = '/api/DroneSsny/TimeOutAlarmList', + TimeoutWarningExport = '/api/DroneSsny/TimeoutWarningExport', + TimeoutAlarmExport = '/api/DroneSsny/TimeoutAlarmExport' +} + +export function TimeoutWarning(params) { + return defHttp.get({ url: Api.TimeoutWarning, params }); +} +export function TimeOutAlarmList(params) { + return defHttp.get({ url: Api.TimeOutAlarmList, params }); +} +export function TimeoutWarningExport(params) { + let paramsString = new URLSearchParams(params).toString(); + return defHttp.post({ + url: `${Api.TimeoutWarningExport}?${paramsString}`, + params, + responseType: 'blob', + }); +} +export function TimeoutAlarmExport(params) { + let paramsString = new URLSearchParams(params).toString(); + return defHttp.post({ + url: `${Api.TimeoutAlarmExport}?${paramsString}`, + params, + responseType: 'blob', + }); +} \ No newline at end of file diff --git a/src/components/EarlyWarning/InfoModal/index.vue b/src/components/EarlyWarning/InfoModal/index.vue new file mode 100644 index 0000000..819c78a --- /dev/null +++ b/src/components/EarlyWarning/InfoModal/index.vue @@ -0,0 +1,1203 @@ + + + + + + + + + + + {{ props.showInfoData.xiangmu_no }} + + + {{ props.showInfoData.xiangmu_name }} + + + {{ props.showInfoData.streetname }} + + + {{ props.showInfoData.communityname }} + + + {{ props.showInfoData.quanliren }} + + + {{ props.showInfoData.xingzhengquhua }} + + + {{ props.showInfoData.beian_no }} + + + {{ props.showInfoData.start_time }} + + + {{ props.showInfoData.end_time }} + + + {{ props.showInfoData.xiangmu_yt }} + + + {{ props.showInfoData.shenqing_area }} + + + {{ props.showInfoData.shengchan_area }} + + + {{ props.showInfoData.fuzhu_area }} + + + {{ props.showInfoData.xiafatime }} + + + + + + + {{ props.showInfoData.iswnti_kg }} + + + {{ props.showInfoData.wentileixing_kg }} + + + {{ props.showInfoData.qtqksm_kg }} + + + {{ props.showInfoData.zgfs_kg }} + + + {{ props.showInfoData.zgqx_kg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_kg }} + + + {{ props.showInfoData.hechatime_kg }} + + + + + + + {{ props.showInfoData.zgfs_kgzg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_kgzg }} + + + {{ props.showInfoData.hechatime_kgzg }} + + + + + + + {{ props.showInfoData.iswnti_jz }} + + + {{ props.showInfoData.wentileixing_jz }} + + + {{ props.showInfoData.qtqksm_jz }} + + + {{ props.showInfoData.zgfs_jz }} + + + {{ props.showInfoData.zgqx_jz }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_jz }} + + + {{ props.showInfoData.hechatime_jz }} + + + + + + + {{ props.showInfoData.zgfs_jzzg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_jzzg }} + + + {{ props.showInfoData.hechatime_jzzg }} + + + + + + + {{ props.showInfoData.iswnti_wg }} + + + {{ props.showInfoData.wentileixing_wg }} + + + {{ props.showInfoData.qtqksm_wg }} + + + {{ props.showInfoData.zgfs_wg }} + + + {{ props.showInfoData.zgqx_wg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_wg }} + + + {{ props.showInfoData.hechatime_wg }} + + + + + + + {{ props.showInfoData.zgfs_wgzg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_wgzg }} + + + {{ props.showInfoData.hechatime_wgzg }} + + + + + + + {{ props.showInfoData.iswnti_rc }} + + + {{ props.showInfoData.wentileixing_rc }} + + + {{ props.showInfoData.qtqksm_rc }} + + + {{ props.showInfoData.zgfs_rc }} + + + {{ props.showInfoData.zgqx_rc }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_rc }} + + + {{ props.showInfoData.hechatime_rc }} + + + + + + + {{ props.showInfoData.zgfs_rczg }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_rczg }} + + + {{ props.showInfoData.hechatime_rczg }} + + + + + + + {{ props.showInfoData.iswenti_rcfh }} + + + {{ props.showInfoData.wentileixing_rcfh }} + + + {{ props.showInfoData.qtqksm_rcfh }} + + + {{ props.showInfoData.zgfs_rcfh }} + + + {{ props.showInfoData.zgqx_rcfh }} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ handlerDealFileName(item) }} + + + + + + {{ props.showInfoData.hechauser_rcfh }} + + + {{ props.showInfoData.hechatime_rcfh }} + + + + + + + + + + 取消 + 下载 + + + + + + + + + diff --git a/src/components/EarlyWarning/InfoModal/util.ts b/src/components/EarlyWarning/InfoModal/util.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/SimpleMenu/src/SimpleMenu.vue b/src/components/SimpleMenu/src/SimpleMenu.vue index d2e76f1..ada011e 100644 --- a/src/components/SimpleMenu/src/SimpleMenu.vue +++ b/src/components/SimpleMenu/src/SimpleMenu.vue @@ -21,7 +21,7 @@ import type { MenuState } from './types'; import type { Menu as MenuType } from '@/router/types'; import type { RouteLocationNormalizedLoaded } from 'vue-router'; - import { computed, ref, unref, reactive, toRefs, watch, PropType, useAttrs } from 'vue'; + import { computed, ref, unref, reactive, toRefs, watch, PropType, useAttrs, onMounted } from 'vue'; import { useDesign } from '@/hooks/web/useDesign'; import Menu from './components/Menu.vue'; import SimpleSubMenu from './SimpleSubMenu.vue'; @@ -32,6 +32,9 @@ import { isFunction, isHttpUrl } from '@/utils/is'; import { openWindow } from '@/utils'; import { useOpenKeys } from './useOpenKeys'; + import { useEarlyWarningStore } from '@/store/modules/earlywarning' + + const earlyWarningStore = useEarlyWarningStore(); defineOptions({ name: 'SimpleMenu', inheritAttrs: false }); @@ -78,6 +81,10 @@ const getBindValues = computed(() => ({ ...attrs, ...props })); + onMounted(() =>{ + earlyWarningStore.getWarning() + }) + watch( () => props.collapse, (collapse) => { diff --git a/src/components/SimpleMenu/src/SimpleSubMenu.vue b/src/components/SimpleMenu/src/SimpleSubMenu.vue index c0e1b59..e42949a 100644 --- a/src/components/SimpleMenu/src/SimpleSubMenu.vue +++ b/src/components/SimpleMenu/src/SimpleSubMenu.vue @@ -3,7 +3,7 @@ :name="item.path" v-if="!menuHasChildren(item) && getShowMenu" v-bind="$props" - :class="getLevelClass" + :class="[getLevelClass, 'sub_menu']" > @@ -11,8 +11,8 @@ {{ getI18nName }} - - {{ getI18nName }} + + {{ getI18nName }}{{showWarningNumber(item)}} @@ -48,7 +48,7 @@ import type { PropType } from 'vue'; import type { Menu } from '@/router/types'; - import { computed } from 'vue'; + import { computed, onMounted } from 'vue'; import { useDesign } from '@/hooks/web/useDesign'; import Icon from '@/components/Icon/Icon.vue'; @@ -57,8 +57,10 @@ import { propTypes } from '@/utils/propTypes'; import { useI18n } from '@/hooks/web/useI18n'; import { createAsyncComponent } from '@/utils/factory/createAsyncComponent'; + import { useEarlyWarningStore } from '@/store/modules/earlywarning' const SimpleMenuTag = createAsyncComponent(() => import('./SimpleMenuTag.vue')); + const earlyWarningStore = useEarlyWarningStore(); defineOptions({ name: 'SimpleSubMenu' }); @@ -99,4 +101,44 @@ menuTreeItem.children.length > 0 ); } + const showWarning = (item) => { + if(['/overduewarning','/expirationwarning'].includes(item.path)){ + return true + } + return false + } + const showWarningNumber = (item) => { + switch(item.path){ + case '/overduewarning': + return earlyWarningStore.overdueWarning + case '/expirationwarning': + return earlyWarningStore.ExpirationWarning + } + } + diff --git a/src/store/modules/earlywarning.ts b/src/store/modules/earlywarning.ts new file mode 100644 index 0000000..214230c --- /dev/null +++ b/src/store/modules/earlywarning.ts @@ -0,0 +1,19 @@ +import { defineStore } from 'pinia'; +import { TimeoutWarning, TimeOutAlarmList } from '@/api/earlywarning/index' +export const useEarlyWarningStore = defineStore({ + id: 'earlyWarning', + state: () => ({ + overdueWarning: 0, + ExpirationWarning: 0, + }), + actions:{ + async getWarning(){ + TimeoutWarning({}).then(res => { + this.ExpirationWarning = res.total + }) + TimeOutAlarmList({}).then(res => { + this.overdueWarning = res.total + }) + } + } +}) \ No newline at end of file diff --git a/src/views/demo/expirationwarning/index.vue b/src/views/demo/expirationwarning/index.vue new file mode 100644 index 0000000..e63b575 --- /dev/null +++ b/src/views/demo/expirationwarning/index.vue @@ -0,0 +1,103 @@ + + + + + 导出 + + + + + + + + + + + + + + + + diff --git a/src/views/demo/expirationwarning/utils.ts b/src/views/demo/expirationwarning/utils.ts new file mode 100644 index 0000000..b3653b4 --- /dev/null +++ b/src/views/demo/expirationwarning/utils.ts @@ -0,0 +1,76 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { getChildrenTree } from '@/api/demo/system'; + +export const columns: BasicColumn[] = [ + { + title: '项目编号', + dataIndex: 'xiangmu_no', + }, + { + title: '项目名称', + dataIndex: 'xiangmu_name', + width: 200, + }, + { + title: '行政区划', + dataIndex: 'xingzhengquhua', + }, + { + title: '备案编号', + dataIndex: 'beian_no', + }, + { + title: '项目开始时间', + dataIndex: 'start_time', + width: 200, + }, + { + title: '项目结束时间', + dataIndex: 'end_time', + }, + { + title: '项目当前用途', + dataIndex: 'xiangmu_yt', + width: 110, + }, + { + title: '设施农业申请用地面积(公顷)', + dataIndex: 'shenqing_area', + width: 200, + }, + { + title: '生产设施用地(公顷)', + dataIndex: 'shengchan_area', + width: 200, + }, + { + title: '辅助设施用地(公顷)', + dataIndex: 'fuzhu_area', + width: 200, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'xiangmumc', + component: 'Input', + colProps: { span: 5 }, + label: '项目名称', + }, + { + field: 'streetid', + label: '乡镇', + component: 'ApiSelect', + colProps: { span: 4 }, + componentProps: ({ formModel }) => { + return { + api: getChildrenTree, + params: { parentId: 371324 }, + // 接口参数 + resultField: 'result', + labelField: 'name', + valueField: 'id', + }; + }, + }, +]; diff --git a/src/views/demo/overduewarning/index.vue b/src/views/demo/overduewarning/index.vue new file mode 100644 index 0000000..6672266 --- /dev/null +++ b/src/views/demo/overduewarning/index.vue @@ -0,0 +1,103 @@ + + + + + 导出 + + + + + + + + + + + + + + + + diff --git a/src/views/demo/overduewarning/utils.ts b/src/views/demo/overduewarning/utils.ts new file mode 100644 index 0000000..b3653b4 --- /dev/null +++ b/src/views/demo/overduewarning/utils.ts @@ -0,0 +1,76 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { getChildrenTree } from '@/api/demo/system'; + +export const columns: BasicColumn[] = [ + { + title: '项目编号', + dataIndex: 'xiangmu_no', + }, + { + title: '项目名称', + dataIndex: 'xiangmu_name', + width: 200, + }, + { + title: '行政区划', + dataIndex: 'xingzhengquhua', + }, + { + title: '备案编号', + dataIndex: 'beian_no', + }, + { + title: '项目开始时间', + dataIndex: 'start_time', + width: 200, + }, + { + title: '项目结束时间', + dataIndex: 'end_time', + }, + { + title: '项目当前用途', + dataIndex: 'xiangmu_yt', + width: 110, + }, + { + title: '设施农业申请用地面积(公顷)', + dataIndex: 'shenqing_area', + width: 200, + }, + { + title: '生产设施用地(公顷)', + dataIndex: 'shengchan_area', + width: 200, + }, + { + title: '辅助设施用地(公顷)', + dataIndex: 'fuzhu_area', + width: 200, + }, +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'xiangmumc', + component: 'Input', + colProps: { span: 5 }, + label: '项目名称', + }, + { + field: 'streetid', + label: '乡镇', + component: 'ApiSelect', + colProps: { span: 4 }, + componentProps: ({ formModel }) => { + return { + api: getChildrenTree, + params: { parentId: 371324 }, + // 接口参数 + resultField: 'result', + labelField: 'name', + valueField: 'id', + }; + }, + }, +];