浏览代码

修复bug

yangyuxuan 3 月之前
父节点
当前提交
b7355468d6

+ 3 - 3
src/api/dataFilling/fillingManage.ts

@@ -11,11 +11,11 @@ export function fillingAdd(data) {
 }
 
 // 填报管理
-export function fillingSelect(data) {
+export function fillingSelect(params) {
   return request({
     url: '/api/dataFilling/select',
-    method: 'post',
-    data: data
+    method: 'get',
+    params: params
   });
 }
 

+ 10 - 4
src/components/DataImport/DataImportDetail.vue

@@ -3,7 +3,7 @@
     <el-table v-show="!showDetails" ref="tableRef" :data="dataList">
       <el-table-column label="文件名称" align="center" prop="file_name" />
       <el-table-column label="时间" align="center" prop="update_time" />
-      <el-table-column label="操作账号" align="center" prop="event_title" />
+      <el-table-column label="操作账号" align="center" prop="event_title"> {{ userStore.nickname }}</el-table-column>
       <el-table-column label="状态" align="center" prop="status">
         <template #default="scope">
           <el-text v-if="scope.row.status === '1'" type="success">已完成</el-text>
@@ -12,8 +12,7 @@
       </el-table-column>
       <el-table-column label="备注" align="center" prop="event_title">
         <template #default="scope">
-          <div>错误3条</div>
-          <el-text class="common-btn-text-primary" @click="handleShowDetails(scope.row.id)">详情</el-text>
+          <el-text v-if="scope.row.remark.length !== 0" class="common-btn-text-primary" @click="handleShowDetails(scope.row.remark)">详情</el-text>
         </template>
       </el-table-column>
     </el-table>
@@ -26,6 +25,7 @@
     />
     <div v-show="showDetails">
       <div style="width: 100%;text-align: center">
+        <div style="margin-bottom: 20px">{{details}}</div>
         <el-button type="primary" @click="showDetails = false">返回</el-button>
       </div>
     </div>
@@ -34,6 +34,10 @@
 
 <script lang="ts" setup name="DataImportDetail">
 import { getSituation } from '@/api/PreventionResponsible';
+import { useUserStore } from '@/store/modules/user';
+
+// 使用 store
+const userStore = useUserStore();
 
 const props = defineProps({
   modelValue: Boolean
@@ -64,8 +68,10 @@ const getList = () => {
 
 
 let showDetails = ref(false);
-const handleShowDetails = (id) => {
+const details = ref('');
+const handleShowDetails = (remark) => {
   showDetails.value = true;
+  details.value = remark;
 };
 onMounted(() => {
   getList();

+ 1 - 0
src/layout/components/Sidebar/SidebarItem.vue

@@ -161,6 +161,7 @@ const getIconClass = (item) => {
       .nest-menu {
         .el-sub-menu__title {
           color: #939faa;
+          margin-left: -6px;
         }
         .is-opened {
           .el-sub-menu__title {

+ 1 - 5
src/types/auto-imports.d.ts

@@ -307,7 +307,7 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }
 // for vue template auto import
@@ -388,7 +388,6 @@ declare module 'vue' {
     readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
     readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
     readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
-    readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
     readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
     readonly provide: UnwrapRef<typeof import('vue')['provide']>
     readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
@@ -500,7 +499,6 @@ declare module 'vue' {
     readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
     readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
     readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
-    readonly useId: UnwrapRef<typeof import('vue')['useId']>
     readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
     readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
     readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
@@ -517,7 +515,6 @@ declare module 'vue' {
     readonly useMediaQuery: UnwrapRef<typeof import('@vueuse/core')['useMediaQuery']>
     readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
     readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
-    readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
     readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
     readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
     readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
@@ -565,7 +562,6 @@ declare module 'vue' {
     readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
     readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
     readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
-    readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
     readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
     readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
     readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>

+ 19 - 3
src/types/components.d.ts

@@ -24,10 +24,15 @@ declare module 'vue' {
     DistributionMap: typeof import('./../components/Map/YztMap/DistributionMap.vue')['default']
     DrawMap: typeof import('./../components/Map/YztMap/DrawMap.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
+    ElAnchor: typeof import('element-plus/es')['ElAnchor']
+    ElAnchorLink: typeof import('element-plus/es')['ElAnchorLink']
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
+    ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
+    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
@@ -44,25 +49,34 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
+    ElLink: typeof import('element-plus/es')['ElLink']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
-    ElSlider: typeof import('element-plus/es')['ElSlider']
+    ElStep: typeof import('element-plus/es')['ElStep']
+    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTable: typeof import('element-plus/es')['ElTable']
+    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
     ElTimeline: typeof import('element-plus/es')['ElTimeline']
     ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
@@ -74,6 +88,8 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 1 - 1
src/utils/ruoyi.ts

@@ -71,7 +71,7 @@ export const addDateRange2 = (params: any, dateRange: any[], beginTimeName?: str
     search['endTime'] = dateRange[1];
   } else {
     search[beginTimeName] = dateRange[0];
-    search[beginTimeName] = dateRange[1];
+    search[endTimeName] = dateRange[1];
   }
   return search;
 };

+ 4 - 3
src/views/dataFilling/fillingManage.vue

@@ -43,7 +43,7 @@
                       range-separator="至"
                       start-placeholder="开始日期"
                       end-placeholder="结束日期"
-                      @change="handleTimeChange"
+                      value-format="YYYY-MM-DD HH:mm:ss"
                     />
                   </el-form-item>
                 </el-col>
@@ -126,7 +126,8 @@ import { ElButton, ElCol } from 'element-plus';
 import { fillingSelect, fillingRelease } from '@/api/dataFilling/fillingManage';
 import * as XLSX from 'xlsx';
 import { deepClone } from '@/utils';
-import { parseTime } from '@/utils/ruoyi';
+import { addDateRange2, parseTime } from '@/utils/ruoyi';
+import { fillList } from '@/api/dataFilling/datafilling';
 
 const loading = ref(true);
 const showSearch = ref(true);
@@ -208,7 +209,7 @@ const handleView = (row) => {
 
 const fetchFillList = () => {
   loading.value = true;
-  const params = deepClone(queryParams.value);
+  let params = addDateRange2(deepClone(queryParams.value), selectedTime.value, 'start_time', 'end_time');
   params.status = !queryParams.value.status ? [] : [queryParams.value.status];
   params.issued_status = !queryParams.value.issued_status ? [] : [queryParams.value.issued_status];
   fillingSelect(params)

+ 2 - 2
src/views/dataFilling/myFilling.vue

@@ -8,7 +8,7 @@
               <el-row :gutter="20">
                 <el-col :span="6">
                   <el-form-item label="表格名称:" prop="table_name" label-width="auto">
-                    <el-input v-model="queryParams.table_name" placeholder="请输入巡查人"></el-input>
+                    <el-input v-model="queryParams.table_name" placeholder="请输入表格名称"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="6">
@@ -174,7 +174,7 @@ onMounted(() => {
 
 const handleQuery = () => {
   queryParams.value.page = 1; // 重置页码
-  fetchFillList(queryParams.value);
+  fetchFillList();
 };
 
 const resetQuery = () => {

+ 9 - 9
src/views/dataManagement/dataManagementADD.vue

@@ -65,15 +65,15 @@ const formData = ref({
 });
 
 const rules = ref({
-  name: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  unit: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  maintainUnit: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  engineer: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  location: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  operation: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  plannedArea: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  actualArea: [{ required: true, message: '不能为空', trigger: 'blur' }],
-  updateTime: [{ required: true, message: '不能为空', trigger: 'blur' }]
+  name: [{ required: true, message: '工程名称不能为空', trigger: 'blur' }],
+  unit: [{ required: true, message: '建设单位不能为空', trigger: 'blur' }],
+  maintainUnit: [{ required: true, message: '维护单位不能为空', trigger: 'blur' }],
+  engineer: [{ required: true, message: '人防专业监理工程师不能为空', trigger: 'blur' }],
+  location: [{ required: true, message: '建设地点不能为空', trigger: 'blur' }],
+  operation: [{ required: true, message: '操作方式不能为空', trigger: 'blur' }],
+  plannedArea: [{ required: true, message: '应建人防地下室面积不能为空', trigger: 'blur' }],
+  actualArea: [{ required: true, message: '实建人防地下室面积不能为空', trigger: 'blur' }],
+  updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }]
 });
 
 const form = ref(null); // 定义 form 变量

+ 63 - 12
src/views/setting/riskPrevention/userManage.vue

@@ -8,9 +8,20 @@
               <!-- 第一行 -->
               <el-col :span="6">
                 <el-form-item label="单位名称:" prop="unitId">
-                  <el-select v-model="queryForm.unitId" placeholder="全部" clearable>
-                    <el-option v-for="item in unitList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
-                  </el-select>
+<!--                  <el-select v-model="queryForm.unitId" placeholder="全部" clearable>-->
+<!--                    <el-option v-for="item in unitList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>-->
+<!--                  </el-select>-->
+                  <el-tree-select
+                    v-model="queryForm.unitId"
+                    :data="unitList"
+                    :render-after-expand="false"
+                    placeholder="请选择单位"
+                    clearable
+                    filterable
+                    style="width: 468px !important"
+                    :props="props"
+                    node-key="deptId"
+                  />
                 </el-form-item>
               </el-col>
               <el-col :span="6">
@@ -72,9 +83,19 @@
         <div class="common-dialog-box">
           <el-form ref="addFormRef" :model="addForm" :rules="rules" label-width="120px">
             <el-form-item label="单位名称:" prop="unitId">
-              <el-select v-model="addForm.unitId" placeholder="请选择单位" clearable style="width: 468px !important">
-                <el-option v-for="item in unitList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>
-              </el-select>
+<!--              <el-select v-model="addForm.unitId" placeholder="请选择单位" clearable style="width: 468px !important">-->
+<!--                <el-option v-for="item in unitList" :key="item.deptId" :label="item.deptName" :value="item.deptId"></el-option>-->
+<!--              </el-select>-->
+              <el-tree-select
+                v-model="addForm.unitId"
+                :data="unitList"
+                :render-after-expand="false"
+                placeholder="请选择单位"
+                clearable
+                style="width: 468px !important"
+                :props="props"
+                node-key="deptId"
+              />
             </el-form-item>
             <el-form-item label="联系人:" prop="contactName">
               <el-input v-model="addForm.contactName" placeholder="请输入联系人" style="width: 468px !important" />
@@ -121,6 +142,7 @@ import {
 } from '@/api/riskPrevention/planManage';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 import { to } from 'await-to-js';
+import { validatePhone } from '@/utils/validate';
 
 interface QueryForm {
   page: number;
@@ -136,7 +158,9 @@ interface resultVO {
   position: string;
   phone: string;
 }
-
+const props = ref({
+  label:'deptName'
+})
 const queryForm = reactive<QueryForm>({
   page: 1,
   pageSize: 10,
@@ -170,10 +194,36 @@ const getList = async () => {
 
 onMounted(async () => {
   const res = await listDept();
-  unitList.value = res.data;
+  unitList.value = transformToTree(res.data);
   getList();
 });
 
+const transformToTree = (data, parentId = 0) => {
+  const map = {};
+  const result = [];
+  // 首先,将所有数据项放入一个映射中,以便快速查找
+  data.forEach(item => {
+    map[item.deptId] = { ...item, children: [] };
+  });
+  // 然后,遍历数据项,构建树形结构
+  data.forEach(item => {
+    const node = map[item.deptId];
+    if (item.parentId === parentId) {
+      // 如果 parentId 匹配,则将该节点添加到结果数组中
+      result.push(node);
+    } else {
+      // 否则,找到其父节点,并将其添加到父节点的 children 数组中
+      const parentNode = map[item.parentId];
+      if (parentNode) {
+        parentNode.children.push(node);
+      }
+    }
+  });
+  console.log('fanhui', result);
+  return result;
+}
+
+
 const handleQuery = () => {
   queryForm.page = 1;
   getList();
@@ -242,10 +292,11 @@ let addForm = ref({
 });
 
 const rules = reactive({
-  unitId: [{ required: true, message: '单位名称', trigger: 'blur' }],
-  contactName: [{ required: true, message: '联系人', trigger: 'blur' }],
-  position: [{ required: true, message: '职务', trigger: 'blur' }],
-  phone: [{ required: true, message: '粤政易手机号码', trigger: 'blur' }]
+  unitId: [{ required: true, message: '单位名称不能为空', trigger: 'blur' }],
+  contactName: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
+  position: [{ required: true, message: '职务不能为空', trigger: 'blur' }],
+  phone: [{ required: true, message: '粤政易手机号码不能为空', trigger: 'blur' },
+          { validator: validatePhone, message: '请输入正确格式的联系电话', trigger: 'blur' }]
 });
 
 const resetForm = () => {

+ 1 - 1
src/views/system/dept/index.vue

@@ -58,7 +58,7 @@
         :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
         :default-expand-all="isExpandAll"
       >
-        <el-table-column prop="deptName" align="center" label="部门名称"></el-table-column>
+        <el-table-column prop="deptName" align="left" label="部门名称"></el-table-column>
         <el-table-column prop="deptCategory" align="center" label="类别编码" width="300"></el-table-column>
         <el-table-column prop="orderNum" align="center" label="排序" width="50"></el-table-column>
         <el-table-column prop="status" align="center" label="状态" width="160">

+ 1 - 1
src/views/system/menu/index.vue

@@ -47,7 +47,7 @@
         :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
         :default-expand-all="isExpandAll"
       >
-        <el-table-column prop="menuName" align="center" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
+        <el-table-column prop="menuName" align="left" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
         <el-table-column prop="icon" label="图标" align="center" width="100">
           <template #default="scope">
             <svg-icon :icon-class="scope.row.icon" />