| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998 |
- <template>
- <div id="festivalAdd">
- <div class="boxWidth">
- <el-form
- label-position="right"
- label-width="120px"
- :model="listData"
- :rules="rules"
- ref="listData"
- >
- <el-form-item label="适用业务层级">
- <el-select
- v-model="eduType"
- placeholder="请选择教育类型"
- @change="changeEduType"
- >
- <el-option
- v-for="(item, index) in eduTypeOptions"
- :key="index"
- :label="item.educationName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-select
- v-model="courType"
- placeholder="请选择业务层次"
- @change="changecourseType"
- >
- <el-option
- v-for="(item, index) in newCourTypeOptions"
- :key="index"
- :label="item.projectName + '-' + item.businessName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-popover
- ref="popovers"
- placement="bottom"
- width="200"
- trigger="click"
- @show="showHandle"
- @hide="hideHandle"
- :disabled="courType ? false : true"
- >
- <el-checkbox-group v-model="sujectArray" class="checkboxSty">
- <el-checkbox
- v-for="(item, index) in newSujectOption"
- :label="item.newId"
- :key="index"
- >{{ item.subjectName }}</el-checkbox
- >
- </el-checkbox-group>
- <div style="display: block; text-align: center; margin-top: 10px">
- <el-button size="mini" type="primary" @click="submitSujectArray"
- >确定</el-button
- >
- </div>
- <el-button
- slot="reference"
- style="margin-left: 12px"
- @click="getMessage"
- >请选择科目</el-button
- >
- </el-popover>
- <span style="margin-left: 10px">注:可多选</span>
- </el-form-item>
- <el-form-item label="">
- <div :class="changeHeight ? 'ach' : 'clh'">
- <div
- v-for="(item, index) in newSujectApis"
- :key="index"
- class="listBoxStys"
- >
- {{
- item.educationName +
- " - " +
- item.projectName +
- " - " +
- item.businessName +
- " - " +
- item.subjectName
- }}
- <i class="el-icon-error closeIcons" @click="closeType(index)"></i>
- </div>
- </div>
- <el-button
- size="mini"
- v-if="newSujectApis.length > 1"
- @click="changeType"
- >{{ changeHeight ? "展开" : "关闭" }}</el-button
- >
- <!-- <span v-if="newSujectApis.length === 0">未选项目类型</span> -->
- </el-form-item>
- <el-form-item label="标题前缀" prop="prefixName">
- <el-input v-model="listData.prefixName"></el-input>
- </el-form-item>
- <el-form-item label="节标题" prop="name">
- <el-input v-model="listData.name"></el-input>
- </el-form-item>
- <el-form-item label="节类型">
- <el-select
- clearable
- v-model="listData.sectionType"
- placeholder="请选择节类型"
- >
- <el-option
- v-for="(item, index) in sectionTypeOptions"
- :key="index"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="直播流地址" v-if="listData.sectionType === 2">
- <el-input
- style="width: 300px"
- v-model="listData.liveUrl"
- placeholder="请输入直播流地址"
- ></el-input>
- <el-select
- v-model="newActiveLiveUrl"
- placeholder="快捷选中直播流地址"
- @change="changeLiveUrl"
- >
- <el-option
- v-for="(item, index) in newLiveUrl"
- :key="index"
- :label="item.streamingName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <div v-if="listData.liveUrl" style="margin-top: 10px">
- <el-button
- size="small"
- type="warning"
- @click="watchZbVideo(listData.liveUrl)"
- >直播预览</el-button
- >
- </div>
- </el-form-item>
- <el-form-item label="直播开始时间" v-if="listData.sectionType === 2">
- <el-date-picker
- v-model="listData.liveStartTime"
- type="datetime"
- placeholder="请选择直播开始时间"
- value-format="timestamp"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="直播结束时间" v-if="listData.sectionType === 2">
- <el-date-picker
- v-model="listData.liveEndTime"
- type="datetime"
- placeholder="请选择直播结束时间"
- value-format="timestamp"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="节时长" v-if="listData.sectionType === 2">
- <el-input
- class="numInputs"
- type="age"
- v-model.number="listData.durationTime"
- ><template slot="append">分钟</template></el-input
- >
- </el-form-item>
- <el-form-item
- label="URL地址"
- v-if="listData.sectionType === 1 || listData.sectionType === 3"
- >
- <el-input
- style="width: 300px"
- v-model="listData.recordingUrl"
- placeholder="请输入URL地址"
- ></el-input>
- <label
- for="mobles"
- class="el-button el-button--primary"
- style="margin: 0px 6px; padding: 10px 20px"
- >上传</label
- ><input
- style="display: none"
- type="file"
- id="mobles"
- @change="importMoble"
- />
- <el-select
- v-if="listData.sectionType === 1"
- v-model="newActiveRecordingUrl1"
- placeholder="快捷选中录播URL地址"
- @change="changeRecordingUrl1"
- >
- <el-option
- v-for="(item, index) in newSteamUrl1"
- :key="index"
- :label="item.streamingName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <el-select
- v-if="listData.sectionType === 3"
- v-model="newActiveRecordingUrl2"
- placeholder="快捷选中回放URL地址"
- @change="changeRecordingUrl2"
- >
- <el-option
- v-for="(item, index) in newSteamUrl2"
- :key="index"
- :label="item.streamingName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <div v-if="listData.recordingUrl" style="margin-top: 10px">
- <el-button
- size="small"
- type="warning"
- @click="watchVideo(listData.recordingUrl)"
- >视频预览</el-button
- >
- </div>
- </el-form-item>
- <el-form-item
- label="节时长"
- v-if="listData.sectionType === 1 || listData.sectionType === 3"
- >
- <el-input
- class="numInputs"
- type="age"
- v-model.number="listData.durationTime"
- ><template slot="append">分钟</template></el-input
- >
- </el-form-item>
- <el-form-item label="节封面">
- <div class="imgBoxins">
- <img :src="$methodsTools.splitImgHost(listData.coverUrl)" alt="" />
- <div
- class="posimg"
- v-if="
- listData.coverUrl === null ||
- listData.coverUrl === '' ||
- listData.coverUrl === undefined
- "
- >
- <label for="uplose">
- <i class="el-icon-circle-plus-outline iconStsz"></i
- ></label>
- <input
- ref="file"
- type="file"
- style="display: none"
- id="uplose"
- @change="getImgFile"
- />
- <p>
- 注:请上传小于300kb,尺寸为750*440的图片,支持gif、jpg、jpeg、png等类型
- </p>
- </div>
- </div>
- <el-button
- v-if="
- listData.coverUrl !== null &&
- listData.coverUrl !== '' &&
- listData.coverUrl !== undefined
- "
- type="danger"
- size="mini"
- class="margin-top: 20px;"
- @click="clearImgs"
- >删除</el-button
- >
- </el-form-item>
- <el-form-item label="是否发布" prop="publishStatus">
- <el-radio-group v-model="listData.publishStatus">
- <el-radio :label="1">是</el-radio>
- <el-radio :label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item>
- <el-button @click="backPage">取消</el-button>
- <el-button type="primary" @click="submit('listData')">确定</el-button>
- </el-form-item>
- </el-form>
- </div>
- <el-dialog
- :visible.sync="diavos"
- width="840px"
- @opened="isOkBf"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">视频预览</div>
- <div class="rightBoxs">
- <img src="@/assets/images/Close@2x.png" alt="" @click="clears" />
- </div>
- </div>
- <div>
- <div id="player"></div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="clears">取 消</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="diavoszb"
- width="840px"
- @opened="isOkBfzb"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">直播预览</div>
- <div class="rightBoxs">
- <img src="@/assets/images/Close@2x.png" alt="" @click="clearszb" />
- </div>
- </div>
- <div>
- <div id="playerzb"></div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="clearszb">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { uploadFile } from "@/utils/uopladFile.js";
- export default {
- data() {
- return {
- vodPlayerJs: "https://player.polyv.net/script/player.js",
- vid: "",
- playerJs:
- "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
- uidzb: "egsxlptzdq",
- vidzb: "",
- diavos: false,
- diavoszb: false,
- fileSetting: {
- desc: "i am desc", // 描述
- cataid: "1639399775001", // 分类ID 可以后端传递 也可以不写 或写死
- tag: "i am tag", // 标签
- luping: 0, // 是否开启视频课件优化处理,对于上传录屏类视频清晰度有所优化:0为不开启,1为开启
- keepsource: 1, // 是否源文件播放(不对视频进行编码):0为编码,1为不编码
- },
- sectionTypeOptions: [
- {
- label: "录播",
- value: 1,
- },
- {
- label: "直播",
- value: 2,
- },
- {
- label: "回放",
- value: 3,
- },
- ],
- // 弹窗数据
- changeHeight: true,
- bfImg: "oss/images/avatar/20211013/1634097664410_1397766697",
- listData: {
- publishStatus: 1,
- recordingUrl: "",
- liveUrl: "",
- coverUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
- },
- newActiveLiveUrl: "",
- newLiveUrl: [], //直播流地址
- newActiveRecordingUrl1: "",
- newSteamUrl1: [], //录播流地址
- newActiveRecordingUrl2: "",
- newSteamUrl2: [], //回放流地址
- eduTypeOptions: [], //教育类型数据
- projectTypeOptions: [], //项目类型数据
- courTypeOptions: [], //业务层次数据
- newCourTypeOptions: [], //当前业务层次数据
- sujectOption: [], //科目数据
- newSujectOption: [], //当前科目数据数据
- eduType: "", //当前选中教育类型
- courType: "", //当前选中业务层次
- sujectApis: [], //当前存在的科目
- newSujectApis: [],
- sujectArray: [], //选中的科目
- //表单验证
- rules: {
- prefixName: [
- { required: true, message: "请输入标题前缀", trigger: "blur" },
- ],
- name: [{ required: true, message: "请输入节标题", trigger: "blur" }],
- // liveDuration: [
- // { required: true, message: "节时长不能为空" },
- // { type: "number", message: "节时长必须为数字值" },
- // ],
- publishStatus: [
- { required: true, message: "请选择是否发布", trigger: "change" },
- ],
- },
- };
- },
- watch: {
- sujectApis: {
- immediate: true,
- handler(newName, oldName) {
- this.changeTypes();
- },
- },
- },
- mounted() {
- this.getDict();
- },
- methods: {
- loadPlayerScript(callback) {
- if (!window.polyvPlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.vodPlayerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- this.player.on("serverError", (...params) => {
- this.$message.error(returnTitle(params[1]));
- console.log(params);
- });
- }
- },
- loadPlayer() {
- var self = this;
- const polyvPlayer = window.polyvPlayer;
- self.player = polyvPlayer({
- wrap: "#player",
- width: 800,
- height: 533,
- vid: self.vid,
- teaser_show: 0,
- playsafe: function (vid, next) {
- self.$api.obtainpolyvvideosign(vid).then((res) => {
- next(res.data);
- });
- },
- });
- },
- /**
- * @param {String} 关闭视频窗口-销毁实例
- */
- clears() {
- this.diavos = false;
- if (this.player) {
- this.player.destroy();
- }
- },
- /**
- * @param {String} 视频查看
- */
- watchVideo(url) {
- if (!url) {
- this.$message.warning("请检查URL地址是否输入完整");
- return;
- }
- this.vid = url;
- this.diavos = true;
- },
- isOkBf() {
- this.loadPlayerScript(this.loadPlayer);
- },
- /**
- * @param {String} 直播预览
- */
- watchZbVideo(url) {
- if (!url) {
- this.$message.warning("请检查直播流地址是否输入完整");
- return;
- }
- this.vidzb = url;
- this.diavoszb = true;
- },
- loadPlayerScriptzb(callback) {
- if (!window.polyvLivePlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.playerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- }
- },
- loadPlayerzb() {
- const polyvLivePlayer = window.polyvLivePlayer;
- this.playerzb = polyvLivePlayer({
- wrap: "#playerzb",
- width: 800,
- height: 533,
- uid: this.uidzb,
- vid: this.vidzb,
- });
- },
- clearszb() {
- this.diavoszb = false;
- if (this.playerzb) {
- this.playerzb.destroy();
- }
- },
- isOkBfzb() {
- this.loadPlayerScriptzb(this.loadPlayerzb);
- },
- importMoble(event) {
- // var self = this;
- var file = event.target.files[0];
- // let formData = new FormData();
- // formData.append("file", file);
- // console.log(formData);
- if (!event.target.value) {
- this.$message.error("请选择您要上传的文件");
- return false;
- }
- /**
- * @param: event.target.files -> 传递的文件list
- * @param: this.fileSetting -> 常规配置 上面有备注
- * @param: 回调
- */
- uploadFile(file, this.fileSetting, (index, event) => {
- this.listData.recordingUrl = event.vid;
- });
- },
- getMessage() {
- if (!this.courType) {
- this.$message.warning("请先选择业务层级");
- }
- },
- clearImgs() {
- this.listData.coverUrl = "";
- },
- changeTypes() {
- var self = this;
- var arrays = [];
- this.sujectApis.map((item, index) => {
- this.courTypeOptions.map((items) => {
- if (items.id === item.split("-").map(Number)[0]) {
- var obj = {
- educationTypeId: items.educationId,
- educationName: items.educationName,
- projectId: items.projectId,
- projectName: items.projectName,
- businessId: items.id,
- businessName: items.businessName,
- };
- self.sujectOption.map((i) => {
- if (
- i.id === item.split("-").map(Number)[1] &&
- i.courseArrays.indexOf(items.projectId) !== -1
- ) {
- obj.subjectName = i.subjectName;
- obj.subjectId = i.id;
- }
- });
- arrays.push(obj);
- }
- });
- });
- this.newSujectApis = arrays;
- },
- changeType() {
- this.changeHeight = !this.changeHeight;
- },
- submitSujectArray() {
- var self = this;
- this.sujectApis = this.sujectApis.filter((item, index) => {
- return item.split("-").map(Number)[0] !== Number(self.courType);
- });
- for (let i = 0; i < this.sujectArray.length; i++) {
- this.sujectApis.push(this.sujectArray[i]);
- }
- this.$refs.popovers.doClose();
- this.$nextTick(() => {
- this.changeUrl();
- });
- },
- changeUrl() {
- var arr = this.newSujectApis.map((val) => val.businessId);
- const unique = [...new Set(arr)];
- var busId = "";
- if (unique.length) {
- busId = unique.toString();
- } else {
- busId = "";
- }
- this.$api.inquireCourseStreaming({ status: 1 }).then((res) => {
- var arraystt = [];
- var newarrays1tt = [];
- var newarrays2tt = [];
- res.rows.map((item) => {
- if (item.streamingType === 1) {
- arraystt.push(item);
- }
- if (item.streamingType === 2) {
- newarrays1tt.push(item);
- }
- if (item.streamingType === 3) {
- newarrays2tt.push(item);
- }
- });
- this.$api
- .inquireCourseStreaming({ status: 1, businessId: busId })
- .then((result) => {
- var arrays = [];
- var newarrays1 = [];
- var newarrays2 = [];
- result.rows.map((item) => {
- if (item.streamingType === 1) {
- arrays.push(item);
- }
- if (item.streamingType === 2) {
- newarrays1.push(item);
- }
- if (item.streamingType === 3) {
- newarrays2.push(item);
- }
- });
- if (arrays.length) {
- this.newLiveUrl = arrays;
- } else {
- this.newLiveUrl = arraystt;
- }
- if (newarrays1.length) {
- this.newSteamUrl1 = newarrays1;
- } else {
- this.newSteamUrl1 = newarrays1tt;
- }
- if (newarrays2.length) {
- this.newSteamUrl2 = newarrays2;
- } else {
- this.newSteamUrl2 = newarrays2tt;
- }
- });
- });
- },
- showHandle() {
- var array = [];
- for (let i = 0; i < this.sujectApis.length; i++) {
- if (
- this.sujectApis[i].split("-").map(Number)[0] === Number(this.courType)
- ) {
- array.push(this.sujectApis[i]);
- }
- }
- this.sujectArray = array;
- this.newSujectOption.map((item) => {
- item.newId = this.courType + "-" + item.id;
- });
- },
- hideHandle() {},
- getDict() {
- this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
- this.eduTypeOptions = res.rows;
- });
- this.$api.inquireCourseProjectType({ status: 1 }).then((res) => {
- this.projectTypeOptions = res.rows;
- });
- this.$api.inquirebusinessList({ status: 1 }).then((res) => {
- this.courTypeOptions = res.rows;
- this.newCourTypeOptions = res.rows;
- });
- this.$api.inquireCourseSubject({ status: 1 }).then((res) => {
- res.rows.map((item, index) => {
- var array = [];
- item.courseProjectTypes.map((items, indexs) => {
- array.push(items.id);
- });
- item.courseArrays = array;
- });
- this.sujectOption = res.rows;
- });
- this.$api.inquireCourseStreaming({ status: 1 }).then((res) => {
- var arrays = [];
- var newarrays1 = [];
- var newarrays2 = [];
- res.rows.map((item) => {
- if (item.streamingType === 1) {
- arrays.push(item);
- }
- if (item.streamingType === 2) {
- newarrays1.push(item);
- }
- if (item.streamingType === 3) {
- newarrays2.push(item);
- }
- });
- this.newLiveUrl = arrays;
- this.newSteamUrl1 = newarrays1;
- this.newSteamUrl2 = newarrays2;
- });
- },
- changeEduType() {
- if (!(this.courType === undefined || this.courType === "")) {
- this.courType = "";
- }
- var arrays = [];
- this.courTypeOptions.map((item) => {
- if (item.educationId === this.eduType) {
- arrays.push(item);
- }
- });
- this.newCourTypeOptions = arrays;
- },
- changecourseType() {
- this.newCourTypeOptions.map((item, index) => {
- if (item.id === this.courType) {
- this.eduType = item.educationId;
- var array = [];
- this.sujectOption.map((items, indexs) => {
- if (items.courseArrays.indexOf(item.projectId) !== -1) {
- array.push(items);
- }
- });
- this.newSujectOption = array;
- }
- });
- var arrays = [];
- this.courTypeOptions.map((item) => {
- if (item.educationId === this.eduType) {
- arrays.push(item);
- }
- });
- this.newCourTypeOptions = arrays;
- this.$refs.popovers.doClose();
- },
- submit(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- // if (
- // this.listData.coverUrl === "" ||
- // this.listData.coverUrl === null ||
- // this.listData.coverUrl === undefined
- // ) {
- // this.$message.error("请上传节封面");
- // return false;
- // }
- this.rulesTableSumbit();
- } else {
- return false;
- }
- });
- },
- async rulesTableSumbit() {
- var dataInfos = {
- status: 1,
- businessList: this.newSujectApis,
- coverUrl: this.listData.coverUrl,
- name: this.listData.name,
- prefixName: this.listData.prefixName,
- publishStatus: this.listData.publishStatus,
- };
- if (this.listData.sectionType === 2) {
- dataInfos.sectionType = 2;
- dataInfos.liveUrl = this.listData.liveUrl;
- dataInfos.liveStartTime = this.$methodsTools.time10to13(
- this.listData.liveStartTime,
- 1
- );
- dataInfos.liveEndTime = this.$methodsTools.time10to13(
- this.listData.liveEndTime,
- 1
- );
- dataInfos.durationTime = this.listData.durationTime;
- }
- if (this.listData.sectionType === 1) {
- dataInfos.sectionType = 1;
- dataInfos.recordingUrl = this.listData.recordingUrl;
- dataInfos.durationTime = this.listData.durationTime;
- }
- if (this.listData.sectionType === 3) {
- dataInfos.sectionType = 3;
- dataInfos.recordingUrl = this.listData.recordingUrl;
- dataInfos.durationTime = this.listData.durationTime;
- }
- this.$api.appCourseSection(dataInfos).then((res) => {
- this.$message.success("新增成功");
- setTimeout(() => {
- this.$router.push({
- path: "festival",
- });
- }, 500);
- });
- },
- backPage() {
- this.$router.push({
- path: "festival",
- });
- },
- closeType(index) {
- this.sujectApis.splice(index, 1);
- this.$nextTick(() => {
- this.changeUrl();
- });
- },
- changeLiveUrl() {
- this.newLiveUrl.map((item) => {
- if (item.id === this.newActiveLiveUrl) {
- this.listData.liveUrl = item.liveUrl;
- }
- });
- this.newActiveLiveUrl = "";
- },
- changeRecordingUrl1() {
- this.newSteamUrl1.map((item) => {
- if (item.id === this.newActiveRecordingUrl1) {
- this.listData.recordingUrl = item.recordingVideoId;
- }
- });
- this.newActiveRecordingUrl1 = "";
- },
- changeRecordingUrl2() {
- this.newSteamUrl2.map((item) => {
- if (item.id === this.newActiveRecordingUrl2) {
- this.listData.recordingUrl = item.playbackUrl;
- }
- });
- this.newActiveRecordingUrl2 = "";
- },
- getImgFile() {
- var self = this;
- var file = self.$refs.file.files[0];
- if (file === undefined) {
- self.$set(self.listData, "coverUrl", "");
- return;
- }
- if (file.size > 0.3 * 1024 * 1024) {
- self.$message.error("图片不得大于300kb");
- return;
- }
- var type = self.$refs.file.value.toLowerCase().split(".").splice(-1);
- if (
- type[0] != "jpg" &&
- type[0] != "png" &&
- type[0] != "jpeg" &&
- type[0] != "gif"
- ) {
- self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
- self.$refs.file.value = "";
- return;
- }
- this.$upload.upload(file, 0).then((res) => {
- self.listData.coverUrl = res;
- });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- /deep/.el-button {
- border-radius: 8px;
- }
- /deep/.el-dialog {
- border-radius: 8px;
- .el-dialog__header {
- padding: 0;
- .hearders {
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0px 18px 0px 20px;
- border-bottom: 1px solid #e2e2e2;
- .leftTitle {
- font-size: 14px;
- font-weight: bold;
- color: #2f4378;
- }
- .rightBoxs {
- display: flex;
- align-items: center;
- img {
- width: 14px;
- height: 14px;
- margin-left: 13px;
- cursor: pointer;
- }
- }
- }
- }
- .el-dialog__footer {
- padding: 0;
- .dialog-footer {
- padding: 0px 40px;
- height: 70px;
- border-top: 1px solid #e2e2e2;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- }
- }
- .imgBox {
- width: 100%;
- // height: 210px;
- border: 1px solid #e2e2e2;
- border-radius: 8px;
- padding: 8px 8px 3px;
- display: flex;
- flex-direction: column;
- align-items: center;
- .imgLabel {
- flex: 1;
- width: 100%;
- border: 1px dotted #e2e2e2;
- color: #999;
- font-size: 14px;
- cursor: pointer;
- border-radius: 8px;
- .msPhoto {
- display: flex;
- justify-content: center;
- align-items: center;
- max-width: 100%;
- max-height: 270px;
- img {
- max-width: 100%;
- max-height: 270px;
- }
- }
- .imgbbx {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- i {
- font-weight: bold;
- margin: 14px 0;
- font-size: 24px;
- }
- }
- }
- p {
- margin: 5px 0px;
- }
- }
- .boxWidth {
- width: 770px;
- }
- .numInputs {
- width: 150px;
- }
- .checkboxSty {
- max-height: 210px;
- overflow: auto;
- display: flex;
- flex-direction: column;
- }
- .listBoxStys {
- flex-shrink: 0;
- padding: 0px 10px;
- border-radius: 8px;
- border: 1px solid #eee;
- margin-right: 10px;
- margin-bottom: 6px;
- }
- .closeIcons {
- color: red;
- cursor: pointer;
- margin-left: 6px;
- }
- .ach {
- display: flex;
- align-items: center;
- overflow: hidden;
- }
- .clh {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- }
- .imgBoxins {
- width: 375px;
- height: 220px;
- text-align: center;
- img {
- height: 100%;
- }
- }
- .iconStsz {
- font-size: 40px;
- color: #67c23a;
- cursor: pointer;
- }
- </style>
|