Commit e2ef7e9c by luyt

add: 静态站点完成

1 parent d98fe972
This diff could not be displayed because it is too large.
{
"name": "antd-demo",
"name": "glsk-front",
"version": "0.1.0",
"private": true,
"scripts": {
......@@ -11,6 +11,8 @@
"ant-design-vue": "^1.7.8",
"axios": "^0.21.3",
"core-js": "^3.6.5",
"moment": "^2.29.1",
"pubsub-js": "^1.9.4",
"vue": "^2.6.11",
"vue-router": "^3.5.2"
},
......
......@@ -3,8 +3,8 @@
<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="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>
......
......@@ -7,6 +7,8 @@ import '@/assets/css/common.css'
import { components } from '@/plugins/ant'
import { message } from "ant-design-vue";
import api from './api'
import PubSub from 'pubsub-js'
Vue.config.productionTip = false;
components.forEach(component => Vue.use(component))
......@@ -19,6 +21,7 @@ Vue.prototype.to = function (name, params) {
router.push({ name, params})
}
Vue.prototype.$message = message
Vue.prototype.$PubSub = PubSub
new Vue({
render: h => h(App),
router,
......
......@@ -9,9 +9,13 @@ import {
Input,
Checkbox,
Button,
Select
Select,
Comment,
Tooltip,
} from 'ant-design-vue'
export const components = [
Menu,
Icon,
......@@ -23,5 +27,7 @@ export const components = [
Input,
Checkbox,
Button,
Select
Select,
Comment,
Tooltip,
]
\ No newline at end of file
......@@ -25,7 +25,7 @@ service.interceptors.request.use(function (config) {
service.interceptors.response.use(response => {
// 对响应数据做点什么
const { data: {status, msg} } = response
console.log(response)
// console.log(response)
if (status != 0) {
message.error(msg)
return Promise.reject({status, msg})
......
......@@ -6,10 +6,8 @@
*/
const routes = Object.freeze([
{
name: 'Home',
path: '/',
redirect: '/home',
component: resolve => require(['../views/home/index.vue'], resolve)
},
{
name: 'Home',
......@@ -17,6 +15,11 @@ const routes = Object.freeze([
component: resolve => require(['../views/home/index.vue'], resolve)
},
{
name: 'HomeAdd',
path: '/home/add',
component: resolve => require(['../views/home/add/index.vue'], resolve)
},
{
name: 'Documentation',
path: '/documentation',
component: resolve => require(['../views/documentation/index.vue'], resolve)
......
<template>
<div>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item label="项目名称" prop="project_title">
<a-input v-model="form.project_title" />
</a-form-model-item>
<a-form-model-item label="开发者名称" prop="developer_name">
<a-input v-model="form.developer_name" />
</a-form-model-item>
<a-form-model-item label="配置名称" prop="config_name">
<a-input v-model="form.config_name" />
</a-form-model-item>
<a-form-model-item label="测试环境地址" prop="test_url">
<a-input v-model="form.test_url" />
</a-form-model-item>
<a-form-model-item label="生产环境地址" prop="product_url">
<a-input v-model="form.product_url" />
</a-form-model-item>
<a-form-model-item label="相关技术栈" prop="technology">
<a-input v-model="form.technology" />
</a-form-model-item>
<a-form-model-item label="请输入项目描述" prop="project_description">
<a-input v-model="form.project_description" 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: {
project_title: "",
project_description: "",
developer_name: "",
config_name: "",
test_url: "",
product_url: "",
technology: "",
},
rules: {
project_title: [
{ required: true, message: "请输入项目名称", trigger: "blur" },
{ min: 1, max: 30, message: "请输入字符1~50之间", trigger: "blur" },
],
project_description: [
{ required: true, message: "请输入项目描述", trigger: "blur" },
],
developer_name: [
{ required: true, message: "请输入开发者名称", trigger: "blur" },
],
config_name: [
{ required: true, message: "请输入配置名称", trigger: "blur" },
],
test_url: [
{ required: true, message: "请输入测试环境地址", trigger: "blur" },
],
product_url: [
{ required: true, message: "请输入生产环境地址", trigger: "blur" },
],
technology: [
{ required: true, message: "请输入相关技术栈", trigger: "blur" },
],
},
};
},
mounted() {
this.editeItemFn();
},
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();
this.resetDate();
},
resetDate() {
this.form = {
project_title: "",
project_description: "",
developer_name: "",
config_name: "",
test_url: "",
product_url: "",
technology: "",
};
},
closeForm() {
this.to(-1);
},
//编辑项目
editeItemFn() {
const editeItem = this.$route.params;
if (!editeItem) return;
this.form = {
...editeItem,
};
},
},
};
</script>
<style scoped lang="scss"></style>
......@@ -2,44 +2,41 @@
<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-meta>
<!-- <a slot="title" href="https://www.antdv.com/">{{ item.title }}</a> -->
<a-avatar slot="avatar" :src="projectImgUrl" />
</a-list-item-meta>
<div>
<a-descriptions :title="item.project_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" @click="editFn(item)">edit</a>
<a slot="actions" @click="commentsFn(item.comments)">comments</a>
</a-list-item>
</a-list>
<div class="icon-anticons" @click="add">
......@@ -50,58 +47,64 @@
<script>
const data = [
{
title: "车联网支撑平台",
developerName: "胡悦、陈婉清",
id: 1,
project_title: "广联运营平台",
project_description: "广联运营平台",
developer_name: "胡悦、陈婉清",
config_name: "/admin_common",
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",
id: 2,
project_title: "账户管理",
project_description: "商户、角色、员工管理",
developer_name: "胡悦、陈婉清",
config_name: "/glsx-oss-account-config",
test_url: "http://glsx-account-merchants.test.glsx.com.cn",
product_url: "http://glsx-account.glsx.com.cn",
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"
}
];
import projectImgUrl from "@/assets/project.jpg";
export default {
name: "Home",
data() {
return {
projectData: data
projectData: data,
projectImgUrl,
};
},
mounted() {
this.getList()
this.getList();
},
methods: {
getList() {
this.api.project.getList().then(res => {
console.log(res)
this.projectData = res
})
this.api.project.getList().then((res) => {
// console.log(res);
this.projectData = res;
});
},
add() {
this.to('DocAdd')
}
this.to("HomeAdd");
},
editFn(item) {
console.log("item: ", item);
this.to("HomeAdd", item);
},
commentsFn(comments) {
this.to("Record", comments);
},
},
};
</script>
<style>
.ant-list-split .ant-list-item{
transition: all 0.3s;
}
.ant-list-split .ant-list-item:hover {
border-color: rgba(0, 0, 0, 0.09);
box-shadow: 0 2px 8px rgb(0 0 0 / 9%);
}
</style>
<template>
<div>
记录
<div class="ant-result-title">项目名称</div>
<a-list
v-if="comments.length"
:data-source="comments"
:header="`${comments.length} ${
comments.length > 1 ? 'replies' : 'reply'
}`"
item-layout="horizontal"
>
<a-list-item slot="renderItem" slot-scope="item">
<a-comment
:author="item.author"
:avatar="item.avatar"
:content="item.content"
:datetime="item.datetime"
/>
</a-list-item>
</a-list>
<a-comment>
<a-avatar
slot="avatar"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
alt="Han Solo"
/>
<div slot="content">
<a-form-item>
<a-textarea :rows="4" :value="value" @change="handleChange" />
</a-form-item>
<a-form-item>
<a-button
html-type="submit"
:loading="submitting"
type="primary"
@click="handleSubmit"
>
Add Comment
</a-button>
</a-form-item>
</div>
</a-comment>
</div>
</template>
<script>
import moment from "moment";
import FormItem from "ant-design-vue/lib/form/FormItem";
export default {
name: 'Record',
data() {
return {
}
}
comments: [],
submitting: false,
value: "",
moment,
};
},
components: { [FormItem.name]: FormItem },
methods: {
handleSubmit() {
if (!this.value) {
return;
}
this.submitting = true;
setTimeout(() => {
this.submitting = false;
this.comments = [
{
author: "Han Solo",
avatar:
"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png",
content: this.value,
datetime: moment().fromNow(),
},
...this.comments,
];
this.value = "";
}, 1000);
},
handleChange(e) {
this.value = e.target.value;
},
},
};
</script>
<style>
.ant-result-title {
margin-bottom: 50px;
color: rgba(0, 0, 0, 0.85);
font-size: 24px;
line-height: 1.8;
text-align: center;
}
</script>
\ No newline at end of file
</style>
\ No newline at end of file
......@@ -4,7 +4,7 @@ module.exports = {
proxy: {
//配置跨域
"/api": {
target: "http://192.168.2.9:7001",
target: "http://192.168.2.24:7001",
// ws:true,
changOrigin: true,
pathRewrite: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!