Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage

This commit is contained in:
songwc
2022-11-01 12:34:58 +08:00
25 changed files with 1021 additions and 392 deletions

View File

@@ -1,5 +1,5 @@
import http from "./config";
// import qs from 'qs';
import qs from 'qs';
/**
@@ -34,6 +34,8 @@ import http from "./config";
*
*/
//上传文件
export const uploadFile = (obj) => http.post('/test/testRequest', qs.stringify({ obj }));
// 接口-请求

19
src/api/indexActivity.js Normal file
View File

@@ -0,0 +1,19 @@
import http from "./config";
//获取活动信息接口
export const getActivity = (obj) => http.get('/activity', { params: obj });
//创建活动接口
export const createActivity = (obj) => http.post('/activity/createActivity', obj);
//删除活动接口
export const deleteActivity = (obj) => http.post('/activity/deleteActivity', { params: obj });
//修改活动接口
export const updateActivity = (obj) => http.post('/activity/updateActivity', obj);
//修改活动是否为必修接口
export const updateActivityToCompulsory = (obj) => http.post('/activity/updateActivityToCompulsory', { params: obj });
//修改活动是否为选修接口
export const updateActivityToElective = (obj) => http.post('/activity/updateActivityToElective', { params: obj });

13
src/api/indexDiscuss.js Normal file
View File

@@ -0,0 +1,13 @@
import http from "./config";
//创建讨论
export const createDiscuss = (obj) => http.post('/discuss/createDiscuss', obj);
//获取讨论信息接口
export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', { params: obj });
//删除讨论接口
export const deleteDiscuss = (obj) => http.post('/discuss/deleteDiscuss', { params: obj });
//修改讨论接口
export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', { params: obj });

63
src/api/indexEval.js Normal file
View File

@@ -0,0 +1,63 @@
import http from "./config";
// import qs from 'qs';
/**
* 接口传参数方式get
* axios.get('/user', {
* params: {
* id: 12345
* name: user
* }
* }).then(res => console.log(res))
*
* 接口传参三种方式post/put/patch
*
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'multipart/form-data'
* var formData=new FormData();
* formData.append('user',123456);formData.append('pass',12345678);
* axios.post("/notice",formData).then()
*
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/x-www-form-urlencoded'
* let data = {"code":"1234","name":"yyyy"};
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
*
* 3.'Content-Type'= 'application/json传参格式为 raw (JSON格式)。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/json;charset=UTF-8'
* let data = {"code":"1234","name":"yyyy"}
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
// 接口-请求
//创建测评
export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj,);
//上传组件
export const fileUp = (obj) => http.post('/file/upload', obj,);
//删除测评信息
export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj })
//根据ID获取测评信息详情
export const queryEvaluationDetailById = (obj) => http.post('/evaluation/queryEvaluationDetailById', { params: obj })
//修改测评信息
export const updateEvaluation = (obj) => http.post('/evaluation/updateEvaluation', obj)
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })

14
src/api/indexExam.js Normal file
View File

@@ -0,0 +1,14 @@
import http from "./config";
// 创建考试信息接口
export const createExamination = (obj) => http.post('/examination/createExamination',obj,{
headers: {
'token': '123'
}
});
// 根据Id删除考试信息
export const deleteExaminationById = (obj) => http.post('/examination/deleteExaminationById',obj);
// 根据ID获取考试信息详情
export const queryExaminationDetailById = (obj) => http.post('/examination/queryExaminationDetailById',obj);
// 创建考试信息接口
export const updateExamination = (obj) => http.post('/examination/updateExamination',obj);

60
src/api/indexInvist.js Normal file
View File

@@ -0,0 +1,60 @@
import http from "./config";
// import qs from 'qs';
/**
* 接口传参数方式get
* axios.get('/user', {
* params: {
* id: 12345
* name: user
* }
* }).then(res => console.log(res))
*
* 接口传参三种方式post/put/patch
*
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'multipart/form-data'
* var formData=new FormData();
* formData.append('user',123456);formData.append('pass',12345678);
* axios.post("/notice",formData).then()
*
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/x-www-form-urlencoded'
* let data = {"code":"1234","name":"yyyy"};
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
*
* 3.'Content-Type'= 'application/json传参格式为 raw (JSON格式)。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/json;charset=UTF-8'
* let data = {"code":"1234","name":"yyyy"}
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
// 接口-请求
//创建评估
export const createAppraiseMessage = (obj) => http.post('/survey/createAppraiseMessage', obj,);
//删除评估信息
export const deleteAppraise = (obj) => http.post('/survey/deleteAppraise', { params: obj })
//根据ID获取评估信息详情
export const queryAppraiseDetailById = (obj) => http.post('/survey/queryAppraiseDetailById', { params: obj })
//修改评估信息
export const updateAppraiseMessage = (obj) => http.post('/survey/updateAppraiseMessage', obj)
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })

8
src/api/indexLevel.js Normal file
View File

@@ -0,0 +1,8 @@
import http from "./config";
//新建或编辑关卡
export const editChapter = (obj) => http.post('/admin/router/editChapter', obj, {
headers: {
'token': '123'
}
});

0
src/api/indexVote.js Normal file
View File

14
src/api/indexWork.js Normal file
View File

@@ -0,0 +1,14 @@
import http from "./config";
// 创建作业信息接口
export const createWorkTask = (obj) => http.post('/work/createWorkTask',obj,{
headers: {
'token': '123'
}
});
// 删除作业信息接口
export const deleteWorkTask = (obj) => http.post('/work/deleteWorkTask',obj);
// 根据ID获取作业信息详情
export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById',obj);
// 修改作业信息接口
export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask',obj);

View File

@@ -188,7 +188,7 @@
</a-menu-item>
<a-menu-item key="sub5" @titleClick="titleClick">
<span>调研</span>
<span>评估</span>
</a-menu-item>
<a-menu-item key="sub6" @titleClick="titleClick">

View File

@@ -65,6 +65,7 @@
v-model:value="textV2"
placeholder="请输入活动说明"
allow-clear
maxlength="150"
/>
</div>
</div>
@@ -75,6 +76,7 @@
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="time"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
@@ -118,7 +120,7 @@
<a-input
v-model:value="inputV3"
style="width: 424px; height: 32px"
placeholder="请输入授课老师"
placeholder="请输入活动地址"
/>
</div>
</div>
@@ -143,7 +145,7 @@
border-radius: 8px;
overflow: hidden;
"
:v-model:value="inputV4"
v-model:value="inputV4"
/>
<span style="color: #999999; margin-left: 8px">分钟</span>
</div>
@@ -159,7 +161,7 @@
border-radius: 8px;
overflow: hidden;
"
:v-model:value="inputV5"
v-model:value="inputV5"
/>
<span style="color: #999999; margin-left: 8px">分钟</span>
</div>
@@ -180,7 +182,7 @@
border-radius: 8px;
overflow: hidden;
"
:v-model:value="inputV6"
v-model:value="inputV6"
/>
<span style="color: #999999; margin-left: 8px"
>分钟提前签退则记为早退</span
@@ -207,14 +209,17 @@
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createActivity">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexActivity";
import { message } from "ant-design-vue";
import { toDate } from "../../api/method.js";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -252,10 +257,20 @@ export default {
textV1: "",
textV2: "",
radioV1: "",
time: "",
});
const closeDrawer = () => {
ctx.emit("update:addactiveVisible", false);
state.radioV1 = "";
state.inputV1 = "";
state.inputV2 = "";
state.inputV3 = "";
state.inputV4 = "";
state.inputV5 = "";
state.inputV6 = "";
state.textV1 = "";
state.textV2 = "";
state.time = "";
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
@@ -265,12 +280,64 @@ export default {
state.radioV1 = "";
}
};
//创建活动
const createActivity = () => {
if(!state.inputV1) return message.warning("请输入活动名称");
if(!state.inputV2) return message.warning("请输入活动时长");
if(!state.textV1) return message.warning("请输入活动公告");
if(!state.inputV3) return message.warning("请输入活动地址");
let startTime = toDate(new Date(state.time[0].$d).getTime() / 1000, "Y-M-D");
let endTime = toDate(new Date(state.time[1].$d).getTime() / 1000, "Y-M-D");
let obj = {
activityAddress: state.inputV3, //活动地址
activityDuration: state.inputV2, //活动时长
activityExplain: state.textV2, //活动说明
activityEndTime: endTime, //活动结束时间
activityId: 0, //活动ID
activityName: state.inputV1, //活动名称
activityNotice: state.textV1, //活动公告
activityStartTime: startTime, //活动开始时间
activityTag: "", //活动逻辑删除标识
afterSignIn: state.inputV5, //活动开始后多少分钟签到
beforeSignIn: state.inputV4, //活动开始前多少分钟签到
createTime: "", //创建时间
createUser: 0, //创建人
signOutTime: state.inputV6, //签退开始时间
standardSettings: state.radioV1, //标准设置
updateTime: "", //更新时间
updateUser: 0, //更新人
};
api
.createActivity(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
state.radioV1 = "";
state.inputV1 = "";
state.inputV2 = "";
state.inputV3 = "";
state.inputV4 = "";
state.inputV5 = "";
state.inputV6 = "";
state.textV1 = "";
state.textV2 = "";
state.time = "";
ctx.emit("update:addactiveVisible", false);
}, 1000);
})
.catch((err) => {
console.log("创建失败",err);
})
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
cloradio1,
createActivity,
};
},
};
@@ -298,6 +365,9 @@ export default {
.contentMain {
display: flex;
justify-content: space-between;
.ant-picker {
border-radius: 8px;
}
.main_left {
padding-right: 30px;
flex: 1;

View File

@@ -33,7 +33,8 @@
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入讨论名称"
maxlength="20"
show-count
:maxlength="20"
/>
</div>
</div>
@@ -46,6 +47,8 @@
v-model:value="textV1"
placeholder="请输入讨论说明"
allow-clear
show-count
:maxlength="200"
/>
</div>
</div>
@@ -60,14 +63,16 @@
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createDiscuss">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexDiscuss";
import { message } from "ant-design-vue";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -103,15 +108,51 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:adddiscussVisible", false);
state.inputV1 = "";
state.textV1 = "";
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
//创建讨论
const createDiscuss = () => {
if(!state.inputV1) return message.warning("请输入讨论名称");
let obj = {
discussName: state.inputV1, //讨论名称
discussExplain: state.textV1, //讨论说明
discussSettings: state.checkedC1, //讨论设置
createTime: "", //创建时间
createUser: 0, //创建人
discussFlag: "", //活动逻辑删除标识
discussId: 0, //讨论Id
discussTag: "", //是否必修的标识
updateTime: "", //更新时间
updateUser: 0, //更新人
projectId: 0, //项目id
};
api
.createDiscuss(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
state.inputV1 = "";
state.textV1 = "";
message.success("创建成功");
ctx.emit("update:adddiscussVisible", false);
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
createDiscuss,
};
},
};
@@ -160,6 +201,9 @@ export default {
display: flex;
flex: 1;
align-items: center;
.ant-input {
height: 100%;
}
.xkbtn {
cursor: pointer;
width: 130px;
@@ -185,40 +229,22 @@ export default {
margin-right: 5px;
}
}
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
.textarea {
width: 423px;
.ant-input {
width: 100%;
}
.ant-input-textarea-show-count {
position: relative;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
}
}
}

View File

@@ -1,72 +1,75 @@
<template>
<a-drawer
:visible="addevalVisible"
class="drawerStyle addevalDrawer"
width="80%"
title="添加测评"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加测评</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="contentMain">
<div class="main_left">
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">测评名称</span>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入测评名称"
maxlength="20"
<a-drawer
:visible="addevalVisible"
class="drawerStyle addevalDrawer"
width="80%"
title="添加测评"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加测评</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="contentMain">
<div class="main_left">
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">测评名称</span>
</div>
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">选择测评</span>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV2"
style="width: 424px; height: 32px"
placeholder="请输入名称或编码后选择"
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入测评名称"
maxlength="20"
/>
</div>
</div>
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">选择测评</span>
</div>
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">有效期</span>
</div>
<div class="btnbox">
<a-range-picker
style="width: 424px;"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV2"
style="width: 424px; height: 32px"
placeholder="请输入名称或编码后选择"
/>
</div>
<div class="main_item2">
</div>
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">有效期</span>
</div>
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="time"
format="YYYY-MM-DD HH:mm:ss"
@change="onChange"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
</div>
<div class="main_item2">
<div class="signbox">
<span style="margin-right: 3px">图片</span>
</div>
@@ -77,7 +80,7 @@
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
action="/api/file/upload"
:before-upload="beforeUpload"
@change="handleChange"
>
@@ -90,200 +93,312 @@
</a-upload>
</div>
</div>
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
</div>
</div>
</a-drawer>
</template>
<div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createEvalText">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
"selectedRows: ",
selectedRows
);
import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import * as api from "../../api/indexEval";
import { message } from "ant-design-vue";
// import { toDate } from "../../api/method";
const router = useRouter();
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
"selectedRows: ",
selectedRows
);
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
},
});
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "AddEval",
// components: {
// },
props: {
addevalVisible: {
type: Boolean,
default: false,
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
},
});
export default {
name: "AddEval",
// components: {
// },
props: {
addevalVisible: {
type: Boolean,
default: false,
},
},
setup(props, ctx) {
const state = reactive({
inputV1: "",
inputV2:"",
});
const closeDrawer = () => {
ctx.emit("update:addevalVisible", false);
},
setup(props, ctx) {
const state = reactive({
inputV1: "",
inputV2: "",
time: undefined,
endTime: undefined,
startTime: undefined,
});
const closeDrawer = () => {
ctx.emit("update:addevalVisible", false);
state.inputV1 = "";
state.inputV2 = "";
state.time = undefined;
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
const onChange = () => {
state.endTime = state.time[0].$d.toString;
state.startTime = state.time[1].$d.toString;
}
//上传组件
const fileList = ref([]);
const loading = ref(false);
const imageUrl = ref('');
const handleChange = info => {
if (info.file.status === 'uploading') {
loading.value = true;
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, base64Url => {
imageUrl.value = base64Url;
loading.value = false;
});
}
if (info.file.status === 'error') {
loading.value = false;
message.error('upload error');
}
}
const beforeUpload = file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
}
// const fileUp = () => {
// let obj = {
// file
// }
// }
//创建测评信息
const createEvalText = () => {
if (!state.inputV1) return message.info("请输入测评名称");
console.log(state.time);
console.log(state.time[0]);
console.log(state.time[0].$d.toString);
console.log(state.time[1].$d.toString);
let obj = {
evaluationName: state.inputV1,
createTime: "",
createUser: 0,
evaluationEndTime: state.endTime,
evaluationFlag: "",
evaluationId: "",
evaluationPictureAddress: "",
evaluationStartTime: state.startTime,
evaluationTag: "",
evaluationTypeId: 0,
evaluationTypeName: "",
updateTime: "",
updateUser: 0,
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
};
},
};
</script>
api
.createEvaluation(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
console.log(obj);
// state.createLoading = false;
router.push("/leveladd");
// getLearnPath();
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
// state.createLoading = false;
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
createEvalText,
onChange,
//上传组件
fileList,
loading,
imageUrl,
handleChange,
beforeUpload,
};
},
};
</script>
<style lang="scss">
.ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important;
}
.addevalDrawer {
.drawerMain {
.header {
height: 73px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
.ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important;
}
.addevalDrawer {
.drawerMain {
.header {
height: 73px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
.contentMain {
display: flex;
justify-content: space-between;
.main_left {
padding-right: 30px;
flex: 1;
border-right: 1px solid #e8e8e8;
.main_item {
}
.contentMain {
display: flex;
justify-content: space-between;
.main_left {
padding-right: 30px;
flex: 1;
border-right: 1px solid #e8e8e8;
.main_item {
display: flex;
align-items: center;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.btnbox {
display: flex;
flex: 1;
align-items: center;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 8px;
color: #fff;
}
.sign {
margin-right: 5px;
}
}
.main_item2 {
.btnbox {
display: flex;
align-items: flex-start;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
}
flex: 1;
align-items: center;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 8px;
color: #fff;
}
}
}
}
.main_btns {
height: 72px;
width: 100%;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
.main_item2 {
display: flex;
align-items: flex-start;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.sign {
margin-right: 5px;
}
}
.kqszbox {
.qdqtbox {
margin-left: 56px;
}
.setbox {
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 24px;
.timerbox {
margin-top: 6px;
margin-right: 32px;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
}
}
.btnbox2 {
display: flex;
flex-direction: column;
justify-content: flex-start;
.xkbtn {
cursor: pointer;
width: 130px;
height: 40px;
background: #388be1;
border-radius: 8px;
border: 0;
margin-right: 16px 8px 32px 0;
color: #fff;
margin-top: 16px;
margin-bottom: 60px;
}
}
}
}
}
.main_btns {
height: 72px;
width: 100%;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
}
}
}
</style>
}
</style>

View File

@@ -63,6 +63,7 @@
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="choosedTime"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
@@ -78,7 +79,15 @@
<span style="margin-right: 3px">附件</span>
</div>
<div class="btnbox">
<a-upload
v-model:file-list="fileList"
name="file"
action="/api/file/upload"
:headers="headers"
@change="handleChange"
>
<button class="xkbtn">上传附件</button>
</a-upload>
</div>
</div>
<div class="main_item" style="margin-top:-25px;">
@@ -91,14 +100,18 @@
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="addHomework">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import {message} from"ant-design-vue";
import {createWorkTask} from "@/api/indexWork"
import dayjs from 'dayjs';
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -129,18 +142,65 @@ export default {
const state = reactive({
inputV1: "",
textV1:"",
choosedTime:[],
});
const handleChange = info => {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 文件上传成功`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 文件上传失败.`);
}
};
const fileList = ref([]);
const closeDrawer = () => {
ctx.emit("update:addhomeworkVisible", false);
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
const addHomework = () => {
if(state.choosedTime.length && state.inputV1 && state.textV1){
createWorkTask({
"createTime": "",
"createUser": 0,
"submitEndTime": dayjs(state.choosedTime[1]).format("YYYY-MM-DD"),
"submitStartTime": dayjs(state.choosedTime[0]).format("YYYY-MM-DD"),
"updateTime": "",
"updateUser": 0,
"workEnclosureAddress": "",
"workFlag": "",
"workId": 0,
"workName": state.inputV1,
"workRequirement": state.textV1,
"workTag": ""
}).then((res)=>{
message.success(`添加成功${res}`)
ctx.emit("update:addhomeworkVisible", false);
}).catch((err)=>{
message.error(`添加失败${err}`)
})
}
else{
message.error(`字段不能为空`)
return 0
}
}
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
addHomework,
handleChange,
fileList,
headers: {
"token":"123"
},
};
},
};

View File

@@ -3,13 +3,13 @@
:visible="addinvistVisible"
class="drawerStyle addinvistDrawer"
width="80%"
title="添加调研"
title="添加评估"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加调研</div>
<div class="headerTitle">添加评估</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -64,7 +64,7 @@
</div>
<div class="btnbox">
<a-range-picker
style="width: 424px"
style="width: 424px"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
@@ -76,7 +76,7 @@
<div class="textarea">
<a-textarea
v-model:value="textV1"
placeholder="请输入调研说明"
placeholder="请输入评估说明"
allow-clear
maxlength="150"
/>
@@ -85,14 +85,18 @@
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createInvist">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
<script>
import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import * as api from "../../api/indexInvist";
import { message } from "ant-design-vue";
const router = useRouter();
const options1 = ref([
{
value: "value1",
@@ -132,21 +136,61 @@ export default {
});
const closeDrawer = () => {
ctx.emit("update:addinvistVisible", false);
state.inputV1 = "";
state.textV1 = "";
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
//创建评估信息
const createInvist = () => {
if (!state.inputV1) return message.info("请输入测评名称");
// if (!state.inputV2) return message.info("请选择测评");
// if (!state.organizationSelectName) return message.info("请选择归属组织");
// state.createLoading = true;
let obj = {
appraiseName: state.inputV1,
appraiseEndTime: "",
appraiseExplain: state.textV1,
appraiseFlag: "",
appraiseId: 0,
appraiseStartTime: "",
appraiseTag: "",
createTime: "",
createUser: 0,
researchId: 0,
researchName: "",
updateTime: "",
updateUser: 0,
};
api
.createAppraiseMessage(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
// state.createLoading = false;
router.push("/leveladd");
// getLearnPath();
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
// state.createLoading = false;
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
rowSelection,
options1,
rowSelection,
options1,
createInvist,
};
},
};
</script>
<style lang="scss">
<style lang="scss">
.ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important;
}
@@ -285,4 +329,3 @@ export default {
}
}
</style>

View File

@@ -43,7 +43,7 @@
</div>
<div class="textarea">
<a-textarea
v-model:value="textV1"
v-model:value="testV1"
placeholder="请输入考试说明"
allow-clear
maxlength="150"
@@ -66,6 +66,7 @@
style="width: 424px"
placeholder="请输入考试名称"
:options="options1"
v-model:value="choosedTest"
allowClear
showSearch
/>
@@ -83,6 +84,7 @@
</div>
<div class="btnbox">
<a-range-picker
v-model:value="testTime"
style="width: 424px"
:placeholder="[' 开始时间', ' 结束时间']"
/>
@@ -199,14 +201,17 @@
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="addTest">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import {message} from"ant-design-vue";
import {createExamination} from "@/api/indexExam"
import dayjs from 'dayjs';
const rowSelection = ref({
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
@@ -244,7 +249,19 @@ export default {
radioV2: "",
radioV3: "",
radioV4: "",
choosedTest: "",
testTime:"",
});
const options1 = ref([
{
label:'math',
value:'math',
},
{
label:'eng',
value:'eng',
},
])
const closeDrawer = () => {
ctx.emit("update:addtestVisible", false);
state.radioV1 = "";
@@ -252,6 +269,44 @@ export default {
state.radioV3 = "";
state.radioV4 = "";
};
const addTest = () => {
if(state.testTime.length
&& state.inputV1&& state.inputV2&& state.inputV3&& state.inputV4
&& state.radioV1&& state.radioV2&& state.radioV3
){
createExamination({
"createTime": "",
"createUser": 0,
"examinationDuration": state.inputV2,
"examinationEndTime": dayjs(state.testTime[1]).format("YYYY-MM-DD"),
"examinationExplain": state.testV1,
"examinationFlag": "",
"examinationId": 0,
"examinationLimit": state.inputV3,
"examinationName": state.inputV1,
"examinationPaperId": 0,
"examinationPaperName": state.choosedTest,
"examinationStartTime": dayjs(state.testTime[0]).format("YYYY-MM-DD"),
"examinationTag": "",
"passLine": state.inputV4,
"questionArrangement": state.radioV4,
"scoringModel": state.radioV3,
"showAnalysis": state.radioV2,
"showAnswers": state.radioV1,
"updateTime": "",
"updateUser": 0
}).then((res)=>{
message.success(`添加成功${res}`)
ctx.emit("update:addtestVisible", false);
}).catch((err)=>{
message.error(`添加失败${err}`)
})
}
else{
message.error(`字段不能为空`)
return 0
}
}
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
@@ -284,6 +339,8 @@ export default {
cloradio2,
cloradio3,
cloradio4,
addTest,
options1,
};
},
};

View File

@@ -1776,7 +1776,7 @@ export default {
}
.learningPath {
width: 100%;
height: 100%;
// height: 100%;
display: flex;
flex-direction: column;
position: relative;
@@ -1983,10 +1983,11 @@ export default {
}
}
.tableBox {
padding-bottom: 20px;
.pa {
position: absolute;
bottom: 20px;
left: 0;
// position: absolute;
// bottom: 20px;
// left: 0;
width: 100%;
// height: 20px;
// background-color: red;

View File

@@ -342,7 +342,7 @@
? require('../../assets/images/leveladd/huo.png')
: item.course === '测评'
? require('../../assets/images/leveladd/ce.png')
: item.course === '调研'
: item.course === '评估'
? require('../../assets/images/leveladd/diao.png')
: item.course === '投票'
? require('../../assets/images/leveladd/tou.png')
@@ -441,7 +441,7 @@
item.course === '外链' ||
item.course === '讨论' ||
item.course === '直播' ||
item.course === '调研' ||
item.course === '评估' ||
item.course === '投票' ||
item.course === '活动'
? showTime(item.course, item.name)
@@ -1083,7 +1083,7 @@ export default {
percent: 20,
},
{
course: "调研",
course: "评估",
name: "管理直播间",
classify: "必修",
beginTime: "2022-09-16 14:03",

View File

@@ -85,8 +85,8 @@
<div class="co1">{{ value2.length }}/100</div>
</div>
<div class="btn">
<button class="btn1">取消</button>
<button class="btn2">确定</button>
<button class="btn1" @click="closeModal">取消</button>
<button class="btn2" @click="editChapter">确定</button>
</div>
</div>
</div>
@@ -217,7 +217,7 @@
<div class="img">
<img src="../../assets/images/leveladd/diao.png" />
</div>
<div class="text">调研</div>
<div class="text">评估</div>
</div>
<div class="lin"></div>
</div>
@@ -504,6 +504,8 @@
import { reactive, toRefs, onMounted, onUnmounted } from "vue";
import AddStu from "../../components/drawers/AddLevelAddStu";
import ImpStu from "../../components/drawers/AddLevelImportStu";
import * as api from "../../api/indexLevel";
import { message } from "ant-design-vue";
export default {
name: "LevelAddDetail",
components: {
@@ -808,6 +810,33 @@ export default {
isActive: false,
projectChecked: null, //项目单选框
});
//新建或编辑关卡
const editChapter = () => {
if(!state.value1) return message.warning("请输入关卡名称");
let obj = {
name: state.value1,
remark: state.value2,
routerId: 0,
};
api
.editChapter(obj)
.then((res) => {
setTimeout(() => {
console.log("创建成功", res);
message.success("创建成功");
state.value1 = "";
state.value2 = "";
state.modal = false;
// state.createLoading = false;
//state.currentPage = 1;
// getLearnPath();
}, 1000);
})
.catch((err) => {
console.log("创建失败", err);
});
}
const showDrawer = () => {
state.visible = true;
};
@@ -819,6 +848,8 @@ export default {
};
const closeModal = () => {
state.modal = false;
state.value1 = "";
state.value2 = "";
};
const afterVisibleChange = (bool) => {
console.log("visible", bool);
@@ -1164,6 +1195,7 @@ export default {
showDeleteALLModal,
delete_exit,
drawertableColumns,
editChapter,
};
},
};
@@ -1289,9 +1321,9 @@ export default {
width: 100px;
height: 40px;
border-radius: 4px;
border: 1px solid #387df7;
border: 1px solid #409EFF;
font-size: 14px;
color: #387df7;
color: #409EFF;
cursor: pointer;
background: #ffffff;
margin-right: 20px;
@@ -1304,7 +1336,7 @@ export default {
color: #fff;
cursor: pointer;
border: 0;
background: #388be1;
background: #409EFF;
}
}
}

View File

@@ -135,7 +135,7 @@
? require('../../assets/images/leveladd/huo.png')
: item.course === '测评'
? require('../../assets/images/leveladd/ce.png')
: item.course === '调研'
: item.course === '评估'
? require('../../assets/images/leveladd/diao.png')
: item.course === '投票'
? require('../../assets/images/leveladd/tou.png')
@@ -225,7 +225,7 @@
item.course === '外链' ||
item.course === '讨论' ||
item.course === '直播' ||
item.course === '调研' ||
item.course === '评估' ||
item.course === '投票' ||
item.course === '活动'
? showTime(item.course, item.name)
@@ -609,7 +609,7 @@ export default defineComponent({
percent: 20,
},
{
course: "调研",
course: "评估",
name: "管理直播间",
classify: "必修",
beginTime: "2022-09-16 14:03",

View File

@@ -216,13 +216,13 @@
<div class="img">
<img src="../../assets/images/leveladd/diao.png" />
</div>
<div class="text">调研</div>
<div class="text">评估</div>
</div>
<!-- 添加调研侧弹窗 -->
<!-- 添加评估侧弹窗 -->
<div>
<add-invist v-model:addinvistVisible="addinvistvisible" />
</div>
<!-- 添加调研侧弹窗 -->
<!-- 添加评估侧弹窗 -->
<div class="lin"></div>
</div>
<div class="item" @click="showDrawerAddVote">

View File

@@ -296,7 +296,7 @@
? require('../../assets/images/leveladd/huo.png')
: item.course === '测评'
? require('../../assets/images/leveladd/ce.png')
: item.course === '调研'
: item.course === '评估'
? require('../../assets/images/leveladd/diao.png')
: item.course === '投票'
? require('../../assets/images/leveladd/tou.png')
@@ -395,7 +395,7 @@
item.course === '外链' ||
item.course === '讨论' ||
item.course === '直播' ||
item.course === '调研' ||
item.course === '评估' ||
item.course === '投票' ||
item.course === '活动'
? showTime(item.course, item.name)
@@ -2233,7 +2233,7 @@ export default {
percent: 20,
},
{
course: "调研",
course: "评估",
name: "管理直播间",
classify: "必修",
beginTime: "2022-09-16 14:03",

View File

@@ -1,4 +1,4 @@
<!-- 调研管理-管理页面 -->
<!-- 评估管理-管理页面 -->
<template>
<div class="managepage">
<div class="up">

View File

@@ -1,4 +1,4 @@
<!-- 调研管理-创建评估页面 -->
<!-- 评估管理-创建评估页面 -->
<template>
<div class="researchadd">
<div class="header">
@@ -21,8 +21,8 @@
<div class="tagbox">
<div class="tagname">单选题</div>
<div class="deleteop">
<div><img src="../../assets/images/projectadd/delete.png"/></div>
<div class="del_text">删除选项</div>
<div><img src="../../assets/images/projectadd/delete.png" /></div>
<div class="del_text">删除选项</div>
</div>
</div>
<div class="name">
@@ -99,7 +99,7 @@
/>
</div>
<div class="name">
<div class="in" style="margin-left: 85px;margin-bottom: 20px">
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
<a-button
type="primary"
style="
@@ -117,8 +117,8 @@
<div class="tagbox">
<div class="tagname">问答题</div>
<div class="deleteop">
<div><img src="../../assets/images/projectadd/delete.png"/></div>
<div class="del_text">删除选项</div>
<div><img src="../../assets/images/projectadd/delete.png" /></div>
<div class="del_text">删除选项</div>
</div>
</div>
<div class="name">
@@ -152,8 +152,8 @@
<div class="tagbox">
<div class="tagname">评分题</div>
<div class="deleteop">
<div><img src="../../assets/images/projectadd/delete.png"/></div>
<div class="del_text">删除选项</div>
<div><img src="../../assets/images/projectadd/delete.png" /></div>
<div class="del_text">删除选项</div>
</div>
</div>
<div class="name">
@@ -221,7 +221,7 @@
</div>
<div class="scoretext">非常不满意</div>
</div>
<div class="name" style="margin-bottom: 20px;">
<div class="name" style="margin-bottom: 20px">
<div class="namebox">
<img
class="nameimg"
@@ -229,27 +229,31 @@
/>
<div class="inname">配置权重</div>
</div>
<div class="in" style="display:flex">
<div class="in" style="display: flex">
<div class="assess">
<div class="assesstype">评估类型</div>
<div class="assesswhole">整体评估</div>
</div>
<div class="assess" style="margin-left: 50px;position: relative">
<div class="assess" style="margin-left: 50px; position: relative">
<div class="assesstype">权重比例</div>
<div class="assesswhole" style="background: #FFFFFF">20</div>
<div class="assesswhole" style="background: #ffffff">20</div>
<div class="ratio">%</div>
</div>
</div>
</div>
</div>
<div class="opinion name2">
<div class="namebox">
<div class="inname" style="margin-top: 13px">您的其他意见</div>
</div>
<div class="in">
<a-textarea v-model:value="valuep" style="height: 110px" show-count
:maxlength="200"/>
</div>
<div class="namebox">
<div class="inname" style="margin-top: 13px">您的其他意见</div>
</div>
<div class="in">
<a-textarea
v-model:value="valuep"
style="height: 110px"
show-count
:maxlength="200"
/>
</div>
</div>
<div class="footer">
<div class="btn">
@@ -449,15 +453,15 @@ export default {
align-items: center;
margin-left: 41px;
.addtypen {
color: #6F6F6F;
color: #6f6f6f;
font-size: 14px;
}
.types {
cursor: pointer;
width: 80px;
height: 40px;
color: #409EFF;
border: 1px solid #409EFF;
color: #409eff;
border: 1px solid #409eff;
border-radius: 4px;
display: flex;
justify-content: center;
@@ -497,11 +501,11 @@ export default {
height: 40px;
margin-top: 20px;
margin-right: 30px;
border: 1px solid #409EFF;
border: 1px solid #409eff;
border-radius: 8px;
cursor: pointer;
.del_text {
color: #409EFF;
color: #409eff;
font-size: 14px;
margin-left: 5px;
}
@@ -589,7 +593,7 @@ export default {
}
}
.inname {
color: #6F6F6F;
color: #6f6f6f;
font-size: 14px;
margin-left: 7px;
font-weight: 700;
@@ -601,12 +605,12 @@ export default {
display: flex;
width: 226px;
height: 40px;
border: 1px solid #56A3F9;
border: 1px solid #56a3f9;
//margin-bottom: 20px;
.assesstype {
width: 50%;
background: #56A3F9;
color: #FFFFFF;
background: #56a3f9;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
@@ -615,7 +619,7 @@ export default {
width: 50%;
background: rgba(86, 163, 249, 0.1);
font-size: 14px;
color: #6F6F6F;
color: #6f6f6f;
display: flex;
justify-content: center;
align-items: center;
@@ -624,7 +628,7 @@ export default {
position: absolute;
right: 10px;
top: 8px;
color: #6F6F6F;
color: #6f6f6f;
font-size: 14px;
}
}
@@ -645,7 +649,6 @@ export default {
// height: 120%;
width: 100%;
height: 35px;
}
.ant-select-selector {
border-radius: 5px;
@@ -668,36 +671,36 @@ export default {
}
}
.name2 {
display: flex;
align-items: flex-start;
}
.opinion {
display: flex;
margin-top: 30px;
.namebox {
width: 120px;
display: flex;
align-items: flex-start;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
}
.opinion {
display: flex;
margin-top: 30px;
.namebox {
width: 120px;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
.in {
margin-left: 14px;
width: 500px;
.ant-input-textarea-show-count {
position: relative;
height: 110px;
}
.in {
margin-left: 14px;
width: 500px;
.ant-input-textarea-show-count {
position: relative;
height: 110px;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
.ant-input-textarea-show-count::after {
position: absolute;
right: 10px;
bottom: 0px;
}
.ant-input {
border-radius: 8px;
}
}
}
.footer {
width: 100%;
margin-top: 31px;

View File

@@ -30,9 +30,7 @@
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<!-- <img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
@@ -48,12 +46,12 @@ import { reactive, toRefs } from "vue";
import AddVote from "../../components/drawers/AddVote";
// import { PlusOutlined, LoadingOutlined } from "@ant-design/icons-vue";
import { message } from "ant-design-vue";
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener("load", () => callback(reader.result));
reader.readAsDataURL(img);
}
import * as api from "../../api/index1";
// function getBase64(img, callback) {
// const reader = new FileReader();
// reader.addEventListener("load", () => callback(reader.result));
// reader.readAsDataURL(img);
// }
export default {
name: "SystemManage",
components: {
@@ -78,16 +76,29 @@ export default {
};
const handleChange = (info) => {
if (info.file.status === "uploading") {
console.log("uploading", info.file);
state.loading = true;
return;
}
if (info.file.status === "done") {
console.log("done", info.file);
let obj = {
file: info.file,
};
api
.uploadFile(obj)
.then((res) => {
console.log("res", res);
})
.then((err) => {
console.log("err", err);
});
// Get this url from response in real world.
getBase64(info.file.originFileObj, (base64Url) => {
state.imageUrl = base64Url;
state.loading = false;
});
// getBase64(info.file.originFileObj, (base64Url) => {
// state.imageUrl = base64Url;
// state.loading = false;
// });
}
if (info.file.status === "error") {
@@ -97,6 +108,7 @@ export default {
};
const beforeUpload = (file) => {
console.log("file", file);
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
@@ -109,8 +121,25 @@ export default {
if (!isLt2M) {
message.error("Image must smaller than 2MB!");
}
return isJpgOrPng && isLt2M;
if (isJpgOrPng && isLt2M) {
let obj = {
file: file,
};
api
.uploadFile(obj)
.then((res) => {
console.log("res", res);
})
.then((err) => {
console.log("err", err);
});
// Get this url from response in real world.
// getBase64(info.file.originFileObj, (base64Url) => {
// state.imageUrl = base64Url;
// state.loading = false;
// });
}
// return isJpgOrPng && isLt2M;
};
return {