|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
- <el-form :model="formData" label-width="130px" ref="ruleForm" :rules="rules" v-loading="loading" class="pr-4">
|
|
|
+ <el-form :model="formData" :disabled="props.primary?.look" label-width="130px" ref="ruleForm" :rules="rules"
|
|
|
+ v-loading="loading" class="pr-4">
|
|
|
<div class="flex flex-row justify-between">
|
|
|
<div class="w-full">
|
|
|
<el-form-item label="关注类型" prop="focus_type">
|
|
@@ -36,10 +37,27 @@
|
|
|
:rules="[{ required: true, message: '关注链接必须填写' }]" label-width="120px">
|
|
|
<el-input style="width:300px;" autosize v-model="formData._link_url" auto-complete="off"
|
|
|
placeholder="关注链接地址要与配置的公众号保存一致"></el-input>
|
|
|
+ <el-popover placement="top" :width="300" trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <el-text type="primary" class="cursor-pointer" style="margin-left: 16px">弹窗预览</el-text>
|
|
|
+ </template>
|
|
|
+ <img src="@/assets/Icon.png" class="rounded-full w-7 h-7" />
|
|
|
+ </el-popover>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="formData.link_type == 2" label="关注二维码" prop="cover_image">
|
|
|
- <my-upload acceptType=".png,.jpg,.jpeg" :isMultiple="false" @fileRemove="fileRemove" @fileSuccess="fileSuccess"
|
|
|
- :fileList="formData.fileList" action="/qiniu/upload/image"></my-upload>
|
|
|
+ <el-form-item v-if="formData.link_type == 2" label="关注二维码" prop="link_url">
|
|
|
+ <div>
|
|
|
+ <my-upload :isDisableUpload="props.primary?.look" acceptType=".png,.jpg,.jpeg" :isMultiple="false"
|
|
|
+ @fileRemove="fileRemove" @fileSuccess="fileSuccess" :fileList="formData.fileList"
|
|
|
+ action="/qiniu/upload/image"></my-upload>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-popover placement="top" :width="300" trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <el-text type="primary" class="cursor-pointer" style="margin-left: 16px">弹窗预览</el-text>
|
|
|
+ </template>
|
|
|
+ <img src="@/assets/Icon.png" class="rounded-full w-7 h-7" />
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -52,7 +70,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { InfoFilled } from '@element-plus/icons-vue';
|
|
|
import { wechatPlatformOfficialAccountList } from '@/api/officialAccount/officialList/index'
|
|
|
-import { videoStockVideoUpdate, videoStockVideoAdd, videoStockVideoCategoryList } from '@/api/video/index'
|
|
|
+import { yinliuManageSave } from '@/api/drainageManage/drainageList/index'
|
|
|
import type { FormInstance, FormRules } from 'element-plus'
|
|
|
const ruleForm = ref<FormInstance>()
|
|
|
import { onMounted, ref } from 'vue';
|
|
@@ -147,24 +165,21 @@ const submitForm = (formEl: FormInstance | undefined) => {
|
|
|
formEl
|
|
|
.validate(valid => {
|
|
|
if (valid) {
|
|
|
- let api;
|
|
|
let params = {
|
|
|
focus_type: formData.value.focus_type,
|
|
|
gzh_id: formData.value.gzh_id,
|
|
|
pop_type: formData.value.pop_type,
|
|
|
- pop_type_sub: formData.value.pop_type_sub,
|
|
|
link_type: formData.value.link_type,
|
|
|
link_url: formData.value.link_url || formData.value._link_url,
|
|
|
- };
|
|
|
+ }
|
|
|
+ if (formData.value.pop_type == 2) {
|
|
|
+ params.pop_type_sub = formData.value.pop_type_sub
|
|
|
+ }
|
|
|
console.log(params, 'submitFormsubmitForm');
|
|
|
- return
|
|
|
if (props.primary) {
|
|
|
- api = videoStockVideoUpdate
|
|
|
params.id = formData.value.id
|
|
|
- } else {
|
|
|
- api = videoStockVideoAdd
|
|
|
}
|
|
|
- api(params).then(res => {
|
|
|
+ yinliuManageSave(params).then(res => {
|
|
|
console.log(res);
|
|
|
ElMessage.success(res.message)
|
|
|
emit('close')
|
|
@@ -177,8 +192,13 @@ const submitForm = (formEl: FormInstance | undefined) => {
|
|
|
}
|
|
|
|
|
|
if (props.primary) {
|
|
|
+ console.log(props.primary, 'props.primary');
|
|
|
formData.value = JSON.parse(JSON.stringify(props.primary))
|
|
|
- formData.value.fileList = [{ uid: props.primary.id, url: props.primary.link_url }]
|
|
|
+ if (formData.value.link_type == 1) {
|
|
|
+ formData.value._link_url = formData.value.link_url
|
|
|
+ } else {
|
|
|
+ formData.value.fileList = [{ uid: props.primary.id, url: props.primary.link_url }]
|
|
|
+ }
|
|
|
} else {
|
|
|
formData.value.fileList = []
|
|
|
}
|