Kaynağa Gözat

修改首页

Seven 5 ay önce
ebeveyn
işleme
3068d56d6e

+ 48 - 42
admin-ui/src/views/platform/index.vue

@@ -70,7 +70,7 @@ const _update = () => {
     });
 };
 const _confirm = () => {
-  message("操作成功",{type:"success"});
+  message("操作成功", {type: "success"});
 };
 
 // 确定并关闭弹窗
@@ -97,45 +97,51 @@ onMounted(() => {
 </script>
 
 <template>
-  <el-form
-    ref="formRef"
-    :model="pageData.formData"
-    style="width: 50%; margin: 20px auto 0"
-    label-width="auto"
-    :rules="pageData.formRules"
-  >
-    <el-form-item label="appId" prop="appId">
-      <el-input
-        v-model="pageData.formData.appId"
-        clearable
-        placeholder="请输入appId"
-        size="small"
-        :readonly="isDetail"
-      />
-    </el-form-item>
-    <el-form-item label="密钥" prop="privateKey">
-      <el-input
-        v-model="pageData.formData.privateKey"
-        clearable
-        placeholder="请输入密钥"
-        size="small"
-        :readonly="isDetail"
-      />
-    </el-form-item>
-    <el-form-item label="公钥" prop="publicKey">
-      <el-input
-        v-model="pageData.formData.publicKey"
-        clearable
-        placeholder="请输入公钥"
-        size="small"
-        :readonly="isDetail"
-      />
-    </el-form-item>
-    <div>
-      <el-button v-if="!isDetail" type="primary" @click="handleConfirm"
-      >保存</el-button
-      >
-    </div>
-  </el-form>
-
+  <el-card>
+    <el-form
+      ref="formRef"
+      :model="pageData.formData"
+      style="width: 50%; margin: 20px"
+      label-width="auto"
+      :rules="pageData.formRules"
+    >
+      <el-form-item label="应用appId" prop="appId">
+        <el-input
+          v-model="pageData.formData.appId"
+          clearable
+          placeholder="请输入应用appId"
+          size="small"
+          :readonly="isDetail"
+        />
+      </el-form-item>
+      <el-form-item label="应用密钥" prop="privateKey">
+        <el-input
+          :rows="13"
+          type="textarea"
+          v-model="pageData.formData.privateKey"
+          clearable
+          placeholder="请输入应用密钥"
+          size="small"
+          :readonly="isDetail"
+        />
+      </el-form-item>
+      <el-form-item label="服务商公钥" prop="publicKey">
+        <el-input
+          :rows="5"
+          type="textarea"
+          v-model="pageData.formData.publicKey"
+          clearable
+          placeholder="请输入服务商公钥"
+          size="small"
+          :readonly="isDetail"
+        />
+      </el-form-item>
+      <div class="w-full text-center">
+        <el-button type="primary" @click="handleConfirm"
+        >保存
+        </el-button
+        >
+      </div>
+    </el-form>
+  </el-card>
 </template>

+ 280 - 5
admin-ui/src/views/welcome/index.vue

@@ -1,15 +1,290 @@
 <script setup lang="ts">
+import {reactive} from "vue";
+
 defineOptions({
   name: "Welcome"
 });
+
+const data = reactive({
+  today: {
+    // 数量
+    quantity: {
+      total: 0,
+      valid: 0
+    },
+    // 金额
+    amount: {
+      total: 0,
+      valid: 0
+    },
+    // 盈利
+    earnings: {
+      total: 0,
+      valid: 0
+    }
+  },
+  yesterday: {
+    // 数量
+    quantity: {
+      total: 0,
+      valid: 0
+    },
+    // 金额
+    amount: {
+      total: 0,
+      valid: 0
+    },
+    // 盈利
+    earnings: {
+      total: 0,
+      valid: 0
+    }
+  },
+  lastWeek: {
+    // 数量
+    quantity: {
+      total: 0,
+      valid: 0
+    },
+    // 金额
+    amount: {
+      total: 0,
+      valid: 0
+    },
+    // 盈利
+    earnings: {
+      total: 0,
+      valid: 0
+    }
+  },
+  lastMonth: {
+    // 数量
+    quantity: {
+      total: 0,
+      valid: 0
+    },
+    // 金额
+    amount: {
+      total: 0,
+      valid: 0
+    },
+    // 盈利
+    earnings: {
+      total: 0,
+      valid: 0
+    }
+  }
+});
+
 </script>
 
 <template>
-  <div class="max-w-full">
-    <el-card style="width: 480px; border-radius: 8px" shadow="hover"
-      >Always</el-card
-    >
-  </div>
+  <el-space direction="vertical">
+    <el-space class="my-4" wrap>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>今日笔数</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{ data.today.quantity.valid }}</span>
+                / {{ data.today.quantity.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>今日金额</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{ data.today.amount.valid }}</span> /
+                {{ data.today.amount.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>今日利润</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{ data.today.earnings.valid }}</span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+    </el-space>
+    <el-space class="my-4" wrap>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>昨日笔数</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.yesterday.quantity.valid
+                }}</span> / {{ data.yesterday.quantity.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>昨日金额</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.yesterday.amount.valid
+                }}</span> / {{ data.yesterday.amount.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>昨日利润</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.yesterday.earnings.valid
+                }}</span></div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+    </el-space>
+    <el-space class="my-4" wrap>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本周笔数</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.lastWeek.quantity.valid
+                }}</span> / {{ data.lastWeek.quantity.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本周金额</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{ data.lastWeek.amount.valid }}</span>
+                / {{ data.lastWeek.amount.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本周利润</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.lastWeek.earnings.valid
+                }}</span></div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+    </el-space>
+    <el-space class="my-4" wrap>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本月笔数</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.lastMonth.quantity.valid
+                }}</span> / {{ data.lastMonth.quantity.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本月金额</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.lastMonth.amount.valid
+                }}</span> / {{ data.lastMonth.amount.total }}
+              </div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+      <el-card style="width: 350px; border-radius: 8px" shadow="hover">
+        <template #header>
+          <div class="card-header">
+            <span>本月利润</span>
+          </div>
+        </template>
+        <div class="ep-bg-purple">
+          <div class="text">
+            <div class="text-center h-[40px]">
+              <div class="text-xl font-bold"><span class="text-red-700 text-2xl">{{
+                  data.lastMonth.earnings.valid
+                }}</span></div>
+            </div>
+          </div>
+        </div>
+      </el-card>
+    </el-space>
+  </el-space>
 </template>
 
 <style scoped>

+ 1 - 1
agent-ui/src/router/utils.ts

@@ -184,7 +184,7 @@ function handleAsyncRoutes(routeList) {
 function initRouter() {
   if (getConfig()?.CachingAsyncRoutes) {
     // 开启动态路由缓存本地sessionStorage
-    const key = "async-routes";
+    const key = "agent-async-routes";
     const asyncRouteList = storageSession().getItem(key) as any;
     if (asyncRouteList && asyncRouteList?.length > 0) {
       return new Promise(resolve => {