mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 23:06:47 +08:00
-- 附件
This commit is contained in:
@@ -88,8 +88,8 @@ watch(files, () => {
|
||||
watch(props, init)
|
||||
|
||||
function init() {
|
||||
if (props.value && props.value !== files.value.map(e => e.url).join(',')) {
|
||||
files.value = props.value.split(',').map(e => ({name: e, url: e}))
|
||||
if (props.value !== files.value.map(e => e.url).join(',')) {
|
||||
files.value = props.value ? props.value.split(',').map(e => ({name: e, url: e})) : []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 确定新建面授课弹窗 -->
|
||||
<!-- 确定新建面授课弹窗 -->
|
||||
<template>
|
||||
<a-modal
|
||||
v-model:visible="ft_hs"
|
||||
@@ -94,10 +94,10 @@
|
||||
:style="{ display: hideshow ? 'block' : 'none' }"
|
||||
>
|
||||
<span style="color: #999ba3">
|
||||
1、课程名称统一不加书名号。<br />
|
||||
1、课程名称统一不加书名号。<br/>
|
||||
2、项目名称、属地等信息如需体现在课程名称中,请放在课程名称信息
|
||||
之后,如“时间管理(GROW180项目)”或“时间管理(B*)”确保首先
|
||||
看到的是课程内容主题。<br />
|
||||
看到的是课程内容主题。<br/>
|
||||
3、同一课程如先后有多个版本,原则上仅开放最新版本,旧版本应停用
|
||||
版本如必须以年份标明,请以“沟通技巧(2022年)”的方式呈现。
|
||||
</span>
|
||||
@@ -310,52 +310,7 @@
|
||||
<span style="margin-right: 10px">附件</span>
|
||||
</div>
|
||||
<div class="item_inp">
|
||||
<a-upload
|
||||
multiple
|
||||
:show-upload-list="false"
|
||||
:before-upload="beforeUpload2"
|
||||
>
|
||||
<div class="accessory" style="cursor: pointer">
|
||||
<div class="accessory_icon">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/enclosure.png"
|
||||
alt="enclosure"
|
||||
/>
|
||||
</div>
|
||||
<span style="color: #4ea6ff">添加附件</span>
|
||||
</div>
|
||||
</a-upload>
|
||||
<span>
|
||||
支持.pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.gif,.zip
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mbl_items12">
|
||||
<div
|
||||
class="i12_box1"
|
||||
v-for="(item, index) in imgList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="file_img"></div>
|
||||
<div class="file_detail">
|
||||
<div class="file_updata">
|
||||
<div class="updatabox">
|
||||
<div class="updatacolor"></div>
|
||||
<div class="updataxq">上传完成</div>
|
||||
</div>
|
||||
<div class="upjd">
|
||||
<span style="margin: auto 5px">100%</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 条件渲染 e -->
|
||||
</div>
|
||||
<div class="file_operation">
|
||||
<div class="fobox">
|
||||
<span style="color: #4ea6ff" @click="handleDel(index)">
|
||||
删除
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<FJUpload v-model:value="attach"></FJUpload>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -408,29 +363,32 @@ import {
|
||||
onMounted,
|
||||
onBeforeUnmount,
|
||||
} from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { edit, detail, handle } from "@/api/indexCourse";
|
||||
import { fileUp } from "../../api/indexEval";
|
||||
import {message} from "ant-design-vue";
|
||||
import {edit, detail, handle} from "@/api/indexCourse";
|
||||
import {fileUp} from "../../api/indexEval";
|
||||
import * as api1 from "../../api/index1";
|
||||
import "@wangeditor/editor/dist/css/style.css";
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||
import {Editor, Toolbar} from "@wangeditor/editor-for-vue";
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
import FJUpload from "@/components/common/FJUpload";
|
||||
import * as moment from "moment";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Editor,
|
||||
Toolbar,
|
||||
FJUpload,
|
||||
ProjectManager,
|
||||
},
|
||||
setup(props, { expose, emit }) {
|
||||
setup(props, {expose, emit}) {
|
||||
const state = reactive({
|
||||
hideshow: true,
|
||||
attach: '',
|
||||
ft_hs: false,
|
||||
addLoading: false,
|
||||
statusJuJue: 0,
|
||||
statusTingQi: 1,
|
||||
member: { name: "", value: "" },
|
||||
member: {name: "", value: ""},
|
||||
|
||||
offcourseId: null,
|
||||
qdms_inputV1: "",
|
||||
@@ -471,7 +429,7 @@ export default defineComponent({
|
||||
state.addLoading = false;
|
||||
state.statusJuJue = 0;
|
||||
state.statusTingQi = 1;
|
||||
state.member = { name: "", value: "" };
|
||||
state.member = {name: "", value: ""};
|
||||
|
||||
state.offcourseId = null;
|
||||
state.qdms_inputV1 = "";
|
||||
@@ -484,6 +442,7 @@ export default defineComponent({
|
||||
state.tags_val = [];
|
||||
state.qdms_inputV6 = "";
|
||||
state.imgList = [];
|
||||
state.attach = '';
|
||||
|
||||
valueHtml.value = "";
|
||||
};
|
||||
@@ -509,7 +468,7 @@ export default defineComponent({
|
||||
const toolbarConfig = {
|
||||
excludeKeys: ["insertVideo", "insertImage"],
|
||||
};
|
||||
const editorConfig = { placeholder: "请输入内容...", MENU_CONF: {} };
|
||||
const editorConfig = {placeholder: "请输入内容...", MENU_CONF: {}};
|
||||
editorConfig.MENU_CONF["uploadImage"] = {
|
||||
// 自定义上传
|
||||
async customUpload(file, insertFn) {
|
||||
@@ -534,45 +493,6 @@ export default defineComponent({
|
||||
});
|
||||
// 富文本 eeeeeeeeeeeeee
|
||||
|
||||
const beforeUpload2 = (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);
|
||||
fileUp(formData).then((res) => {
|
||||
if (res.data.code === 200) {
|
||||
state.imgList.push({
|
||||
img: res.data.data,
|
||||
name: file.name,
|
||||
size: file.size,
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
const handleDel = (index) => {
|
||||
state.imgList.splice(index, 1);
|
||||
};
|
||||
|
||||
//获取分类、场景、封面图、-----------字典配置-------------------------------
|
||||
const optionsUrl = ref([]);
|
||||
const options2 = ref([]);
|
||||
@@ -672,7 +592,7 @@ export default defineComponent({
|
||||
teacherId: state.member.value,
|
||||
teacher: state.member.name,
|
||||
intro: state.qdms_inputV6,
|
||||
attach: files,
|
||||
attach: state.attach,
|
||||
outline: valueHtml.value,
|
||||
};
|
||||
console.log("postData");
|
||||
@@ -728,21 +648,9 @@ export default defineComponent({
|
||||
state.chang_jin = String(item.sceneId);
|
||||
state.tags_val = item.tips ? item.tips.split(",") : [];
|
||||
state.qdms_inputV6 = item.intro;
|
||||
state.member = { value: item.teacherId, name: item.teacher };
|
||||
if (item.attach === "") {
|
||||
state.imgList = [];
|
||||
} else {
|
||||
if (item.attach.indexOf(",")) {
|
||||
const arr = item.attach.split(",");
|
||||
arr.forEach((item) => {
|
||||
state.imgList.push({ img: item });
|
||||
});
|
||||
} else {
|
||||
state.imgList = [{ img: item.attach }];
|
||||
}
|
||||
}
|
||||
state.member = {value: item.teacherId, name: item.teacher};
|
||||
valueHtml.value = item.outline;
|
||||
|
||||
state.attach = item.attach;
|
||||
state.ft_hs = true;
|
||||
};
|
||||
|
||||
@@ -794,12 +702,9 @@ export default defineComponent({
|
||||
handleTagChange,
|
||||
handleTagClose,
|
||||
handleCreated,
|
||||
beforeUpload2,
|
||||
handleDel,
|
||||
handlePush,
|
||||
submitReview,
|
||||
reviewClick,
|
||||
|
||||
editorRef,
|
||||
valueHtml,
|
||||
mode: "simple", // 或 'simple'
|
||||
|
||||
Reference in New Issue
Block a user