master
liuchen 1 month ago
commit 8f83981e08

23
.gitignore vendored

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -0,0 +1,24 @@
# coeditor_frontend
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

11190
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,51 @@
{
"name": "coeditor_frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"core-js": "^3.8.3",
"jquery": "^3.7.1",
"jwt-decode": "^4.0.0",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -0,0 +1,22 @@
<template>
<NavBar />
<router-view/>
</template>
<script>
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/js/bootstrap';
import NavBar from '@/components/NavBar.vue';
export default({
name:"App",
components:{
NavBar,
}
})
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -0,0 +1,21 @@
<template>
<div class="home">
<div class="container">
<div class="card">
<div class="card-body">
<slot></slot>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ContentBase',
}
</script>
<style scoped>
</style>

@ -0,0 +1,72 @@
<template>
<ContentBase>
<div class="file-item" v-for="item in items" :key="item.name">
<div class="file-item">
<div @dblclick="handledouleclick(item.name,item.type)" class="file-item-icon">
<img v-if="item.type==='folder'" src="@/assets/folder_icon.png" alt="">
<img v-else src="@/assets/file_icon.png" alt="">
</div>
<div class="file-item-title">
{{ item.name }}
</div>
</div>
</div>
</ContentBase>
</template>
<script>
import ContentBase from './ContentBase';
export default {
name: 'ContentShow',
components:{
ContentBase,
},
props:{
items:{
type:Object,
required:true,
}
},
setup(props,context){
const handledouleclick = (name,type) => {
context.emit("handledoubleclick",name,type);
}
return {
handledouleclick,
}
},
}
</script>
<style scoped>
.file-item{
width: 8vw;
display: inline-block;
}
.file-item {
width: 8vw;
height: 8vw;
overflow: hidden;
display: inline-block;
margin: 0 0.1vw 1vw 0.1vw;
border: 0.1vh solid white;
}
.file-item-icon > img {
width: 6vw;
height: 6vw;
}
.file-item-title{
width: 6vw;
height: 4vw;
text-align: center;
overflow: hidden;
font-size: 1.2vw;
word-break: break-all;
}
</style>

@ -0,0 +1,21 @@
<template>
<nav class="nav">
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z"/>
</svg>
</a>
<a class="nav-link" href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>
</svg>
</a>
</nav>
</template>
<script>
export default ({
name:"NavBar",
})
</script>

@ -0,0 +1,6 @@
import { createApp } from 'vue'
import App from './App.vue'
import store from './store'
import router from './router'
createApp(App).use(router).use(store).mount('#app')

@ -0,0 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes = [
{
path: '/',
name: 'home',
component: HomeView
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router

@ -0,0 +1,16 @@
import { createStore } from 'vuex'
import ModulerUser from './user';
export default createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
user: ModulerUser,
}
})

@ -0,0 +1,23 @@
// import $ from 'jquery';
// import { jwtDecode } from 'jwt-decode';
const ModulerUser = {
state: {
id:'',
username:'',
photo:'',
access: "",
refresh: "",
is_login: false,
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
}
export default ModulerUser;

@ -0,0 +1,54 @@
<template>
<ContentShow @handledoubleclick="handledoubleclick" :items="items">
</ContentShow>
</template>
<script>
import $ from 'jquery';
import ContentShow from '@/components/ContentShow';
import { ref } from 'vue';
export default {
name: 'HomeView',
components:{
ContentShow,
},
setup(){
let items = ref([]);
let path = ['~/'];
const ls = () => {
$.ajax({
url:'https://app7179.acapp.acwing.com.cn/filesystem/ls/',
type:'get',
data:{
'path':path.join(""),
},
success:resp => {
items.value = resp.items;
}
});
}
ls();
const handledoubleclick = (name,type) => {
if (type === "folder"){
path.push(name + "/");
ls();
}
else {
console.log(name);
}
}
return {
items,
ls,
handledoubleclick,
}
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,4 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
Loading…
Cancel
Save