Compare commits

...

2 Commits

Author SHA1 Message Date
tangyi c15fab6c72 修改 2022-01-11 20:18:13 +08:00
tangyi f2b84b2b5e 修改 2022-01-11 20:17:54 +08:00
4 changed files with 381 additions and 61 deletions

View File

@ -7,6 +7,30 @@
</script>
<style>
<<<<<<< HEAD
body{
margin: 0px;
}
p{
margin: 0px;
}
a{
text-decoration: none;
}
*{outline: none;}
.makeBer{
position: fixed;
width: 100%;
height: 100%;
left: 0px;
top: 0px;
display: flex;
z-index: 5;
align-items: center;
background-color: rgba(0,0,0,0.5);
justify-content: center
}
=======
* {
margin: 0;
padding: 0;
@ -58,4 +82,5 @@
.title-item li.cur{
border-bottom: 1px solid #0544A4;
}
>>>>>>> 642f11b1bb2a73ce363919b308f78feb8965d9c4
</style>

View File

@ -9,6 +9,7 @@ import login from '../view/login.vue'
import index from '../view/index.vue'
import consumer from '../view/consumer.vue'
import projectManagement from '../view/projectManagement.vue'
import projectTopic from '../view/projectTopic.vue'
//配置路由
const router = createRouter({
history: createWebHistory(),
@ -31,6 +32,11 @@ const router = createRouter({
path: '/projectManagement', //
name: 'projectManagement',
component: projectManagement
},
{
path: '/projectTopic', //
name: 'projectTopic',
component: projectTopic
}
]

View File

@ -43,15 +43,36 @@
<el-table-column align="center" prop="name" label="项目" />
<el-table-column align="center" prop="note" label="备注" />
<el-table-column align="center" prop="testCount" label="数量" />
<el-table-column align="center" fixed="right" label="状态">
<template #default="scope">
<div v-if="scope.row.status == 0"></div>
<div v-else></div>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作">
<template #default="scope">
<el-button
type="text"
size="small"
@click.prevent="deleteRow(scope.$index)"
@click.prevent="open(scope, 1)"
>
删除
</el-button>
<el-button
type="text"
size="small"
@click.prevent="open(scope, 2)"
>
停用
</el-button>
<el-button
type="text"
size="small"
@click.prevent="topicNav(scope)"
>
编辑题库
</el-button>
</template>
</el-table-column>
</el-table>
@ -62,53 +83,61 @@
@current-change="handleCurrentChange"
:current-page="currentPage4"
layout="prev, pager, next, jumper"
:total="400"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
<el-drawer
v-model="drawer"
title="新建项目"
:direction="direction"
:before-close="handleClose"
>
<div class="elementUl">
<el-form
:label-position="labelPosition"
label-width="100px"
:model="addProjectData"
style="max-width: 460px"
>
<el-form-item label="项目名称">
<el-input v-model="addProjectData.projectName"></el-input>
</el-form-item>
<el-form-item label="项目单位">
<el-input v-model="addProjectData.projectUnit"></el-input>
</el-form-item>
<el-drawer
v-model="drawer"
title="新建项目"
:direction="direction"
:before-close="handleClose"
>
<div class="elementUl">
<el-form
:label-position="labelPosition"
label-width="100px"
:model="addProjectData"
style="max-width: 460px"
>
<el-form-item label="项目名称">
<el-input v-model="addProjectData.projectName"></el-input>
</el-form-item>
<el-form-item label="项目单位">
<el-input v-model="addProjectData.projectUnit"></el-input>
</el-form-item>
<el-form-item label="项目描述" prop="type">
<el-input v-model="addProjectData.projectNote" type="textarea" :autosize="{ minRows:9, maxRows: 9 }"></el-input>
</el-form-item>
<el-form-item label="项目描述" prop="type">
<el-input
v-model="addProjectData.projectNote"
type="textarea"
:autosize="{ minRows: 9, maxRows: 9 }"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addProjectManagement()"
>新建项目</el-button
>
<el-button @click="resetForm(ruleFormRef)"></el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
<el-form-item>
<el-button type="primary" @click="addProjectManagement()"
>新建项目</el-button
>
<el-button @click="resetForm(ruleFormRef)"></el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
<!-- <div class="makeBer">
</div> -->
</div>
</template>
<script>
import NavLeft from "../components/nav.vue";
import { ElMessageBox, ElMessage } from "element-plus";
export default {
components: {
@ -119,16 +148,22 @@ export default {
},
data() {
return {
addProjectData:{
projectName:"",
projectUnit:"",
projectNote:""
total: "1",
addProjectData: {
projectName: "",
projectUnit: "",
projectNote: "",
},
drawer: false,
direction: "rtl",
projectName: "",
projectDate: "",
promptData: {
confirmText: "",
message: "",
},
projectData: {
current: 1,
endTime: "",
@ -166,14 +201,94 @@ export default {
},
};
},
deleteProject() {},
mounted() {
//
this.getProject();
},
methods: {
//
open(obj, num) {
let that = this;
if (num == 1) {
this.promptData.confirmText = "是否确定删除";
this.promptData.message = "删除成功";
} else {
this.promptData.confirmText = "是否确定停用";
this.promptData.message = "停用成功";
}
ElMessageBox.confirm(this.promptData.confirmText, {
confirmButtonText: "取消",
cancelButtonText: "确定",
type: "提示",
})
.then(() => {
ElMessage({
type: "delet",
message: "已取消",
});
})
.catch(() => {
if (num == 1) {
that.projectDelete(obj.row.id);
ElMessage({
type: "tiyong",
message: that.promptData.message,
});
} else {
console.log(obj.row.status);
if (obj.row.status == 0) {
that.projectDisable({ id: obj.row.id, status: "1" });
ElMessage({
type: "tiyong",
message: "已禁用",
});
} else {
that.projectDisable({ id: obj.row.id, status: "0" });
ElMessage({
type: "tiyong",
message: "已启用",
});
}
}
});
},
//
topicNav(data){
localStorage.topicData= JSON.stringify( data.row)
this.$router.push("/projectTopic");
},
//
projectDelete(id) {
let that = this;
this.axios
.post("/hysc/project/delProject", {
id: id,
})
.then(function () {
that.getProject();
})
.catch(function (error) {
console.log(error);
});
},
projectDisable(data) {
let that = this;
this.axios
.post("/hysc/project/updProject", data)
.then(function () {
that.getProject();
})
.catch(function (error) {
console.log(error);
});
},
handleCurrentChange(data) {
this.projectData.current = data;
this.getProject();
},
handleClose() {
this.drawer=false
this.drawer = false;
},
deleteRow(index) {
console.log(index);
@ -191,33 +306,31 @@ export default {
return yy + "-" + mm + "-" + "-" + dd;
},
//
addProject(){
this.drawer=true
console.log( this.drawer);
addProject() {
this.drawer = true;
},
addProjectManagement(){
let that=this
addProjectManagement() {
let that = this;
this.axios
.post("/hysc/project/addProject",{
name:this.addProjectData.projectName,
companyName:this.addProjectData.projectUnit,
note:this.addProjectData.projectNote,
.post("/hysc/project/addProject", {
name: this.addProjectData.projectName,
companyName: this.addProjectData.projectUnit,
note: this.addProjectData.projectNote,
})
.then(function (response) {
console.log(response);
that.drawer=false
this.getProject()
.then(function () {
that.drawer = false;
this.getProject();
})
.catch(function (error) {
console.log(error);
});
},
//
queryProject() {
this.projectData.startTime = this.newDate(this.projectDate[0]);
this.projectData.endTime = this.newDate(this.projectDate[1]);
if (this.projectDate[0]) {
this.projectData.startTime = this.newDate(this.projectDate[0]);
this.projectData.endTime = this.newDate(this.projectDate[1]);
}
this.projectData.name = this.projectName;
this.getProject();
},
@ -233,11 +346,11 @@ export default {
this.axios
.get("/hysc/project/getProjectPage", {
params: param
})
params: param,
})
.then(function (response) {
console.log(response.data);
that.total = response.data.data.total;
that.tableData = response.data.data.records;
})
.catch(function (error) {
@ -260,6 +373,7 @@ export default {
}
.projectManagement {
flex: 1;
box-sizing: border-box;
padding: 60px;
}
.title {
@ -314,5 +428,6 @@ export default {
}
.projectTable {
margin-top: 30px;
width: 100%;
}
</style>

174
src/view/projectTopic.vue Normal file
View File

@ -0,0 +1,174 @@
<template>
<div class="disFlex">
<NavLeft />
<div class="projectManagement">
<div class="title">编辑题库</div>
<div class="projectTopicText">
<p class="tit">项目信息</p>
<div class="projectTopicCon">
<div>
<div class="projectTopicText">
<p>项目名称</p>
<p>内容</p>
</div>
<div class="projectTopicText">
<p>项目名称</p>
<p>内容</p>
</div>
<div class="projectTopicText">
<p>项目名称</p>
<p>内容</p>
</div>
</div>
<div class="">
<p>当前已选择:</p>
<p>题型1<span>40</span></p>
<p>题型2<span>40</span></p>
<p>题型3<span>40</span></p>
<p>题型4<span>40</span></p>
</div>
</div>
<div class="projectTopicA">
<div class="projectTopicATie">
<p>题型一题库</p>
<p>题型二题库</p>
<p>题型三题库</p>
<p>题型四题库</p>
</div>
<div class="projectTopicAButton">
<div>
<el-input
v-model="input2"
class="w-50 m-2"
placeholder="搜索"
:prefix-icon="Search"
/>
</div>
<button class="buttonCss" type="button"></button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import NavLeft from "../components/nav.vue";
export default {
components: {
NavLeft,
},
props: {
msg: String,
},
data() {
return {};
},
mounted() {
//
this.getProject();
},
methods: {},
};
</script>
<style >
.projectTopicText .tit {
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1b2125;
margin-top: 50px;
line-height: 22px;
padding-left: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #1b2125;
}
.projectTopicCon {
width: 100%;
height: 157px;
padding-top: 30px;
background: #f8fafb;
border-radius: 3px;
border: 1px solid #dde3e8;
margin-top: 50px;
}
.projectTopicCon > div {
display: flex;
}
.projectTopicCon > :nth-child(1) {
padding-left: 30px;
}
.projectTopicCon > :nth-child(2) {
padding-left: 30px;
padding-top: 60px;
}
.projectTopicCon > div > .projectTopicText {
margin-right: 120px;
}
.projectTopicText > :nth-child(1) {
width: 80px;
height: 26px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #8e8e8e;
line-height: 26px;
}
.projectTopicText > :nth-child(2) {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #8e8e8e;
line-height: 26px;
}
.projectTopicCon > :nth-child(2) > p {
margin-right: 60px;
}
.projectTopicCon > :nth-child(2) > :nth-child(1) {
margin-right: 0px;
}
.projectTopicA {
width: 100%;
height: 415px;
margin-top: 30px;
background: #f8fafb;
border-radius: 3px;
border: 1px solid #dde3e8;
}
.projectTopicA {
box-sizing: border-box;
padding: 30px;
}
.projectTopicATie {
display: flex;
}
.projectTopicATie > p {
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1b2125;
margin-right: 60px;
line-height: 22px;
}
.buttonCss{
width: 100px;
height: 36px;
background: #0544A4;
box-shadow: 0px 2px 7px 0px rgba(120, 137, 149, 0.25);
border-radius: 3px;
border: none;
}
.projectTopicAButton{
display: flex;
}
</style>