|
@@ -274,7 +274,7 @@
|
|
|
import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
import { useI18n } from 'vue-i18n';
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import useLoading from '@/hooks/loading';
|
|
import useLoading from '@/hooks/loading';
|
|
|
- import { queryKbList, PolicyRecord, PolicyParams } from '@/api/kbList';
|
|
|
|
|
|
|
+import { queryKbList, PolicyRecord, PolicyParams, queryKbDocumentList } from "@/api/kbList";
|
|
|
import { Pagination } from '@/types/global';
|
|
import { Pagination } from '@/types/global';
|
|
|
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
@@ -303,7 +303,7 @@ import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
};
|
|
};
|
|
|
const { loading, setLoading } = useLoading(true);
|
|
const { loading, setLoading } = useLoading(true);
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
- const renderData = ref<PolicyRecord[]>([]);
|
|
|
|
|
|
|
+ const renderData = ref([]);
|
|
|
const formModel = ref(generateFormModel());
|
|
const formModel = ref(generateFormModel());
|
|
|
const cloneColumns = ref<Column[]>([]);
|
|
const cloneColumns = ref<Column[]>([]);
|
|
|
const showColumns = ref<Column[]>([]);
|
|
const showColumns = ref<Column[]>([]);
|
|
@@ -317,6 +317,11 @@ import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
const selectTab = (index,item) => {
|
|
const selectTab = (index,item) => {
|
|
|
selectedTab.value= index;
|
|
selectedTab.value= index;
|
|
|
console.log(item.id);
|
|
console.log(item.id);
|
|
|
|
|
+ fetchData({
|
|
|
|
|
+ kb_id: item.id,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ page_size: 20
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const basePagination: Pagination = {
|
|
const basePagination: Pagination = {
|
|
@@ -418,17 +423,16 @@ import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
value: 'offline',
|
|
value: 'offline',
|
|
|
},
|
|
},
|
|
|
]);
|
|
]);
|
|
|
- const fetchData = async (
|
|
|
|
|
- params = { page: 1, page_size: 20 }
|
|
|
|
|
- ) => {
|
|
|
|
|
|
|
+ const fetchData = async (params) => {
|
|
|
setLoading(true);
|
|
setLoading(true);
|
|
|
try {
|
|
try {
|
|
|
- const { data } = await queryKbList(params);
|
|
|
|
|
|
|
+ const data = await queryKbDocumentList(params);
|
|
|
console.log(data, 'data');
|
|
console.log(data, 'data');
|
|
|
- // renderData.value = data.list;
|
|
|
|
|
- // console.log(renderData, 'renderData');
|
|
|
|
|
- // pagination.current = params.current;
|
|
|
|
|
- // pagination.total = data.total;
|
|
|
|
|
|
|
+ if(data.code=='0'){
|
|
|
|
|
+ renderData.value = data.data.docs||[];
|
|
|
|
|
+ pagination.current = params.page;
|
|
|
|
|
+ pagination.total = data.data.total;
|
|
|
|
|
+ }
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
// you can report use errorHandler or other
|
|
// you can report use errorHandler or other
|
|
|
} finally {
|
|
} finally {
|
|
@@ -440,7 +444,7 @@ import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
fetchData({
|
|
fetchData({
|
|
|
...basePagination,
|
|
...basePagination,
|
|
|
...formModel.value,
|
|
...formModel.value,
|
|
|
- } as unknown as PolicyParams);
|
|
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleClick = ()=>{
|
|
const handleClick = ()=>{
|
|
@@ -460,7 +464,13 @@ import { computed, ref, reactive, watch, nextTick, onBeforeMount } from "vue";
|
|
|
console.log(data, 'data');
|
|
console.log(data, 'data');
|
|
|
tabs.value = data;
|
|
tabs.value = data;
|
|
|
console.log(tabs.value, 'tabs');
|
|
console.log(tabs.value, 'tabs');
|
|
|
- // fetchData()
|
|
|
|
|
|
|
+ if(tabs.value.length>0 && tabs.value[0]){
|
|
|
|
|
+ fetchData({
|
|
|
|
|
+ kb_id: tabs.value[0].id,
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ page_size: 20
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
// renderData.value = data.list;
|
|
// renderData.value = data.list;
|
|
|
// console.log(renderData, 'renderData');
|
|
// console.log(renderData, 'renderData');
|
|
|
// pagination.current = params.current;
|
|
// pagination.current = params.current;
|