Commit d98fe972 by 胡悦

first

0 parents
NODE_ENV='development'
\ No newline at end of file
NODE_ENV='production'
\ No newline at end of file
.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?
# antd-demo
## 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/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
// plugins: [
// [
// "import",
// { libraryName: "ant-design-vue", libraryDirectory: "es", style: true }
// ]
// ]
};
This diff could not be displayed because it is too large.
{
"name": "antd-demo",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"ant-design-vue": "^1.7.8",
"axios": "^0.21.3",
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.5.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
No preview for this file type
<!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>
<template>
<div id="app">
<div class="wrapper-header">
<img class="logo" src="./assets/logo.png" alt="">
<a-menu v-model="current" mode="horizontal">
<a-menu-item key="home" @click="handleTab('Home')"><a-icon type="home" />团队主页</a-menu-item>
<a-menu-item key="documentation" @click="handleTab('Documentation')"><a-icon type="file-text" />开发者须知</a-menu-item>
<a-menu-item key="record" @click="handleTab('Record')"><a-icon type="message" />问题记录</a-menu-item>
</a-menu>
</div>
<div class="wrapper-content">
<router-view />
</div>
</div>
</template>
<script>
let currentName = ''
export default {
name: 'App',
data() {
return {
current: ['home'],
}
},
mounted() {
currentName = window.location.pathname.substr(1)
console.log(currentName)
if (!currentName) this.current = ['home']
else this.current = [currentName]
},
methods: {
handleTab(name) {
this.to(name)
}
},
}
</script>
<style>
.wrapper-header {
display: flex;
background-color: #2b303b;
}
.wrapper-header .logo {
display: inline-flex;
width: 50px;
height: 50px;
}
.wrapper-header .ant-menu {
display: inline-flex;
background-color: #2b303b;
color: #fff;
}
.wrapper-header .ant-menu-horizontal > .ant-menu-item:hover,
.wrapper-header .ant-menu-horizontal > .ant-menu-item-active,
.wrapper-header .ant-menu-horizontal > .ant-menu-item-selected {
border-bottom: none;
}
.wrapper-header .ant-menu-horizontal {
border-bottom: none;
}
.wrapper-header .ant-menu-horizontal > .ant-menu-item > a {
color: #fff;
}
.wrapper-content {
margin: 30px auto;
padding: 0 10px;
max-width: 1200px;
}
</style>
/*
* @Author: huyue
* @Date: 2021-09-09 16:18:46
* @Last Modified by: huyue
* @Last Modified time: 2021-09-09 16:24:33
*/
import request from '@/plugins/axios'
const documentation = {
getList() {
return request({
url: '/documentation/getList',
method: 'get',
params: {}
})
},
create(data) {
console.log(data)
return request({
url: '/documentation/create',
method: 'post',
data
})
}
}
export default documentation
import project from './project';
import documentation from './documentation';
export default {
project,
documentation
}
/*
* @Author: huyue
* @Date: 2021-09-06 15:27:21
* @Last Modified by: huyue
* @Last Modified time: 2021-09-07 10:57:27
*/
import request from '@/plugins/axios'
const project = {
getList() {
return request({
url: '/project/getList',
method: 'get',
params: {}
})
}
}
export default project
.icon-anticons {
position: fixed;
bottom: 20px;
right: 40px;
text-align: right;
cursor: pointer;
transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out;
background-color: #fff;
overflow: hidden;
border-radius: 50%;
box-shadow: 0 10px 30px rgb(45 140 240 / 40%);
}
.icon-anticons .anticon {
font-size: 36px;
color: #2d8cf0;
transition: transform 0.3s ease-in-out;
will-change: transform;
}
.icon-anticons .anticon:hover {
background: rgba(45, 140, 240, 0.2);
}
\ No newline at end of file
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import 'ant-design-vue/dist/antd.css';
import '@/assets/css/common.css'
// 全局引入按需引入UI库 vant
import { components } from '@/plugins/ant'
import { message } from "ant-design-vue";
import api from './api'
Vue.config.productionTip = false;
components.forEach(component => Vue.use(component))
Vue.prototype.api = api
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params})
}
Vue.prototype.$message = message
new Vue({
render: h => h(App),
router,
}).$mount('#app')
import {
Menu,
Icon,
List,
Card,
Descriptions,
Avatar,
FormModel,
Input,
Checkbox,
Button,
Select
} from 'ant-design-vue'
export const components = [
Menu,
Icon,
List,
Card,
Descriptions,
Avatar,
FormModel,
Input,
Checkbox,
Button,
Select
]
\ No newline at end of file
/*
* @Author: huyue
* @Date: 2021-09-06 15:19:47
* @Last Modified by: huyue
* @Last Modified time: 2021-09-10 15:16:03
*/
import axios from 'axios'
import { message } from "ant-design-vue";
let url = process.env.NODE_ENV == "development" ? "/api" : "http://192.168.2.9:7001"
const service = axios.create({
withCredentials: true,
baseURL: url
})
// 添加请求拦截器
service.interceptors.request.use(function (config) {
// 在发送请求之前做些什么
return config;
}, function (error) {
// 对请求错误做些什么
return Promise.reject(error);
});
// 添加响应拦截器
service.interceptors.response.use(response => {
// 对响应数据做点什么
const { data: {status, msg} } = response
console.log(response)
if (status != 0) {
message.error(msg)
return Promise.reject({status, msg})
} else {
return Promise.resolve(response.data.data)
}
}, error => {
// 对响应错误做点什么
message.error(JSON.stringify(error))
return Promise.reject(error);
});
export default service
/*
* @Author: huyue
* @Date: 2021-08-31 11:40:17
* @Last Modified by: huyue
* @Last Modified time: 2021-09-08 11:10:35
*/
import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
export default new Router({
mode: 'history',
routes
})
\ No newline at end of file
/*
* @Author: huyue
* @Date: 2021-08-31 11:40:04
* @Last Modified by: huyue
* @Last Modified time: 2021-09-10 15:26:10
*/
const routes = Object.freeze([
{
name: 'Home',
path: '/',
redirect: '/home',
component: resolve => require(['../views/home/index.vue'], resolve)
},
{
name: 'Home',
path: '/home',
component: resolve => require(['../views/home/index.vue'], resolve)
},
{
name: 'Documentation',
path: '/documentation',
component: resolve => require(['../views/documentation/index.vue'], resolve)
},
{
name: 'DocAdd',
path: '/documentation/add',
component: resolve => require(['../views/documentation/add/index.vue'], resolve)
},
{
name: 'Record',
path: '/record',
component: resolve => require(['../views/record/index.vue'], resolve)
}
])
export default routes
\ No newline at end of file
<template>
<div>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item label="文档标题" prop="docTitle">
<a-input
v-model="form.docTitle"
/>
</a-form-model-item>
<a-form-model-item label="文档地址" prop="docUrl">
<a-input
v-model="form.docUrl"
/>
</a-form-model-item>
<a-form-model-item label="文档描述" prop="docDescription">
<a-input v-model="form.docDescription" type="textarea" />
</a-form-model-item>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="onSubmit">
创建
</a-button>
<a-button style="margin-left: 10px;" @click="resetForm">
重置
</a-button>
<a-button style="margin-left: 10px;" @click="closeForm">
关闭
</a-button>
</a-form-model-item>
</a-form-model>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: '',
data () {
return {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
form: {
docTitle: '',
docUrl: '',
docDescription: '',
},
rules: {
docTitle: [
{ required: true, message: '请输入文档名称', trigger: 'blur' },
{ min: 1, max: 30, message: '请输入字符1~50之间', trigger: 'blur' },
],
docUrl: [{ required: true, message: '请输入文档地址', trigger: 'blur' }],
docDescription: [{ required: true, message: '请输入文档描述', trigger: 'blur' }],
},
}
},
mounted () {
},
methods: {
onSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
console.log(this.form)
this.api.documentation.create(this.form).then(res => {
console.log(res)
this.$message.success('添加成功')
this.closeForm()
})
} else {
return false;
}
});
},
resetForm() {
this.$refs.ruleForm.resetFields();
},
closeForm() {
this.to(-1)
}
}
}
</script>
<style scoped lang="scss"></style>
<template>
<div>
<h2>前端开发文档</h2>
<a-list :grid="{ gutter: 16, column: 4 }" :data-source="docData">
<a-list-item slot="renderItem" slot-scope="item">
<a :href="item.doc_url" target="_blank" rel="noopener noreferrer">
<a-card :title="item.doc_title">
<p>{{ item.doc_description }}</p>
<!-- <p v-for="(i, idx) in item.content" :key="i">{{idx + 1}}. {{i}}</p> -->
</a-card>
</a>
</a-list-item>
</a-list>
<div class="icon-anticons" @click="add">
<a-icon type="plus-circle" theme="filled" />
</div>
</div>
</template>
<script>
const data = [
{
title: "广联赛讯Vue模板及组件",
content: "vue模板介绍与使用",
url: "http://192.168.3.171:8080/#/installNode"
},
{
title: "glsx-vue-common使用文档",
content: "介绍使用方法;内置方法介绍",
url: "http://192.168.3.171:8089/"
},
{
title: "easy mock 地址",
content: "通用配置",
url: "https://oss-config.test.glsx.com.cn"
},
{
title: "公司git仓库",
content: "公司git仓库地址(使用svn账号)",
url: "http://192.168.3.233:8090"
},
{
title: "上线发版OPS",
content: "公司上线发版地址",
url: "http://192.168.3.233:8888/login"
}
];
export default {
name: "Developers",
data() {
return {
docData: data
};
},
mounted() {
this.getList()
},
methods: {
getList() {
this.api.documentation.getList().then(res => {
console.log(res)
this.docData = res
})
},
add() {
this.to('DocAdd')
}
},
};
</script>
<style>
</style>
<template>
<div>
<a-list item-layout="horizontal" :data-source="projectData">
<a-list-item slot="renderItem" slot-scope="item">
<a-list-item-meta>
<!-- <a slot="title" href="https://www.antdv.com/">{{ item.title }}</a> -->
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</a-list-item-meta>
<div>
<a-descriptions :title="item.title" :bordered="false">
<a-descriptions-item label="开发人员">
{{ item.developer_name }}
</a-descriptions-item>
<a-descriptions-item label="测试项目地址">
<a
:href="item.test_url"
target="_blank"
rel="noopener noreferrer"
>{{ item.test_url }}</a
>
</a-descriptions-item>
<a-descriptions-item label="上产项目地址">
<a
:href="item.test_url"
target="_blank"
rel="noopener noreferrer"
>{{ item.product_url }}</a
>
</a-descriptions-item>
<a-descriptions-item label="使用技术">
{{ item.technology }}
</a-descriptions-item>
<a-descriptions-item label="配置名称">
{{ item.config_name }}
</a-descriptions-item>
</a-descriptions>
</div>
<a slot="actions">edit</a>
<a slot="actions">comment</a>
</a-list-item>
</a-list>
<div class="icon-anticons" @click="add">
<a-icon type="plus-circle" theme="filled" />
</div>
</div>
</template>
<script>
const data = [
{
title: "车联网支撑平台",
developerName: "胡悦、陈婉清",
test_url: "http://sso.test.glsx.com.cn/#/login",
product_url: "http://sso.glsx.com.cn/#/login",
technology: "vue",
config_name: "/admin_common"
},
{
title: "车联网支撑平台",
developerName: "胡悦、陈婉清",
test_url: "http://sso.test.glsx.com.cn/#/login",
product_url: "http://sso.glsx.com.cn/#/login",
technology: "vue",
config_name: "/admin_common"
},
{
title: "车联网支撑平台",
developerName: "胡悦、陈婉清",
test_url: "http://sso.test.glsx.com.cn/#/login",
product_url: "http://sso.glsx.com.cn/#/login",
technology: "vue",
config_name: "/admin_common"
},
{
title: "车联网支撑平台",
developerName: "胡悦、陈婉清",
test_url: "http://sso.test.glsx.com.cn/#/login",
product_url: "http://sso.glsx.com.cn/#/login",
technology: "vue",
config_name: "/admin_common"
}
];
export default {
name: "Home",
data() {
return {
projectData: data
};
},
mounted() {
this.getList()
},
methods: {
getList() {
this.api.project.getList().then(res => {
console.log(res)
this.projectData = res
})
},
add() {
this.to('DocAdd')
}
},
};
</script>
<template>
<div>
记录
</div>
</template>
<script>
export default {
name: 'Record',
data() {
return {
}
}
}
</script>
\ No newline at end of file
module.exports = {
devServer: {
port: 8080, // 端口
proxy: {
//配置跨域
"/api": {
target: "http://192.168.2.9:7001",
// ws:true,
changOrigin: true,
pathRewrite: {
"^/api": "/"
}
}
}
}
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!