瀏覽代碼

优化代码

ith5 5 月之前
父節點
當前提交
2997020bf7

+ 1 - 1
src/components/game-select/index.vue

@@ -5,7 +5,7 @@
     :data="gameListTree"
     tree-checked-strategy="child"
     :tree-checkable="multiple"
-    :max-tag-count="2"
+    :max-tag-count="1"
     :fieldNames="{ title: 'name', key: 'id' }"
     allow-search
     allow-clear

+ 24 - 22
src/components/sa-table/defaultOptions.js

@@ -2,7 +2,7 @@ export default {
   // 当前crud组件的 id,全局唯一,不指定则随机生成一个
   id: undefined,
   // 主键名称
-  pk: "id",
+  pk: 'id',
   // 请求api方法
   api: () => {},
   // 设置分页组件每页记录数
@@ -20,26 +20,28 @@ export default {
   // 斑马线
   stripe: true,
   // 表格大小
-  size: "small",
+  size: 'small',
   // 是否显示展开/折叠按钮
   isExpand: false,
   // 是否显示工具栏
   showTools: true,
   // 页面布局方式,支持 normal(标准)和 fixed(固定)两种
-  pageLayout: "fixed",
+  pageLayout: 'fixed',
   height: 0,
   // 简洁模式
   pageSimple: false,
   // 显示排序
   showSort: true,
+  // 是否需要服务端排序
+  serverSort: false,
   // 显示隐藏列
   showColumnSetting: true,
   // 显示搜索
   showSearch: true,
   // 搜索提交按钮文案
-  searchText: "搜索",
+  searchText: '搜索',
   // 搜索重置按钮文案
-  resetText: "重置",
+  resetText: '重置',
   // 强制搜索一行显示
   singleLine: false,
 
@@ -49,9 +51,9 @@ export default {
     // 显示新增按钮的权限
     auth: [],
     // 按钮文案
-    text: "查看",
+    text: '查看',
     // 是否显示
-    show: false,
+    show: false
   },
 
   add: {
@@ -60,9 +62,9 @@ export default {
     // 显示新增按钮的权限
     auth: [],
     // 按钮文案
-    text: "新增",
+    text: '新增',
     // 是否显示
-    show: false,
+    show: false
   },
   edit: {
     // 编辑api
@@ -70,9 +72,9 @@ export default {
     // 显示编辑按钮的权限
     auth: [],
     // 按钮文案
-    text: "编辑",
+    text: '编辑',
     // 是否显示
-    show: false,
+    show: false
   },
   delete: {
     // 删除api
@@ -80,11 +82,11 @@ export default {
     // 显示删除按钮的权限
     auth: [],
     // 按钮文案
-    text: "删除",
+    text: '删除',
     // 是否显示
     show: false,
     // 是否显示批量处理按钮
-    batch: true,
+    batch: true
   },
   import: {
     // 导入url
@@ -96,9 +98,9 @@ export default {
     // 显示导入按钮的权限
     auth: [],
     // 按钮文案
-    text: "导入",
+    text: '导入',
     // 是否显示
-    show: false,
+    show: false
   },
   export: {
     // 导出url
@@ -106,27 +108,27 @@ export default {
     // 显示导出按钮的权限
     auth: [],
     // 按钮文案
-    text: "导出",
+    text: '导出',
     // 是否显示
-    show: false,
+    show: false
   },
 
   // 列对齐方式
-  columnAlign: "left",
+  columnAlign: 'left',
 
   // 是否显示索引列
   showIndex: false,
   // 索引列名称
-  indexLabel: "序号",
+  indexLabel: '序号',
   // 索引列宽度
   indexColumnWidth: 70,
   // 索引列固定方向,false 为不固定
-  indexColumnFixed: "left",
+  indexColumnFixed: 'left',
 
   // 是否显示操作列
   operationColumn: true,
   // 操作列宽度
   operationColumnWidth: 190,
   // 操作列名称
-  operationColumnText: "操作",
-};
+  operationColumnText: '操作'
+}

+ 3 - 0
src/components/sa-table/index.vue

@@ -562,6 +562,9 @@ const handlerExpand = () => {
 
 // 排序
 const handlerSort = async (name, type) => {
+  if (!options.value.serverSort) {
+    return
+  }
   if (type) {
     requestParams.value.orderBy = name
     requestParams.value.orderType = type === 'ascend' ? 'asc' : 'desc'

+ 0 - 1
src/views/v1/gameLog/activeDay/index.vue

@@ -56,7 +56,6 @@ const days_options = ref([
 const options = reactive({
   api: api.getRetentionDayDataList,
   pk: 'id',
-  rowSelection: { showCheckedAll: true },
   showSummary: true,
   operationColumn: false,
   showSort: false,

+ 90 - 11
src/views/v1/gameLog/agent/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm" @search="handleRequestData">
+    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="8" :xs="24">
@@ -100,10 +100,95 @@ const searchForm = ref({
 // SaTable 基础配置
 const options = reactive({
   api: api.getAgentDataList,
-  pk: 'id',
-  rowSelection: { showCheckedAll: true },
-  showSort: false,
-
+  pk: 'akey',
+  showSort: true,
+  showSummary: true,
+  summary: [
+    {
+      action: 'totalRow',
+      dataIndex: 'akey',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'cost',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'install',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'reg_dev',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'reg_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'role_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'role_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'active',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'a_cost',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'a_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'reg_pay_num',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'reg_pay_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'p_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'da_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 're_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 're_amount_per',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 're_amount_per_7',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'p_cost',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'arpu',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'r_arpu',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'old_login_total',
+    },
+  ],
   operationColumn: false,
 })
 
@@ -152,12 +237,6 @@ onMounted(async () => {
   initPage()
   refresh()
 })
-
-const handleRequestData = () => {
-  const res = crudRef.value.getResponseData()
-  console.log('res====>', res)
-  total.value = res.totalData
-}
 </script>
 
 <script>

+ 2 - 1
src/views/v1/gameLog/agentByDay/index.vue

@@ -81,8 +81,9 @@ const options = reactive({
   api: api.getAgentDayDataList,
   pk: 'tdate',
   rowSelection: { showCheckedAll: true },
-  showSort: false,
+
   showSummary: true,
+  showSort: true,
   summary: [
     {
       action: 'totalRow',

+ 24 - 24
src/views/v1/gameLog/hour/index.vue

@@ -144,30 +144,30 @@ const columns = reactive([
   { title: '渠道ID', dataIndex: 'agent_id', width: 80 },
   { title: '渠道名', dataIndex: 'agent_name', width: 100 },
   { title: '合计', dataIndex: 'total_raw', width: 80 },
-  { title: 'h0', dataIndex: 'h0', width: 80 },
-  { title: 'h1', dataIndex: 'h1', width: 80 },
-  { title: 'h2', dataIndex: 'h2', width: 80 },
-  { title: 'h3', dataIndex: 'h3', width: 80 },
-  { title: 'h4', dataIndex: 'h4', width: 80 },
-  { title: 'h5', dataIndex: 'h5', width: 80 },
-  { title: 'h6', dataIndex: 'h6', width: 80 },
-  { title: 'h7', dataIndex: 'h7', width: 80 },
-  { title: 'h8', dataIndex: 'h8', width: 80 },
-  { title: 'h9', dataIndex: 'h9', width: 80 },
-  { title: 'h10', dataIndex: 'h10', width: 80 },
-  { title: 'h11', dataIndex: 'h11', width: 80 },
-  { title: 'h12', dataIndex: 'h12', width: 80 },
-  { title: 'h13', dataIndex: 'h13', width: 80 },
-  { title: 'h14', dataIndex: 'h14', width: 80 },
-  { title: 'h15', dataIndex: 'h15', width: 80 },
-  { title: 'h16', dataIndex: 'h16', width: 80 },
-  { title: 'h17', dataIndex: 'h17', width: 80 },
-  { title: 'h18', dataIndex: 'h18', width: 80 },
-  { title: 'h19', dataIndex: 'h19', width: 80 },
-  { title: 'h20', dataIndex: 'h20', width: 80 },
-  { title: 'h21', dataIndex: 'h21', width: 80 },
-  { title: 'h22', dataIndex: 'h22', width: 80 },
-  { title: 'h23', dataIndex: 'h23', width: 80 },
+  { title: '0', dataIndex: 'h0', width: 80 },
+  { title: '1', dataIndex: 'h1', width: 80 },
+  { title: '2', dataIndex: 'h2', width: 80 },
+  { title: '3', dataIndex: 'h3', width: 80 },
+  { title: '4', dataIndex: 'h4', width: 80 },
+  { title: '5', dataIndex: 'h5', width: 80 },
+  { title: '6', dataIndex: 'h6', width: 80 },
+  { title: '7', dataIndex: 'h7', width: 80 },
+  { title: '8', dataIndex: 'h8', width: 80 },
+  { title: '9', dataIndex: 'h9', width: 80 },
+  { title: '10', dataIndex: 'h10', width: 80 },
+  { title: '11', dataIndex: 'h11', width: 80 },
+  { title: '12', dataIndex: 'h12', width: 80 },
+  { title: '13', dataIndex: 'h13', width: 80 },
+  { title: '14', dataIndex: 'h14', width: 80 },
+  { title: '15', dataIndex: 'h15', width: 80 },
+  { title: '16', dataIndex: 'h16', width: 80 },
+  { title: '17', dataIndex: 'h17', width: 80 },
+  { title: '18', dataIndex: 'h18', width: 80 },
+  { title: '19', dataIndex: 'h19', width: 80 },
+  { title: '20', dataIndex: 'h20', width: 80 },
+  { title: '21', dataIndex: 'h21', width: 80 },
+  { title: '22', dataIndex: 'h22', width: 80 },
+  { title: '23', dataIndex: 'h23', width: 80 },
 ])
 
 // 页面数据初始化

+ 1 - 1
src/views/v1/gameLog/ltv/index.vue

@@ -96,7 +96,7 @@ const options = reactive({
   api: api.getLtvDataList,
   pk: 'tdate',
   rowSelection: { showCheckedAll: true },
-  showSort: false,
+
   showSummary: true,
   summary: [
     {

+ 1 - 0
src/views/v1/gameLog/sdkLoginLog/index.vue

@@ -107,6 +107,7 @@ const options = reactive({
   api: api.getPageList,
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
+  showSort: false,
 })
 
 // SaTable 列配置

+ 1 - 0
src/views/v1/gameLog/sdkOrderRank/index.vue

@@ -133,6 +133,7 @@ const options = reactive({
   pk: 'order_id',
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
+  showSort: false,
 })
 
 // SaTable 列配置

+ 1 - 0
src/views/v1/gameLog/sdkOrderSuccess/index.vue

@@ -108,6 +108,7 @@ const options = reactive({
   api: api.getPageList,
   pk: 'order_id',
   rowSelection: { showCheckedAll: true },
+  showSort: false,
   export: {
     // // 导出url
     // url: "v1/gameLog/sdkOrderSuccess/export",

+ 1 - 0
src/views/v1/gameLog/sdkRegLog/index.vue

@@ -110,6 +110,7 @@ const options = reactive({
   api: api.getPageList,
   rowSelection: { showCheckedAll: true },
   operationColumn: false,
+  showSort: false,
 })
 
 // SaTable 列配置

+ 1 - 1
src/views/v1/gameLog/site/index.vue

@@ -193,7 +193,7 @@ const options = reactive({
       dataIndex: 'auth_name',
     },
   ],
-
+  showSort: true,
   operationColumn: false,
 })
 

+ 1 - 1
src/views/v1/material/cost/index.vue

@@ -109,7 +109,7 @@ const searchForm = ref({
 const options = reactive({
   api: api.getMaterialListApi,
   pk: 'id',
-  showSort: false,
+  showSort: true,
   operationColumn: false,
   showSummary: true,
   summary: [