Browse Source

20240918已上线

yzs 1 year ago
parent
commit
ed6c4d0059

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 NODE_ENV = 'development'
 #VUE_APP_BASE_URL = 'https://apicms.manage.ai.yaoyuankj.top/'
 #VUE_APP_AI_URL = 'https://ckgpt.ai.yaoyuankj.top/'
-VUE_APP_BASE_URL = 'http://localhost:8091/'
+VUE_APP_BASE_URL = 'http://localhost:8041/'
 VUE_APP_AI_URL = 'http://120.79.155.3:4091/'

+ 2 - 0
src/entity/system.ts

@@ -139,4 +139,6 @@ interface ActiveCodeModel {
 	addNum: string | number;
   proxyId: string | number;
   salesPackageId: string | number;
+  activationCode: string;
+  packageType: string | number;
 }

+ 84 - 4
src/views/activation/activationCode.vue

@@ -1,6 +1,59 @@
 <template>
   <div class="main-container">
     <TableBody>
+      <template #header>
+        <el-input
+          v-model="activeCode.activationCode"
+          style="width: 200px; margin: 10px 0 10px 20px"
+          placeholder="请输入激活码"
+          clearable
+        />
+        <el-select
+          v-model="activeCode.proxyId"
+          placeholder="请选择代理"
+          style="width: 200px; margin: 10px 0 10px 10px"
+        >
+          <el-option
+            v-for="item in proxyList"
+            :key="item.id"
+            :label="item.proxyName"
+            :value="item.id"
+          />
+        </el-select>
+        <el-select
+          v-model="activeCode.packageType"
+          placeholder="请选择套餐类型"
+          style="width: 200px; margin: 10px 0 10px 10px"
+        >
+          <el-option
+            v-for="item in packageTypeEnum"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+        <el-button
+          type="success"
+          icon="Refresh"
+          style="margin-left: 10px"
+          @click="resetSearch"
+          size="small">
+          重置
+        </el-button>
+        <el-button
+          type="primary"
+          icon="Search"
+          @click="doRefresh"
+          size="small">
+          搜索
+        </el-button>
+        <el-button
+          type="primary"
+          size="small"
+          icon="Download"
+          @click="exportCsv"
+        >导出</el-button>
+      </template>
       <template #tableConfig>
         <TableConfig
           v-model:border="tableConfig.border"
@@ -148,11 +201,14 @@ import { onBeforeMount, onMounted, reactive, ref } from "vue";
 import {
   actionCarTypeEnum,
   activationCode,
-  activationCodeAdd, packageListLink, proxyListLink
+  activationCodeAdd, packageListLink, packageTypeEnumLink, proxyListLink
 } from "@/api/url";
 import { ElMessage } from "element-plus";
 import type { DialogType, TableFooter } from "@/components/types";
 import { useRouter } from "vue-router";
+import { get } from "@/api/http";
+import useUserStore from "@/store/modules/user";
+import { baseIp } from "@/api/axios.config";
 const router = useRouter();
 const post = usePost();
 const dialogRef = ref<DialogType>();
@@ -160,6 +216,9 @@ const tableFooter = ref<TableFooter>();
 const proxyList = ref<Array<any>>([]);
 const salesPackageList = ref<Array<any>>([]);
 const tableRef = ref();
+const packageTypeEnum = ref([
+  {label:"",value:""}
+]);
 const {
   dataList,
   tableLoading,
@@ -173,6 +232,8 @@ const activeCode = reactive<ActiveCodeModel>({
   addNum: "",
   salesPackageId: "",
   proxyId: "",
+  activationCode: "",
+  packageType: "",
 });
 
 function add() {
@@ -199,9 +260,7 @@ function doRefresh() {
     url: activationCode,
     data: {
       ...tableFooter.value?.withPageInfoData(),
-      data: {
-
-      }
+      data: activeCode
     }
   })
     .then((res) => {
@@ -226,6 +285,19 @@ function getPackageList(){
   }).catch(console.log);
 }
 
+function getPackageTypeEnum(){
+  get({
+    url: packageTypeEnumLink,
+    data: {},
+  }).then((res:any) => {
+    packageTypeEnum.value = res.data || [];
+  }).catch(console.log);
+}
+function exportCsv() {
+  const useStore = useUserStore();
+  window.open(baseIp+"cms_api/activation_code/export_csv?adminToken="+useStore.token+"&activationCode="+activeCode.activationCode+"&proxyId="+activeCode.proxyId+"&packageType="+activeCode.packageType)
+}
+
 function getProxyList(){
   post({
     url:proxyListLink,
@@ -240,11 +312,19 @@ function getProxyList(){
   }).catch(console.log);
 }
 
+const resetSearch = () => {
+  activeCode.activationCode = "";
+  activeCode.proxyId = "";
+  activeCode.packageType="";
+  doRefresh();
+}
+
 onMounted(() => {
   doRefresh();
   useHeight();
   getProxyList();
   getPackageList();
+  getPackageTypeEnum();
 });
 onBeforeMount(offTableCollapseTransition);
 </script>

+ 4 - 4
src/views/fund/salesPackage.vue

@@ -56,8 +56,8 @@
               <span v-if="scope.row.packageType===2||scope.row.packageType==3">Token数量:{{scope.row.tokens}}</span>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="套餐原价" prop="salesPrice" />
-          <el-table-column align="center" label="售卖金额" prop="price" />
+          <el-table-column align="center" label="套餐原价" prop="price" />
+          <el-table-column align="center" label="售卖金额" prop="salesPrice" />
           <el-table-column align="center" label="更新时间" prop="updateTimes" />
           <el-table-column align="center" label="创建时间" prop="createTime" />
           <el-table-column
@@ -173,7 +173,7 @@
           <el-form-item
             class="form-item"
             label="套餐原价:"
-            prop="packageName"
+            prop="price"
           >
             <el-input
               style="width: 300px"
@@ -187,7 +187,7 @@
           <el-form-item
             class="form-item__require"
             label="售卖价格:"
-            prop="packageName"
+            prop="salesPrice"
           >
             <el-input
               style="width: 300px"