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