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

This commit is contained in:
songwc
2022-11-14 11:24:54 +08:00
27 changed files with 5561 additions and 2772 deletions

27
package-lock.json generated
View File

@@ -13,6 +13,7 @@
"axios": "^1.1.3", "axios": "^1.1.3",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-plus": "^2.2.17", "element-plus": "^2.2.17",
"element-resize-detector": "^1.2.4",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"jquery": "^3.6.1", "jquery": "^3.6.1",
"qrcode.vue": "^3.3.3", "qrcode.vue": "^3.3.3",
@@ -3536,6 +3537,11 @@
"integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==",
"dev": true "dev": true
}, },
"node_modules/batch-processor": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/batch-processor/-/batch-processor-1.0.0.tgz",
"integrity": "sha512-xoLQD8gmmR32MeuBHgH0Tzd5PuSZx71ZsbhVxOCRbgktZEPe4SQy7s9Z50uPp0F/f7iw2XmkHN2xkgbMfckMDA=="
},
"node_modules/big.js": { "node_modules/big.js": {
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
@@ -4934,6 +4940,14 @@
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
}, },
"node_modules/element-resize-detector": {
"version": "1.2.4",
"resolved": "https://registry.npmmirror.com/element-resize-detector/-/element-resize-detector-1.2.4.tgz",
"integrity": "sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==",
"dependencies": {
"batch-processor": "1.0.0"
}
},
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -14162,6 +14176,11 @@
"integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==",
"dev": true "dev": true
}, },
"batch-processor": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/batch-processor/-/batch-processor-1.0.0.tgz",
"integrity": "sha512-xoLQD8gmmR32MeuBHgH0Tzd5PuSZx71ZsbhVxOCRbgktZEPe4SQy7s9Z50uPp0F/f7iw2XmkHN2xkgbMfckMDA=="
},
"big.js": { "big.js": {
"version": "5.2.2", "version": "5.2.2",
"resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
@@ -15332,6 +15351,14 @@
} }
} }
}, },
"element-resize-detector": {
"version": "1.2.4",
"resolved": "https://registry.npmmirror.com/element-resize-detector/-/element-resize-detector-1.2.4.tgz",
"integrity": "sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==",
"requires": {
"batch-processor": "1.0.0"
}
},
"emoji-regex": { "emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",

View File

@@ -13,6 +13,7 @@
"axios": "^1.1.3", "axios": "^1.1.3",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-plus": "^2.2.17", "element-plus": "^2.2.17",
"element-resize-detector": "^1.2.4",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"jquery": "^3.6.1", "jquery": "^3.6.1",
"qrcode.vue": "^3.3.3", "qrcode.vue": "^3.3.3",

View File

@@ -55,7 +55,12 @@ export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvalua
//根据ID获取测评信息详情 //根据ID获取测评信息详情
export const queryEvaluationDetailById = (obj) => 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) => export const updateEvaluation = (obj) =>
@@ -68,3 +73,11 @@ export const updateEvaluation = (obj) =>
// }).catch(err => { // }).catch(err => {
// console.log(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',
}
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

View File

@@ -9,8 +9,7 @@
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div v-if="edit" class="headerTitle">编辑测评</div> <div class="headerTitle">{{edit?'编辑':'添加'}}测评</div>
<div v-else class="headerTitle">添加测评</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@@ -49,11 +48,16 @@
<span style="margin-right: 3px">选择测评</span> <span style="margin-right: 3px">选择测评</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <button class="checkEval" @click="showEvalDrawer">选择测评</button>
v-model:value="inputV2" </div>
style="width: 424px; height: 32px" <div>
placeholder="请输入名称或编码后选择" <div><EvList
v-model:EvalListVisible="EvalListVisible"
v-model:evaluationTypeId="evaluationTypeId"
v-model:evaluationTypeName="evaluationTypeName"
/> />
</div>
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -71,29 +75,11 @@
</div> </div>
<div class="main_item2"> <div class="main_item2">
<div class="signbox"> <div class="signbox">
<span style="margin-right: 3px">图片</span> <span style="margin-right: 3px">测评说明</span>
</div> </div>
<div class="textarea"> <div class="textarea">
<a-upload <a-textarea v-model:value="description" placeholder="请输入测评说明" style="width:424px; height: 120px;" allowClear/>
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
>
</div> </div>
</div> </div>
</div> </div>
@@ -109,30 +95,32 @@
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs } from "vue";
// import { useRouter } from "vue-router"; // import { useRouter } from "vue-router";
import EvList from "./EvList.vue";
import * as api from "../../api/indexEval"; import * as api from "../../api/indexEval";
import * as apitaskadd from "../../api/indexTaskadd"; import * as apitaskadd from "../../api/indexTaskadd";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { toDate } from "../../api/method";
import { RouterEditTask } from "@/api/indexTask"; import { RouterEditTask } from "@/api/indexTask";
import dayjs from 'dayjs';
// const router = useRouter(); // const router = useRouter();
export default { export default {
name: "AddEval", name: "AddEval",
// components: { components: {
// }, EvList,
},
props: { props: {
addevalVisible: { addevalVisible: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
edit: { EditEvalId: {
type: Boolean,
default: false,
},
learn: {
type: Number, type: Number,
default: 0, default: null,
},
edit: { // 是否为编辑
type: Boolean,
default: null,
}, },
projectId: { projectId: {
type: Number, type: Number,
@@ -142,7 +130,15 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
isactive: { routerTaskId: {
type: Number,
default: 0,
},
isLevel: { // 是否是关卡页面触发
type: Boolean,
default: null,
},
projectTaskId: { // 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -150,9 +146,9 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
EditEvalId: { isactive: {
type: Number, type: Number,
default: 147, default: null,
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
@@ -160,15 +156,11 @@ export default {
inputV1: "", inputV1: "",
inputV2: "", inputV2: "",
time: undefined, time: undefined,
endTimes: "", EvalId: null,
startTimes: "", evaluationTypeId:null,
picUrl: "", evaluationTypeName:"",
tableData: [], description:"",
deletePathId: null, //删除路径id EvalListVisible:false,
editPathId: null, //修改路径id
currentPage: 1, //当前页
tableDataTotal: -1, //学习路径列表总数
pageSize: 10, //每页10条数据
// addLoading:false, // addLoading:false,
}); });
@@ -179,54 +171,63 @@ export default {
state.inputV2 = ""; state.inputV2 = "";
}; };
const afterVisibleChange = (bool) => { 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); const showEvalDrawer = () =>{
state.picUrl = info.file.response.data; state.EvalListVisible = true;
// Get this url from response in real world. console.log("进来了吗");
getBase64(info.file.originFileObj, (base64Url) => { };
imageUrl.value = base64Url; const queryEval = () =>{
loading.value = false; 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") { const updateTask = (res)=>{
loading.value = false; if(props.isLevel){
message.error("upload error"); 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);
const beforeUpload = (file) => { })
const isJpgOrPng = .catch((err) => {
file.type === "image/jpeg" || file.type === "image/png"; console.log(err);
if (!isJpgOrPng) { });
message.error("You can only upload JPG file!"); }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 isLt2M = file.size / 1024 / 1024 < 1; }
if (!isLt2M) {
message.error("Image must smaller than 1MB!");
}
return isJpgOrPng && isLt2M;
};
//创建或编辑测评信息 //创建或编辑测评信息
const createEvalText = () => { const createEvalText = () => {
if (!state.inputV1) { if (!state.inputV1) {
@@ -237,130 +238,45 @@ export default {
message.destroy(); message.destroy();
return message.info("请选择测评"); return message.info("请选择测评");
} }
if (state.time != undefined) { if (!state.time) {
state.endTimes = toDate( message.destroy();
new Date(state.time[0].$d).getTime() / 1000, return message.warning("请输入直播时间");
"Y-M-D"
);
state.startTimes = toDate(
new Date(state.time[1].$d).getTime() / 1000,
"Y-M-D"
);
} }
let obj = { let obj = {
evaluationName: state.inputV1, evaluationName: state.inputV1,
createTime: "", evaluationEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"),
createUser: 0, evaluationId: props.edit?props.evaluationId:0,
evaluationEndTime: state.endTimes, evaluationStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"),
evaluationFlag: "", evaluationTypeId:state.evaluationTypeId,
evaluationId: 0, evaluationTypeName:state.evaluationTypeName,
evaluationPictureAddress: "", //state.description
evaluationStartTime: state.startTimes,
evaluationTag: "",
evaluationTypeId: 0,
evaluationTypeName: "",
updateTime: "",
updateUser: 0,
}; };
let objedit = { if(props.edit){
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) {
api api
.createEvaluation(obj) .createEvaluation(obj)
.then((res) => { .then((res) => {
console.log("创建成功", res); updateTask(res);
message.success("创建成功"); message.success("创建成功");
closeDrawer(); closeDrawer();
//渲染到项目列表 ctx.emit("changeData", false);
if (props.learn == 0) })
apitaskadd .catch((err) => {
.addTask({ console.log(err);
courseId: res.data.data.evaluationId, });
duration: 0, }else{
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 {
api api
.queryEvaluationDetailById(queryobj) .updateEvaluation(obj)
.then((res) => { .then((res) => {
setTimeout(() => { updateTask(res);
console.log("获取成功", res,objedit.evaluationId); message.success("创建成功");
message.success("获取成功"); closeDrawer();
ctx.emit("changeData", false);
}, 1000); })
}) .catch((err) => {
.catch((err) => { console.log(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();
});
}
}; };
return { return {
@@ -369,12 +285,8 @@ export default {
closeDrawer, closeDrawer,
//增改 //增改
createEvalText, createEvalText,
//上传组件 showEvalDrawer,
fileList, updateTask,
loading,
imageUrl,
handleChange,
beforeUpload,
}; };
}, },
}; };
@@ -424,14 +336,14 @@ export default {
display: flex; display: flex;
flex: 1; flex: 1;
align-items: center; align-items: center;
.xkbtn { .checkEval {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
height: 40px; height: 40px;
background: #388be1; background: #4ea6ff;
border-radius: 8px; border-radius: 8px;
border: 0; border: 0;
margin-right: 8px; margin-left: 15px;
color: #fff; color: #fff;
} }
} }
@@ -475,7 +387,7 @@ export default {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
height: 40px; height: 40px;
background: #388be1; background: #4ea6ff;
border-radius: 8px; border-radius: 8px;
border: 0; border: 0;
margin-right: 16px 8px 32px 0; margin-right: 16px 8px 32px 0;

View File

@@ -28,7 +28,7 @@
maxlength="20" maxlength="20"
/> />
</div> </div>
<div class="btns" @click="searchInvist"> <div class="btns" @click="getAllInvistText">
<div class="search"></div> <div class="search"></div>
<div class="btnText">搜索</div> <div class="btnText">搜索</div>
</div> </div>
@@ -59,6 +59,7 @@
:current="currentPage" :current="currentPage"
:total="tableDataTotal" :total="tableDataTotal"
class="pagination" class="pagination"
@change="handelChangePage"
/> />
</div> </div>
</div> </div>
@@ -66,17 +67,17 @@
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="createInvist">确定</button> <button class="btn2" @click="updateTask">确定</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, onMounted } from "vue"; import { reactive, toRefs, onMounted } from "vue";
import * as api from "../../api/indexInvist"; import * as api from "../../api/indexInvist.js";
import * as apitaskadd from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { toDate } from "../../api/method"; import dayjs from "dayjs";
import { RouterEditTask } from "@/api/indexTask"; import { RouterEditTask } from "@/api/indexTask";
export default { export default {
name: "AddInvist", name: "AddInvist",
@@ -87,13 +88,13 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
edit: { EditInvistId: {
type: Boolean,
default: false,
},
learn: {
type: Number, type: Number,
default: 0, default: null,
},
edit: { // 是否为编辑
type: Boolean,
default: null,
}, },
projectId: { projectId: {
type: Number, type: Number,
@@ -103,6 +104,27 @@ export default {
type: Number, type: Number,
default: null, 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) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -110,16 +132,15 @@ export default {
time: undefined, time: undefined,
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
tableDataTotal: -1, tableDataTotal: 0,
tableData: [ tableData: [
// {
// key: 1,
// name: "评估",
// num: "2",
// creator: "管理员",
// time: "2022-07-21 14:30:25",
// },
], ],
assessmentId:null,
assessmentName:"",
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addinvistVisible", false); ctx.emit("update:addinvistVisible", false);
@@ -139,23 +160,6 @@ export default {
width: "150px", width: "150px",
align: "left", align: "left",
className: "classify", 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: "题数", title: "题数",
@@ -183,48 +187,31 @@ export default {
}; };
const rowSelection = { const rowSelection = {
type: "radio", 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) => { onSelect: (selectedRows, selected, selectedRowKeys) => {
console.log( console.log(
"selectedRowKeys", "selectedRowKeys",selectedRowKeys,"selectedRows",selectedRows, "selected",selected );
selectedRowKeys, console.log(selectedRows.assessmentId);
"selectedRows", state.assessmentId =selectedRows.assessmentId;
selectedRows, state.assessmentName = selectedRows.name;
"selected",
selected
);
}, },
};
};
const handelChangePage = (page, pageSize) => {
state.currentPage = page;
state.pageSize = pageSize;
getAllInvistText();
};
const getTableDate = (tableData) => { const getTableDate = (tableData) => {
let data = tableData; let data = tableData;
let array = []; let array = [];
data.map((value, index) => { data.map((value, index) => {
// console.log("123", value);
let obj = { let obj = {
// id: value.routerId,
key: index, key: index,
assessmentId:value.assessmentId,
num: value.essayQuestionVoList.length, num: value.essayQuestionVoList.length,
name: value.assessmentName ? value.assessmentName : "-", name: value.assessmentName ? value.assessmentName : "-",
creator: value.createUser ? value.createUser : "-", creator: value.createUser ? value.createUser : "-",
time: value.createTime time: dayjs(value.createTime).format("YYYY-MM-DD"),
? toDate(new Date(value.createTime).getTime() / 1000, "Y-M-D h:m:s")
: "-",
}; };
array.push(obj); array.push(obj);
}); });
@@ -232,169 +219,73 @@ export default {
}; };
//获取全部评估信息接口 //获取全部评估信息接口
const getAllInvistText = () => { const getAllInvistText = () => {
let obj = {
assessmentName: "", api
.queryAssessmentDetailList({
assessmentName:state.inputV1,
pageNo: state.currentPage, pageNo: state.currentPage,
pageSize: state.pageSize, pageSize: state.pageSize,
releaseStatus: "", })
searchEndTime: "",
searchStartTime: "",
};
api
.queryAssessmentDetailList(obj)
.then((res) => { .then((res) => {
let arr = res.data.data.rows;
if (res.status === 200) { if (res.status === 200) {
// console.log("获取全部评估信息", res.data.data); // 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); getTableDate(arr);
state.tableDataTotal = Number(res.data.data.total); state.tableDataTotal = Number(res.data.data.total);
} }
// console.log("获取全部评估信息接口成功", res);
// message.success("获取全部评估信息接口成功");
// console.log(obj);
}) })
.catch((err) => { .catch((err) => {
console.log("获取全部评估信息接口失败", err); console.log("获取全部评估信息接口失败", err);
// state.createLoading = false; // state.createLoading = false;
}); });
}; };
//创建评估信息 const updateTask =()=>{
const createInvist = () => { console.log("jinlaile=================",state.assessmentName)
let obj = { if(props.isLevel){
appraiseName: state.inputV1, RouterEditTask({
appraiseEndTime: "", chapterId: props.isactive,
appraiseExplain: "", courseId: state.assessmentId,
appraiseFlag: "", name: state.assessmentName,
appraiseId: 0, routerId: props.routerId,
appraiseStartTime: "", routerTaskId: props.routerTaskId || 0,
appraiseTag: "", type: 11,
createUser: 0, })
researchId: 0,
researchName: "",
updateTime: "",
updateUser: 0,
};
api
.createAppraiseMessage(obj)
.then((res) => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
getAllInvistText();
if (props.learn == 0)
apitaskadd
.addTask({
courseId: 0,
duration: 0,
flag: true,
name: obj.appraiseName,
projectId: props.projectId,
projectTaskId: 0,
stageId: props.chooseStageId,
type: 11,
})
.then((res) => { .then((res) => {
console.log("调用项目添加接口后", res.data); console.log(res, 11111);
//自定义事件给父组件传值 message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
ctx.emit("changeData", false); ctx.emit("changeData", false);
//重新获取任务列表 closeDrawer();
// apiTask.getTask({ projectId: 28 }); state.addLoading = false;
// router.push("/taskadd");
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err, 1111);
}); });
else { }else{
let editObj1 = { console.log("=========projectTaskId",props.projectTaskId);
chapterId: 36, apiTask
courseId: 0, .addTask({
duration: 0, courseId: state.assessmentId,
flag: true, name: state.assessmentName,
name: obj.appraiseName, projectId: props.projectId,
routerId: 92, projectTaskId: props.projectTaskId || 0,
routerTaskId: 0, stageId: props.chooseStageId,
type: 11, type: 11,
}; })
RouterEditTask(editObj1); .then((res) => {
} console.log("调用项目添加接口后111", res.data, 11111);
}) ctx.emit("changeData", false);
.catch((err) => { closeDrawer();
console.log("创建失败", err); })
// state.createLoading = false; .catch((err) => {
}); console.log(err, 111111);
}; });
//搜索评估信息接口 }
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 = () => { const resetInvist = () => {
state.inputV1 = ""; state.inputV1 = "";
let objreset = { getAllInvistText();
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(() => { onMounted(() => {
// createInvist(); // createInvist();
@@ -406,10 +297,10 @@ export default {
closeDrawer, closeDrawer,
tableDataFunc, tableDataFunc,
rowSelection, rowSelection,
createInvist,
getAllInvistText, getAllInvistText,
searchInvist, updateTask,
resetInvist, resetInvist,
handelChangePage,
}; };
}, },
}; };

View File

@@ -1021,17 +1021,17 @@ export default {
state.selectedRowKeys2 = selectedRowKeys; state.selectedRowKeys2 = selectedRowKeys;
}; };
const getMousePosition = () => { const getClientHeight = () => {
state.screenHeight = document.body.clientHeight; state.screenHeight = document.body.clientHeight;
}; };
onMounted(() => { onMounted(() => {
// console.log("11111", 1); // console.log("11111", 1);
window.addEventListener("resize", getMousePosition, false); window.addEventListener("resize", getClientHeight, false);
// judgeUrl(); // judgeUrl();
}); });
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener("resize", getMousePosition, false); window.removeEventListener("resize", getClientHeight, false);
}); });
return { return {
...toRefs(state), ...toRefs(state),

View File

@@ -328,8 +328,6 @@ const rowSelection = ref({
}); });
export default { export default {
name: "AddLive", name: "AddLive",
// components: {
// },
props: { props: {
addliveVisible: { addliveVisible: {
type: Boolean, type: Boolean,
@@ -360,10 +358,6 @@ export default {
type: Boolean, type: Boolean,
default: null, default: null,
}, },
EditWorkId: { // 要编辑的workId
type: Number,
default: null,
},
projectTaskId: { // 要编辑的projectId projectTaskId: { // 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
@@ -381,89 +375,6 @@ export default {
setup(props, ctx) { setup(props, ctx) {
// const router = useRouter(); // const router = useRouter();
const state = reactive({ 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, currentPage: 1,
tableDataTotal: 100, tableDataTotal: 100,
pageSize: 10, pageSize: 10,
@@ -646,18 +557,7 @@ export default {
message.destroy(); message.destroy();
return message.warning("直播时长需大于0"); 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( let startTime = toDate(
new Date(state.time[0].$d).getTime() / 1000, new Date(state.time[0].$d).getTime() / 1000,
"Y-M-D" "Y-M-D"

View File

@@ -66,7 +66,7 @@
<div :style="{ display: creVote ? 'block' : 'none' }"> <div :style="{ display: creVote ? 'block' : 'none' }">
<div class="fileTigan"> <div class="fileTigan">
<span style="color: #388be1">{{voteStemName}}</span> <span style="color: #388be1">{{voteStemName}}</span>
<div class="delBox" @click="delBox()"></div> <div class="delBox" @click="dleVoteStem()"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -74,7 +74,8 @@
<div> <div>
<cre-vote <cre-vote
v-model:crevoteVisible="crevotevisible" v-model:crevoteVisible="crevotevisible"
@getData="changeVData" @getData="getStemId"
v-model:voteStemId="voteStemId"
/> />
</div> </div>
<!-- 创建投票侧弹窗 --> <!-- 创建投票侧弹窗 -->
@@ -195,7 +196,7 @@ export default {
endTimes: "", endTimes: "",
startTimes: "", startTimes: "",
ascriptionId: "", ascriptionId: "",
voteStemId: "", voteStemId: null,
voteId:"", voteId:"",
voteStemName:"", voteStemName:"",
}); });
@@ -209,6 +210,14 @@ export default {
const showDrawerCreVote = () => { const showDrawerCreVote = () => {
state.crevotevisible = true; state.crevotevisible = true;
}; };
const getStemId = (data) => {
state.voteStemName = data.voteStemName;
state.voteStemId = Number(data.voteStemId);
state.creVote = data.creVote;
console.log('state.voteStemId', state.voteStemId);
console.log('state.voteStemId', state.creVote);
}
//暂时没用 之前给子用传参来着
const changeVData = (data) => { const changeVData = (data) => {
console.log("111", data); console.log("111", data);
state.creVote = data.creVote; state.creVote = data.creVote;
@@ -220,25 +229,11 @@ export default {
}; };
const delBox = () => { const delBox = () => {
state.creVote = false; state.creVote = false;
dleVoteStem()
}; };
//获取题干信息 const updateTableData = (data) => {
// const getStemText = () => { console.log(data, 'data');
// 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 = () => { const dleVoteStem = () => {
@@ -249,6 +244,7 @@ export default {
.then((res) => { .then((res) => {
console.log('删除题干信息成功', res) console.log('删除题干信息成功', res)
message.success('删除题干信息成功') message.success('删除题干信息成功')
delBox()
}) })
} }
//创建投票信息 //创建投票信息
@@ -273,9 +269,6 @@ export default {
); );
} }
// if (state.crevotevisible = false) {
// changeVData()
// };
let obj = { let obj = {
ascriptionId: state.ascriptionId, ascriptionId: state.ascriptionId,
@@ -342,12 +335,14 @@ export default {
showDrawerCreVote, showDrawerCreVote,
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
getStemId,
changeVData, changeVData,
rowSelection, rowSelection,
options1, options1,
dleVoteStem, dleVoteStem,
createVoteText, createVoteText,
delBox, delBox,
updateTableData,
}; };
}, },
}; };

View File

@@ -1,5 +1,5 @@
<template> <template>
<a-drawer <a-drawer
:visible="corpowerlistVisible" :visible="corpowerlistVisible"
class="drawerStyle corpowerlistDrawer" class="drawerStyle corpowerlistDrawer"
width="80%" width="80%"
@@ -80,7 +80,8 @@
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
const columns1 = [ const columns1 = [
@@ -205,9 +206,9 @@
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { // .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; // background-color: #fafafa !important;
} // }
.corpowerlistDrawer { .corpowerlistDrawer {
.drawerMain { .drawerMain {

View File

@@ -36,7 +36,7 @@
<button class="cjtpbtn" @click="addQue()">创建题干</button> <button class="cjtpbtn" @click="addQue()">创建题干</button>
</div> </div>
<div class="queBox" v-for="(q, index) in questions" :key="index"> <div class="queBox" v-for="(q, index) in questions" :key="index">
<div class="delBtn" v-if="questions.length > 1"> <div class="delBtn" v-if="questions.length > 1" @click="delQue(questions,index)">
<img src="@/assets/images/projectadd/delete.png" alt="" /> <img src="@/assets/images/projectadd/delete.png" alt="" />
<div class="btnText">删除题干</div> <div class="btnText">删除题干</div>
</div> </div>
@@ -77,10 +77,18 @@
v-model:value="o.opvalue" v-model:value="o.opvalue"
style="width: 424px; height: 32px" style="width: 424px; height: 32px"
/> />
<button v-if="q.options.length > 2" class="delbtn" :key="index" @click="delOpt(q.options)"> <button v-if="q.options.length > 2" class="delbtn" @click="delOpt(q.options,index)">
删除 删除
</button> </button>
</div> </div>
<!-- <a-upload
v-show="!item.imgVal"
class="in uploadBtn"
:show-upload-list="false"
:before-upload="beforeUpload"
>
<div class="addimg">+ 上传图片</div>
</a-upload> -->
<a-button type="link">+ 上传图片</a-button> <a-button type="link">+ 上传图片</a-button>
<!-- <input class="file-upload" type="file" accept="image/*" name="picture"/> --> <!-- <input class="file-upload" type="file" accept="image/*" name="picture"/> -->
</div> </div>
@@ -103,7 +111,7 @@
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import * as api from "../../api/indexVote"; import * as api from "../../api/indexVote";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -152,6 +160,10 @@ export default {
], ],
}); });
}; };
const delQue = (value,index)=>{
console.log('gyd',value,index);
value.splice(value[index],1)
}
const addOpt = (value) => { const addOpt = (value) => {
console.log(value); console.log(value);
value.push({ value.push({
@@ -160,10 +172,10 @@ export default {
opvalue: "", opvalue: "",
}); });
}; };
const delOpt = (value) => { const delOpt = (value,index) => {
console.log('gys', value); console.log('gys', value,index);
// delete value[0] // delete value
value.pop() value.splice(value[index],1)
} }
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:crevoteVisible", false); ctx.emit("update:crevoteVisible", false);
@@ -174,46 +186,69 @@ export default {
//创建题干接口 //创建题干接口
const createQueTit = () => { const createQueTit = () => {
if (state.inputV1 == "") { if (!state.inputV1) {
message.destroy(); message.destroy();
return message.info("请输入投票名称"); return message.info("请输入投票名称");
} }
// if (!state.questions.inputV) { for (let i = 0; i < state.questions.length; i++) {
// message.destroy(); if (!state.questions[i].inputV) {
// return message.info("请输入题干"); message.destroy();
return message.info("请输入题干");
}
}
for (let i = 0; i < state.questions.length; i++) {
for (let k = 0; k < state.questions[i].options.length; k++) {
if (!state.questions[i].options[k].opvalue) {
message.destroy();
return message.info("请输入选项");
}
}
}
// for (let i = 0; i < state.questions.length; i++) {
// for (let k = 0; k < state.questions[i].options.length; k++) {
// // console.log('1111111111111111', state.questions);
// // console.log('2222222222222222', state.questions[i].options);
// }
// } // }
// if (!state.questions.optins.opvalue) { let obj = {
// message.destroy(); "ballotId": 0,
// return message.info("请输入选项"); "ballotName": state.inputV1,
// } "createTime": "",
console.log("111111", state.questions); "createUser": 0,
// console.log('22222',state.questions.inputV); "updateTime": "",
// console.log('333333',state.questions.options); "updateUser": 0,
let obj = [ "voteStemDtoList": [
{ {
ascriptionId: 0, "ballotId": 0,
createUser: 0, "createTime": "",
optionDetailList: [ "createUser": 0,
{ "optionDetailList": [
createUser: 0, {
optionId: 0, "createTime": "",
optionName: state.questions[0].options[0].opvalue, "createUser": 0,
optionOrderNum: "", "optionFlag": "",
optionPictureAddress: "", "optionId": 0,
stem: "", // "optionName": state.questions[i].options[k].opvalue,
updateTime: "", "optionName": "",
updateUser: 0, "optionOrderNum": "",
voteStemId: 0, "optionPictureAddress": "",
}, "stem": "",
], "updateTime": "",
orderNumber: "", "updateUser": 0,
updateTime: "", "voteStemId": 0
updateUser: 0, }
voteStemFlag: "", ],
voteStemId: 0, "orderNumber": "",
voteStemName: state.questions[0].inputV, "updateTime": "",
}, "updateUser": 0,
]; "voteStemFlag": "",
"voteStemId": 0,
// "voteStemName": state.questions[i].inputV,
"voteStemName": "",
}
]
}
api api
.createOptionMessage(obj) .createOptionMessage(obj)
.then((res) => { .then((res) => {
@@ -222,27 +257,12 @@ export default {
// console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId); // console.log('res.data.data[0].voteStemId',res.data.data[0].voteStemId);
// console.log('state.questions[0].inputV',state.questions[0].inputV); // console.log('state.questions[0].inputV',state.questions[0].inputV);
message.success("创建成功"); message.success("创建成功");
//获取题干信息
let objstem = { 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, voteStemName: state.questions[0].inputV,
voteStemId: res.data.data.voteStemVoList[0].voteStemId,
creVote: true,
}; };
ctx.emit("getData", stemData); ctx.emit("getData", objstem);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
@@ -254,6 +274,7 @@ export default {
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
addQue, addQue,
delQue,
addOpt, addOpt,
delOpt, delOpt,
createQueTit, createQueTit,
@@ -261,7 +282,7 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }

View 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>

View File

@@ -93,7 +93,7 @@
</div> </div>
</div> </div>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="添加组织" force-render> <!-- <a-tab-pane key="2" tab="添加组织" force-render>
<div class="tab2"> <div class="tab2">
<div class="t1"> <div class="t1">
<div class="organize">选择组织</div> <div class="organize">选择组织</div>
@@ -123,7 +123,7 @@
/> />
</div> </div>
</div> </div>
<!-- 选完后出现下面 -->
<div class="searchdown"> <div class="searchdown">
<div class="btns"> <div class="btns">
<div class="btn1"> <div class="btn1">
@@ -213,19 +213,7 @@
<div class="wz">重置</div> <div class="wz">重置</div>
</div> </div>
</div> </div>
<!-- <div class="line">
<div class="inline">
<div class="left1">
<div class="img"></div>
<div class="text" style="margin-left: 10px">已选择</div>
<div class="text2">2</div>
<div class="text"></div>
<div class="text3">列表选项总计</div>
<div class="text4">9</div>
</div>
<div class="right1">清空</div>
</div>
</div> -->
<div class="tabb" style="margin-top: 16px"> <div class="tabb" style="margin-top: 16px">
<a-table <a-table
style="border: 1px solid #f2f6fe" style="border: 1px solid #f2f6fe"
@@ -256,7 +244,7 @@
</div> </div>
</div> </div>
</div> </div>
</a-tab-pane> </a-tab-pane> -->
</a-tabs> </a-tabs>
</div> </div>
</div> </div>

View File

@@ -50,11 +50,7 @@
@expand="expandTable" @expand="expandTable"
:scroll="{ x: 900 }" :scroll="{ x: 900 }"
:pagination="false" :pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
/> />
</div> </div>
@@ -562,7 +558,7 @@ export default {
.classify { .classify {
// margin-left: 11px !important; // margin-left: 11px !important;
// padding-left: 9px !important; // padding-left: 9px !important;
padding-left: 0px !important; padding-left: 20px !important;
} }
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
align-items: center; align-items: center;

View File

@@ -42,7 +42,7 @@
<div class="tableBox" style="margin-top: 10px"> <div class="tableBox" style="margin-top: 10px">
<a-table <a-table
style="border: 1px solid #f2f6fe" style="border: 1px solid #f2f6fe;"
:columns="tableDataFunc()" :columns="tableDataFunc()"
:data-source="tableData" :data-source="tableData"
:loading="tableDataTotal === -1 ? true : false" :loading="tableDataTotal === -1 ? true : false"
@@ -50,11 +50,7 @@
@expand="expandTable" @expand="expandTable"
:scroll="{ x: 900 }" :scroll="{ x: 900 }"
:pagination="false" :pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
/> />
</div> </div>
<div class="tableBox"> <div class="tableBox">
@@ -107,7 +103,7 @@
<div class="close_exit" @click="closeCancelModal"></div> <div class="close_exit" @click="closeCancelModal"></div>
</div> </div>
<div class="body"> <div class="body">
<span>是否取消当前用户对此数据的权限</span> <span>您确定要取消该用户的授权吗</span>
</div> </div>
<div class="del_btnbox"> <div class="del_btnbox">
<div class="del_btn btn1"> <div class="del_btn btn1">
@@ -255,13 +251,13 @@ export default {
// width: "30%", // width: "30%",
key: "name", key: "name",
width: 70, width: 70,
align: "left", // align: "left",
className: "classify", className: "classify",
scopedSlots: { customRender: "action" }, //引入的插槽 scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => { customRender: (text) => {
// console.log(text.record.checked1); // console.log(text.record.checked1);
return ( return (
<div class="racona"> <div class="racona" >
<span> {text.record.name}</span> <span> {text.record.name}</span>
</div> </div>
); );
@@ -450,7 +446,7 @@ export default {
.classify { .classify {
// margin-left: 11px !important; // margin-left: 11px !important;
// padding-left: 9px !important; // padding-left: 9px !important;
padding-left: 0px !important; padding-left: 20px !important;
} }
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
align-items: center; align-items: center;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,484 @@
<template>
<a-drawer
:visible="addvoteVisible"
class="drawerStyle addvoteDrawer"
width="80%"
title="添加投票"
placement="right"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">添加投票任务</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="contentMain">
<div class="main_left">
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">任务名称</span>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入任务名称"
maxlength="20"
/>
</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"
:style="{ display: creVote ? 'none' : 'block' }"
@click="showDrawerCreateVote"
>
创建投票
</button>
<button
class="xkbtn"
:style="{ display: creVote ? 'block' : 'none' }"
@click="showDrawerCreateVote"
>
编辑投票
</button>
<div :style="{ display: creVote ? 'block' : 'none' }">
<div class="fileTigan">
<span style="color: #388be1">{{voteStemName}}</span>
<div class="delBox" @click="delBox()"></div>
</div>
</div>
</div>
<!-- 创建投票侧弹窗 -->
<div>
<CreateVote
v-model:createVoteVisible="createVoteVisible"
/>
</div>
<!-- 创建投票侧弹窗 -->
</div>
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">起止时间</span>
</div>
<div class="btnbox">
<a-range-picker
style="width: 424px"
v-model:value="time"
:placeholder="[' 开始时间', ' 结束时间']"
/>
</div>
</div>
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">基础投票数</span>
</div>
<div class="btnbox">
<button class="xkbtn">点击上传</button>
</div>
</div>
<div class="main_item" style="margin-top: -25px">
<div class="signbox"></div>
<div class="btnbox">
<span style="color: #999999">支持xls.xlsx</span>
</div>
</div>
<div class="main_item2">
<div class="signbox">
<span style="margin-right: 3px">投票说明</span>
</div>
<div class="textarea">
<a-textarea
v-model:value="textV1"
placeholder="请输入投票说明"
allow-clear
maxlength="150"
/>
</div>
</div>
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2" @click="createVoteText()">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
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";
import dayjs from 'dayjs';
export default {
name: "AddVote",
components: {
CreateVote,
},
props: {
addvoteVisible: {
type: Boolean,
default: false,
},
EditVoteId:{
type: Number,
default: 0,
},
edit: { // 是否为编辑
type: Boolean,
default: null,
},
projectId: {
type: Number,
default: null,
},
chooseStageId: {
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({
voteName: "",
voteExplain: "",
createVoteVisible: false,
time: undefined,
basevote: "",
ascriptionId: "",
});
const closeDrawer = () => {
ctx.emit("update:addvoteVisible", false);
ctx.emit("update:edit", false);
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
};
const showDrawerCreateVote = () => {
state.createVoteVisible = true;
console.log("进来了====");
};
const changeVData = (data) => {
state.ascriptionId = data.ascriptionId;
};
const delBox = () => {
dleVoteStem()
};
//删除题干信息接口
const dleVoteStem = () => {
let objdelstem = {
voteStemId:state.voteStemId
}
api.deleteVoteStem(objdelstem)
.then((res) => {
console.log('删除题干信息成功', res)
message.success('删除题干信息成功')
})
}
const updteVote = (res) =>{
if (props.isLevel)
apitaskadd
.addTask({
courseId: res.data.data.voteId,
name: res.data.data.voteName,
projectId: props.projectId,
projectTaskId:props.projectTaskId || 0,
stageId: props.chooseStageId,
type: 12,
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
ctx.emit("changeData", false);
})
.catch((err) => {
console.log(err);
});
else {
RouterEditTask({
chapterId: props.isactive,
courseId: res.data.data.voteId,
name: res.data.data.voteName,
routerId: props.routerId,
routerTaskId: props.routerTaskId,
type: 12,
}) .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),
showDrawerCreateVote,
afterVisibleChange,
closeDrawer,
changeVData,
dleVoteStem,
createVoteText,
delBox,
};
},
};
</script>
<style lang="scss">
.ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important;
}
.addvoteDrawer {
.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 {
display: flex;
justify-content: space-between;
.main_left {
padding-right: 30px;
flex: 1;
border-right: 1px solid #e8e8e8;
.main_item {
display: flex;
align-items: center;
margin-bottom: 32px;
.signbox {
width: 120px;
display: flex;
justify-content: end;
align-items: center;
.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;
}
}
}
}
}
.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>

View 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>

View 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>

View 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>

View File

@@ -234,17 +234,17 @@ export default {
const closeModal = () => { const closeModal = () => {
state.visible = false; state.visible = false;
}; };
const getMousePosition = () => { const getClientHeight = () => {
state.screenHeight = document.body.clientHeight; state.screenHeight = document.body.clientHeight;
}; };
onMounted(() => { onMounted(() => {
// console.log("11111", 1); // console.log("11111", 1);
window.addEventListener("resize", getMousePosition, false); window.addEventListener("resize", getClientHeight, false);
// judgeUrl(); // judgeUrl();
}); });
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener("resize", getMousePosition, false); window.removeEventListener("resize", getClientHeight, false);
}); });
return { return {

View File

@@ -51,7 +51,10 @@
<div class="imgIcon"></div> <div class="imgIcon"></div>
</div> </div>
<div class="boxs_right"> <div class="boxs_right">
<div class="imgIcon" @click="deleteChapter(element.chapterId)"></div> <div
class="imgIcon"
@click="deleteChapter(element.chapterId)"
></div>
</div> </div>
</div> </div>
<div class="items2"> <div class="items2">
@@ -1241,15 +1244,15 @@ export default {
}; };
//测试评估投票抽屉 //测试评估投票抽屉
const showDrawerAddEval = (id, eleId) => { const showDrawerAddEval = (id, eleId) => {
state.addevalVisible = true;
state.addhomeworkvisible = true;
state.EditEvalId = id; state.EditEvalId = id;
state.routerTaskId = eleId; state.routerTaskId = eleId;
}; };
const showDrawerAddInvist = (id, eleId) => { const showDrawerAddInvist = (id, eleId) => {
state.addhomeworkvisible = true; state.addinvistVisible = true;
state.EditInvistId = id;
state.routerTaskId = eleId; state.routerTaskId = eleId;
state.EditInvistId =id;
}; };
const showDrawerAddVote = (id, eleId) => { const showDrawerAddVote = (id, eleId) => {
state.addhomeworkvisible = true; state.addhomeworkvisible = true;
@@ -1713,16 +1716,20 @@ export default {
} }
}; };
//删除关卡 //删除关卡
const deleteChapter=(chapterId)=>{ const deleteChapter = (chapterId) => {
let obj={ console.log('chapterId',chapterId)
chapterId:chapterId let obj = {
} chapterId: chapterId,
api.deleteChapter(obj).then(res=>{ };
console.log('删除关卡成功',res) api
}).catch(err=>{ .deleteChapter(obj)
console.log('删除关卡失败',err) .then((res) => {
}) console.log("删除关卡成功", res);
} })
.catch((err) => {
console.log("删除关卡失败", err);
});
};
return { return {
...toRefs(state), ...toRefs(state),
// tableDataFunc, // tableDataFunc,

View File

@@ -280,6 +280,7 @@
v-model:edit="edit" v-model:edit="edit"
v-model:projectId="projectId" v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId" v-model:chooseStageId="chooseStageId"
v-model:projectTaskId="projectTaskId"
v-model:EditEvalId="EditEvalId" v-model:EditEvalId="EditEvalId"
/> />
</div> </div>
@@ -301,6 +302,8 @@
v-model:edit="edit" v-model:edit="edit"
v-model:projectId="projectId" v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId" v-model:chooseStageId="chooseStageId"
v-model:projectTaskId="projectTaskId"
v-model:EditInvistId = "EditInvistId"
/> />
</div> </div>
<!-- 添加评估侧弹窗 --> <!-- 添加评估侧弹窗 -->
@@ -321,6 +324,8 @@
v-model:edit="edit" v-model:edit="edit"
v-model:projectId="projectId" v-model:projectId="projectId"
v-model:chooseStageId="chooseStageId" v-model:chooseStageId="chooseStageId"
v-model:projectTaskId="projectTaskId"
v-model:EditVoteId = "EditVoteId"
/> />
</div> </div>
<!-- 添加投票侧弹窗 --> <!-- 添加投票侧弹窗 -->
@@ -840,19 +845,11 @@ import AddInvist from "../../components/drawers/AddInvist.vue";
import AddVote from "../../components/drawers/AddVote.vue"; import AddVote from "../../components/drawers/AddVote.vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import * as api from "../../api/indexTaskadd"; 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 apistage from "../../api/indexStage";
import * as apimove from "../../api/indexMovetask"; import * as apimove from "../../api/indexMovetask";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import { storage } from "../../api/storage"; import { storage } from "../../api/storage";
import { deleteExaminationById } from "@/api/indexExam";
import { deleteWorkTask } from "@/api/indexWork";
const drawercolumns = [ const drawercolumns = [
{ {
@@ -928,6 +925,8 @@ export default {
EditWorkId:null, // 要编辑的作业id EditWorkId:null, // 要编辑的作业id
EditTestId: null,// 要编辑的考试id EditTestId: null,// 要编辑的考试id
EditEvalId:null, EditEvalId:null,
EditInvistId:null,
EditVoteId:null,
projectTaskId:null, // 要编辑的具体任务id projectTaskId:null, // 要编辑的具体任务id
projectNameList: [ projectNameList: [
{ {
@@ -1352,13 +1351,7 @@ export default {
}); });
}; };
//获取阶段
// const getStage = () =>{
// let obj = {
// projectId:state.projectId
// }
// }
//获取删除id投票) //获取删除id投票)
const changeVData = (data) => { const changeVData = (data) => {
@@ -1370,149 +1363,6 @@ export default {
console.log("添加数据", data); console.log("添加数据", data);
getTask(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 = () => { 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 = () => { const showChangeModal = () => {
state.visiblene = true; state.visiblene = true;
}; };
@@ -1678,14 +1509,19 @@ export default {
state.projectTaskId = eleId; state.projectTaskId = eleId;
console.log("active=======",id); console.log("active=======",id);
}; };
const showDrawerAddEval = () => { const showDrawerAddEval = (id, eleId) => {
state.addevalvisible = true; state.addevalvisible = true;
state.evaluationId = id;
state.projectTaskId = eleId;
}; };
const showDrawerAddInvist = () => { const showDrawerAddInvist = (id, eleId) => {
state.addinvistvisible = true; state.addinvistvisible = true;
state.projectTaskId = eleId;
}; };
const showDrawerAddVote = () => { const showDrawerAddVote = (id, eleId) => {
state.addvotevisible = true; state.addvotevisible = true;
state.EditVoteId = id;
state.projectTaskId = eleId;
}; };
const showConfirm = () => { const showConfirm = () => {
state.confirmModal = true; state.confirmModal = true;
@@ -1840,14 +1676,6 @@ export default {
closeChangeModal, closeChangeModal,
changebgc, changebgc,
getTask, getTask,
deleteLiveBroadcast,
deleteDiscuss,
deleteEvalText,
deleteExternalChain,
deleteActivity,
deleteVoteText,
deleteInvistText,
getTableData, getTableData,
deleteTask, deleteTask,
editStage, editStage,
@@ -1859,8 +1687,6 @@ export default {
getStageData, getStageData,
moveTask, moveTask,
deleteTaskAll, deleteTaskAll,
deleteTest,
deleteWork,
decideType, decideType,

View File

@@ -446,7 +446,7 @@
</div> </div>
</a-collapse-panel> </a-collapse-panel>
</a-collapse> </a-collapse>
<!-- 无数据创建任务 --> <!-- 无数据创建任务 v-if="taskSyllabus.length == 0"-->
<router-link <router-link
to="/taskadd" to="/taskadd"
class="taskbox" class="taskbox"
@@ -454,7 +454,7 @@
background: linear-gradient(180deg, #ddeaff, #f0f8fe); background: linear-gradient(180deg, #ddeaff, #f0f8fe);
display: block; display: block;
" "
v-if="taskSyllabus.length == 0"
> >
<div class="leftt"> <div class="leftt">
<img src="../../assets/images/taskpage/left2.png" /> <img src="../../assets/images/taskpage/left2.png" />

View File

@@ -2,6 +2,7 @@ const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({ module.exports = defineConfig({
// transpileDependencies: true, // transpileDependencies: true,
devServer: { devServer: {
port:8080,
proxy: { proxy: {
"/api": { "/api": {
target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口 target: "http://111.231.196.214:30001/", //这里后台的地址模拟的;应该填写你们真实的后台接口