mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-16 16:42:50 +00:00
优化 upload 模块
This commit is contained in:
parent
f47b4c36df
commit
9a643d435f
@ -1,79 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="module-view">
|
|
||||||
<a href="https://cool-js.com/" target="blank">
|
|
||||||
<img src="https://admin.cool-js.com/logo.png" width="200" alt="cool-admin Logo" />
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<p class="title">COOL-ADMIN 一个很酷的后台权限管理框架</p>
|
|
||||||
<p class="desc">开源免费可商用、快速开发、模块化、插件化</p>
|
|
||||||
|
|
||||||
<p class="tag">
|
|
||||||
<img
|
|
||||||
src="https://img.shields.io/badge/license-MIT-green?style=flat-square"
|
|
||||||
alt="GitHub license"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
src="https://img.shields.io/github/package-json/v/cool-team-official/cool-admin-vue?style=flat-square"
|
|
||||||
alt="GitHub tag"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
src="https://img.shields.io/github/last-commit/cool-team-official/cool-admin-vue?style=flat-square"
|
|
||||||
alt="GitHub tag"
|
|
||||||
/>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="link">
|
|
||||||
<a href="https://cool-js.com/" target="blank">
|
|
||||||
<el-button type="primary" round>快速开始</el-button>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="https://github.com/cool-team-official/cool-admin-vue" target="blank">
|
|
||||||
<el-button round>GitHub</el-button>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { defineComponent } from "vue";
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "cl-about"
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.module-view {
|
|
||||||
text-align: center;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 100px 20px;
|
|
||||||
overflow: auto;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 36px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: 30px 0 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
|
||||||
color: #6a8bad;
|
|
||||||
font-size: 22px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
img {
|
|
||||||
margin: 0 3px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
margin-top: 30px;
|
|
||||||
|
|
||||||
a {
|
|
||||||
margin: 0 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
import About from "./about.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
About
|
|
||||||
};
|
|
||||||
|
|
||||||
// 导出的组件会以 name 参数命名全局注册,当前为: cl-about
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
// 参考官方例子 https://v3.vuejs.org/guide/custom-directive.html
|
|
||||||
|
|
||||||
export default {
|
|
||||||
// 聚焦元素
|
|
||||||
focus: {
|
|
||||||
mounted(el) {
|
|
||||||
el.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 在模块中使用
|
|
||||||
// <input v-focus />
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
import components from "./components";
|
|
||||||
import directives from "./directives";
|
|
||||||
import pages from "./pages";
|
|
||||||
import service from "./service";
|
|
||||||
import store from "./store";
|
|
||||||
import views from "./views";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
install() {
|
|
||||||
return {
|
|
||||||
components,
|
|
||||||
directives,
|
|
||||||
pages,
|
|
||||||
service,
|
|
||||||
store,
|
|
||||||
views
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<cl-about />
|
|
||||||
</template>
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// 导出的列表会自动注册到路由中
|
|
||||||
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
path: "/test-pages/about", // 路由地址
|
|
||||||
component: () => import("./about.vue") // 组件实例
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import Test from "./test";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
test: new Test()
|
|
||||||
};
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
import { BaseService, Service, Permission } from "/@/core";
|
|
||||||
|
|
||||||
@Service("test")
|
|
||||||
class Test extends BaseService {
|
|
||||||
// 继承后可使用:page、list、add、delete、update、info 6个基本接口
|
|
||||||
|
|
||||||
// 添加其他接口
|
|
||||||
@Permission("batchAdd") // 是否需要权限控制,建议参数与请求地址保持一致
|
|
||||||
batchAdd(params: any): Promise<any> {
|
|
||||||
return this.request({
|
|
||||||
url: "/batchAdd",
|
|
||||||
method: "GET",
|
|
||||||
params
|
|
||||||
// 参数与 axios 一致
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Test;
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
// 参考官方例子 https://vuex.vuejs.org/zh/
|
|
||||||
|
|
||||||
export default {
|
|
||||||
state: {
|
|
||||||
count: 0
|
|
||||||
},
|
|
||||||
mutations: {
|
|
||||||
increment(state: any) {
|
|
||||||
state.count++;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {}
|
|
||||||
};
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
import calc from "./calc";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
calc
|
|
||||||
};
|
|
||||||
|
|
||||||
// 导出后会以 模块名-calc 命名注册
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<cl-about />
|
|
||||||
</template>
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
// 导出的列表会自动注册到 "/" 子路由中
|
|
||||||
|
|
||||||
export default [
|
|
||||||
{
|
|
||||||
path: "/test-views/about", // 路由地址
|
|
||||||
component: () => import("./about.vue"), // 组件实例
|
|
||||||
meta: {
|
|
||||||
keepAlive: true, // 是否缓存路由
|
|
||||||
label: "关于 cool-admin" // 路由名称
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@ -108,9 +108,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import { last, isArray, isNumber, isBoolean, basename } from "/@/core/utils";
|
import { clone, last, isArray, isNumber, isBoolean, basename } from "/@/core/utils";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import { clone } from "/@/core/utils";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "cl-upload",
|
name: "cl-upload",
|
||||||
@ -223,7 +222,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_text() {
|
_text() {
|
||||||
return this.text || this.conf.text || "选择文件";
|
return this.text === undefined ? this.conf.text : this.text;
|
||||||
},
|
},
|
||||||
|
|
||||||
_accept() {
|
_accept() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user