Ver código fonte

Merge remote-tracking branch 'origin/master'

zhangying 11 meses atrás
pai
commit
cdc998fff5

+ 1 - 0
vue/public/index.html

@@ -8,6 +8,7 @@
     <meta name="referrer" content="no-referrer" />
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
+    <script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=e9ece4c8c4db9f3f7a7511c595eceb67"></script>
 </head>
 <body>
 <noscript>

+ 1 - 0
vue/src/router/asyncModules/basesettings.ts

@@ -11,4 +11,5 @@ export default {
   'baseSettings/user/add': () => import('@/views/baseSettings/siteUser/edit.vue'),
   'baseSettings/user/edit': () => import('@/views/baseSettings/siteUser/edit.vue'),
   'baseSettings/user/detail': () => import('@/views/baseSettings/siteUser/detail.vue'),
+  'baseSettings/positionmap/index': () => import('@/views/baseSettings/positionMap/index.vue'),
 };

+ 138 - 0
vue/src/views/baseSettings/positionMap/index.vue

@@ -0,0 +1,138 @@
+<template>
+  <div class="card-search">
+    <a-form
+      ref="formRef"
+      name="advanced_search"
+      class="ant-advanced-search-form"
+      :model="searchParams"
+    >
+      <a-row :gutter="24">
+        <a-col :span="6">
+          <a-form-item label="所属县区" :label-col="{ span: 8 }" name="regionCode">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.regionCode"
+              :options="regionList"
+              :field-names="{ label: 'name', value: 'code' }"
+              :allow-clear="true"
+              @change="changeRegion"
+            >
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="6">
+          <a-form-item label="所属驿站" :label-col="{ span: 8 }" name="siteID">
+            <a-select
+              ref="select"
+              v-model:value="searchParams.siteID"
+              :options="allSites"
+              :field-names="{ label: 'siteName', value: 'siteID' }"
+              :allow-clear="true"
+              style="width: 200px"
+              @change="loadData"
+            >
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="6">
+          <a-form-item label="日期" :label-col="{ span: 8 }" name="startDate">
+            <a-input
+              v-model:value="searchParams.startDate"
+              placeholder=""
+              :allow-clear="true"
+              type="date"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :span="6" style="text-align: left">
+          <a-button type="primary" html-type="submit" @click="onSearch">查询</a-button>
+          <a-button
+            style="margin: 0 8px"
+            @click="
+              () => {
+                formRef.resetFields();
+                loadData();
+              }
+            "
+            >重置
+          </a-button>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="6">
+          <a-form-item label="人员名称" :label-col="{ span: 8 }" name="userName">
+            <a-input v-model:value="searchParams.userName" placeholder="" :allow-clear="true" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+    <div
+      id="mapDiv"
+      style="
+        position: absolute;
+        width: calc(100% - 270px);
+        height: calc(100% - 300px);
+        z-index: 100;
+      "
+    ></div>
+  </div>
+</template>
+
+<script lang="ts">
+  import { defineComponent, onMounted, ref } from 'vue';
+  import dayjs from 'dayjs';
+  import type { FormInstance, SelectProps } from 'ant-design-vue';
+  import { getRegionCodeList } from '@/api/system/area/index';
+  import { getSiteList } from '@/api/baseSettings/siteInfo';
+
+  export default defineComponent({
+    name: 'PositionMapIndex',
+    setup() {
+      const formRef = ref<FormInstance>();
+      const T = (window as any).T;
+      const zoom = 14;
+      let map = null;
+      const regionList = ref<SelectProps['options']>();
+      const allSites = ref<any>([]);
+      const searchParams = ref({
+        startDate: dayjs(new Date()).format('YYYY-MM-DD'),
+      });
+
+      const loadData = () => {
+        return '';
+      };
+      const getRegionList = async function () {
+        const regionResult: any = await getRegionCodeList();
+        regionList.value = regionResult;
+      };
+      const getAllSites = () => {
+        getSiteList({ pageIndex: 1, pageSize: 1000 }).then((result: any) => {
+          allSites.value = result.list;
+        });
+      };
+
+      const initMap = () => {
+        console.log(`T:${T}`);
+        //初始化地图对象
+        map = new T.Map('mapDiv');
+
+        if (map != null) (map as any).centerAndZoom(new T.LngLat(114.4, 23.08), zoom); //惠州市
+      };
+
+      onMounted(() => {
+        initMap();
+        getRegionList();
+        getAllSites();
+      });
+
+      return {
+        searchParams,
+        loadData,
+        formRef,
+        regionList,
+        allSites,
+      };
+    },
+    created() {},
+  });
+</script>

+ 15 - 3
vue/src/views/jobUserManager/jobuser/edit.vue

@@ -12,14 +12,14 @@
         <a-col :span="8">
           <a-form-item  label="身份证号码" :label-col="{ span: 6 }"
                         name="identityNumber" :rules="[{ required: true, message: '请输入身份证号码!' }]" >
-            <a-input v-model:value="dataModel.identityNumber" placeholder=""/>
+            <a-input v-model:value="dataModel.identityNumber" placeholder="" @change="onIdentityNumberChange()"/>
           </a-form-item>
         </a-col>
         <a-col :span="8">
         <a-form-item label="性别" :label-col="{span:6}"
                      name="sex" :rules="[{ required: true, message: '请选择性别!' }]">
           <a-select
-            ref="select"
+            ref="select" disabled
             v-model:value="dataModel.sex"
             :options="genderList"
             :field-names="{ label: 'name', value: 'value' }"
@@ -187,7 +187,7 @@
       <a-row :gutter="24">
         <a-col :span="8">
           <a-form-item label="出生日期" :label-col="{ span: 6 }" name="birthDay" >
-            <a-date-picker
+            <a-date-picker disabled
               v-model:value="dataModel.birthDay"
               picker="date"
               value-format="YYYY-MM-DD"/>
@@ -507,6 +507,7 @@ import {getSysDictionaryList} from '@/api/system/dictionary';
 import {getDataById, getEducationList, getExperienceList, save} from '@/api/jobUserManager/jobuser';
 import {getSiteList} from "@/api/baseSettings/siteInfo";
 import {getInfo} from "@/api/account";
+import dayjs from "dayjs";
 
 interface FormState {
   dataModel: any;
@@ -597,6 +598,16 @@ export default defineComponent(
         fileList.value = files;
       };
 
+      const onIdentityNumberChange =()=>{
+        const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
+        if(formState.dataModel.identityNumber.match(identReg)&&formState.dataModel.identityNumber.length==18){
+          const birthDayStr = String(formState.dataModel.identityNumber).substring(6,14);
+          const sexStr = String(formState.dataModel.identityNumber).substring(16,17);
+          formState.dataModel.sex = parseInt(sexStr)%2 == 0 ? 2 : 1; //双女单男
+          formState.dataModel.birthDay = dayjs(birthDayStr).format("YYYY-MM-DD");
+        }
+      }
+
       const inputDataValidate = () =>{
         isAllowCommit.value = true;
         const identReg = /^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
@@ -874,6 +885,7 @@ export default defineComponent(
         delEducation,
         loadEducation,
         inputDataValidate,
+        onIdentityNumberChange,
         siteList,
         regionList,
         streetList,