liyongli 1 éve
szülő
commit
a9eac7f30f
7 módosított fájl, 294 hozzáadás és 5 törlés
  1. 1 1
      index.html
  2. 3 0
      src/main.js
  3. 27 0
      src/router/index.js
  4. 197 0
      src/view/home/index.vue
  5. 24 4
      src/view/login/index.vue
  6. 26 0
      src/view/system/index.vue
  7. 16 0
      src/view/user/index.vue

+ 1 - 1
index.html

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="en">
+<html lang="cmn-hans">
   <head>
     <meta charset="UTF-8" />
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />

+ 3 - 0
src/main.js

@@ -1,7 +1,10 @@
 import { createApp } from 'vue'
 import router from "./router/index";
+import ViewUIPlus from 'view-ui-plus';
+import 'view-ui-plus/dist/styles/viewuiplus.css'
 import './style.css'
 import App from './App.vue'
 const mainprogram = createApp(App);
 mainprogram.use(router)
+mainprogram.use(ViewUIPlus)
 mainprogram.mount('#app')

+ 27 - 0
src/router/index.js

@@ -2,6 +2,7 @@ import * as vueRouter from 'vue-router';
 
 // 导入页面
 import login from '../view/login/index.vue';
+import home from '../view/home/index.vue';
 
 export default vueRouter.createRouter({
   history: vueRouter.createWebHashHistory(),
@@ -10,5 +11,31 @@ export default vueRouter.createRouter({
       path: '/',
       component: login,
     },
+    {
+      path: '/home',
+      component: home,
+      meta: {
+        title: '首页',
+      },
+      children: [
+        {
+          path: 'personnelMatters',
+          meta: {
+            title: '人员管理',
+          },
+          children: [
+            {
+              path: '',
+              component: () =>
+                import('../view/system/index.vue'),
+            },
+            {
+              path: 'user',
+              component: () => import('../view/user/index.vue'),
+            }
+          ],
+        },
+      ],
+    },
   ],
 });

+ 197 - 0
src/view/home/index.vue

@@ -0,0 +1,197 @@
+<!-- vue 页面模板 -->
+<template>
+  <div class="layout">
+    <Layout>
+      <Header>
+        <Menu mode="horizontal" theme="dark" active-name="1">
+          <div class="layout-logo"></div>
+          <div class="layout-nav">
+            <MenuItem name="1">
+              <Icon type="ios-navigate"></Icon>
+              Item 1
+            </MenuItem>
+            <MenuItem name="2">
+              <Icon type="ios-keypad"></Icon>
+              Item 2
+            </MenuItem>
+            <MenuItem name="3">
+              <Icon type="ios-analytics"></Icon>
+              Item 3
+            </MenuItem>
+          </div>
+        </Menu>
+      </Header>
+      <Layout>
+        <Sider hide-trigger :style="{ background: '#fff' }">
+          <Menu
+            :active-name="active_name"
+            theme="primary"
+            width="auto"
+            :open-names="['home']"
+            @on-select="changePage"
+            accordion
+          >
+            <div v-for="(item, i) in menu_list" :key="i">
+              <Submenu v-if="item.children" :name="item.name">
+                <template #title>
+                  <Icon :type="item.icon" />
+                  {{ item.title }}
+                </template>
+                <MenuItem
+                  v-for="v in item.children"
+                  :key="v.name"
+                  :name="v.name"
+                >
+                  {{ v.title }}
+                </MenuItem>
+              </Submenu>
+              <MenuItem v-else :name="item.name">
+                <Icon v-if="item.icon" :type="item.icon" />
+                {{ item.title }}
+              </MenuItem>
+            </div>
+          </Menu>
+        </Sider>
+        <Layout :style="{ padding: '24px' }">
+          <Content
+            :style="{
+              padding: '24px',
+              height: content_height + 'px',
+              background: '#fff',
+            }"
+          >
+            <router-view></router-view>
+          </Content>
+        </Layout>
+      </Layout>
+    </Layout>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      content_height: 0,
+      active_name: '',
+      menu_list: [
+        {
+          name: 'home',
+          title: '人员管理',
+          icon: 'ios-person',
+          children: [
+            {
+              name: '/home/personnelMatters',
+              title: '管理员',
+            },
+            {
+              name: '/home/personnelMatters/user',
+              title: '用户',
+            },
+          ],
+        },
+        {
+          name: 'limitsAuthority',
+          title: '权限配置',
+          icon: 'ios-key',
+          children: [
+            {
+              name: '/home/limitsAuthority/role',
+              title: '角色管理',
+            },
+            {
+              name: '/home/limitsAuthority/permission',
+              title: '权限管理',
+            },
+          ],
+        },
+        {
+          name: 'belong',
+          title: '归属配置',
+          icon: 'ios-locate',
+          children: [
+            {
+              name: '/home/belong/organization',
+              title: '机构管理',
+            },
+            {
+              name: '/home/belong/area',
+              title: '地域管理',
+            },
+          ],
+        },
+        {
+          name: 'governmentAffairs',
+          title: '政务库管理',
+          icon: 'ios-cloud-download',
+          children: [
+            {
+              name: '/home/governmentAffairs/administration',
+              title: '行政领导配置',
+            },
+          ],
+        },
+        {
+          name: '/home/administration',
+          icon: 'ios-document',
+          title: '稿件管理',
+        },
+        {
+          name: '/home/medium',
+          icon: 'ios-film',
+          title: '媒体管理',
+        },
+        {
+          name: '/home/broadcast',
+          icon: 'ios-desktop',
+          title: '电视广播管理',
+        },
+        {
+          name: '/home/lifeService',
+          icon: 'ios-hammer',
+          title: '生活服务管理',
+        },
+      ],
+    };
+  },
+  mounted() {
+    // 计算内容区域高度
+    this.content_height = document.documentElement.clientHeight - 120;
+    this.active_name = this.$route.path;
+  },
+  methods: {
+    changePage(p) {
+      this.$router.replace(p);
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.layout {
+  border: 1px solid #d7dde4;
+  background: #f5f7f9;
+  position: relative;
+  border-radius: 4px;
+  overflow: hidden;
+  width: 100%;
+  height: 100%;
+
+  .layout-logo {
+    width: 100px;
+    height: 30px;
+    background: #5b6270;
+    border-radius: 3px;
+    float: left;
+    position: relative;
+    top: 15px;
+    left: 20px;
+  }
+
+  .layout-nav {
+    width: 420px;
+    margin: 0 auto;
+    margin-right: 20px;
+  }
+}
+</style>

+ 24 - 4
src/view/login/index.vue

@@ -1,9 +1,30 @@
 <template>
   <div class="login"></div>
-  <div class="body">123</div>
+  <div class="body">
+    <Login @on-submit="handleSubmit">
+      <UserName name="username" />
+      <Password name="password" />
+      <Submit />
+    </Login>
+  </div>
 </template>
 
-<script setup></script>
+<script>
+export default {
+  data() {
+    return {
+      autoLogin: true,
+    };
+  },
+  methods: {
+    handleSubmit(valid, { username, password }) {
+      if (!valid) return;
+      this.$Message.success('登录成功'+'username: ' + username + ' | password: ' + password);
+      this.$router.push('/home/personnelMatters')
+    },
+  },
+};
+</script>
 
 <style scoped lang="scss">
 .login {
@@ -19,12 +40,11 @@
   position: fixed;
   z-index: 1;
   width: 30em;
-  height: 20em;
   background-color: #ffffff99;
   top: 50%;
   left: 50%;
   border-radius: 15px;
   padding: 15px;
-  transform: translate(-50%,-50%);
+  transform: translate(-50%, -50%);
 }
 </style>

+ 26 - 0
src/view/system/index.vue

@@ -0,0 +1,26 @@
+<!-- vue 页面模板 -->
+<template>
+    <div class="system">
+        system
+    </div>
+  </template>
+  
+  <script>
+  export default {
+    data() {
+      return {
+      };
+    },
+    mounted() {
+    },
+    methods: {
+    },
+  };
+  </script>
+  
+  <style lang="scss">
+  .system {
+    width: 100%;
+  }
+  </style>
+  

+ 16 - 0
src/view/user/index.vue

@@ -0,0 +1,16 @@
+<!-- vue 页面模板 -->
+<template>
+  <div class="user">user</div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  mounted() {},
+  methods: {},
+};
+</script>
+
+<style lang="scss"></style>