Kaynağa Gözat

元数据编辑

duy 2 yıl önce
ebeveyn
işleme
c7111426d6

+ 43 - 9
src/views/archives/components/meta-info.vue

@@ -2,7 +2,7 @@
     <el-drawer v-model="showModal"  v-if="showModal" title="元数据信息" class="hc-modal-border" draggable destroy-on-close @closed="cancelClick" :size="size"
     ref="drawerRef" :modal-class="uis" :class="`hc-drawer-box ${ui}`"   >
 
-       <metaTable  :isEdit="isEdit"/>
+       <metaTable  :isEdit="isEdit" :loading="tabeloading" :metaDataTable="metaDataTable"/>
         <template #footer>
 
             <div class="dialog-footer" style="margin-top: 20px" v-if="isEdit">
@@ -34,19 +34,32 @@
 <script setup>
 import {ref, watch,toRefs} from "vue"
 import {useAppStore} from "~src/store";
-//import {sendNotice, saveSmsTimeout} from '~api/other';
-import config from '~src/config/index';
-import MetaTable from './meta-table.vue'
+import metaTable from './meta-table.vue'
+import tuningApi from "~api/archiveConfig/tuning.js";
+import {getArrValue} from "js-fast-way"
 //参数
 const props = defineProps({
     show: {
         type: Boolean,
         default: false
     },
-    loading: {
-        type: Boolean,
-        default: false
+
+    uis: {
+        type: String,
+        default: ''
+    },
+    ui: {
+        type: String,
+        default: ''
     },
+    fileId:{
+        type: String,
+        default: ''
+    },
+    loading:{
+        type: String,
+        default: ''
+    }
 
 })
 
@@ -56,18 +69,38 @@ const userStore = useAppStore()
 
 const showModal = ref(props.show)
 const isLoading = ref(props.loading)
+const fileIdval=ref(props.fileId)
 const isEdit =ref(true)
 
 const size = ref('70%')
 //监听
 watch(() => [
     props.show,
-    props.loading,
+   
 ], ([show,  loading, user]) => {
     showModal.value = show
     isLoading.value = loading
+    if (show) {
+        isEdit.value=true
+        getmetaInfo()
+    }
 })
-
+//获取元数据信息
+const tabeloading=ref(false)
+const metaDataTable=ref([])
+const getmetaInfo=async()=>{
+    tabeloading.value = true
+    const {error, code, data} = await tuningApi.getMetadataFileByid({
+        fileId:props.fileId,
+    })
+    tabeloading.value = false
+    if (!error && code === 200) {
+        console.log(data,'data');
+        metaDataTable.value=getArrValue(data)
+    } else {
+        metaDataTable.value=[]
+    }
+}
 
 
 
@@ -78,6 +111,7 @@ const emits = defineEmits(['upshowModal'])
 //取消
 const cancelClick = () => {
     //  emit('cancel')
+    isEdit.value=true
       emits('upshowModal', false)
 }
 

+ 15 - 6
src/views/archives/components/meta-table.vue

@@ -9,7 +9,7 @@
                         <tr class="hc-csc-meta-table-tr" v-else>
                             <td class="hc-csc-meta-table-td name">{{item.title}}</td>
                             <td class="hc-csc-meta-table-td val" v-if="isEdit">{{item.val}}</td>
-                            <td  v-else style="padding:0px">
+                            <td  v-else style="padding:0px;border: none;">
                                 <input type="input" data-id="project" name="project[]" class="iptclass">
                             </td>
                         </tr>
@@ -42,22 +42,31 @@ const props = defineProps({
     isEdit:{
        type: Boolean,
         default: true 
-    }
+    },
+    // metaDataTable:{
+    //     type: [Array],
+    //     default: []
+    // }
+ 
 })
 
 //变量
 const projectId = ref(props.projectId);
 const contractId = ref(props.contractId);
 const isLoading = ref(props.loading);
-
+const isEditval=ref(props.isEdit)
+// const metaDataTableval=ref(props.metaDataTable)
 //监听
 watch(() => [
-    props.loading
-], ([loading]) => {
+    props.loading,
+    props.isEdit
+], ([loading,isEdit]) => {
     isLoading.value = loading;
+    isEditval.value=isEdit
+    
 })
 
-//元数据
+// 元数据
 const metaDataTable = ref([
     {type: 1, title: '聚合层次', val: ''},
     {type: 2, title: '来源', val: ''},

+ 75 - 164
src/views/archives/meta-data.vue

@@ -32,7 +32,6 @@
                         :column="tableColumn"
                         :datas="tableData"
                         :loading="tableLoading"
-                        isCheck @selection-change="tableSelection"
                         @row-click="tableRowClick"
                         :ui="hoverHand?'hover-hand':''"
                         >
@@ -49,12 +48,10 @@
                         <div class="hc-file-table-box">
                             <HcTable ref="tableFileRef"
                             :column="innertableColumn"
-                            :datas="tableData"
-                            :loading="tableFileLoading"
-                            isCheck
-                            @selection-change="tableFileSelection"
+                            :datas="intableData"
+                            :loading="intableLoading"
                             @row-click="tableFileRowClick"
-                             :ui="hoverHand?'hover-hand':''"
+                            :ui="hoverHand?'hover-hand':''"
                             >
                                 <template #action="{row,index}">
                                     <el-button type="primary" size="small" @click.stop="consultFileClick">查阅文件</el-button>
@@ -63,45 +60,12 @@
                         </div>
                     </div>
                 </div>
-                <template #action>
-                    <HcPages :pages="searchForm" @change="pageChange"/>
-                </template>
+                
             </HcCard>
         </div>
     <!-- 元数据信息编辑 -->
-    <MetaInfo :show="showMeteInfo"   @upshowModal="upshowModal" ></MetaInfo>
-      <!--调整排序-->
-    <HcDialog :show="sortModal" title="调整排序" widths="980px" isTable isRowFooter @close="sortModalClose">
-        <el-alert title="可拖动排序,也可在后面点击图标,切换排序" type="error" :closable="false"/>
-        <div class="hc-table-h">
-            <HcTable ui="hc-table-row-drop" :column="sortTableColumn" :datas="sortTableData" :loading="sortTableLoading" isRowDrop @row-drop="sortTableRowDrop">
-                <template #key2="{row}">
-                    <span class="text-link">{{row?.key2}}</span>
-                </template>
-                <template #action="{index}">
-                <span class="text-link text-xl" @click="upSortClick(index)">
-                    <HcIcon name="arrow-up" fill/>
-                </span>
-                    <span class="text-link text-xl ml-2" @click="downSortClick(index)">
-                    <HcIcon name="arrow-down" fill/>
-                </span>
-                </template>
-            </HcTable>
-        </div>
-        <template #leftRowFooter>
-            <el-button hc-btn @click="sortModalClose">
-                <HcIcon name="close"/>
-                <span>取消</span>
-            </el-button>
-            <el-button type="primary" hc-btn :loading="sortModalLoading" @click="sortModalSave">
-                <HcIcon name="check"/>
-                <span>确认</span>
-            </el-button>
-        </template>
-        <template #rightRowFooter>
-            <HcPages :pages="sortSearchForm" :sizes="[10, 20, 50, 100, 200, 300, 400, 500, 600]" @change="sortPageChange"/>
-        </template>
-    </HcDialog>
+    <MetaInfo :show="showMeteInfo"   @upshowModal="upshowModal" :fileId="fileId"></MetaInfo>
+ 
 
     </div>
 </template>
@@ -109,13 +73,12 @@
 <script setup>
 import {ref, watch, onMounted} from "vue";
 import {useAppStore} from "~src/store";
-//import HcTree from "./components/hc-tree.vue"
 import HcTree from "~src/components/tree/hc-tree.vue"
-import ProjectTree from "./components/ProjectTree.vue"
 import MetaInfo from './components/meta-info.vue'
 import projectScanningApi from "~api/other-file/projectScanning";
 import {getStoreValue, setStoreValue} from '~src/utils/storage'
 import {downloadBlob, getArrValue, deepClone} from "js-fast-way"
+import tuningApi from "~api/archiveConfig/tuning.js";
 
 //变量
 const useAppState = useAppStore()
@@ -183,59 +146,65 @@ const pageChange = ({current, size}) => {
 //表格数据
 const tableRef = ref(null)
 const tableColumn = ref([
-    {key:'key1', name: '档号'},
-    {key:'key2', name: '案卷题名',width:600},
-    {key:'key3', name: '保管期限'},
-    {key:'key4', name: '总页数'},
+        {key: 'fileNumber', name: '档号'},
+        {key: 'name', name: '案卷题名', width: 500},
+        {key: 'storageTimeValue', name: '保管期限'},
+        {key: 'pageN', name: '总页数'},
 
 ])
 const innertableColumn = ref([
-    {key:'key1', name: '文件编号'},
-    {key:'key2', name: '题名',width:600},
-    {key:'key3', name: '责任者'},
-    {key:'key4', name: '页数'},
+        {key: 'fileNumber', name: '文件编号'},
+        {key: 'fileName', name: '文件题名', width: 500},
+        {key: 'fileTime', name: '文件日期'},
+        {key: 'dutyUser', name: '责任者'},
+        {key: 'pageNum', name: '页数'},
 
 ])
 
-const tableData = ref([
-    {
-        id: 1,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    },
-    {
-        id: 2,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    },
-    {
-        id: 3,
-        key1: 'FJZB-02-123',
-        key2: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
-        key3: '293',
-        key4: '300',
-        key5: '备注信息',
-    }
-])
+const tableData = ref([])
 
 //获取数据
 const tableLoading = ref(false)
 const getTableData = async () => {
-
+    tableFileShow.value = false
+    tableLoading.value = true
+    const {error, code, data} = await tuningApi.pageByArchive({
+        ...searchForm.value,
+        projectId: projectId.value,
+        contractId: contractId.value,
+        isArchive: 1
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data?.records)
+        searchForm.value.total = data?.total || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
 
-//多选
-const tableCheckedKeys = ref([]);
-const tableSelection = (rows) => {
-    tableCheckedKeys.value = rows
+const intableLoading = ref(false)
+const intableData=ref([])
+//获取卷内文件
+const getintableData = async () => {
+    intableLoading.value = true
+    const {error, code, data} = await tuningApi.getarchiveFilePage({
+        nodeIds: searchForm.value.nodeIds,
+        archiveId: checkInid.value,
+        size:1000,
+        current:1
+    })
+    intableLoading.value = false
+    if (!error && code === 200) {
+        intableData.value = getArrValue(data['records'])
+    } else {
+        intableData.value = []
+
+    }
 }
 
+
 //删除
 const delModalClick = () => {
 
@@ -257,26 +226,32 @@ const onmousedown = () => {
     }
 }
 //表格行被点击
+//表格行被点击
 const tableFileShow = ref(false)
-const tableRowClick = () => {
+const checkInid = ref('')
+const fileId=ref('')
+const tableRowClick = ({row}) => {
     tableFileShow.value = true;
+    checkInid.value = row.id
+    
+   
+    getintableData()
 }
 //收起卷内文件
 const closetableFile = () => {
     tableFileShow.value = false
 }
+
 //卷内文件点击
 
-const tableFileRowClick = () => {
+const tableFileRowClick = ({row}) => {
+    console.log(row,'row');
     showMeteInfo.value = true;
+    fileId.value=row.id
 
 }
-//表格排序
-const sortModal = ref(false)
-//显示
-const tableSortClick = () => {
-    sortModal.value = true
-}
+
+
 
 //搜索表单
 const sortSearchForm = ref({
@@ -287,75 +262,12 @@ const sortSearchForm = ref({
 const sortPageChange = ({current, size}) => {
     searchForm.value.current = current
     searchForm.value.size = size
-    getSortTableData()
 }
 
-//表格数据
-const sortTableColumn = ref([
-    {key:'key1', name: '档号', width: 160},
-    {key:'key2', name: '案卷名称'},
-    {key:'action', name: '排序', width: 90},
-])
-const sortTableData = ref([
-    {
-        id: 1,
-        key1: 'xxxx-xxxx-xxx',
-        key2: '30 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-    },
-    {
-        id: 2,
-        key1: 'xxxx-xxxx-222',
-        key2: '40 奉建路PPP项目实施方案的批复-市发展改革委(渝发改交〔2018〕1361号)-20220317090413.pdf',
-    }
-])
-
-const sortTableLoading = ref(false)
-const getSortTableData = () => {
-
-}
-
-//拖动完成
-const sortTableRowDrop = (rows) => {
-    sortTableData.value = rows
-}
-
-//向下
-const downSortClick = (index) => {
-    const indexs = index + 1
-    const data = sortTableData.value
-    if(indexs !== data.length) {
-        const tmp = data.splice(indexs,1);
-        sortTableData.value.splice(index,0,tmp[0]);
-    } else {
-        window?.$message?.warning('已经处于置底,无法下移')
-    }
-}
-
-//向上
-const upSortClick = (index) => {
-    const data = sortTableData.value || []
-    if(index !== 0) {
-        const tmp = data.splice(index - 1,1);
-        sortTableData.value.splice(index,0,tmp[0]);
-    } else {
-        window?.$message?.warning('已经处于置顶,无法上移')
-    }
-}
-
-//保存
-const sortModalLoading = ref(false)
-const sortModalSave = () => {
-    sortModal.value = false
-}
-
-//关闭
-const sortModalClose = () => {
-    sortModal.value = false
-}
 
 //获取树的数据
 const ElTreeData = ref([])
-let childtreedata = ref([])//子目录信息
+
 const getClassIfyList = async () => {
     const { error, code, data } = await projectScanningApi.getClassIfyList({
         projectId: projectId.value,
@@ -369,15 +281,9 @@ const getClassIfyList = async () => {
     }
     console.log(ElTreeData.value,'ElTreeData');
 }
-//自动展开缓存
-const TreeAutoExpandKeys = ref(getStoreValue('scanningTreeExpandKeys') || [])
-
-//项目树被点击
-const treeNodeInfo = ref({})
-const treeDataInfo = ref({})
-const nodeIds = ref('')
-const isStorageNode = ref(0)
-const isBuiltDrawing = ref(0)
+
+
+
 //自动展开缓存
 const treeAutoExpandKeys = ref(getStoreValue('metaExpandKeys') || [])
 const nodeElTreeClick = ({node, data, keys, key}) => {
@@ -385,6 +291,11 @@ const nodeElTreeClick = ({node, data, keys, key}) => {
     //缓存展开的节点
     setStoreValue('metaExpandKeys', keys)
     treeAutoExpandKeys.value = keys || []
+    searchForm.value.total = 0
+    searchForm.value.current = 1
+    searchForm.value.size = 20
+    searchForm.value.nodeIds = data.id || '';
+    getTableData()
 }
 //树菜单被点击
 const ElTreeMenuClick = async ({key, node, data, keys}) => {