feat:各审核的各操作

This commit is contained in:
宋文超
2022-11-22 18:07:43 +08:00
parent ed8c5626bd
commit a730558682
8 changed files with 1892 additions and 101 deletions

View File

@@ -1025,7 +1025,7 @@
<a-upload
v-model:file-list="fileList"
name="file"
action="/api/file/upload"
action="/manageApi/file/upload"
@change="handleChange"
>
<span
@@ -1062,7 +1062,11 @@
<span style="font: oblique bold 16px Sans-serif">{{
item.name
}}</span>
<span style="color: #4ea6ff; float: right;cursor: pointer;" @click="deFile(item.uid)">删除</span>
<span
style="color: #4ea6ff; float: right; cursor: pointer"
@click="deFile(item.uid)"
>删除</span
>
</div>
</div>
</div>
@@ -3260,7 +3264,7 @@ export default {
let luj = info.attach;
console.log("lulj", luj);
console.log("赚回来", JSON.parse(luj));
state.fileList = JSON.parse(luj)
state.fileList = JSON.parse(luj);
// state.fileList = luj
}
});
@@ -3369,33 +3373,23 @@ export default {
};
//end---------项目概览
const handleChange = (info) => {
const handleChange = ({ file, fileList }) => {
let list = [];
if (info.file.status !== "uploading") {
console.log(info.file.response.data, info.fileList);
// info.fileList.map((item) => {
// //把地址放到list里
// // list.push(item.response.data);
// // list.push(JSON.stringify(item))
// state.fileList.push(item)
// });
state.fileList.push(info.file)
list = state.fileList
if (file.status !== "uploading") {
console.log("上传的list", fileList);
console.log(file);
list = state.fileList;
console.log("list", list);
// let str = list.join(",");
let str = JSON.stringify(list);
console.log("str", str);
console.log("str",str)
//要编辑项目
editProj({
attach: str,
beginTime: state.tstartTime.slice(0, 10),
// beginTime:1668643200,
boeFlag: state.boeFlag,
category: state.category,
courseSyncFlag: state.courseSyncFlag,
endTime: state.tendTime.slice(0, 10),
// endTime: 1668816000,
level: state.tlevel,
manager: state.manager,
managerId: state.managerId,
@@ -3420,10 +3414,10 @@ export default {
});
}
if (info.file.status === "done") {
message.success(`${info.file.name} 文件上传成功`);
} else if (info.file.status === "error") {
message.error(`${info.file.name} 文件上传失败.`);
if (file.status === "done") {
message.success(`${file.name} 文件上传成功`);
} else if (file.status === "error") {
message.error(`${file.name} 文件上传失败.`);
}
};
@@ -3608,45 +3602,47 @@ export default {
});
};
//删除文件
const deFile=(id)=>{
console.log(id)
let index = state.fileList.findIndex(item=>{item.uid==id})
state.fileList.splice(index,1)
let str = JSON.stringify(state.fileList)
const deFile = (id) => {
console.log(id);
let index = state.fileList.findIndex((item) => {
item.uid == id;
});
state.fileList.splice(index, 1);
let str = JSON.stringify(state.fileList);
editProj({
attach: str,
beginTime: state.tstartTime.slice(0, 10),
// beginTime:1668643200,
boeFlag: state.boeFlag,
category: state.category,
courseSyncFlag: state.courseSyncFlag,
endTime: state.tendTime.slice(0, 10),
// endTime: 1668816000,
level: state.tlevel,
manager: state.manager,
managerId: state.managerId,
name: state.name,
notice: state.notice,
noticeFlag: state.noticeFlag,
parentId: state.parentId,
picUrl: state.picUrl,
projectId: state.projectId,
remark: state.remark,
sourceBelongId: Number(state.tsourceBelong),
status: state.status,
systemId: state.tsystemId,
templateId: state.templateId || 0,
type: state.type,
attach: str,
beginTime: state.tstartTime.slice(0, 10),
// beginTime:1668643200,
boeFlag: state.boeFlag,
category: state.category,
courseSyncFlag: state.courseSyncFlag,
endTime: state.tendTime.slice(0, 10),
// endTime: 1668816000,
level: state.tlevel,
manager: state.manager,
managerId: state.managerId,
name: state.name,
notice: state.notice,
noticeFlag: state.noticeFlag,
parentId: state.parentId,
picUrl: state.picUrl,
projectId: state.projectId,
remark: state.remark,
sourceBelongId: Number(state.tsourceBelong),
status: state.status,
systemId: state.tsystemId,
templateId: state.templateId || 0,
type: state.type,
})
.then((res) => {
console.log("上传成功", res);
message.destroy();
return message.success("删除成功");
})
.then((res) => {
console.log("上传成功", res);
message.destroy()
return message.success("删除成功")
})
.catch((err) => {
console.log("上传失败了", err);
});
}
.catch((err) => {
console.log("上传失败了", err);
});
};
onMounted(() => {
getStu();
getTaskList();