Browse Source

feat(router): 增加基本router for zfb

gemercheung 3 years ago
parent
commit
45518f9f78

+ 85 - 0
mock/house/selectHouseByType.ts

@@ -0,0 +1,85 @@
+import { MockMethod } from 'vite-plugin-mock';
+import { mock, Random } from 'mockjs';
+import { resultPageSuccess } from '../_util';
+Random.extend({
+  phone: function () {
+    const phonePrefixs = ['132', '135', '189']; // 自己写前缀哈
+    return this.pick(phonePrefixs) + mock(/\d{8}/); //Number()
+  },
+});
+// console.log(Random.phone());
+// 生成 1 - 10 个 随机手机号码
+const demoList = (() => {
+  const result: any[] = [];
+  for (let index = 0; index < 1200; index++) {
+    const { phone } = mock({
+      phone: '@phone',
+    });
+    result.push({
+      id: `${index}`,
+
+      // bgMusic: '@url()',
+      // cameraNum: '@integer(1,20)',
+      // childName: '@ctitle(10,20)',
+      // expirationDate: '@datetime',
+      // expirationTime: '@datetime',
+      // floorLogo: '@image()',
+      // name: '@ctitle(10,15)',
+      // num: '@integer(1,20)',
+      // point: '@integer(1,100)',
+      // sceneLogo: '@image()',
+      // sceneNum: '@integer(1,10)',
+      // subNum: '@integer(1,20)',
+      // userName: phone,
+
+      buildingId: '@integer(1,20)',
+      buildingNum: null,
+      companyName: null,
+      coveredArea: null,
+      createTime: '@datetime',
+      decorate: null,
+      elevator: null,
+      endTime: null,
+      floor: null,
+      head: null,
+      homepic: null,
+      houseNum: null,
+      latitude: null,
+      longitude: null,
+      name: null,
+      nickName: null,
+      orientation: null,
+      parlourNum: null,
+      phone: null,
+      power: null,
+      price: null,
+      purpose: null,
+      roomNum: null,
+      sellTime: null,
+      startTime: null,
+      state: 0,
+      title: '@ctitle(10,15)',
+      toiletNum: null,
+      total: null,
+      type: null,
+      unitNum: null,
+      userName: phone,
+      userType: null,
+      utilizationArea: null,
+      website: null,
+    });
+  }
+  return result;
+})();
+
+export default [
+  {
+    url: '/basic-api/zfb/house/selectHouseByType',
+    timeout: 1000,
+    method: 'get',
+    response: ({ query }) => {
+      const { page = 1, pageSize = 20 } = query;
+      return resultPageSuccess(page, pageSize, demoList);
+    },
+  },
+] as MockMethod[];

+ 0 - 0
src/api/bulletin/rent.ts


+ 10 - 0
src/locales/lang/en/routes/dashboard.ts

@@ -6,4 +6,14 @@ export default {
   corporation: 'corporation',
   corporationAccount: 'corporation account',
   corporationVerify: 'corporation verify',
+  bulletin: 'bulletin',
+  bulletinRentInfo: 'rent info',
+  bulletinSellInfo: 'sell info',
+  bulletinDecoration: 'construct decoration',
+  advertisement: 'advertisement',
+  advertisementList: 'advertisement list',
+  advertisementPads: 'advertisement recommendation',
+  scenesDownload: 'scenes download',
+  scenesManger: 'scenes manger',
+  devices: 'devices Manger',
 };

+ 10 - 0
src/locales/lang/zh-CN/routes/dashboard.ts

@@ -6,4 +6,14 @@ export default {
   corporation: '企业管理',
   corporationAccount: '企业账号',
   corporationVerify: '企业认证',
+  bulletin: '信息发布',
+  bulletinRentInfo: '出租信息',
+  bulletinSellInfo: '出售信息',
+  bulletinDecoration: '工地装修',
+  advertisement: '广告位',
+  advertisementList: '轮播图',
+  advertisementPads: '推荐位',
+  scenesDownload: '场景下载',
+  scenesManger: '场景管理',
+  devices: '设备管理',
 };

+ 39 - 0
src/router/routes/modules/advertisement.ts

@@ -0,0 +1,39 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const advertisement: AppRouteModule = {
+  path: '/advertisement',
+  name: 'advertisement',
+  component: LAYOUT,
+  redirect: '/advertising/list',
+  meta: {
+    // hideChildrenInMenu: true,
+    icon: 'ri:advertisement-fill',
+    title: t('routes.dashboard.advertisement'),
+    orderNo: 101,
+  },
+  children: [
+    {
+      path: 'list',
+      name: 'advertisementList',
+      component: () => import('/@/views/dashboard/advertisement/list.vue'),
+      meta: {
+        title: t('routes.dashboard.advertisementList'),
+        icon: 'mdi:view-gallery',
+      },
+    },
+    {
+      path: 'pads',
+      name: 'advertisementPads',
+      component: () => import('/@/views/dashboard/advertisement/pads.vue'),
+      meta: {
+        title: t('routes.dashboard.advertisementPads'),
+        icon: 'ic:baseline-recommend',
+      },
+    },
+  ],
+};
+
+export default advertisement;

+ 48 - 0
src/router/routes/modules/bulletin.ts

@@ -0,0 +1,48 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const bulletin: AppRouteModule = {
+  path: '/bulletin',
+  name: 'Bulletin',
+  component: LAYOUT,
+  redirect: '/bulletin/rent',
+  meta: {
+    // hideChildrenInMenu: true,
+    icon: 'mdi:bulletin-board',
+    title: t('routes.dashboard.bulletin'),
+    orderNo: 100,
+  },
+  children: [
+    {
+      path: 'rent',
+      name: 'bulletinRentInfo',
+      component: () => import('/@/views/dashboard/bulletin/rent.vue'),
+      meta: {
+        title: t('routes.dashboard.bulletinRentInfo'),
+        icon: 'map:movie-rental',
+      },
+    },
+    {
+      path: 'sell',
+      name: 'bulletinSellInfo',
+      component: () => import('/@/views/dashboard/bulletin/sell.vue'),
+      meta: {
+        title: t('routes.dashboard.bulletinSellInfo'),
+        icon: 'ic:baseline-sell',
+      },
+    },
+    {
+      path: 'decoration',
+      name: 'bulletinDecoration',
+      component: () => import('/@/views/dashboard/bulletin/decoration.vue'),
+      meta: {
+        title: t('routes.dashboard.bulletinDecoration'),
+        icon: 'carbon:construction',
+      },
+    },
+  ],
+};
+
+export default bulletin;

+ 31 - 0
src/router/routes/modules/devices.ts

@@ -0,0 +1,31 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const devices: AppRouteModule = {
+  path: '/devices',
+  name: 'Devices',
+  component: LAYOUT,
+  redirect: '/devices/index',
+  meta: {
+    hideChildrenInMenu: true,
+    icon: 'tabler:device-computer-camera',
+    title: t('routes.dashboard.devices'),
+    orderNo: 102,
+  },
+  children: [
+    {
+      path: 'index',
+      name: 'DevicesList',
+      component: () => import('/@/views/dashboard/devices/list.vue'),
+      meta: {
+        title: t('routes.dashboard.devices'),
+        icon: 'tabler:device-computer-camera',
+        hideMenu: true,
+      },
+    },
+  ],
+};
+
+export default devices;

+ 31 - 0
src/router/routes/modules/scenesDownload.ts

@@ -0,0 +1,31 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const scenesDownload: AppRouteModule = {
+  path: '/scenes',
+  name: 'ScenesDownload',
+  component: LAYOUT,
+  redirect: '/scenes/list',
+  meta: {
+    hideChildrenInMenu: true,
+    icon: 'mdi:drama-masks',
+    title: t('routes.dashboard.scenesDownload'),
+    orderNo: 101,
+  },
+  children: [
+    {
+      path: 'list',
+      name: 'ScenesDownloadList',
+      component: () => import('/@/views/dashboard/scenesDownload/list.vue'),
+      meta: {
+        title: t('routes.dashboard.scenesDownload'),
+        icon: 'mdi:drama-masks',
+        hideMenu: true,
+      },
+    },
+  ],
+};
+
+export default scenesDownload;

+ 31 - 0
src/router/routes/modules/scenesManger.ts

@@ -0,0 +1,31 @@
+import type { AppRouteModule } from '/@/router/types';
+
+import { LAYOUT } from '/@/router/constant';
+import { t } from '/@/hooks/web/useI18n';
+
+const scenesManger: AppRouteModule = {
+  path: '/scenesManger',
+  name: 'ScenesManger',
+  component: LAYOUT,
+  redirect: '/scenesManger/index',
+  meta: {
+    hideChildrenInMenu: true,
+    icon: 'eos-icons:admin-outlined',
+    title: t('routes.dashboard.scenesManger'),
+    orderNo: 103,
+  },
+  children: [
+    {
+      path: 'index',
+      name: 'ScenesMangerList',
+      component: () => import('/@/views/dashboard/scenesManger/list.vue'),
+      meta: {
+        title: t('routes.dashboard.scenesManger'),
+        icon: 'eos-icons:admin-outlined',
+        hideMenu: true,
+      },
+    },
+  ],
+};
+
+export default scenesManger;

+ 5 - 0
src/views/dashboard/advertisement/list.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 轮播图 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/advertisement/pads.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 推荐位 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/bulletin/decoration.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 工地装修 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/bulletin/rent.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 出租信息 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/bulletin/sell.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 出售信息 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 0 - 1
src/views/dashboard/corporation/index.vue

@@ -124,7 +124,6 @@
         showIndexColumn: false,
         rowKey: 'id',
       });
-      // pagination.value = { pageSize: 20 };
 
       return {
         registerTable,

+ 5 - 0
src/views/dashboard/devices/list.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 设备管理 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/scenesDownload/list.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 场景下载 </div>
+</template>
+
+<script lang="ts" setup></script>

+ 5 - 0
src/views/dashboard/scenesManger/list.vue

@@ -0,0 +1,5 @@
+<template>
+  <div> 场景管理 </div>
+</template>
+
+<script lang="ts" setup></script>