评估接口+课程部分

This commit is contained in:
kclf
2022-11-08 15:49:53 +08:00
parent 57509c7e8c
commit 5a647ef48a
25 changed files with 17428 additions and 1199 deletions

View File

@@ -123,7 +123,7 @@ export default {
inputV1: "",
inputV2: "",
time: undefined,
endTimes : "",
endTimes: "",
startTimes: "",
picUrl: "",
tableData: [],
@@ -145,46 +145,47 @@ export default {
//上传组件
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
const reader = new FileReader();
reader.addEventListener("load", () => callback(reader.result));
reader.readAsDataURL(img);
}
const fileList = ref([]);
const loading = ref(false);
const imageUrl = ref('');
const imageUrl = ref("");
const handleChange = (info) => {
if (info.file.status === 'uploading') {
loading.value = true;
return;
}
if (info.file.status === 'done') {
console.log('上传图片返回的信息 %o', info)
state.picUrl = info.file.response.data;
// Get this url from response in real world.
getBase64(info.file.originFileObj, (base64Url) => {
imageUrl.value = base64Url;
const handleChange = (info) => {
if (info.file.status === "uploading") {
loading.value = true;
return;
}
if (info.file.status === "done") {
console.log("上传图片返回的信息 %o", info);
state.picUrl = info.file.response.data;
// Get this url from response in real world.
getBase64(info.file.originFileObj, (base64Url) => {
imageUrl.value = base64Url;
loading.value = false;
});
}
if (info.file.status === 'error') {
loading.value = false;
message.error('upload error');
}
}
if (info.file.status === "error") {
loading.value = false;
message.error("upload error");
}
};
const beforeUpload = (file) => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 1;
if (!isLt2M) {
message.error('Image must smaller than 1MB!');
}
return isJpgOrPng && isLt2M;
};
const beforeUpload = (file) => {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
if (!isJpgOrPng) {
message.error("You can only upload JPG file!");
}
const isLt2M = file.size / 1024 / 1024 < 1;
if (!isLt2M) {
message.error("Image must smaller than 1MB!");
}
return isJpgOrPng && isLt2M;
};
// const getTableDate = (tableData) => {
// let data = tableData;
@@ -219,11 +220,17 @@ export default {
//创建测评信息
const createEvalText = () => {
if (!state.inputV1) return message.info("请输入测评名称");
if ( state.time != undefined) {
state.endTimes = toDate(new Date(state.time[0].$d).getTime() / 1000, "Y-M-D")
state.startTimes = toDate(new Date(state.time[1].$d).getTime() / 1000, "Y-M-D")
}
if (state.time != undefined) {
state.endTimes = toDate(
new Date(state.time[0].$d).getTime() / 1000,
"Y-M-D"
);
state.startTimes = toDate(
new Date(state.time[1].$d).getTime() / 1000,
"Y-M-D"
);
}
let obj = {
evaluationName: state.inputV1,
createTime: "",