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

View File

@ -13,14 +13,7 @@ import VueAxios from 'vue-axios'
import zhCn from 'element-plus/es/locale/lang/zh-cn' import zhCn from 'element-plus/es/locale/lang/zh-cn'
axios.defaults.baseURL='https://a99zg89a.xiaomy.net' 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) let app=createApp(App)
app.config.globalProperties.$bucketName = "nianhua-test" app.config.globalProperties.$bucketName = "nianhua-test"
@ -30,3 +23,21 @@ app.use(VueAxios,axios)
app.mount('#app') app.mount('#app')
app.component('QuillEditor', QuillEditor) 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 projectTopic from '../view/projectTopic.vue'
import generateTest from '../view/generateTest.vue' import generateTest from '../view/generateTest.vue'
import topicParameters from '../view/topicParameters.vue' import topicParameters from '../view/topicParameters.vue'
import details from '../view/details.vue'
//配置路由 //配置路由
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
@ -51,6 +53,12 @@ const router = createRouter({
name: 'topicParameters', name: 'topicParameters',
component: topicParameters component: topicParameters
} }
,
{
path: '/details', //
name: 'details',
component: details
}
] ]
}) })
// 导出router // 导出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>
<p></p> <p></p>
<div class="buttonFunctionMake"> <div class="buttonFunctionMake">
<p>查看结</p> <p @click="detailsData(item)"></p>
<p>下载二维码</p> <p>下载二维码</p>
<p @click="resetCode(item)"></p> <p @click="resetCode(item)"></p>
<p>配置白名</p> <p @click="addIdCard(item)"></p>
<p>停用</p> <p>停用</p>
<p>删除</p> <p>删除</p>
</div> </div>
@ -115,7 +115,7 @@
v-model="iDcrt" v-model="iDcrt"
title="配置白名单" title="配置白名单"
:direction="direction" :direction="direction"
:before-close="handleClose" :before-close="handleClosea"
> >
<div class="generateTestCode"> <div class="generateTestCode">
<p>测试名称{{ codeDate.name }}</p> <p>测试名称{{ codeDate.name }}</p>
@ -126,10 +126,28 @@
codeDate.qrCodeUrlStartTime codeDate.qrCodeUrlStartTime
}} }}
</p> </p>
</div> </div>
<el-button type="primary" @click="resetCodeModify()"></el-button> <el-form
<el-button @click="resetForm(ruleFormRef)"></el-button> :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> </div>
</el-drawer> </el-drawer>
</div> </div>
@ -153,6 +171,12 @@ export default {
drawer: false, drawer: false,
direction: "rtl", direction: "rtl",
iDcrt: false, iDcrt: false,
iDcrtData: {
idCard: "",
name: "",
phone: "",
testId: 0,
},
generateData: { generateData: {
current: 1, current: 1,
endTime: "", endTime: "",
@ -196,6 +220,23 @@ export default {
this.getGenerateTest(); this.getGenerateTest();
}, },
methods: { 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) { projectDelete(id) {
let that = this; let that = this;
@ -228,7 +269,13 @@ export default {
handleClose() { handleClose() {
this.drawer = false; this.drawer = false;
}, },
handleClosea() {
this.iDcrt = false;
},
detailsData(data) {
localStorage.detailsData= JSON.stringify(data)
this.$router.push("/details");
},
// //
newDate(data) { newDate(data) {
let yy = new Date(data).getFullYear(); let yy = new Date(data).getFullYear();

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="disFlex"> <div class="disFlex">
<NavLeft navIf="consumer" /> <NavLeft navIf="index" />
<div class="consumer"> <div class="consumer">
<div class="pull-title"> <div class="pull-title">
<ul class="title-item"> <ul class="title-item">
@ -45,25 +45,30 @@
<el-button class="seach-btn" @click="queryConsumer()" <el-button class="seach-btn" @click="queryConsumer()"
><img src="../assets/search-btn.png" alt="" />查询 ><img src="../assets/search-btn.png" alt="" />查询
</el-button> </el-button>
<el-button class="seach-btn" @click="addIf()"> </el-button>
</ul> </ul>
</div> </div>
<div class="consumer-list"> <div class="consumer-list">
<el-table :data="tableData" style="width: 100%"> <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="phone" label="手机号" />
<el-table-column align="center" prop="wxMiniShowname" label="微信" /> <!-- <el-table-column align="center" prop="wxMiniShowname" label="所属部门" /> -->
<el-table-column <el-table-column align="center" #default="scope" label="操作">
align="center" <el-button type="text" size="small" @click="queryName(scope)"
prop="dingdingShowname" >编辑</el-button
label="钉钉" >
/> <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" prop="createTime" label="注册时间" />
<el-table-column align="center" #default="scope" label="操作"> <el-table-column align="center" #default="scope" label="操作">
<el-button type="text" size="small" @click="queryName(scope)" <el-button type="text" size="small" @click="queryName(scope)"
>用户详情</el-button >编辑</el-button
> >
<el-button type="text" size="small" @click="queryNamea(scope)" <el-button type="text" size="small" @click="queryNamea(scope)"
>测试列表</el-button >删除</el-button
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -72,7 +77,6 @@
<div class="consumer-pagination"> <div class="consumer-pagination">
<el-pagination <el-pagination
background background
v-model:currentPage="currentPage3"
:page-size="100" :page-size="100"
layout="prev, pager, next, jumper" layout="prev, pager, next, jumper"
:total="total" :total="total"
@ -89,46 +93,45 @@
:before-close="handleClose" :before-close="handleClose"
> >
<div class="elementUl"> <div class="elementUl">
<div class="usernameDatatit"> <el-form
<p :label-position="labelPosition"
@click="usernameDatatitIf(true)" label-width="100px"
:class="usernameDataIf ? 'usernameDatatitIf' : ''" :model="adduserData"
style="max-width: 460px"
> >
用户信息 <el-form-item label="新增头像">
</p> <div class="imgFm">
<p <input type="file" @change="upLoad($event)" />
@click="usernameDatatitIf(fales)" <img :src="imgData" alt="" />
:class="usernameDataIf ? '' : 'usernameDatatitIf'" </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
</p> class="option"
</div> v-for="item in roleData"
:key="item.roleName"
<div v-if="usernameDataIf" class="usernameData"> :value="item.id"
<p class="p"> >
用户ID<span>{{ usernameData.id }}</span> {{ item.roleName }}
</p> </option>
<p class="p"> </select>
手机号<span>{{ usernameData.phone }}</span> </el-form-item>
</p> <el-form-item>
<p class="p"> <el-button type="primary" @click="addUsername()"></el-button>
身份证号<span>{{ usernameData.idCard }}</span> <el-button @click="resetForm(ruleFormRef)"></el-button>
</p> </el-form-item>
<div class="wxDd"> </el-form>
<p>微信</p>
<div class="wxDdCon">
<img src="" alt="" />
<p>{{ usernameData.wxMiniShowname }}</p>
</div>
<p>钉钉</p>
<div class="wxDdCon">
<img src="" alt="" />
<p></p>
</div>
</div>
</div>
</div> </div>
</el-drawer> </el-drawer>
</div> </div>
@ -136,6 +139,7 @@
<script> <script>
import NavLeft from "../components/nav.vue"; import NavLeft from "../components/nav.vue";
import * as qiniu from "qiniu-js";
export default { export default {
components: { components: {
NavLeft, NavLeft,
@ -147,12 +151,22 @@ export default {
return { return {
drawer: false, drawer: false,
tableData: [], tableData: [],
roleData: "",
total: 1, total: 1,
imgData: "https://nianhua.test.joymido.com/",
consumerData: { consumerData: {
current: 1, current: 1,
phone: "", phone: "",
size: 10, size: 10,
}, },
userData: "",
adduserData: {
account: "",
avatar: "",
password: "",
phone: "",
roleId: "",
},
}; };
}, },
mounted() { mounted() {
@ -161,6 +175,63 @@ export default {
this.getReportList(); this.getReportList();
}, },
methods: { 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) { newDate(data) {
let yy = new Date(data).getFullYear(); let yy = new Date(data).getFullYear();
@ -171,20 +242,9 @@ export default {
usernameDatatitIf(ifS) { usernameDatatitIf(ifS) {
this.usernameDataIf = 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) { handleCurrentChange(data) {
this.consumerData.current = data; this.consumerData.current = data;
this.getConsumer(); this.getConsumer();
@ -192,6 +252,31 @@ export default {
handleClose() { handleClose() {
this.drawer = false; 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) { phonetest(data) {
const reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/; const reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
if (data == "" || data.length <= 10 || !reg.test(data)) { 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() { getReportList() {
let param = new URLSearchParams(); let param = new URLSearchParams();
param.append("current", this.consumerData.current); param.append("current", this.consumerData.current);
param.append("phone", this.userData.phone); // param.append("phone", this.userData.phone);
param.append("size", this.consumerData.size); param.append("size", this.consumerData.size);
let that = this; let that = this;
@ -232,38 +298,25 @@ export default {
params: param, params: param,
}) })
.then(function (response) { .then(function (response) {
console.log(response.data);
that.tableData = response.data.data.records; that.tableData = response.data.data.records;
console.log( that.tableData );
that.total = response.data.data.total; that.total = response.data.data.total;
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
}, },
queryConsumer() { addUsername() {
// consumerData: { this.adduserData.avatar = this.imgData;
// current: 1, this.adduserData.phone=this.adduserData.account
// keyword: "", this.axios
// type: "", .post("/hysc/user/submit", this.adduserData)
// size: 10, .then(function (response) {
// endTime: "", console.log(response);
// startTime: "", })
// }, .catch(function (error) {
console.log(this.consumerData.type); console.log(error);
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();
}, },
}, },
}; };