feat(资源配置-->编辑组件): 新增“bdFree”开关

This commit is contained in:
tianfeng 2026-04-01 12:04:22 +08:00
parent b63f164bc5
commit 525ec41e75

View File

@ -8,7 +8,13 @@
width="450px" width="450px"
> >
<div v-loading="submitLoading"> <div v-loading="submitLoading">
<el-form ref="form" :model="form" :rules="ruleVlide()" label-width="110px" style="margin-right:50px;"> <el-form
ref="form"
:model="form"
:rules="ruleVlide()"
label-width="110px"
style="margin-right:50px;"
>
<el-form-item label="系统" prop="sysOrigin"> <el-form-item label="系统" prop="sysOrigin">
<el-select <el-select
v-model="form.sysOrigin" v-model="form.sysOrigin"
@ -21,8 +27,12 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
> >
<span style="float: left;"> <sys-origin-icon :icon="item.value" :desc="item.value" /></span> <span style="float: left;">
<span style="float: left;margin-left:10px">{{ item.label }}</span> <sys-origin-icon :icon="item.value" :desc="item.value"
/></span>
<span style="float: left;margin-left:10px">{{
item.label
}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -34,7 +44,12 @@
class="filter-item" class="filter-item"
@change="selectdTheme" @change="selectdTheme"
> >
<el-option v-for="item in propsTypes" :key="item.value" :label="item.name" :value="item.value" /> <el-option
v-for="item in propsTypes"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="封面" prop="cover"> <el-form-item label="封面" prop="cover">
@ -49,10 +64,18 @@
:on-remove="handleCoverFileRemove" :on-remove="handleCoverFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="coverUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="coverUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="封面预览图" prop="sourceUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="封面预览图"
prop="sourceUrl"
>
<el-upload <el-upload
:disabled="sourceUploadLoading" :disabled="sourceUploadLoading"
:file-list="sourceUrlFileList" :file-list="sourceUrlFileList"
@ -64,10 +87,18 @@
:on-remove="handleSourceFileRemove" :on-remove="handleSourceFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="sourceUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="sourceUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="房间发送页图" prop="roomSendCoverUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="房间发送页图"
prop="roomSendCoverUrl"
>
<el-upload <el-upload
:disabled="roomSendCoverUrlUploadLoading" :disabled="roomSendCoverUrlUploadLoading"
:file-list="roomSendCoverFileList" :file-list="roomSendCoverFileList"
@ -79,10 +110,18 @@
:on-remove="handleRoomSendCoverFileRemove" :on-remove="handleRoomSendCoverFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="roomSendCoverUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="roomSendCoverUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label=" 房间拆红包大图" prop="roomNotOpenedUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label=" 房间拆红包大图"
prop="roomNotOpenedUrl"
>
<el-upload <el-upload
:disabled="roomNotOpenedUrlUploadLoading" :disabled="roomNotOpenedUrlUploadLoading"
:file-list="roomNotOpenedUrlFileList" :file-list="roomNotOpenedUrlFileList"
@ -94,10 +133,18 @@
:on-remove="handleRoomNotOpenedUrlFileRemove" :on-remove="handleRoomNotOpenedUrlFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="roomNotOpenedUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="roomNotOpenedUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="房间红包已打开大图" prop="roomOpenedUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="房间红包已打开大图"
prop="roomOpenedUrl"
>
<el-upload <el-upload
:disabled="roomOpenedUrlUploadLoading" :disabled="roomOpenedUrlUploadLoading"
:file-list="roomOpenedUrlFileList" :file-list="roomOpenedUrlFileList"
@ -109,10 +156,18 @@
:on-remove="handleRoomOpenedUrlFileRemove" :on-remove="handleRoomOpenedUrlFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="roomOpenedUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="roomOpenedUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="IM发送页图" prop="imSendCoverUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="IM发送页图"
prop="imSendCoverUrl"
>
<el-upload <el-upload
:disabled="imSendCoverUrlUploadLoading" :disabled="imSendCoverUrlUploadLoading"
:file-list="imSendCoverUrlFileList" :file-list="imSendCoverUrlFileList"
@ -124,10 +179,18 @@
:on-remove="handleImSendCoverUrlFileRemove" :on-remove="handleImSendCoverUrlFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="imSendCoverUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="imSendCoverUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="IM/房间封面未打开小图" prop="imNotOpenedUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="IM/房间封面未打开小图"
prop="imNotOpenedUrl"
>
<el-upload <el-upload
:disabled="imNotOpenedUrlUploadLoading" :disabled="imNotOpenedUrlUploadLoading"
:file-list="imNotOpenedUrlFileList" :file-list="imNotOpenedUrlFileList"
@ -139,10 +202,18 @@
:on-remove="handleImNotOpenedUrlFileRemove" :on-remove="handleImNotOpenedUrlFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="imNotOpenedUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="imNotOpenedUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="IM/房间封面已打开小图" prop="imOpenedUrl"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="IM/房间封面已打开小图"
prop="imOpenedUrl"
>
<el-upload <el-upload
:disabled="imOpenedUrlUploadLoading" :disabled="imOpenedUrlUploadLoading"
:file-list="imOpenedUrlFileList" :file-list="imOpenedUrlFileList"
@ -154,11 +225,19 @@
:on-remove="handleImOpenedUrlFileRemove" :on-remove="handleImOpenedUrlFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="imOpenedUrlUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="imOpenedUrlUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'RED_PACKET'" label="IM/房间封面已打开小图2" prop="imOpenedUrlTwo"> <el-form-item
v-show="selectedTypeName === 'RED_PACKET'"
label="IM/房间封面已打开小图2"
prop="imOpenedUrlTwo"
>
<el-upload <el-upload
:disabled="imOpenedUrlTwoUploadLoading" :disabled="imOpenedUrlTwoUploadLoading"
:file-list="imOpenedUrlTwoFileList" :file-list="imOpenedUrlTwoFileList"
@ -170,11 +249,19 @@
:on-remove="handleImOpenedUrlTwoFileRemove" :on-remove="handleImOpenedUrlTwoFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="imOpenedUrlTwoUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="imOpenedUrlTwoUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="isSvga && form.type !== 'RED_PACKET'" label="svga" prop="sourceUrl"> <el-form-item
v-show="isSvga && form.type !== 'RED_PACKET'"
label="svga"
prop="sourceUrl"
>
<el-upload <el-upload
:disabled="sourceUploadLoading" :disabled="sourceUploadLoading"
:class="{ 'upload-but-hide': !isShowSourceUpload }" :class="{ 'upload-but-hide': !isShowSourceUpload }"
@ -186,7 +273,12 @@
accept=".svga,.pag,.mp4" accept=".svga,.pag,.mp4"
> >
<div class="upload-but"> <div class="upload-but">
<el-button :loading="sourceUploadLoading" size="small" type="primary">点击上传</el-button> <el-button
:loading="sourceUploadLoading"
size="small"
type="primary"
>点击上传</el-button
>
<div slot="tip" class="el-upload__tip"> <div slot="tip" class="el-upload__tip">
只能上传svga/pag/mp4文件 只能上传svga/pag/mp4文件
</div> </div>
@ -194,7 +286,11 @@
</el-upload> </el-upload>
<svgaplayer v-if="!isShowSourceUpload" :url="form.sourceUrl" /> <svgaplayer v-if="!isShowSourceUpload" :url="form.sourceUrl" />
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'CHAT_BUBBLE'" label="iOS 资源 " prop="sourceUrl"> <el-form-item
v-show="selectedTypeName === 'CHAT_BUBBLE'"
label="iOS 资源 "
prop="sourceUrl"
>
<el-upload <el-upload
:disabled="sourceUploadLoading" :disabled="sourceUploadLoading"
:file-list="sourceUrlFileList" :file-list="sourceUrlFileList"
@ -206,10 +302,18 @@
:on-remove="handleSourceFileRemove" :on-remove="handleSourceFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="sourceUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="sourceUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-show="selectedTypeName === 'CHAT_BUBBLE'" label="Android 资源 " prop="expand"> <el-form-item
v-show="selectedTypeName === 'CHAT_BUBBLE'"
label="Android 资源 "
prop="expand"
>
<el-upload <el-upload
:disabled="expandUploadLoading" :disabled="expandUploadLoading"
:file-list="expandFileList" :file-list="expandFileList"
@ -221,10 +325,18 @@
:on-remove="handleExpandFileRemove" :on-remove="handleExpandFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="expandUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="expandUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-if="isBackground" label="房间装扮背景" prop="sourceUrl"> <el-form-item
v-if="isBackground"
label="房间装扮背景"
prop="sourceUrl"
>
<el-upload <el-upload
:disabled="sourceUploadLoading" :disabled="sourceUploadLoading"
:file-list="sourceUrlFileList" :file-list="sourceUrlFileList"
@ -236,7 +348,11 @@
:on-remove="handleSourceFileRemove" :on-remove="handleSourceFileRemove"
accept="image/*" accept="image/*"
> >
<i slot="default" v-loading="sourceUploadLoading" class="el-icon-plus" /> <i
slot="default"
v-loading="sourceUploadLoading"
class="el-icon-plus"
/>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
@ -247,38 +363,53 @@
style="width: 100%" style="width: 100%"
class="filter-item" class="filter-item"
> >
<el-option v-for="item in nobleVipTabs" :key="item.value" :label="item.name" :value="item.value" /> <el-option
v-for="item in nobleVipTabs"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select> </el-select>
<el-input v-else v-model.trim="form.name" type="text" /> <el-input v-else v-model.trim="form.name" type="text" />
</el-form-item> </el-form-item>
<el-form-item v-if="!isUpdate" label="编码" prop="code"> <el-form-item v-if="!isUpdate" label="编码" prop="code">
<el-input v-model.trim="form.code" type="text" placeholder="编码添加后不能修改" /> <el-input
v-model.trim="form.code"
type="text"
placeholder="编码添加后不能修改"
/>
</el-form-item> </el-form-item>
<el-form-item v-if="isPrice" label="底价" prop="amount"> <el-form-item v-if="isPrice" label="底价" prop="amount">
<el-input v-model.trim="form.amount" v-number type="text" /> <el-input v-model.trim="form.amount" v-number type="text" />
</el-form-item> </el-form-item>
<el-form-item label="admin free" prop="amount"> <el-form-item label="admin free" prop="adminFree">
<el-switch <el-switch
v-model="form.adminFree" v-model="form.adminFree"
active-text="是" active-text="是"
inactive-text="否" inactive-text="否"
></el-switch> ></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="bd free" prop="bdFree">
<el-switch
v-model="form.bdFree"
active-text="是"
inactive-text="否"
></el-switch>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm()">保存</el-button> <el-button type="primary" @click="submitForm()">保存</el-button>
<el-button @click="handleClose()">取消</el-button> <el-button @click="handleClose()">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { addPropsSource, updatePropsSource } from '@/api/props' import { addPropsSource, updatePropsSource } from "@/api/props";
import { propsTypes, nobleVipTabs } from '@/constant/type' import { propsTypes, nobleVipTabs } from "@/constant/type";
import { deepClone, getElementUiUploadFile } from '@/utils' import { deepClone, getElementUiUploadFile } from "@/utils";
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
export default { export default {
props: { props: {
@ -290,8 +421,8 @@ export default {
}, },
data() { data() {
const commonRules = [ const commonRules = [
{ required: true, message: '必填字段不可为空', trigger: 'blur' } { required: true, message: "必填字段不可为空", trigger: "blur" }
] ];
return { return {
nobleVipTabs, nobleVipTabs,
svgaplayerVisable: false, svgaplayerVisable: false,
@ -321,25 +452,26 @@ export default {
isBackground: false, isBackground: false,
submitLoading: false, submitLoading: false,
uploadLoading: false, uploadLoading: false,
selectedTypeName: '', selectedTypeName: "",
form: { form: {
id: '', id: "",
cover: '', cover: "",
sourceUrl: '', sourceUrl: "",
name: '', name: "",
type: '', type: "",
code: '', code: "",
amount: '', amount: "",
expand: '', expand: "",
sysOrigin: '', sysOrigin: "",
roomSendCoverUrl: '', roomSendCoverUrl: "",
roomOpenedUrl: '', roomOpenedUrl: "",
roomNotOpenedUrl: '', roomNotOpenedUrl: "",
imSendCoverUrl: '', imSendCoverUrl: "",
imOpenedUrl: '', imOpenedUrl: "",
imOpenedUrlTwo: '', imOpenedUrlTwo: "",
imNotOpenedUrl: '', imNotOpenedUrl: "",
adminFree: false adminFree: false,
bdFree: false
}, },
formRules: { formRules: {
sysOrigin: commonRules, sysOrigin: commonRules,
@ -381,306 +513,359 @@ export default {
type: commonRules, type: commonRules,
code: commonRules code: commonRules
} }
} };
}, },
computed: { computed: {
...mapGetters(['permissionsSysOriginPlatforms']), ...mapGetters(["permissionsSysOriginPlatforms"]),
isShowRoomSendCoverUpload() { isShowRoomSendCoverUpload() {
return !this.form.roomSendCoverUrl return !this.form.roomSendCoverUrl;
}, },
isShowRoomNotOpenedUrlUpload() { isShowRoomNotOpenedUrlUpload() {
return !this.form.roomNotOpenedUrl return !this.form.roomNotOpenedUrl;
}, },
isShowRoomOpenedUrlUpload() { isShowRoomOpenedUrlUpload() {
return !this.form.roomOpenedUrl return !this.form.roomOpenedUrl;
}, },
isShowImSendCoverUrlUpload() { isShowImSendCoverUrlUpload() {
return !this.form.imSendCoverUrl return !this.form.imSendCoverUrl;
}, },
isShowImNotOpenedUrlUpload() { isShowImNotOpenedUrlUpload() {
return !this.form.imNotOpenedUrl return !this.form.imNotOpenedUrl;
}, },
isShowImOpenedUrlUpload() { isShowImOpenedUrlUpload() {
return !this.form.imOpenedUrl return !this.form.imOpenedUrl;
}, },
isShowImOpenedUrlTwoUpload() { isShowImOpenedUrlTwoUpload() {
return !this.form.imOpenedUrlTwo return !this.form.imOpenedUrlTwo;
}, },
isShowCoverUpload() { isShowCoverUpload() {
return !this.form.cover return !this.form.cover;
}, },
isShowSourceUpload() { isShowSourceUpload() {
return !this.form.sourceUrl return !this.form.sourceUrl;
}, },
isShowExpandUpload() { isShowExpandUpload() {
return this.form.type === 'CHAT_BUBBLE' && !this.form.expand return this.form.type === "CHAT_BUBBLE" && !this.form.expand;
}, },
textOptTitle() { textOptTitle() {
return this.row && this.row.id ? '修改' : '添加' return this.row && this.row.id ? "修改" : "添加";
}, },
isUpdate() { isUpdate() {
return this.row && this.row.id return this.row && this.row.id;
} }
}, },
watch: { watch: {
row: { row: {
handler(newVal) { handler(newVal) {
if (!newVal) { if (!newVal) {
return return;
} }
this.form = deepClone(newVal) this.form = deepClone(newVal);
if (this.form.sourceUrl) { if (this.form.sourceUrl) {
this.sourceUrlFileList = getElementUiUploadFile(this.form.sourceUrl) this.sourceUrlFileList = getElementUiUploadFile(this.form.sourceUrl);
} }
if (this.form.cover) { if (this.form.cover) {
this.coverFileList = getElementUiUploadFile(this.form.cover) this.coverFileList = getElementUiUploadFile(this.form.cover);
} }
if (this.form.expand) { if (this.form.expand) {
this.expandFileList = getElementUiUploadFile(this.form.expand) this.expandFileList = getElementUiUploadFile(this.form.expand);
} }
if (this.form.roomSendCoverUrl) { if (this.form.roomSendCoverUrl) {
this.roomSendCoverFileList = getElementUiUploadFile(this.form.roomSendCoverUrl) this.roomSendCoverFileList = getElementUiUploadFile(
this.form.roomSendCoverUrl
);
} }
if (this.form.roomNotOpenedUrl) { if (this.form.roomNotOpenedUrl) {
this.roomNotOpenedUrlFileList = getElementUiUploadFile(this.form.roomNotOpenedUrl) this.roomNotOpenedUrlFileList = getElementUiUploadFile(
this.form.roomNotOpenedUrl
);
} }
if (this.form.roomOpenedUrl) { if (this.form.roomOpenedUrl) {
this.roomOpenedUrlFileList = getElementUiUploadFile(this.form.roomOpenedUrl) this.roomOpenedUrlFileList = getElementUiUploadFile(
this.form.roomOpenedUrl
);
} }
if (this.form.imSendCoverUrl) { if (this.form.imSendCoverUrl) {
this.imSendCoverUrlFileList = getElementUiUploadFile(this.form.imSendCoverUrl) this.imSendCoverUrlFileList = getElementUiUploadFile(
this.form.imSendCoverUrl
);
} }
if (this.form.imNotOpenedUrl) { if (this.form.imNotOpenedUrl) {
this.imNotOpenedUrlFileList = getElementUiUploadFile(this.form.imNotOpenedUrl) this.imNotOpenedUrlFileList = getElementUiUploadFile(
this.form.imNotOpenedUrl
);
} }
if (this.form.imOpenedUrl) { if (this.form.imOpenedUrl) {
this.imOpenedUrlFileList = getElementUiUploadFile(this.form.imOpenedUrl) this.imOpenedUrlFileList = getElementUiUploadFile(
this.form.imOpenedUrl
);
} }
if (this.form.imOpenedUrlTwo) { if (this.form.imOpenedUrlTwo) {
this.imOpenedUrlTwoFileList = getElementUiUploadFile(this.form.imOpenedUrlTwo) this.imOpenedUrlTwoFileList = getElementUiUploadFile(
this.form.imOpenedUrlTwo
);
} }
this.isSvga = this.form.type !== 'THEME' && this.form.type !== 'LAYOUT' && this.form.type !== 'CHAT_BUBBLE' && this.form.type !== 'RED_PACKET' this.isSvga =
this.selectedTypeName = this.form.type this.form.type !== "THEME" &&
this.isBackground = this.form.type === 'LAYOUT' this.form.type !== "LAYOUT" &&
this.form.type !== "CHAT_BUBBLE" &&
this.form.type !== "RED_PACKET";
this.selectedTypeName = this.form.type;
this.isBackground = this.form.type === "LAYOUT";
}, },
immediate: true immediate: true
} }
}, },
methods: { methods: {
ruleVlide() { ruleVlide() {
if (this.selectedTypeName === 'RED_PACKET') { if (this.selectedTypeName === "RED_PACKET") {
return this.formRules3 return this.formRules3;
} }
if (this.selectedTypeName === 'CUSTOMIZE' || this.selectedTypeName === 'FRAGMENTS') { if (
this.form.amount = 0 this.selectedTypeName === "CUSTOMIZE" ||
return this.formRulesCustomize this.selectedTypeName === "FRAGMENTS"
) {
this.form.amount = 0;
return this.formRulesCustomize;
} }
return !this.isSvga ? this.formRules2 : this.formRules return !this.isSvga ? this.formRules2 : this.formRules;
}, },
uploadCover(file) { uploadCover(file) {
const that = this const that = this;
that.coverUploadLoading = true that.coverUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.coverUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.cover = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.coverUploadLoading = false;
that.coverUploadLoading = false that.form.cover = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.coverUploadLoading = false;
});
}, },
handleCoverFileRemove(file, fileList) { handleCoverFileRemove(file, fileList) {
this.form.cover = '' this.form.cover = "";
this.coverUploadLoading = false this.coverUploadLoading = false;
}, },
roomSendUploadCover(file) { roomSendUploadCover(file) {
const that = this const that = this;
that.roomSendCoverUrlUploadLoading = true that.roomSendCoverUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.roomSendCoverUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.roomSendCoverUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.roomSendCoverUrlUploadLoading = false;
that.roomSendCoverUrlUploadLoading = false that.form.roomSendCoverUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.roomSendCoverUrlUploadLoading = false;
});
}, },
handleRoomSendCoverFileRemove(file, fileList) { handleRoomSendCoverFileRemove(file, fileList) {
this.form.roomSendCoverUrl = '' this.form.roomSendCoverUrl = "";
this.roomSendCoverUrlUploadLoading = false this.roomSendCoverUrlUploadLoading = false;
}, },
roomNotOpenedUrlUploadCover(file) { roomNotOpenedUrlUploadCover(file) {
const that = this const that = this;
that.roomNotOpenedUrlUploadLoading = true that.roomNotOpenedUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.roomNotOpenedUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.roomNotOpenedUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.roomNotOpenedUrlUploadLoading = false;
that.roomNotOpenedUrlUploadLoading = false that.form.roomNotOpenedUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.roomNotOpenedUrlUploadLoading = false;
});
}, },
handleRoomNotOpenedUrlFileRemove(file, fileList) { handleRoomNotOpenedUrlFileRemove(file, fileList) {
this.form.roomNotOpenedUrl = '' this.form.roomNotOpenedUrl = "";
this.roomNotOpenedUrlUploadLoading = false this.roomNotOpenedUrlUploadLoading = false;
}, },
roomOpenedUrlUploadCover(file) { roomOpenedUrlUploadCover(file) {
const that = this const that = this;
that.roomOpenedUrlUploadLoading = true that.roomOpenedUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.roomOpenedUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.roomOpenedUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.roomOpenedUrlUploadLoading = false;
that.roomOpenedUrlUploadLoading = false that.form.roomOpenedUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.roomOpenedUrlUploadLoading = false;
});
}, },
handleRoomOpenedUrlFileRemove(file, fileList) { handleRoomOpenedUrlFileRemove(file, fileList) {
this.form.roomOpenedUrl = '' this.form.roomOpenedUrl = "";
this.roomOpenedUrlUploadLoading = false this.roomOpenedUrlUploadLoading = false;
}, },
imSendCoverUrlUploadCover(file) { imSendCoverUrlUploadCover(file) {
const that = this const that = this;
that.imSendCoverUrlUploadLoading = true that.imSendCoverUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.imSendCoverUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.imSendCoverUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.imSendCoverUrlUploadLoading = false;
that.imSendCoverUrlUploadLoading = false that.form.imSendCoverUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.imSendCoverUrlUploadLoading = false;
});
}, },
handleImSendCoverUrlFileRemove(file, fileList) { handleImSendCoverUrlFileRemove(file, fileList) {
this.form.imSendCoverUrl = '' this.form.imSendCoverUrl = "";
this.imSendCoverUrlUploadLoading = false this.imSendCoverUrlUploadLoading = false;
}, },
imNotOpenedUrlUploadCover(file) { imNotOpenedUrlUploadCover(file) {
const that = this const that = this;
that.imNotOpenedUrlUploadLoading = true that.imNotOpenedUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.imNotOpenedUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.imNotOpenedUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.imNotOpenedUrlUploadLoading = false;
that.imNotOpenedUrlUploadLoading = false that.form.imNotOpenedUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.imNotOpenedUrlUploadLoading = false;
});
}, },
handleImNotOpenedUrlFileRemove(file, fileList) { handleImNotOpenedUrlFileRemove(file, fileList) {
this.form.imNotOpenedUrl = '' this.form.imNotOpenedUrl = "";
this.imNotOpenedUrlUploadLoading = false this.imNotOpenedUrlUploadLoading = false;
}, },
imOpenedUrlUploadCover(file) { imOpenedUrlUploadCover(file) {
const that = this const that = this;
that.imOpenedUrlUploadLoading = true that.imOpenedUrlUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.imOpenedUrlUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.imOpenedUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.imOpenedUrlUploadLoading = false;
that.imOpenedUrlUploadLoading = false that.form.imOpenedUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.imOpenedUrlUploadLoading = false;
});
}, },
handleImOpenedUrlFileRemove(file, fileList) { handleImOpenedUrlFileRemove(file, fileList) {
this.form.imOpenedUrl = '' this.form.imOpenedUrl = "";
this.imOpenedUrlUploadLoading = false this.imOpenedUrlUploadLoading = false;
}, },
imOpenedUrlTwoUploadCover(file) { imOpenedUrlTwoUploadCover(file) {
const that = this const that = this;
that.imOpenedUrlTwoUploadLoading = true that.imOpenedUrlTwoUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgaCover).then(res => { that
that.imOpenedUrlTwoUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgaCover)
that.form.imOpenedUrlTwo = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.imOpenedUrlTwoUploadLoading = false;
that.imOpenedUrlTwoUploadLoading = false that.form.imOpenedUrlTwo = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.imOpenedUrlTwoUploadLoading = false;
});
}, },
handleImOpenedUrlTwoFileRemove(file, fileList) { handleImOpenedUrlTwoFileRemove(file, fileList) {
this.form.imOpenedUrlTwo = '' this.form.imOpenedUrlTwo = "";
this.imOpenedUrlTwoUploadLoading = false this.imOpenedUrlTwoUploadLoading = false;
}, },
sourceUpload(file) { sourceUpload(file) {
const that = this const that = this;
that.sourceUploadLoading = true that.sourceUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgasource).then(res => { that
that.sourceUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgasource)
that.form.sourceUrl = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.sourceUploadLoading = false;
that.sourceUploadLoading = false that.form.sourceUrl = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.sourceUploadLoading = false;
});
}, },
handleSourceFileRemove(file, fileList) { handleSourceFileRemove(file, fileList) {
this.form.sourceUrl = '' this.form.sourceUrl = "";
this.sourceUploadLoading = false this.sourceUploadLoading = false;
}, },
expandUpload(file) { expandUpload(file) {
const that = this const that = this;
that.expandUploadLoading = true that.expandUploadLoading = true;
that.$simpleUploadFlie(file, that.$application.fileBucket.svgasource).then(res => { that
that.expandUploadLoading = false .$simpleUploadFlie(file, that.$application.fileBucket.svgasource)
that.form.expand = that.$getAccessImgUrl(res.name) .then(res => {
}).catch(er => { that.expandUploadLoading = false;
that.expandUploadLoading = false that.form.expand = that.$getAccessImgUrl(res.name);
}) })
.catch(er => {
that.expandUploadLoading = false;
});
}, },
handleExpandFileRemove(file, fileList) { handleExpandFileRemove(file, fileList) {
this.form.expand = '' this.form.expand = "";
this.expandUploadLoading = false this.expandUploadLoading = false;
}, },
handleClose() { handleClose() {
this.$emit('close') this.$emit("close");
}, },
selectdTheme(typeName) { selectdTheme(typeName) {
this.isSvga = true this.isSvga = true;
this.isPrice = true this.isPrice = true;
this.isBackground = false this.isBackground = false;
this.selectedTypeName = typeName this.selectedTypeName = typeName;
if (typeName === 'THEME' || typeName === 'CHAT_BUBBLE') { if (typeName === "THEME" || typeName === "CHAT_BUBBLE") {
this.isSvga = false this.isSvga = false;
return return;
} }
if (typeName === 'LAYOUT') { if (typeName === "LAYOUT") {
this.isSvga = false this.isSvga = false;
this.isBackground = true this.isBackground = true;
return return;
} }
if (typeName === 'CUSTOMIZE' || typeName === 'FRAGMENTS') { if (typeName === "CUSTOMIZE" || typeName === "FRAGMENTS") {
this.isPrice = false this.isPrice = false;
return return;
} }
}, },
submitForm() { submitForm() {
const that = this const that = this;
that.$refs.form.validate(valid => { that.$refs.form.validate(valid => {
if (!valid) { if (!valid) {
console.error('error submit!!') console.error("error submit!!");
return false return false;
} }
that.submitLoading = true that.submitLoading = true;
if (that.isUpdate) { if (that.isUpdate) {
updatePropsSource(that.form).then(res => { updatePropsSource(that.form)
that.submitLoading = false .then(res => {
that.$emit('success', res) that.submitLoading = false;
}).catch(er => { that.$emit("success", res);
that.submitLoading = false
that.$emit('fail')
console.error(er)
}) })
return .catch(er => {
that.submitLoading = false;
that.$emit("fail");
console.error(er);
});
return;
} }
addPropsSource(that.form).then(res => { addPropsSource(that.form)
that.submitLoading = false .then(res => {
that.$emit('success', res) that.submitLoading = false;
}).catch(er => { that.$emit("success", res);
that.submitLoading = false
that.$emit('fail')
console.error(er)
})
}) })
.catch(er => {
that.submitLoading = false;
that.$emit("fail");
console.error(er);
});
});
}, },
clickSvgaplayer() { clickSvgaplayer() {
this.svgaplayerVisable = true this.svgaplayerVisable = true;
}
} }
} }
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss"></style>
</style>