1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699 |
- <template>
- <!-- 项目安排 -->
- <div class="pb_content">
- <div class="race_content_body">
- <div class="raceBox">
- <div class="stepBg">
- <div
- class="steps"
- v-for="(sta, staIndex) in racePro.stageBox"
- :key="staIndex"
- >
- <div>
- <img src="../../../../assets/icon/race/progress.png" alt="" />
- </div>
- <div class="stepRightNav" @click="jump('jd' + staIndex + 1)">
- <div>阶段{{ staIndex + 1 }}</div>
- <div v-if="sta.staTitle != ''">{{ sta.staTitle }}</div>
- <div class="isFinishCss" v-if="sta.staTitle != ''">
- <div class="isFinish">
- <img src="../../../../assets/icon/race/finish.png" alt="" />
- </div>
- <div>已填写</div>
- </div>
- </div>
- </div>
- </div>
- <div class="right">
- <div
- v-for="(sa, saIndex) in racePro.stageBox"
- :key="saIndex"
- :id="'jd' + saIndex + 1"
- >
- <div class="jdTop">
- <div class="jdTopFirst jdInput">
- <div class="right_title">阶段{{ saIndex + 1 }}</div>
- <el-input
- v-model="sa.staTitle"
- @input="upRacePro"
- placeholder="阶段标题"
- ></el-input>
- </div>
- <div class="jdTopFirst">
- <div>总课时</div>
- <el-input
- v-model="sa.allTime"
- @input="upRacePro"
- disabled
- placeholder="输入阶段总课时"
- @change="isNumber($event, saIndex, '', 0)"
- ></el-input>
- </div>
- <div
- class="remove"
- v-if="racePro.stageBox.length > 1"
- @click="deleteSta(saIndex)"
- style="position: absolute; right: 0"
- ></div>
- </div>
- <div
- class="raceProBox"
- v-for="(race, raIndex) in sa.actBox"
- :key="raIndex"
- >
- <div class="raceTop allBox">
- <div style="color: #a1a4a8; font-size: 18px">
- 任务{{ raIndex + 1 }}
- </div>
- <div class="titleTop">
- <div class="leftBox"></div>
- <div class="hdName">任务名称</div>
- <div class="rwInput">
- <el-input
- v-model="race.actName"
- placeholder="输入任务名称"
- @input="upRacePro"
- ></el-input>
- </div>
- <div class="rwKs">
- <div style="min-width: 45px">课时</div>
- <el-input
- v-model="race.actTime"
- placeholder="输入任务课时"
- @input="upRacePro"
- @change="isNumber($event, saIndex, raIndex, 1)"
- ></el-input>
- </div>
- <div
- class="remove"
- v-if="racePro.stageBox[saIndex].actBox.length > 1"
- @click="deleteTask(saIndex, raIndex)"
- style="position: absolute; right: 0"
- ></div>
- </div>
- </div>
- <div class="raceTop allBox">
- <div class="lineBox">
- <div class="lineTitle">活动目标</div>
- <div class="strLine"></div>
- </div>
- <div class="editorCss">
- <editor-bar
- v-model="race.driQuestion.brief"
- @change="upRacePro"
- ></editor-bar>
- <div
- class="fullCss"
- @click="
- fullTools(race.driQuestion.brief, 1, '', saIndex, raIndex)
- "
- >
- 全屏编辑
- </div>
- </div>
- <!-- <div>
- <div class="basic_box">
- <div class="lineBox">
- <div class="lineTitleTwo">资料补充</div>
- <div class="strLine"></div>
- </div>
- <div>
- <div
- class="add_chapters_box"
- v-if="
- race.driQuestion.data &&
- race.driQuestion.data.length == 0
- "
- style="height: 185px"
- ></div>
- <div
- v-else
- class="add_chapters_box"
- style="display: flex; flex-direction: column"
- >
- <div
- class="chapter_upload"
- v-for="(item, index) in race.driQuestion.data"
- :key="item.id"
- >
- <div class="chapter_upload_t"></div>
- <div class="chapter_upload_o">
- <div class="chapter_upload_l">
- <div
- v-if="item.type == 2"
- class="chapter_upload_l_i1"
- ></div>
- <div
- v-if="item.type == 1 || item.type == 3"
- class="chapter_upload_l_i5"
- ></div>
- </div>
- <div class="chapter_upload_ic">
- <div class="chapter_upload_ic_l"></div>
- <div
- class="chapter_upload_ic_r"
- @click.stop="
- deleteChapterData(
- $event,
- sindex,
- index,
- raIndex,
- 0
- )
- "
- >
- <div></div>
- </div>
- </div>
- <div class="chapter_upload_n">
- <input
- class="first"
- v-if="item.type == 1 || item.type == 3"
- :placeholder="item.name"
- />
- <input
- class="first"
- v-if="item.type == 2"
- :placeholder="item.name"
- />
- <div class="chapter_upload_ud">
- <div class="chapter_upload_up"></div>
- <div class="chapter_upload_down"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="add_info_box">
- <button class="info_btn" @click="addImg($event)">
- 上传附件
- <input
- type="file"
- accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
- style="display: none"
- @change="
- beforeUpload($event, null, saIndex, raIndex, 0)
- "
- />
- </button>
- </div>
- <div v-if="race.driQuestion.data.proVisible" class="mask">
- <div class="progressBox">
- <div class="lbox">
- <img
- src="../../../../assets/loading.gif"
- />上传中,请稍后
- </div>
- <el-progress
- :text-inside="true"
- :stroke-width="20"
- :percentage="
- race.driQuestion.data.progress
- ? race.driQuestion.data.progress
- : 0
- "
- style="width: 80%"
- ></el-progress>
- </div>
- </div>
- </div>
- </div> -->
- </div>
- <div class="raceTop allBox">
- <div class="lineBox">
- <div class="lineTitle">活动内容</div>
- <div class="strLine"></div>
- </div>
- <div class="editorCss">
- <editor-bar
- v-model="race.tarDesign.brief"
- @change="upRacePro"
- ></editor-bar>
- <div
- class="fullCss"
- @click="
- fullTools(race.tarDesign.brief, 2, '', saIndex, raIndex)
- "
- >
- 全屏编辑
- </div>
- </div>
- <!-- <div>
- <div class="basic_box">
- <div class="lineBox">
- <div class="lineTitleTwo">资料补充</div>
- <div class="strLine"></div>
- </div>
- <div>
- <div
- class="add_chapters_box"
- v-if="
- race.tarDesign.data && race.tarDesign.data.length == 0
- "
- style="height: 185px"
- ></div>
- <div
- v-else
- class="add_chapters_box"
- style="display: flex; flex-direction: column"
- >
- <div
- class="chapter_upload"
- v-for="(item, index) in race.tarDesign.data"
- :key="item.id"
- >
- <div class="chapter_upload_t"></div>
- <div class="chapter_upload_o">
- <div class="chapter_upload_l">
- <div
- v-if="item.type == 2"
- class="chapter_upload_l_i1"
- ></div>
- <div
- v-if="item.type == 1 || item.type == 3"
- class="chapter_upload_l_i5"
- ></div>
- </div>
- <div class="chapter_upload_ic">
- <div class="chapter_upload_ic_l"></div>
- <div
- class="chapter_upload_ic_r"
- @click.stop="
- deleteChapterData(
- $event,
- sindex,
- index,
- raIndex,
- 1
- )
- "
- >
- <div></div>
- </div>
- </div>
- <div class="chapter_upload_n">
- <input
- class="first"
- v-if="item.type == 1 || item.type == 3"
- :placeholder="item.name"
- />
- <input
- class="first"
- v-if="item.type == 2"
- :placeholder="item.name"
- />
- <div class="chapter_upload_ud">
- <div class="chapter_upload_up"></div>
- <div class="chapter_upload_down"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="add_info_box">
- <button class="info_btn" @click="addImg($event)">
- 上传附件
- <input
- type="file"
- accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
- style="display: none"
- @change="
- beforeUpload($event, null, saIndex, raIndex, 1)
- "
- />
- </button>
- </div>
- <div v-if="race.tarDesign.data.proVisible" class="mask">
- <div class="progressBox">
- <div class="lbox">
- <img
- src="../../../../assets/loading.gif"
- />上传中,请稍后
- </div>
- <el-progress
- :text-inside="true"
- :stroke-width="20"
- :percentage="
- race.tarDesign.data.progress
- ? race.tarDesign.data.progress
- : 0
- "
- style="width: 80%"
- ></el-progress>
- </div>
- </div>
- </div>
- </div> -->
- </div>
- <div class="raceTop allBox">
- <div class="lineBox">
- <div class="lineTitle">预期成果</div>
- <div class="strLine"></div>
- </div>
- <div class="editorCss">
- <editor-bar
- v-model="race.actiDesign.brief"
- @change="upRacePro"
- ></editor-bar>
- <div
- class="fullCss"
- @click="
- fullTools(race.actiDesign.brief, 3, '', saIndex, raIndex)
- "
- >
- 全屏编辑
- </div>
- </div>
- <!-- <div>
- <div class="basic_box">
- <div class="lineBox">
- <div class="lineTitleTwo">资料补充</div>
- <div class="strLine"></div>
- </div>
- <div>
- <div
- class="add_chapters_box"
- v-if="
- race.actiDesign.data &&
- race.actiDesign.data.length == 0
- "
- style="height: 185px"
- ></div>
- <div
- v-else
- class="add_chapters_box"
- style="display: flex; flex-direction: column"
- >
- <div
- class="chapter_upload"
- v-for="(item, index) in race.actiDesign.data"
- :key="item.id"
- >
- <div class="chapter_upload_t"></div>
- <div class="chapter_upload_o">
- <div class="chapter_upload_l">
- <div
- v-if="item.type == 2"
- class="chapter_upload_l_i1"
- ></div>
- <div
- v-if="item.type == 1 || item.type == 3"
- class="chapter_upload_l_i5"
- ></div>
- </div>
- <div class="chapter_upload_ic">
- <div class="chapter_upload_ic_l"></div>
- <div
- class="chapter_upload_ic_r"
- @click.stop="
- deleteChapterData(
- $event,
- sindex,
- index,
- raIndex,
- 2
- )
- "
- >
- <div></div>
- </div>
- </div>
- <div class="chapter_upload_n">
- <input
- class="first"
- v-if="item.type == 1 || item.type == 3"
- :placeholder="item.name"
- />
- <input
- class="first"
- v-if="item.type == 2"
- :placeholder="item.name"
- />
- <div class="chapter_upload_ud">
- <div class="chapter_upload_up"></div>
- <div class="chapter_upload_down"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="add_info_box">
- <button class="info_btn" @click="addImg($event)">
- 上传附件
- <input
- type="file"
- accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
- style="display: none"
- @change="
- beforeUpload($event, null, saIndex, raIndex, 2)
- "
- />
- </button>
- </div>
- <div v-if="race.actiDesign.data.proVisible" class="mask">
- <div class="progressBox">
- <div class="lbox">
- <img
- src="../../../../assets/loading.gif"
- />上传中,请稍后
- </div>
- <el-progress
- :text-inside="true"
- :stroke-width="20"
- :percentage="
- race.actiDesign.data.progress
- ? race.actiDesign.data.progress
- : 0
- "
- style="width: 80%"
- ></el-progress>
- </div>
- </div>
- </div>
- </div> -->
- </div>
- <div class="raceTop allBox">
- <div class="lineBox">
- <div class="lineTitle">活动评价</div>
- <div class="strLine"></div>
- </div>
- <div class="editorCss">
- <editor-bar
- v-model="race.evaDesign.brief"
- @change="upRacePro"
- ></editor-bar>
- <div
- class="fullCss"
- @click="
- fullTools(race.evaDesign.brief, 4, '', saIndex, raIndex)
- "
- >
- 全屏编辑
- </div>
- </div>
- <!-- <div>
- <div class="basic_box">
- <div class="lineBox">
- <div class="lineTitleTwo">资料补充</div>
- <div class="strLine"></div>
- </div>
- <div>
- <div
- class="add_chapters_box"
- v-if="
- race.evaDesign.data && race.evaDesign.data.length == 0
- "
- style="height: 185px"
- ></div>
- <div
- v-else
- class="add_chapters_box"
- style="display: flex; flex-direction: column"
- >
- <div
- class="chapter_upload"
- v-for="(item, index) in race.evaDesign.data"
- :key="item.id"
- >
- <div class="chapter_upload_t"></div>
- <div class="chapter_upload_o">
- <div class="chapter_upload_l">
- <div
- v-if="item.type == 2"
- class="chapter_upload_l_i1"
- ></div>
- <div
- v-if="item.type == 1 || item.type == 3"
- class="chapter_upload_l_i5"
- ></div>
- </div>
- <div class="chapter_upload_ic">
- <div class="chapter_upload_ic_l"></div>
- <div
- class="chapter_upload_ic_r"
- @click.stop="
- deleteChapterData(
- $event,
- sindex,
- index,
- raIndex,
- 3
- )
- "
- >
- <div></div>
- </div>
- </div>
- <div class="chapter_upload_n">
- <input
- class="first"
- v-if="item.type == 1 || item.type == 3"
- :placeholder="item.name"
- />
- <input
- class="first"
- v-if="item.type == 2"
- :placeholder="item.name"
- />
- <div class="chapter_upload_ud">
- <div class="chapter_upload_up"></div>
- <div class="chapter_upload_down"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="add_info_box">
- <button class="info_btn" @click="addImg($event)">
- 上传附件
- <input
- type="file"
- accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
- style="display: none"
- @change="
- beforeUpload($event, null, saIndex, raIndex, 3)
- "
- />
- </button>
- </div>
- <div v-if="race.evaDesign.data.proVisible" class="mask">
- <div class="progressBox">
- <div class="lbox">
- <img
- src="../../../../assets/loading.gif"
- />上传中,请稍后
- </div>
- <el-progress
- :text-inside="true"
- :stroke-width="20"
- :percentage="
- race.evaDesign.data.progress
- ? race.evaDesign.data.progress
- : 0
- "
- style="width: 80%"
- ></el-progress>
- </div>
- </div>
- </div>
- </div> -->
- </div>
- <div
- class="addTaskBorder"
- @click="addTaskBorder(saIndex)"
- v-if="raIndex == racePro.stageBox[saIndex].actBox.length - 1"
- >
- <div>
- <img src="../../../../assets/icon/addHw.png" alt />
- <span>添加任务</span>
- </div>
- </div>
- </div>
- <div
- class="addTaskBorder"
- @click="addStageBorder()"
- v-if="saIndex == racePro.stageBox.length - 1"
- >
- <div>
- <img src="../../../../assets/icon/addHw.png" alt />
- <span>添加阶段</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <el-dialog
- title="编辑富文本"
- :visible.sync="full"
- :append-to-body="true"
- width="100%"
- :before-close="handleClose"
- class="dialog_diy fullEditor"
- >
- <editor-bar v-model="fullBrief" :placeholder="plaText"></editor-bar>
- <span slot="footer" class="dialog-footer">
- <el-button @click="full = false">取 消</el-button>
- <el-button type="primary" @click="addFullText">确定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import EditorBar from "../../../tools/wangEnduit";
- export default {
- components: { EditorBar },
- props: ["raceProcess"],
- data() {
- return {
- racePro: {
- stageBox: [
- {
- staTitle: "",
- allTime: "",
- brief: "",
- data: [],
- actBox: [
- {
- actName: "",
- actTime: "",
- driQuestion: { brief: "", data: [] },
- tarDesign: { brief: "", data: [] },
- actiDesign: { brief: "", data: [] },
- evaDesign: { brief: "", data: [] },
- },
- ],
- },
- ],
- },
- fullBrief: "",
- plaText: "",
- isBrief: 0,
- full: false,
- jdIndex: 0,
- rwIndex: 0,
- };
- },
- methods: {
- change(val) {
- console.log(val);
- },
- handleClose(done) {
- done();
- },
- addImg(e) {
- var el = e.currentTarget;
- el.getElementsByTagName("input")[0].click();
- e.target.value = "";
- },
- jump(t) {
- var a = document.getElementById(t);
- var b = document.getElementsByClassName("right")[0];
- b.scrollTop = a.offsetTop;
- },
- getChapterData(e, i, j, ic, type) {
- e.stopPropagation();
- if ((type == 2 || type == 3) && e.target.tagName !== "INPUT") {
- console.log("还不能下载图片喔");
- }
- },
- time() {
- if (!this.now) {
- this.now = new Date().getTime();
- return true;
- } else {
- let time = new Date().getTime();
- if (time - this.now > 3000) {
- this.now = time;
- return true;
- } else {
- return false;
- }
- }
- },
- isNumber(e, i, j, t) {
- var numReg = /^[0-9]*$/;
- var numRe = new RegExp(numReg);
- if (!numRe.test(e)) {
- this.$message.error("请输入数字!");
- if (t == 0) {
- this.racePro.stageBox[i].allTime = "";
- } else {
- this.racePro.stageBox[i].actBox[j].actTime = "";
- }
- return;
- }
- if (t == 1) {
- var a = 0;
- for (var k = 0; k < this.racePro.stageBox[i].actBox.length; k++) {
- if (this.racePro.stageBox[i].actBox[k].actTime != "") {
- a += parseInt(this.racePro.stageBox[i].actBox[k].actTime);
- }
- }
- this.racePro.stageBox[i].allTime = a;
- // if(parseInt(e) != a){
- // this.$message.error("阶段总课时需等于于阶段下所有任务的课时总数之和!");
- // this.racePro.stageBox[i].allTime = "";
- // }
- }
- },
- upRacePro() {
- this.$emit("upRacePro", this.racePro);
- },
- deleteChapterData(e, si, i, j, t) {
- e.stopPropagation();
- if (t == 0) {
- this.racePro.stageBox[si].actBox[j].driQuestion.data.splice(i, 1);
- } else if (t == 1) {
- this.racePro.stageBox[si].actBox[j].tarDesign.data.splice(i, 1);
- } else if (t == 2) {
- this.racePro.stageBox[si].actBox[j].actiDesign.data.splice(i, 1);
- } else {
- this.racePro.stageBox[si].actBox[j].evaDesign.data.splice(i, 1);
- }
- this.upRacePro();
- },
- imgChange(file, fileList, type, sindex, index, jT) {
- if (jT == 0) {
- var _tmp = this.racePro.stageBox[sindex].actBox[index].driQuestion.data;
- } else if (jT == 1) {
- var _tmp = this.racePro.stageBox[sindex].actBox[index].tarDesign.data;
- } else if (jT == 2) {
- var _tmp = this.racePro.stageBox[sindex].actBox[index].actiDesign.data;
- } else {
- var _tmp = this.racePro.stageBox[sindex].actBox[index].evaDesign.data;
- }
- this.noneBtnImg = _tmp.length >= 1;
- },
- beforeUpload(event, type, sindex, index, jsonType) {
- var file = event.target.files[0];
- var credentials = {
- accessKeyId: "AKIATLPEDU37QV5CHLMH",
- secretAccessKey: "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",
- }; //秘钥形式的登录上传
- window.AWS.config.update(credentials);
- window.AWS.config.region = "cn-northwest-1"; //设置区域
- var type1 = type;
- var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
- var _this = this;
- var b = [
- "DOC",
- "DOCX",
- "DOCM",
- "DOTM",
- "DOTX",
- "PPTX",
- "PPSX",
- "PPT",
- "PPS",
- "PPTM",
- "POTM",
- "PPAM",
- "POTX",
- "PPSM",
- ];
- var c = ["PDF", "DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
- var d = [
- "BMP",
- "PJP",
- "APNG",
- "PNG",
- "JPG",
- "GIF",
- "SVG",
- "JPEG",
- "JPG",
- "ICO",
- "PGPEG",
- "AVIF",
- ];
- if (
- b.indexOf(
- file.name
- .split(".")
- [file.name.split(".").length - 1].toLocaleUpperCase()
- ) != -1
- ) {
- if (file.size / 1024 / 1024 > 10) {
- this.$message.error("上传文件大于10M,请重新选择文件!");
- return;
- }
- } else if (
- c.indexOf(
- file.name
- .split(".")
- [file.name.split(".").length - 1].toLocaleUpperCase()
- ) != -1
- ) {
- if (file.size / 1024 / 1024 > 5) {
- this.$message.error("添加的上传文件大于5M,请重新选择文件!");
- return;
- }
- }
- if (
- c.indexOf(
- file.name
- .split(".")
- [file.name.split(".").length - 1].toLocaleUpperCase()
- ) != -1
- ) {
- type1 = 1;
- } else if (
- d.indexOf(
- file.name
- .split(".")
- [file.name.split(".").length - 1].toLocaleUpperCase()
- ) != -1
- ) {
- type1 = 3;
- } else {
- type1 = 2;
- }
- if (jsonType == 0) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.progress = 0;
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.proVisible = true;
- } else if (jsonType == 1) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.progress = 0;
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.proVisible = true;
- } else if (jsonType == 2) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.progress = 0;
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.proVisible = true;
- } else {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.progress = 0;
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.proVisible = true;
- }
- _this.$forceUpdate();
- if (file) {
- var params = {
- Key:
- file.name.split(".")[0] +
- new Date().getTime() +
- "." +
- file.name.split(".")[file.name.split(".").length - 1],
- ContentType: file.type,
- Body: file,
- "Access-Control-Allow-Credentials": "*",
- ACL: "public-read",
- }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
- var options = {
- partSize: 2048 * 1024 * 1024,
- queueSize: 2,
- leavePartsOnError: true,
- };
- bucket
- .upload(params, options)
- .on("httpUploadProgress", function (evt) {
- //这里可以写进度条
- // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
- if (jsonType == 0) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.progress = parseInt(
- (evt.loaded * 80) / evt.total
- );
- } else if (jsonType == 1) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.progress = parseInt(
- (evt.loaded * 80) / evt.total
- );
- } else if (jsonType == 2) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.progress = parseInt(
- (evt.loaded * 80) / evt.total
- );
- } else {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.progress = parseInt(
- (evt.loaded * 80) / evt.total
- );
- }
- })
- .send(function (err, data) {
- if (jsonType == 0) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.progress = 100;
- } else if (jsonType == 1) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.progress = 100;
- } else if (jsonType == 2) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.progress = 100;
- } else {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.progress = 100;
- }
- setTimeout(() => {
- if (jsonType == 0) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.proVisible = false;
- } else if (jsonType == 1) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.proVisible = false;
- } else if (jsonType == 2) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.proVisible = false;
- } else {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.proVisible = false;
- }
- _this.$forceUpdate();
- }, 1000);
- if (err) {
- _this.$message.error("上传失败");
- } else {
- if (jsonType == 0) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].driQuestion.data.push({
- name: file.name,
- url: data.Location,
- uid: file.uid,
- type: type1,
- });
- _this.imgChange(null, null, type1, sindex, index, jsonType);
- } else if (jsonType == 1) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].tarDesign.data.push({
- name: file.name,
- url: data.Location,
- uid: file.uid,
- type: type1,
- });
- _this.imgChange(null, null, type1, sindex, index, jsonType);
- } else if (jsonType == 2) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].actiDesign.data.push({
- name: file.name,
- url: data.Location,
- uid: file.uid,
- type: type1,
- });
- _this.imgChange(null, null, type1, sindex, index, jsonType);
- } else if (jsonType == 3) {
- _this.racePro.stageBox[sindex].actBox[
- index
- ].evaDesign.data.push({
- name: file.name,
- url: data.Location,
- uid: file.uid,
- type: type1,
- });
- _this.imgChange(null, null, type1, sindex, index, jsonType);
- }
- _this.upRacePro();
- console.log(data.Location);
- }
- });
- }
- },
- addTaskBorder(si) {
- this.racePro.stageBox[si].actBox.push({
- actName: "",
- actTime: "",
- driQuestion: { brief: "", data: [] },
- tarDesign: { brief: "", data: [] },
- actiDesign: { brief: "", data: [] },
- evaDesign: { brief: "", data: [] },
- });
- this.upRacePro();
- },
- addStageBorder() {
- this.racePro.stageBox.push({
- staTitle: "",
- allTime: "",
- brief: "",
- data: [],
- actBox: [
- {
- actName: "",
- actTime: "",
- driQuestion: { brief: "", data: [] },
- tarDesign: { brief: "", data: [] },
- actiDesign: { brief: "", data: [] },
- evaDesign: { brief: "", data: [] },
- },
- ],
- });
- },
- deleteTask(si, i) {
- var _this = this;
- if (_this.time()) {
- _this
- .$confirm("确定删除此活动吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- _this.racePro.stageBox[si].actBox.splice(i, 1);
- _this.$message.success("删除成功");
- this.upRacePro();
- })
- .catch(() => {
- return;
- });
- }
- },
- deleteSta(i) {
- var _this = this;
- if (_this.time()) {
- _this
- .$confirm("确定删除此阶段吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- _this.racePro.stageBox.splice(i, 1);
- _this.$message.success("删除成功");
- this.upRacePro();
- })
- .catch(() => {
- return;
- });
- }
- },
- fullTools(b, t, text, i, j) {
- this.fullBrief = b;
- this.isBrief = t;
- this.plaText = text;
- this.jdIndex = i;
- this.rwIndex = j;
- this.full = !this.full;
- },
- addFullText() {
- if (this.isBrief == 1) {
- this.racePro.stageBox[this.jdIndex].actBox[
- this.rwIndex
- ].driQuestion.brief = this.fullBrief;
- } else if (this.isBrief == 2) {
- this.racePro.stageBox[this.jdIndex].actBox[
- this.rwIndex
- ].tarDesign.brief = this.fullBrief;
- } else if (this.isBrief == 3) {
- this.racePro.stageBox[this.jdIndex].actBox[
- this.rwIndex
- ].actiDesign.brief = this.fullBrief;
- } else if (this.isBrief == 4) {
- this.racePro.stageBox[this.jdIndex].actBox[
- this.rwIndex
- ].evaDesign.brief = this.fullBrief;
- }
- this.isBrief = 0;
- this.fullBrief = "";
- this.plaText = "";
- this.jdIndex = 0;
- this.rwIndex = 0;
- this.full = !this.full;
- this.upRacePro();
- },
- },
- created() {
- this.racePro = this.raceProcess;
- },
- };
- </script>
- <style scoped>
- @media screen and (max-width: 1280px) {
- .jdTop > .jdTopFirst:nth-child(2) {
- padding-left: 5% !important;
- }
- .jdTopFirst >>> .el-input {
- width: 60% !important;
- }
- .rwKs >>> .el-input__inner {
- width: 60px !important;
- }
- .rwInput {
- width: 35% !important;
- }
- .fullCss {
- right: 1% !important;
- }
- .fullEditor >>> .el-dialog__footer {
- padding: 4% 20px 20px !important;
- }
- }
- .dialog_diy >>> .el-dialog__header {
- background: #3c3c3c !important;
- padding: 15px 20px;
- }
- .dialog_diy >>> .el-dialog__title {
- color: #fff;
- }
- .pb_content {
- width: 100%;
- height: 100%;
- }
- .race_content_body {
- width: 100%;
- position: relative;
- margin: 0;
- height: 100%;
- }
- .raceBox {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: flex-start;
- }
- .stepBg {
- padding: 80px 0 0 0;
- margin: 0 25px 0 0;
- width: 20%;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- flex-wrap: nowrap;
- background: #fff;
- /* min-height: 800px; */
- height: calc(100% - 80px);
- border-radius: 15px;
- overflow: auto;
- min-width: 260px;
- flex-direction: column;
- font-size: 14px;
- }
- .steps {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- position: relative;
- width: 145px;
- height: 130px;
- }
- .steps > div:nth-child(1) > img {
- z-index: 9;
- position: relative;
- }
- .stepRightNav {
- display: flex;
- flex-direction: column;
- flex-wrap: nowrap;
- justify-content: space-between;
- align-items: flex-start;
- margin: 8px 0 0 10px;
- height: 40px;
- cursor: pointer;
- }
- .stepRightNav:hover {
- color: #999;
- }
- .right {
- width: calc(100% - 20%);
- background: rgb(255, 255, 255);
- border-radius: 10px;
- overflow: auto;
- height: 100%;
- border-radius: 15px;
- /* max-height: 800px; */
- }
- .raceProBox {
- background: #f6f9fe;
- width: 90%;
- margin: 20px 0 0 20px;
- border-radius: 10px;
- border: 2px solid #c4d9f3;
- }
- .allBox {
- padding: 25px 25px 0 25px;
- }
- .allBox > div:nth-child(1) {
- font-size: 18px;
- }
- .raceTop > div:nth-child(2) {
- width: 100%;
- margin-top: 10px;
- }
- .titleTop {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- width: 100%;
- position: relative;
- }
- .titleTop > div:nth-child(2) {
- margin-left: 10px;
- }
- .leftBox {
- width: 5px;
- height: 15px;
- background: #5499e6;
- }
- .editorCss {
- width: 90% !important;
- position: relative;
- }
- .basic_box {
- position: relative;
- margin: 0;
- min-height: 0;
- width: 90%;
- }
- .add_info_box {
- margin: 20px 0;
- }
- .add_info_box button {
- margin: 0 10px 10px 0;
- }
- .add_chapters_box {
- text-align: left;
- background-color: rgb(232 234 237);
- width: 100%;
- padding: 0px 15px;
- border-radius: 15px;
- font-size: 16px;
- box-sizing: border-box;
- position: relative;
- padding: 0 10px 5px 10px;
- height: 125px;
- overflow-y: auto;
- overflow-x: hidden;
- }
- .chapter_upload {
- height: 50px;
- margin-top: 8px;
- position: relative;
- display: flex;
- align-items: center;
- width: 100%;
- min-height: 50px;
- }
- .chapter_upload_t {
- background-color: #fff;
- position: absolute;
- height: 100%;
- top: 0px;
- left: 0px;
- border-radius: 40px;
- box-sizing: border-box;
- box-shadow: 0 0 3px 3px #dfdfdf;
- width: 100%;
- }
- .chapter_upload_o {
- width: 100%;
- height: 100%;
- position: relative;
- z-index: 1;
- display: flex;
- align-items: center;
- }
- .chapter_upload_ic {
- height: 30px;
- float: right;
- cursor: pointer;
- position: absolute;
- width: 45px;
- right: 0;
- top: 0;
- }
- .chapter_upload_ic_l {
- width: 50px;
- height: 50px;
- float: left;
- }
- .chapter_upload_ic_l div {
- width: 30px;
- height: 35px;
- background: url("../../../../assets/icon/icon.png");
- }
- .chapter_upload_ic_r {
- width: 50px;
- height: 50px;
- float: left;
- margin-left: 0px;
- display: flex;
- align-items: center;
- position: absolute;
- }
- .chapter_upload_ic_r div {
- width: 25px;
- height: 25px;
- background-image: url("../../../../assets/delete.png");
- background-size: 100% 100%;
- }
- .chapter_upload_n {
- display: flex;
- text-indent: 10px;
- text-decoration: none;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- width: 55%;
- margin-left: 10px;
- cursor: pointer;
- margin-top: 2px;
- }
- .chapter_upload_l_i1 {
- background-image: url("../../../../assets/icon/video.png");
- width: 28px;
- height: 28px;
- background-size: 100% 100%;
- }
- .chapter_upload_l_i5 {
- background-image: url("../../../../assets/icon/word.png");
- width: 24px;
- height: 24px;
- background-size: 100% 100%;
- margin-left: 1px;
- }
- .chapter_upload_l_i8 {
- background-image: url("../../../../assets/icon/line.png");
- width: 24px;
- height: 24px;
- background-size: 100% 100%;
- margin-left: 1px;
- }
- .chapter_upload_ud {
- display: flex;
- flex-direction: column;
- margin-left: 5px;
- justify-content: center;
- z-index: 99;
- }
- .chapter_upload_up {
- background-image: url("../../../../assets/icon/up.png");
- width: 17px;
- height: 15px;
- background-size: 100% 100%;
- cursor: pointer;
- }
- .chapter_upload_down {
- background-image: url("../../../../assets/icon/down.png");
- width: 17px;
- height: 15px;
- margin: 2px auto 0 auto;
- background-size: 100% 100%;
- cursor: pointer;
- }
- .chapter_upload_l {
- padding: 1px 0 0 10px;
- }
- .first {
- border: none;
- outline: none;
- width: 80%;
- min-width: 215px;
- z-index: 99;
- font-size: 14px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .info_btn {
- color: #fff;
- background-color: #0f7eff;
- padding: 8px 24px;
- font-size: 0.9375rem;
- box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%),
- 0px 3px 1px -2px rgb(0 0 0 / 12%);
- min-width: 64px;
- font-weight: 500;
- border-radius: 4px;
- box-sizing: border-box;
- border: none;
- cursor: pointer;
- }
- .info_btn:hover {
- background-color: #4f7cd5 !important;
- }
- .hdName {
- font-size: 22px;
- color: #407eef;
- min-width: 90px;
- margin: 0 10px;
- }
- .lineBox {
- display: flex;
- margin: 0 0 20px 0;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- }
- .lineTitle,
- .lineTitleTwo {
- margin-top: 15px;
- width: 110px;
- }
- .lineTitle {
- color: #407eef;
- font-size: 22px;
- }
- .strLine {
- width: 85%;
- margin: 0 auto;
- border-top: 1px solid #e5e5e5;
- margin-top: 20px;
- }
- .addTaskBorder {
- border: 2px solid #e1e1e1;
- border-radius: 10px;
- width: 90%;
- margin: 20px 0 20px 20px;
- cursor: pointer;
- }
- .addTaskBorder > div {
- margin: 0 auto;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .addTaskBorder > div > img {
- width: 60px;
- }
- .addTaskBorder > div > span {
- font-size: 23px;
- color: #dbdbdb;
- }
- .remove {
- background-image: url(../../../../assets/remove.png);
- cursor: pointer;
- opacity: 0.5;
- width: 40px;
- height: 50px;
- background-repeat: no-repeat;
- background-position: 5px 10px;
- }
- .stepBg .steps::after {
- content: "";
- height: 100%;
- background: #eee;
- width: 4px;
- position: absolute;
- left: 15px;
- top: calc(50% + (35px / 2));
- transform: translateY(-50%);
- z-index: 1;
- }
- .mask {
- background-color: rgb(0 0 0 / 30%);
- /* position: fixed; */
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 20000;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .progressBox {
- width: 300px;
- height: 150px;
- background: #fff;
- border-radius: 10px;
- box-shadow: 0 0 6px 1px #bfbfbf;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- }
- .progressBox .lbox {
- height: 100px;
- font-size: 16px;
- display: flex;
- align-items: center;
- }
- .progressBox .lbox img {
- width: 40px;
- margin-right: 20px;
- }
- .progressBox >>> .el-progress-bar__outer {
- background-color: #d1dfff !important;
- }
- .progressBox .lbox {
- height: 100px;
- font-size: 19px;
- display: flex;
- align-items: center;
- }
- .progressBox .lbox img {
- width: 40px;
- margin-right: 20px;
- }
- .jdTop {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- justify-content: flex-start;
- padding: 20px 0 0 25px;
- position: relative;
- width: 90%;
- }
- .jdTopFirst {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- }
- .jdTop > .jdTopFirst:nth-child(2) {
- padding-left: 20%;
- }
- .jdTop > .jdTopFirst:nth-child(2) > div:nth-child(1) {
- min-width: 60px;
- }
- .jdTopFirst > input {
- width: 200px;
- height: 25px;
- }
- .firstTop {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- width: 90%;
- }
- .rightNav {
- width: 87%;
- margin-left: 15px;
- }
- .right_title {
- height: 30px;
- font-size: 1.5em;
- font-weight: bold;
- color: #0f7eff;
- width: 100px;
- }
- .rwInput {
- width: 50%;
- }
- .rwInput >>> .el-input__inner,
- .jdInput >>> .el-input__inner {
- font-size: 16px;
- }
- .rwKs {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- margin-left: 10px;
- }
- .isFinishCss {
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: flex-end;
- }
- .isFinishCss > div:nth-child(2) {
- margin-left: 5px;
- color: #939393;
- }
- .isFinish {
- width: 16px;
- height: 16px;
- margin-top: 5px;
- }
- .isFinish > img {
- width: 100%;
- height: 100%;
- }
- .fullCss {
- font-size: 12px;
- position: absolute;
- right: 4%;
- top: 12px;
- cursor: pointer;
- }
- .fullEditor >>> .text {
- height: 100% !important;
- }
- .fullEditor >>> .el-dialog {
- margin: 0 !important;
- height: 100%;
- }
- .fullEditor >>> .el-dialog__body {
- height: 70%;
- }
- .fullEditor >>> .editor {
- height: 100%;
- }
- .fullEditor >>> .el-dialog__footer {
- padding: 2% 20px 20px !important;
- }
- </style>
|