mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
头像上传组件调整
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<div class="qr_header"></div>
|
||||
<div class="qr_main">
|
||||
<div class="qrm_header">
|
||||
<span style="title">选择教师专长</span>
|
||||
<span style="title">{{Addtitle}}</span>
|
||||
<div class="close_exit" @click="closeCodeModal"></div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
@@ -77,6 +77,14 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
Addtitle:{
|
||||
type:String,
|
||||
default: true,
|
||||
},
|
||||
AddContentList:{
|
||||
type:Object,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
|
||||
@@ -232,7 +232,20 @@
|
||||
|
||||
<a-radio :value="0">未认证</a-radio>
|
||||
<a-radio :value="1">已认证</a-radio>
|
||||
<span> <a-button type="text" class="moreidbtn" v-if="formParam.certStatus==1">上传凭证</a-button></span>
|
||||
<span>
|
||||
<a-upload
|
||||
multiple
|
||||
:headers="headers"
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload2"
|
||||
>
|
||||
<a-button type="text" class="moreidbtn" v-if="formParam.certStatus==1">上传凭证</a-button>
|
||||
</a-upload>
|
||||
|
||||
<!-- <span>
|
||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||
</span> -->
|
||||
</span>
|
||||
</a-radio-group>
|
||||
<!-- <FJUpload v-if="formParam.certStatus==1" v-model:value="formParam.workEnclosureAddress"/> -->
|
||||
</a-form-item>
|
||||
@@ -349,7 +362,7 @@
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
<AddContent v-model:showContent="showContent" @AddContentList="AddContentList" />
|
||||
<AddContent v-model:showContent="showContent" @AddContentList="AddContentList" :Addtitle="Addtitle" />
|
||||
<!-- <div> <Upload/> </div> -->
|
||||
</div>
|
||||
</template>
|
||||
@@ -365,7 +378,8 @@ import Editor from "@/components/project/Editor";
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { getTeacherSystemList, getTeacherList, getPayRollPlace, getLevel, insertTeacher, deleteInTeacher, updateInTeacher, getTeacherById, updateTeacherState, getTeacherExpertise, getTeacherExpertiseByPid, infoteacher, fileUp } from "../../api/Lecturer";
|
||||
import { getTeacherSystemList, getTeacherList, getPayRollPlace, getLevel, insertTeacher, deleteInTeacher, updateInTeacher, getTeacherById, updateTeacherState } from "../../api/Lecturer";
|
||||
import { fileUp } from "../../api/indexEval";
|
||||
import {getCookieForName} from "@/api/method";
|
||||
// import {getProjSt} from "../../api/indexProjStu";
|
||||
import AddContent from "../../components/project/AddContent.vue"
|
||||
@@ -384,6 +398,7 @@ export default {
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
Addtitle:'选择教师专长',
|
||||
showContent: false,
|
||||
moreid: 1,
|
||||
byPid: null,
|
||||
@@ -435,6 +450,8 @@ export default {
|
||||
activeName: 'first'
|
||||
})
|
||||
const headers = { token: getCookieForName("token") };
|
||||
//图片上传
|
||||
const imageUrl = ref('')
|
||||
const beforeUpload = (file) => {
|
||||
const isJpgOrPng =
|
||||
file.type === "image/jpg" ||
|
||||
@@ -457,6 +474,7 @@ export default {
|
||||
|
||||
const formDatas = new FormData();
|
||||
formDatas.append("file", file);
|
||||
console.log("file", file)
|
||||
fileUp(formDatas).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
console.log(res.data.data, 45);
|
||||
@@ -468,6 +486,47 @@ export default {
|
||||
});
|
||||
return false;
|
||||
};
|
||||
//附件上传
|
||||
const beforeUpload2 = (file) => {
|
||||
console.log(6765555);
|
||||
console.log(file);
|
||||
const fileType = [
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"png",
|
||||
"gif",
|
||||
"pdf",
|
||||
"ppt",
|
||||
"pptx",
|
||||
"doc",
|
||||
"docx",
|
||||
"xls",
|
||||
"xlsx",
|
||||
"zip",
|
||||
];
|
||||
if (!fileType.includes(file.name.split(".")[1])) {
|
||||
message.error(
|
||||
"仅支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip格式!"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
console.log(file);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.imgList.push({
|
||||
img: res.data.data,
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
});
|
||||
console.log(state.imgList);
|
||||
// state.hasImgName = res.data.data;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
const LecturerSystemList = ref([
|
||||
// { value: 0, systemName: "讲师体系" },
|
||||
]);
|
||||
@@ -1039,6 +1098,7 @@ console.log( "讲师体系id" +val);
|
||||
managerChange,
|
||||
headers,
|
||||
beforeUpload,
|
||||
imageUrl,
|
||||
handlemoreid,
|
||||
// changeSelect,
|
||||
handleExport,
|
||||
@@ -1078,6 +1138,7 @@ console.log( "讲师体系id" +val);
|
||||
getinfoteacher,
|
||||
addContentData,
|
||||
AddContentList,
|
||||
beforeUpload2,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -94,9 +94,16 @@
|
||||
<UploadOutlined /> 一键生成讲师费
|
||||
</a-button>
|
||||
</div> -->
|
||||
<a-button @click="handleExport()" class="resetbtn">
|
||||
<a-upload
|
||||
multiple
|
||||
:headers="headers"
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload2"
|
||||
>
|
||||
<a-button class="resetbtn">
|
||||
<DownloadOutlined /> 导入
|
||||
</a-button>
|
||||
</a-upload>
|
||||
<a-button @click="handleExport()" class="resetbtn">
|
||||
<UploadOutlined /> 导出
|
||||
</a-button>
|
||||
@@ -295,7 +302,7 @@
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a-space >
|
||||
<a-button type="link" @click="() => handleLooka(record, String(record.courseform))">查看</a-button>
|
||||
<!-- <a-button type="link" @click="() => handleLooka(record, String(record.courseform))">查看</a-button> -->
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -365,6 +372,7 @@ import { getTeacherSystemList, infoteacher, getTeacherExpertise, deleteInTeacher
|
||||
import { getNewInTeacherCourseList, getOrganization, getTeacherCourseList, insertInTeacherCourse, updateInTeacherCourse ,getCharges} from "../../api/Teaching";
|
||||
// import AddTeacher from "../../components/drawers/project/AddTeacher"
|
||||
import ImportWork from "../../components/project/ImportWork.vue";
|
||||
import { fileUp } from "../../api/Lecturer";
|
||||
export default {
|
||||
name: "InsideTeaching",
|
||||
components: {
|
||||
@@ -981,9 +989,41 @@ export default {
|
||||
const handleImport = () => {
|
||||
state.showWork = true
|
||||
}
|
||||
const beforeUpload2 = (file) => {
|
||||
console.log(6765555);
|
||||
console.log(file);
|
||||
const fileType = [
|
||||
"xls",
|
||||
"xlsx",
|
||||
"zip",
|
||||
];
|
||||
if (!fileType.includes(file.name.split(".")[1])) {
|
||||
message.error(
|
||||
"仅支持.xls,.xlsx,.zip格式!"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
console.log(file);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.imgList.push({
|
||||
img: res.data.data,
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
});
|
||||
console.log(state.imgList);
|
||||
// state.hasImgName = res.data.data;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
managerChange,
|
||||
beforeUpload2,
|
||||
rules,
|
||||
column,
|
||||
tableDatas,
|
||||
|
||||
@@ -80,9 +80,16 @@
|
||||
<UploadOutlined /> 一键生成讲师费
|
||||
</a-button>
|
||||
</div> -->
|
||||
<a-button @click="handleExport()" class="resetbtn">
|
||||
<a-upload
|
||||
multiple
|
||||
:headers="headers"
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload2"
|
||||
>
|
||||
<a-button class="resetbtn">
|
||||
<DownloadOutlined /> 导入
|
||||
</a-button>
|
||||
</a-upload>
|
||||
<a-button @click="handleExport()" class="resetbtn">
|
||||
<UploadOutlined /> 导出
|
||||
</a-button>
|
||||
@@ -392,7 +399,7 @@
|
||||
} from '@ant-design/icons-vue';
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew"
|
||||
import {getTeacherFeeList,getTeacherFeeDetail,addTeacherFee ,updateTeacherFee,updateStatusSubmit,approveTeacherFee,getTrainOrg,getTeacherLevel} from "../../api/lecturerFeeManagement";4
|
||||
import { getTeacherExpertise,getTeacherSystemList,getLevel,getPayRollPlace } from "../../api/Lecturer";
|
||||
import { getTeacherExpertise,getTeacherSystemList,getLevel,getPayRollPlace,fileUp } from "../../api/Lecturer";
|
||||
// lecturerFeeManagement
|
||||
// import {getProjSt} from "../../api/indexProjStu";
|
||||
// import AddTeacher from "../../components/drawers/project/AddTeacher"
|
||||
@@ -1040,9 +1047,41 @@ console.log( "讲师体系id" +val);
|
||||
// ...state.searchParam
|
||||
// }, `project_${new Date().getTime()}.xlsx` )
|
||||
}
|
||||
const beforeUpload2 = (file) => {
|
||||
console.log(6765555);
|
||||
console.log(file);
|
||||
const fileType = [
|
||||
"xls",
|
||||
"xlsx",
|
||||
"zip",
|
||||
];
|
||||
if (!fileType.includes(file.name.split(".")[1])) {
|
||||
message.error(
|
||||
"仅支持.xls,.xlsx,.zip格式!"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
console.log(file);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.imgList.push({
|
||||
img: res.data.data,
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
});
|
||||
console.log(state.imgList);
|
||||
// state.hasImgName = res.data.data;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
rules,
|
||||
beforeUpload2,
|
||||
closeDeleteTeacher,
|
||||
cancelTeachingDialog,
|
||||
managerChange,
|
||||
|
||||
@@ -127,28 +127,28 @@
|
||||
<div v-for="(item,index) in formParam.levelList " :key="index" >
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="4" >
|
||||
<a-input v-model:value="item.levelName" class="draitem" placeholder="" allowClear showSearch>
|
||||
<a-input v-model:value="item.levelName" class="draitem" placeholder="0" allowClear showSearch>
|
||||
</a-input>
|
||||
</a-col>
|
||||
<a-col :span="4" style="height: 5px;">
|
||||
<a-input v-model:value="item.levelTime " class="draitem"
|
||||
placeholder="" allowClear showSearch>
|
||||
placeholder="0" allowClear showSearch>
|
||||
</a-input>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-input-number id="inputNumber" v-model:value="item.sort" :min="1" :max="999" class="draitem" />
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-col :span="4" style="margin-top: 5px;">
|
||||
<a-input v-model:value="item.levelPay" class="draitem"
|
||||
placeholder="" allowClear showSearch>
|
||||
placeholder="0" allowClear showSearch>
|
||||
</a-input>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-col :span="4" style="margin-top: 5px;">
|
||||
<a-input v-model:value="item.upperLimit" class="draitem"
|
||||
placeholder="" allowClear showSearch>
|
||||
placeholder="0" allowClear showSearch>
|
||||
</a-input>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-col :span="4" style="margin-top: -10px; margin-bottom: 10px;">
|
||||
<div style="display: flex;">
|
||||
<!-- <a-button v-if="index===0" shape="circle" class="btn-circle btn-add" @click="inputAdd">+</a-button> -->
|
||||
<a-button shape="circle" class="btn-circle" @click="inputRemove(index)" :disabled="formParam.levelList.length == 1">-</a-button>
|
||||
|
||||
Reference in New Issue
Block a user