tangning 10 月之前
父節點
當前提交
ad07af453c

+ 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"><%= title %></div>
+          <div class="app-loading-title">数字现勘</div>
         </div>
       </div>
     </div>

+ 7 - 7
src/api/jyUserPlatform/index.ts

@@ -15,6 +15,7 @@ enum Api {
   yhadd = '/service/manage/jyUserPlatform/add',
   yhupdate = '/service/manage/jyUserPlatform/update',
   yhdel = '/service/manage/jyUserPlatform/del',
+  addressKey = '/service/manage/index/addressKey/',
 }
 
 /**
@@ -86,9 +87,9 @@ export const jyUserPlatformadd = (params: PageParams) =>
   });
 
 //权益详情
-export const DetailsApi = (params: PageParams) =>
+export const disable = (params: PageParams) =>
   defHttp.post<userList>({
-    url: Api.getIncrementListByUserId,
+    url: Api.disable,
     params: params,
     // data: params,
     headers: {
@@ -98,9 +99,9 @@ export const DetailsApi = (params: PageParams) =>
   });
 
 //权益延期
-export const IncrementDelayApi = (params: PageParams) =>
+export const enable = (params: PageParams) =>
   defHttp.post<userList>({
-    url: Api.IncrementDelay,
+    url: Api.enable,
     params: params,
     headers: {
       // @ts-ignore
@@ -153,10 +154,9 @@ export const GetCameraDetailApi = (params: PageParams) =>
   });
 
 //相机解绑
-export const UnbindCameraApi = (params: PageParams) =>
+export const addressKey = (address) =>
   defHttp.get<userList>({
-    url: Api.unbindCamera,
-    params: params,
+    url: Api.addressKey + address,
     headers: {
       // @ts-ignore
       ignoreCancelToken: true,

+ 19 - 4
src/components/Application/src/AppLogo.vue

@@ -7,19 +7,19 @@
     <!-- <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">
-      {{ title1 }}
+      {{ zdyTitile || title1 }}
     </div>
   </div>
 </template>
 <script lang="ts" setup>
-  import { computed, unref } from 'vue';
+  import { computed, unref, ref } from 'vue';
   import { useGlobSetting } from '/@/hooks/setting';
   import { useGo } from '/@/hooks/web/usePage';
   import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { PageEnum } from '/@/enums/pageEnum';
   import { useUserStore } from '/@/store/modules/user';
-
+  import { addressKey } from '/@/api/jyUserPlatform/index';
   const props = defineProps({
     /**
      * The theme of the current parent component
@@ -39,8 +39,23 @@
   const { getCollapsedShowTitle } = useMenuSetting();
   const userStore = useUserStore();
   const { title1 } = useGlobSetting();
+  const zdyTitile = ref(title1)
   const go = useGo();
-
+  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']
+    console.log(address, 'getUrlParams2')
+    if(address){
+      addressKey(address).then(res => {
+        console.log(res, 'getUrlParams2')
+        zdyTitile.value = res.platformName
+      })
+    }
+  }
+  getUrlParams2()
   const getAppLogoClass = computed(() => [
     prefixCls,
     props.theme,

+ 1 - 1
src/hooks/setting/index.ts

@@ -2,7 +2,7 @@ import type { GlobConfig } from '/#/config';
 
 import { warn } from '/@/utils/log';
 import { getAppEnvConfig } from '/@/utils/env';
-
+console.log('getAppEnvConfig()', window.Location);
 export const useGlobSetting = (): Readonly<GlobConfig> => {
   const {
     VITE_GLOB_APP_TITLE,

+ 56 - 57
src/views/lanUser/adddetailsModal.vue

@@ -35,64 +35,59 @@
       const preventAutoFill = ref(true);
       const { companyId } = userinfo.value;
       let lastFetchId = 0;
-      const fetchUser = debounce((value) => {
-        console.log('fetching user', value);
-        if(!value){
+      const fetchUser = debounce((e) => {
+        let value = e.target.value;
+        if (!value) {
           return;
         }
         lastFetchId += 1;
         const fetchId = lastFetchId;
         options.value = [];
-        queryByKey({queryKey: value}).then((res) => {
+        setFieldsValue({
+          'id': null
+        });
+        queryByKey({ queryKey: value }).then((res) => {
           console.log('queryByKey', res);
           const data = res.map((user) => ({
-            label: `${user.queryKey}`,
+            ...user,
+            label: `${user.name}`,
             value: user.id,
           }));
           options.value = data;
+          updateSchema([
+            {
+              field: 'id',
+              ifShow: true,
+              componentProps: {
+                options: options.value,
+              },
+            },
+          ]);
         });
       }, 300);
       const schemas: FormSchema[] = [
-        // {
-        //   field: 'nickName',
-        //   component: 'Input',
-        //   label: '姓名',
-        //   colProps: {
-        //     span: 20,
-        //   },
-        //   componentProps: {
-        //     maxLength: 15,
-        //   },
-        //   rules: [
-        //     {
-        //       required: true,
-        //       // @ts-ignore
-        //       validator: async (rule, value) => {
-        //         var reg_tel = /^[a-zA-Z\u4e00-\u9fa5]+$/;
-        //         // var reg = /\S+@\S+\.\S+/;
-        //         if (!value) {
-        //           return Promise.reject('请输入姓名');
-        //         }
-        //         if (!reg_tel.test(value)) {
-        //           /* eslint-disable-next-line */
-        //           return Promise.reject('请输入正确的姓名');
-        //         }
-        //         return Promise.resolve();
-        //       },
-        //       trigger: 'change',
-        //     },
-        //   ],
-        // },
+        {
+          field: 'idkey',
+          component: 'Input',
+          label: '账号查询',
+          required: true,
+          colProps: {
+            span: 20,
+          },
+          componentProps: {
+            onChange: fetchUser,
+          }
+        },
         {
           field: 'id',
-          component: 'ApiSelect',
+          component: 'Select',
           label: '账号',
           required: true,
+          ifShow: false,
           colProps: {
             span: 20,
           },
           componentProps: {
-            // api: queryByKey,
             placeholder: '请选择平台',
             'label-in-value': true,
             options: options.value,
@@ -102,7 +97,7 @@
             labelField: 'name',
             valueField: 'id',
             immediate: true,
-            onChange:handleChange
+            // onChange: handleChange,
           },
         },
       ];
@@ -121,23 +116,26 @@
         data && onDataReceive(data);
       });
       function onDataReceive(data) {
-        console.log('onDataReceive',data)
+        console.log('onDataReceive', data);
         // 方式1;
-        setTimeout(()=>{
-          preventAutoFill.value = false
-          updateSchema([{
-            field: 'userName',
-            componentProps:{
-              readonly:false,
-            }
-          },{
-            field: 'password',
-            componentProps:{
-              readonly:false,
-            }
-          }])
+        setTimeout(() => {
+          preventAutoFill.value = false;
+          updateSchema([
+            {
+              field: 'userName',
+              componentProps: {
+                readonly: false,
+              },
+            },
+            {
+              field: 'password',
+              componentProps: {
+                readonly: false,
+              },
+            },
+          ]);
           // updateSchema(schemas);
-        },500)
+        }, 500);
       }
       function companyIdChange(companyId) {
         // resetFields(['permList'])
@@ -157,17 +155,18 @@
       }
       async function handleOk() {
         let data = await validate();
-        const requestApi =  saveAddApi; //data.id ? updateApi :
         let res = await jyUserPlatformadd({
-          ...data,
+          id: data.id.value,
+          platformId: '2a5ceb3ca61e4763'
         });
         context && context.emit('ok', res);
         createMessage.success(t('common.optSuccess'));
         closeModal();
         resetFields();
       }
-      function handleChange(value,b,a) {
-        console.log('value', value,b, a);
+      function handleChange(value, b, a) {
+        console.log('value', value, b, a);
+        updateSchema({ field: 'projectNum', ifShow: value == '4' });
       }
       return {
         register,

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

@@ -11,7 +11,7 @@
   </BasicModal>
 </template>
 <script lang="ts">
-  import { defineComponent, ref, computed, h } from 'vue';
+  import { defineComponent, ref, computed, h, unref } from 'vue';
   import { updateUcenterUser } from '/@/api/staff/list'; //roleLIstApi
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
@@ -19,6 +19,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useUserStore } from '/@/store/modules/user';
   import { addOrUpdate } from '/@/api/jyUserPlatform/index';
+  import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   const { t } = useI18n();
   export default defineComponent({
     components: { BasicModal, BasicForm },
@@ -164,22 +165,27 @@
         context && context.emit('ok', res);
         createConfirm({
           iconType: 'warning',
+          okText: '复制',
           title: () => h('span', data.id ? '修改成功' : '平台创建成功'),
           content: () =>
             h('div', {}, [
               h('div', null, `平台名称:${res.platformName}`),
               h('div', null, `平台地址:${res.platformAddress}`),
-              h('div', null, `平台管理员:${res.name}`),
+              h('div', null, `平台管理员:${res.name},${res.idCard}`),
             ]),
           onOk: async () => {
-            // await this.logout(true);
+            await handleCopy(res.platformAddress);
           },
         });
         createMessage.success(t('common.optSuccess'));
         closeModal();
         resetFields();
       }
-
+      function handleCopy(key) {
+        let url = window.location.origin + '?key=' + key;
+        const { isSuccessRef } = useCopyToClipboard(url);
+        isSuccessRef && createMessage.success('复制成功');
+      }
       return {
         register,
         title,

+ 26 - 7
src/views/lanUser/platformList.vue

@@ -19,10 +19,17 @@
           :actions="[
             {
               color: 'warning',
+              ifShow: record.status === 0,
               label: '禁用',
               onClick: handleOpenModal.bind(null, record),
             },
             {
+              color: 'warning',
+              label: '启用',
+              ifShow: record.status != 0,
+              onClick: handEnable.bind(null, record.id),
+            },
+            {
               label: '编辑',
               //ifShow:getCheckPerm('lanuser-update'),
               onClick: handleEdit.bind(null, record), //handleEdit.bind(null, record),
@@ -38,7 +45,7 @@
       </template>
     </BasicTable>
     <DetailsModal @register="registerDetail" @ok="reload" />
-    <SetpaswordModal @register="register" @reload="reload" />
+    <SetpaswordModal @register="register" @ok="reload" />
     <addDetailsModal @register="registerAddDetail" @ok="reload" />
   </div>
 </template>
@@ -64,7 +71,7 @@
   import { Time } from '/@/components/Time';
   import { useUserStore } from '/@/store/modules/user';
   import { usePermissionStore } from '/@/store/modules/permission';
-  import { jyPlatformlist, delplatformList } from '/@/api/jyUserPlatform/index'; //roleLIstApi
+  import { jyPlatformlist, delplatformList,enable } from '/@/api/jyUserPlatform/index'; //roleLIstApi
   export default defineComponent({
     components: {
       BasicTable,
@@ -113,23 +120,22 @@
         {
           title: '平台名称',
           dataIndex: 'platformName',
-          width: 120,
+          width: 150,
         },
         {
           title: '平台地址',
           dataIndex: 'platformAddress',
-          width: 150,
+          width: 100,
         },
         {
           title: '平台管理员姓名',
           dataIndex: 'name',
-          fixed: 'left',
-          width: 60,
+          width: 100,
         },
         {
           title: '平台管理员手机号码',
           dataIndex: 'phone',
-          width: 80,
+          width: 150,
         },
         {
           title: '添加时间',
@@ -306,6 +312,18 @@
           },
         });
       }
+      async function handEnable(id) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: '是否确认启用?',
+          onOk: async () => {
+            await enable({ id });
+            createMessage.success(t('common.optSuccess'));
+            reload();
+          },
+        });
+      }
       return {
         registerTable,
         registerDetail,
@@ -329,6 +347,7 @@
         surplusSubNum,
         getCheckPerm,
         getNumByStaffData,
+        handEnable,
       };
     },
   });

+ 28 - 15
src/views/lanUser/setpaswordModal.vue

@@ -4,37 +4,38 @@
     @register="register"
     @ok="handSubmit"
     title="提示"
-    :min-height="200"
-    @visible-change="handleVisibleChange"
+    :min-height="250"
     @cancel="resetFields"
   >
     <div class="pt-3px pr-3px">
+      <BasicForm @register="registerForm" />
       <span style="margin-left: 100px; color: #9f9c9c"
-        >禁用后,该平台无法打开。请为已有用户分配平台</span
+        >禁用后,该平台无法打开。请为已有用户分配平台</span
       >
-      <BasicForm @register="registerForm" />
     </div>
   </BasicModal>
 </template>
 <script lang="ts">
   import { useI18n } from '/@/hooks/web/useI18n';
   import { encodeStr } from '/@/utils/encodeUtil';
-  import { defineComponent, nextTick, ref } from 'vue';
+  import { defineComponent, nextTick, ref, h } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { ReUcenterUserPassword } from '/@/api/staff/list';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { debounce } from 'lodash-es';
   import { platformallList } from '/@/api/account/index';
+  import { disable } from '/@/api/jyUserPlatform/index'; //roleLIstApi
 
-  const { createMessage } = useMessage();
+  const { createMessage, createConfirm } = useMessage();
 
   export default defineComponent({
     components: { BasicModal, BasicForm },
     props: {
       userData: { type: Object },
     },
-    setup(props) {
+    emits: ['ok'],
+    setup(props, context) {
       const { t } = useI18n();
       const options = ref([]);
       let lastFetchId = 0;
@@ -66,9 +67,9 @@
           show: false,
         },
         {
-          field: 'roleId',
+          field: 'toPlatformId',
           component: 'ApiSelect',
-          label: '角色',
+          label: '平台',
           required: true,
           itemProps: {
             validateTrigger: 'blur',
@@ -78,8 +79,9 @@
           },
           defaultValue: '',
           componentProps: {
+            placeholder: '请选择删除之后的员工平台',
             api: platformallList,
-            labelField: 'roleName',
+            labelField: 'platformName',
             valueField: 'id',
             params: {
               type: 1,
@@ -132,11 +134,22 @@
         });
       }
       async function handSubmit() {
-        const { id, password } = await validate();
-        await ReUcenterUserPassword({ id, newPassword: encodeStr(window.btoa(password)) });
-        createMessage.success(t('common.optSuccess'));
-        resetFields();
-        closeModal();
+        console.log('submit');
+        let param = await validate();
+        console.log('submit', param);
+
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: '是否确认停用迁移用户?',
+          onOk: async () => {
+            await disable(param);
+            context && context.emit('ok');
+            createMessage.success(t('common.optSuccess'));
+            resetFields();
+            closeModal();
+          },
+        });
       }
       function handleVisibleChange(v) {
         v && props.userData && nextTick(() => onDataReceive(props.userData));