master
tangyi 2022-01-17 19:20:45 +08:00
parent de596339f6
commit 82dc933b20
7 changed files with 16035 additions and 150 deletions

15436
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
:class="[navIf == 'consumer' ? 'navIF' : '']"
to="/consumer"
><img src="../assets/user.png" alt="" />
<p>用户管理</p>
<p>考试管理</p>
</router-link>
<router-link
class="navigationList"
@ -42,13 +42,14 @@
><img src="../assets/user.png" alt="" />
<p>题型配置</p>
</router-link>
<!-- <div>
<div class="navigationList" :class="[navIf ? 'navIF':'']">
<img src="../assets/zhanghu.png" alt="" />
<p>账户管理</p>
<img src="" alt="" />
</div>
</div> -->
<router-link
class="navigationList"
:class="[navIf == 'index' ? 'navIF' : '']"
to="/index"
><img src="../assets/user.png" alt="" />
<p>用户管理</p>
</router-link>
</div>
</div>
</template>

View File

@ -13,14 +13,7 @@ import VueAxios from 'vue-axios'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
axios.defaults.baseURL='https://a99zg89a.xiaomy.net'
axios.interceptors.request.use(config => {
config.headers.Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0"
config.headers.common['Blade-Auth'] =localStorage.token
return config
})
let app=createApp(App)
app.config.globalProperties.$bucketName = "nianhua-test"
@ -30,3 +23,21 @@ app.use(VueAxios,axios)
app.mount('#app')
app.component('QuillEditor', QuillEditor)
axios.interceptors.request.use(config => {
config.headers.Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0"
if (config.url!="/hysc/auth/token") {
if (!localStorage.token) {
console.log(app);
router.replace('/');
return config
}
}
config.headers.common['Blade-Auth'] =localStorage.token
return config
})

View File

@ -12,6 +12,8 @@ import projectManagement from '../view/projectManagement.vue'
import projectTopic from '../view/projectTopic.vue'
import generateTest from '../view/generateTest.vue'
import topicParameters from '../view/topicParameters.vue'
import details from '../view/details.vue'
//配置路由
const router = createRouter({
history: createWebHistory(),
@ -51,6 +53,12 @@ const router = createRouter({
name: 'topicParameters',
component: topicParameters
}
,
{
path: '/details', //
name: 'details',
component: details
}
]
})
// 导出router

365
src/view/details.vue Normal file
View File

@ -0,0 +1,365 @@
<template>
<div class="disFlex">
<NavLeft navIf="projectTopic" />
<div class="projectManagement">
<div class="title">编辑题库</div>
<div class="projectTopicText">
<p class="tit">项目信息</p>
<div class="projectTopicCon">
<div>
<div class="projectTopicText">
<p>项目名称</p>
<p>{{ projectData.name }}</p>
</div>
<div class="projectTopicText">
<p>发起单位</p>
<p>{{ projectData.companyName }}</p>
</div>
<div class="projectTopicText">
<p>项目描述</p>
<p>{{ projectData.note }}</p>
</div>
<div class="projectTopicText">
<p>创建时间</p>
<p>{{ projectData.createTime }}</p>
</div>
</div>
<div class="ewm">
<img :src="projectData.qrCodeUrl" alt="" />
</div>
</div>
<div class="projectTopicA">
<div class="detailsInt">
<div class="searchInput">
<el-input
v-model="projectName"
placeholder="请输入项目名称"
></el-input>
</div>
<div class="searchInput">
<el-date-picker
v-model="projectDate"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</div>
<button type="button" @click="queryProject()" class="queryProject">
<img src="" alt="" /> 查询
</button>
</div>
<div class="projectTopicTable">
<el-table :data="tableData" style="width: 100%" max-height="500">
<el-table-column align="center" prop="id" label="用户ID" />
<el-table-column align="center" prop="idCard" label="身份证号" />
<el-table-column align="center" prop="topic" label="人格类型" />
<el-table-column align="center" label="允许参测人员查看测试结果">
<template #default="scope">
<el-switch
v-model="scope.row.age"
@change="testStatus(scope.row)"
/>
</template>
</el-table-column>
<el-table-column
align="center"
prop="testScope"
label="答题环境"
/>
<el-table-column
align="center"
prop="createTime"
label="答题时间"
/>
<el-table-column align="center" fixed="right" label="操作">
<template #default="scope">
<el-button
type="text"
size="small"
@click.prevent="open(scope)"
>
删除
</el-button>
<el-button
type="text"
size="small"
@click.prevent="editTitle(scope)"
>
编辑
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
<!-- // 1 -->
</div>
</template>
<script>
import NavLeft from "../components/nav.vue";
export default {
components: {
NavLeft,
},
props: {
msg: String,
},
data() {
return {
total: "",
detailsData: {
current: "1",
size: "10",
},
projectData: {},
};
},
mounted() {
this.projectData = JSON.parse(localStorage.detailsData);
this.allowAllViewResult()
this.getProject();
},
methods: {
//
handleCurrentChange(data) {
this.detailsData.current = data;
this.getProject();
},
//
inputDataFun() {
this.getProject(this.inputData);
},
testStatus(data) {
let isAllowViewResult = 1;
if (data.age) {
isAllowViewResult = 1;
} else {
isAllowViewResult = 0;
}
console.log({
id: data.id,
isAllowViewResult,
});
// this.axios
// .post("/hysc/test/allowViewResult", {
// id: data.id,
// isAllowViewResult,
// })
// .then(function (response) {
// console.log(response.data.data);
// })
// .catch(function (error) {
// console.log(error);
// });
},
allowAllViewResult() {
this.axios
.get("/hysc/test/allowAllViewResult", {
testId: this.projectData.id,
})
.then(function (response) {
console.log(response.data.data);
})
.catch(function (error) {
console.log(error);
});
},
//
getProject() {
let param = new URLSearchParams();
let that = this;
param.append("current", this.detailsData.current);
param.append("size", this.detailsData.size);
param.append("testId", this.projectData.id);
this.axios
.get("/hysc/test/getTestDetailPage", {
params: param,
})
.then(function (response) {
console.log(response.data.data);
that.tableData = response.data.data.records;
that.total = response.data.data.total;
})
.catch(function (error) {
console.log(error);
});
},
},
};
</script>
<style scoped>
.projectManagement {
height: 100vh;
box-sizing: border-box;
overflow-x: auto;
}
.projectTopicText .projectTopicCon > .ewm {
padding-top: 0px;
padding-left: 0px;
flex: 1;
padding-right: 30px;
box-sizing: border-box;
display: flex;
justify-content: flex-end;
}
.projectTopicText .projectTopicCon > .ewm > img {
height: 100px;
width: 100px;
}
.projectTopicTable {
margin-top: 30px;
}
.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;
display: flex;
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: auto;
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: 32px;
color: #fff;
background: #0544a4;
box-shadow: 0px 2px 7px 0px rgba(120, 137, 149, 0.25);
border-radius: 3px;
border: none;
}
.projectTopicAButton > .buttonCss {
margin-right: 20px;
}
.projectTopicAButton {
display: flex;
margin-top: 30px;
}
.projectTopicAButton > .projectTopicAButtonSearch {
margin-right: 60px;
}
.projectTopicAButtonSearch {
display: flex;
}
.projectTopicAButtonSearch button {
margin-left: 20px;
}
.projectTopicATie > .topicType {
border-bottom: 2px solid #0544a4;
color: #0544a4;
}
.detailsInt {
display: flex;
}
</style>

View File

@ -54,10 +54,10 @@
<p></p>
<p></p>
<div class="buttonFunctionMake">
<p>查看结</p>
<p @click="detailsData(item)"></p>
<p>下载二维码</p>
<p @click="resetCode(item)"></p>
<p>配置白名</p>
<p @click="addIdCard(item)"></p>
<p>停用</p>
<p>删除</p>
</div>
@ -111,11 +111,11 @@
</div> -->
<el-drawer
<el-drawer
v-model="iDcrt"
title="配置白名单"
:direction="direction"
:before-close="handleClose"
:before-close="handleClosea"
>
<div class="generateTestCode">
<p>测试名称{{ codeDate.name }}</p>
@ -126,10 +126,28 @@
codeDate.qrCodeUrlStartTime
}}
</p>
</div>
<el-button type="primary" @click="resetCodeModify()"></el-button>
<el-button @click="resetForm(ruleFormRef)"></el-button>
<el-form
:label-position="labelPosition"
label-width="100px"
:model="iDcrtData"
style="max-width: 460px"
>
<el-form-item label="姓名">
<el-input v-model="iDcrtData.name"></el-input>
</el-form-item>
<el-form-item label="身份证号">
<el-input v-model="iDcrtData.idCard"></el-input>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="iDcrtData.phone"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addTestWhiteList()"></el-button>
<el-button @click="resetForm(ruleFormRef)"></el-button>
</el-form-item>
</el-form>
<div></div>
</div>
</el-drawer>
</div>
@ -152,7 +170,13 @@ export default {
resetCodeModifyData: "",
drawer: false,
direction: "rtl",
iDcrt:false,
iDcrt: false,
iDcrtData: {
idCard: "",
name: "",
phone: "",
testId: 0,
},
generateData: {
current: 1,
endTime: "",
@ -196,6 +220,23 @@ export default {
this.getGenerateTest();
},
methods: {
addIdCard(data) {
this.codeDate = data;
this.iDcrt= true
},
addTestWhiteList() {
this.iDcrtData.testId=this.codeDate.id
console.log( this.iDcrtData);
this.axios
.post("/hysc/test/addTestWhiteList", this.iDcrtData,)
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});
},
//
projectDelete(id) {
let that = this;
@ -228,7 +269,13 @@ export default {
handleClose() {
this.drawer = false;
},
handleClosea() {
this.iDcrt = false;
},
detailsData(data) {
localStorage.detailsData= JSON.stringify(data)
this.$router.push("/details");
},
//
newDate(data) {
let yy = new Date(data).getFullYear();

View File

@ -1,6 +1,6 @@
<template>
<div class="disFlex">
<NavLeft navIf="consumer" />
<NavLeft navIf="index" />
<div class="consumer">
<div class="pull-title">
<ul class="title-item">
@ -45,25 +45,30 @@
<el-button class="seach-btn" @click="queryConsumer()"
><img src="../assets/search-btn.png" alt="" />查询
</el-button>
<el-button class="seach-btn" @click="addIf()"> </el-button>
</ul>
</div>
<div class="consumer-list">
<el-table :data="tableData" style="width: 100%">
<el-table-column align="center" prop="name" label="用户姓名" />
<el-table-column align="center" prop="name" label="账号信息" />
<el-table-column align="center" prop="phone" label="手机号" />
<el-table-column align="center" prop="wxMiniShowname" label="微信" />
<el-table-column
align="center"
prop="dingdingShowname"
label="钉钉"
/>
<!-- <el-table-column align="center" prop="wxMiniShowname" label="所属部门" /> -->
<el-table-column align="center" #default="scope" label="操作">
<el-button type="text" size="small" @click="queryName(scope)"
>编辑</el-button
>
<el-button type="text" size="small" @click="queryNamea(scope)"
>删除</el-button
>
</el-table-column>
<el-table-column align="center" prop="createTime" label="注册时间" />
<el-table-column align="center" #default="scope" label="操作">
<el-button type="text" size="small" @click="queryName(scope)"
>用户详情</el-button
>编辑</el-button
>
<el-button type="text" size="small" @click="queryNamea(scope)"
>测试列表</el-button
>删除</el-button
>
</el-table-column>
</el-table>
@ -72,7 +77,6 @@
<div class="consumer-pagination">
<el-pagination
background
v-model:currentPage="currentPage3"
:page-size="100"
layout="prev, pager, next, jumper"
:total="total"
@ -89,46 +93,45 @@
:before-close="handleClose"
>
<div class="elementUl">
<div class="usernameDatatit">
<p
@click="usernameDatatitIf(true)"
:class="usernameDataIf ? 'usernameDatatitIf' : ''"
>
用户信息
</p>
<p
@click="usernameDatatitIf(fales)"
:class="usernameDataIf ? '' : 'usernameDatatitIf'"
>
测评报告
</p>
</div>
<div v-if="usernameDataIf" class="usernameData">
<p class="p">
用户ID<span>{{ usernameData.id }}</span>
</p>
<p class="p">
手机号<span>{{ usernameData.phone }}</span>
</p>
<p class="p">
身份证号<span>{{ usernameData.idCard }}</span>
</p>
<div class="wxDd">
<p>微信</p>
<div class="wxDdCon">
<img src="" alt="" />
<p>{{ usernameData.wxMiniShowname }}</p>
<el-form
:label-position="labelPosition"
label-width="100px"
:model="adduserData"
style="max-width: 460px"
>
<el-form-item label="新增头像">
<div class="imgFm">
<input type="file" @change="upLoad($event)" />
<img :src="imgData" alt="" />
</div>
<p>钉钉</p>
<div class="wxDdCon">
<img src="" alt="" />
<p></p>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="登陆账号(手机号)">
<el-input v-model="adduserData.account"></el-input>
</el-form-item>
<el-form-item label="登陆密码">
<el-input v-model="adduserData.password"></el-input>
</el-form-item>
<el-form-item label="角色" prop="region">
<select
placeholder="请选择类型"
v-model="adduserData.roleId"
class="selectCss"
>
<option
class="option"
v-for="item in roleData"
:key="item.roleName"
:value="item.id"
>
{{ item.roleName }}
</option>
</select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addUsername()"></el-button>
<el-button @click="resetForm(ruleFormRef)"></el-button>
</el-form-item>
</el-form>
</div>
</el-drawer>
</div>
@ -136,6 +139,7 @@
<script>
import NavLeft from "../components/nav.vue";
import * as qiniu from "qiniu-js";
export default {
components: {
NavLeft,
@ -147,12 +151,22 @@ export default {
return {
drawer: false,
tableData: [],
roleData: "",
total: 1,
imgData: "https://nianhua.test.joymido.com/",
consumerData: {
current: 1,
phone: "",
size: 10,
},
userData: "",
adduserData: {
account: "",
avatar: "",
password: "",
phone: "",
roleId: "",
},
};
},
mounted() {
@ -161,6 +175,63 @@ export default {
this.getReportList();
},
methods: {
upLoad(e) {
let that = this;
let key = null;
this.axios
.get("http://101.200.157.76:12306/ding/file/getQiniuToken", {
params: { bucketName: "nianhua-test" },
})
.then(function (data) {
var config = {
useCdnDomain: true,
};
//
var putExtra = {
fname: "",
params: {},
mimeType: null,
};
console.log(e.target.files[0], data.data.data.token);
let observable = qiniu.upload(
e.target.files[0],
key,
data.data.data.token,
putExtra,
config
);
// var observable = qiniu.upload({ file, key, token, putExtra, config })
//
var observer = {
//
//
error(err) {
console.log(err);
},
complete(res) {
that.imgData += res.key;
},
};
//
observable.subscribe(observer);
})
.catch(function (error) {
console.log(error);
});
},
getroleData() {
let that = this;
this.axios
.get("/hysc/system/role/getRoleList")
.then(function (response) {
that.roleData = response.data.data;
console.log(that.roleData);
})
.catch(function (error) {
console.log(error);
});
},
//
newDate(data) {
let yy = new Date(data).getFullYear();
@ -171,20 +242,9 @@ export default {
usernameDatatitIf(ifS) {
this.usernameDataIf = ifS;
},
//
queryName(data) {
this.drawer = true;
this.getReportList(data.row);
this.usernameData = data.row;
this.usernameDataIf = true;
},
//
queryNamea(data) {
this.drawer = true;
this.getReportList(data.row);
this.usernameData = data.row;
this.usernameDataIf = false;
},
handleCurrentChange(data) {
this.consumerData.current = data;
this.getConsumer();
@ -192,6 +252,31 @@ export default {
handleClose() {
this.drawer = false;
},
addIf() {
this.drawer = true;
this.adduserData = {
account: "",
avatar: "",
password: "",
phone: "",
roleId: "",
};
this.getroleData();
},
queryName(data) {
this.drawer = true;
this.adduserData = { ...data.row };
},
queryNamea(data) {
this.axios
.post("/hysc/user/delUserById", { id: data.row.id })
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
},
phonetest(data) {
const reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
if (data == "" || data.length <= 10 || !reg.test(data)) {
@ -201,29 +286,10 @@ export default {
}
},
//
getConsumer() {
let param = new URLSearchParams();
param.append("current", this.consumerData.current);
param.append("keyword", this.consumerData.keyword);
param.append("size", this.consumerData.size);
param.append("type", this.consumerData.type);
param.append("endTime", this.consumerData.endTime);
param.append("startTime", this.consumerData.startTime);
this.axios
.get("/hysc/member/getMemberPage", {
params: param,
})
.then(function () {})
.catch(function (error) {
console.log(error);
});
},
getReportList() {
let param = new URLSearchParams();
param.append("current", this.consumerData.current);
param.append("phone", this.userData.phone);
// param.append("phone", this.userData.phone);
param.append("size", this.consumerData.size);
let that = this;
@ -232,38 +298,25 @@ export default {
params: param,
})
.then(function (response) {
console.log(response.data);
that.tableData = response.data.data.records;
console.log( that.tableData );
that.total = response.data.data.total;
})
.catch(function (error) {
console.log(error);
});
},
queryConsumer() {
// consumerData: {
// current: 1,
// keyword: "",
// type: "",
// size: 10,
// endTime: "",
// startTime: "",
// },
console.log(this.consumerData.type);
if (this.consumerData.type == "手机号" || this.consumerData.type == "") {
if (!this.phonetest(this.consumerData.keyword)) {
this.$alert("请正确输入手机号", "手机号错误", {
confirmButtonText: "确定",
});
return;
}
}
if (this.consumerData.Time) {
this.consumerData.startTime = this.newDate(this.consumerData.Time[0]);
this.consumerData.endTime = this.newDate(this.consumerData.Time[1]);
}
this.getConsumer();
addUsername() {
this.adduserData.avatar = this.imgData;
this.adduserData.phone=this.adduserData.account
this.axios
.post("/hysc/user/submit", this.adduserData)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
},
},
};