mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
style:投票页面修改
This commit is contained in:
@@ -55,7 +55,12 @@ export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvalua
|
||||
|
||||
//根据ID获取测评信息详情
|
||||
export const queryEvaluationDetailById = (obj) =>
|
||||
http.post("/evaluation/queryEvaluationDetailById", { params: obj });
|
||||
http.post("/evaluation/queryEvaluationDetailById", obj,{
|
||||
headers: {
|
||||
'token': '123',
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
}
|
||||
});
|
||||
|
||||
//修改测评信息
|
||||
export const updateEvaluation = (obj) =>
|
||||
@@ -68,3 +73,11 @@ export const updateEvaluation = (obj) =>
|
||||
// }).catch(err => {
|
||||
// console.log(err)
|
||||
// })
|
||||
//根据name获取测评信息详情
|
||||
export const getEvalListByName = (obj) =>
|
||||
http.post("/evaluation/queryEvaluationDetailById", obj,{
|
||||
headers: {
|
||||
'token': '123',
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
}
|
||||
});
|
||||
@@ -9,8 +9,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div v-if="edit" class="headerTitle">编辑测评</div>
|
||||
<div v-else class="headerTitle">添加测评</div>
|
||||
<div class="headerTitle">{{edit?'编辑':'添加'}}测评</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -49,12 +48,17 @@
|
||||
<span style="margin-right: 3px">选择测评:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="inputV2"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入名称或编码后选择"
|
||||
<button class="checkEval" @click="showEvalDrawer">选择测评</button>
|
||||
</div>
|
||||
<div>
|
||||
<div><EvList
|
||||
v-model:EvalListVisible="EvalListVisible"
|
||||
v-model:evaluationTypeId="evaluationTypeId"
|
||||
v-model:evaluationTypeName="evaluationTypeName"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
@@ -71,29 +75,11 @@
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">图片:</span>
|
||||
<span style="margin-right: 3px">测评说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-upload
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
list-type="picture-card"
|
||||
class="avatar-uploader"
|
||||
:show-upload-list="false"
|
||||
action="/api/file/upload"
|
||||
:before-upload="beforeUpload"
|
||||
@change="handleChange"
|
||||
>
|
||||
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
|
||||
<div v-else>
|
||||
<loading-outlined v-if="loading"></loading-outlined>
|
||||
<plus-outlined v-else></plus-outlined>
|
||||
<div class="ant-upload-text">Upload</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
<span style="padding-bottom: 20px; color: #878b92"
|
||||
>图片格式为JPG/PNG 图片大小不可超过1MB</span
|
||||
>
|
||||
<a-textarea v-model:value="description" placeholder="请输入测评说明" style="width:424px; height: 120px;" allowClear/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,30 +95,32 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { reactive, toRefs } from "vue";
|
||||
// import { useRouter } from "vue-router";
|
||||
import EvList from "./EvList.vue";
|
||||
import * as api from "../../api/indexEval";
|
||||
import * as apitaskadd from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import { toDate } from "../../api/method";
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
import dayjs from 'dayjs';
|
||||
// const router = useRouter();
|
||||
export default {
|
||||
name: "AddEval",
|
||||
// components: {
|
||||
// },
|
||||
components: {
|
||||
EvList,
|
||||
},
|
||||
props: {
|
||||
addevalVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
learn: {
|
||||
EditEvalId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
@@ -142,7 +130,15 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
isactive: {
|
||||
routerTaskId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -150,9 +146,9 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
EditEvalId: {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: 147,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
@@ -160,15 +156,11 @@ export default {
|
||||
inputV1: "",
|
||||
inputV2: "",
|
||||
time: undefined,
|
||||
endTimes: "",
|
||||
startTimes: "",
|
||||
picUrl: "",
|
||||
tableData: [],
|
||||
deletePathId: null, //删除路径id
|
||||
editPathId: null, //修改路径id
|
||||
currentPage: 1, //当前页
|
||||
tableDataTotal: -1, //学习路径列表总数
|
||||
pageSize: 10, //每页10条数据
|
||||
EvalId: null,
|
||||
evaluationTypeId:null,
|
||||
evaluationTypeName:"",
|
||||
description:"",
|
||||
EvalListVisible:false,
|
||||
// addLoading:false,
|
||||
});
|
||||
|
||||
@@ -179,54 +171,63 @@ export default {
|
||||
state.inputV2 = "";
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
if(props.edit && bool){
|
||||
queryEval();
|
||||
}
|
||||
};
|
||||
//上传组件
|
||||
function getBase64(img, callback) {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener("load", () => callback(reader.result));
|
||||
reader.readAsDataURL(img);
|
||||
}
|
||||
|
||||
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") {
|
||||
console.log("上传图片返回的信息 %o", info);
|
||||
state.picUrl = info.file.response.data;
|
||||
// Get this url from response in real world.
|
||||
getBase64(info.file.originFileObj, (base64Url) => {
|
||||
imageUrl.value = base64Url;
|
||||
loading.value = false;
|
||||
const showEvalDrawer = () =>{
|
||||
state.EvalListVisible = true;
|
||||
console.log("进来了吗");
|
||||
};
|
||||
const queryEval = () =>{
|
||||
api
|
||||
.queryEvaluationDetailById({evaluationId:props.evaluationId})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data.data);
|
||||
state.inputV1 = res.data.data.evaluationName;
|
||||
state.time = [dayjs(res.data.data.evaluationStartTime, "YYYY-MM-DD"), dayjs(res.data.data.evaluationEndTime, "YYYY-MM-DD")];
|
||||
state.evaluationTypeId = res.data.data.evaluationTypeId;
|
||||
state.evaluationTypeName =res.data.data.evaluationTypeName;
|
||||
//state.description =
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
if (info.file.status === "error") {
|
||||
loading.value = false;
|
||||
message.error("upload error");
|
||||
const updateTask = (res)=>{
|
||||
if(props.isLevel){
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 10,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}else{
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 10,
|
||||
}).then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
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 < 1;
|
||||
if (!isLt2M) {
|
||||
message.error("Image must smaller than 1MB!");
|
||||
}
|
||||
return isJpgOrPng && isLt2M;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//创建或编辑测评信息
|
||||
const createEvalText = () => {
|
||||
if (!state.inputV1) {
|
||||
@@ -237,128 +238,43 @@ export default {
|
||||
message.destroy();
|
||||
return message.info("请选择测评");
|
||||
}
|
||||
if (state.time != undefined) {
|
||||
state.endTimes = toDate(
|
||||
new Date(state.time[0].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
state.startTimes = toDate(
|
||||
new Date(state.time[1].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
if (!state.time) {
|
||||
message.destroy();
|
||||
return message.warning("请输入直播时间");
|
||||
}
|
||||
|
||||
let obj = {
|
||||
evaluationName: state.inputV1,
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
evaluationEndTime: state.endTimes,
|
||||
evaluationFlag: "",
|
||||
evaluationId: 0,
|
||||
evaluationPictureAddress: "",
|
||||
evaluationStartTime: state.startTimes,
|
||||
evaluationTag: "",
|
||||
evaluationTypeId: 0,
|
||||
evaluationTypeName: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
evaluationEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"),
|
||||
evaluationId: props.edit?props.evaluationId:0,
|
||||
evaluationStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"),
|
||||
evaluationTypeId:state.evaluationTypeId,
|
||||
evaluationTypeName:state.evaluationTypeName,
|
||||
//state.description
|
||||
};
|
||||
let objedit = {
|
||||
createTime: "",
|
||||
createUser: 0,
|
||||
evaluationEndTime: "",
|
||||
evaluationFlag: "",
|
||||
evaluationId: props.EditEvalId == null ? 0 : props.EditEvalId,
|
||||
evaluationName: state.inputV1,
|
||||
evaluationPictureAddress: "",
|
||||
evaluationStartTime: "",
|
||||
evaluationTag: "",
|
||||
evaluationTypeId: 0,
|
||||
evaluationTypeName: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
};
|
||||
let queryobj = {
|
||||
evaluationId:props.EditEvalId
|
||||
}
|
||||
console.log(queryobj,'ssssssssss');
|
||||
if (props.edit == false) {
|
||||
if(props.edit){
|
||||
api
|
||||
.createEvaluation(obj)
|
||||
.then((res) => {
|
||||
console.log("创建成功", res);
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
//渲染到项目列表
|
||||
if (props.learn == 0)
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: res.data.data.evaluationId,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.evaluationName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 10,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//自定义事件给父组件传值
|
||||
ctx.emit("changeData", false);
|
||||
//重新获取任务列表
|
||||
// apiTask.getTask({ projectId: 28 });
|
||||
// router.push("/taskadd");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
//渲染到学历路径
|
||||
else {
|
||||
let editObj1 = {
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.evaluationId,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.evaluationName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: 0,
|
||||
type: 10,
|
||||
};
|
||||
RouterEditTask(editObj1)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
// state.createLoading = false;
|
||||
});
|
||||
}
|
||||
else {
|
||||
}else{
|
||||
api
|
||||
.queryEvaluationDetailById(queryobj)
|
||||
.updateEvaluation(obj)
|
||||
.then((res) => {
|
||||
setTimeout(() => {
|
||||
console.log("获取成功", res,objedit.evaluationId);
|
||||
message.success("获取成功");
|
||||
|
||||
}, 1000);
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取失败", err);
|
||||
});
|
||||
api
|
||||
.updateEvaluation(objedit)
|
||||
.then((res) => {
|
||||
setTimeout(() => {
|
||||
console.log("修改成功", res);
|
||||
message.success("修改成功");
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("修改失败", err);
|
||||
// state.createLoading = false;
|
||||
//重新获取列表
|
||||
// getTask();
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -369,12 +285,8 @@ export default {
|
||||
closeDrawer,
|
||||
//增改
|
||||
createEvalText,
|
||||
//上传组件
|
||||
fileList,
|
||||
loading,
|
||||
imageUrl,
|
||||
handleChange,
|
||||
beforeUpload,
|
||||
showEvalDrawer,
|
||||
updateTask,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -424,14 +336,14 @@ export default {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
.xkbtn {
|
||||
.checkEval {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #388be1;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
@@ -475,7 +387,7 @@ export default {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #388be1;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 16px 8px 32px 0;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
<div class="btns" @click="searchInvist">
|
||||
<div class="btns" @click="getAllInvistText">
|
||||
<div class="search"></div>
|
||||
<div class="btnText">搜索</div>
|
||||
</div>
|
||||
@@ -59,6 +59,7 @@
|
||||
:current="currentPage"
|
||||
:total="tableDataTotal"
|
||||
class="pagination"
|
||||
@change="handelChangePage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,17 +67,17 @@
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="createInvist">确定</button>
|
||||
<button class="btn2" @click="updateTask">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, onMounted } from "vue";
|
||||
import * as api from "../../api/indexInvist";
|
||||
import * as apitaskadd from "../../api/indexTaskadd";
|
||||
import * as api from "../../api/indexInvist.js";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import { toDate } from "../../api/method";
|
||||
import dayjs from "dayjs";
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
export default {
|
||||
name: "AddInvist",
|
||||
@@ -87,13 +88,13 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
learn: {
|
||||
EditInvistId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
@@ -103,6 +104,27 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerTaskId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
@@ -110,16 +132,15 @@ export default {
|
||||
time: undefined,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
tableDataTotal: -1,
|
||||
tableDataTotal: 0,
|
||||
tableData: [
|
||||
// {
|
||||
// key: 1,
|
||||
// name: "评估",
|
||||
// num: "2",
|
||||
// creator: "管理员",
|
||||
// time: "2022-07-21 14:30:25",
|
||||
// },
|
||||
|
||||
],
|
||||
assessmentId:null,
|
||||
assessmentName:"",
|
||||
|
||||
|
||||
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addinvistVisible", false);
|
||||
@@ -139,23 +160,6 @@ export default {
|
||||
width: "150px",
|
||||
align: "left",
|
||||
className: "classify",
|
||||
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: (text) => {
|
||||
// console.log(text.record.checked1);
|
||||
return (
|
||||
<div class="racona">
|
||||
<span> {text.record.name}</span>
|
||||
|
||||
{/**
|
||||
<div class="img"></div>
|
||||
<a-checkbox class="ch" checked={text.record.checkedd}>
|
||||
{text.record.lei}
|
||||
</a-checkbox>
|
||||
*/}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "题数",
|
||||
@@ -183,48 +187,31 @@ export default {
|
||||
};
|
||||
const rowSelection = {
|
||||
type: "radio",
|
||||
// onChange: (selectedRowKeys, selectedRows) => {
|
||||
// this.selectedRowKeys = selectedRowKeys
|
||||
// if (selectedRows.length > 1) {
|
||||
// //获取选中的数据的key
|
||||
// var selectNumber = this.selectedRowKeys[1]
|
||||
// //清空选中的key
|
||||
// this.selectedRowKeys = []
|
||||
// //选中的数据的key重新赋值给selectedRowKeys
|
||||
// this.selectedRowKeys.push(selectNumber)
|
||||
// }
|
||||
// },
|
||||
// getCheckboxProps: (record) => ({
|
||||
// // disabled: record.name === 'Disabled User',
|
||||
// // // Column configuration not to be checked
|
||||
// name: record.name,
|
||||
// }),
|
||||
onSelect: (selectedRows, selected, selectedRowKeys) => {
|
||||
console.log(
|
||||
"selectedRowKeys",
|
||||
selectedRowKeys,
|
||||
"selectedRows",
|
||||
selectedRows,
|
||||
"selected",
|
||||
selected
|
||||
);
|
||||
"selectedRowKeys",selectedRowKeys,"selectedRows",selectedRows, "selected",selected );
|
||||
console.log(selectedRows.assessmentId);
|
||||
state.assessmentId =selectedRows.assessmentId;
|
||||
state.assessmentName = selectedRows.name;
|
||||
},
|
||||
};
|
||||
|
||||
};
|
||||
const handelChangePage = (page, pageSize) => {
|
||||
state.currentPage = page;
|
||||
state.pageSize = pageSize;
|
||||
getAllInvistText();
|
||||
};
|
||||
const getTableDate = (tableData) => {
|
||||
let data = tableData;
|
||||
let array = [];
|
||||
data.map((value, index) => {
|
||||
// console.log("123", value);
|
||||
let obj = {
|
||||
// id: value.routerId,
|
||||
key: index,
|
||||
assessmentId:value.assessmentId,
|
||||
num: value.essayQuestionVoList.length,
|
||||
name: value.assessmentName ? value.assessmentName : "-",
|
||||
creator: value.createUser ? value.createUser : "-",
|
||||
time: value.createTime
|
||||
? toDate(new Date(value.createTime).getTime() / 1000, "Y-M-D h:m:s")
|
||||
: "-",
|
||||
time: dayjs(value.createTime).format("YYYY-MM-DD"),
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
@@ -232,169 +219,73 @@ export default {
|
||||
};
|
||||
//获取全部评估信息接口
|
||||
const getAllInvistText = () => {
|
||||
let obj = {
|
||||
assessmentName: "",
|
||||
|
||||
api
|
||||
.queryAssessmentDetailList({
|
||||
assessmentName:state.inputV1,
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
releaseStatus: "",
|
||||
searchEndTime: "",
|
||||
searchStartTime: "",
|
||||
};
|
||||
api
|
||||
.queryAssessmentDetailList(obj)
|
||||
})
|
||||
.then((res) => {
|
||||
let arr = res.data.data.rows;
|
||||
if (res.status === 200) {
|
||||
// console.log("获取全部评估信息", res.data.data);
|
||||
let arr = res.data.data.rows;
|
||||
if (
|
||||
arr.length === 0 &&
|
||||
res.data.data.total > 0 &&
|
||||
state.currentPage > 1
|
||||
) {
|
||||
state.currentPage = state.currentPage - 1;
|
||||
getAllInvistText();
|
||||
}
|
||||
getTableDate(arr);
|
||||
state.tableDataTotal = Number(res.data.data.total);
|
||||
}
|
||||
// console.log("获取全部评估信息接口成功", res);
|
||||
// message.success("获取全部评估信息接口成功");
|
||||
// console.log(obj);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取全部评估信息接口失败", err);
|
||||
// state.createLoading = false;
|
||||
});
|
||||
};
|
||||
//创建评估信息
|
||||
const createInvist = () => {
|
||||
let obj = {
|
||||
appraiseName: state.inputV1,
|
||||
appraiseEndTime: "",
|
||||
appraiseExplain: "",
|
||||
appraiseFlag: "",
|
||||
appraiseId: 0,
|
||||
appraiseStartTime: "",
|
||||
appraiseTag: "",
|
||||
createUser: 0,
|
||||
researchId: 0,
|
||||
researchName: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
};
|
||||
api
|
||||
.createAppraiseMessage(obj)
|
||||
const updateTask =()=>{
|
||||
console.log("jinlaile=================",state.assessmentName)
|
||||
if(props.isLevel){
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("创建成功", res);
|
||||
message.success("创建成功");
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
getAllInvistText();
|
||||
if (props.learn == 0)
|
||||
apitaskadd
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
}else{
|
||||
console.log("=========projectTaskId",props.projectTaskId);
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.appraiseName,
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//自定义事件给父组件传值
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
//重新获取任务列表
|
||||
// apiTask.getTask({ projectId: 28 });
|
||||
// router.push("/taskadd");
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err, 111111);
|
||||
});
|
||||
else {
|
||||
let editObj1 = {
|
||||
chapterId: 36,
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.appraiseName,
|
||||
routerId: 92,
|
||||
routerTaskId: 0,
|
||||
type: 11,
|
||||
};
|
||||
RouterEditTask(editObj1);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
// state.createLoading = false;
|
||||
});
|
||||
};
|
||||
//搜索评估信息接口
|
||||
const searchInvist = () => {
|
||||
let objsearch = {
|
||||
assessmentName: state.inputV1,
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
releaseStatus: "",
|
||||
searchEndTime: "",
|
||||
searchStartTime: "",
|
||||
};
|
||||
api
|
||||
.queryAssessmentDetailList(objsearch)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
console.log("获取搜索的评估信息", res.data.data);
|
||||
let arr = res.data.data.rows;
|
||||
if (
|
||||
arr.length === 0 &&
|
||||
res.data.data.total > 0 &&
|
||||
state.currentPage > 1
|
||||
) {
|
||||
state.currentPage = state.currentPage - 1;
|
||||
getAllInvistText();
|
||||
}
|
||||
getTableDate(arr);
|
||||
state.tableDataTotal = Number(res.data.data.total);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取全部评估信息接口失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
//重置评估信息
|
||||
const resetInvist = () => {
|
||||
state.inputV1 = "";
|
||||
let objreset = {
|
||||
assessmentName: state.inputV1,
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
releaseStatus: "",
|
||||
searchEndTime: "",
|
||||
searchStartTime: "",
|
||||
};
|
||||
api
|
||||
.queryAssessmentDetailList(objreset)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
console.log("获取重置后的评估信息", res.data.data);
|
||||
let arr = res.data.data.rows;
|
||||
if (
|
||||
arr.length === 0 &&
|
||||
res.data.data.total > 0 &&
|
||||
state.currentPage > 1
|
||||
) {
|
||||
state.currentPage = state.currentPage - 1;
|
||||
getAllInvistText();
|
||||
}
|
||||
getTableDate(arr);
|
||||
state.tableDataTotal = Number(res.data.data.total);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("获取重置的评估信息接口失败", err);
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
// createInvist();
|
||||
@@ -406,10 +297,10 @@ export default {
|
||||
closeDrawer,
|
||||
tableDataFunc,
|
||||
rowSelection,
|
||||
createInvist,
|
||||
getAllInvistText,
|
||||
searchInvist,
|
||||
updateTask,
|
||||
resetInvist,
|
||||
handelChangePage,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -328,8 +328,6 @@ const rowSelection = ref({
|
||||
});
|
||||
export default {
|
||||
name: "AddLive",
|
||||
// components: {
|
||||
// },
|
||||
props: {
|
||||
addliveVisible: {
|
||||
type: Boolean,
|
||||
@@ -360,10 +358,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
EditWorkId: { // 要编辑的workId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
@@ -381,89 +375,6 @@ export default {
|
||||
setup(props, ctx) {
|
||||
// const router = useRouter();
|
||||
const state = reactive({
|
||||
tableData1: [
|
||||
{
|
||||
key: "1",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "通用力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
num: "JDF2022071100001",
|
||||
name: "管理能力课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
num: "JDF2022071100001",
|
||||
name: "快速换模SMED",
|
||||
content: "通用力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
num: "JDF2022071100001",
|
||||
name: "巧妙对话人见人夸",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "5",
|
||||
num: "JDF2022071100001",
|
||||
name: "管理能力课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "6",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "7",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "8",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "9",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
],
|
||||
currentPage: 1,
|
||||
tableDataTotal: 100,
|
||||
pageSize: 10,
|
||||
@@ -646,18 +557,7 @@ export default {
|
||||
message.destroy();
|
||||
return message.warning("直播时长需大于0");
|
||||
}
|
||||
const reg = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
||||
if (!reg.test(state.inputV3)) {
|
||||
message.destroy();
|
||||
return message.warning("请输入有效直播链接地址");
|
||||
}
|
||||
if (!reg.test(state.inputV5)) {
|
||||
message.destroy();
|
||||
return message.warning("请输入有效回放地址");
|
||||
}
|
||||
//if (!state.inputV3) return message.warning("请输入授课老师");
|
||||
|
||||
//let check = state.checkedC2 ;
|
||||
let startTime = toDate(
|
||||
new Date(state.time[0].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
|
||||
@@ -1,488 +0,0 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="crevoteVisible"
|
||||
class="drawerStyle crevoteDrawer"
|
||||
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_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="请输入投票名称"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box" @click="showDrawerCreVote">
|
||||
<button class="cjtpbtn" @click="addQue()">创建题干</button>
|
||||
</div>
|
||||
<div class="queBox" v-for="(q, index) in questions" :key="index">
|
||||
<div class="delBtn" v-if="questions.length > 1">
|
||||
<img src="@/assets/images/projectadd/delete.png" alt="" />
|
||||
<div class="btnText">删除题干</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"
|
||||
>{{ q.stemTit }}{{ index + 1 }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="q.inputV"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入题干"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="option" v-for="(o, index) in q.options" :key="index">
|
||||
<div class="mainoptions">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">{{ o.title }}{{index+1}}</span>
|
||||
</div>
|
||||
<div class="optionbox">
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="o.opvalue"
|
||||
style="width: 424px; height: 32px"
|
||||
/>
|
||||
<button v-if="q.options.length > 2" class="delbtn" :key="index" @click="delOpt(q.options)">
|
||||
删除
|
||||
</button>
|
||||
</div>
|
||||
<a-button type="link">+ 上传图片</a-button>
|
||||
<!-- <input class="file-upload" type="file" accept="image/*" name="picture"/> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox"></div>
|
||||
<div class="btnbox">
|
||||
<div class="tjxxbtn" @click="addOpt(q.options)">
|
||||
<div class="btntext">添加选项</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1">取消</button>
|
||||
<button class="btn2" @click="createQueTit">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
import * as api from "../../api/indexVote";
|
||||
import { message } from "ant-design-vue";
|
||||
export default {
|
||||
name: "CreVote",
|
||||
props: {
|
||||
crevoteVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
creVote: true,
|
||||
questions: [
|
||||
{
|
||||
stemTit: "题干",
|
||||
inputV: "",
|
||||
options: [
|
||||
{
|
||||
title: "选项",
|
||||
opvalue: "",
|
||||
},
|
||||
{
|
||||
title: "选项",
|
||||
opvalue: "",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
const addQue = () => {
|
||||
state.questions.push({
|
||||
stemTit: "题干",
|
||||
inputV: "",
|
||||
options: [
|
||||
{
|
||||
title: "选项",
|
||||
opvalue: "",
|
||||
},
|
||||
{
|
||||
title: "选项",
|
||||
opvalue: "",
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
const addOpt = (value) => {
|
||||
console.log(value);
|
||||
value.push({
|
||||
// title: "选项" + (value.length + 1 * 1),
|
||||
title: "选项",
|
||||
opvalue: "",
|
||||
});
|
||||
};
|
||||
const delOpt = (value) => {
|
||||
console.log('gys', value);
|
||||
// delete value[0]
|
||||
value.pop()
|
||||
}
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:crevoteVisible", false);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
|
||||
//创建题干接口
|
||||
const createQueTit = () => {
|
||||
if (state.inputV1 == "") {
|
||||
message.destroy();
|
||||
return message.info("请输入投票名称");
|
||||
}
|
||||
// if (!state.questions.inputV) {
|
||||
// message.destroy();
|
||||
// return message.info("请输入题干");
|
||||
// }
|
||||
// if (!state.questions.optins.opvalue) {
|
||||
// message.destroy();
|
||||
// return message.info("请输入选项");
|
||||
// }
|
||||
console.log("111111", state.questions);
|
||||
// console.log('22222',state.questions.inputV);
|
||||
// console.log('333333',state.questions.options);
|
||||
let obj = [
|
||||
{
|
||||
ascriptionId: 0,
|
||||
createUser: 0,
|
||||
optionDetailList: [
|
||||
{
|
||||
createUser: 0,
|
||||
optionId: 0,
|
||||
optionName: state.questions[0].options[0].opvalue,
|
||||
optionOrderNum: "",
|
||||
optionPictureAddress: "",
|
||||
stem: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
voteStemId: 0,
|
||||
},
|
||||
],
|
||||
orderNumber: "",
|
||||
updateTime: "",
|
||||
updateUser: 0,
|
||||
voteStemFlag: "",
|
||||
voteStemId: 0,
|
||||
voteStemName: state.questions[0].inputV,
|
||||
},
|
||||
];
|
||||
api
|
||||
.createOptionMessage(obj)
|
||||
.then((res) => {
|
||||
console.log("创建成功", res);
|
||||
// console.log('res.data.data[0].ascriptionId',res.data.data[0].ascriptionId);
|
||||
// console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId);
|
||||
// console.log('state.questions[0].inputV',state.questions[0].inputV);
|
||||
message.success("创建成功");
|
||||
//获取题干信息
|
||||
let objstem = {
|
||||
stemId: res.data.data[0].ascriptionId,
|
||||
ascriptionId: res.data.data[0].voteStemId,
|
||||
};
|
||||
api
|
||||
.queryStemByStemId(objstem)
|
||||
.then((res) => {
|
||||
console.log("获取成功", res);
|
||||
message.success("获取成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
let stemData = {
|
||||
creVote: state.creVote,
|
||||
ascriptionId: res.data.data[0].ascriptionId,
|
||||
voteStemId: res.data.data[0].voteStemId,
|
||||
voteStemName: state.questions[0].inputV,
|
||||
};
|
||||
ctx.emit("getData", stemData);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
addQue,
|
||||
addOpt,
|
||||
delOpt,
|
||||
createQueTit,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
.crevoteDrawer {
|
||||
.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 {
|
||||
.box {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
.cjtpbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #388be1;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-right: 5px;
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.mainoptions {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
padding-top: 5px;
|
||||
margin-right: 5px;
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.optionbox {
|
||||
.btnbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.delbtn {
|
||||
border: none;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.queBox {
|
||||
border: 1px solid #e8e8e8;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
|
||||
padding-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
.delBtn {
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 20px;
|
||||
img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.main_item {
|
||||
display: flex;
|
||||
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;
|
||||
.tjxxbtn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #388be1;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
.btntext {
|
||||
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>
|
||||
|
||||
529
src/components/drawers/EvList.vue
Normal file
529
src/components/drawers/EvList.vue
Normal file
@@ -0,0 +1,529 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="EvalListVisible"
|
||||
class="drawerStyle addonlineDrawer"
|
||||
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_items">
|
||||
<div class="mi_ipts">
|
||||
<div class="mii_ipt">
|
||||
<div class="ipt_name">测评信息:</div>
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
v-model:value="value1"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入项目名称"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mi_btns">
|
||||
<div class="btn btn1">
|
||||
<div class="search"></div>
|
||||
<div class="btnText">搜索</div>
|
||||
</div>
|
||||
<div class="btn btn2">
|
||||
<div class="search"></div>
|
||||
<div class="btnText">重置</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_table">
|
||||
<a-table
|
||||
style="border: 1px solid #f2f6fe"
|
||||
:columns="tablecolumns"
|
||||
:data-source="tabledata"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
expandRowByClick="true"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
columnWidth: 30,
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
/>
|
||||
<div class="pa">
|
||||
<a-pagination
|
||||
v-if="total > 10"
|
||||
showSizeChanger="true"
|
||||
showQuickJumper="true"
|
||||
hideOnSinglePage="true"
|
||||
:pageSize="pageSize"
|
||||
:current="currentPage"
|
||||
:total="total"
|
||||
class="pagination"
|
||||
@change="changePagination"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="checkFinish">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import * as api from "../../api/indexEval";
|
||||
export default {
|
||||
name: "EvList",
|
||||
props: {
|
||||
EvalListVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
evaluationTypeId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
evaluationTypeName:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
tableData1: [
|
||||
{
|
||||
key: "1",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "通用力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
num: "JDF2022071100001",
|
||||
name: "管理能力课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
num: "JDF2022071100001",
|
||||
name: "快速换模SMED",
|
||||
content: "通用力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
num: "JDF2022071100001",
|
||||
name: "巧妙对话人见人夸",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "5",
|
||||
num: "JDF2022071100001",
|
||||
name: "管理能力课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "6",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "7",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "8",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
{
|
||||
key: "9",
|
||||
num: "JDF2022071100001",
|
||||
name: "时间管理课程",
|
||||
content: "领导力",
|
||||
teacher: "BOE教师",
|
||||
creator: "管理员",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
],
|
||||
currentPage: 1,
|
||||
tableDataTotal: 100,
|
||||
pageSize: 10,
|
||||
vlue1:"",
|
||||
tabledata: [
|
||||
],
|
||||
});
|
||||
const options1 = ref([
|
||||
{
|
||||
value: "value1",
|
||||
label: "请选择状态",
|
||||
},
|
||||
]);
|
||||
const columns1 = [
|
||||
{
|
||||
title: "课程编号",
|
||||
width: "20%",
|
||||
dataIndex: "num",
|
||||
key: "num",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "title",
|
||||
width: "20%",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
width: "13%",
|
||||
dataIndex: "content",
|
||||
key: "content",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
width: "13%",
|
||||
dataIndex: "teacher",
|
||||
key: "teacher",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
width: "13%",
|
||||
dataIndex: "creator",
|
||||
key: "creator",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "可答题人数",
|
||||
width: "20%",
|
||||
dataIndex: "time",
|
||||
key: "time",
|
||||
align: "center",
|
||||
},
|
||||
];
|
||||
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);
|
||||
},
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:EvalListVisible", false);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
getEvalList();
|
||||
};
|
||||
const checkFinish =() =>{
|
||||
ctx.emit("update:evaluationTypeId", state.evaluationTypeId);
|
||||
ctx.emit("update:evaluationTypeName", state.evaluationTypeName);
|
||||
closeDrawer();
|
||||
}
|
||||
const changePagination = (page) => {
|
||||
state.currentPage = page;
|
||||
getEvalList();
|
||||
};
|
||||
const getTableDataList = (tableData) => {
|
||||
let data = tableData;
|
||||
let array = [];
|
||||
data.map((value) => {
|
||||
let obj = {
|
||||
key: value.studentId,
|
||||
projectId: value.projectId, //项目id
|
||||
groupId: value.groupId, //小组id
|
||||
group: value.groupName, //小组名
|
||||
studentId: value.studentId, //学生id
|
||||
currentStageId: value.currentStageId, //当前关卡id
|
||||
name: value.name, //用户名
|
||||
bum: value.userInfoBo.deptName, //部门
|
||||
gangw: value.userInfoBo.jobName, //岗位
|
||||
completeStageCnt: value.completeStageCnt, //当前完成阶段数
|
||||
totalStageCnt: value.totalStageCnt, //总阶段数
|
||||
progress: value.completeStageCnt + "/" + value.totalStageCnt,
|
||||
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
state.tabledata = array;
|
||||
};
|
||||
const getEvalList =(o)=>{
|
||||
let obj = o || {
|
||||
evaluationTypeName:state.value1
|
||||
}
|
||||
api
|
||||
.getEvalListByName(obj).then((res) => {
|
||||
|
||||
console.log(res.data.data, "获取测评");
|
||||
let leng = res.data.data.rows.length;
|
||||
state.total = res.data.data.total;
|
||||
if (leng > 0) {
|
||||
let arr = res.data.data.rows;
|
||||
getTableDataList(arr);
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
options1,
|
||||
columns1,
|
||||
rowSelection,
|
||||
checkFinish,
|
||||
changePagination,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
.addonlineDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
.contentMain {
|
||||
padding-right: 12px;
|
||||
.main_items {
|
||||
display: flex;
|
||||
|
||||
margin-bottom: 12px;
|
||||
flex-wrap: wrap;
|
||||
.mi_ipts {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
.mii_ipt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 24px;
|
||||
.ipt_name {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mi_btns {
|
||||
display: flex;
|
||||
margin-left: 38px;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
.btn {
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 14px;
|
||||
flex-shrink: 0;
|
||||
.search {
|
||||
background-size: 100%;
|
||||
}
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
.btn1 {
|
||||
background: rgb(64, 158, 255);
|
||||
.search {
|
||||
width: 15px;
|
||||
height: 17px;
|
||||
background-image: url("@/assets/images/coursewareManage/search0.png");
|
||||
}
|
||||
.btnText {
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
}
|
||||
.btn2 {
|
||||
background: rgb(255, 255, 255);
|
||||
.search {
|
||||
width: 15px;
|
||||
height: 17px;
|
||||
background-image: url("@/assets/images/coursewareManage/reset1.png");
|
||||
}
|
||||
.btnText {
|
||||
color: rgb(64, 158, 255);
|
||||
}
|
||||
}
|
||||
.btn1:hover {
|
||||
background: rgb(255, 255, 255);
|
||||
.search {
|
||||
background-image: url("@/assets/images/courseManage/search1.png");
|
||||
}
|
||||
.btnText {
|
||||
color: #388be1;
|
||||
}
|
||||
}
|
||||
.btn2:hover {
|
||||
background: rgba(64, 158, 255, 1);
|
||||
.search {
|
||||
background-image: url("@/assets/images/courseManage/reset0.png");
|
||||
}
|
||||
.btnText {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.main_notice {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32px;
|
||||
height: 40px;
|
||||
background-color: #e9f6fe;
|
||||
.mntc_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.notice_icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 9px;
|
||||
margin-left: 9px;
|
||||
background-image: url(@/assets/images/coursewareManage/gan.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.mntc_right {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
.classify {
|
||||
margin-left: 10px !important;
|
||||
padding-left: 9px !important;
|
||||
}
|
||||
.ant-checkbox-wrapper {
|
||||
align-items: center;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.ant-table-selection-column {
|
||||
padding: 0px !important;
|
||||
padding-left: 60px !important;
|
||||
}
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: rgba(239, 244, 252, 1);
|
||||
}
|
||||
th.h {
|
||||
background-color: #eff4fc !important;
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
.pa {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
// height: 20px;
|
||||
// background-color: red;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
@@ -9,8 +9,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div v-if="edit" class="headerTitle">编辑投票</div>
|
||||
<div v-else class="headerTitle">添加投票</div>
|
||||
<div class="headerTitle">添加投票任务</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -33,7 +32,7 @@
|
||||
<a-input
|
||||
v-model:value="inputV1"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入投票名称"
|
||||
placeholder="请输入任务名称"
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
@@ -52,14 +51,14 @@
|
||||
<button
|
||||
class="xkbtn"
|
||||
:style="{ display: creVote ? 'none' : 'block' }"
|
||||
@click="showDrawerCreVote"
|
||||
@click="showDrawerCreateVote"
|
||||
>
|
||||
创建投票
|
||||
</button>
|
||||
<button
|
||||
class="xkbtn"
|
||||
:style="{ display: creVote ? 'block' : 'none' }"
|
||||
@click="showDrawerCreVote"
|
||||
@click="showDrawerCreateVote"
|
||||
>
|
||||
编辑投票
|
||||
</button>
|
||||
@@ -72,9 +71,9 @@
|
||||
</div>
|
||||
<!-- 创建投票侧弹窗 -->
|
||||
<div>
|
||||
<cre-vote
|
||||
v-model:crevoteVisible="crevotevisible"
|
||||
@getData="changeVData"
|
||||
<CreateVote
|
||||
v-model:createVoteVisible="createVoteVisible"
|
||||
|
||||
/>
|
||||
</div>
|
||||
<!-- 创建投票侧弹窗 -->
|
||||
@@ -86,6 +85,7 @@
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 424px"
|
||||
v-model:value="time"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
@@ -127,54 +127,33 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import CreVote from "../../components/drawers/CreVote.vue";
|
||||
import { reactive, toRefs} from "vue";
|
||||
import CreateVote from "./CreateVote.vue";
|
||||
import * as api from "../../api/indexVote";
|
||||
import * as apitaskadd from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import { toDate } from "../../api/method";
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
const options1 = ref([
|
||||
{
|
||||
value: "value1",
|
||||
label: "请选择状态",
|
||||
},
|
||||
]);
|
||||
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);
|
||||
},
|
||||
});
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export default {
|
||||
name: "AddVote",
|
||||
components: {
|
||||
CreVote,
|
||||
CreateVote,
|
||||
},
|
||||
props: {
|
||||
addvoteVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
learn: {
|
||||
EditVoteId:{
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
@@ -183,63 +162,56 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerTaskId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
setup(props, ctx) {
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
routerId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
|
||||
},
|
||||
setup(props,ctx) {
|
||||
const state = reactive({
|
||||
inputV1: "",
|
||||
textV1: "",
|
||||
creVote: false,
|
||||
crevotevisible: false,
|
||||
voteName: "",
|
||||
voteExplain: "",
|
||||
createVoteVisible: false,
|
||||
time: undefined,
|
||||
basevote: "",
|
||||
endTimes: "",
|
||||
startTimes: "",
|
||||
ascriptionId: "",
|
||||
voteStemId: "",
|
||||
voteId:"",
|
||||
voteStemName:"",
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
};
|
||||
const showDrawerCreVote = () => {
|
||||
state.crevotevisible = true;
|
||||
const showDrawerCreateVote = () => {
|
||||
state.createVoteVisible = true;
|
||||
console.log("进来了====");
|
||||
};
|
||||
const changeVData = (data) => {
|
||||
console.log("111", data);
|
||||
state.creVote = data.creVote;
|
||||
state.ascriptionId = data.ascriptionId;
|
||||
state.voteStemId = data.voteStemId;
|
||||
state.voteStemName = data.voteStemName;
|
||||
console.log("222", state.creVote);
|
||||
console.log("333", state.ascriptionId);
|
||||
|
||||
};
|
||||
const delBox = () => {
|
||||
state.creVote = false;
|
||||
dleVoteStem()
|
||||
};
|
||||
|
||||
//获取题干信息
|
||||
// const getStemText = () => {
|
||||
// let objstem = {
|
||||
// stemId: state.ascriptionId,
|
||||
// ascriptionId: state.voteStemId,
|
||||
// }
|
||||
// api
|
||||
// .queryStemByStemId(objstem)
|
||||
// .then((res) => {
|
||||
// console.log("获取成功", res);
|
||||
// message.success("获取成功");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// });
|
||||
// }
|
||||
|
||||
//删除题干信息接口
|
||||
const dleVoteStem = () => {
|
||||
let objdelstem = {
|
||||
@@ -251,100 +223,101 @@ export default {
|
||||
message.success('删除题干信息成功')
|
||||
})
|
||||
}
|
||||
//创建投票信息
|
||||
const createVoteText = () => {
|
||||
if (!state.inputV1) {
|
||||
message.destroy();
|
||||
return message.info("请输入投票名称");
|
||||
}
|
||||
|
||||
if (state.basevote == "") {
|
||||
state.basevote = 1;
|
||||
}
|
||||
|
||||
if (state.time != undefined) {
|
||||
state.endTimes = toDate(
|
||||
new Date(state.time[0].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
state.startTimes = toDate(
|
||||
new Date(state.time[1].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
}
|
||||
|
||||
// if (state.crevotevisible = false) {
|
||||
// changeVData()
|
||||
// };
|
||||
|
||||
let obj = {
|
||||
ascriptionId: state.ascriptionId,
|
||||
baseVote: state.basevote,
|
||||
createUser: 0,
|
||||
updateUser: 0,
|
||||
voteEndTime: state.endTimes,
|
||||
voteExplain: state.textV1,
|
||||
voteFlag: "",
|
||||
voteName: state.inputV1,
|
||||
voteStartTime: state.startTimes,
|
||||
voteTag: "",
|
||||
};
|
||||
api
|
||||
.createVote(obj)
|
||||
.then((res) => {
|
||||
console.log("创建成功123", res);
|
||||
message.success("创建成功");
|
||||
ctx.emit("getData", res.data.data.voteId);
|
||||
closeDrawer();
|
||||
if (props.learn == 0)
|
||||
const updteVote = (res) =>{
|
||||
if (props.isLevel)
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.voteName,
|
||||
courseId: res.data.data.voteId,
|
||||
name: res.data.data.voteName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: 0,
|
||||
projectTaskId:props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 12,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
//自定义事件给父组件传值
|
||||
ctx.emit("changeData", false);
|
||||
//重新获取任务列表
|
||||
// apiTask.getTask({ projectId: 28 });
|
||||
// router.push("/taskadd");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
else {
|
||||
let editObj1 = {
|
||||
chapterId: 36,
|
||||
courseId: 0,
|
||||
duration: 0,
|
||||
flag: true,
|
||||
name: obj.voteName,
|
||||
routerId: 92,
|
||||
routerTaskId: 0,
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.voteId,
|
||||
name: res.data.data.voteName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId,
|
||||
type: 12,
|
||||
};
|
||||
RouterEditTask(editObj1);
|
||||
}) .then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
//创建投票信息
|
||||
const createVoteText = () => {
|
||||
if (!state.voteName) {
|
||||
message.destroy();
|
||||
return message.info("请输入投票名称");
|
||||
}
|
||||
if (state.basevote == "") {
|
||||
state.basevote = 1;
|
||||
}
|
||||
if (state.time != undefined) {
|
||||
state.time[0] = toDate(
|
||||
new Date(state.time[0].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
state.time[1] = toDate(
|
||||
new Date(state.time[1].$d).getTime() / 1000,
|
||||
"Y-M-D"
|
||||
);
|
||||
}
|
||||
|
||||
let obj = {
|
||||
ascriptionId: state.ascriptionId,
|
||||
baseVote: state.basevote,
|
||||
voteEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"),
|
||||
voteExplain: state.voteExplain,
|
||||
voteName: state.voteName,
|
||||
voteStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"),
|
||||
};
|
||||
if(props.edit){
|
||||
api
|
||||
.editVote(obj)
|
||||
.then((res) => {
|
||||
console.log("创建成功123", res);
|
||||
message.success("创建成功");
|
||||
updteVote(res);
|
||||
closeDrawer();
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
});
|
||||
}else{
|
||||
api
|
||||
.createVote(obj)
|
||||
.then((res) => {
|
||||
updteVote(res);
|
||||
closeDrawer();
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
});
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
showDrawerCreVote,
|
||||
showDrawerCreateVote,
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
changeVData,
|
||||
rowSelection,
|
||||
options1,
|
||||
dleVoteStem,
|
||||
createVoteText,
|
||||
delBox,
|
||||
652
src/components/vote/CreateVote.vue
Normal file
652
src/components/vote/CreateVote.vue
Normal file
@@ -0,0 +1,652 @@
|
||||
<!-- 评估管理-创建评估页面 -->
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="createVoteVisible"
|
||||
class="drawerStyle createvoteDrawer"
|
||||
width="80%"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="researchadd">
|
||||
<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="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="voteName"
|
||||
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>创建题干:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<button
|
||||
class="xkbtn"
|
||||
@click="handleTypes"
|
||||
>
|
||||
创建题干
|
||||
</button>
|
||||
</div>
|
||||
</div> <!-- 创建投票侧弹窗 -->
|
||||
</div>
|
||||
<div v-for="(item, index) in allFormsData" :key="index">
|
||||
<VoteQuestion
|
||||
:item="item"
|
||||
:assessmentId="assessmentId"
|
||||
@del="handleDel"
|
||||
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<div class="btn">
|
||||
<a-button
|
||||
type="primary"
|
||||
style="width: 100px;height: 40px;border-radius: 8px; background-color: #409eff;"
|
||||
@click="handleSave"
|
||||
>
|
||||
保存
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
ghost
|
||||
style="width: 100px;height: 40px;margin-left: 14px;border-radius: 8px;"
|
||||
@click="handleAllCancel"
|
||||
>
|
||||
取消
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive,toRefs} from "vue";
|
||||
// import { message } from "ant-design-vue";
|
||||
// import { createResearch } from "../../api/indexResearch";
|
||||
import VoteQuestion from "./VoteQuestion.vue";
|
||||
|
||||
import {
|
||||
sortBy,
|
||||
traverseArr,
|
||||
filterCommon,
|
||||
deepCloneFilterString,
|
||||
} from "../../utils/utils";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
//import store from "@/store";
|
||||
import {
|
||||
queryResearchDetailById,
|
||||
editResearchMessage,
|
||||
createResearch,
|
||||
|
||||
} from "@/api/indexResearch";
|
||||
import { message } from "ant-design-vue";
|
||||
|
||||
export default {
|
||||
name: "CreateVote",
|
||||
components: {
|
||||
VoteQuestion,
|
||||
|
||||
},
|
||||
props: {
|
||||
createVoteVisible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
|
||||
},
|
||||
setup(props,ctx) {
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
createVoteVisible:false,
|
||||
allFormsData: [],
|
||||
|
||||
});
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state======进来creates", bool);
|
||||
handleTypes();
|
||||
};
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:createVoteVisible", false);
|
||||
|
||||
console.log("======关闭");
|
||||
}
|
||||
// 详情
|
||||
const getInfoDate = async () => {
|
||||
let id = router.currentRoute.value.params.id;
|
||||
if (id) {
|
||||
state.assessmentId = id;
|
||||
let res = await queryResearchDetailById({
|
||||
assessmentId: state.assessmentId,
|
||||
}).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
return res.data.data;
|
||||
}
|
||||
});
|
||||
state.assessmentName = res.assessmentName;
|
||||
state.valueMore = res.assessmentMark;
|
||||
let renderArr = [
|
||||
...res.singleStemVoList,
|
||||
...res.multipleStemVoList,
|
||||
...res.essayQuestionVoList,
|
||||
...res.scoringQuestionVoList,
|
||||
];
|
||||
sortBy(renderArr, "orderNumber"); //序号
|
||||
state.allFormsData = parseData(renderArr, "questionType"); //类型
|
||||
// console.log("state.allFormsData");
|
||||
// console.log(state.allFormsData);
|
||||
}
|
||||
};
|
||||
getInfoDate();
|
||||
|
||||
// 转换成前端格式
|
||||
const parseData = (arr, typeKey) => {
|
||||
const resultArr = [];
|
||||
arr.forEach((item) => {
|
||||
let key = Number(item[typeKey]);
|
||||
let obj = {};
|
||||
if (key === 1) {
|
||||
let restList = traverseArr(item.assessmentSingleChoiceVoList, {
|
||||
inputVal: "singleOptionName",
|
||||
imgVal: "singleOptionPictureAddress",
|
||||
optionId: "singleOptionId",
|
||||
}).map((itm, idx) => {
|
||||
itm.id = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
|
||||
obj = {
|
||||
type: key,
|
||||
valueSingle: item.singleStemName,
|
||||
singleList: restList,
|
||||
orderNumber: item.orderNumber,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (key === 2) {
|
||||
let restList = traverseArr(item.multipleChoiceVoList, {
|
||||
inputVal: "multipleOptionName",
|
||||
imgVal: "multipleOptionPictureAddress",
|
||||
optionId: "multipleOptionId",
|
||||
}).map((itm, idx) => {
|
||||
itm.id = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
|
||||
obj = {
|
||||
type: key,
|
||||
valueMutil: item.multipleStemName,
|
||||
mutilList: restList,
|
||||
orderNumber: item.orderNumber,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (key === 3) {
|
||||
obj = {
|
||||
type: key,
|
||||
valueAsk: item.assessmentQaTitle,
|
||||
valueAskDesc: item.assessmentQaDescribe,
|
||||
optionId: item.assessmentQaId,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (key === 4) {
|
||||
obj = {
|
||||
type: key,
|
||||
valuePin: item.assessmentScTitle,
|
||||
minScore: item.assessmentMinScore,
|
||||
maxScore: item.assessmentMaxScore,
|
||||
pinQuan: item.weightScale,
|
||||
optionId: item.assessmentScId,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
});
|
||||
resultArr.map((itm, idx) => {
|
||||
itm.id = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
return resultArr;
|
||||
};
|
||||
// 转换成后端格式
|
||||
const restData = (arr, typeKey) => {
|
||||
const resultArr = [];
|
||||
arr.forEach((item) => {
|
||||
let obj = {};
|
||||
if (item[typeKey] === 1) {
|
||||
let restList = traverseArr(item.singleList, {
|
||||
singleOptionName: "inputVal",
|
||||
singleOptionPictureAddress: "imgVal",
|
||||
singleOptionId: "optionId",
|
||||
}).map((itm, idx) => {
|
||||
itm.optionOrderNum = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
restList.forEach((item) => {
|
||||
item.singleOptionId = item.singleOptionId
|
||||
? item.singleOptionId
|
||||
: "";
|
||||
});
|
||||
|
||||
obj = {
|
||||
questionType: item[typeKey],
|
||||
singleStemName: item.valueSingle,
|
||||
singleList: restList,
|
||||
orderNumber: item.orderNumber,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (item[typeKey] === 2) {
|
||||
let restList = traverseArr(item.mutilList, {
|
||||
multipleOptionName: "inputVal",
|
||||
multipleOptionPictureAddress: "imgVal",
|
||||
multipleOptionId: "optionId",
|
||||
}).map((itm, idx) => {
|
||||
itm.optionOrderNum = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
restList.forEach((item) => {
|
||||
item.multipleOptionId = item.multipleOptionId
|
||||
? item.multipleOptionId
|
||||
: "";
|
||||
});
|
||||
|
||||
obj = {
|
||||
questionType: item[typeKey],
|
||||
multipleStemName: item.valueMutil,
|
||||
mutilList: restList,
|
||||
orderNumber: item.orderNumber,
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (item[typeKey] === 3) {
|
||||
obj = {
|
||||
questionType: item[typeKey],
|
||||
assessmentQaTitle: item.valueAsk,
|
||||
assessmentQaDescribe: item.valueAskDesc,
|
||||
assessmentQaId: item.optionId ? item.optionId : "",
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
if (item[typeKey] === 4) {
|
||||
obj = {
|
||||
questionType: item[typeKey],
|
||||
assessmentScTitle: item.valuePin,
|
||||
assessmentMinScore: item.minScore,
|
||||
assessmentMaxScore: item.maxScore,
|
||||
weightScale: item.pinQuan,
|
||||
assessmentScId: item.optionId ? item.optionId : "",
|
||||
};
|
||||
resultArr.push(obj);
|
||||
}
|
||||
});
|
||||
resultArr.map((itm, idx) => {
|
||||
itm.orderNumber = idx + 1;
|
||||
return itm;
|
||||
});
|
||||
return resultArr;
|
||||
};
|
||||
// 解散传值
|
||||
const parseItem = (arr) => {
|
||||
const filterComObj = filterCommon(arr, "questionType");
|
||||
let resultObj = {};
|
||||
for (let key in filterComObj) {
|
||||
if (key === "1") {
|
||||
let arrSingle = filterComObj[key];
|
||||
let arr = [];
|
||||
arrSingle.forEach((item) => {
|
||||
if (item.singleList.length) {
|
||||
item.singleList.forEach((itm) => {
|
||||
arr.push({
|
||||
...itm,
|
||||
singleStemName: item.singleStemName,
|
||||
orderNumber: item.orderNumber,
|
||||
questionType: item.questionType,
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
resultObj.assessmentSingleChoiceDtoList = arr;
|
||||
}
|
||||
if (key === "2") {
|
||||
let arrMulti = filterComObj[key];
|
||||
let arr = [];
|
||||
arrMulti.forEach((item) => {
|
||||
if (item.mutilList.length) {
|
||||
item.mutilList.forEach((itm) => {
|
||||
arr.push({
|
||||
...itm,
|
||||
multipleStemName: item.multipleStemName,
|
||||
orderNumber: item.orderNumber,
|
||||
questionType: item.questionType,
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
resultObj.assessmentMultipleChoiceDtoList = arr;
|
||||
}
|
||||
if (key === "3") {
|
||||
resultObj.assessmentEssayQuestionDtoList = filterComObj[key];
|
||||
}
|
||||
if (key === "4") {
|
||||
resultObj.assessmentScoringQuestionDtoList = filterComObj[key];
|
||||
}
|
||||
}
|
||||
return resultObj;
|
||||
};
|
||||
|
||||
|
||||
const handleTypes = () => {
|
||||
let obj = {
|
||||
id: state.allFormsData.length,
|
||||
valueSingle: "",
|
||||
singleList: [
|
||||
{
|
||||
id: 1,
|
||||
inputVal: "",
|
||||
imgVal: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
state.allFormsData.push(obj);
|
||||
console.log("state.allFormsData=====",state.allFormsData,state.allFormsData.length);
|
||||
};
|
||||
|
||||
const handleDel = ({ id ,curItem}) => {
|
||||
state.allFormsData.forEach((item, index) => {
|
||||
if (item.id === id) {
|
||||
state.allFormsData.splice(index, 1);
|
||||
}
|
||||
});
|
||||
state.allFormsData.map((item, index) => {
|
||||
item.id = index + 1;
|
||||
return item;
|
||||
});
|
||||
console.log("curItem.orderNumber",curItem.orderNumber);
|
||||
|
||||
// orderNumber: curItem.orderNumber,
|
||||
|
||||
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
let resultPost = {};
|
||||
let filterData = parseItem(restData(state.allFormsData, "type"));
|
||||
// 校验
|
||||
if (!checkVal(filterData)) {
|
||||
return false;
|
||||
}
|
||||
console.log(12121212);
|
||||
console.log(filterData);
|
||||
|
||||
if (state.assessmentId) {
|
||||
resultPost = {
|
||||
assessmentId: state.assessmentId,
|
||||
assessmentName: state.assessmentName,
|
||||
assessmentMark: state.valueMore,
|
||||
...filterData,
|
||||
};
|
||||
resultPost = deepCloneFilterString(resultPost, [
|
||||
"assessmentMaxScore",
|
||||
"assessmentMinScore",
|
||||
]);
|
||||
console.log(1212334);
|
||||
console.log(resultPost);
|
||||
editResearchMessage(resultPost).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
message.success("编辑成功");
|
||||
router.push({
|
||||
path: "/researchmanage",
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resultPost = {
|
||||
assessmentName: state.assessmentNameNew,
|
||||
assessmentMark: state.valueMore,
|
||||
...filterData,
|
||||
};
|
||||
resultPost = deepCloneFilterString(resultPost, [
|
||||
"assessmentMaxScore",
|
||||
"assessmentMinScore",
|
||||
]);
|
||||
createResearch(resultPost).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
message.success("创建成功");
|
||||
router.push({
|
||||
path: "/researchmanage",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const handleAllCancel = () => {
|
||||
state.allFormsData = [];
|
||||
router.push({
|
||||
path: "/researchmanage",
|
||||
});
|
||||
};
|
||||
const checkVal = (filterData) => {
|
||||
// 问答
|
||||
if (
|
||||
filterData.assessmentEssayQuestionDtoList &&
|
||||
filterData.assessmentEssayQuestionDtoList.length
|
||||
) {
|
||||
let arr = filterData.assessmentEssayQuestionDtoList;
|
||||
for (let item of arr) {
|
||||
if (!item.assessmentQaTitle) {
|
||||
message.error("问答题干为必填 请确认");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 多选
|
||||
if (
|
||||
filterData.assessmentMultipleChoiceDtoList &&
|
||||
filterData.assessmentMultipleChoiceDtoList.length
|
||||
) {
|
||||
let arr = filterData.assessmentMultipleChoiceDtoList;
|
||||
for (let item of arr) {
|
||||
if (!item.multipleStemName) {
|
||||
message.error("多选题干为必填 请确认");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 评分
|
||||
if (
|
||||
filterData.assessmentScoringQuestionDtoList &&
|
||||
filterData.assessmentScoringQuestionDtoList.length
|
||||
) {
|
||||
let CountNum = 0;
|
||||
let CountArr = filterData.assessmentScoringQuestionDtoList;
|
||||
for (let item of CountArr) {
|
||||
if (!item.assessmentScTitle) {
|
||||
message.error("评分题干为必填 请确认");
|
||||
return false;
|
||||
}
|
||||
CountNum += Number(item["weightScale"]);
|
||||
}
|
||||
if (CountNum !== 100) {
|
||||
message.error("当前权重设置是百分制 请重新配置");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 单选
|
||||
if (
|
||||
filterData.assessmentSingleChoiceDtoList &&
|
||||
filterData.assessmentSingleChoiceDtoList.length
|
||||
) {
|
||||
let arr = filterData.assessmentSingleChoiceDtoList;
|
||||
for (let item of arr) {
|
||||
if (!item.singleStemName) {
|
||||
message.error("单选题干为必填 请确认");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
handleTypes,
|
||||
handleSave,
|
||||
handleAllCancel,
|
||||
handleDel,
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.researchadd {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 25px;
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
.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;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.fileTigan {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 3px 5px;
|
||||
background-color: rgba(42, 103, 209, 0.4);
|
||||
span {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.delBox {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
background-image: url(@/assets/images/basicinfo/ch.png);
|
||||
background-size: 100% 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
454
src/components/vote/VoteQuestion.vue
Normal file
454
src/components/vote/VoteQuestion.vue
Normal file
@@ -0,0 +1,454 @@
|
||||
<!-- 评估管理-创建评估页面 -->
|
||||
<template>
|
||||
<!-- 单选题 -->
|
||||
<div class="content">
|
||||
<div class="tagbox">
|
||||
<div class="deleteop" @click="handleTypesDel">
|
||||
<div><img src="../../assets/images/projectadd/delete.png" /></div>
|
||||
<div class="del_text">删除选项</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<img
|
||||
class="nameimg"
|
||||
src="../../assets/images/basicinfo/asterisk.png"
|
||||
/>
|
||||
<div class="inname">题干{{item.id}}</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-input
|
||||
v-model:value="curItem.valueSingle"
|
||||
placeholder="请输入题干名称"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
style="border-radius: 8px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<VoteQuestionItem
|
||||
v-for="(item, index) in curItem.singleList"
|
||||
:key="index"
|
||||
:item="item"
|
||||
@input="input"
|
||||
@src="imgSrc"
|
||||
@delImg="delImg"
|
||||
@del="del"
|
||||
/>
|
||||
<div class="name">
|
||||
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
|
||||
<a-button
|
||||
type="primary"
|
||||
style="width: 100px;height: 40px;border-radius: 8px;background-color: #409eff;"
|
||||
@click="handleSingleAdd"
|
||||
>
|
||||
添加选项
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import VoteQuestionItem from "./VoteQuestionItem.vue";
|
||||
import { ref } from "vue";
|
||||
export default {
|
||||
name: "CreateVote",
|
||||
components: {
|
||||
VoteQuestionItem,
|
||||
},
|
||||
props: {
|
||||
num:{
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
setup(props,{ emit }) {
|
||||
|
||||
|
||||
|
||||
const curItem = ref(props.item);
|
||||
const handleTypesDel = () => {
|
||||
emit("del", { id: curItem.value.id, curItem: curItem.value });
|
||||
|
||||
};
|
||||
|
||||
const handleSingleAdd = () => {
|
||||
curItem.value.singleList.push({
|
||||
id: curItem.value.singleList.length + 1,
|
||||
inputVal: "",
|
||||
imgVal: "",
|
||||
});
|
||||
};
|
||||
const input = ({ id, val }) => {
|
||||
curItem.value.singleList.forEach((item) => {
|
||||
if (item.id === id) {
|
||||
item.inputVal = val;
|
||||
}
|
||||
});
|
||||
};
|
||||
const imgSrc = ({ id, src }) => {
|
||||
curItem.value.singleList.forEach((item) => {
|
||||
if (item.id === id) {
|
||||
item.imgVal = src;
|
||||
}
|
||||
});
|
||||
};
|
||||
const delImg = ({ id }) => {
|
||||
curItem.value.singleList.forEach((item) => {
|
||||
if (item.id === id) {
|
||||
item.imgVal = "";
|
||||
}
|
||||
});
|
||||
};
|
||||
const del = ({ id, optionId }) => {
|
||||
curItem.value.singleList.forEach((item, index) => {
|
||||
if (item.id === id) {
|
||||
curItem.value.singleList.splice(index, 1);
|
||||
}
|
||||
console.log("删除=====",id,optionId);
|
||||
});
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
curItem,
|
||||
handleTypesDel,
|
||||
handleSingleAdd,
|
||||
input,
|
||||
imgSrc,
|
||||
delImg,
|
||||
del,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.researchadd {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 18px;
|
||||
//line-height: 36px;
|
||||
padding-top: 30px;
|
||||
padding-left: 37px;
|
||||
//font-weight: 500;
|
||||
}
|
||||
.goback {
|
||||
padding-right: 70px;
|
||||
//padding-top: 37px;
|
||||
position: relative;
|
||||
.return {
|
||||
display: inline-block;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
margin-top: 17px;
|
||||
margin-right: 10px;
|
||||
background-image: url("../../assets/images/projectadd/return.png");
|
||||
}
|
||||
.returntext {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 27px;
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.addtype {
|
||||
display: flex;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
margin-right: 20px;
|
||||
align-items: center;
|
||||
margin-left: 41px;
|
||||
.addtypen {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
.types {
|
||||
cursor: pointer;
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
color: #409eff;
|
||||
border: 1px solid #409eff;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
.typesCur {
|
||||
color: #fff;
|
||||
background: #409eff;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
width: 70%;
|
||||
min-width: 690px;
|
||||
margin-left: 38px;
|
||||
margin-top: 20px;
|
||||
.tagbox {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
.tagname {
|
||||
width: 90px;
|
||||
height: 32px;
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 134px;
|
||||
background: rgba(78, 166, 255, 0.1);
|
||||
border-radius: 4px;
|
||||
color: rgba(64, 158, 255, 1);
|
||||
font-size: 16px;
|
||||
}
|
||||
.deleteop {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
margin-right: 30px;
|
||||
border: 1px solid #409eff;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
.del_text {
|
||||
color: #409eff;
|
||||
font-size: 14px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.scorebox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
margin-left: 70px;
|
||||
.scoretext {
|
||||
font-size: 14px;
|
||||
color: #56a3f9;
|
||||
}
|
||||
.number {
|
||||
display: flex;
|
||||
border: 1px solid #d7e5fd;
|
||||
border-radius: 5px;
|
||||
margin: 0 10px;
|
||||
padding: 5px;
|
||||
.btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 1px solid #56a3f9;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #56a3f9;
|
||||
line-height: 24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.curBtn {
|
||||
background: #56a3f9;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.picture {
|
||||
width: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 20px;
|
||||
margin-left: 133px;
|
||||
.pictureimg {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
.picturename {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.options {
|
||||
display: flex;
|
||||
}
|
||||
.delete {
|
||||
cursor: pointer;
|
||||
margin-top: 32px;
|
||||
margin-left: 107px;
|
||||
// float: right;
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.name2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.name {
|
||||
width: 60%;
|
||||
// background-color: lightcoral;
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
//align-items: center;
|
||||
//height: 40px;
|
||||
// border: 1px solid black;
|
||||
.namebox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-shrink: 0;
|
||||
.nameimg {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
.inname {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
margin-left: 7px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.in {
|
||||
margin-left: 14px;
|
||||
flex: 1;
|
||||
.assess {
|
||||
display: flex;
|
||||
width: 226px;
|
||||
height: 40px;
|
||||
border: 1px solid #56a3f9;
|
||||
//margin-bottom: 20px;
|
||||
.assesstype {
|
||||
width: 50%;
|
||||
background: #56a3f9;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.assesswhole {
|
||||
width: 50%;
|
||||
background: rgba(86, 163, 249, 0.1);
|
||||
font-size: 14px;
|
||||
color: #6f6f6f;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.ratio {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 8px;
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.addimg {
|
||||
cursor: pointer;
|
||||
color: rgba(78, 166, 255, 1);
|
||||
font-size: 14px;
|
||||
}
|
||||
.text {
|
||||
color: rgba(109, 117, 132, 1);
|
||||
font-size: 14px;
|
||||
//line-height: 24px;
|
||||
}
|
||||
.ant-radio-wrapper {
|
||||
}
|
||||
.ant-input {
|
||||
border-radius: 5px;
|
||||
// height: 120%;
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
}
|
||||
.ant-select-selector {
|
||||
border-radius: 5px;
|
||||
// height: 120%;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.numberInp {
|
||||
width: 200px;
|
||||
.ant-input-number {
|
||||
width: 200px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
// .ant-input-number-input-wrap {
|
||||
// width: 200px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
.name2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
width: 100%;
|
||||
margin-top: 31px;
|
||||
margin-bottom: 14px;
|
||||
.btn {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadContent {
|
||||
display: block !important;
|
||||
.uploadBtn {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
439
src/components/vote/VoteQuestionItem.vue
Normal file
439
src/components/vote/VoteQuestionItem.vue
Normal file
@@ -0,0 +1,439 @@
|
||||
<!-- 评估管理-创建评估页面 -->
|
||||
<template>
|
||||
<div class="itemRow">
|
||||
<div class="options">
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<div class="inname">选项{{ item.id }}</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-input
|
||||
v-model:value="curItem.inputVal"
|
||||
show-count
|
||||
:maxlength="30"
|
||||
style="border-radius: 8px"
|
||||
@change="handleInput"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="delete" @click="handleDel">删除</div>
|
||||
</div>
|
||||
<div class="name uploadContent">
|
||||
<a-upload
|
||||
v-show="!item.imgVal"
|
||||
class="in uploadBtn"
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<div class="addimg">+添加图片</div>
|
||||
</a-upload>
|
||||
<div v-show="item.imgVal" class="picture" style="position: relative">
|
||||
<img class="pictureimg" :src="item.imgVal" />
|
||||
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
|
||||
<img
|
||||
style="
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="handleCancel"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { fileUp } from "../../api/indexEval";
|
||||
|
||||
export default {
|
||||
name: "VoteQuestionItem",
|
||||
props: {
|
||||
item: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const curItem = ref(props.item);
|
||||
const state = reactive({
|
||||
hasImgName: "",
|
||||
});
|
||||
|
||||
const handleInput = () => {
|
||||
emit("input", { id: curItem.value.id, val: curItem.value.inputVal });
|
||||
};
|
||||
const handleDel = () => {
|
||||
handleCancel();
|
||||
emit("del", { id: curItem.value.id, optionId: curItem.value.optionId });
|
||||
};
|
||||
const handleCancel = () => {
|
||||
state.hasImgName = "";
|
||||
emit("delImg", { id: curItem.value.id });
|
||||
};
|
||||
const beforeUpload = (file) => {
|
||||
const isJpgOrPng =
|
||||
file.type === "image/jpg" ||
|
||||
file.type === "image/jpeg" ||
|
||||
file.type === "image/png" ||
|
||||
file.type === "image/svg" ||
|
||||
file.type === "image/bmp" ||
|
||||
file.type === "image/gif";
|
||||
if (!isJpgOrPng) {
|
||||
message.error("仅支持jpg、gif、png、jpeg、svg、bmp格式!");
|
||||
return false;
|
||||
}
|
||||
|
||||
let isLt1M = file.size / 10240 / 10240 <= 1;
|
||||
if (!isLt1M) {
|
||||
this.$message.error("图片大小超过10MB!");
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
console.log(file);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.hasImgName = file.name;
|
||||
emit("src", { id: curItem.value.id, src: res.data.data });
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
curItem,
|
||||
handleInput,
|
||||
handleDel,
|
||||
handleCancel,
|
||||
beforeUpload,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.researchadd {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
color: #000000;
|
||||
font-size: 18px;
|
||||
//line-height: 36px;
|
||||
padding-top: 30px;
|
||||
padding-left: 37px;
|
||||
//font-weight: 500;
|
||||
}
|
||||
.goback {
|
||||
padding-right: 70px;
|
||||
//padding-top: 37px;
|
||||
position: relative;
|
||||
.return {
|
||||
display: inline-block;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
margin-top: 17px;
|
||||
margin-right: 10px;
|
||||
background-image: url("../../assets/images/projectadd/return.png");
|
||||
}
|
||||
.returntext {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 27px;
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.addtype {
|
||||
display: flex;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
margin-right: 20px;
|
||||
align-items: center;
|
||||
margin-left: 41px;
|
||||
.addtypen {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
.types {
|
||||
cursor: pointer;
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
color: #409eff;
|
||||
border: 1px solid #409eff;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
.typesCur {
|
||||
color: #fff;
|
||||
background: #409eff;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
width: 70%;
|
||||
min-width: 690px;
|
||||
margin-left: 38px;
|
||||
margin-top: 20px;
|
||||
.tagbox {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.tagname {
|
||||
width: 90px;
|
||||
height: 32px;
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 134px;
|
||||
background: rgba(78, 166, 255, 0.1);
|
||||
border-radius: 4px;
|
||||
color: rgba(64, 158, 255, 1);
|
||||
font-size: 16px;
|
||||
}
|
||||
.deleteop {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
margin-right: 30px;
|
||||
border: 1px solid #409eff;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
.del_text {
|
||||
color: #409eff;
|
||||
font-size: 14px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.scorebox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
margin-left: 70px;
|
||||
.scoretext {
|
||||
font-size: 14px;
|
||||
color: #56a3f9;
|
||||
}
|
||||
.number {
|
||||
display: flex;
|
||||
border: 1px solid #d7e5fd;
|
||||
border-radius: 5px;
|
||||
margin: 0 10px;
|
||||
padding: 5px;
|
||||
.btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 1px solid #56a3f9;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #56a3f9;
|
||||
line-height: 24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.picture {
|
||||
width: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 20px;
|
||||
margin-left: 133px;
|
||||
.pictureimg {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
.picturename {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.options {
|
||||
display: flex;
|
||||
}
|
||||
.delete {
|
||||
cursor: pointer;
|
||||
margin-top: 32px;
|
||||
margin-left: 107px;
|
||||
// float: right;
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.name2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.name {
|
||||
width: 60%;
|
||||
// background-color: lightcoral;
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
//align-items: center;
|
||||
//height: 40px;
|
||||
// border: 1px solid black;
|
||||
.namebox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-shrink: 0;
|
||||
.nameimg {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
.inname {
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
margin-left: 7px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.in {
|
||||
margin-left: 14px;
|
||||
flex: 1;
|
||||
.assess {
|
||||
display: flex;
|
||||
width: 226px;
|
||||
height: 40px;
|
||||
border: 1px solid #56a3f9;
|
||||
//margin-bottom: 20px;
|
||||
.assesstype {
|
||||
width: 50%;
|
||||
background: #56a3f9;
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.assesswhole {
|
||||
width: 50%;
|
||||
background: rgba(86, 163, 249, 0.1);
|
||||
font-size: 14px;
|
||||
color: #6f6f6f;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.ratio {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 8px;
|
||||
color: #6f6f6f;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.addimg {
|
||||
cursor: pointer;
|
||||
color: rgba(78, 166, 255, 1);
|
||||
font-size: 14px;
|
||||
}
|
||||
.text {
|
||||
color: rgba(109, 117, 132, 1);
|
||||
font-size: 14px;
|
||||
//line-height: 24px;
|
||||
}
|
||||
.ant-radio-wrapper {
|
||||
}
|
||||
.ant-input {
|
||||
border-radius: 5px;
|
||||
// height: 120%;
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
}
|
||||
.ant-select-selector {
|
||||
border-radius: 5px;
|
||||
// height: 120%;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.numberInp {
|
||||
width: 200px;
|
||||
.ant-input-number {
|
||||
width: 200px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
// .ant-input-number-input-wrap {
|
||||
// width: 200px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
.name2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer {
|
||||
width: 100%;
|
||||
margin-top: 31px;
|
||||
margin-bottom: 14px;
|
||||
.btn {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadContent {
|
||||
display: block !important;
|
||||
.uploadBtn {
|
||||
margin-left: 120px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -909,7 +909,7 @@ import AddDiscuss from "../../components/drawers/AddDiscuss.vue";
|
||||
import AddActive from "../../components/drawers/AddActive.vue";
|
||||
import AddEval from "../../components/drawers/AddEval.vue";
|
||||
import AddInvist from "../../components/drawers/AddInvist.vue";
|
||||
import AddVote from "../../components/drawers/AddVote.vue";
|
||||
import AddVote from "../../components/vote/AddVote.vue";
|
||||
import AddLive from "../../components/drawers/AddLive.vue";
|
||||
import AddRef from "../../components/drawers/AddRef.vue";
|
||||
import * as api from "../../api/indexLevel";
|
||||
@@ -1241,15 +1241,15 @@ export default {
|
||||
};
|
||||
//测试评估投票抽屉
|
||||
const showDrawerAddEval = (id, eleId) => {
|
||||
|
||||
state.addhomeworkvisible = true;
|
||||
state.addevalVisible = true;
|
||||
state.EditEvalId = id;
|
||||
state.routerTaskId = eleId;
|
||||
};
|
||||
const showDrawerAddInvist = (id, eleId) => {
|
||||
state.addhomeworkvisible = true;
|
||||
state.EditInvistId = id;
|
||||
state.addinvistVisible = true;
|
||||
state.routerTaskId = eleId;
|
||||
state.EditInvistId =id;
|
||||
|
||||
};
|
||||
const showDrawerAddVote = (id, eleId) => {
|
||||
state.addhomeworkvisible = true;
|
||||
|
||||
@@ -280,6 +280,7 @@
|
||||
v-model:edit="edit"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:projectTaskId="projectTaskId"
|
||||
v-model:EditEvalId="EditEvalId"
|
||||
/>
|
||||
</div>
|
||||
@@ -301,6 +302,8 @@
|
||||
v-model:edit="edit"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:projectTaskId="projectTaskId"
|
||||
v-model:EditInvistId = "EditInvistId"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加评估侧弹窗 -->
|
||||
@@ -321,6 +324,8 @@
|
||||
v-model:edit="edit"
|
||||
v-model:projectId="projectId"
|
||||
v-model:chooseStageId="chooseStageId"
|
||||
v-model:projectTaskId="projectTaskId"
|
||||
v-model:EditVoteId = "EditVoteId"
|
||||
/>
|
||||
</div>
|
||||
<!-- 添加投票侧弹窗 -->
|
||||
@@ -837,22 +842,14 @@ import AddDiscuss from "../../components/drawers/AddDiscuss.vue";
|
||||
import AddActive from "../../components/drawers/AddActive.vue";
|
||||
import AddEval from "../../components/drawers/AddEval.vue";
|
||||
import AddInvist from "../../components/drawers/AddInvist.vue";
|
||||
import AddVote from "../../components/drawers/AddVote.vue";
|
||||
import AddVote from "../../components/vote/AddVote.vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/indexTaskadd";
|
||||
import * as apilive from "../../api/indexLiveBroadcast";
|
||||
import * as apiExternal from "../../api/indexExternalChain";
|
||||
import * as apidiscuss from "../../api/indexDiscuss";
|
||||
import * as apiactivity from "../../api/indexActivity";
|
||||
import * as apieval from "../../api/indexEval";
|
||||
import * as apiinvist from "../../api/indexInvist";
|
||||
import * as apivote from "../../api/indexVote";
|
||||
import * as apistage from "../../api/indexStage";
|
||||
import * as apimove from "../../api/indexMovetask";
|
||||
import draggable from "vuedraggable";
|
||||
import { storage } from "../../api/storage";
|
||||
import { deleteExaminationById } from "@/api/indexExam";
|
||||
import { deleteWorkTask } from "@/api/indexWork";
|
||||
|
||||
|
||||
const drawercolumns = [
|
||||
{
|
||||
@@ -928,6 +925,8 @@ export default {
|
||||
EditWorkId:null, // 要编辑的作业id
|
||||
EditTestId: null,// 要编辑的考试id
|
||||
EditEvalId:null,
|
||||
EditInvistId:null,
|
||||
EditVoteId:null,
|
||||
projectTaskId:null, // 要编辑的具体任务id
|
||||
projectNameList: [
|
||||
{
|
||||
@@ -1352,13 +1351,7 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
//获取阶段
|
||||
// const getStage = () =>{
|
||||
// let obj = {
|
||||
// projectId:state.projectId
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
//获取删除id(投票)
|
||||
const changeVData = (data) => {
|
||||
@@ -1370,149 +1363,6 @@ export default {
|
||||
console.log("添加数据", data);
|
||||
getTask(data);
|
||||
};
|
||||
// 删除考试
|
||||
const deleteTest = () => {
|
||||
let obj = {
|
||||
examinationId: state.deleteID,
|
||||
};
|
||||
deleteExaminationById(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
// 删除作业
|
||||
const deleteWork = () => {
|
||||
let obj = {
|
||||
workId: state.deleteID,
|
||||
};
|
||||
deleteWorkTask(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
//删除直播
|
||||
const deleteLiveBroadcast = () => {
|
||||
let obj = {
|
||||
liveId: state.deleteLiveID,
|
||||
};
|
||||
apilive
|
||||
.deleteLiveBroadcast(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
|
||||
//删除外链
|
||||
const deleteExternalChain = () => {
|
||||
let obj = {
|
||||
linkId: state.deleteExternalID,
|
||||
// linkId: 11,
|
||||
};
|
||||
apiExternal
|
||||
.deleteLink(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
//删除讨论
|
||||
const deleteDiscuss = () => {
|
||||
let obj = {
|
||||
discussId: state.deleteDiscussID,
|
||||
};
|
||||
apidiscuss
|
||||
.deleteDiscuss(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
state.deleteModal = false;
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
};
|
||||
//删除活动
|
||||
const deleteActivity = () => {
|
||||
let obj = {
|
||||
activityId: state.deleteActivityID,
|
||||
};
|
||||
apiactivity
|
||||
.deleteActivity(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
state.deleteModal = false;
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
//删除测评测试
|
||||
const deleteEvalText = () => {
|
||||
let obj = {
|
||||
evaluationId: "",
|
||||
token: 123,
|
||||
};
|
||||
apieval
|
||||
.deleteEvaluationById(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
//删除评估测试
|
||||
const deleteInvistText = () => {
|
||||
let obj = {
|
||||
评估信息Id: "",
|
||||
token: "",
|
||||
};
|
||||
apiinvist
|
||||
.deleteAppraise(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
//删除任务
|
||||
const deleteTask = () => {
|
||||
@@ -1528,25 +1378,6 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
//删除投票信息
|
||||
const deleteVoteText = () => {
|
||||
let obj = {
|
||||
voteId: state.voteId,
|
||||
};
|
||||
apivote
|
||||
.deleteVoteMessage(obj)
|
||||
.then((res) => {
|
||||
console.log("删除成功", res);
|
||||
message.success("删除成功");
|
||||
//重新获取列表
|
||||
getTask();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("删除失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const showChangeModal = () => {
|
||||
state.visiblene = true;
|
||||
};
|
||||
@@ -1678,14 +1509,19 @@ export default {
|
||||
state.projectTaskId = eleId;
|
||||
console.log("active=======",id);
|
||||
};
|
||||
const showDrawerAddEval = () => {
|
||||
const showDrawerAddEval = (id, eleId) => {
|
||||
state.addevalvisible = true;
|
||||
state.evaluationId = id;
|
||||
state.projectTaskId = eleId;
|
||||
};
|
||||
const showDrawerAddInvist = () => {
|
||||
const showDrawerAddInvist = (id, eleId) => {
|
||||
state.addinvistvisible = true;
|
||||
state.projectTaskId = eleId;
|
||||
};
|
||||
const showDrawerAddVote = () => {
|
||||
const showDrawerAddVote = (id, eleId) => {
|
||||
state.addvotevisible = true;
|
||||
state.EditVoteId = id;
|
||||
state.projectTaskId = eleId;
|
||||
};
|
||||
const showConfirm = () => {
|
||||
state.confirmModal = true;
|
||||
@@ -1840,14 +1676,6 @@ export default {
|
||||
closeChangeModal,
|
||||
changebgc,
|
||||
getTask,
|
||||
deleteLiveBroadcast,
|
||||
deleteDiscuss,
|
||||
|
||||
deleteEvalText,
|
||||
deleteExternalChain,
|
||||
deleteActivity,
|
||||
deleteVoteText,
|
||||
deleteInvistText,
|
||||
getTableData,
|
||||
deleteTask,
|
||||
editStage,
|
||||
@@ -1859,8 +1687,6 @@ export default {
|
||||
getStageData,
|
||||
moveTask,
|
||||
deleteTaskAll,
|
||||
deleteTest,
|
||||
deleteWork,
|
||||
decideType,
|
||||
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
</div>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
<!-- 无数据创建任务 -->
|
||||
<!-- 无数据创建任务 v-if="taskSyllabus.length == 0"-->
|
||||
<router-link
|
||||
to="/taskadd"
|
||||
class="taskbox"
|
||||
@@ -433,7 +433,7 @@
|
||||
background: linear-gradient(180deg, #ddeaff, #f0f8fe);
|
||||
display: block;
|
||||
"
|
||||
v-if="taskSyllabus.length == 0"
|
||||
|
||||
>
|
||||
<div class="leftt">
|
||||
<img src="../../assets/images/taskpage/left2.png" />
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
import AddVote from "../../components/drawers/AddVote";
|
||||
import AddVote from "../../components/vote/AddVote";
|
||||
// import { PlusOutlined, LoadingOutlined } from "@ant-design/icons-vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/index1";
|
||||
|
||||
Reference in New Issue
Block a user