editBaseMessageDialog.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. <template>
  2. <div>
  3. <el-dialog
  4. :center="true"
  5. :visible.sync="show"
  6. :close-on-click-modal="false"
  7. :modal="true"
  8. width="auto"
  9. height="auto"
  10. :append-to-body="true"
  11. class="editBaseMessageDialog"
  12. >
  13. <div class="box">
  14. <div class="b_head">
  15. <span>编辑基本信息</span>
  16. <img src="../../../../assets/icon/classroomObservation/close.svg" @click="close()">
  17. </div>
  18. <div class="b_main">
  19. <div class="m-m-form">
  20. <div class="m-m-formItem" style="width: clamp(50%, 50%, 50%)">
  21. <div class="m-m-fi-label">课堂名称</div>
  22. <div class="m-m-fi-input">
  23. <el-input
  24. v-model="data.courseName"
  25. placeholder="请输入课堂名称"
  26. @change="changeData()"
  27. ></el-input>
  28. </div>
  29. </div>
  30. <div class="m-m-formItem" style="width: clamp(21%,21%,21%)">
  31. <div class="m-m-fi-label">授课老师</div>
  32. <div class="m-m-fi-input">
  33. <el-input
  34. v-model="data.teacherName"
  35. placeholder="请输入授课老师"
  36. @change="changeData()"
  37. ></el-input>
  38. </div>
  39. </div>
  40. <div class="m-m-formItem" style="width: clamp(22%,22%,22%)"">
  41. <div class="m-m-fi-label">授课时间</div>
  42. <div class="m-m-fi-input" style="position: relative;">
  43. <el-date-picker
  44. v-model="data.time"
  45. type="datetime"
  46. format="yyyy-MM-dd HH:mm:ss"
  47. value-format="yyyy-MM-dd HH:mm:ss"
  48. style="width: 100%;"
  49. class="m_m_fi_inputDisabledIcon"
  50. prefix-icon="none"
  51. @change="changeData()"
  52. placeholder="请选择授课时间"
  53. >
  54. </el-date-picker>
  55. <i class="el-icon-date" style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none;"></i>
  56. </div>
  57. </div>
  58. <div class="m-m-formItem" style="width: clamp(24%,24%,24%)"">
  59. <div class="m-m-fi-label">授课年级</div>
  60. <div class="m-m-fi-input">
  61. <el-select
  62. style="width: 100%"
  63. v-model="data.grade"
  64. @change="changeData()"
  65. placeholder="请选择年级"
  66. >
  67. <el-option
  68. v-for="(item, index) in gradeList"
  69. :key="index"
  70. :value="item.value"
  71. :label="item.label"
  72. ></el-option>
  73. </el-select>
  74. </div>
  75. </div>
  76. <div class="m-m-formItem" style="width: clamp(24.5%,24.5%,24.5%)">
  77. <div class="m-m-fi-label">授课科目</div>
  78. <div class="m-m-fi-input">
  79. <el-select
  80. style="width: 100%"
  81. v-model="data.subject"
  82. @change="changeData()"
  83. placeholder="请选择科目"
  84. >
  85. <el-option
  86. v-for="(item, index) in subjectList"
  87. :key="index"
  88. :value="item.value"
  89. :label="item.label"
  90. ></el-option>
  91. </el-select>
  92. </div>
  93. </div>
  94. <div class="m-m-formItem" style="width: clamp(21%,21%,21%)"">
  95. <div class="m-m-fi-label">教材版本</div>
  96. <div class="m-m-fi-input">
  97. <el-input
  98. v-model="data.textbook"
  99. placeholder="请输入教材版本"
  100. @change="changeData()"
  101. ></el-input>
  102. </div>
  103. </div>
  104. <div class="m-m-formItem" style="width: clamp(22%,22%,22%)"">
  105. <div class="m-m-fi-label">学生人数</div>
  106. <div class="m-m-fi-input">
  107. <el-input
  108. v-model.number="data.studentNum"
  109. placeholder="请输入学生人数"
  110. @change="changeData()"
  111. ></el-input>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="fileList">
  116. <div class="fl_img">
  117. <div class="imgTit">
  118. <span>课堂图片</span>
  119. <span>(建议图片比例16:9,最多上传3张)</span>
  120. </div>
  121. <div class="m-m-formImage" v-loading="uploadImageLoading">
  122. <div
  123. class="m-m-fi-imageItem"
  124. v-for="(value, key, index) in data.imageList"
  125. :key="index"
  126. v-if="(key == 'fileList1' || key == 'fileList2' || key == 'fileList3') && value.length >0"
  127. @click.stop="previewImg(value[0].url)"
  128. style="max-width:32%;"
  129. >
  130. <el-image
  131. class="itemUrl"
  132. :src="value[0].url"
  133. fit="cover"
  134. style="width: 100%;"
  135. ></el-image>
  136. <span @click.stop="delImage(key)"></span>
  137. <!-- <img class="itemUrl" :src="value[0].url" alt="" /> -->
  138. </div>
  139. <!-- 图片区域 -->
  140. <div
  141. class="m-m-fi-imageItem"
  142. @click.stop="addImage2()"
  143. style="max-width:32%;"
  144. v-if="
  145. data.imageList.fileList1 &&
  146. data.imageList.fileList1.length +
  147. data.imageList.fileList2.length +
  148. data.imageList.fileList3.length <
  149. 3
  150. "
  151. >
  152. <img
  153. src="../../../../assets/icon/classroomObservation/Union.svg"
  154. alt=""
  155. />
  156. <div
  157. style="
  158. font-size: 12px;
  159. font-weight: 400;
  160. margin-top: 5px;
  161. color: rgba(0, 0, 0, 0.4);
  162. "
  163. >
  164. 点击上传图片
  165. </div>
  166. </div>
  167. <!-- 图片区域 -->
  168. <!-- <div class="m-m-fi-btn" >添加课堂图片</div> -->
  169. </div>
  170. </div>
  171. <div class="fl_video">
  172. <div class="imgTit">
  173. <span>课堂视频</span>
  174. <span></span>
  175. <!-- <span>(建议视频比例16:9,最多上传1个)</span> -->
  176. </div>
  177. <div class="m-m-formImage" v-loading="uploadVideoLoading">
  178. <div
  179. class="m-m-fi-imageItem"
  180. style="max-width:100%;"
  181. v-if="!data.imageList.videoList.length==0"
  182. v-for="(item, index) in data.imageList.videoList?data.imageList.videoList:[]"
  183. :key="index"
  184. @click.stop="previewVideo(item.url)"
  185. >
  186. <!-- <div>{{ item }}</div> -->
  187. <el-image
  188. class="itemUrl"
  189. :src="require('../../../../assets/icon/classroomObservation/isVideo.png')"
  190. fit="cover"
  191. ></el-image>
  192. <span @click.stop="delVideo('videoList')"></span>
  193. </div>
  194. <!-- <el-progress v-if="progressData.uploadVideo && !imageList.videoList.length" class="m_m_fi_progress" :percentage="progressData.value"></el-progress> -->
  195. <el-popover
  196. placement="top"
  197. width="180"
  198. trigger="hover"
  199. style="width: 140px"
  200. v-if="(((data.imageList.videoList&&data.imageList.videoList.length<=0) || !data.imageList.videoList) && !progressData.uploadVideo)"
  201. >
  202. <div class="m_m_box">
  203. <el-button-group style="width: 100%;display: flex;justify-content: center;">
  204. <el-button size="small" @click="addVideo()">本地上传</el-button>
  205. <el-button size="small" @click="resourceUploadVideo()">资源库上传</el-button>
  206. </el-button-group>
  207. </div>
  208. <div
  209. slot="reference"
  210. class="m-m-fi-imageItem"
  211. @click.stop="addVideo()"
  212. style="max-width:100%;"
  213. v-if="(((data.imageList.videoList&&data.imageList.videoList.length<=0) || !data.imageList.videoList) && !progressData.uploadVideo)"
  214. >
  215. <img
  216. src="../../../../assets/icon/classroomObservation/Union.svg"
  217. alt=""
  218. />
  219. <div
  220. style="
  221. font-size: 12px;
  222. font-weight: 400;
  223. margin-top: 5px;
  224. color: rgba(0, 0, 0, 0.4);
  225. "
  226. >
  227. 点击上传视频
  228. </div>
  229. </div>
  230. </el-popover>
  231. <div
  232. class="m-m-fi-imageItem"
  233. style="max-width:60%;border-radius: 8px;overflow: hidden;"
  234. v-if="progressData.uploadVideo && !data.imageList.videoList.length""
  235. >
  236. <el-image
  237. class="itemUrl"
  238. :src="require('../../../../assets/icon/classroomObservation/videoFile.svg')"
  239. fit="cover"
  240. ></el-image>
  241. <div class="m_m_fi_videBtn">
  242. <img v-if="!progressData.stop" :src="require('../../../../assets/icon/classroomObservation/stopIcon.png')" @click.stop="stopUploadVideo()">
  243. <img v-if="progressData.stop" :src="require('../../../../assets/icon/classroomObservation/startIcon.png')" @click.stop="startUploadVideo()">
  244. <img :src="require('../../../../assets/icon/classroomObservation/delFile.svg')" @click.stop="delUploadVideo()">
  245. </div>
  246. <div class="m_m_fi_progress">
  247. <div>{{ progressData.value }}%</div>
  248. <span v-if="!progressData.stop">上传中...</span>
  249. <span v-else>已暂停</span>
  250. <div class="m_m_fi_p_bar">
  251. <div :style="{width:progressData.value+'%'}"></div>
  252. </div>
  253. </div>
  254. </div>
  255. <!-- <div class="m-m-fi-btn" >添加课堂图片</div> -->
  256. </div>
  257. </div>
  258. <!-- <div class="nephogramArea"> -->
  259. <div class="fl_nephogram">
  260. <div class="imgTit">
  261. <span>词云图</span>
  262. <span></span>
  263. </div>
  264. <div class="m-m-formImage">
  265. <div
  266. class="m-m-fi-nephogramItem"
  267. style="width:100%;"
  268. v-loading="uploadNephogramLoading"
  269. v-if="(data.imageList.NephogramList&&data.imageList.NephogramList.length>0)"
  270. >
  271. <wordcloudEChart :data="data.imageList.NephogramList[0]"/>
  272. <span @click.stop="delNephogram('NephogramList')"></span>
  273. </div>
  274. <div
  275. class="m-m-fi-nephogramItem"
  276. v-loading="uploadNephogramLoading"
  277. @click.stop="addNephogram()"
  278. style="width:60%;max-height: 100px;"
  279. v-if="((data.imageList.NephogramList&&data.imageList.NephogramList.length<=0) || !data.imageList.NephogramList)"
  280. >
  281. <img
  282. :src="require('../../../../assets/icon/classroomObservation/bmRefresh.png')"
  283. alt=""
  284. style="width:20px"
  285. />
  286. <div
  287. style="
  288. font-size: 12px;
  289. font-weight: 400;
  290. margin-top: 5px;
  291. color: rgba(0, 0, 0, 0.4);
  292. "
  293. >
  294. 生成词云图
  295. </div>
  296. </div>
  297. </div>
  298. <!-- </div> -->
  299. </div>
  300. </div>
  301. </div>
  302. <div class="b_bottom">
  303. <el-button size="small" @click="close()">取消</el-button>
  304. <el-button size="small" type="primary" @click="submit">确定修改</el-button>
  305. </div>
  306. <previewVideoDialog ref="previewVideoDialogRef" v-if="show"/>
  307. <uploadFile v-if="progressData.uploadVideo && show" ref="uploadFileRef" @progressUpdate="videoProgressUpdate" @delUpload="videoDelUpload" @success="updateVideoSuccess" @startUpload="videoStartUpload"/>
  308. <resourceLibraryDialog v-if="show" ref="resourceLibraryDialogRef" @addFile="resourceLibraryDialogAddFile"/>
  309. </div>
  310. </el-dialog>
  311. </div>
  312. </template>
  313. <script>
  314. import previewVideoDialog from '../components/previewVideoDialog.vue';
  315. import wordcloudEChart from '../components/wordcloudEChart.vue'
  316. import uploadFile from '../components/uploadFile.vue';
  317. import resourceLibraryDialog from '../components/resourceLibraryDialog.vue';
  318. export default {
  319. components:{
  320. previewVideoDialog,
  321. wordcloudEChart,
  322. uploadFile,
  323. resourceLibraryDialog
  324. },
  325. data() {
  326. return {
  327. loading: false,
  328. show: false,
  329. userId: this.$route.query["userid"],
  330. uploadVideoLoading:false,
  331. uploadImageLoading:false,
  332. uploadNephogramLoading:false,
  333. editId:null,
  334. data: {
  335. courseName: "",
  336. teacherName: "",
  337. time:"",
  338. grade: "",
  339. subject: "",
  340. textbook:"",
  341. studentNum: 0,
  342. imageList:{
  343. fileList1: [],
  344. fileList2: [],
  345. fileList3: [],
  346. NephogramList: [],
  347. videoList: []
  348. },
  349. },
  350. gradeList: [
  351. { value: "小学一年级", label: "小学一年级" },
  352. { value: "小学二年级", label: "小学二年级" },
  353. { value: "小学三年级", label: "小学三年级" },
  354. { value: "小学四年级", label: "小学四年级" },
  355. { value: "小学五年级", label: "小学五年级" },
  356. { value: "小学六年级", label: "小学六年级" },
  357. { value: "初中一年级", label: "初中一年级" },
  358. { value: "初中二年级", label: "初中二年级" },
  359. { value: "初中三年级", label: "初中三年级" },
  360. { value: "高中一年级", label: "高中一年级" },
  361. { value: "高中二年级", label: "高中二年级" },
  362. { value: "高中三年级", label: "高中三年级" },
  363. ],
  364. subjectList: [
  365. { value: "语文", label: "语文" },
  366. { value: "数学", label: "数学" },
  367. { value: "英语", label: "英语" },
  368. { value: "科学", label: "科学" },
  369. { value: "信息技术", label: "信息技术" },
  370. { value: "心理", label: "心理" },
  371. { value: "物理", label: "物理" },
  372. { value: "化学", label: "化学" },
  373. { value: "生物", label: "生物" },
  374. { value: "历史", label: "历史" },
  375. { value: "地理", label: "地理" },
  376. { value: "通用技术", label: "通用技术" },
  377. { value: "政治", label: "政治" },
  378. { value: "STEM", label: "STEM" },
  379. { value: "美术", label: "美术" },
  380. { value: "音乐", label: "音乐" },
  381. { value: "其他", label: "其他" },
  382. ],
  383. progressData:{
  384. stop:false,
  385. uploadVideo:false,
  386. value:0,
  387. status:"",
  388. key:"",
  389. uploadid:"",
  390. },
  391. uploadFileObj:null,
  392. loading:false,
  393. };
  394. },
  395. methods: {
  396. open({editId,message}) {
  397. this.editId = editId;
  398. this.data = JSON.parse(JSON.stringify(message));
  399. this.loading = false;
  400. this.show = true;
  401. },
  402. close() {
  403. this.show = false;
  404. this.init();
  405. },
  406. init() {
  407. this.loading = false;
  408. this.data = {
  409. courseName: "",
  410. teacherName: "",
  411. time:"",
  412. grade: "",
  413. subject: "",
  414. textbook:"",
  415. studentNum: 0,
  416. imageList:{
  417. fileList1: [],
  418. fileList2: [],
  419. fileList3: [],
  420. NephogramList: [],
  421. videoList: []
  422. }
  423. }
  424. this.progressData = {
  425. stop:false,
  426. uploadVideo:false,
  427. value:0,
  428. status:"",
  429. key:"",
  430. uploadid:"",
  431. }
  432. this.editId = null;
  433. },
  434. submit(){
  435. if(!this.data.courseName.trim())return this.$message.error("请输入胡课堂名称");
  436. this.$emit("success",{editId:this.editId,message:JSON.parse(JSON.stringify(this.data))})
  437. },
  438. changeData(){
  439. // this.$message.info("更新数据")
  440. },
  441. //本地上传
  442. localUploadVideo(){
  443. this.$message.info("本地上传")
  444. },
  445. //资源库上传
  446. resourceUploadVideo(){
  447. this.$refs.resourceLibraryDialogRef.open();
  448. },
  449. //添加视频
  450. addVideo(){
  451. let input = document.createElement("input");
  452. input.type = "file";
  453. input.accept = "video/*";
  454. input.click();
  455. input.onchange = () => {
  456. this.progressData.uploadVideo = true;
  457. // this.uploadVideoLoading = true;
  458. this.progressData.stop = false;
  459. this.progressData.status = "";
  460. this.progressData.value = 0;
  461. let file = input.files[0];
  462. this.uploadFileObj = file;
  463. this.$nextTick(()=>{
  464. this.$refs.uploadFileRef.awsupload({
  465. file:file,
  466. folderName:this.editId
  467. })
  468. })
  469. }
  470. },
  471. //删除词云图
  472. delNephogram(){
  473. this.$message.info("删除词云图")
  474. },
  475. //生成词云图
  476. addNephogram(){
  477. // this.$message.info("生成词云图")
  478. },
  479. delVideo(key){
  480. this.$confirm("确定删除该视频吗?", "提示", {
  481. confirmButtonText: "确定",
  482. cancelButtonText: "取消",
  483. type: "warning",
  484. }).then(() => {
  485. this.data.imageList.videoList = [];
  486. this.$message.success("删除成功")
  487. }).catch(e=>{
  488. console.log("取消删除")
  489. });
  490. },
  491. //资源库添加文件
  492. resourceLibraryDialogAddFile(file){
  493. let _file = file[0];
  494. if(!_file.file.endsWith(".mp4")){
  495. this.$message.error("请选择mp4视频文件")
  496. return;
  497. }
  498. console.log(_file)
  499. this.$message.info("上传文件")
  500. this.data.imageList.videoList = [{
  501. name: _file.name,
  502. status: "success",
  503. uid: _file.id,
  504. url: _file.file,
  505. }]
  506. this.$message.success("上传成功")
  507. },
  508. videoProgressUpdate(data){
  509. if(data.status=="processing"){
  510. this.progressData.value = data.percent;
  511. this.progressData.status = data.status;
  512. }else if(data.status=="fail"){
  513. this.progressData.value = data.percent;
  514. this.progressData.status = data.status;
  515. this.$message.error('上传发生错误,请点击继续上传')
  516. this.$refs.uploadFileRef.stopUpload();
  517. }else if(data.status=="success"){
  518. this.progressData.value = data.percent;
  519. this.progressData.status = data.status;
  520. this.$refs.uploadFileRef.stopUpload();
  521. }else if(data.status=="error"){
  522. this.progressData.stop = true;
  523. this.progressData.status = data.status;
  524. this.$refs.uploadFileRef.stopUpload();
  525. this.$message.error('上传发生错误,请重新上传')
  526. }
  527. console.log(this.progressData)
  528. },
  529. videoDelUpload(res){
  530. this.progressData.uploadVideo = false;
  531. this.progressData.uploadid = "";
  532. this.progressData.key = "";
  533. this.progressData.status = "";
  534. this.progressData.stop = false;
  535. this.progressData.value = 0;
  536. this.$message.success("已删除视频");
  537. },
  538. videoStartUpload({key,uploadid}){
  539. this.progressData.uploadid = uploadid;
  540. this.progressData.key = key;
  541. this.progressData.status = "start"
  542. },
  543. updateVideoSuccess(res){
  544. if(!res.data)return;
  545. this.progressData.uploadVideo = false;
  546. this.progressData.stop = false;
  547. this.progressData.uploadid = "";
  548. this.progressData.status = "";
  549. this.progressData.value = 0;
  550. let {data} = res;
  551. this.$refs.uploadFileRef.file = null;
  552. console.log(data)
  553. this.data.imageList.videoList = [{
  554. name: data.Key,
  555. status: "success",
  556. uid: this.userId,
  557. url: data.Location,
  558. }]
  559. this.$message.success("上传成功");
  560. },
  561. //上传课堂图片
  562. addImage2(){
  563. let input = document.createElement("input");
  564. input.type = "file";
  565. input.accept = "image/*";
  566. input.multiple = true;
  567. input.click();
  568. input.onchange = () => {
  569. this.uploadImageLoading = true;
  570. let promise =[];
  571. for(let i=0;i<input.files.length;i++){
  572. promise.push(this.uploadFile(input.files[i]));
  573. }
  574. Promise.all(promise).then(res=>{
  575. this.saveImage2(res)
  576. // this.$emit("saveImage2",res);
  577. this.uploadImageLoading = false;
  578. })
  579. };
  580. },
  581. saveImage2(dataList){
  582. for(let i=0;i<dataList.length;i++){
  583. if (this.data.imageList.fileList1.length == 0) {
  584. this.data.imageList.fileList1.push(dataList[i]);
  585. } else if (this.data.imageList.fileList2.length == 0) {
  586. this.data.imageList.fileList2.push(dataList[i]);
  587. } else if (this.data.imageList.fileList3.length == 0) {
  588. this.data.imageList.fileList3.push(dataList[i]);
  589. } else {
  590. this.$message.error("最多只能上传3张图片");
  591. break;
  592. }
  593. }
  594. },
  595. delImage(key){
  596. this.$confirm("确定删除该图片吗?", "提示", {
  597. confirmButtonText: "确定",
  598. cancelButtonText: "取消",
  599. type: "warning",
  600. }).then(() => {
  601. this.data.imageList[key] = [];
  602. // this.$emit("delImage", key);
  603. });
  604. },
  605. uploadFile(file){
  606. return new Promise(resolve=>{
  607. var credentials = {
  608. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  609. secretAccessKey: "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",
  610. }; //秘钥形式的登录上传
  611. window.AWS.config.update(credentials);
  612. window.AWS.config.region = "cn-northwest-1"; //设置区域
  613. var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  614. var _this = this;
  615. if (file) {
  616. var params = {
  617. Key:
  618. file.name.split(".")[0] +
  619. new Date().getTime() +
  620. "." +
  621. file.name.split(".")[file.name.split(".").length - 1],
  622. ContentType: file.type,
  623. Body: file,
  624. "Access-Control-Allow-Credentials": "*",
  625. ACL: "public-read",
  626. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  627. var options = {
  628. partSize: 2048 * 1024 * 1024,
  629. queueSize: 2,
  630. leavePartsOnError: true,
  631. };
  632. bucket
  633. .upload(params, options)
  634. .on("httpUploadProgress", function (evt) {
  635. //这里可以写进度条
  636. // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
  637. })
  638. .send(function (err, data) {
  639. if (err) {
  640. resolve(0)
  641. } else {
  642. resolve({
  643. name: data.key,
  644. status: "success",
  645. uid: "1",
  646. url: data.Location,
  647. })
  648. }
  649. });
  650. }
  651. })
  652. },
  653. previewVideo(url){
  654. this.$refs.previewVideoDialogRef.open(url)
  655. },
  656. },
  657. };
  658. </script>
  659. <style scoped>
  660. .editBaseMessageDialog >>> .el-dialog {
  661. width: 1200px !important;
  662. border-radius: 8px;
  663. background-color: #fff;
  664. overflow: hidden;
  665. padding: 0;
  666. }
  667. .editBaseMessageDialog >>> .el-dialog__body {
  668. width: 1200px !important;
  669. height: auto;
  670. flex-shrink: 0;
  671. box-sizing: border-box;
  672. overflow: auto;
  673. padding: 0;
  674. }
  675. .editBaseMessageDialog >>> .el-dialog__header {
  676. display: none !important;
  677. }
  678. .box{
  679. width:1200px;
  680. height:500px;
  681. background:#FAFAFA;
  682. border-radius:15px;
  683. box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
  684. }
  685. .b_head{
  686. width:100%;
  687. height:50px;
  688. border-radius:15px 15px 0 0;
  689. background:#fff;
  690. display:flex;
  691. align-items:center;
  692. justify-content:space-between;
  693. box-sizing: border-box;
  694. padding: 0 20px;
  695. }
  696. .b_head>span{
  697. font-size: 18px;
  698. font-weight: bold;
  699. color: #000;
  700. }
  701. .b_head>img{
  702. width: 20px;
  703. height: 20px;
  704. cursor: pointer;
  705. }
  706. .b_main{
  707. width:100%;
  708. height:calc(100% - 50px - 70px);
  709. background:#FAFAFA;
  710. padding: 20px 20px 0 20px;
  711. box-sizing: border-box;
  712. display: flex;
  713. flex-wrap: wrap;
  714. flex-direction: column;
  715. }
  716. .m-m-form {
  717. display: flex;
  718. flex-wrap: wrap;
  719. width: 100%;
  720. }
  721. .m-m-formItem {
  722. width: 100%;
  723. height: auto;
  724. display: flex;
  725. flex-direction: column;
  726. align-items: left;
  727. margin-top: 10px;
  728. margin-right: 1.5%;
  729. /* margin-bottom: 10px; */
  730. }
  731. .m-m-fi-input {
  732. max-width: 100%;
  733. }
  734. .m_m_fi_inputDisabledIcon>>> .el-input__prefix{
  735. display: none;
  736. }
  737. .m_m_fi_inputDisabledIcon>>>.el-input__inner{
  738. padding-left: 15px;
  739. }
  740. .m-m-fi-label {
  741. font-size: 16px;
  742. display: flex;
  743. padding-bottom: 5px;
  744. /* justify-content: center; */
  745. /* align-items: center; */
  746. box-sizing: border-box;
  747. /* padding: 0 10px; */
  748. text-wrap: nowrap;
  749. min-width: fit-content;
  750. }
  751. .m-m-formImage {
  752. width: 100%;
  753. height: auto;
  754. margin-bottom: 20px;
  755. display: flex;
  756. justify-content: flex-start;
  757. /* flex-wrap: wrap; */
  758. }
  759. .m-m-fi-imageList {
  760. width: 100%;
  761. height: auto;
  762. display: flex;
  763. flex-wrap: wrap;
  764. }
  765. .m-m-fi-imageItem {
  766. width: auto;
  767. height: auto;
  768. background-color: rgba(238, 238, 238, 1);
  769. width: 140px;
  770. height: 100px;
  771. min-width: 110px !important;
  772. margin-right: 1%;
  773. display: flex;
  774. justify-content: center;
  775. align-items: center;
  776. flex-direction: column;
  777. box-sizing: border-box;
  778. font-size: 14px;
  779. cursor: pointer;
  780. position: relative;
  781. margin-bottom: 10px;
  782. border-radius: 4px;
  783. border: dashed 1px #DCDCDC;
  784. overflow: hidden;
  785. }
  786. .m-m-fi-imageItem > .itemUrl {
  787. width: 100%;
  788. height: 100%;
  789. }
  790. .m-m-fi-imageItem > span {
  791. width: 20px;
  792. height: 20px;
  793. position: absolute;
  794. right: 4px;
  795. top: 4px;
  796. background-image: url("../../../../assets/icon/classroomObservation/delFile.svg");
  797. background-repeat: no-repeat;
  798. background-size: 100% 100%;
  799. display: none;
  800. z-index: 9999;
  801. /* display: flex;
  802. justify-content: flex-end;
  803. align-items: flex-start;
  804. box-sizing: border-box;
  805. padding: 2px 10px;
  806. color: #666666;
  807. font-size: 18px;
  808. background-color: #FFBBBB;
  809. cursor: pointer;
  810. border-radius: 100%;
  811. display: none; */
  812. }
  813. .m-m-fi-imageItem:hover > span {
  814. display: flex;
  815. }
  816. /* .m-m-fi-i-icon {
  817. width: 20px;
  818. height: 20px;
  819. background: url("../../../../assets/icon/classroomObservation/file.png")
  820. no-repeat;
  821. background-size: 100% 100%;
  822. margin-right: 5px;
  823. } */
  824. .m-m-fi-btn {
  825. width: auto;
  826. height: 35px;
  827. box-sizing: border-box;
  828. display: flex;
  829. justify-content: center;
  830. align-items: center;
  831. border-radius: 18px;
  832. font-size: 14px;
  833. border: solid 1px #c5c5c5;
  834. background-color: white;
  835. cursor: pointer;
  836. padding: 0 10px;
  837. }
  838. .fileList{
  839. width: 100%;
  840. position: relative;
  841. display: flex;
  842. }
  843. .fl_img{
  844. width: 50%;
  845. height: auto;
  846. }
  847. .fl_video{
  848. width: 21.8%;
  849. margin-left: 1.6%;
  850. height: auto;
  851. }
  852. .nephogramArea{
  853. width: 20%;
  854. height: auto;
  855. }
  856. .fl_nephogram{
  857. width: 20%;
  858. /* margin-left: 1.5%; */
  859. height: auto;
  860. margin-left: 1%;
  861. /* margin-top: -2%; */
  862. }
  863. .m_m_fi_progress{
  864. width: 100%;
  865. height: 100%;
  866. position: absolute;
  867. display: flex;
  868. flex-direction: column;
  869. justify-content: center;
  870. align-items: center;
  871. /* 加载 */
  872. /* cursor:wait !important; */
  873. background-color: #00000099;
  874. }
  875. .m_m_fi_progress>div:nth-child(1){
  876. font-size: 20px;
  877. color: white;
  878. }
  879. .m_m_fi_progress>span:nth-child(2){
  880. font-size: 16px;
  881. color: #FFFFFF8C;
  882. }
  883. .m_m_fi_p_bar{
  884. width: 100%;
  885. height: 5px;
  886. position: absolute;
  887. bottom: 0;
  888. background-color: #D8E3F7;
  889. }
  890. .m_m_fi_p_bar>div{
  891. background-color: #3975CE;
  892. max-width: 100%;
  893. height: 100%;
  894. }
  895. .m-m-fi-nephogramItem{
  896. width: 140px;
  897. height: 100px;
  898. background-color: rgba(238, 238, 238, 1);
  899. min-width: 140px;
  900. min-height: 100px;
  901. margin-right: 1%;
  902. display: flex;
  903. justify-content: center;
  904. align-items: center;
  905. flex-direction: column;
  906. box-sizing: border-box;
  907. font-size: 14px;
  908. cursor: pointer;
  909. position: relative;
  910. margin-bottom: 10px;
  911. border-radius: 4px;
  912. border: dashed 1px #DCDCDC;
  913. overflow: hidden;
  914. }
  915. .m-m-fi-nephogramItem> .itemUrl {
  916. width: 100%;
  917. height: 100%;
  918. }
  919. .m-m-fi-nephogramItem > span {
  920. width: 20px;
  921. height: 20px;
  922. position: absolute;
  923. right: 4px;
  924. top: 4px;
  925. background-image: url("../../../../assets/icon/classroomObservation/delFile.svg");
  926. background-repeat: no-repeat;
  927. background-size: 100% 100%;
  928. display: none;
  929. z-index: 99999;
  930. /* display: flex;
  931. justify-content: flex-end;
  932. align-items: flex-start;
  933. box-sizing: border-box;
  934. padding: 2px 10px;
  935. color: #666666;
  936. font-size: 18px;
  937. background-color: #FFBBBB;
  938. cursor: pointer;
  939. border-radius: 100%;
  940. display: none; */
  941. }
  942. .m-m-fi-nephogramItem:hover > span {
  943. display: flex;
  944. }
  945. .m_m_fi_videBtn{
  946. position: absolute;
  947. right: 4px;
  948. top: 4px;
  949. width:auto;
  950. height: 20px;
  951. background-size: 100% 100%;
  952. /* display: none; */
  953. z-index: 99999;
  954. display: flex;
  955. }
  956. .m_m_fi_videBtn>img{
  957. width: 20px;
  958. height: 20px;
  959. margin-left:10px;
  960. cursor: pointer;
  961. }
  962. .imgTit {
  963. height: 40px;
  964. line-height: 40px;
  965. }
  966. .imgTit :first-child {
  967. font-size: 16px;
  968. font-weight: 400;
  969. line-height: 22px;
  970. text-align: right;
  971. }
  972. .imgTit :last-child {
  973. font-family: PingFang SC;
  974. font-size: 12px;
  975. font-weight: 400;
  976. line-height: 20px;
  977. text-align: left;
  978. color: rgba(0, 0, 0, 0.4);
  979. }
  980. .b_bottom{
  981. width: 100%;
  982. height: 70px;
  983. display: flex;
  984. align-items: center;
  985. justify-content: flex-end;
  986. box-sizing: border-box;
  987. padding: 0 20px;
  988. }
  989. </style>