|
@@ -11,7 +11,7 @@
|
|
|
<CzrButton :type="state.uploadType == UploadTypeEnum.Text ? 'primary' : 'normal'" title="文本文件" @click="state.uploadType = UploadTypeEnum.Text, state.step = 1, state.uploadFiles.clear()"/>
|
|
|
<CzrButton :type="state.uploadType == UploadTypeEnum.QA ? 'primary' : 'normal'" title="QA问答" @click="state.uploadType = UploadTypeEnum.QA, state.step = 1, state.uploadFiles.clear()"/>
|
|
|
</div>
|
|
|
- <div class="mt-[1.75rem] flex justify-center items-center gap-[1rem]">
|
|
|
+ <div class="mt-[1.75rem] flex justify-center items-center gap-[1rem] mb-[1.5rem]">
|
|
|
<template v-for="(item, index) in (state.uploadType == UploadTypeEnum.Text ? TextSteps : QASteps)">
|
|
|
<div v-if="index > 0" class="step-split" :class="{active: state.step > index }"/>
|
|
|
<div class="step-item" :class="{active: state.step > index, current: state.step === index + 1}">
|
|
@@ -21,7 +21,7 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
<template v-if="state.step == 1">
|
|
|
- <div class="w-full rounded-[0.25rem] bg-[#F6F8FC] px-[1.5rem] py-[1rem] mt-[1.5rem] flex">
|
|
|
+ <div class="w-full rounded-[0.25rem] bg-[var(--czr-default-color)] px-[1.5rem] py-[1rem] flex">
|
|
|
<SvgIcon name="czr_tip" color="#fdb648" class="mr-[1rem]"/>
|
|
|
<div class="flex flex flex-col gap-[0.5rem] text-[#606266] text-[0.88rem]">
|
|
|
<template v-if="state.uploadType == UploadTypeEnum.Text">
|
|
@@ -35,7 +35,7 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mt-[1rem] w-full h-[12.5rem] rounded-[0.25rem] bg-[#F6F8FC]">
|
|
|
+ <div class="mt-[1rem] w-full h-[12.5rem] rounded-[0.25rem] bg-[var(--czr-default-color)]">
|
|
|
<el-upload
|
|
|
class="upload"
|
|
|
drag
|
|
@@ -56,7 +56,7 @@
|
|
|
</div>
|
|
|
<div class="mt-[1rem] flex-1 grid grid-cols-4 auto-rows-max gap-[1.5rem] overflow-y-auto">
|
|
|
<template v-for="[id, file] in state.uploadFiles">
|
|
|
- <div class="h-[3.13rem] flex items-center gap-[0.25rem] px-[var(--czr-gap)] rounded-[0.25rem] bg-[#F6F8FC]" @mouseenter="file.hover__ = true" @mouseleave="file.hover__ = false">
|
|
|
+ <div class="h-[3.13rem] flex items-center gap-[0.25rem] px-[var(--czr-gap)] rounded-[0.25rem] bg-[var(--czr-default-color)]" @mouseenter="file.hover__ = true" @mouseleave="file.hover__ = false">
|
|
|
<img src="@/assets/images/file-word.png" class="w-[1.25rem] h-[1.25rem]"/>
|
|
|
<div class="flex-1 flex items-center gap-[0.25rem] relative overflow-hidden">
|
|
|
<div v-title class="flex-1 text-[#333333] text-[0.88rem]">{{file.name}}</div>
|
|
@@ -89,7 +89,53 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="state.uploadType === UploadTypeEnum.Text && state.step === 2">
|
|
|
-
|
|
|
+ <div class="flex-1 flex gap-[1rem] overflow-hidden">
|
|
|
+ <div class="flex-1">
|
|
|
+ <div class="__czr-title_1">分段设置</div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1 flex flex-col overflow-hidden">
|
|
|
+ <div class="__czr-title_1">预览</div>
|
|
|
+ <div class="flex-1 flex flex-col bg-[var(--czr-default-color)] rounded-[0.25rem] p-[1rem] overflow-hidden">
|
|
|
+ <div>
|
|
|
+ <CzrFormColumn
|
|
|
+ :span="12"
|
|
|
+ label-width="0px"
|
|
|
+ v-model:param="state.previewFile"
|
|
|
+ link="select"
|
|
|
+ :options="state.uploadFileList"
|
|
|
+ labelKey="name"
|
|
|
+ valueKey="name"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="flex-1 flex flex-col gap-[1rem] overflow-y-auto">
|
|
|
+ <template v-for="(item, index) in state.query.result.data">
|
|
|
+ <div>
|
|
|
+ <div class="text-[#576275] text-[1rem] font-bold">
|
|
|
+ Chunk-{{index + 1}} . 195 charact
|
|
|
+ </div>
|
|
|
+ <div class="text-[#6F7889] text-[0.88rem] mt-[0.25rem]" style="line-height: 1.25rem">
|
|
|
+ 啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="mt-[1rem]">
|
|
|
+ <el-pagination
|
|
|
+ ref="ref_tablePage"
|
|
|
+ class="__czr-pagination"
|
|
|
+ :current-page="state.query.page.pageNum"
|
|
|
+ :page-size="state.query.page.pageSize"
|
|
|
+ background
|
|
|
+ :page-sizes="[20]"
|
|
|
+ layout="total,prev,pager,next"
|
|
|
+ :total="Number(state.query.result.total)"
|
|
|
+ @current-change="onPage"
|
|
|
+ :pager-count="5"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -116,9 +162,21 @@ enum UploadTypeEnum {
|
|
|
const state: any = reactive({
|
|
|
ID: route.params.id,
|
|
|
uploadType: UploadTypeEnum.Text,
|
|
|
- step: 1,
|
|
|
+ step: 2,
|
|
|
uploadFiles: new Map(),
|
|
|
- uploadFileList: []
|
|
|
+ uploadFileList: [],
|
|
|
+ previewFile: '',
|
|
|
+ query: {
|
|
|
+ loading: false,
|
|
|
+ page: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ },
|
|
|
+ result: {
|
|
|
+ total: 0,
|
|
|
+ data: []
|
|
|
+ },
|
|
|
+ },
|
|
|
})
|
|
|
const UploadConfig = {
|
|
|
limit: 2,
|
|
@@ -144,6 +202,7 @@ const initDetail = () => {
|
|
|
router.push({name: '4342bfff-1ea8-4f4c-b562-3cdc1fde116f'})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const handleBeforeUpload = (file) => {
|
|
|
const suffix = file.name.split('.').pop().toUpperCase()
|
|
|
const msg = `文件${file.name}上传失败`
|
|
@@ -166,6 +225,7 @@ const handleBeforeUpload = (file) => {
|
|
|
})
|
|
|
return true
|
|
|
}
|
|
|
+
|
|
|
const handleHttpRequest = (options) => {
|
|
|
const id = options.file.uid
|
|
|
const formData = new FormData();
|
|
@@ -201,8 +261,51 @@ const onNextOne = () => {
|
|
|
state.step = 2
|
|
|
}
|
|
|
}
|
|
|
+const onPage = (pageNum, pageSize) => {
|
|
|
+ state.query.page = {
|
|
|
+ pageNum: pageNum,
|
|
|
+ pageSize: pageSize,
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ pageNum: state.query.page.pageNum,
|
|
|
+ pageSize: state.query.page.pageSize,
|
|
|
+ }
|
|
|
+ state.query.loading = true
|
|
|
+ setTimeout(() => {
|
|
|
+ state.query.result.total = 100
|
|
|
+ const arr: any = [{empty: true}]
|
|
|
+ for (let i = 1; i <= params.pageSize; i++) {
|
|
|
+ const n = (params.pageNum - 1) * params.pageSize + i
|
|
|
+ arr.push({
|
|
|
+ p1: '部门知识库-部门知识库-部门知识库-' + n,
|
|
|
+ p2: '王一鸣',
|
|
|
+ p3: '只是一个政务服务事项办事指南',
|
|
|
+ p4: n,
|
|
|
+ p5: '2980k',
|
|
|
+ p6: n % 4,
|
|
|
+ p7: n % 2,
|
|
|
+ tags: n % 2 ? '1,2,3,41,2,3,41,2,3,41,2,3,41,2,3,4' : ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ state.query.result.data = arr
|
|
|
+ state.query.loading = false
|
|
|
+ }, 1000)
|
|
|
+ // state.query.loading = true
|
|
|
+ // listRuleLogisticsDataSubscribeInfo(params).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // state.query.result.total = res.total
|
|
|
+ // state.query.result.data = res.rows
|
|
|
+ // state.query.loading = false
|
|
|
+ // } else {
|
|
|
+ // ElMessage.error(res.msg)
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // state.query.loading = false
|
|
|
+ // })
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
initDetail()
|
|
|
+ onPage(1, 10)
|
|
|
})
|
|
|
</script>
|
|
|
|