yangyin
2024-09-06 cf5c3cde7d0dbec44d4c2f7bea87c4d5362accb0
src/views/project/yw/dataManage/graph/GraphIndex.vue
@@ -53,21 +53,21 @@
      <template #header>
         <!-- 查询、重置、排序、增加表单 -->
         <el-form :inline="true" :model="formulaQueryParams">
         <el-form :inline="true" :model="graphQueryParams">
            <el-form-item label="名称" prop="title">
               <el-input v-model="formulaQueryParams.title" style="width: 226.4px" placeholder="文件名称" clearable></el-input>
               <el-input v-model="graphQueryParams.title" style="width: 226.4px" placeholder="文件名称" clearable></el-input>
            </el-form-item>
            <el-form-item>
               <el-select v-model="formulaQueryParams.Code" autocomplete="off" style="width: 226.4px" clearable>
            <!-- <el-form-item>
               <el-select v-model="graphQueryParams.Code" autocomplete="off" style="width: 226.4px" clearable>
                  <el-option v-for="item in Object.keys(analyzeMap)" :key="item" :value="parseInt(item)" :label="analyzeMap[item]">
                  </el-option>
               </el-select>
            </el-form-item>
            </el-form-item> -->
            <el-form-item>
               <el-button type="primary" icon="ele-Search"> 查询 </el-button>
               <el-button icon="ele-Refresh">重置 </el-button>
               <el-button icon="ele-Plus" @click="importData()"> 导入数据 </el-button>
               <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> 查询 </el-button>
               <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button>
               <el-button icon="ele-Plus" @click="importData()" type="primary"> 导入数据 </el-button>
            </el-form-item>
         </el-form></template
      >
@@ -82,11 +82,11 @@
               class="flex-auto"
               :row-class-name="isFormulaTableDrag ? 'cursor-move' : 'cursor-pointer'"
               :header-cell-style="{ textAlign: 'center' }"
               :data="categoryTableData"
               :data="displayTableData"
               highlight-current-row
            >
               <el-table-column prop="name" label="文件名称" fixed="left" show-overflow-tooltip align="left" />
               <el-table-column prop="type" width="120" label="文件格式" show-overflow-tooltip align="center" />
               <el-table-column prop="type" width="120" label="文件类型" show-overflow-tooltip align="center" />
               <el-table-column prop="time" label="上传时间" show-overflow-tooltip width="280" align="center"></el-table-column>
               <el-table-column label="操作" width="80" fixed="right" show-overflow-tooltip align="center">
                  <template #default="scope">
@@ -100,19 +100,6 @@
                  </template>
               </el-table-column>
            </el-table>
            <!-- <div class="flex-0">
               <el-pagination
                  v-model:currentPage="state.tableParams.PageIndex"
                  v-model:page-size="state.tableParams.PageSize"
                  :total="state.tableTotal"
                  :page-sizes="[10, 20, 50, 100]"
                  background
                  @size-change="handleSizeChange"
                  style="margin-bottom: 20px"
                  @current-change="handleCurrentChange"
                  layout="total, sizes, prev, pager, next, jumper"
               />
            </div> -->
         </div>
      </template>
      <!-- 增加、修改数据对话框 -->
@@ -185,9 +172,9 @@
} from '/@/api/knowledge/group';
import AHMContainer from '/@/components/layout/AHMContainer.vue';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { deepClone } from '/@/utils/other';
import { convertListToTree } from '/@/utils/util';
import { analyzeMap } from '/@/views/types/catalog/index';
const state = reactive({
   tableParams: {
      PageIndex: 1,
@@ -241,13 +228,11 @@
const categoryTableData = ref([]);
const isFormulaTableDrag = ref(false);
const getCategoryTableData = async () => {
   const res = await list_knowledge_file().finally(() => {});
   const res = await list_knowledge_file({
      group_id: currentListID.value,
   }).finally(() => {});
   if (res?.json_ok) {
      const resData = (res.values || []) as [];
      resData.forEach((item) => {
         const type = item?.name.split('.')[1];
         item.type = type;
      });
      categoryTableData.value = resData;
   } else {
      ElMessage.error('获取文档列表失败' + (res?.json_msg ? `,${JSON.stringify(res.json_msg)}` : ''));
@@ -277,8 +262,11 @@
//#endregion
//#region ====================== 搜索表格,对表格排序 ======================
const formulaQueryParams = ref({
const graphQueryParams = ref({
   title: '',
});
const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(categoryTableData, graphQueryParams, () => {
   displayTableData.value = categoryTableData.value;
});
//#endregion
@@ -299,6 +287,7 @@
      name: 'AddGraph',
      query: {
         group_id: currentListID.value,
         title: currentTreeNode.value.title,
      },
   });
};