CzRger před 2 týdny
rodič
revize
eb58bbc987

+ 0 - 2
src/App.vue

@@ -9,8 +9,6 @@
 
 <script setup lang="ts">
 import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
-import { sysDict } from '@/api/modules/global/dictionary'
-sysDict()
 </script>
 
 <style lang="scss" scoped></style>

+ 45 - 1
src/layout/top-left/head/index.vue

@@ -19,6 +19,33 @@
         </div>
       </template>
     </div>
+    <div class="ml-auto">
+      <el-button type="primary" @click="state.drawer = true"
+        >临时字典</el-button
+      >
+    </div>
+    <el-drawer v-model="state.drawer" title="临时字典管理">
+      <div class="h-full w-full overflow-y-auto">
+        <el-collapse v-model="state.activeNames">
+          <template v-for="[key, value] in state.dictMap">
+            <el-collapse-item :title="`${value.name} ${key}`" :name="key">
+              <el-descriptions :column="1" border>
+                <template v-for="item in value.children">
+                  <el-descriptions-item>
+                    <template #label>
+                      <div @click="copy(item.dictValue)">
+                        {{ item.dictValue }}
+                      </div>
+                    </template>
+                    {{ item.dictName }}
+                  </el-descriptions-item>
+                </template>
+              </el-descriptions>
+            </el-collapse-item>
+          </template>
+        </el-collapse>
+      </div>
+    </el-drawer>
   </div>
 </template>
 
@@ -31,11 +58,28 @@ const MenuStore = useMenuStore()
 const router = useRouter()
 const route = useRoute()
 const { proxy } = getCurrentInstance()
-const state: any = reactive({})
+const state: any = reactive({
+  drawer: false,
+  dictMap: new Map(),
+  activeNames: '',
+})
 const titleCpt = computed(() => import.meta.env.VITE_TITLE)
 const menusCpt: any = computed(
   () => router.options.routes.filter((v) => v.name === 'root')[0],
 )
+
+import { sysDict } from '@/api/modules/global/dictionary'
+import { copy } from '@/utils/czr-util'
+sysDict().then(({ data }: any) => {
+  data.forEach((v) => {
+    const d = state.dictMap.get(v.dictType)
+    if (d) {
+      d.children.push(v)
+    } else {
+      state.dictMap.set(v.dictType, { name: v.remark, children: [v] })
+    }
+  })
+})
 </script>
 
 <style lang="scss" scoped>

+ 12 - 0
src/stores/modules/dictionary.ts

@@ -5,9 +5,13 @@ import { datasetGroupsGetAllByTenantId } from '@/api/modules/knowledge/group'
 import { pluginConfigs, pluginGetModelTypeList } from '@/api/modules/model'
 import { dictionary, dictionaryDefine } from './dictionary-define'
 import { sysDictFindByDictType } from '@/api/modules/global/dictionary'
+// @ts-ignore
 import FileExcel from '@/assets/images/file-excel.png'
+// @ts-ignore
 import FileTxt from '@/assets/images/file-txt.png'
+// @ts-ignore
 import FileUnknown from '@/assets/images/file-unknown.png'
+// @ts-ignore
 import FileWord from '@/assets/images/file-word.png'
 
 const listToMap = ({
@@ -54,6 +58,14 @@ export const useDictionaryStore = defineStore('dictionary', {
       { label: '全部开放', value: 'OPEN_SHARE' },
       { label: '申请开放', value: 'SHARE_ON_CONDITION' },
     ],
+    modelStatus: [
+      { label: '停用', value: 0 },
+      { label: '启用', value: 1 },
+    ],
+    documentStatus: [
+      { label: '启用', value: 0 },
+      { label: '停用', value: 1 },
+    ],
   }),
   getters: {
     shareConditionsMap() {

+ 9 - 6
src/views/manage/knowledge/documents/document/index.vue

@@ -167,14 +167,14 @@ const state: any = reactive({
     loading: false,
     head: [
       { value: 'name', label: '文件名称', show: true },
-      { value: 'p1', label: '字符数', show: true },
-      { value: 'p1', label: '状态', show: true },
+      { value: 'wordCount', label: '字符数', show: true },
+      { value: 'indexingStatus', label: '状态', show: true },
       { value: 'p1', label: '召回次数', show: true },
-      { value: 'p1', label: '启用/停用', show: true },
-      { value: 'p1', label: '审核状态', show: true },
+      { value: 'isUse', label: '启用/停用', show: true },
+      { value: 'checkStatus', label: '审核状态', show: true },
       { value: 'p1', label: '关联应用', show: true },
-      { value: 'p1', label: '创建时间', show: true },
-      { value: 'p1', label: '更新时间', show: true },
+      { value: 'createTime', label: '创建时间', show: true },
+      { value: 'updateTime', label: '更新时间', show: true },
       {
         value: 'caozuo',
         label: '操作',
@@ -259,6 +259,9 @@ const onPage = (pageNum, pageSize) => {
       state.query.result.data = data.content
     })
     .catch(() => {})
+    .finally(() => {
+      state.query.loading = false
+    })
 }
 const onSearch = () => {
   state.query.selected = []

+ 5 - 0
src/views/manage/knowledge/upload/index.vue

@@ -674,6 +674,11 @@ const initTask = () => {
 onMounted(() => {
   initDetail()
   initDictionary()
+  datasetsDocumentsDealStatus({
+    fileIds: [
+      'http://1.95.78.201:30002/dataset/1752141126163_387eb0a3-f04e-4174-bda5-4a5ba3002405.txt',
+    ],
+  })
 })
 onUnmounted(() => {
   clearInterval(state.taskFiles.timer)

+ 1 - 4
src/views/manage/model/index.vue

@@ -21,10 +21,7 @@
             label-width="0px"
             v-model:param="state.query.form.status"
             link="select"
-            :options="[
-              { label: '停用', value: 0 },
-              { label: '启用', value: 1 },
-            ]"
+            :options="DictionaryStore.modelStatus"
             placeholder="模型状态"
           />
           <CzrFormColumn