mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
测评上传
This commit is contained in:
@@ -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