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

@@ -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,
};
},
};