mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
头像上传组件调整
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user