tangning 9 місяців тому
батько
коміт
c47e274d0f

+ 1 - 1
.env

@@ -5,4 +5,4 @@ VITE_PORT = 3100
 VITE_GLOB_APP_TITLE = 江门公安
 
 # spa shortname
-VITE_GLOB_APP_SHORT_NAME = 江门公安实景三维
+VITE_GLOB_APP_SHORT_NAME = 实景三维

+ 1 - 1
index.html

@@ -159,7 +159,7 @@
           <div class="app-loading-dots">
             <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
           </div>
-          <div class="app-loading-title">数字现勘</div>
+          <!-- <div class="app-loading-title">数字现勘</div> -->
         </div>
       </div>
     </div>

+ 37 - 0
src/App.vue

@@ -11,16 +11,53 @@
   import { AppProvider } from '/@/components/Application';
   import { useTitle } from '/@/hooks/web/useTitle';
   import { useLocale } from '/@/locales/useLocale';
+  // import { useLocale } from '/@/locales/useLocale';
   import { useUserStoreWithOut } from '/@/store/modules/user';
+  import { useAppStoreWithOut } from '/@/store/modules/app';
+  import { addressKey } from '/@/api/jyUserPlatform/index';
+  import { useMessage } from '/@/hooks/web/useMessage';
 
   // support Multi-language
+  const { createConfirm } = useMessage();
   const { getAntdLocale } = useLocale();
+  const appStore = useAppStoreWithOut();
   let token = localStorage.getItem('token');
   if (token) {
     const userStore = useUserStoreWithOut();
     userStore.setToken(token);
     // localStorage.removeItem('token');
   }
+  function getUrlParams2() {
+    let url = window.location.href
+    let urlStr = url.split('?')[1]
+    const urlSearchParams = new URLSearchParams(urlStr)
+    const result = Object.fromEntries(urlSearchParams.entries())
+    let address = result['key']
+    if(address){
+      addressKey(address).then(res => {
+        if(res.status == 1){
+          createConfirm({
+            iconType: 'warning',
+            title: '警告',
+            content: `当前账户已停用,请联系平台管理员`,
+            onOk: async () => {
+              onClose()
+            },
+            onCancel: async () => {
+              onClose()
+            },
+          });
+          return
+        }
+        appStore.setTitle(res.platformName);
+      })
+    }
+  }
+  const onClose = () => {
+    window.opener = null;
+    window.open('about:blank', '_top')?.close();
+  };
+  getUrlParams2()
   // Listening to page changes and dynamically changing site titles
   useTitle();
 </script>

+ 6 - 35
src/components/Application/src/AppLogo.vue

@@ -7,7 +7,7 @@
     <!-- <img src="../../../assets/images/grey-logo.png" /> -->
     <img src="/resource/img/logo.png" />
     <div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
-      {{ zdyTitile || title1 }}
+      {{ mytitle || title1 }}
     </div>
   </div>
 </template>
@@ -19,8 +19,8 @@
   import { useDesign } from '/@/hooks/web/useDesign';
   import { PageEnum } from '/@/enums/pageEnum';
   import { useUserStore } from '/@/store/modules/user';
-  import { addressKey } from '/@/api/jyUserPlatform/index';
-  import { useMessage } from '/@/hooks/web/useMessage';
+  import { useRootSetting } from '/@/hooks/setting/useRootSetting';
+
   const props = defineProps({
     /**
      * The theme of the current parent component
@@ -36,43 +36,14 @@
     alwaysShowTitle: { type: Boolean },
   });
 
-  const { createConfirm } = useMessage();
+  const { getTitle } = useRootSetting();
+  const mytitle = computed(() => getTitle.value);
   const { prefixCls } = useDesign('app-logo');
   const { getCollapsedShowTitle } = useMenuSetting();
   const userStore = useUserStore();
   const { title1 } = useGlobSetting();
-  const zdyTitile = ref(title1)
   const go = useGo();
-  const onClose = () => {
-    window.opener = null;
-    window.open('about:blank', '_top')?.close();
-  };
-  function getUrlParams2() {
-    let url = window.location.href
-    let urlStr = url.split('?')[1]
-    const urlSearchParams = new URLSearchParams(urlStr)
-    const result = Object.fromEntries(urlSearchParams.entries())
-    let address = result['key']
-    if(address){
-      addressKey(address).then(res => {
-        if(res.status == 1){
-          createConfirm({
-            iconType: 'warning',
-            title: '警告',
-            content: `当前账户已停用,请联系平台管理员`,
-            onOk: async () => {
-              onClose()
-            },
-            onCancel: async () => {
-              onClose()
-            },
-          });
-        }
-        zdyTitile.value = res.platformName
-      })
-    }
-  }
-  getUrlParams2()
+
   const getAppLogoClass = computed(() => [
     prefixCls,
     props.theme,

+ 3 - 0
src/hooks/setting/useRootSetting.ts

@@ -53,6 +53,8 @@ export function useRootSetting() {
 
   const getDarkMode = computed(() => appStore.getDarkMode);
 
+  const getTitle = computed(() => appStore.getTitle);
+
   const getLayoutContentMode = computed(() =>
     appStore.getProjectConfig.contentMode === ContentEnum.FULL
       ? ContentEnum.FULL
@@ -91,5 +93,6 @@ export function useRootSetting() {
     getDarkMode,
     setDarkMode,
     getShowDarkModeToggle,
+    getTitle,
   };
 }

+ 10 - 1
src/store/modules/app.ts

@@ -21,6 +21,8 @@ interface AppState {
   darkMode?: ThemeEnum;
   // Page loading status
   pageLoading: boolean;
+  title: string;
+  // description: string;
   // project config
   projectConfig: ProjectConfig | null;
   // When the window shrinks, remember some states, and restore these states when the window is restored
@@ -34,11 +36,16 @@ export const useAppStore = defineStore({
     pageLoading: false,
     projectConfig: Persistent.getLocal(PROJ_CFG_KEY),
     beforeMiniInfo: {},
+    title: '江门公安',
+    // description: '',
   }),
   getters: {
     getPageLoading(): boolean {
       return this.pageLoading;
     },
+    getTitle(): string {
+      return this.title;
+    },
     getDarkMode(): 'light' | 'dark' | string {
       return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode;
     },
@@ -73,7 +80,9 @@ export const useAppStore = defineStore({
       this.darkMode = mode;
       localStorage.setItem(APP_DARK_MODE_KEY_, mode);
     },
-
+    setTitle(title: string): void {
+      this.title = title;
+    },
     setBeforeMiniInfo(state: BeforeMiniState): void {
       this.beforeMiniInfo = state;
     },

+ 22 - 4
src/views/lanUser/detailsModal.vue

@@ -81,6 +81,24 @@
           component: 'Input',
           required: true,
           label: '身份证',
+          rules: [
+            {
+              required: true,
+              // @ts-ignore
+              validator: async (rule, value) => {
+                const regPos = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; // 非中文
+                if (!value) {
+                  return Promise.reject('请输入身份证');
+                }
+                if (!regPos.test(value)) {
+                  /* eslint-disable-next-line */
+                  return Promise.reject('请输入正确的身份证号码');
+                }
+                return Promise.resolve();
+              },
+              trigger: 'change',
+            },
+          ],
           colProps: {
             span: 20,
           },
@@ -169,6 +187,7 @@
         });
         console.log('res', res);
         context && context.emit('ok', res);
+        let url = window.location.origin + window.location.pathname + '?key=' + res.platformAddress;
         createConfirm({
           iconType: 'warning',
           okText: '复制',
@@ -176,19 +195,18 @@
           content: () =>
             h('div', {}, [
               h('div', null, `平台名称:${res.platformName}`),
-              h('div', null, `平台地址:${res.platformAddress}`),
+              h('div', null, `平台地址:${url}`),
               h('div', null, `平台管理员:${res.name},${res.idCard}`),
             ]),
           onOk: async () => {
-            await handleCopy(res.platformAddress);
+            await handleCopy(url);
           },
         });
         createMessage.success(t('common.optSuccess'));
         closeModal();
         resetFields();
       }
-      function handleCopy(key) {
-        let url = window.location.origin + window.location.pathname + '?key=' + key;
+      function handleCopy(url) {
         const { isSuccessRef } = useCopyToClipboard(url);
         isSuccessRef && createMessage.success('复制成功');
       }

+ 1 - 1
src/views/lanUser/list.vue

@@ -163,7 +163,7 @@
           // ifShow:getCheckPerm('sysuser-enable'),
           width: 80,
           customRender: ({ record }) => {
-            // return record.status == 1 ? '启用' : '禁用';
+            return record.status == 1 ? '启用' : '禁用';
             if (!Reflect.has(record, 'status')) {
               record.pendingStatus = false;
             }

+ 16 - 4
src/views/sys/login/Login.vue

@@ -54,15 +54,25 @@
               enter-x
             "
           >
-            <div class="title">
+            <div class="title" v-if="mytitle != '江门公安'">
               <div class="titleText" style="font-weight: bold; letter-spacing: 12px">
                 <div style="margin-bottom: 0">案事件实景三维重建</div>
                 <div>及数字化建档系统</div>
               </div>
-              <!-- <div class="en text-sm font-normal mb-5 titleSubtext" style="line-height: 30px; margin-bottom:80px;color:#666">
+              <div class="en text-sm font-normal mb-5 titleSubtext" style="line-height: 30px; margin-bottom:24px;color:#666">
+                <div>3D Scene Reconstruction and Digital Archiving System of Police</div>
+                <div>Cases and Events</div>
+              </div>
+            </div>
+            <div class="title" v-else>
+              <div class="titleText" style="font-weight: bold; letter-spacing: 12px">
+                <div style="margin-bottom: 0">江门市公安局</div>
+                <div>警用三维实景平台</div>
+              </div>
+              <div class="en text-sm font-normal mb-5 titleSubtext" style="line-height: 30px; margin-bottom:24px;color:#666">
                 <div>Three-Dimensional Police Scene Platform for Public Security</div>
                 <div>Bureau of Jiangmen Municipality</div>
-              </div> -->
+              </div>
             </div>
             <LoginForm />
             <ForgetPasswordForm />
@@ -88,13 +98,15 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useLocaleStore } from '/@/store/modules/locale';
+  import { useRootSetting } from '/@/hooks/setting/useRootSetting';
 
   defineProps({
     sessionTimeout: {
       type: Boolean,
     },
   });
-
+  const { getTitle } = useRootSetting();
+  const mytitle = computed(() => getTitle.value);
   const globSetting = useGlobSetting();
   const { prefixCls } = useDesign('login');
   const { t } = useI18n();

+ 2 - 2
src/views/sys/login/LoginForm.vue

@@ -49,9 +49,9 @@
       <Button style="border-radius: 5px" type="primary" size="large" block @click="handleLogin" :loading="loading">
         {{ t('sys.login.loginButton') }}
       </Button>
-      <!-- <Button size="large" class="mt-4 enter-x" block @click="handleRegister">
+      <Button size="large" class="mt-4 enter-x" block @click="handleRegister">
         {{ t('sys.login.registerButton') }}
-      </Button> -->
+      </Button>
     </FormItem>
     <!-- <ARow class="enter-x">
       <ACol :md="8" :xs="24">