ith5 3 місяців тому
батько
коміт
ea7ec15fc3

+ 5 - 0
src/views/v1/advert/agenList/addSite.vue

@@ -26,6 +26,9 @@
       <a-form-item label="广告位名称" field="name">
         <a-input v-model="formData.name" placeholder="请输入广告位名称" />
       </a-form-item>
+      <a-form-item label="生产个数" field="num">
+        <a-input v-model="formData.num" />
+      </a-form-item>
     </a-form>
     <!-- 表单信息 end -->
   </component>
@@ -62,6 +65,7 @@ const initialFormData = {
   agent_id: null,
   auth_id: null,
   name: '',
+  num: 1,
 }
 
 // 表单信息
@@ -73,6 +77,7 @@ const rules = {
   agent_id: [{ required: true, message: '渠道ID必需填写' }],
   auth_id: [{ required: true, message: '负责人ID必需填写' }],
   name: [{ required: true, message: '广告位名称必需填写' }],
+  num: [{ required: true, message: '生产个数必须填写' }],
 }
 
 // 获取媒体列表Options

+ 1 - 0
src/views/v1/advert/mediaCost/index.vue

@@ -101,6 +101,7 @@ const searchForm = ref({
 const options = reactive({
   api: api.getPageList,
   rowSelection: { showCheckedAll: true },
+
   add: {
     show: true,
     auth: ['/v1/advert/MediaCost/save'],

+ 62 - 45
src/views/v1/advert/mediaList/index.vue

@@ -1,21 +1,38 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="6" :xs="24">
-          <a-form-item label="媒体id" field="id">
-            <a-input v-model="searchForm.id" placeholder="请输入媒体id" allow-clear />
+          <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="6" :xs="24">
           <a-form-item label="媒体名称" field="name">
-            <a-input v-model="searchForm.name" placeholder="请输入媒体名称" allow-clear />
+            <a-input
+              v-model="searchForm.name"
+              placeholder="请输入媒体名称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="媒体渠道简称" field="channel_name">
-            <a-input v-model="searchForm.channel_name" placeholder="请输入媒体渠道简称" allow-clear />
+            <a-input
+              v-model="searchForm.channel_name"
+              placeholder="请输入媒体渠道简称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
       </template>
@@ -29,22 +46,22 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import { Message } from '@arco-design/web-vue'
-import EditForm from './edit.vue'
-import api from '../../api/advert/mediaList'
+import { onMounted, ref, reactive } from "vue";
+import { Message } from "@arco-design/web-vue";
+import EditForm from "./edit.vue";
+import api from "../../api/advert/mediaList";
 
 // 引用定义
-const crudRef = ref()
-const editRef = ref()
-const viewRef = ref()
+const crudRef = ref();
+const editRef = ref();
+const viewRef = ref();
 
 // 搜索表单
 const searchForm = ref({
-  id: '',
-  name: '',
-  channel_name: '',
-})
+  id: "",
+  name: "",
+  channel_name: "",
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -52,65 +69,65 @@ const options = reactive({
   rowSelection: { showCheckedAll: true },
   add: {
     show: true,
-    auth: ['/v1/advert/MediaList/save'],
+    auth: ["/v1/advert/MediaList/save"],
     func: async () => {
-      editRef.value?.open()
+      editRef.value?.open();
     },
   },
   edit: {
     show: true,
-    auth: ['/v1/advert/MediaList/update'],
+    auth: ["/v1/advert/MediaList/update"],
     func: async (record) => {
-      editRef.value?.open('edit')
-      editRef.value?.setFormData(record)
+      editRef.value?.open("edit");
+      editRef.value?.setFormData(record);
     },
   },
   delete: {
     show: true,
-    auth: ['/v1/advert/MediaList/destroy'],
+    auth: ["/v1/advert/MediaList/destroy"],
     func: async (params) => {
-      const resp = await api.destroy(params)
+      const resp = await api.destroy(params);
       if (resp.code === 200) {
-        Message.success(`删除成功!`)
-        crudRef.value?.refresh()
+        Message.success(`删除成功!`);
+        crudRef.value?.refresh();
       }
     },
   },
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '媒体id', dataIndex: 'id', width: 180 },
-  { title: '媒体名称', dataIndex: 'name', width: 180 },
-  { title: '媒体渠道简称', dataIndex: 'channel_name', width: 180 },
-  { title: '安卓监测链接', dataIndex: 'andurl', width: 180 },
-  { title: 'ios监测链接', dataIndex: 'iosurl', width: 180 },
-  { title: '小游戏监测链接', dataIndex: 'xyxurl', width: 180 },
-  { title: '小游戏路径参数补充', dataIndex: 'appleturl', width: 180 },
+  { title: "媒体ID", dataIndex: "id", width: 180 },
+  { title: "媒体名称", dataIndex: "name", width: 180 },
+  { title: "媒体渠道简称", dataIndex: "channel_name", width: 180 },
+  { title: "安卓监测链接", dataIndex: "andurl", width: 180 },
+  { title: "ios监测链接", dataIndex: "iosurl", width: 180 },
+  { title: "小游戏监测链接", dataIndex: "xyxurl", width: 180 },
+  { title: "小游戏路径参数补充", dataIndex: "appleturl", width: 180 },
   {
-    title: '状态',
-    dataIndex: 'status',
-    type: 'dict',
-    dict: 'nomal_or_stop',
+    title: "状态",
+    dataIndex: "status",
+    type: "dict",
+    dict: "nomal_or_stop",
     width: 120,
   },
-])
+]);
 
 // 页面数据初始化
-const initPage = async () => {}
+const initPage = async () => {};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/advert/mediaList' }
+export default { name: "v1/advert/mediaList" };
 </script>

+ 64 - 47
src/views/v1/gameLog/roleData/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -14,19 +19,31 @@
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
-          <a-form-item label="广告位id" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="请输入广告位id" allow-clear />
+          <a-form-item label="广告位ID" field="site_id">
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="请输入广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
 
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="用户名" field="user_name">
-            <a-input v-model="searchForm.user_name" placeholder="请输入用户名" allow-clear />
+            <a-input
+              v-model="searchForm.user_name"
+              placeholder="请输入用户名"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="5" :xs="24">
           <a-form-item label="注册日期" field="create_time">
-            <a-range-picker class="w-full" v-model="searchForm.create_time" placeholder="注册日期" />
+            <a-range-picker
+              class="w-full"
+              v-model="searchForm.create_time"
+              placeholder="注册日期"
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="3" :xs="24">
@@ -40,27 +57,27 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import api from '../../api/gameLog/roleData'
-import dayjs from 'dayjs'
-import commonApi from '../../api/common'
-import GameSelect from '@/components/game-select/index.vue'
-import AuthSelect from '@/components/auth-select/index.vue'
-import MediaSelect from '@/components/media-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import api from "../../api/gameLog/roleData";
+import dayjs from "dayjs";
+import commonApi from "../../api/common";
+import GameSelect from "@/components/game-select/index.vue";
+import AuthSelect from "@/components/auth-select/index.vue";
+import MediaSelect from "@/components/media-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const mediaOptions = ref([])
+const crudRef = ref();
+const mediaOptions = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  media_id: '',
-  site_id: '',
-  auth_id: '',
-  user_name: '',
-  crete_time: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
-})
+  game_id: "",
+  media_id: "",
+  site_id: "",
+  auth_id: "",
+  user_name: "",
+  crete_time: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -68,50 +85,50 @@ const options = reactive({
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
   showSort: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '注册时间', dataIndex: 'create_time', width: 180 },
-  { title: '角色id', dataIndex: 'role_id', width: 80 },
-  { title: '角色名', dataIndex: 'role_name', width: 80 },
-  { title: '角色等级', dataIndex: 'role_level', width: 80 },
-  { title: '区服id', dataIndex: 'server_id', width: 60 },
-  { title: '区服名', dataIndex: 'server_name', width: 100 },
-  { title: '用户名', dataIndex: 'user_name', width: 120 },
-  { title: '游戏名', dataIndex: 'game_name', width: 120 },
-  { title: '渠道id', dataIndex: 'agent_id', width: 100 },
-  { title: '广告位id', dataIndex: 'site_id', width: 100 },
-  { title: '注册IP', dataIndex: 'ip', width: 180 },
-  { title: '渠道名', dataIndex: 'agent_name', width: 120 },
-  { title: '负责人', dataIndex: 'auth_name', width: 120 },
-])
+  { title: "注册时间", dataIndex: "create_time", width: 180 },
+  { title: "角色ID", dataIndex: "role_id", width: 80 },
+  { title: "角色名", dataIndex: "role_name", width: 80 },
+  { title: "角色等级", dataIndex: "role_level", width: 80 },
+  { title: "区服id", dataIndex: "server_id", width: 60 },
+  { title: "区服名", dataIndex: "server_name", width: 100 },
+  { title: "用户名", dataIndex: "user_name", width: 120 },
+  { title: "游戏名", dataIndex: "game_name", width: 120 },
+  { title: "渠道ID", dataIndex: "agent_id", width: 100 },
+  { title: "广告位ID", dataIndex: "site_id", width: 100 },
+  { title: "注册IP", dataIndex: "ip", width: 180 },
+  { title: "渠道名", dataIndex: "agent_name", width: 120 },
+  { title: "负责人", dataIndex: "auth_name", width: 120 },
+]);
 
 // 获取媒体类型
 const getMediaOptions = async () => {
-  const resp = await commonApi.getMediaOptionsApi()
+  const resp = await commonApi.getMediaOptionsApi();
   if (resp.code === 200) {
-    mediaOptions.value = resp.data
+    mediaOptions.value = resp.data;
   }
-}
+};
 
 // 页面数据初始化
 const initPage = async () => {
-  await getMediaOptions()
-}
+  await getMediaOptions();
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/gameLog/roleData' }
+export default { name: "v1/gameLog/roleData" };
 </script>

+ 128 - 77
src/views/v1/gameLog/sdkLoginLog/index.vue

@@ -1,11 +1,20 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="用户名" field="user_name">
-            <a-input v-model="searchForm.user_name" placeholder="请输入用户名" allow-clear />
+            <a-input
+              v-model="searchForm.user_name"
+              placeholder="请输入用户名"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -15,23 +24,37 @@
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="媒体类型" field="media_id">
-            <a-select v-model="searchForm.media_id" placeholder="请选择媒体类型" allow-clear allow-search>
+            <a-select
+              v-model="searchForm.media_id"
+              placeholder="请选择媒体类型"
+              allow-clear
+              allow-search
+            >
               <a-option
                 v-for="item in mediaOptions"
                 :key="item.id"
                 :value="item.id"
-                :label="`${item.id}:${item.name}`" />
+                :label="`${item.id}:${item.name}`"
+              />
             </a-select>
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
-          <a-form-item label="渠道id" field="agent_id">
-            <a-input v-model="searchForm.agent_id" placeholder="请输入渠道id" allow-clear />
+          <a-form-item label="渠道ID" field="agent_id">
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="请输入渠道ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
-          <a-form-item label="广告位id" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="请输入广告位id" allow-clear />
+          <a-form-item label="广告位ID" field="site_id">
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="请输入广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -42,10 +65,26 @@
         <a-col :sm="24" :md="17" :lg="17" :xl="12" :xxl="8" :xs="24">
           <a-form-item label="登录日期" field="login_time">
             <a-space>
-              <a-range-picker class="w-full" v-model="searchForm.login_time" :clearable="false" />
-              <a-button size="mini" type="outline" @click="refreshDay('yesterday')">前一天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('today')">当天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('tomorrow')">后一天</a-button>
+              <a-range-picker
+                class="w-full"
+                v-model="searchForm.login_time"
+                :clearable="false"
+              />
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('yesterday')"
+                >前一天</a-button
+              >
+              <a-button size="mini" type="outline" @click="refreshDay('today')"
+                >当天</a-button
+              >
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('tomorrow')"
+                >后一天</a-button
+              >
             </a-space>
           </a-form-item>
         </a-col>
@@ -56,10 +95,10 @@
         </a-col>
       </template>
       <template #login_time="{ record }">
-        {{ dayjs(record.login_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}
+        {{ dayjs(record.login_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}
       </template>
       <template #reg_time="{ record }">
-        {{ dayjs(record.reg_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}
+        {{ dayjs(record.reg_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}
       </template>
       <!-- Table 自定义渲染 -->
     </sa-table>
@@ -70,30 +109,30 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import EditForm from './edit.vue'
-import api from '../../api/gameLog/sdkLoginLog'
-import commonApi from '../../api/common'
-import dayjs from 'dayjs'
-import GameSelect from '@/components/game-select/index.vue'
-import AuthSelect from '@/components/auth-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import EditForm from "./edit.vue";
+import api from "../../api/gameLog/sdkLoginLog";
+import commonApi from "../../api/common";
+import dayjs from "dayjs";
+import GameSelect from "@/components/game-select/index.vue";
+import AuthSelect from "@/components/auth-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const editRef = ref()
-const mediaOptions = ref()
+const crudRef = ref();
+const editRef = ref();
+const mediaOptions = ref();
 
 // 搜索表单
 const searchForm = ref({
-  user_name: '',
-  game_id: '',
-  media_id: '',
-  agent_id: '',
-  site_id: '',
-  auth_id: '',
-  login_time: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
+  user_name: "",
+  game_id: "",
+  media_id: "",
+  agent_id: "",
+  site_id: "",
+  auth_id: "",
+  login_time: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
   reg_time: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -101,78 +140,90 @@ const options = reactive({
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
   showSort: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '用户名', dataIndex: 'user_name', width: 100 },
-  { title: '游戏', dataIndex: 'game_name', width: 120 },
-  { title: '媒体ID', dataIndex: 'media_id', width: 80 },
-  { title: '广告位id', dataIndex: 'site_id', width: 80 },
-  { title: '登录IP', dataIndex: 'ip', width: 120 },
-  { title: '登录IMEI/IDFA', dataIndex: 'imei', width: 120 },
-  { title: '登录OAID/CID', dataIndex: 'oaid', width: 120 },
+  { title: "用户名", dataIndex: "user_name", width: 100 },
+  { title: "游戏", dataIndex: "game_name", width: 120 },
+  { title: "渠道ID", dataIndex: "agent_id", width: 80 },
+  { title: "媒体ID", dataIndex: "media_id", width: 80 },
+  { title: "广告位ID", dataIndex: "site_id", width: 80 },
+  { title: "登录IP", dataIndex: "ip", width: 120 },
+  { title: "登录IMEI/IDFA", dataIndex: "imei", width: 120 },
+  { title: "登录OAID/CID", dataIndex: "oaid", width: 120 },
 
-  { title: '登录时间', dataIndex: 'login_time', width: 140 },
-  { title: '注册时间', dataIndex: 'reg_time', width: 140 },
+  { title: "登录时间", dataIndex: "login_time", width: 140 },
+  { title: "注册时间", dataIndex: "reg_time", width: 140 },
 
-  { title: '手机品牌', dataIndex: 'brand', width: 90 },
-  { title: '手机型号', dataIndex: 'model', width: 90 },
-  { title: '系统版本', dataIndex: 'system_version', width: 70 },
-  { title: 'sdk版本', dataIndex: 'sdk_version', width: 70 },
-  { title: '设备类型', dataIndex: 'vt', type: 'dict', dict: 'vt', width: 80 },
-  { title: '渠道名', dataIndex: 'agent_name', width: 90 },
-  { title: '负责人', dataIndex: 'auth_name', width: 90 },
-])
+  { title: "手机品牌", dataIndex: "brand", width: 90 },
+  { title: "手机型号", dataIndex: "model", width: 90 },
+  { title: "系统版本", dataIndex: "system_version", width: 70 },
+  { title: "sdk版本", dataIndex: "sdk_version", width: 70 },
+  { title: "设备类型", dataIndex: "vt", type: "dict", dict: "vt", width: 80 },
+  { title: "渠道名", dataIndex: "agent_name", width: 90 },
+  { title: "负责人", dataIndex: "auth_name", width: 90 },
+]);
 
 // 获取媒体类型
 const getMediaOptions = async () => {
-  const resp = await commonApi.getMediaOptionsApi()
+  const resp = await commonApi.getMediaOptionsApi();
   if (resp.code === 200) {
-    mediaOptions.value = resp.data
+    mediaOptions.value = resp.data;
   }
-}
+};
 
 // 页面数据初始化
 const initPage = async () => {
-  await getMediaOptions()
-}
+  await getMediaOptions();
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 const refreshDay = async (day) => {
   switch (day) {
-    case 'yesterday':
+    case "yesterday":
       searchForm.value.login_time = [
-        dayjs(searchForm.value.login_time[0]).subtract(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.login_time[1]).subtract(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
-    case 'today':
-      searchForm.value.login_time = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-      break
-    case 'tomorrow':
+        dayjs(searchForm.value.login_time[0])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+        dayjs(searchForm.value.login_time[1])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+      ];
+      break;
+    case "today":
       searchForm.value.login_time = [
-        dayjs(searchForm.value.login_time[0]).add(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.login_time[1]).add(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
+        dayjs().format("YYYY-MM-DD"),
+        dayjs().format("YYYY-MM-DD"),
+      ];
+      break;
+    case "tomorrow":
+      searchForm.value.login_time = [
+        dayjs(searchForm.value.login_time[0])
+          .add(1, "day")
+          .format("YYYY-MM-DD"),
+        dayjs(searchForm.value.login_time[1])
+          .add(1, "day")
+          .format("YYYY-MM-DD"),
+      ];
+      break;
     default:
-      break
+      break;
   }
-  refresh()
-}
+  refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/user-logs/sdkLoginLog' }
+export default { name: "v1/user-logs/sdkLoginLog" };
 </script>

+ 122 - 79
src/views/v1/gameLog/sdkRegLog/index.vue

@@ -1,11 +1,20 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="用户名" field="user_name">
-            <a-input v-model="searchForm.user_name" placeholder="请输入用户名" allow-clear />
+            <a-input
+              v-model="searchForm.user_name"
+              placeholder="请输入用户名"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -21,32 +30,59 @@
                 v-model="searchForm.reg_time"
                 :show-time="false"
                 placeholder="请选择注册时间"
-                :allow-clear="false" />
-              <a-button size="mini" type="outline" @click="refreshDay('yesterday')">前一天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('today')">当天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('tomorrow')">后一天</a-button>
+                :allow-clear="false"
+              />
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('yesterday')"
+                >前一天</a-button
+              >
+              <a-button size="mini" type="outline" @click="refreshDay('today')"
+                >当天</a-button
+              >
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('tomorrow')"
+                >后一天</a-button
+              >
             </a-space>
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="媒体类型" field="media_id">
-            <a-select v-model="searchForm.media_id" placeholder="请选择媒体类型" allow-clear allow-search>
+            <a-select
+              v-model="searchForm.media_id"
+              placeholder="请选择媒体类型"
+              allow-clear
+              allow-search
+            >
               <a-option
                 v-for="item in mediaOptions"
                 :key="item.id"
                 :value="item.id"
-                :label="`${item.id}:${item.name}`" />
+                :label="`${item.id}:${item.name}`"
+              />
             </a-select>
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
-          <a-form-item label="渠道id" field="agent_id">
-            <a-input v-model="searchForm.agent_id" placeholder="请输入渠道id" allow-clear />
+          <a-form-item label="渠道ID" field="agent_id">
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="请输入渠道ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
-          <a-form-item label="广告位id" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="请输入广告位id" allow-clear />
+          <a-form-item label="广告位ID" field="site_id">
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="请输入广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
 
@@ -64,7 +100,7 @@
 
       <!-- Table 自定义渲染 -->
       <template #reg_time="{ record }">
-        {{ dayjs(record.reg_time * 1000).format('YYYY-MM-DD HH:mm:ss') }}
+        {{ dayjs(record.reg_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}
       </template>
     </sa-table>
 
@@ -74,31 +110,31 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import { Message } from '@arco-design/web-vue'
-import EditForm from './edit.vue'
-import api from '../../api/gameLog/sdkRegLog'
-import dayjs from 'dayjs'
-import commonApi from '../../api/common'
-import GameSelect from '@/components/game-select/index.vue'
-import AuthSelect from '@/components/auth-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import { Message } from "@arco-design/web-vue";
+import EditForm from "./edit.vue";
+import api from "../../api/gameLog/sdkRegLog";
+import dayjs from "dayjs";
+import commonApi from "../../api/common";
+import GameSelect from "@/components/game-select/index.vue";
+import AuthSelect from "@/components/auth-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const editRef = ref()
-const mediaOptions = ref()
+const crudRef = ref();
+const editRef = ref();
+const mediaOptions = ref();
 
 // 搜索表单
 const searchForm = ref({
-  user_name: '',
-  game_id: '',
-  media_id: '',
-  agent_id: '',
-  site_id: '',
-  reg_time: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
-  vt: '',
+  user_name: "",
+  game_id: "",
+  media_id: "",
+  agent_id: "",
+  site_id: "",
+  reg_time: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
+  vt: "",
   auth_id: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -106,78 +142,85 @@ const options = reactive({
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
   showSort: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '用户名', dataIndex: 'user_name', width: 100 },
-  { title: '游戏', dataIndex: 'game_name', width: 100 },
-  { title: '设备类型', dataIndex: 'vt', type: 'dict', dict: 'vt', width: 120 },
-  { title: '渠道id', dataIndex: 'agent_id', width: 100 },
-  { title: '广告位id', dataIndex: 'site_id', width: 100 },
-
-  { title: '注册IP', dataIndex: 'ip', width: 120 },
-  { title: '注册时间', dataIndex: 'reg_time', width: 120 },
-
-  { title: '手机品牌', dataIndex: 'brand', width: 100 },
-  { title: '手机型号', dataIndex: 'model', width: 100 },
-  { title: '系统版本', dataIndex: 'system_version', width: 100 },
-  { title: 'sdk版本', dataIndex: 'sdk_version', width: 100 },
-  { title: '注册IMEI/IDFA', dataIndex: 'imei', width: 120 },
-  { title: '注册OAID/CID', dataIndex: 'oaid', width: 120 },
-
-  { title: '渠道名', dataIndex: 'agent_name', width: 100 },
-  { title: '负责人', dataIndex: 'auth_name', width: 100 },
-])
+  { title: "用户名", dataIndex: "user_name", width: 100 },
+  { title: "游戏", dataIndex: "game_name", width: 100 },
+  { title: "设备类型", dataIndex: "vt", type: "dict", dict: "vt", width: 120 },
+  { title: "渠道ID", dataIndex: "agent_id", width: 100 },
+  { title: "广告位ID", dataIndex: "site_id", width: 100 },
+
+  { title: "注册IP", dataIndex: "ip", width: 120 },
+  { title: "注册时间", dataIndex: "reg_time", width: 120 },
+
+  { title: "手机品牌", dataIndex: "brand", width: 100 },
+  { title: "手机型号", dataIndex: "model", width: 100 },
+  { title: "系统版本", dataIndex: "system_version", width: 100 },
+  { title: "sdk版本", dataIndex: "sdk_version", width: 100 },
+  { title: "注册IMEI/IDFA", dataIndex: "imei", width: 120 },
+  { title: "注册OAID/CID", dataIndex: "oaid", width: 120 },
+
+  { title: "渠道名", dataIndex: "agent_name", width: 100 },
+  { title: "负责人", dataIndex: "auth_name", width: 100 },
+]);
 
 // 获取媒体类型
 const getMediaOptions = async () => {
-  const resp = await commonApi.getMediaOptionsApi()
+  const resp = await commonApi.getMediaOptionsApi();
   if (resp.code === 200) {
-    mediaOptions.value = resp.data
+    mediaOptions.value = resp.data;
   }
-}
+};
 
 // 页面数据初始化
 const initPage = async () => {
-  await getMediaOptions()
-}
+  await getMediaOptions();
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 const refreshDay = async (day) => {
   switch (day) {
-    case 'yesterday':
+    case "yesterday":
       searchForm.value.reg_time = [
-        dayjs(searchForm.value.reg_time[0]).subtract(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.reg_time[1]).subtract(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
-    case 'today':
-      searchForm.value.reg_time = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-      break
-    case 'tomorrow':
+        dayjs(searchForm.value.reg_time[0])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+        dayjs(searchForm.value.reg_time[1])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+      ];
+      break;
+    case "today":
       searchForm.value.reg_time = [
-        dayjs(searchForm.value.reg_time[0]).add(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.reg_time[1]).add(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
+        dayjs().format("YYYY-MM-DD"),
+        dayjs().format("YYYY-MM-DD"),
+      ];
+      break;
+    case "tomorrow":
+      searchForm.value.reg_time = [
+        dayjs(searchForm.value.reg_time[0]).add(1, "day").format("YYYY-MM-DD"),
+        dayjs(searchForm.value.reg_time[1]).add(1, "day").format("YYYY-MM-DD"),
+      ];
+      break;
     default:
-      break
+      break;
   }
-  refresh()
-}
+  refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/user-logs/sdkRegLog' }
+export default { name: "v1/user-logs/sdkRegLog" };
 </script>