Jelajahi Sumber

添加权限

ith5 6 bulan lalu
induk
melakukan
04e845b8c7

+ 2 - 2
src/views/v1/advert/agenList/edit.vue

@@ -16,10 +16,10 @@
       :rules="rules"
       :auto-label-width="true"
     >
-      <a-form-item label="媒体ID" field="media_id">
+      <a-form-item label="渠道类型" field="media_id">
         <a-select
           v-model="formData.media_id"
-          placeholder="请选择媒体ID"
+          placeholder="请选择渠道类型"
           allow-clear
         >
           <a-option

+ 41 - 6
src/views/v1/advert/agenList/index.vue

@@ -9,13 +9,19 @@
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
-          <a-form-item label="后台归属人" field="auth_id">
+          <a-form-item label="渠道类型" field="media_id">
             <a-select
-              v-model="searchForm.auth_id"
-              :options="authOptions"
-              placeholder="请选择后台归属人"
+              v-model="searchForm.media_id"
+              placeholder="请选择渠道类型"
               allow-clear
-            />
+            >
+              <a-option
+                v-for="item in mediaOptions"
+                :key="item.id"
+                :value="item.id"
+                :label="`${item.id}:${item.name}`"
+              />
+            </a-select>
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
@@ -27,6 +33,25 @@
             />
           </a-form-item>
         </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="渠道ID" field="id">
+            <a-input
+              v-model="searchForm.id"
+              placeholder="请输入渠道ID"
+              allow-clear
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="后台归属人" field="auth_id">
+            <a-select
+              v-model="searchForm.auth_id"
+              :options="authOptions"
+              placeholder="请选择后台归属人"
+              allow-clear
+            />
+          </a-form-item>
+        </a-col>
       </template>
 
       <!-- Table 自定义渲染 -->
@@ -58,8 +83,9 @@ const crudRef = ref();
 const editRef = ref();
 const viewRef = ref();
 const addSiteRef = ref();
-const authOptions = ref([]);
 
+const authOptions = ref([]);
+const mediaOptions = ref([]);
 // 搜索表单
 const searchForm = ref({
   auth_id: "",
@@ -115,6 +141,7 @@ const columns = reactive([
 // 页面数据初始化
 const initPage = async () => {
   await getAuthOptions();
+  await getMediaOptions();
 };
 
 const getAuthOptions = async () => {
@@ -124,6 +151,14 @@ const getAuthOptions = async () => {
   }
 };
 
+// 获取媒体列表Options
+const getMediaOptions = async () => {
+  const res = await advertCommonApi.getMediaOptionsApi();
+  if (res.code == 200) {
+    mediaOptions.value = res.data;
+  }
+};
+
 // SaTable 数据请求
 const refresh = async () => {
   crudRef.value?.refresh();

+ 19 - 26
src/views/v1/advert/agentSite/index.vue

@@ -10,37 +10,21 @@
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
-          <a-form-item label="媒体ID" field="media_id">
-            <a-select
-              v-model="searchForm.media_id"
-              placeholder="请选择媒体ID"
-              allow-search
+          <a-form-item label="渠道ID" field="agent_id">
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="请输入渠道ID"
               allow-clear
-            >
-              <a-option
-                v-for="item in mediaOptions"
-                :key="item.id"
-                :value="item.id"
-                :label="`${item.id}:${item.name}`"
-              />
-            </a-select>
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
-          <a-form-item label="渠道ID" field="agent_id">
-            <a-select
-              v-model="searchForm.agent_id"
-              placeholder="请选择渠道ID"
-              allow-search
+          <a-form-item label="渠道名称" field="agent_name">
+            <a-input
+              v-model="searchForm.agent_name"
+              placeholder="请输入渠道名称"
               allow-clear
-            >
-              <a-option
-                v-for="item in agentOptions"
-                :key="item.id"
-                :value="item.id"
-                :label="`${item.id}:${item.name}`"
-              />
-            </a-select>
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
@@ -54,6 +38,15 @@
             />
           </a-form-item>
         </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="广告位ID" field="id">
+            <a-input
+              v-model="searchForm.id"
+              placeholder="请输入广告位ID"
+              allow-clear
+            />
+          </a-form-item>
+        </a-col>
         <a-col :sm="8" :xs="24">
           <a-form-item label="广告位名称" field="name">
             <a-input

+ 30 - 9
src/views/v1/advert/mediaCost/index.vue

@@ -14,12 +14,13 @@
               v-model="searchForm.tdate"
               :show-time="false"
               mode="date"
+              class="w-full"
             />
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
           <a-form-item label="投放游戏" field="game_id">
-            <a-select
+            <!-- <a-select
               v-model="searchForm.game_id"
               placeholder="请选择投放游戏"
               allow-clear
@@ -31,7 +32,19 @@
                 :value="item.id"
                 :label="`${item.id}:${item.name}`"
               />
-            </a-select>
+            </a-select> -->
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="gameListTree"
+              tree-checked-strategy="child"
+              :tree-checkable="true"
+              :max-tag-count="2"
+              :fieldNames="{ title: 'name', key: 'id' }"
+              allow-search
+              allow-clear
+              placeholder="请选择游戏"
+            >
+            </a-tree-select>
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
@@ -123,15 +136,14 @@ import { Message } from "@arco-design/web-vue";
 import EditForm from "./edit.vue";
 import api from "../../api/advert/mediaCost";
 import commonAdvertApi from "../../api/advert/common";
-import commonCenterApi from "../../api/center/common";
+import commonApi from "../../api/common";
 
 // 引用定义
 const crudRef = ref();
 const editRef = ref();
-const viewRef = ref();
 const mediaOptions = ref([]);
-const gameOptions = ref([]);
 const authOptions = ref([]);
+const gameListTree = ref([]);
 
 // 搜索表单
 const searchForm = ref({
@@ -202,7 +214,8 @@ const columns = reactive([
 // 页面数据初始化
 const initPage = async () => {
   await getMediaOptions();
-  await getGameOptions();
+  // await getGameOptions();
+  await getGameListTree();
   await getAuthOptions();
 };
 
@@ -223,10 +236,18 @@ const getAuthOptions = async () => {
 };
 
 // 获取投放游戏
-const getGameOptions = async () => {
-  const resp = await commonCenterApi.getGameOptionsApi();
+// const getGameOptions = async () => {
+//   const resp = await commonCenterApi.getGameOptionsApi();
+//   if (resp.code === 200) {
+//     gameOptions.value = resp.data;
+//   }
+// };
+
+// 获取游戏列表树形
+const getGameListTree = async () => {
+  const resp = await commonApi.getGameListTreeApi();
   if (resp.code === 200) {
-    gameOptions.value = resp.data;
+    gameListTree.value = resp.data;
   }
 };
 

+ 25 - 0
src/views/v1/api/common.js

@@ -40,6 +40,31 @@ export default {
     });
   },
 
+  /**
+   * 获取子游戏TreeOptions
+   */
+  getGameListTreeNoAuthApi(params = {}) {
+    return request({
+      url: "/v1/common/getGameListTreeNoAuth",
+      method: "get",
+      params,
+    });
+  },
+
+  /**
+   * 获取子游戏TreeOptions(有权限)
+   * @param {*} params
+   * @returns
+   */
+
+  getGameListTreeApi(params = {}) {
+    return request({
+      url: "/v1/common/getGameListTree",
+      method: "get",
+      params,
+    });
+  },
+
   /**
    * 获取广告位options
    */

+ 40 - 3
src/views/v1/center/iosPayWay/index.vue

@@ -7,9 +7,29 @@
       :searchForm="searchForm"
     >
       <!-- 搜索区 tableSearch -->
-      <template #tableSearch> </template>
+      <template #tableSearch>
+        <a-col :span="8">
+          <a-form-item label="游戏" name="game_id">
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="gameListTree"
+              tree-checked-strategy="child"
+              :tree-checkable="false"
+              :max-tag-count="2"
+              :fieldNames="{ title: 'name', key: 'id' }"
+              allow-search
+              allow-clear
+              placeholder="请选择游戏"
+            >
+            </a-tree-select>
+          </a-form-item>
+        </a-col>
+      </template>
 
       <!-- Table 自定义渲染 -->
+      <template #game_id="{ record }">
+        {{ record.game_id }}:{{ record.game_name }}
+      </template>
     </sa-table>
 
     <!-- 编辑表单 -->
@@ -22,14 +42,18 @@ import { onMounted, ref, reactive } from "vue";
 import { Message } from "@arco-design/web-vue";
 import EditForm from "./edit.vue";
 import api from "../../api/center/iosPayWay";
+import commonApi from "../../api/common";
 
 // 引用定义
 const crudRef = ref();
 const editRef = ref();
 const viewRef = ref();
+const gameListTree = ref([]);
 
 // 搜索表单
-const searchForm = ref({});
+const searchForm = ref({
+  game_id: "",
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -65,6 +89,7 @@ const options = reactive({
 
 // SaTable 列配置
 const columns = reactive([
+  { title: "游戏", dataIndex: "game_id", width: 180 },
   { title: "开启时间", dataIndex: "pay_stime", width: 180 },
   { title: "结束时间", dataIndex: "pay_etime", width: 180 },
   { title: "充值金额", dataIndex: "pay_money", width: 180 },
@@ -82,13 +107,25 @@ const columns = reactive([
 ]);
 
 // 页面数据初始化
-const initPage = async () => {};
+const initPage = async () => {
+  await getGameListTree();
+};
 
 // SaTable 数据请求
 const refresh = async () => {
   crudRef.value?.refresh();
 };
 
+// 获取游戏列表树形
+const getGameListTree = async () => {
+  const resp = await commonApi.getGameListTreeNoAuthApi({
+    single: true,
+  });
+  if (resp.code === 200) {
+    gameListTree.value = resp.data;
+  }
+};
+
 // 页面加载完成执行
 onMounted(async () => {
   initPage();

+ 21 - 5
src/views/v1/customer/roleData/index.vue

@@ -10,7 +10,7 @@
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
           <a-form-item label="游戏" field="game_id">
-            <a-select
+            <!-- <a-select
               v-model="searchForm.game_id"
               placeholder="请选择游戏"
               allow-clear
@@ -22,7 +22,17 @@
               >
                 [{{ item.id }}] {{ item.name }}
               </a-option>
-            </a-select>
+            </a-select> -->
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="allGameOptions"
+              placeholder="请选择游戏"
+              allow-clear
+              :field-names="{ title: 'name', key: 'id' }"
+              allow-search
+              tree-checked-strategy="child"
+              :tree-checkable="false"
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
@@ -144,12 +154,18 @@ const columns = reactive([
 
 // 页面数据初始化
 const initPage = async () => {
-  await getGameOptions();
+  // await getGameOptions();
+  await getGameListTree();
 };
 
 // 获取子游戏options
-const getGameOptions = async () => {
-  const res = await commonApi.getGameOptionsApiNoAuth();
+// const getGameOptions = async () => {
+//   const res = await commonApi.getGameOptionsApiNoAuth();
+//   allGameOptions.value = res.data;
+// };
+
+const getGameListTree = async () => {
+  const res = await commonApi.getGameListTreeNoAuthApi({ single: 1 });
   allGameOptions.value = res.data;
 };
 

+ 21 - 5
src/views/v1/customer/sdkOrder/index.vue

@@ -10,7 +10,7 @@
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
           <a-form-item label="游戏" field="game_id">
-            <a-select
+            <!-- <a-select
               v-model="searchForm.game_id"
               placeholder="请选择游戏"
               allow-clear
@@ -23,7 +23,18 @@
               >
                 [{{ item.id }}] {{ item.name }}
               </a-option>
-            </a-select>
+            </a-select> -->
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="allGameOptions"
+              placeholder="请选择游戏"
+              allow-clear
+              :field-names="{ title: 'name', key: 'id' }"
+              allow-search
+              tree-checked-strategy="child"
+              :tree-checkable="true"
+              :max-tag-count="1"
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="8" :xs="24">
@@ -215,12 +226,17 @@ const columns = reactive([
 
 // 页面数据初始化
 const initPage = async () => {
-  await getGameOptions();
+  await getGameListTree();
 };
 
 // 获取子游戏options
-const getGameOptions = async () => {
-  const res = await commonApi.getGameOptionsApiNoAuth();
+// const getGameOptions = async () => {
+//   const res = await commonApi.getGameOptionsApiNoAuth();
+//   allGameOptions.value = res.data;
+// };
+
+const getGameListTree = async () => {
+  const res = await commonApi.getGameListTreeNoAuthApi();
   allGameOptions.value = res.data;
 };
 

+ 30 - 9
src/views/v1/gameLog/gamePackage/edit.vue

@@ -17,9 +17,8 @@
       :auto-label-width="true"
     >
       <a-form-item label="游戏" field="game_id">
-        <a-select
+        <!-- <a-select
           v-model="formData.game_id"
-          :options="gameOptions"
           placeholder="请选择游戏ID"
           allow-clear
           @change="handleGameChange"
@@ -30,7 +29,19 @@
             :value="item.id"
             :label="`${item.id}:${item.name}:${item.package_name}`"
           />
-        </a-select>
+        </a-select> -->
+        <a-tree-select
+          v-model="formData.game_id"
+          :data="gameListTree"
+          tree-checked-strategy="child"
+          :tree-checkable="false"
+          :max-tag-count="2"
+          :fieldNames="{ title: 'name', key: 'id' }"
+          allow-search
+          allow-clear
+          placeholder="请选择游戏"
+        >
+        </a-tree-select>
       </a-form-item>
       <a-form-item label="所属媒体" field="media_id">
         <a-select
@@ -97,6 +108,7 @@ import { Message, Modal } from "@arco-design/web-vue";
 import api from "../../api/gameLog/gamePackage";
 import advertCommonApi from "../../api/advert/common";
 import centerCommonApi from "../../api/center/common";
+import commonApi from "../../api/common";
 
 const emit = defineEmits(["success"]);
 // 引用定义
@@ -106,6 +118,7 @@ const formRef = ref();
 const mode = ref("");
 const mediaOptions = ref([]);
 const gameOptions = ref([]);
+const gameListTree = ref([]);
 
 let title = computed(() => {
   return "母包管理" + (mode.value == "add" ? "-新增" : "-编辑");
@@ -177,7 +190,8 @@ const handleMediaChange = (value) => {
 // 初始化页面数据
 const initPage = async () => {
   await getMediaOptions();
-  await getGameOptions();
+  // await getGameOptions();
+  await getGameListTree();
 };
 
 // 获取媒体列表Options
@@ -188,11 +202,18 @@ const getMediaOptions = async () => {
   }
 };
 
-// 获取游戏列表
-const getGameOptions = async () => {
-  const res = await centerCommonApi.getGameOptionsApi();
-  if (res.code == 200) {
-    gameOptions.value = res.data;
+// // 获取游戏列表
+// const getGameOptions = async () => {
+//   const res = await centerCommonApi.getGameOptionsApi();
+//   if (res.code == 200) {
+//     gameOptions.value = res.data;
+//   }
+// };
+
+const getGameListTree = async () => {
+  const resp = await commonApi.getGameListTreeApi({ single: true });
+  if (resp.code === 200) {
+    gameListTree.value = resp.data;
   }
 };
 

+ 29 - 7
src/views/v1/gameLog/gamePackage/index.vue

@@ -26,7 +26,7 @@
         </a-col>
         <a-col :sm="8" :xs="24">
           <a-form-item label="游戏" field="game_id">
-            <a-select
+            <!-- <a-select
               v-model="searchForm.game_id"
               placeholder="请选择游戏ID"
               allow-clear
@@ -37,7 +37,19 @@
                 :value="item.id"
                 :label="`${item.id}:${item.name}`"
               />
-            </a-select>
+            </a-select> -->
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="gameListTree"
+              tree-checked-strategy="child"
+              :tree-checkable="false"
+              :max-tag-count="2"
+              :fieldNames="{ title: 'name', key: 'id' }"
+              allow-search
+              allow-clear
+              placeholder="请选择游戏"
+            >
+            </a-tree-select>
           </a-form-item>
         </a-col>
       </template>
@@ -58,8 +70,9 @@ import { onMounted, ref, reactive } from "vue";
 import { Message } from "@arco-design/web-vue";
 import EditForm from "./edit.vue";
 import advertCommonApi from "../../api/advert/common";
-import centerCommonApi from "../../api/center/common";
+// import centerCommonApi from "../../api/center/common";
 import api from "../../api/gameLog/gamePackage";
+import commonApi from "../../api/common";
 
 // 引用定义
 const crudRef = ref();
@@ -67,6 +80,7 @@ const editRef = ref();
 const viewRef = ref();
 const mediaOptions = ref([]);
 const gameOptions = ref([]);
+const gameListTree = ref([]);
 
 // 搜索表单
 const searchForm = ref({
@@ -118,8 +132,9 @@ const columns = reactive([
 
 // 页面数据初始化
 const initPage = async () => {
-  await getGameOptions();
+  // await getGameOptions();
   await getMediaOptions();
+  await getGameListTree();
 };
 
 // 获取媒体列表
@@ -131,10 +146,17 @@ const getMediaOptions = async () => {
 };
 
 // 获取游戏列表
-const getGameOptions = async () => {
-  const resp = await centerCommonApi.getGameOptionsApi();
+// const getGameOptions = async () => {
+//   const resp = await centerCommonApi.getGameOptionsApi();
+//   if (resp.code === 200) {
+//     gameOptions.value = resp.data;
+//   }
+// };
+
+const getGameListTree = async () => {
+  const resp = await commonApi.getGameListTreeApi({ single: true });
   if (resp.code === 200) {
-    gameOptions.value = resp.data;
+    gameListTree.value = resp.data;
   }
 };
 

+ 41 - 5
src/views/v1/gameLog/gamePackageLog/index.vue

@@ -9,10 +9,34 @@
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
-          <a-form-item label="游戏名" field="game_name">
+          <a-form-item label="游戏" field="game_id">
+            <a-tree-select
+              v-model="searchForm.game_id"
+              :data="gameListTree"
+              tree-checked-strategy="child"
+              :tree-checkable="false"
+              :max-tag-count="2"
+              :fieldNames="{ title: 'name', key: 'id' }"
+              allow-search
+              allow-clear
+              placeholder="请选择游戏"
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="渠道ID" field="agent_id">
             <a-input
-              v-model="searchForm.game_name"
-              placeholder="请输入游戏名"
+              v-model="searchForm.agent_id"
+              placeholder="请输入渠道ID"
+              allow-clear
+            />
+          </a-form-item>
+        </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="广告位ID" field="site_id">
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="请输入广告位ID"
               allow-clear
             />
           </a-form-item>
@@ -40,11 +64,13 @@ import { onMounted, ref, reactive } from "vue";
 import { Message } from "@arco-design/web-vue";
 import EditForm from "./edit.vue";
 import api from "../../api/gameLog/gamePackageLog";
+import commonApi from "../../api/common";
 
 // 引用定义
 const crudRef = ref();
 const editRef = ref();
 const viewRef = ref();
+const gameListTree = ref([]);
 
 // 搜索表单
 const searchForm = ref({
@@ -88,7 +114,8 @@ const options = reactive({
 const columns = reactive([
   { title: "广告位ID", dataIndex: "site_id", width: 120 },
   { title: "渠道ID", dataIndex: "agent_id", width: 120 },
-  { title: "母包名称", dataIndex: "package_name", width: 240 },
+  { title: "游戏", dataIndex: "game_name", width: 160 },
+
   { title: "目录", dataIndex: "letter", width: 180 },
   { title: "icon", dataIndex: "icon", type: "image", width: 120 },
   {
@@ -103,7 +130,16 @@ const columns = reactive([
 ]);
 
 // 页面数据初始化
-const initPage = async () => {};
+const initPage = async () => {
+  await getGameListTree();
+};
+
+const getGameListTree = async () => {
+  const resp = await commonApi.getGameListTreeApi({ single: true });
+  if (resp.code === 200) {
+    gameListTree.value = resp.data;
+  }
+};
 
 // SaTable 数据请求
 const refresh = async () => {