mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 03:16:44 +08:00
测评上传
This commit is contained in:
@@ -12,7 +12,6 @@ export const importList = (obj) => http.post(`${ACTIVITYAPI}/evaluation/import`,
|
||||
export const save = (obj) => http.post(`${ACTIVITYAPI}/evaluation/save`,obj)
|
||||
//保存测评详情
|
||||
export const saveEvaluationDetail = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/saveEvaluationDetail`,obj)
|
||||
// export const save = (obj) => http.post(`${ACTIVITYAPI}/evaluation/save`,obj)
|
||||
//测评封面上传
|
||||
export const uploadImage = (obj) => http.post(`${ACTIVITYAPI}/evaluation/upload-image`,obj)
|
||||
//测评总下载
|
||||
@@ -21,3 +20,11 @@ export const downloadAll = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detaild
|
||||
export const adminList = (obj) => http.post(`${ACTIVITYAPI}/permission/adminList`,obj)
|
||||
//权限启用
|
||||
export const updateStatus = (obj) => http.post(`${ACTIVITYAPI}/permission/updateStatus`,obj)
|
||||
//测评删除
|
||||
export const deleteList = (obj) => http.post(`${ACTIVITYAPI}/evaluation/delete`,obj)
|
||||
//测评详情展示
|
||||
export const getPage = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/getPage`,obj)
|
||||
//测评详情删除
|
||||
export const deleteById = (obj) => http.post(`${ACTIVITYAPI}/evaluation/detail/deleteById`,obj)
|
||||
//测评清空
|
||||
export const clear = (obj) => http.post(`${ACTIVITYAPI}/evaluation/clear`,obj)
|
||||
|
||||
@@ -64,23 +64,18 @@
|
||||
<script>
|
||||
import { ref,onMounted, reactive,toRefs,computed } from "vue";
|
||||
import dialog from "@/utils/dialog";
|
||||
import { saveAdmin } from "@/api/evaluation";
|
||||
import { getPage,deleteById } from "@/api/evaluation";
|
||||
import { useRoute } from "vue-router";
|
||||
import { message } from "ant-design-vue";
|
||||
export default {
|
||||
name: "evadown",
|
||||
components: {},
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
const state = reactive({
|
||||
searchName: '',
|
||||
tableData:[
|
||||
{
|
||||
name:'111',
|
||||
jobId:'111',
|
||||
evaluationName:'aaaaa',
|
||||
uploader:'eeeee',
|
||||
uploadDate:'2023-02-5'
|
||||
}
|
||||
],
|
||||
total: 40,
|
||||
tableData:[],
|
||||
total: 0,
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
@@ -89,16 +84,16 @@ import { saveAdmin } from "@/api/evaluation";
|
||||
const columns = ref([
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
dataIndex: "studentName",
|
||||
key: "studentName",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "jobId",
|
||||
key: "jobId",
|
||||
dataIndex: "wokeNum",
|
||||
key: "wokeNum",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
@@ -121,8 +116,8 @@ import { saveAdmin } from "@/api/evaluation";
|
||||
},
|
||||
{
|
||||
title: "上传日期",
|
||||
dataIndex: "uploadDate",
|
||||
key: "uploadDate",
|
||||
dataIndex: "updateTime",
|
||||
key: "updateTime",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
@@ -148,23 +143,38 @@ import { saveAdmin } from "@/api/evaluation";
|
||||
state.params.pageNo = page
|
||||
state.params.pageSize = pageSize
|
||||
}
|
||||
const listData = async () => {
|
||||
await getPage({
|
||||
pid:route.query.id,
|
||||
|
||||
}).then((res) => {
|
||||
console.log(res,'data')
|
||||
state.tableData = res.data.records
|
||||
state.total = res.data.total
|
||||
})
|
||||
|
||||
}
|
||||
const deleteItem = (record) => {
|
||||
dialog({
|
||||
content: '请您确认是否要删除该报告?',
|
||||
ok: () => {
|
||||
// message.success("删除成功");
|
||||
// projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].id ? (projectInfo.value.stageList[activeIndex.value].taskDraftDtoList[index].deleted = true) : projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(index, 1)
|
||||
deleteById({id:record.id}).then((res)=>{
|
||||
message.success('删除成功')
|
||||
listData()
|
||||
})
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
console.log('aaa')})
|
||||
listData()
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
columns,
|
||||
deleteItem,
|
||||
pagination,
|
||||
listData,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -68,24 +68,43 @@
|
||||
<span class="download"></span>
|
||||
</a-tooltip>
|
||||
</a-button>
|
||||
<DropDown value="更多">
|
||||
<a-button type="link" class="btn_item" @click="openEdit(record)">
|
||||
<span class="release"></span>
|
||||
编辑
|
||||
</a-button>
|
||||
<a-button type="link" class="btn_item" @click="authorityItem(record)">
|
||||
<span class="authority"></span>
|
||||
权限设置
|
||||
</a-button>
|
||||
<a-button type="link" class="btn_item" @click="deleteItem(record)">
|
||||
<span class="delete"></span>
|
||||
删除
|
||||
</a-button>
|
||||
<a-button type="link" class="btn_item" @click="emptyItem(record)">
|
||||
<span class="empty"></span>
|
||||
清空
|
||||
</a-button>
|
||||
</DropDown>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<a-dropdown :getPopupContainer='triggerNode=> triggerNode.parentNode' :trigger="['click']">
|
||||
<a class="ant-dropdown-link" @click.prevent>
|
||||
更多
|
||||
<DownOutlined />
|
||||
</a>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="0">
|
||||
<a-button type="link" class="btn_item" @click="openEdit(record)">
|
||||
<span class="release"></span>
|
||||
编辑
|
||||
</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="1">
|
||||
<a-button type="link" class="btn_item" @click="authorityItem(record)">
|
||||
<span class="authority"></span>
|
||||
权限设置
|
||||
</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="2">
|
||||
<a-button type="link" class="btn_item" @click="deleteItem(record)">
|
||||
<span class="delete"></span>
|
||||
删除
|
||||
</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="3">
|
||||
<a-button type="link" class="btn_item" @click="emptyItem(record)">
|
||||
<span class="empty"></span>
|
||||
清空
|
||||
</a-button>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -579,18 +598,30 @@
|
||||
|
||||
<script>
|
||||
import { reactive, toRefs, ref, watch,computed,onMounted } from "vue";
|
||||
import DropDown from "@/components/common/DropDown";
|
||||
import { DownOutlined } from '@ant-design/icons-vue';
|
||||
import {getCookieForName} from "@/api/method";
|
||||
import { useRouter } from "vue-router";
|
||||
import dialog from "@/utils/dialog";
|
||||
import NameInput from "@/components/project/NameInput";
|
||||
import { list,importList,save,uploadImage,downloadAll,adminList,saveEvaluationDetail,updateStatus } from "@/api/evaluation";
|
||||
import { boeRequest } from "@/api/request";
|
||||
import {
|
||||
list,
|
||||
importList,
|
||||
save,
|
||||
uploadImage,
|
||||
downloadAll,
|
||||
adminList,
|
||||
saveEvaluationDetail,
|
||||
updateStatus,
|
||||
deleteList,
|
||||
clear
|
||||
} from "@/api/evaluation";
|
||||
import { useStore } from "vuex";
|
||||
import { message } from "ant-design-vue";
|
||||
export default {
|
||||
name: 'evaluationUpload',
|
||||
components:{
|
||||
DropDown,
|
||||
DownOutlined,
|
||||
NameInput,
|
||||
},
|
||||
setup() {
|
||||
@@ -598,6 +629,11 @@ import { message } from "ant-design-vue";
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
idValue: '',
|
||||
valueAll: [],
|
||||
uploadStatus: true,
|
||||
uploadId: '',
|
||||
uploadName: '',
|
||||
serchName: '',
|
||||
bg_power: false,
|
||||
tableLoading: false,
|
||||
@@ -888,6 +924,7 @@ import { message } from "ant-design-vue";
|
||||
const textDisabled = async (record) => {
|
||||
await updateStatus({status:0}).then((res)=>{
|
||||
console.log(res,'res')
|
||||
record.status = 1
|
||||
})
|
||||
console.log(record,'aaaa')
|
||||
}
|
||||
@@ -902,7 +939,7 @@ import { message } from "ant-design-vue";
|
||||
const bgcheck = (record) =>{
|
||||
router.push({
|
||||
path:'/evadown',
|
||||
query:{id:record.name,name:record.evaluationName}
|
||||
query:{id:record.id,name:record.evaluationName}
|
||||
})
|
||||
}
|
||||
watch(() => state.searchParam.pageSize, () => {
|
||||
@@ -921,16 +958,25 @@ import { message } from "ant-design-vue";
|
||||
state.bg_check = true;
|
||||
state.formData = {}
|
||||
}
|
||||
const bgupload1 = () => {
|
||||
const bgupload1 = (record) => {
|
||||
console.log(record,'record')
|
||||
state.uploadId = record.id
|
||||
state.uploadName = record.evaluationName
|
||||
state.formData = {...record}
|
||||
state.uploadStatus = false
|
||||
state.bg_check = true;
|
||||
state.btShow = false
|
||||
}
|
||||
const downloadAll = async (record) => {
|
||||
window.open(`${process.env.VUE_APP_BASE_API}/activityApi/evaluation/detaildownload?id=${record.id}`);
|
||||
console.log(record,'record')
|
||||
// window.open(`${process.env.VUE_APP_BASE_API}/activityApi/evaluation/detaildownload?id=${record.id}`);
|
||||
}
|
||||
const of_exit = () => {
|
||||
state.bg_check = false;
|
||||
state.errorMessage = ''
|
||||
state.uploadId = ''
|
||||
state.uploadName = ''
|
||||
state.uploadStatus = true
|
||||
state.btShow = true
|
||||
state.btShowEdit = true
|
||||
}
|
||||
@@ -945,21 +991,31 @@ import { message } from "ant-design-vue";
|
||||
console.log('aaa')
|
||||
}
|
||||
const reportUpload = async () => {
|
||||
if(!state.formData.evaluationName){
|
||||
message.error('请输入测评标题名称')
|
||||
return
|
||||
}
|
||||
state.tableLoading = true
|
||||
state.bg_results = true
|
||||
await save({
|
||||
creatId:userInfo.value.userId,
|
||||
kid:userInfo.value.userId,
|
||||
creatName:userInfo.value.realName,
|
||||
prefix:'',
|
||||
remarks:state.formData.remarks,
|
||||
evaluationName:state.formData.evaluationName,
|
||||
}).then((res)=>{
|
||||
console.log(res.data,'data')
|
||||
})
|
||||
// await saveEvaluationDetail(JSON.stringify(daorures)).then((res)=>{
|
||||
// console.log(res.data,'json')
|
||||
// })
|
||||
if(state.uploadStatus){
|
||||
console.log(state.uploadStatus,'state.uploadStatus')
|
||||
await save({
|
||||
creatId:userInfo.value.userId,
|
||||
creatName:userInfo.value.realName,
|
||||
prefix:'',
|
||||
remarks:state.formData.remarks,
|
||||
evaluationName:state.formData.evaluationName,
|
||||
detailIds:state.idValue,
|
||||
}).then((res)=>{
|
||||
console.log(res.data,'data')
|
||||
})
|
||||
}
|
||||
if(state.valueAll.length != 0){
|
||||
console.log(state.valueAll,'valueAll')
|
||||
await saveEvaluationDetail({evaluationDetailListlist:state.valueAll}).then((res)=>{
|
||||
console.log(res.data,'json')
|
||||
})
|
||||
}
|
||||
of_exit()
|
||||
listData()
|
||||
}
|
||||
@@ -1012,17 +1068,22 @@ import { message } from "ant-design-vue";
|
||||
message.error("仅支持zip、pdf格式!");
|
||||
return false;
|
||||
}
|
||||
const files = file.name.split('.')[0]
|
||||
const pid = files.split('-')[2]
|
||||
const uploadName = files.split('-')[1]
|
||||
const formDatas = new FormData();
|
||||
formDatas.append("file", file);
|
||||
await importList({
|
||||
file: formDatas,
|
||||
pid,
|
||||
uploadName,
|
||||
}).then((res)=>{
|
||||
if(state.uploadId){
|
||||
formDatas.append("pid", state.uploadId);
|
||||
formDatas.append("uploadName", state.uploadName);
|
||||
}else{
|
||||
formDatas.append("uploadName", state.formData.evaluationName);
|
||||
}
|
||||
await importList(formDatas).then((res)=>{
|
||||
console.log(res,'res')
|
||||
if(res.code === 200){
|
||||
state.idValue = res.data.map(item=>item.id)
|
||||
console.log(state.idValue,'idValue')
|
||||
state.valueAll = res.data
|
||||
console.log(state.valueAll,'valueAll')
|
||||
}
|
||||
})
|
||||
return false
|
||||
}
|
||||
@@ -1040,19 +1101,30 @@ import { message } from "ant-design-vue";
|
||||
});
|
||||
state.filesList = resFileList;
|
||||
}
|
||||
const deleteItem = () => {
|
||||
const deleteItem = (record) => {
|
||||
dialog({
|
||||
content: '请您确认是否要删除测评?',
|
||||
ok: () => {
|
||||
console.log('111')
|
||||
deleteList({id:record.id}).then((res)=>{
|
||||
if(res.code === 200 ){
|
||||
message.success('删除成功')
|
||||
listData()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const emptyItem = () => {
|
||||
const emptyItem = (record) => {
|
||||
dialog({
|
||||
content: '请您确认是否要清空全部报告?',
|
||||
ok: () => {
|
||||
console.log('111')
|
||||
clear({
|
||||
creatId:record.id
|
||||
}).then((res)=>{
|
||||
console.log(res,'data')
|
||||
message.success('清空成功')
|
||||
listData()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1131,6 +1203,7 @@ import { message } from "ant-design-vue";
|
||||
console.log(record,'record')
|
||||
await updateStatus({status:0}).then((res)=>{
|
||||
console.log(res,'res')
|
||||
state.tableData1.status = 1
|
||||
})
|
||||
}
|
||||
const textDeleteAdd = (record,index) => {
|
||||
@@ -1202,6 +1275,9 @@ import { message } from "ant-design-vue";
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .ant-dropdown{
|
||||
left: 144px !important;
|
||||
}
|
||||
.evaluationUpload{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user