livehelpModel.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. <template>
  2. <div class="systemNotifyModel">
  3. <div class="m-core">
  4. <el-form
  5. :model="form"
  6. :rules="rules"
  7. ref="form"
  8. label-width="110px"
  9. style="width: 100%"
  10. >
  11. <el-form-item label="标题" prop="title">
  12. <el-input v-model.trim="form.title" placeholder="请输入标题"></el-input>
  13. </el-form-item>
  14. <el-form-item label="排序值">
  15. <el-input
  16. v-model.trim="form.order"
  17. placeholder="请输入排序值"
  18. type="number"
  19. ></el-input>
  20. </el-form-item>
  21. <el-form-item prop="subType" label="类型">
  22. <el-select v-model="form.subType" clearable placeholder="帮助类型">
  23. <el-option
  24. v-for="item in typeList"
  25. :key="item.id"
  26. :label="item.name"
  27. :value="item.id"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <!-- <el-form-item label="自动开启时间" prop="actionTime" :rules="[{required: true, message: '请选择自动开启时间范围', trigger: 'change'}]">
  32. <el-date-picker style="width:400px;"
  33. v-model="form.actionTime"
  34. :clearable="false"
  35. type="datetimerange"
  36. range-separator="至"
  37. :picker-options="{ firstDayOfWeek: 1 }"
  38. start-placeholder="开始日期"
  39. end-placeholder="结束日期">
  40. </el-date-picker>
  41. </el-form-item> -->
  42. <el-form-item
  43. label="内容"
  44. prop="content"
  45. v-if="outUrlRadio == 0"
  46. :rules="[{ required: true, message: '请编辑内容', trigger: 'blur' }]"
  47. >
  48. <quill-editor
  49. class="ql-editor"
  50. style="margin-top: -17px"
  51. v-model="form.content"
  52. ref="myQuillEditor"
  53. :options="editorOption"
  54. @change="onEditorChange($event)"
  55. ></quill-editor>
  56. <el-upload
  57. class="ivu-upload"
  58. :show-upload-list="false"
  59. :on-success="handleSuccess"
  60. accept=".jpg, .jpeg, .png, .gif"
  61. :max-size="2048"
  62. multiple
  63. :action="ossUploadUrl"
  64. :data="dataObj"
  65. :before-upload="beforeImgUpload"
  66. >
  67. <Button icon="ios-cloud-upload-outline"></Button>
  68. </el-upload>
  69. </el-form-item>
  70. <el-form-item>
  71. <el-button @click="onSubmit('form')" type="primary"
  72. >立即{{ pageType == "create" ? "创建" : "修改" }}</el-button
  73. >
  74. <el-button @click="onReSet('form')">重置</el-button>
  75. <!-- <el-button @click="onLook">预览</el-button> -->
  76. </el-form-item>
  77. </el-form>
  78. </div>
  79. <el-dialog
  80. title="插入视频"
  81. :append-to-body="true"
  82. width="500px"
  83. @close="onDialogClose('diologForm')"
  84. :visible.sync="dialogFormVisible"
  85. >
  86. <el-form :model="dialogForm" ref="diologForm" :rules="dialogFormRules">
  87. <el-form-item
  88. label="封面图地址"
  89. prop="poster"
  90. :rules="[
  91. {
  92. required: uploadType == 2 ? true : false,
  93. message: '请上传封面图',
  94. trigger: 'blur',
  95. },
  96. ]"
  97. label-width="120px"
  98. >
  99. <el-upload
  100. class="avatar-uploader"
  101. style="line-height: 0; display: inline-block"
  102. :action="ossUploadUrl"
  103. :data="dataObj"
  104. :show-file-list="false"
  105. v-loading="uploadImgLoading"
  106. accept=".jpg, .jpeg, .png, .gif"
  107. :on-success="handleImgSuccess"
  108. :on-error="handleUploadImgError"
  109. :before-upload="beforeImgUpload"
  110. >
  111. <img v-if="dialogForm.poster" :src="dialogForm.poster" class="avatar" />
  112. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  113. </el-upload>
  114. </el-form-item>
  115. <el-form-item label="视频类型" label-width="120px">
  116. <el-radio-group v-model="formRadio">
  117. <el-radio :label="1">外部链接</el-radio>
  118. <el-radio :label="2">上传</el-radio>
  119. </el-radio-group>
  120. </el-form-item>
  121. <el-form-item
  122. v-if="formRadio == 1"
  123. label="视频地址"
  124. label-width="120px"
  125. prop="url"
  126. >
  127. <el-input
  128. v-model="dialogForm.url"
  129. style="width: 100%"
  130. autocomplete="off"
  131. ></el-input>
  132. </el-form-item>
  133. <el-form-item
  134. v-if="formRadio == 2"
  135. label="上传视频"
  136. label-width="120px"
  137. prop="videoUrl"
  138. >
  139. <el-upload
  140. class="upload-demo"
  141. style="display: inline-block"
  142. v-loading="uploadLoading"
  143. :action="ossUploadUrl"
  144. :data="dataObj"
  145. :before-upload="beforeUpload"
  146. :on-success="handleUploadSuccess"
  147. :on-error="handleUploadError"
  148. :show-file-list="false"
  149. accept=".mp4"
  150. :file-list="fileList"
  151. :on-exceed="handleExceed"
  152. >
  153. <video
  154. style="width: 120px; height: 120px"
  155. v-if="dialogForm.videoUrl"
  156. type="video/mp4"
  157. preload="auto"
  158. :src="dialogForm.videoUrl"
  159. ></video>
  160. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  161. </el-upload>
  162. <p class="imageSize">
  163. <!-- 广告管理 & 广告类型为 视频 -->
  164. <span v-if="uploadType == 2 && type == 8"
  165. >上传视频尺寸建议:1242px * 2208px;</span
  166. ><br />
  167. 只能上传mp4文件, 且不超过100M
  168. </p>
  169. </el-form-item>
  170. </el-form>
  171. <div slot="footer" class="dialog-footer">
  172. <el-button @click="dialogFormVisible = false">取 消</el-button>
  173. <el-button type="primary" @click="onVideoComfirm('diologForm')">确 定</el-button>
  174. </div>
  175. </el-dialog>
  176. <el-dialog
  177. width="375px"
  178. title="预览"
  179. :append-to-body="true"
  180. :visible.sync="lookVisible"
  181. >
  182. <div class="sd-container">
  183. <h2>{{ dataInfo.title }}</h2>
  184. <div class="titleInfo">
  185. <p>{{ typeCheck(dataInfo.type) }}</p>
  186. <p>{{ dataInfo.updateTime }}</p>
  187. </div>
  188. <div class="msgWrap quill-editor ql-editor" v-html="dataInfo.content"></div>
  189. </div>
  190. </el-dialog>
  191. </div>
  192. </template>
  193. <script>
  194. import { policy } from "@/api/appTenant";
  195. import { newsQueryId, newsAdd, newsUpdate } from "@/api/contentManager";
  196. import { getToken } from "@/utils/auth";
  197. import { vaildStudentUrl } from "@/utils/validate";
  198. import "quill/dist/quill.core.css";
  199. import "quill/dist/quill.snow.css";
  200. import "quill/dist/quill.bubble.css";
  201. import Quill from "quill";
  202. import { quillEditor } from "vue-quill-editor";
  203. // 工具栏配置
  204. const toolbarOptions = [
  205. ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
  206. ["blockquote", "code-block"], // 引用 代码块
  207. [{ header: 1 }, { header: 2 }], // 1、2 级标题
  208. [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
  209. [{ script: "sub" }, { script: "super" }], // 上标/下标
  210. [{ indent: "-1" }, { indent: "+1" }], // 缩进
  211. // [{'direction': 'rtl'}], // 文本方向
  212. [{ size: ["small", false, "large", "huge"] }], // 字体大小
  213. [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
  214. [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
  215. [{ font: [] }], // 字体种类
  216. [{ align: [] }], // 对齐方式
  217. ["clean"], // 清除文本格式
  218. ["image", "video"], // 链接、图片、视频
  219. // ["link", "image", "video"] // 链接、图片、视频
  220. ];
  221. // 标题
  222. const titleConfig = {
  223. "ql-bold": "加粗",
  224. "ql-color": "颜色",
  225. "ql-font": "字体",
  226. "ql-code": "插入代码",
  227. "ql-italic": "斜体",
  228. // 'ql-link': '添加链接',
  229. "ql-background": "背景颜色",
  230. "ql-size": "字体大小",
  231. "ql-strike": "删除线",
  232. "ql-script": "上标/下标",
  233. "ql-underline": "下划线",
  234. "ql-blockquote": "引用",
  235. "ql-header": "标题",
  236. "ql-indent": "缩进",
  237. "ql-list": "列表",
  238. "ql-align": "文本对齐",
  239. "ql-direction": "文本方向",
  240. "ql-code-block": "代码块",
  241. "ql-formula": "公式",
  242. "ql-image": "图片",
  243. "ql-video": "视频",
  244. "ql-clean": "清除字体样式",
  245. "ql-upload": "文件",
  246. };
  247. // 这里引入修改过的video模块并注册
  248. import Video from "../../quill/video.js";
  249. import dayjs from "dayjs";
  250. Quill.register(Video, true);
  251. export default {
  252. props: ["options", "typeList"],
  253. name: "contentOperation",
  254. components: {
  255. quillEditor,
  256. },
  257. data() {
  258. let that = this;
  259. const query = this.options;
  260. return {
  261. uploadType: 1, // 上传类型
  262. uploadStatus: false,
  263. type: query.type,
  264. pageType: query.pageType,
  265. organId: null,
  266. // headers: {
  267. // Authorization: getToken()
  268. // },
  269. content: null,
  270. dialogFormVisible: false,
  271. formRadio: 1,
  272. lookVisible: false,
  273. dataInfo: {
  274. title: "",
  275. type: query.type,
  276. updateTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
  277. content: null,
  278. },
  279. editorIndex: 0, // 光标位置
  280. editorOption: {
  281. placeholder: "请输入内容",
  282. modules: {
  283. toolbar: {
  284. container: toolbarOptions,
  285. handlers: {
  286. image: function (value) {
  287. if (value) {
  288. // 调用iview图片上传
  289. document.querySelector(".ivu-upload .el-upload").click();
  290. } else {
  291. this.quill.format("image", false);
  292. }
  293. },
  294. video: function (value) {
  295. if (value) {
  296. that.dialogFormVisible = true;
  297. let editor = that.$refs.myQuillEditor.quill;
  298. // 光标所在位置
  299. that.editorIndex = editor.getSelection().index;
  300. } else {
  301. this.quill.format("image", false);
  302. }
  303. },
  304. },
  305. },
  306. },
  307. },
  308. dialogForm: {
  309. poster: null,
  310. url: null,
  311. videoUrl: null,
  312. },
  313. uploadLoading: false,
  314. uploadImgLoading: false,
  315. fileList: [],
  316. dialogFormRules: {
  317. url: [{ required: true, message: "请输入视频地址", trigger: "blur" }],
  318. videoUrl: [{ required: true, message: "请上传视频", trigger: "blur" }],
  319. },
  320. outUrlRadio: 0, // 是否使用外部连接,默认不使用
  321. form: {
  322. title: null,
  323. order: null,
  324. linkUrl: null,
  325. type: query.type,
  326. status: 0,
  327. content: null,
  328. organIdList: [],
  329. },
  330. rules: {
  331. title: [
  332. { required: true, message: "请输入标题", trigger: "blur" },
  333. {
  334. min: 2,
  335. max: 30,
  336. message: "长度在 2 到 30 个字符",
  337. trigger: "blur",
  338. },
  339. ],
  340. organIdList: [{ required: true, message: "请选择分部", trigger: "change" }],
  341. },
  342. imageSize: null,
  343. dataObj: {
  344. policy: "",
  345. signature: "",
  346. key: "",
  347. KSSAccessKeyId: "",
  348. // dir: "",
  349. acl: "public-read",
  350. name: "",
  351. // bucket_name: props.bucket_name
  352. },
  353. // ossUploadUrl: "https://ks3-cn-beijing.ksyuncs.com/" + "news-info",
  354. ossUploadUrl: `https://gyt.ks3-cn-beijing.ksyuncs.com`,
  355. bucket_name: "gyt",
  356. };
  357. },
  358. mounted() {
  359. this.$store.dispatch("setBranchs");
  360. this.init();
  361. },
  362. methods: {
  363. init() {
  364. this.getList();
  365. this.addQuillTitle();
  366. // this.form.type
  367. let tempTitle = {
  368. 1: "468px * 552px;图片不能超过 2M;",
  369. 2: "456px * 288px; 图片不能超过 2M;",
  370. 3: "686px * 140px; 图片不能超过 2M;",
  371. 4: "图片不能超过 2M;",
  372. 5: "图片不能超过 2M;",
  373. 6: "图片不能超过 2M;",
  374. 7: "图片不能超过 2M;",
  375. 8: "1242px * 2208px; 图片不能超过 2M;",
  376. };
  377. this.imageSize = tempTitle[this.form.type];
  378. this.$refs["form"].clearValidate();
  379. },
  380. onVideoComfirm(formName) {
  381. this.$refs[formName].validate((valid) => {
  382. if (valid) {
  383. let dialogForm = this.dialogForm;
  384. // 编辑器输入视频
  385. // 获取富文本组件实例
  386. let quill = this.editor;
  387. // 插入图片,res为服务器返回的图片链接地址
  388. const params = {
  389. poster: dialogForm.poster,
  390. url: this.formRadio == 1 ? dialogForm.url : dialogForm.videoUrl,
  391. };
  392. quill.insertEmbed(this.editorIndex, "video", params);
  393. // 调整光标到最后
  394. quill.setSelection(this.editorIndex + 1, { preload: false });
  395. this.dialogFormVisible = false;
  396. this.dialogForm = {
  397. poster: null,
  398. url: null,
  399. videoUrl: null,
  400. };
  401. } else {
  402. return false;
  403. }
  404. });
  405. },
  406. onDialogClose(diologForm) {
  407. this.dialogForm = {
  408. poster: null,
  409. url: null,
  410. videoUrl: null,
  411. };
  412. this.$refs[diologForm].resetFields();
  413. },
  414. addQuillTitle() {
  415. const oToolBar = document.querySelector(".ql-toolbar"),
  416. aButton = oToolBar.querySelectorAll("button"),
  417. aSelect = oToolBar.querySelectorAll("select");
  418. aButton.forEach(function (item) {
  419. if (item.className === "ql-script") {
  420. item.value === "sub" ? (item.title = "下标") : (item.title = "上标");
  421. } else if (item.className === "ql-indent") {
  422. item.value === "+1" ? (item.title = "向右缩进") : (item.title = "向左缩进");
  423. } else {
  424. item.title = titleConfig[item.classList[0]];
  425. }
  426. });
  427. aSelect.forEach(function (item) {
  428. item.parentNode.title = titleConfig[item.classList[0]];
  429. });
  430. },
  431. onSubmit(formName) {
  432. this.$refs[formName].validate(async (valid) => {
  433. if (valid) {
  434. let { organIdList, linkUrl, content, ...rest } = this.form;
  435. if (this.outUrlRadio == 1) {
  436. content = null;
  437. } else {
  438. linkUrl = null;
  439. }
  440. let form = {
  441. ...rest,
  442. linkUrl,
  443. content,
  444. organIdList: organIdList ? organIdList.join(",") : null,
  445. };
  446. if (this.pageType == "create") {
  447. if (form.id) {
  448. // 判断有没有Id,如果有则删除
  449. delete form.id;
  450. }
  451. // return false
  452. await newsAdd(form).then((res) => {
  453. this.messageTips("添加", res);
  454. });
  455. } else if (this.pageType == "update") {
  456. await newsUpdate(form).then((res) => {
  457. this.messageTips("修改", res);
  458. });
  459. }
  460. } else {
  461. this.$nextTick(() => {
  462. let isError = document.getElementsByClassName("is-error");
  463. isError[0].scrollIntoView({
  464. block: "center",
  465. behavior: "smooth",
  466. });
  467. });
  468. return false;
  469. }
  470. });
  471. },
  472. messageTips(title, res) {
  473. if (res.code == 200) {
  474. this.$message.success(title + "成功");
  475. this.$listeners.submited();
  476. this.$listeners.close();
  477. } else {
  478. this.$message.error(res.msg);
  479. }
  480. },
  481. handleSuccess(res) {
  482. // 获取富文本组件实例
  483. this.uploadImgLoading = false;
  484. let quill = this.editor;
  485. // 如果上传成功
  486. let url = this.ossUploadUrl + "/" + this.dataObj.key;
  487. if (url) {
  488. // 获取光标所在位置
  489. let length = quill.getSelection().index;
  490. // 插入图片,res为服务器返回的图片链接地址
  491. quill.insertEmbed(length, "image", url);
  492. // 调整光标到最后
  493. quill.setSelection(length + 1);
  494. } else {
  495. // 提示信息,需引入Message
  496. this.$message.error("图片插入失败");
  497. }
  498. },
  499. onReSet(formName) {
  500. this.form = {
  501. title: null,
  502. order: null,
  503. linkUrl: null,
  504. type: this.type,
  505. status: 1,
  506. content: null,
  507. organIdList: [],
  508. };
  509. this.$refs[formName].resetFields();
  510. },
  511. onLook() {
  512. // 预览
  513. let dataInfo = this.dataInfo;
  514. dataInfo.title = this.form.title;
  515. dataInfo.content = this.form.content;
  516. // 处理图片显示问题
  517. setTimeout(() => {
  518. let imgNode = document.querySelectorAll(".msgWrap img");
  519. if (imgNode.length > 0) {
  520. imgNode.forEach((item) => {
  521. item.style.width = "100%";
  522. });
  523. }
  524. let videoNode = document.querySelectorAll(".msgWrap .ql-video");
  525. if (videoNode.length > 0) {
  526. videoNode.forEach((item) => {
  527. item.style.width = "100%";
  528. item.style.height = "195px";
  529. });
  530. }
  531. }, 500);
  532. this.lookVisible = true;
  533. },
  534. async getList() {
  535. if (this.pageType == "create") {
  536. return;
  537. } else {
  538. await newsQueryId({ id: this.options.id }).then((res) => {
  539. if (res.code == 200) {
  540. let result = res.data;
  541. let organ = result.organIdList ? result.organIdList.split(",") : [];
  542. // 是否使用外部链接
  543. if (result.linkUrl) {
  544. this.outUrlRadio = 1;
  545. } else {
  546. this.outUrlRadio = 0;
  547. }
  548. this.form = {
  549. id: result.id,
  550. title: result.title,
  551. order: result.order,
  552. linkUrl: result.linkUrl,
  553. type: result.type,
  554. status: result.status,
  555. organIdList: organ.map((item) => {
  556. return +item;
  557. }),
  558. content: result.content,
  559. subType: result.subType,
  560. };
  561. this.dataInfo.updateTime = result.updateTime;
  562. }
  563. });
  564. }
  565. },
  566. handleUploadImgError(file) {
  567. this.uploadImgLoading = false;
  568. this.$message.error("上传失败");
  569. },
  570. handleImgSuccess(res, file) {
  571. this.uploadImgLoading = false;
  572. let url = this.ossUploadUrl + "/" + this.dataObj.key;
  573. if (url) {
  574. this.dialogForm.poster = url;
  575. } else {
  576. this.$message.error("上传失败");
  577. }
  578. },
  579. async beforeImgUpload(file) {
  580. const imageType = {
  581. "image/png": true,
  582. "image/jpeg": true,
  583. };
  584. const isImage = imageType[file.type];
  585. const isLt2M = file.size / 1024 / 1024 < 2;
  586. isImage, isLt2M;
  587. if (!isImage) {
  588. this.$message.error("只能上传图片格式!");
  589. }
  590. if (!isLt2M) {
  591. this.$message.error("上传图片大小不能超过 2MB!");
  592. }
  593. if (isImage && isLt2M) {
  594. this.uploadImgLoading = true;
  595. }
  596. try {
  597. let fileName = file.name.replaceAll(" ", "_");
  598. let key = new Date().getTime() + fileName;
  599. let obj = {
  600. filename: fileName,
  601. bucketName: this.bucket_name,
  602. postData: {
  603. filename: fileName,
  604. acl: "public-read",
  605. key: key,
  606. unknowValueField: [],
  607. },
  608. };
  609. const res = await policy(obj);
  610. this.dataObj = {
  611. policy: res.data.policy,
  612. signature: res.data.signature,
  613. key: key,
  614. KSSAccessKeyId: res.data.kssAccessKeyId,
  615. // dir: "",
  616. acl: "public-read",
  617. name: fileName,
  618. // bucket_name: props.bucket_name
  619. };
  620. } catch (e) {
  621. console.log(e);
  622. return false;
  623. }
  624. return isImage && isLt2M;
  625. },
  626. typeCheck(type) {
  627. let params = {
  628. 1: "精彩活动",
  629. 2: "热门资讯",
  630. 4: "专项训练",
  631. 7: "知识库",
  632. 19: "系统通知",
  633. };
  634. return params[type] ? params[type] : "管乐迷";
  635. },
  636. typeIndex(type) {
  637. let tempTitle = {
  638. 1: 0,
  639. 2: 1,
  640. 3: 4,
  641. 4: 2,
  642. 5: 3,
  643. 6: 5,
  644. 7: 6,
  645. 8: 7,
  646. 19: 8,
  647. };
  648. return tempTitle[type];
  649. },
  650. onEditorChange({ quill, html, text }) {
  651. this.form.content = html;
  652. },
  653. async beforeUpload(file) {
  654. // const isJPG = file.type === 'image/jpeg';
  655. const isLt2M = file.size / 1024 / 1024 < 100;
  656. // if (!isJPG) {
  657. // this.$message.error('上传头像图片只能是 JPG 格式!');
  658. // }
  659. if (!isLt2M) {
  660. this.$message.error("上传视频大小不能超过 100MB!");
  661. }
  662. this.uploadLoading = true;
  663. try {
  664. let fileName = file.name.replaceAll(" ", "_");
  665. let key = new Date().getTime() + fileName;
  666. let obj = {
  667. filename: fileName,
  668. bucketName: this.bucket_name,
  669. postData: {
  670. filename: fileName,
  671. acl: "public-read",
  672. key: key,
  673. unknowValueField: [],
  674. },
  675. };
  676. const res = await policy(obj);
  677. this.dataObj = {
  678. policy: res.data.policy,
  679. signature: res.data.signature,
  680. key: key,
  681. KSSAccessKeyId: res.data.kssAccessKeyId,
  682. // dir: "",
  683. acl: "public-read",
  684. name: fileName,
  685. // bucket_name: props.bucket_name
  686. };
  687. } catch (e) {
  688. console.log(e);
  689. return false;
  690. }
  691. return isLt2M;
  692. },
  693. handleUploadError(file) {
  694. this.uploadLoading = false;
  695. this.$message.error("上传视频失败");
  696. },
  697. handleUploadSuccess(file, fileList) {
  698. this.uploadLoading = false;
  699. let url = this.ossUploadUrl + "/" + this.dataObj.key;
  700. if (url) {
  701. this.$message.success("上传视频成功");
  702. this.dialogForm.videoUrl = url;
  703. } else {
  704. this.$message.error("上传视频失败");
  705. }
  706. },
  707. handleExceed(files, fileList) {
  708. this.$message.error("您已上传过视频");
  709. },
  710. },
  711. computed: {
  712. editor() {
  713. return this.$refs.myQuillEditor.quill;
  714. },
  715. },
  716. };
  717. </script>
  718. <style lang="scss" scoped>
  719. .systemNotifyModel {
  720. min-width: 100%;
  721. }
  722. .el-input {
  723. width: 400px;
  724. }
  725. ::v-deep .el-select {
  726. width: 400px !important;
  727. .el-input {
  728. width: 400px;
  729. }
  730. .el-select-dropdown {
  731. width: 400px;
  732. }
  733. }
  734. ::v-deep .ql-editor {
  735. min-height: 300px;
  736. padding: 0;
  737. }
  738. ::v-deep .ql-container .ql-editor {
  739. max-height: 500px;
  740. padding: 15px;
  741. }
  742. .el-row {
  743. margin-top: 40px;
  744. }
  745. .el-col {
  746. display: flex;
  747. align-items: center;
  748. margin-bottom: 20px;
  749. justify-content: flex-end;
  750. margin-right: 50%;
  751. }
  752. .el-input-group {
  753. width: 200px;
  754. margin: 0 20px;
  755. }
  756. ::v-deep .el-tree-node__content {
  757. height: 40px !important;
  758. }
  759. ::v-deep .avatar-uploader .el-upload,
  760. ::v-deep .upload-demo .el-upload {
  761. border-radius: 6px;
  762. cursor: pointer;
  763. position: relative;
  764. overflow: hidden;
  765. }
  766. .avatar-uploader .el-upload:hover {
  767. border-color: #409eff;
  768. }
  769. .avatar-uploader-icon {
  770. border: 1px dashed #d9d9d9;
  771. font-size: 28px;
  772. color: #8c939d;
  773. width: 120px;
  774. height: 120px;
  775. line-height: 120px;
  776. text-align: center;
  777. }
  778. .avatar {
  779. width: 120px;
  780. height: 120px;
  781. display: block;
  782. }
  783. .ivu-upload {
  784. display: none;
  785. }
  786. .sd-container {
  787. // padding: 15px;
  788. h2 {
  789. height: auto;
  790. font-weight: 500;
  791. color: rgba(68, 68, 68, 1);
  792. line-height: 37px;
  793. font-size: 26px;
  794. margin-bottom: 10px;
  795. }
  796. .titleInfo {
  797. height: 15px;
  798. line-height: 15px;
  799. display: flex;
  800. flex-direction: row;
  801. justify-content: space-between;
  802. color: #444;
  803. margin-bottom: 25px;
  804. }
  805. .imgWrap {
  806. /* width: 100;
  807. height: 1.45rem; */
  808. margin-bottom: 0.15rem;
  809. p {
  810. font-size: 0.16rem;
  811. font-family: PingFangSC;
  812. font-weight: 400;
  813. color: rgba(68, 68, 68, 1);
  814. line-height: 0.28rem;
  815. text-indent: 0.32rem;
  816. }
  817. img {
  818. width: 100%;
  819. }
  820. }
  821. }
  822. .imageSize {
  823. color: red;
  824. line-height: 1.5;
  825. }
  826. </style>