Commit 4a229f15 by 胡悦

优化

1 parent b0e485a3
......@@ -11,6 +11,8 @@
"ant-design-vue": "^1.7.8",
"axios": "^0.21.3",
"core-js": "^3.6.5",
"less": "^3.0.0",
"less-loader": "^6.0.0",
"moment": "^2.29.1",
"pubsub-js": "^1.9.4",
"vue": "^2.6.11",
......
......@@ -3,15 +3,15 @@
<div class="wrapper-header">
<img class="logo" src="./assets/logo.png" alt="" />
<a-menu v-model="current" mode="horizontal">
<a-menu-item key="folder" @click="handleTab('Folder')"
><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-item key="folder" @click="handleTab('Folder')">
<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">
......@@ -44,34 +44,4 @@ export default {
</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: 1300px;
}
</style>
......@@ -10,12 +10,14 @@
border-radius: 50%;
box-shadow: 0 10px 30px rgb(45 140 240 / 40%);
}
.icon-anticons .anticon {
font-size: 36px;
color: #2d8cf0;
color: #002FA7;
transition: transform 0.3s ease-in-out;
will-change: transform;
}
.icon-anticons .anticon:hover {
background: rgba(45, 140, 240, 0.2);
background: rgba(0, 47, 167, 0.2);
}
\ No newline at end of file
@import '~ant-design-vue/dist/antd.less';
@import 'theme.less';
.icon {
margin-right: 4px;
color: @primary-color;
}
.wrapper-header {
display: flex;
background-color: @white-bg;
.logo {
display: inline-flex;
width: 50px;
height: 50px;
}
.ant-menu {
display: inline-flex;
background-color: @white-bg;
color: @text-color;
}
.ant-menu-horizontal>.ant-menu-item:hover,
.ant-menu-horizontal>.ant-menu-item-active,
.ant-menu-horizontal>.ant-menu-item-selected {
border-bottom: none;
}
.ant-menu-horizontal {
border-bottom: none;
}
.ant-menu-horizontal>.ant-menu-item>a {
color: @primary-color;
}
}
.wrapper-content {
margin: 30px auto;
padding: 0 10px;
max-width: 1300px;
}
\ No newline at end of file
@primary-color: #002FA7;
@text-color: #333;
@white-bg: #fff;
\ No newline at end of file
/*
* @Description:
* @Author: huyue
* @Date: 2022-05-09 15:36:51
* @LastEditors: huyue
* @LastEditTime: 2022-05-10 00:02:51
*/
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,Modal } from "ant-design-vue";
import { message, Modal } from "ant-design-vue";
import '@/assets/css/common.css'
import '@/assets/css/style.less'
import api from './api'
import PubSub from 'pubsub-js'
......@@ -18,7 +25,7 @@ Vue.prototype.to = function (name, params) {
router.go(-1)
return
}
router.push({ name, params})
router.push({ name, params })
}
Vue.prototype.$message = message
Vue.prototype.$confirm = Modal.confirm
......
<template>
<div>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-model-item label="分类标题" prop="classify_title">
<a-input v-model="form.classify_title" />
</a-form-model-item>
<a-form-model-item label="分类字段" prop="classify">
<a-input v-model="form.classify" :disabled="!isNewAdd" />
<a-form-model-item prop="classify">
<span slot="label">
<a-popover title="什么是分类字段?">
<template slot="content">
<p>项目分类的字段名,用来区分创建项目所属的类别</p>
</template>
<a-icon class="icon" type="question-circle" />分类字段
</a-popover>
</span>
<a-input v-model="form.classify" :disabled="!isNewAdd" />
<!-- <a-select v-model="form.classify" placeholder="请选择你的分类">
<a-select-option
v-for="item in classifyList"
......@@ -27,8 +29,7 @@
<a-input v-model="form.classify_description" type="textarea" />
</a-form-model-item>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="onSubmit"
>{{ isNewAdd ? "创建" : "提交" }}
<a-button type="primary" @click="onSubmit">{{ isNewAdd ? "创建" : "提交" }}
</a-button>
<a-button style="margin-left: 10px" @click="resetForm"> 重置 </a-button>
<a-button style="margin-left: 10px" @click="closeForm"> 关闭 </a-button>
......@@ -91,7 +92,7 @@ export default {
if (valid) {
if (this.isNewAdd) {
//新增
console.log('this.form',this.form)
console.log('this.form', this.form)
this.api.classify.create(this.form).then((res) => {
// console.log(res);
if (res.id) {
......@@ -148,4 +149,5 @@ export default {
};
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
</style>
......@@ -7,6 +7,9 @@
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item label="项目分类">
{{ $route.params.classify }}
</a-form-model-item>
<a-form-model-item label="项目名称" prop="project_title">
<a-input v-model="form.project_title" />
</a-form-model-item>
......@@ -47,22 +50,23 @@
<script>
export default {
name: "",
name: "HomeAdd",
data() {
return {
isNewAdd: true,
labelCol: { span: 4 },
wrapperCol: { span: 14 },
form: {
project_title: "",
project_description: "",
developer_name: "",
config_name: "",
test_url: "",
product_url: "",
technology: "",
git_url: "",
git_id: "",
classify: this.$route.params.classify,
project_title: '',
project_description: '',
developer_name: '',
config_name: '',
test_url: '',
product_url: '',
technology: '',
git_url: '',
git_id: '',
},
rules: {
project_title: [
......@@ -97,7 +101,11 @@ export default {
};
},
mounted() {
this.editeItemFn();
// this.editeItemFn();
if (this.$route.params.id) {
this.form = this.$route.params
this.$set(this, 'isNewAdd', false)
}
},
methods: {
onSubmit() {
......@@ -105,16 +113,14 @@ export default {
if (valid) {
// const classify = sessionStorage.getItem("classify");
const pramas = {
const params = {
...this.form,
// classify,
};
// console.log("pramas: " + JSON.stringify(pramas));
console.log(this.isNewAdd, 'isNewAdd')
if (this.isNewAdd) {
//新增
this.api.project.create(pramas).then((res) => {
this.api.project.create(params).then((res) => {
// console.log('res: ', res);
if (res.id) {
this.$message.success("添加成功");
......@@ -126,7 +132,7 @@ export default {
});
} else {
//编辑
this.api.project.update(pramas).then((res) => {
this.api.project.update(params).then((res) => {
// console.log("res: ", res);
if (res.id) {
this.$message.success("编辑成功");
......
......@@ -59,8 +59,9 @@
<p>1.进入git仓库项目设置</p>
<p>2.查看 Project ID</p>
</template>
{{ item.git_id }} <a-icon type="question" />
<a-icon type="question-circle" />
</a-popover>
{{ item.git_id }}
</a-descriptions-item>
</a-descriptions>
</div>
......@@ -146,11 +147,10 @@ export default {
//设置 项目分类
setClassifyFn() {
const classify = this.$route.query.classify;
sessionStorage.setItem("classify", classify);
},
add() {
this.to("HomeAdd");
this.to("HomeAdd", { classify: this.$route.query.classify });
this.setClassifyFn();
},
editFn(item) {
......@@ -193,7 +193,7 @@ export default {
// console.log('item: ', item);
this.$router.push({ name: "GitLog", query: { projectId: item.git_id } });
},
//h获取全部的分类
//获取全部的分类
getClassifyList() {
this.api.classify.getList().then((res) => {
console.log(res);
......
module.exports = {
css: {
loaderOptions: {
less: {
lessOptions: {
modifyvars: {
'primary-color': '#002FA7'
},
javascriptEnabled: true
}
}
}
},
devServer: {
port: 8080, // 端口
proxy: {
//配置跨域
"/api3": {
target: "http://192.168.2.24:7001",
ws:true,
target: "http://192.168.1.68:7001",
ws: true,
changOrigin: true,
pathRewrite: {
"^/api3": "/"
}
},
},
"/api2": {
// target: "http://192.168.3.233:8090/api/v4/projects",
target: "http://192.168.1.16:8090/api/v4/projects",
ws:true,
ws: true,
changOrigin: true,
pathRewrite: {
"^/api2": "/"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!