pansl 1 рік тому
батько
коміт
4e0d0f0647

+ 21 - 0
src/api/drainageManage/drainageList/index.ts

@@ -0,0 +1,21 @@
+import http from '@/api/http';
+/**
+ * 引流列表
+ */
+export function yinliuManageList(params: object) {
+  return http.get('/yinliu/manage/list', params);
+}
+
+/**
+ * 引流管理-添加、编辑
+ */
+export function yinliuManageSave(params: object) {
+  return http.post('/yinliu/manage/save', params);
+}
+/**
+ * 引流配置-删除
+ */
+export function yinliuManageDelete(params: object) {
+  return http.post('/yinliu/manage/delete', params);
+}
+

+ 34 - 14
src/views/drainageManage/drainageList/form/create.vue

@@ -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 = []
 }

+ 14 - 14
src/views/drainageManage/drainageList/index.vue

@@ -17,33 +17,33 @@
                 @click="openType('createVisible', null)">新增</el-button>
             </div>
             <el-table :data="tableData" class="mt-3" v-loading="loading">
-              <el-table-column prop="name" label="配置公众号" min-width="200">
+              <el-table-column prop="gzh_nick_name" label="配置公众号" min-width="200">
                 <template #default="scope">
                   <div class="flex flex-col">
                     <div>
-                      {{ scope.row.gzh_names }}
+                      {{ scope.row.gzh_nick_name }}
                     </div>
                   </div>
                 </template>
               </el-table-column>
-              <el-table-column prop="send_at" label="关注类型" min-width="200">
+              <el-table-column prop="focus_type_str" label="关注类型" min-width="200">
                 <template #default="scope">
-                  <span>{{ scope.row.send_at }}</span>
+                  <span>{{ scope.row.focus_type_str }}</span>
                 </template>
               </el-table-column>
-              <el-table-column prop="send_at" label="弹窗类型" min-width="200">
+              <el-table-column prop="link_type_str" label="弹窗类型" min-width="200">
                 <template #default="scope">
-                  <span>{{ scope.row.send_at }}</span>
+                  <span>{{ scope.row.link_type_str }}</span>
                 </template>
               </el-table-column>
-              <el-table-column prop="send_at" label="创建时间" min-width="200">
+              <el-table-column prop="created_at" label="创建时间" min-width="200">
                 <template #default="scope">
-                  <span>{{ scope.row.send_at }}</span>
+                  <span>{{ scope.row.created_at }}</span>
                 </template>
               </el-table-column>
               <el-table-column label="操作" width="200" fixed="right">
                 <template #default="scope">
-                  <div v-if="![4, 2].includes(scope.row.status)" v-action="'wechatPlatform.KFMessage.updateContent'">
+                  <div v-action="'wechatPlatform.KFMessage.updateContent'">
                     <el-button link type="primary" size="small"
                       @click="openType('createVisible', scope.row)">编辑</el-button>
                   </div>
@@ -51,7 +51,7 @@
                     <el-button link type="primary" size="small" v-action="'wechatPlatform.KFMessage.detail'"
                       @click="openType('createVisible', { look: true, ...scope.row })">查看</el-button>
                   </div>
-                  <div v-if="scope.row.status != 2" v-action="'wechatPlatform.KFMessage.delete'">
+                  <div v-action="'wechatPlatform.KFMessage.delete'">
                     <el-button link type="primary" size="small" @click="deleteChange(scope.row)">删除</el-button>
                   </div>
                 </template>
@@ -75,8 +75,8 @@ import { optionsCommonParams } from '@/api/common/index'
 import Create from './form/create.vue';
 import { useGetList } from '@/hook/curd/useGetList';
 import { wechatPlatformOfficialAccountList } from '@/api/officialAccount/officialList/index'
-import { wechatPlatformKfMessageStop, wechatPlatformKfMessageDelete, wechatPlatformKfMessageUpdateGZH } from '@/api/officialAccount/newsService/index'
-const api = 'wechatPlatform/kfMessage/list';
+import { yinliuManageDelete } from '@/api/drainageManage/drainageList/index'
+const api = 'yinliu/manage/list';
 const createVisible = ref(false)
 const current = ref<object | null>({})
 const messageTypeList = ref([])
@@ -123,7 +123,7 @@ const closeType = (type: string) => {
 
 const deleteChange = (row: object) => {
   ElMessageBox.confirm(
-    `确定要删除活动:${row.name} 吗?`,
+    `确定要删除吗?`,
     '提示',
     {
       confirmButtonText: '确定',
@@ -132,7 +132,7 @@ const deleteChange = (row: object) => {
     }
   )
     .then(() => {
-      wechatPlatformKfMessageDelete({ ids: [row.id] }).then(res => {
+      yinliuManageDelete({ id: row.id }).then(res => {
         console.log(res);
         ElMessage.success(res.message)
         search()