|
@@ -30,7 +30,7 @@
|
|
|
class="__czr-table-form-column"
|
|
|
:span="24"
|
|
|
label-width="0px"
|
|
|
- v-model:param="state.query.form.group"
|
|
|
+ v-model:param="state.query.form.groupId"
|
|
|
link="select"
|
|
|
:options="DictionaryStore.knowledgeGroups.list"
|
|
|
placeholder="全部分组"
|
|
@@ -40,7 +40,7 @@
|
|
|
class="__czr-table-form-column"
|
|
|
:span="24"
|
|
|
label-width="0px"
|
|
|
- v-model:param="state.query.form.tag"
|
|
|
+ v-model:param="state.query.form.tagIds"
|
|
|
link="select"
|
|
|
:options="DictionaryStore.knowledgeTags.list"
|
|
|
placeholder="全部标签"
|
|
@@ -104,10 +104,10 @@
|
|
|
class="flex flex-1 flex-col justify-around overflow-hidden"
|
|
|
>
|
|
|
<div class="text-[1.25rem] font-bold text-[#2E3238]" v-title>
|
|
|
- {{ row.p1 }}
|
|
|
+ {{ row.name }}
|
|
|
</div>
|
|
|
<div class="text-[0.75rem] text-[#6F7889]">
|
|
|
- 创建者:{{ row.p2 }}
|
|
|
+ 创建者:{{ row.userName }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mt-[0.25rem] ml-auto">
|
|
@@ -122,14 +122,14 @@
|
|
|
style="line-height: 1.4rem"
|
|
|
v-title="{ lines: 3 }"
|
|
|
>
|
|
|
- {{ row.p3 }}
|
|
|
+ {{ row.description }}
|
|
|
</div>
|
|
|
<div
|
|
|
class="flex items-center gap-[var(--czr-gap)] text-[0.75rem] text-[#6F7889]"
|
|
|
>
|
|
|
- <div>文档数:{{ row.p4 }}</div>
|
|
|
+ <div>文档数:{{ row.docCount }}</div>
|
|
|
<div>|</div>
|
|
|
- <div>字符:{{ row.p5 }}</div>
|
|
|
+ <div>字符:{{ row.wordCounts }}</div>
|
|
|
<div>|</div>
|
|
|
<div>关联应用:{{ row.p6 }}</div>
|
|
|
<el-tooltip content="编辑" effect="light" placement="top">
|
|
@@ -178,12 +178,13 @@
|
|
|
import { getCurrentInstance, onMounted, reactive, ref, watch } from 'vue'
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import { debounce } from 'lodash'
|
|
|
-import { useDialogStore, useDictionaryStore } from '@/stores'
|
|
|
+import { useAppStore, useDialogStore, useDictionaryStore } from '@/stores'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import tagsSelect from './tags-select.vue'
|
|
|
import detailCom from './detail.vue'
|
|
|
import { datasetsGetAllByPage } from '@/api/modules/knowledge'
|
|
|
|
|
|
+const AppStore = useAppStore()
|
|
|
const DialogStore = useDialogStore()
|
|
|
const DictionaryStore = useDictionaryStore()
|
|
|
const emit = defineEmits([])
|
|
@@ -222,8 +223,7 @@ watch(
|
|
|
watch(
|
|
|
() => state.query.form,
|
|
|
(n) => {
|
|
|
- console.log(state.query.init)
|
|
|
- console.log(3)
|
|
|
+ console.log(n)
|
|
|
if (state.query.init) {
|
|
|
onSearch()
|
|
|
}
|
|
@@ -231,6 +231,9 @@ watch(
|
|
|
{ deep: true },
|
|
|
)
|
|
|
const onPage = (pageNum, pageSize) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ state.query.init = true
|
|
|
+ }, 100)
|
|
|
state.query.page = {
|
|
|
pageNum: pageNum,
|
|
|
pageSize: pageSize,
|
|
@@ -243,34 +246,34 @@ const onPage = (pageNum, pageSize) => {
|
|
|
// 添加表单参数
|
|
|
for (const [k, v] of Object.entries(state.query.formReal)) {
|
|
|
if (proxy.$czrUtil.isValue(v)) {
|
|
|
- params[k] = v
|
|
|
+ if (k === 'isCreate') {
|
|
|
+ if (v) {
|
|
|
+ params['creator'] = AppStore.userInfo?.id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (k === 'isStar') {
|
|
|
+ if (v) {
|
|
|
+ params['collectId'] = AppStore.userInfo?.id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (k === 'tagIds') {
|
|
|
+ params['tagIds'] = [v]
|
|
|
+ } else {
|
|
|
+ params[k] = v
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
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)
|
|
|
- datasetsGetAllByPage(params).then(({ data }) => {})
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- state.query.loading = true
|
|
|
- }, 100)
|
|
|
+ datasetsGetAllByPage(params)
|
|
|
+ .then(({ data }: any) => {
|
|
|
+ state.query.result.total = data.totalElements
|
|
|
+ state.query.result.data = [{ empty: true }, ...data.content]
|
|
|
+ state.query.loading = false
|
|
|
+ })
|
|
|
+ .catch(({ message }: any) => {
|
|
|
+ ElMessage.error(message)
|
|
|
+ state.loading = false
|
|
|
+ })
|
|
|
}
|
|
|
const onSearch = () => {
|
|
|
state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
|