Browse Source

重构应用管理菜单路由并接入出包渠道

wangzhiqiang 4 months ago
parent
commit
eaa54bbce5

+ 0 - 6
src/router/modules/formworkErection.js

@@ -8,12 +8,6 @@ const route = [
         redirect: '/formworkErection/appAdmin/index',
         meta: { title: '广告变现', icon: 'sfont system-zidingyi' },
         children: [
-            {
-                path: 'appAdmin/index',
-                name: 'appAdmin',
-                component: createNameComponent(() => import('@/views/main/formworkErection/appAdmin.vue')),
-                meta: { title: '应用管理' },
-            },
             {
                 path: 'placementAdmin/index',
                 name: 'placementAdmin',

+ 6 - 0
src/router/modules/outBagModule.js

@@ -13,6 +13,12 @@ const route = [
                 name: 'ChannelTypeAdmin',
                 component: createNameComponent(() => import('@/views/main/outBagModule/channelTypeAdmin.vue')),
                 meta: { title: '出包渠道' },
+            },
+            {
+                path: 'appAdmin/index',
+                name: 'AppAdmin',
+                component: createNameComponent(() => import('@/views/main/outBagModule/appAdmin.vue')),
+                meta: { title: '应用管理' },
             }
         ],
     }

+ 1 - 1
src/router/permission/backConfig.js

@@ -7,7 +7,6 @@ const dashboard = {
 }
 
 const formworkErection = {
-  appAdmin: createNameComponent(() => import('@/views/main/formworkErection/appAdmin.vue')),
   placementAdmin: createNameComponent(() => import('@/views/main/formworkErection/placementAdmin.vue')),
   adPlatformAdmin: createNameComponent(() => import('@/views/main/formworkErection/adPlatformAdmin.vue')),
   adSourceAdmin: createNameComponent(() => import('@/views/main/formworkErection/adSourceAdmin.vue')),
@@ -38,6 +37,7 @@ const riskModule = {
 
 const outBagModule = {
   channelTypeAdmin: createNameComponent(() => import('@/views/main/outBagModule/channelTypeAdmin.vue')),
+  appAdmin: createNameComponent(() => import('@/views/main/outBagModule/appAdmin.vue')),
 }
 
 /** 导出所有路由,供后端配置使用 */

+ 3 - 3
src/views/main/dashboard/components/charts/lineChartModel.vue

@@ -9,13 +9,13 @@
                 <div class="main" v-if="type === 'earn'">
                     <el-row>
                         <el-col :span="8">
-                            <el-statistic title="今日收益" :value="268.5" precision="2" />
+                            <el-statistic title="今日收益" :value="268.5" :precision="2" />
                         </el-col>
                         <el-col :span="8">
-                            <el-statistic title="昨日收益" :value="2685" precision="2" />
+                            <el-statistic title="昨日收益" :value="2685" :precision="2" />
                         </el-col>
                         <el-col :span="8">
-                            <el-statistic title="本月收益" :value="2685" precision="2" />
+                            <el-statistic title="本月收益" :value="2685" :precision="2" />
                         </el-col>
                     </el-row>
                 </div>

+ 52 - 6
src/views/main/formworkErection/appAdmin.vue → src/views/main/outBagModule/appAdmin.vue

@@ -41,6 +41,17 @@
             </el-tag>
           </template>
         </el-table-column>
+        <el-table-column prop="ditchName" label="渠道名称" width="140">
+          <template #default="scope">
+            <el-tag
+              type="success"
+              effect="dark"
+              v-if="scope.row.ditchName"
+            >
+              {{ scope.row.ditchName }}
+            </el-tag>
+          </template>
+        </el-table-column>
         <el-table-column prop="networkAppName" label="关联渠道应用" width="120" />
         <el-table-column prop="nickName" label="所属用户" width="100" />
         <el-table-column prop="appType" label="应用类型" width="100">
@@ -125,6 +136,11 @@
     <!-- 操作弹窗 -->
     <Layer :layer="layer" @confirm="submit(ruleForm)" @close="layer.show = false">
       <el-form :model="formEdit" :rules="rules" ref="ruleForm" label-width="130px" style="margin-right: 30px">
+        <el-form-item label="出包渠道" required prop="ditchData">
+          <el-select v-model="formEdit.ditchData">
+            <el-option v-for="item in ditchListData" :key="item.ditchId" :value="item.ditchName" :label="item.ditchName" />
+          </el-select>
+        </el-form-item>
         <el-row :gutter="5">
           <el-col :span="10" v-if="formEdit.appId">
             <el-form-item label="应用ID" required prop="appId">
@@ -308,6 +324,7 @@ import {
   delApp, channelList, getSecondaryCategories, getPrimaryCategories, relativeChannel, relativeChannelList
 } from "@/api/formworkErection.js";
 import { attachFile, attachImage } from '@/api/common.js'
+import { ditchList } from '@/api/outBagModule.js'
 import From from "@/components/from/index.vue";
 import Table from "@/components/table/index.vue";
 import Layer from "@/components/layer/index.vue";
@@ -355,6 +372,7 @@ const dynamicFormItems = ref([]);
 onBeforeMount(() => {
   settingData();
   getList();
+  getDitchList();
 });
 
 
@@ -396,6 +414,22 @@ const settingData = () => {
   });
 };
 
+// 获取出包渠道
+const ditchListData = ref([])
+const getDitchList = async() => {
+  let res = await ditchList({
+    page: 1,
+    limit: 999,
+  })
+  ditchListData.value = res.data
+
+  console.log('res',res)
+}
+
+function findByDitchName(name) {
+  return ditchListData.value.find(item => item.ditchName === name)
+}
+
 // 分页数据
 const getList = async () => {
   let res = await appList({ ...formSearch.value });
@@ -499,6 +533,9 @@ const channelSubmit = async () => {
 }
 
 const formEdit = ref({
+  ditchData: null, //渠道数据
+  ditchId: null, //渠道ID
+  ditchName: '',//渠道名称
   store_on_sale: "",
   store_type: null,
   store_url: "",
@@ -508,11 +545,11 @@ const formEdit = ref({
   versionCode: "",
   updateTips: "",
   apiSecret: "", //请求密令
-  channelAccount: "", //渠道账号
-  channelId: "", //渠道ID
-  channelName: "", //渠道名称
-  channelPwd: "", //渠道密码
-  channelStatus: 0, //渠道状态
+  channelAccount: "", //广告平台账号
+  channelId: "", //广告平台ID
+  channelName: "", //广告平台名称
+  channelPwd: "", //广告平台密码
+  channelStatus: 0, //广告平台状态
   loginType: 0, //登录类型 1-账号密码 2-微信
   remark: "", //备注
   appId: "",
@@ -537,6 +574,8 @@ const edit = (row) => {
     formEdit.value.store_url = row.storeUrl;
     formEdit.value.sub_category = row.subCategory;
     formEdit.value.screen_orientation = row.screenOrientation;
+    // formEdit.value.ditchData = findByDitchName(row.ditchName)
+    formEdit.value.ditchData = row.ditchName
   } else {
     layer.value.title = "新增APP";
     layer.value.edit = false;
@@ -561,6 +600,9 @@ const openChannelLayer = async (row) => {
 const ruleForm = ref(null);
 
 const rules = reactive({
+  ditchData: [
+    { required: true, message: "请选择出包渠道", trigger: "change" },
+  ],
   appName: [
     { required: true, message: "请输入应用名称", trigger: "blur" },
   ],
@@ -598,10 +640,14 @@ const submit = async (formEl) => {
     }
 
     if (valid) {
+      formEdit.value.ditchData = findByDitchName(formEdit.value.ditchData)
+      formEdit.value.ditchId = formEdit.value.ditchData.ditchId
+      formEdit.value.ditchName = formEdit.value.ditchData.ditchName
+      delete formEdit.value.ditchData
       // 提交内容
       if (layer.value.edit) {
         //api修改需要uuid
-        formEdit.uuid = formEdit.appId;
+        formEdit.value.uuid = formEdit.value.appId;
       }
       const result = await saveOrUpdate({ ...formEdit.value });
       console.log(result)