ith5 3 ماه پیش
والد
کامیت
bc9b547fd2

+ 26 - 24
src/components/auth-select/index.vue

@@ -10,14 +10,16 @@
     allow-search
     allow-clear
     :filter-tree-node="filterTreeNode"
-    placeholder="负责人" />
+    dropdown-style="paddingRight: 10px;"
+    placeholder="负责人"
+  />
 </template>
 <script setup>
-import { ref, onMounted, defineProps, defineEmits } from 'vue'
-import advertCommonApi from '@/views/v1/api/advert/common'
-
-const authOptions = ref([])
+import { ref, onMounted, defineProps, defineEmits } from "vue";
+import advertCommonApi from "@/views/v1/api/advert/common";
 
+const authOptions = ref([]);
+const expandedKeys = ref([]);
 const props = defineProps({
   modelValue: {
     type: [Array],
@@ -27,46 +29,46 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
-})
+});
 
-const emit = defineEmits(['update:modelValue'])
+const emit = defineEmits(["update:modelValue"]);
 const onUpdate = (val) => {
-  emit('update:modelValue', val)
-}
+  emit("update:modelValue", val);
+};
 // 搜索
 const filterTreeNode = (inputText, node) => {
-  return node.name.toLowerCase().indexOf(inputText.toLowerCase()) > -1
-}
+  return node.name.toLowerCase().indexOf(inputText.toLowerCase()) > -1;
+};
 
 // 获取后台归属人列表
 const getAuthList = async () => {
-  const res = await advertCommonApi.getAuthOptionsApi()
+  const res = await advertCommonApi.getAuthOptionsApi();
   if (res.code == 200) {
     if (props.multiple) {
-      authOptions.value = res.data
+      authOptions.value = res.data;
     } else {
-      const data = await handleData(res.data)
-      authOptions.value = data
+      const data = await handleData(res.data);
+      authOptions.value = data;
     }
   }
-}
+};
 
 // 处理数据
 const handleData = (data) => {
   return new Promise((resolve) => {
     for (const item of data) {
-      if (item.id.includes('dept_id_')) {
-        item.disabled = true
+      if (item.id.includes("dept_id_")) {
+        item.disabled = true;
       }
       if (item.children) {
-        handleData(item.children)
+        handleData(item.children);
       }
     }
-    resolve(data)
-  })
-}
+    resolve(data);
+  });
+};
 
 onMounted(() => {
-  getAuthList()
-})
+  getAuthList();
+});
 </script>

+ 20 - 16
src/components/game-select/index.vue

@@ -9,37 +9,41 @@
     :fieldNames="{ title: 'name', key: 'id' }"
     allow-search
     allow-clear
-    placeholder="游戏" />
+    :treeProps="{
+      defaultExpandedKeys: [],
+    }"
+    placeholder="游戏"
+  />
 </template>
 
 <script setup>
-import { ref, onMounted, defineProps, defineEmits } from 'vue'
-import commonApi from '../../views/v1/api/common'
+import { ref, onMounted, defineProps, defineEmits } from "vue";
+import commonApi from "../../views/v1/api/common";
 
 const props = defineProps({
   modelValue: {
     type: [String, Number, Array],
-    default: '',
+    default: "",
   },
   multiple: {
     type: Boolean,
     default: false,
   },
-})
+});
 
-const emit = defineEmits(['update:modelValue', 'change'])
+const emit = defineEmits(["update:modelValue", "change"]);
 const onUpdate = (val) => {
-  emit('update:modelValue', val)
-  emit('change', val)
-}
-const gameListTree = ref([])
+  emit("update:modelValue", val);
+  emit("change", val);
+};
+const gameListTree = ref([]);
 
 const fetchGameList = async () => {
   // 这里替换为你的实际API请求
   // const response = await api.getGameList()
   // gameListTree.value = response.data
-  const response = await commonApi.getGameOptionsApi()
-  gameListTree.value = response.data
+  const response = await commonApi.getGameOptionsApi();
+  gameListTree.value = response.data;
 
   if (!props.multiple) {
     gameListTree.value = response.data.map((item) => {
@@ -47,10 +51,10 @@ const fetchGameList = async () => {
         ...item,
         disabled: true,
         children: item.children || [],
-      }
-    })
+      };
+    });
   }
-}
+};
 
-onMounted(fetchGameList)
+onMounted(fetchGameList);
 </script>

+ 122 - 72
src/views/v1/customer/sdkOrder/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="6" :xs="24">
@@ -10,32 +15,57 @@
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="日期" field="pay_time">
-            <a-range-picker v-model="searchForm.pay_time" :show-time="false" mode="date" style="width: 100%" />
+            <a-range-picker
+              v-model="searchForm.pay_time"
+              :show-time="false"
+              mode="date"
+              style="width: 100%"
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :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="6" :xs="24">
           <a-form-item label="角色ID" field="role_id">
-            <a-input v-model="searchForm.role_id" placeholder="请输入角色ID" allow-clear />
+            <a-input
+              v-model="searchForm.role_id"
+              placeholder="请输入角色ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="订单号" field="order_id">
-            <a-input v-model="searchForm.order_id" placeholder="请输入订单号" allow-clear />
+            <a-input
+              v-model="searchForm.order_id"
+              placeholder="请输入订单号"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="交易订单号" field="trade_id">
-            <a-input v-model="searchForm.trade_id" placeholder="请输入交易订单号" allow-clear />
+            <a-input
+              v-model="searchForm.trade_id"
+              placeholder="请输入交易订单号"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="支付状态" field="sync_status">
-            <a-select clearable v-model="searchForm.sync_status" placeholder="请选择支付状态">
+            <a-select
+              clearable
+              v-model="searchForm.sync_status"
+              placeholder="请选择支付状态"
+            >
               <a-option value="1">已支付</a-option>
               <a-option value="2">异常回调</a-option>
               <a-option value="0">未支付</a-option>
@@ -44,7 +74,11 @@
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="发货状态" field="send_status">
-            <a-select clearable v-model="searchForm.send_status" placeholder="请选择发货状态">
+            <a-select
+              clearable
+              v-model="searchForm.send_status"
+              placeholder="请选择发货状态"
+            >
               <a-option value="1">已发货</a-option>
               <a-option value="0">未发货</a-option>
             </a-select>
@@ -53,17 +87,33 @@
       </template>
 
       <!-- Table 自定义渲染 -->
-      <template #game_id="{ record }"> [{{ record.game_id }}] {{ record.game_name }} </template>
+      <template #game_id="{ record }">
+        [{{ record.game_id }}] {{ record.game_name }}
+      </template>
       <template #sync_status="{ record }">
         <!-- 支付回调状态 0未支付, 1已支付, 2异常回调 -->
-        <a-tag :color="record.sync_status === 1 ? 'green' : record.sync_status === 2 ? 'red' : 'blue'">
-          {{ record.sync_status === 1 ? '已支付' : record.sync_status === 2 ? '异常回调' : '未支付' }}
+        <a-tag
+          :color="
+            record.sync_status === 1
+              ? 'green'
+              : record.sync_status === 2
+              ? 'red'
+              : 'blue'
+          "
+        >
+          {{
+            record.sync_status === 1
+              ? "已支付"
+              : record.sync_status === 2
+              ? "异常回调"
+              : "未支付"
+          }}
         </a-tag>
       </template>
       <template #send_status="{ record }">
         <!-- 发货状态 0未发货, 1已发货 -->
         <a-tag :color="record.send_status === 1 ? 'green' : 'red'">
-          {{ record.send_status === 1 ? '已发货' : '未发货' }}
+          {{ record.send_status === 1 ? "已发货" : "未发货" }}
         </a-tag>
       </template>
       <template #operationCell="{ record }">
@@ -82,25 +132,25 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import { Message, Modal } from '@arco-design/web-vue'
-import EditForm from './edit.vue'
-import api from '../../api/customer/sdkOrder'
-import GameSelect from '@/components/game-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import { Message, Modal } from "@arco-design/web-vue";
+import EditForm from "./edit.vue";
+import api from "../../api/customer/sdkOrder";
+import GameSelect from "@/components/game-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const editRef = ref()
+const crudRef = ref();
+const editRef = ref();
 
 // 搜索表单
 const searchForm = ref({
-  order_id: '',
-  trade_id: '',
-  game_id: '',
-  user_name: '',
-  role_id: '',
+  order_id: "",
+  trade_id: "",
+  game_id: "",
+  user_name: "",
+  role_id: "",
   pay_time: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
@@ -108,101 +158,101 @@ const options = reactive({
   showSummary: true,
   summary: [
     {
-      action: 'totalRow',
-      dataIndex: 'money',
+      action: "totalRow",
+      dataIndex: "money",
     },
   ],
 
   add: {
     show: false,
-    auth: ['/v1/customer/SdkOrder/save'],
+    auth: ["/v1/customer/SdkOrder/save"],
     func: async () => {
-      editRef.value?.open()
+      editRef.value?.open();
     },
   },
   edit: {
     show: false,
-    auth: ['/v1/customer/SdkOrder/update'],
+    auth: ["/v1/customer/SdkOrder/update"],
     func: async (record) => {
-      editRef.value?.open('edit')
-      editRef.value?.setFormData(record)
+      editRef.value?.open("edit");
+      editRef.value?.setFormData(record);
     },
   },
   delete: {
     show: false,
-    auth: ['/v1/customer/SdkOrder/destroy'],
+    auth: ["/v1/customer/SdkOrder/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: '充值账号', dataIndex: 'user_name', width: 120 },
-  { title: '充值IP', dataIndex: 'user_ip', width: 130 },
-  { title: '订单号', dataIndex: 'order_id', width: 180 },
-  { title: '交易订单号', dataIndex: 'trade_id', width: 180 },
-  { title: '研发订单号', dataIndex: 'cp_order_id', width: 180 },
-  { title: '支付时间', dataIndex: 'pay_date', width: 140 },
+  { title: "充值账号", dataIndex: "user_name", width: 120 },
+  { title: "充值IP", dataIndex: "ip", width: 130 },
+  { title: "订单号", dataIndex: "order_id", width: 180 },
+  { title: "交易订单号", dataIndex: "trade_id", width: 180 },
+  { title: "研发订单号", dataIndex: "cp_order_id", width: 180 },
+  { title: "支付时间", dataIndex: "pay_date", width: 140 },
   {
-    title: '金额',
-    dataIndex: 'money',
+    title: "金额",
+    dataIndex: "money",
     width: 100,
   },
-  { title: '充值游戏', dataIndex: 'game_id', width: 120 },
+  { title: "充值游戏", dataIndex: "game_id", width: 120 },
 
-  { title: '充值区服', dataIndex: 'server_name', width: 120 },
-  { title: '角色ID', dataIndex: 'role_id', width: 60 },
-  { title: '角色名', dataIndex: 'role_name', width: 100 },
+  { title: "充值区服", dataIndex: "server_name", width: 120 },
+  { title: "角色ID", dataIndex: "role_id", width: 60 },
+  { title: "角色名", dataIndex: "role_name", width: 100 },
 
-  { title: '支付状态', dataIndex: 'sync_status', width: 80 },
-  { title: '发货状态', dataIndex: 'send_status', width: 80 },
+  { title: "支付状态", dataIndex: "sync_status", width: 80 },
+  { title: "发货状态", dataIndex: "send_status", width: 80 },
 
-  { title: '充值方式', dataIndex: 'pay_channel_name', width: 120 },
+  { title: "充值方式", dataIndex: "pay_channel_name", width: 120 },
 
-  { title: '支付返回值', dataIndex: 'sync_result', width: 80 },
-  { title: '回调信息', dataIndex: 'sync_data', width: 80 },
+  { title: "支付返回值", dataIndex: "sync_result", width: 80 },
+  { title: "回调信息", dataIndex: "sync_data", width: 80 },
 
-  { title: 'SDK版本', dataIndex: 'sdk_version', width: 80 },
-])
+  { title: "SDK版本", dataIndex: "sdk_version", width: 80 },
+]);
 
 // 页面数据初始化
-const initPage = async () => {}
+const initPage = async () => {};
 
 // 补发
 const handleSend = async (record) => {
-  console.log(record)
+  console.log(record);
   Modal.info({
-    title: '补发',
-    content: '确定要补发吗?',
-    okText: '确定',
-    cancelText: '取消',
+    title: "补发",
+    content: "确定要补发吗?",
+    okText: "确定",
+    cancelText: "取消",
     onOk: async () => {
-      const resp = await api.send(record.order_id)
+      const resp = await api.send(record.order_id);
       if (resp.code === 200) {
-        Message.success(`操作成功,请稍后刷新`)
-        crudRef.value?.refresh()
+        Message.success(`操作成功,请稍后刷新`);
+        crudRef.value?.refresh();
       }
     },
-  })
-}
+  });
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-})
+  initPage();
+});
 </script>
 
 <script>
-export default { name: 'v1/customer/sdkOrder' }
+export default { name: "v1/customer/sdkOrder" };
 </script>

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

@@ -76,7 +76,7 @@ const searchForm = ref({
   site_id: "",
   auth_id: "",
   user_name: "",
-  crete_time: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
+  create_time: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")],
 });
 
 // SaTable 基础配置