Kaynağa Gözat

我的文件界面搭建

liyangzheng 2 yıl önce
ebeveyn
işleme
37fcb9f8f5
7 değiştirilmiş dosya ile 98 ekleme ve 9 silme
  1. 1 1
      .env.development
  2. 1 1
      index.html
  3. 12 0
      src/api/myfile/myfile.js
  4. 4 3
      src/main.js
  5. 17 3
      src/router/index.js
  6. 62 0
      src/views/myfile/MyFile.vue
  7. 1 1
      vite.config.js

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 文档管理系统
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 1 - 1
index.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
   <meta name="renderer" content="webkit">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
   <link rel="icon" href="/favicon.ico">

+ 12 - 0
src/api/myfile/myfile.js

@@ -0,0 +1,12 @@
+import request from "../../../src/utils/request"
+// 查询文档目录管理列表
+function get(data) {
+    return request({
+        url: "/biz/dir/list",
+        method: "get",
+        params: data
+    })
+}
+export default {
+    get,
+}

+ 4 - 3
src/main.js

@@ -20,7 +20,7 @@ import { download } from '@/utils/request'
 import 'virtual:svg-icons-register'
 import SvgIcon from '@/components/SvgIcon'
 import elementIcons from '@/components/SvgIcon/svgicon'
-
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
 import './permission' // permission control
 
 import { useDict } from '@/utils/dict'
@@ -44,7 +44,9 @@ import TreeSelect from '@/components/TreeSelect'
 import DictTag from '@/components/DictTag'
 
 const app = createApp(App)
-
+// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+//   app.component(key, component)
+// }
 // 全局方法挂载
 app.config.globalProperties.useDict = useDict
 app.config.globalProperties.download = download
@@ -79,5 +81,4 @@ app.use(ElementPlus, {
   // 支持 large、default、small
   size: Cookies.get('size') || 'default'
 })
-
 app.mount('#app')

+ 17 - 3
src/router/index.js

@@ -67,10 +67,24 @@ export const constantRoutes = [
         component: () => import('@/views/index'),
         name: 'Index',
         meta: { title: '首页', icon: 'dashboard', affix: true }
-      }
+      },
     ]
   },
   {
+    path: '',
+    component: Layout,
+    redirect: '/index',
+    children: [
+      {
+        path: "/myfile",
+        component: () => import("@/views/myfile/MyFile"),
+        name: "myfile",
+        meta: { title: "我的文件", icon: "myfile" }
+      },
+    ]
+  },
+
+  {
     path: '/user',
     component: Layout,
     hidden: true,
@@ -81,9 +95,9 @@ export const constantRoutes = [
         component: () => import('@/views/system/user/profile/index'),
         name: 'Profile',
         meta: { title: '个人中心', icon: 'user' }
-      }
+      },
     ]
-  }
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 62 - 0
src/views/myfile/MyFile.vue

@@ -0,0 +1,62 @@
+<template>
+    <div>
+        <div class="bigBox">
+            <div class="settingBox">
+                <!-- 设置盒子顶部搜索 -->
+                <div class="topSearch">
+                    <el-input v-model="searchFire" class="searchFire" size="large" placeholder="搜索文件">
+                    </el-input>
+                    <el-icon style="font-size: 24px;">
+                        <Plus />
+                    </el-icon>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import { ref } from 'vue'
+import myfile from '../../api/myfile/myfile'
+import { Search } from '@element-plus/icons-vue'
+export default {
+    setup() {
+        let tableList = ref([])
+        let searchFire = ref('')
+        const getAll = () => {
+            myfile.get().then(res => {
+                console.log(res, 'eee');
+            })
+        }
+        return {
+            tableList,//定义的数据
+            getAll,//拿到数据的方法
+            searchFire,//搜索文件的model
+        }
+    },
+    created() {
+        this.getAll();
+    },
+}
+</script>
+
+<style scoped>
+.settingBox {
+    width: 312px;
+    height: 836px;
+    border: 1px solid black;
+    border-radius: 4px;
+    margin: 10px 10px;
+}
+.topSearch{
+    width: 100%;
+    height: 48px;
+    background-color: #EBEFF6;
+    text-align: center;
+    line-height: 48px;
+}
+.searchFire {
+    width: 248px;
+    height: 32px;
+}
+</style>

+ 1 - 1
vite.config.js

@@ -31,7 +31,7 @@ export default defineConfig(({ mode, command }) => {
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          target: 'http://localhost:8080',
+          target: 'http://192.168.1.28:8080/',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }