CzRger 2 mēneši atpakaļ
vecāks
revīzija
2db2451839

+ 10 - 0
src/router/modules/big-model.ts

@@ -8,6 +8,16 @@ const BigModelRouter = [
     },
   },
   {
+    path: '/home/:id/app',
+    name: 'd8b2a8e5-d087-4722-b833-7b7e10df0ec0',
+    component: () => import('@/views/manage/home/app/index.vue'),
+    meta: {
+      title: '应用体验',
+      single: true,
+      root: '4806d051-e037-4d9d-99a0-78aa2f2f362b',
+    },
+  },
+  {
     path: '/model',
     name: '86e9f5e8-285d-4038-abc2-a39b2ad7fcd1',
     component: () => import('@/views/manage/model/index.vue'),

+ 8 - 19
src/views/manage/app/make/index.vue

@@ -1,18 +1,12 @@
 <template>
   <div class="flex h-full w-full flex-col">
-    <div
-      class="__hover flex items-center text-sm text-[var(--czr-main-color)]"
-      @click="toBack"
-    >
-      <SvgIcon
-        name="czr_arrow"
-        rotate="180"
-        size="13"
-        :active="true"
-        class="mr-1"
-      />应用中心
-    </div>
-    <div class="bm-main-box mt-4">
+    <toBackCom
+      title="应用中心"
+      :rou="{
+        name: 'd446bfb3-4605-477f-a0f4-b7a0a1aa78fe',
+      }"
+    />
+    <div class="bm-main-box">
       <div class="grid h-full w-full grid-cols-3 gap-4">
         <div
           class="col-span-2 flex flex-col gap-2 overflow-hidden rounded-lg bg-[#F6F8FC] p-4"
@@ -672,6 +666,7 @@ import templateDetail from './template-detail.vue'
 import workflowSelect from './workflow-select.vue'
 import CzrForm from '@/components/czr-ui/CzrForm.vue'
 import CzrDialog from '@/components/czr-ui/CzrDialog.vue'
+import toBackCom from '@/views/manage/components/to-back.vue'
 
 const DictionaryStore = useDictionaryStore()
 const DialogStore = useDialogStore()
@@ -805,12 +800,6 @@ const initDrag = () => {
     })
   })
 }
-
-const toBack = () => {
-  router.push({
-    name: 'd446bfb3-4605-477f-a0f4-b7a0a1aa78fe',
-  })
-}
 const onAddKnowledge = () => {
   state.knowledgeSelect.transfer = {
     ids: state.form.knowledges.map((v) => v.id),

+ 32 - 0
src/views/manage/components/to-back.vue

@@ -0,0 +1,32 @@
+<template>
+  <div
+    class="__hover mb-2.5 ml-2.5 flex items-center text-sm text-[var(--czr-main-color)]"
+    @click="toBack"
+  >
+    <SvgIcon
+      name="czr_arrow"
+      rotate="180"
+      size="13"
+      :active="true"
+      class="mr-1"
+    />
+    {{ props.title }}
+  </div>
+</template>
+
+<script setup lang="ts">
+import { reactive } from 'vue'
+import { useRouter } from 'vue-router'
+
+const router = useRouter()
+const props = defineProps({
+  title: { default: '' },
+  rou: { default: {} },
+})
+const state: any = reactive({})
+const toBack = () => {
+  router.push(props.rou)
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 20 - 0
src/views/manage/home/app/index.vue

@@ -0,0 +1,20 @@
+<template>
+  <div class="flex h-full w-full flex-col">
+    <toBackCom
+      title="首页"
+      :rou="{
+        name: '4806d051-e037-4d9d-99a0-78aa2f2f362b',
+      }"
+    />
+    <div class="bm-main-box"></div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { reactive } from 'vue'
+import toBackCom from '@/views/manage/components/to-back.vue'
+
+const state: any = reactive({})
+</script>
+
+<style lang="scss" scoped></style>

+ 11 - 12
src/views/manage/knowledge/upload/index.vue

@@ -1,17 +1,15 @@
 <template>
   <div class="flex h-full w-full flex-col">
-    <div
-      class="__hover ml-2.5 flex items-center text-sm text-[var(--czr-main-color)]"
-      @click="toBack"
-    >
-      <SvgIcon
-        name="czr_arrow"
-        :rotate="180"
-        size="12"
-        :active="true"
-      />文档列表
-    </div>
-    <div class="bm-main-box mt-[1.25rem]" v-if="state.knowledge.ID">
+    <toBackCom
+      title="文档列表"
+      :rou="{
+        name: '78430247-a531-4c8f-8a08-c88e93a836e2',
+        params: {
+          id: state.ID,
+        },
+      }"
+    />
+    <div class="bm-main-box" v-if="state.knowledge.ID">
       <div class="flex gap-4" v-if="state.step === 1">
         <CzrButton
           :type="state.uploadType == UploadTypeEnum.Text ? 'primary' : 'normal'"
@@ -412,6 +410,7 @@ import {
   datasetsDocumentsDealView,
 } from '@/api/modules/knowledge/document'
 import stageConfig from './stage-config.vue'
+import toBackCom from '@/views/manage/components/to-back.vue'
 
 const DictionaryStore = useDictionaryStore()
 const DialogStore = useDialogStore()

+ 137 - 136
src/views/manage/model/statistic/index.vue

@@ -1,146 +1,152 @@
 <template>
-  <div class="bm-main-box">
-    <CzrButton
-      type="normal"
-      title="返回"
-      icon="czr_arrow"
-      :rotate="180"
-      @click="toBack"
+  <div class="flex h-full w-full flex-col">
+    <toBackCom
+      title="模型纳管"
+      :rou="{
+        name: '78430247-a531-4c8f-8a08-c88e93a836e2',
+        params: {
+          name: '86e9f5e8-285d-4038-abc2-a39b2ad7fcd1',
+        },
+      }"
     />
-    <div class="mt-4 flex">
-      <img
-        src="@/assets/images/model/model-default-logo.png"
-        class="mr-2.5 h-[3.25rem] w-[3.25rem]"
-      />
-      <div class="flex flex-1 flex-col justify-around overflow-hidden">
-        <div class="flex items-center text-xl font-bold text-[#2E3238]">
-          <div v-title>{{ state.detail.name }}</div>
-          <div
-            v-if="state.detail.status == 1"
-            class="ml-4 flex h-[1.56rem] w-[3.75rem] items-center justify-center rounded-[1.25rem] bg-gradient-to-r from-[#D5F9FE] to-[#E0DAFF] text-[0.75rem] font-bold text-[#1E3F92]"
-          >
-            已启用
+    <div class="bm-main-box">
+      <div class="flex">
+        <img
+          src="@/assets/images/model/model-default-logo.png"
+          class="mr-2.5 h-[3.25rem] w-[3.25rem]"
+        />
+        <div class="flex flex-1 flex-col justify-around overflow-hidden">
+          <div class="flex items-center text-xl font-bold text-[#2E3238]">
+            <div v-title>{{ state.detail.name }}</div>
+            <div
+              v-if="state.detail.status == 1"
+              class="ml-4 flex h-[1.56rem] w-[3.75rem] items-center justify-center rounded-[1.25rem] bg-gradient-to-r from-[#D5F9FE] to-[#E0DAFF] text-[0.75rem] font-bold text-[#1E3F92]"
+            >
+              已启用
+            </div>
           </div>
-        </div>
-        <div class="flex">
-          <div
-            class="flex h-[1.25rem] items-center justify-center rounded-[0.13rem] bg-gradient-to-r from-[#FF9E2D] to-[#FFB92D] px-[0.38rem] text-[0.63rem] font-bold text-[#ffffff]"
-          >
-            {{ DictionaryStore.modelTypes.map.get(state.detail.type) }}
+          <div class="flex">
+            <div
+              class="flex h-[1.25rem] items-center justify-center rounded-[0.13rem] bg-gradient-to-r from-[#FF9E2D] to-[#FFB92D] px-[0.38rem] text-[0.63rem] font-bold text-[#ffffff]"
+            >
+              {{ DictionaryStore.modelTypes.map.get(state.detail.type) }}
+            </div>
           </div>
         </div>
+        <div class="mt-[0.25rem] ml-auto"></div>
       </div>
-      <div class="mt-[0.25rem] ml-auto"></div>
-    </div>
-    <div class="mt-2.5 text-sm text-[#606266]" style="line-height: 1.4rem">
-      {{ state.detail.description }}
-    </div>
-    <div class="mt-2.5 flex items-center gap-2.5 text-[0.75rem] text-[#6F7889]">
-      <div>
-        {{ DictionaryStore.modelProvides.map.get(state.detail.pluginClass) }}
+      <div class="mt-2.5 text-sm text-[#606266]" style="line-height: 1.4rem">
+        {{ state.detail.description }}
       </div>
-      <div>|</div>
-      <div>(创建单位)</div>
-      <div>|</div>
-      <div>{{ state.detail.createNickName }}</div>
-      <div>|</div>
-      <div>{{ YMDHms(state.detail.updateTime) }}</div>
-    </div>
-    <div class="mt-4 flex flex-1 flex-col gap-4 overflow-y-auto">
-      <div class="card">
-        <div class="__czr-title_1">Token调用次数</div>
-        <div class="h-[9rem] w-full">
-          <lineChart :data="state.statistic.token" />
+      <div
+        class="mt-2.5 flex items-center gap-2.5 text-[0.75rem] text-[#6F7889]"
+      >
+        <div>
+          {{ DictionaryStore.modelProvides.map.get(state.detail.pluginClass) }}
         </div>
+        <div>|</div>
+        <div>(创建单位)</div>
+        <div>|</div>
+        <div>{{ state.detail.createNickName }}</div>
+        <div>|</div>
+        <div>{{ YMDHms(state.detail.updateTime) }}</div>
       </div>
-      <div class="card">
-        <div class="__czr-title_1">大模型调用次数</div>
-        <div class="h-[9rem] w-full">
-          <lineChart :data="state.statistic.call" />
+      <div class="mt-4 flex flex-1 flex-col gap-4 overflow-y-auto">
+        <div class="card">
+          <div class="__czr-title_1">Token调用次数</div>
+          <div class="h-[9rem] w-full">
+            <lineChart :data="state.statistic.token" />
+          </div>
         </div>
-      </div>
-      <div class="flex gap-4">
-        <div class="card flex-1">
-          <div class="__czr-title_1">调用单位占比统计</div>
-          <div class="h-[16rem] w-full">
-            <pieChart :data="state.statistic.dept" />
+        <div class="card">
+          <div class="__czr-title_1">大模型调用次数</div>
+          <div class="h-[9rem] w-full">
+            <lineChart :data="state.statistic.call" />
           </div>
         </div>
-        <div class="card flex-1">
-          <div class="__czr-title_1">大模型调用明细</div>
-          <div class="mt-2 flex h-[16rem] w-full flex-col">
-            <div class="flex h-[2.25rem] items-center gap-2">
-              <CzrButton
-                :type="
-                  state.statistic.table.dateType === 1 ? 'primary' : 'normal'
-                "
-                title="今日"
-                @click="() => (state.statistic.table.dateType = 1)"
-              />
-              <CzrButton
-                :type="
-                  state.statistic.table.dateType === 2 ? 'primary' : 'normal'
-                "
-                title="近7天"
-                @click="() => (state.statistic.table.dateType = 2)"
-              />
-              <CzrButton
-                :type="
-                  state.statistic.table.dateType === 3 ? 'primary' : 'normal'
-                "
-                title="近30天"
-                @click="() => (state.statistic.table.dateType = 3)"
-              />
-              <CzrButton
-                :type="
-                  state.statistic.table.dateType === 4 ? 'primary' : 'normal'
-                "
-                title="自定义"
-                @click="() => (state.statistic.table.dateType = 4)"
-              />
-              <CzrFormColumn
-                v-if="state.statistic.table.dateType === 4"
-                width="25rem"
-                class="__czr-table-form-column"
-                label-width="0px"
-                v-model:param="state.statistic.table.cusDate"
-                link="datetime"
-                type="datetimerange"
-              />
+        <div class="flex gap-4">
+          <div class="card flex-1">
+            <div class="__czr-title_1">调用单位占比统计</div>
+            <div class="h-[16rem] w-full">
+              <pieChart :data="state.statistic.dept" />
             </div>
-            <div class="flex-1">
-              <CzrTable
-                v-loading="state.statistic.table.query.loading"
-                :data="state.statistic.table.query.result.data"
-                :head="state.statistic.table.query.head"
-                :no-foot="true"
-              >
-                <template #name-column-value="{ scope }">
-                  <div class="flex justify-center">
-                    <CzrButton
-                      type="table"
-                      :title="scope.row.p1"
-                      @click="onStage(scope.row)"
-                    />
-                  </div>
-                </template>
-                <template #caozuo-column-value="{ scope }">
-                  <div class="__czr-table-operations">
-                    <CzrButton
-                      type="table"
-                      title="重命名"
-                      @click="onRename(scope.row)"
-                    />
-                    <CzrButton
-                      type="table"
-                      title="迁移"
-                      @click="onKnowledge(scope.row)"
-                    />
-                    <CzrButton type="table" title="归档" />
-                    <CzrButton type="table-del" @click="onDel(scope.row)" />
-                  </div>
-                </template>
-              </CzrTable>
+          </div>
+          <div class="card flex-1">
+            <div class="__czr-title_1">大模型调用明细</div>
+            <div class="mt-2 flex h-[16rem] w-full flex-col">
+              <div class="flex h-[2.25rem] items-center gap-2">
+                <CzrButton
+                  :type="
+                    state.statistic.table.dateType === 1 ? 'primary' : 'normal'
+                  "
+                  title="今日"
+                  @click="() => (state.statistic.table.dateType = 1)"
+                />
+                <CzrButton
+                  :type="
+                    state.statistic.table.dateType === 2 ? 'primary' : 'normal'
+                  "
+                  title="近7天"
+                  @click="() => (state.statistic.table.dateType = 2)"
+                />
+                <CzrButton
+                  :type="
+                    state.statistic.table.dateType === 3 ? 'primary' : 'normal'
+                  "
+                  title="近30天"
+                  @click="() => (state.statistic.table.dateType = 3)"
+                />
+                <CzrButton
+                  :type="
+                    state.statistic.table.dateType === 4 ? 'primary' : 'normal'
+                  "
+                  title="自定义"
+                  @click="() => (state.statistic.table.dateType = 4)"
+                />
+                <CzrFormColumn
+                  v-if="state.statistic.table.dateType === 4"
+                  width="25rem"
+                  class="__czr-table-form-column"
+                  label-width="0px"
+                  v-model:param="state.statistic.table.cusDate"
+                  link="datetime"
+                  type="datetimerange"
+                />
+              </div>
+              <div class="flex-1">
+                <CzrTable
+                  v-loading="state.statistic.table.query.loading"
+                  :data="state.statistic.table.query.result.data"
+                  :head="state.statistic.table.query.head"
+                  :no-foot="true"
+                >
+                  <template #name-column-value="{ scope }">
+                    <div class="flex justify-center">
+                      <CzrButton
+                        type="table"
+                        :title="scope.row.p1"
+                        @click="onStage(scope.row)"
+                      />
+                    </div>
+                  </template>
+                  <template #caozuo-column-value="{ scope }">
+                    <div class="__czr-table-operations">
+                      <CzrButton
+                        type="table"
+                        title="重命名"
+                        @click="onRename(scope.row)"
+                      />
+                      <CzrButton
+                        type="table"
+                        title="迁移"
+                        @click="onKnowledge(scope.row)"
+                      />
+                      <CzrButton type="table" title="归档" />
+                      <CzrButton type="table-del" @click="onDel(scope.row)" />
+                    </div>
+                  </template>
+                </CzrTable>
+              </div>
             </div>
           </div>
         </div>
@@ -165,6 +171,7 @@ import pieChart from './pie-chart.vue'
 import { pluginDetail } from '@/api/modules/model'
 import { useDictionaryStore } from '@/stores'
 import { YMDHms } from '@/utils/czr-util'
+import toBackCom from '@/views/manage/components/to-back.vue'
 
 const DictionaryStore = useDictionaryStore()
 const route = useRoute()
@@ -235,12 +242,6 @@ const initDetail = () => {
     router.push({ name: '86e9f5e8-285d-4038-abc2-a39b2ad7fcd1' })
   }
 }
-
-const toBack = () => {
-  router.push({
-    name: '86e9f5e8-285d-4038-abc2-a39b2ad7fcd1',
-  })
-}
 const initStatistic = () => {
   state.statistic.table.query.loading = true
   setTimeout(() => {