tangning 1 год назад
Родитель
Сommit
d1b74a399f
7 измененных файлов с 9420 добавлено и 22240 удалено
  1. 9232 10034
      pnpm-lock.yaml
  2. 22 0
      src/api/archive/list.ts
  3. 3 1
      src/locales/lang/json/ja.json
  4. 4 1
      src/locales/lang/json/zh-CN.json
  5. 143 0
      src/views/staff/addpowerModal.vue
  6. 16 3
      src/views/staff/list.vue
  7. 0 12201
      yarn.lock

Разница между файлами не показана из-за своего большого размера
+ 9232 - 10034
pnpm-lock.yaml


+ 22 - 0
src/api/archive/list.ts

@@ -3,6 +3,8 @@ import { PageParams, ListModel } from './model';
 
 enum Api {
   pageList = '/service/manage_jp/storage/list',
+  listAll = '/service/manage_jp/platform/listAll',
+  givePlatformAuth = '/service/manage_jp/userPlatform/givePlatformAuth',
 }
 
 /**
@@ -18,3 +20,23 @@ export const ListApi = (params: PageParams) =>
       ignoreCancelToken: true,
     },
   });
+
+export const listAll = (params: PageParams) =>
+  defHttp.get({
+    url: Api.listAll,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
+export const givePlatformAuth = (params: PageParams) =>
+  defHttp.post<ListModel>({
+    url: Api.givePlatformAuth,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });

+ 3 - 1
src/locales/lang/json/ja.json

@@ -642,5 +642,7 @@
     "layout.map.geoLocation": "ポジション",
     "layout.map.geoLocation.opt1": "ポジションを設置",
     "layout.scene.downloadE57tips": "ダウンロードするには少々時間がかかります。[ビューワーを閉じる」をクリックするとダウンロードを継続します。後ほど進度を再確認してください。",
-    "layout.map.searchEmptyProjectTip": "現在のプロジェクトにはシーンはありません"
+    "layout.map.searchEmptyProjectTip": "現在のプロジェクトにはシーンはありません",
+    "routes.staff.setpower": "権限の変更",
+    "routes.staff.setpowerpt": "認証プラットフォーム"
 }

+ 4 - 1
src/locales/lang/json/zh-CN.json

@@ -642,5 +642,8 @@
     "layout.map.geoLocation.opt2": "从场景列表选择",
     "layout.map.searchEmptyProjectTip": "当前项目暂没场景",
     "layout.scene.downloadE57tips": "下载需要一定时间,点击[关闭弹窗]将继续为您下载,建议稍后再来。",
-    "apiCode.errCode5031": "此场景无位置信息,无法在地图显示!"
+    "apiCode.errCode5031": "此场景无位置信息,无法在地图显示!",
+    "": "setpower",
+    "routes.staff.setpower": "修改授权",
+    "routes.staff.setpowerpt": "授权平台"
 }

+ 143 - 0
src/views/staff/addpowerModal.vue

@@ -0,0 +1,143 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="t('routes.staff.setpower')"
+    @ok="handleSubmit"
+  >
+    <div class="pt-20px">
+      <BasicForm @register="registerForm">
+        <template #label="{ model, field }">
+          {{ model[field] }}
+        </template>
+      </BasicForm>
+    </div>
+    <template #centerFooter> </template>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  // import { BasicTable, useTable, BasicColumn, FormSchema } from '/@/components/Table';
+  // import { useMessage } from '/@/hooks/web/useMessage';
+  // import { checkUserAddAble } from '/@/api/corporation/modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { listAll, givePlatformAuth } from '/@/api/archive/list';
+  // import { bindAnchorListParam } from '/@/api/scene/model';
+  // import { Time } from '/@/components/Time';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  // import { useUserStore } from '/@/store/modules/user';
+  const { t } = useI18n();
+  const { createMessage } = useMessage();
+  const schemas: FormSchema[] = [
+    {
+      field: 'userId',
+      component: 'Input',
+      label: 'id',
+      show: false,
+    },
+    {
+      field: 'nickName',
+      label: t('common.fullName'),
+
+      component: 'Input',
+      slot: 'label',
+    },
+    {
+      field: 'userName',
+      label: t('routes.devices.email'),
+      component: 'Input',
+      slot: 'label',
+    },
+    {
+      field: 'companyName',
+      label: t('routes.staff.deptName'),
+      component: 'Input',
+      slot: 'label',
+    },
+    {
+      field: 'platformIds',
+      label: t('routes.staff.setpowerpt'),
+      required: true,
+      component: 'CheckboxGroup',
+      colProps: {
+        // xl: 12,
+        // xxl: 12,
+      },
+      componentProps: {
+        api: listAll,
+      },
+    },
+  ];
+
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['register', 'success'],
+    setup(_, { emit }) {
+      // const { createMessage } = useMessage();
+      const sceneNum = ref('');
+      const options = ref([]);
+      listAll({ page: 1, limit: 1000 }).then((res) => {
+        console.log('listAll', res);
+        options.value = res.map((ele) => {
+          return {
+            label: ele.platformName,
+            value: ele.id,
+          };
+        });
+      });
+      const [registerForm, { setFieldsValue, validate, updateSchema }] = useForm({
+        schemas: schemas,
+        labelWidth: 160,
+        showActionButtonGroup: false,
+
+        actionColOptions: {
+          span: 24,
+        },
+        // submitFunc: handleSubmit,
+      });
+
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+        updateSchema({
+          field: 'platformIds',
+          componentProps: {
+            options: options.value,
+          },
+        });
+      });
+
+      function onDataReceive(data) {
+        console.log('Data Received', data, data.num);
+
+        setFieldsValue({
+          ...data,
+          userId: data.id,
+        });
+
+        sceneNum.value = data.num;
+      }
+      const handleSubmit = async () => {
+        let params = await validate();
+        await givePlatformAuth(params);
+        createMessage.success(t('common.optSuccess'));
+        closeModal();
+        emit('reload');
+        console.log(params);
+      };
+
+      return {
+        t,
+        register,
+        schemas,
+        handleSubmit,
+        closeModal,
+        registerForm,
+      };
+    },
+  });
+</script>

+ 16 - 3
src/views/staff/list.vue

@@ -26,11 +26,16 @@
               label: t('routes.staff.setpaswd'),
               onClick: handleOpenModal.bind(null, record),
             },
+            {
+              label: t('routes.staff.setpower'),
+              onClick: handlepowerModal.bind(null, record),
+            },
           ]"
         />
       </template>
     </BasicTable>
     <SetpaswordModal @register="register" />
+    <addpowerModal @register="registerpower" @reload="reload" />
   </div>
 </template>
 <script lang="ts">
@@ -42,6 +47,7 @@
   // import { Switch } from 'ant-design-vue';
   // import { h } from 'vue';
   import SetpaswordModal from './setpaswordModal.vue';
+  import addpowerModal from './addpowerModal.vue';
   import { ListApi } from '/@/api/staff/list';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
@@ -53,9 +59,10 @@
   const isJA = computed(() => localeStore.getLocale === 'ja');
 
   export default defineComponent({
-    components: { BasicTable, TableAction, SetpaswordModal },
+    components: { BasicTable, TableAction, SetpaswordModal, addpowerModal },
     setup() {
       const [register, { openModal }] = useModal();
+      const [registerpower, { openModal: openpowerModal }] = useModal();
       const { createMessage } = useMessage();
       const go = useGo();
       const { t } = useI18n();
@@ -116,7 +123,7 @@
           slots: { customRender: 'action' },
           fixed: 'right',
           align: 'center',
-          width: isJA.value ? 160 : 80,
+          width: isJA.value ? 200 : 160,
         },
       ];
 
@@ -135,7 +142,7 @@
         ],
       };
 
-      const [registerTable] = useTable({
+      const [registerTable, { reload }] = useTable({
         title: t('routes.staff.staffList'),
         api: ListApi,
         columns: columns,
@@ -173,16 +180,22 @@
       function handleOpenModal(record: Recordable) {
         openModal(true, record);
       }
+      function handlepowerModal(record: Recordable) {
+        openpowerModal(true, record);
+      }
       return {
         registerTable,
         createMessage,
         t,
         go,
+        reload,
         renderRoleType,
         renderStatus,
         uploadApi: uploadApi as any,
         handleOpenModal,
         register,
+        registerpower,
+        handlepowerModal,
       };
     },
   });

Разница между файлами не показана из-за своего большого размера
+ 0 - 12201
yarn.lock