From d3215f0051943a83f459009359d0039c3a0e1a4e Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期五, 04 八月 2023 10:29:48 +0800 Subject: [PATCH] 信息管理 --- src/views/datamanage/metadataManage.vue | 1039 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 855 insertions(+), 184 deletions(-) diff --git a/src/views/datamanage/metadataManage.vue b/src/views/datamanage/metadataManage.vue index f72b3ee..9a74259 100644 --- a/src/views/datamanage/metadataManage.vue +++ b/src/views/datamanage/metadataManage.vue @@ -1,20 +1,26 @@ <template> <div class="authorityManagement_box"> - <My-bread - :list="[ + <My-bread :list="[ `${$t('dataManage.dataManage')}`, `${$t('dataManage.metadataManage')}`, - ]" - ></My-bread> + ]"></My-bread> <el-divider /> - <div class="inquire subpage_Div" ref="container"> - <el-form ref="queryForm" :model="queryForm" :inline="true"> + <div + class="inquire subpage_Div" + ref="container" + > + <el-form + ref="queryForm" + :model="queryForm" + :inline="true" + > <div class="flex_box"> <div style="margin-right: auto"> - <el-form-item> + <el-form-item size="small"> <el-select :popper-append-to-body="false" v-model="queryForm.depName" + ref="treeSelect" > <el-option :value="queryForm.depid" @@ -44,10 +50,11 @@ }" ></el-cascader> --> </el-form-item> - <el-form-item> + <el-form-item size="small"> <el-select :popper-append-to-body="false" v-model="queryForm.dirName" + ref="treeSelect1" > <el-option :value="queryForm.dirid" @@ -77,7 +84,7 @@ }" ></el-cascader> --> </el-form-item> - <el-form-item> + <el-form-item size="small"> <el-select :popper-append-to-body="false" v-model="queryForm.verid" @@ -93,41 +100,42 @@ </el-option> </el-select> </el-form-item> - <el-form-item prop="name"> + <el-form-item + prop="name" + size="small" + > + <!-- suffix-icon="el-icon-edit" :placeholder="$t('common.pleaseInput')"--> <el-input v-model="queryForm.name" - :placeholder="$t('common.pleaseInput')" + :placeholder="$t('shuJuGuanLi.lable2')" style="width: 200px" - /> + ><i + slot="suffix" + class="el-icon-search" + @click="queryInfo()" + style="padding-right: 8px" + ></i></el-input> </el-form-item> </div> <div> - <el-form-item> + <!-- <el-form-item> <el-button - @click="resetInfo('queryForm')" - icon="el-icon-refresh" - type="info" - size="small" - >{{ $t("common.reset") }}</el-button + @click="queryInfo()" + icon="el-icon-search" + class="primary" + size="small" + >{{ $t("common.iquery") }} + </el-button > - </el-form-item> - <el-form-item> - <el-button - @click="queryInfo()" - icon="el-icon-search" - class="primary" - size="small" - >{{ $t("common.iquery") }}</el-button - > - </el-form-item> + </el-form-item>--> <el-form-item v-if="btnStatus.delete"> <el-button type="danger" size="small" @click="deleteMetaInfo" icon="el-icon-delete" - >{{ $t("common.delete") }}</el-button - > + >{{ $t("common.delete") }} + </el-button> </el-form-item> <el-form-item v-if="btnStatus.download"> <el-button @@ -135,65 +143,39 @@ icon="el-icon-download" type="success" size="small" - >{{ $t("common.download") }}</el-button - > + >{{ $t("common.download") }} + </el-button> + </el-form-item> + + <el-form-item> + <el-button + @click="resetInfo('queryForm')" + icon="el-icon-refresh" + type="info" + size="small" + >{{ $t("common.reset") }} + </el-button> </el-form-item> </div> </div> - - <!-- <el-form-item style="float:right"> - <el-button - @click="queryInfo()" - icon="el-icon-search" - class="primary" - size="small" - >{{ $t('common.iquery') }}</el-button> - </el-form-item> - <el-form-item style="float:right"> - <el-button - @click="resetInfo('queryForm')" - icon="el-icon-refresh" - type="info" - size="small" - >{{ $t('common.reset') }}</el-button> - </el-form-item> --> - - <!-- <el-form-item v-if="btnStatus.insert"> - <el-button - type="success" - size="small" - @click="showAddDialog" - icon="el-icon-plus" - >{{ $t('common.append') }}</el-button - > - </el-form-item> --> - <!-- <el-form-item v-if="btnStatus.delete" style="float:right"> - <el-button - type="danger" - size="small" - @click="deleteMetaInfo" - icon="el-icon-delete" - >{{ $t('common.delete') }}</el-button> - </el-form-item> - <el-form-item v-if="btnStatus.download" style="float:right"> - <el-button - @click="downFormData" - icon="el-icon-download" - type="success" - size="small" - >{{ $t('common.download') }}</el-button> - </el-form-item> --> </el-form> </div> - - <div class="table_box subpage_Div" :style="styleVar"> + <div class="dividing-line"></div> + <div + class="table_box subpage_Div" + :style="styleVar" + > <el-table :data="tableData" style="width: 100%" + border @selection-change="handleSelectionChange" height="calc(100% - 57px)" > - <el-table-column type="selection" width="55" /> + <el-table-column + type="selection" + width="55" + /> <el-table-column :label="$t('dataManage.dictionaryManageObj.number')" type="index" @@ -204,17 +186,44 @@ <template slot-scope="scope"> <span v-if="scope.row.ismeta > 0"> <el-link + style="color: #409eff" title="婧愭暟鎹煡璇�" @click="setQueryMetaData(scope.row)" target="_blank" - >{{ scope.row.name }}</el-link - > + >{{ scope.row.name }}</el-link> </span> + <span v-else-if="scope.row.metaid > 0"> + <el-link + style="color: #409eff" + title="鍏冩暟鎹煡璇�" + @click="setMetaDataQuery(scope.row)" + target="_blank" + >{{ scope.row.name }}</el-link></span> <span v-else>{{ scope.row.name }}</span> </template> </el-table-column> - <el-table-column prop="type" :label="$t('dataManage.vmobj.format')" /> + <el-table-column + prop="type" + :label="$t('dataManage.vmobj.format')" + > + <template slot-scope="scope"> + <span v-if="scope.row.type == 'gdb'"> + <el-link + @click="setSelectGdbByGuid(scope.row)" + style="color: #409eff" + > + {{ scope.row.type }} + </el-link> + </span> + <span v-else> + + {{ scope.row.type }} + </span> + </template> + + </el-table-column> + <el-table-column prop="sizes" :label="$t('dataManage.vmobj.size')" @@ -235,7 +244,14 @@ /> <el-table-column :label="$t('dataManage.dataUpObj.tableName')"> <template slot-scope="scope"> - <a @click="detail(scope.row)">{{ scope.row.tab }}</a> + <!-- <span ></span> --> + <el-link></el-link> + <el-link + :underline="false" + @click="detail(scope.row)" + >{{ + scope.row.tab + }}</el-link> </template> </el-table-column> @@ -244,7 +260,17 @@ :label="$t('dataManage.vmobj.tab')" :formatter="formatData" /> --> - <el-table-column prop="rows" :label="$t('dataManage.vmobj.row')" /> + <el-table-column + prop="rows" + :label="$t('dataManage.vmobj.row')" + /> + + <el-table-column + :label="$t('common.dataStatus')" + :formatter="stateFormat" + > + + </el-table-column> <el-table-column prop="uname" :label="$t('dataManage.vmobj.createonuser')" @@ -254,15 +280,18 @@ :label="$t('dataManage.vmobj.createontime')" :formatter="formatData" /> - <el-table-column min-width="180" :label="$t('common.operate')"> + <el-table-column + min-width="210" + :label="$t('common.operate')" + > <template slot-scope="scope"> <el-button @click="showDetail(scope.row)" type="primary" plain size="small" - >{{ $t("common.details") }}</el-button - > + >{{ $t("common.details") }} + </el-button> <el-button type="warning" plain @@ -270,17 +299,28 @@ v-if="btnStatus.update" @click="editInfo(scope.row)" style="margin-left: 10px" - >{{ $t("common.edit") }}</el-button - > + >{{ $t("common.edit") }} + </el-button> + <el-button + plain + size="small" + v-if="showPreview(scope.row)" + @click="handlePreview(scope.row)" + style="margin-left: 10px" + >{{ $t("common.preview") }} + </el-button> </template> </el-table-column> </el-table> - <div class="pagination_box"> + <div + class="pagination_box" + style="margin-top: 15px" + > <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listData.pageIndex" - :page-sizes="[10, 20, 50, 100]" + :page-sizes="[10, 50, 100, 200]" :page-size="listData.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="count" @@ -288,16 +328,29 @@ </el-pagination> </div> </div> - <div class="infoBox_box" v-show="showinfoBox"> + <div + class="infoBox_box" + v-show="showinfoBox" + style="z-index:99999" + > <div class="infoBox box_div"> - <div slot="header" class="clearfix"> + <div + slot="header" + class="clearfix" + > <span>{{ $t("common.details") }}</span> - <div style="float: right; cursor: pointer" @click="closeDetial"> + <div + style="float: right; cursor: pointer" + @click="closeDetial" + > <i class="el-icon-close"></i> </div> </div> <el-divider></el-divider> - <div class="contentBox" style="padding: 1%"> + <div + class="contentBox" + style="padding: 1%" + > <p>{{ $t("dataManage.vmobj.name") }}锛歿{ itemdetail.name }}</p> <el-divider></el-divider> <p>{{ $t("dataManage.vmobj.format") }}锛歿{ itemdetail.type }}</p> @@ -314,7 +367,7 @@ <el-divider></el-divider> <p>{{ $t("dataManage.vmobj.tab") }}锛歿{ itemdetail.tab }}</p> <el-divider></el-divider> - <p>{{ $t("dataManage.vmobj.row") }}锛歿{ itemdetail.row }}</p> + <p>{{ $t("dataManage.vmobj.row") }}锛歿{ itemdetail.rows }}</p> <el-divider></el-divider> <p> {{ $t("dataManage.vmobj.createonuser") }}锛歿{ itemdetail.uname }} @@ -326,17 +379,15 @@ }} </p> <el-divider></el-divider> - <p> - {{ $t("dataManage.vmobj.updateonuser") }}锛歿{ - itemdetail.updateUser - }} + <!-- <p> + {{ $t("dataManage.vmobj.depName") }}锛歿{ itemdetail.updateUser }} </p> <el-divider></el-divider> <p> - {{ $t("dataManage.vmobj.updateontime") }}锛歿{ + {{ $t("dataManage.vmobj.depName") }}锛歿{ setInfoBoxTime(itemdetail.updateTime) }} - </p> + </p> --> </div> </div> </div> @@ -352,24 +403,36 @@ :visible.sync="dialogFormVisible" :before-close="handleClose" > - <el-form :model="editForm" ref="editForm"> + <el-form + :model="editForm" + ref="editForm" + > <el-form-item :label="$t('dataManage.vmobj.name')" :label-width="formLabelWidth" > - <el-input v-model="editForm.name" autocomplete="off"></el-input> + <el-input + v-model="editForm.name" + autocomplete="off" + ></el-input> </el-form-item> <el-form-item :label="$t('dataManage.vmobj.format')" :label-width="formLabelWidth" > - <el-input v-model="editForm.type" autocomplete="off"></el-input> + <el-input + v-model="editForm.type" + autocomplete="off" + ></el-input> </el-form-item> <el-form-item :label="$t('dataManage.vmobj.size')" :label-width="formLabelWidth" > - <el-input v-model="editForm.sizes" autocomplete="off"></el-input> + <el-input + v-model="editForm.sizes" + autocomplete="off" + ></el-input> </el-form-item> <el-form-item :label="$t('dataManage.vmobj.depName')" @@ -435,7 +498,10 @@ :label="$t('dataManage.vmobj.describe')" :label-width="formLabelWidth" > - <el-input v-model="editForm.describe" autocomplete="off"></el-input> + <el-input + v-model="editForm.describe" + autocomplete="off" + ></el-input> </el-form-item> <!-- <el-form-item :label="$t('dataManage.vmobj.gather')" @@ -444,29 +510,41 @@ <el-input v-model="editForm.gather" autocomplete="off"></el-input> </el-form-item> --> </el-form> - <div v-if="behavior == '淇敼淇℃伅'" slot="footer" class="dialog-footer"> - <el-button size="small" @click="cancelEdit()">{{ - $t("common.reset") - }}</el-button> + <div + v-if="behavior == '淇敼淇℃伅'" + slot="footer" + class="dialog-footer" + > + <el-button + size="small" + @click="cancelEdit()" + >{{ $t("common.reset") }} + </el-button> <el-button size="small" type="primary" @click="sendEdit('editForm')" v-loading.fullscreen.lock="fullscreenLoading" - >{{ $t("common.submit") }}</el-button - > + >{{ $t("common.submit") }} + </el-button> </div> - <div v-else slot="footer" class="dialog-footer"> - <el-button size="small" @click="cancelAdd('editForm')">{{ - $t("common.reset") - }}</el-button> + <div + v-else + slot="footer" + class="dialog-footer" + > + <el-button + size="small" + @click="cancelAdd('editForm')" + >{{ $t("common.reset") }} + </el-button> <el-button size="small" type="primary" @click="sendAdd('editForm')" v-loading.fullscreen.lock="fullscreenLoading" - >{{ $t("common.submit") }}</el-button - > + >{{ $t("common.submit") }} + </el-button> </div> </el-dialog> <el-dialog @@ -497,12 +575,15 @@ align="center" ></el-table-column> </el-table> - <div style="margin-top: 10px" class="pagination_box"> + <div + style="margin-top: 10px" + class="pagination_box" + > <el-pagination @size-change="handleLoaderSizeChange" @current-change="handleLoaderCurrentChange" :current-page="listLoader.pageIndex" - :page-sizes="[10, 20, 50, 100]" + :page-sizes="[10, 50, 100, 200]" :page-size="listLoader.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="count1" @@ -511,7 +592,10 @@ </div> </div> </el-dialog> - <div class="downloadBox box_div subpage_Div" v-if="showCodeBox"> + <div + class="downloadBox box_div subpage_Div" + v-if="showCodeBox" + > <h4 style="padding: 20px">{{ $t("common.passworld") }}</h4> <el-form :model="codeForm" @@ -520,14 +604,20 @@ label-width="100px" class="codeForm" > - <el-form-item :label="$t('common.passworld')" prop="password"> + <el-form-item + :label="$t('common.passworld')" + prop="password" + > <el-input type="password" v-model="codeForm.password" show-password ></el-input> </el-form-item> - <el-form-item :label="$t('common.SPassword')" prop="repassword"> + <el-form-item + :label="$t('common.SPassword')" + prop="repassword" + > <el-input type="password" v-model="codeForm.repassword" @@ -539,11 +629,14 @@ class="primary" size="small" @click="download('codeForm')" - >{{ $t("common.confirm") }}</el-button - > - <el-button type="info" size="small" @click="closeDown('codeForm')">{{ - $t("common.cancel") - }}</el-button> + >{{ $t("common.confirm") }} + </el-button> + <el-button + type="info" + size="small" + @click="closeDown('codeForm')" + >{{ $t("common.cancel") }} + </el-button> </el-form-item> </el-form> </div> @@ -553,18 +646,31 @@ width="70%" > <div style="height: 65vh; width: 100%"> - <el-form :inline="true" :model="fromQueryMeta" class="demo-form-inline"> + <el-form + :inline="true" + :model="fromQueryMeta" + class="demo-form-inline" + > <el-form-item> - <el-input size="small" v-model="fromQueryMeta.name"></el-input> + <el-input + size="small" + v-model="fromQueryMeta.name" + ></el-input> </el-form-item> <el-form-item> - <el-button type="primary" size="small" @click="setSearchMetaData()" - >鏌ヨ</el-button - > - <el-button type="info" size="small" @click="setRestMetaData()" - >閲嶇疆</el-button - > + <el-button + type="primary" + size="small" + @click="setSearchMetaData()" + >鏌ヨ + </el-button> + <el-button + type="info" + size="small" + @click="setRestMetaData()" + >閲嶇疆 + </el-button> </el-form-item> </el-form> <el-table @@ -619,7 +725,10 @@ :label="$t('dataManage.dataUpObj.tableName')" > <template slot-scope="scope"> - <a class="scopeRowColor" @click="detail(scope.row)">{{ + <a + class="scopeRowColor" + @click="detail(scope.row)" + >{{ scope.row.tab }}</a> </template> @@ -635,12 +744,15 @@ :label="$t('dataManage.dataUpObj.describe')" /> </el-table> - <div class="pagination_box"> + <div + class="pagination_box" + style="margin-top: 15px" + > <el-pagination @size-change="handleMetaSizeChange" @current-change="handMetaCurrentChange" :current-page="listMetaData.pageIndex" - :page-sizes="[10, 20, 50, 100]" + :page-sizes="[10, 50, 100, 200,500]" :page-size="listMetaData.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="listMetaData.count" @@ -649,11 +761,329 @@ </div> </div> </el-dialog> + <el-dialog + :title="fromQueryMeta.title" + :visible.sync="queryMetaFlag1" + width="70%" + > + <div style="height: 65vh; width: 100%"> + <el-table + ref="filterTable" + :data="metaDataTable1" + style="width: 100%" + height="100%" + > + <el-table-column + align="center" + type="index" + :label="$t('common.index')" + width="70px" + ></el-table-column> + <el-table-column + align="center" + prop="name" + :label="$t('common.name')" + width="120" + > + </el-table-column> + <el-table-column + align="center" + prop="dirName" + :label="$t('dataManage.dataUpObj.catalogue')" + width="300" + /> + <el-table-column + align="center" + prop="depName" + :label="$t('dataManage.dataUpObj.company')" + width="200" + /> + <el-table-column + align="center" + prop="verName" + :label="$t('dataManage.dataUpObj.versionNo')" + /> + <el-table-column + align="center" + prop="type" + :label="$t('common.type')" + /> + <el-table-column + align="center" + prop="sizes" + :label="$t('common.size')" + :formatter="changeSizeFile" + /> + <el-table-column + align="center" + :label="$t('dataManage.dataUpObj.tableName')" + > + <template slot-scope="scope"> + <a + class="scopeRowColor" + @click="detail(scope.row)" + >{{ + scope.row.tab + }}</a> + </template> + </el-table-column> + <el-table-column + align="center" + prop="rows" + :label="$t('common.lineNuber')" + /> + <el-table-column + align="center" + prop="desc" + :label="$t('dataManage.dataUpObj.describe')" + /> + </el-table> + </div> + </el-dialog> + <el-dialog + custom-class="preview-dialog" + title="棰勮" + :append-to-body="false" + :visible.sync="dialog.dialogVisible" + width="70%" + :close-on-click-modal="false" + > + <div + v-if="dialog.isPdf" + class="pdfClass" + > + <iframe + :src="dialog.src" + type="application/x-google-chrome-pdf" + width="100%" + height="100%" + > + </iframe> + </div> + <div + v-if="dialog.isJpg" + class="pdfClass" + > + <el-image + style="width: 100%; height: 100%" + :src="dialog.src" + :preview-src-list="[dialog.src]" + > + </el-image> + </div> + </el-dialog> + <el-dialog + title="鏁版嵁鐢宠" + :visible.sync="dialogInsertFile" + width="30%" + top="10vh" + :modal="false" + :close-on-click-modal="false" + :show-close="false" + > + <el-form + ref="form" + :model="fileFrom" + label-width="100px" + > + <el-form-item label="瀹℃牳鍗曚綅"> + <div> + <ul> + <li v-for="item in fileFrom.depid"> + {{ item.name }} + </li> + </ul> + </div> + </el-form-item> + + <el-form-item label="鎻忚堪"> + <el-input + type="textarea" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="fileFrom.descr" + maxlength="50" + show-word-limit + > + </el-input> + </el-form-item> + <el-form-item> + <el-button + class="primary" + size="small" + @click="getFileInsertApply()" + >{{ $t("common.confirm") }}</el-button> + <el-button + type="info" + size="small" + @click="handleInsertFileClose()" + >{{ $t("common.cancel") }}</el-button> + </el-form-item> + </el-form> + </el-dialog> + <el-dialog + title="" + :visible.sync="gdbDialog" + width="80%" + top="8vh" + :modal="false" + :close-on-click-modal="false" + > + <div class="gdbTableBox"> + <el-table + :data="gdbData" + style="width: 100%" + max-height="38.54167vw" + > + <el-table-column + type="selection" + width="55" + /> + <el-table-column + :label="$t('dataManage.dictionaryManageObj.number')" + type="index" + width="50" + > + </el-table-column> + <el-table-column :label="$t('dataManage.vmobj.name')"> + <template slot-scope="scope"> + <span v-if="scope.row.ismeta > 0"> + <el-link + style="color: #409eff" + title="婧愭暟鎹煡璇�" + @click="setQueryMetaData(scope.row)" + target="_blank" + >{{ scope.row.name }}</el-link> + </span> + <span v-else-if="scope.row.metaid > 0"> + <el-link + style="color: #409eff" + title="鍏冩暟鎹煡璇�" + @click="setMetaDataQuery(scope.row)" + target="_blank" + >{{ scope.row.name }}</el-link></span> + <span v-else>{{ scope.row.name }}</span> + </template> + </el-table-column> + + <el-table-column + prop="type" + :label="$t('dataManage.vmobj.format')" + > + + </el-table-column> + + <el-table-column + prop="sizes" + :label="$t('dataManage.vmobj.size')" + :formatter="stateFormatSizes" + /> + <el-table-column + prop="depName" + :label="$t('dataManage.vmobj.depName')" + /> + <el-table-column + prop="dirName" + :label="$t('dataManage.vmobj.dirName')" + width="200" + /> + <el-table-column + prop="verName" + :label="$t('dataManage.vmobj.versionNumber')" + /> + <el-table-column :label="$t('dataManage.dataUpObj.tableName')"> + <template slot-scope="scope"> + + <el-link></el-link> + <el-link + :underline="false" + @click="detail(scope.row)" + >{{ + scope.row.tab + }}</el-link> + </template> + </el-table-column> + + <el-table-column + prop="rows" + :label="$t('dataManage.vmobj.row')" + /> + + <el-table-column + :label="$t('common.dataStatus')" + :formatter="stateFormat" + > + + </el-table-column> + <el-table-column + prop="uname" + :label="$t('dataManage.vmobj.createonuser')" + /> + <el-table-column + prop="createTime" + :label="$t('dataManage.vmobj.createontime')" + :formatter="formatData" + /> + <el-table-column + min-width="210" + :label="$t('common.operate')" + > + <template slot-scope="scope"> + <el-button + @click="showDetail(scope.row)" + type="primary" + plain + size="small" + >{{ $t("common.details") }} + </el-button> + <el-button + type="warning" + plain + size="small" + v-if="btnStatus.update" + @click="editInfo(scope.row)" + style="margin-left: 10px" + >{{ $t("common.edit") }} + </el-button> + <el-button + plain + size="small" + v-if="showPreview(scope.row)" + @click="handlePreview(scope.row)" + style="margin-left: 10px" + >{{ $t("common.preview") }} + </el-button> + </template> + </el-table-column> + </el-table> + </div> + + </el-dialog> <iframe id="downFrame" src="" style="display: none; border: 0; padding: 0; height: 0; width: 0" ></iframe> + + <div + class="loadBox" + v-if="loadDialogVisible" + > + <div style="widht:100%; margin:20px; color:white"> + <div style="margin-left:99%"> + <!-- <el-link + @click="setloadDialogVisible()" + style="color:white" + > X</el-link> --> + </div> + </div> + <div + v-loading="true" + element-loading-background="rgba(0, 0, 0, 0.0) " + element-loading-text="鏁版嵁鍒犻櫎涓�" + style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); " + > + </div> + </div> </div> </template> @@ -661,24 +1091,29 @@ import $ from "jquery"; import { getToken } from "@/utils/auth"; import { - select_meta_ByPageAndCount, - // queryDataCount, - updateMeta, + encr, deleteMeta, insertMeta, - selectDictTab, - selectdirTab, - selectdepTab, meta_downloadReq, - sign_getPublicKey, + meta_selectByPageForUpload, meta_selectDownloadFile, meta_selectFields, - meta_selectByPageForUpload, - meta_selectVerByDirid, meta_selectPageAndCountByPid, + meta_selectVerByDirid, + select_meta_ByPageAndCount, + selectdepTab, + selectdirTab, + sign_getPublicKey, + updateMeta, + meta_selectById, + meta_selectMetaOverflowDep, + meta_selectDepsByCodes, + apply_insertApply, + meta_selectGdbByGuid, } from "../../api/api"; import MyBread from "../../components/MyBread.vue"; + export default { name: "metadataManage", components: { MyBread }, @@ -726,6 +1161,8 @@ dirid: "", depid: "", verid: "", + depName: "", + }, behavior: "", initialForm: "", @@ -774,7 +1211,7 @@ dialogVisible: false, listLoader: { id: null, - pageSize: 1, + pageIndex: 1, pageSize: 10, }, count1: 0, @@ -797,6 +1234,26 @@ name: "", }, metaDataTable: [], + queryMetaFlag1: false, + metaDataTable1: [], + dialog: { + dialogVisible: false, + isPdf: false, + isJpg: false, + src: "", + }, + dialogInsertFile: false, + fileFrom: { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null, + }, + gdbData: [], + gdbDialog: false, + gdbGuid: null, + loadDialogVisible: false }; }, created() { @@ -810,11 +1267,52 @@ this.timer && clearTimeout(this.timer); window.removeEventListener("resize", this.onResize); }, + mounted() { window.addEventListener("resize", this.onResize); this.calHeight(); }, + watch: { + "queryForm.depName"() { + + this.$refs.treeSelect.visible = false; + }, + "queryForm.dirid"() { + + this.$refs.treeSelect1.visible = false; + }, + }, methods: { + //gdb 鐐瑰嚮浜嬩欢 + setSelectGdbByGuid(row) { + this.gdbGuid = row.guid + this.getSelectGdbByGuid(); + }, + async getSelectGdbByGuid() { + if (!this.gdbGuid) return + const data = await meta_selectGdbByGuid({ guid: this.gdbGuid }) + if (data.code != 200) { + return this.$message.error("鏍规嵁GUID鏌ヨGDB鏁版嵁澶辫触"); + } + if (data.count <= 0) { + return this.$message("鏌ユ棤鏇村鏁版嵁"); + } + this.gdbData = data.result; + this.gdbDialog = true; + + }, + + + stateFormat(row, column) { + var val = ['shp', 'gdb', 'xls', 'xlsx'] + if (val.indexOf(row.type) > -1 && row.rows > 0) { + return '宸蹭笂浼�,宸插叆搴�' + } else if (val.indexOf(row.type) > -1 && row.rows == 0) { + return '宸蹭笂浼�,鏈叆搴�' + } else { + return '宸蹭笂浼�' + } + }, //澶у皬鍊兼敼鍙� changeSizeFile(row, column, cellValue, index) { if (cellValue >= 1024) { @@ -849,6 +1347,24 @@ this.listMetaData.pageIndex = val; this.startQueryMetaData(); }, + //鍏冩暟鎹煡璇� + async setMetaDataQuery(row) { + this.fromQueryMeta.title = row.name; + this.listMetaData = { + id: row.metaid, + + }; + const data = await meta_selectById(this.listMetaData); + if (data.code != 200) { + return; + } + + this.queryMetaFlag1 = true; + this.metaDataTable1 = [data.result]; + // this.listMetaData.count = data.count; + }, + + //婧愭暟鎹煡璇� setQueryMetaData(row) { this.fromQueryMeta.title = row.name; @@ -881,7 +1397,7 @@ this.$nextTick(() => { const rect = this.$refs.container.getBoundingClientRect(); this.tableHeight = `${rect.height + 97}px`; - this.styleVar["height"] = `calc(100% - ${rect.height + 97}px)`; + this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`; }); }, async detail(res) { @@ -1004,6 +1520,7 @@ this.listData.pageIndex = 1; this.queryForm.depcode = data.code; this.queryForm.depName = data.name; + this.getMetaData(); }, handleChange2(data, node, nodeData) { @@ -1215,6 +1732,9 @@ }, // 鍒犻櫎澶氭潯 deleteMetaInfo() { + if (this.multipleSelection.length <= 0) { + return this.$message("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁"); + } this.$confirm("纭畾鏄惁鍒犻櫎鎵�閫夊唴瀹�?", "鎻愮ず", { confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", @@ -1225,18 +1745,23 @@ for (var i in this.multipleSelection) { std.push(this.multipleSelection[i].id); } + this.loadDialogVisible = true; deleteMeta({ ids: std.toString() }).then((res) => { if (res.code == 200) { + this.loadDialogVisible = false; this.$message({ type: "success", message: "鍒犻櫎鎴愬姛!", }); this.multipleSelection = []; - this.listData.pageSize = 10; + // this.listData.pageSize = 10 this.listData.pageIndex = 1; + this.getMetaData(); } else { + this.loadDialogVisible = false; this.$message.error("鍒犻櫎澶辫触"); + this.multipleSelection = []; } }); @@ -1250,7 +1775,9 @@ showDetail(row) { // console.log(index, row); this.showinfoBox = true; + this.itemdetail = row; + }, // 鍏抽棴鏌ョ湅 closeDetial() { @@ -1276,7 +1803,7 @@ this.editForm = {}; done(); }) - .catch((_) => {}); + .catch((_) => { }); }, // 鎻愪氦淇敼 @@ -1294,7 +1821,14 @@ if (res.code == 200) { this.listData.pageSize = 10; this.listData.pageIndex = 1; - this.getMetaData(); + + if (this.gdbDialog) { + this.getSelectGdbByGuid(); + } else { + this.getMetaData(); + } + + this.$message({ message: "淇敼鎴愬姛", type: "success", @@ -1309,6 +1843,7 @@ alert("淇敼澶辫触锛岃閲嶈瘯锛�"); this.fullscreenLoading = false; }); + }, cancelEdit() { this.$nextTick(() => { @@ -1316,44 +1851,111 @@ }); }, async download() { - var std = []; + var ids = []; for (var i in this.multipleSelection) { - std.push(this.multipleSelection[i].id); + ids.push(this.multipleSelection[i].id); } var obj = { - pwd: encrypt.encrypt(this.codeForm.repassword), - ids: std, + ids: ids, }; - const res = await meta_downloadReq(JSON.stringify(obj)); - - if (res.code != 200) { - this.$message.error("涓嬭浇璇锋眰澶辫触"); - return; - } - - var downObj = { - guid: res.result, - pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)), - }; - const data = await meta_selectDownloadFile(downObj); - + const data = await meta_selectMetaOverflowDep(obj); if (data.code != 200) { - this.$message.error("涓嬭浇璇锋眰澶辫触"); return; } - var token = getToken(); - var url = - BASE_URL + - "/meta/downloadFile?token=" + - token + - "&guid=" + - res.result + - "&pwd=" + - encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)); + var password = this.codeForm.repassword; + if (data.result.length == 0) { + var obj = { + pwd: encrypt.encrypt(this.codeForm.repassword), + ids: ids, + }; + const res = await meta_downloadReq(JSON.stringify(obj)); + if (res.code != 200) { + this.$message.error("涓嬭浇璇锋眰澶辫触"); + return; + } - $("#downFrame").attr("src", url).click(); + var downObj = { + guid: res.result, + pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)), + }; + const data1 = await meta_selectDownloadFile(downObj); + if (data1.code != 200) { + this.$message.error("涓嬭浇璇锋眰澶辫触"); + return; + } + var token = getToken(); + var url = + BASE_URL + + "/meta/downloadFile?token=" + + token + + "&guid=" + + res.result + + "&pwd=" + + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)); + + $("#downFrame").attr("src", url).click(); + } else { + var val = ""; + var std = []; + for (var i in data.result) { + if (val == "") { + val += "codes=" + data.result[i]; + } else { + val += "&codes=" + data.result[i]; + } + std.push({ + name: data.result[i], + }); + } + const data1 = await meta_selectDepsByCodes(val); + if (data1.code != 200) { + return; + } + + this.fileFrom.depid = data1.result; + this.fileFrom.ids = ids; + this.fileFrom.pwd = encr(password); + this.fileFrom.depcodes = data.result; + this.dialogInsertFile = true; + } + this.closeDown(); }, + + async getFileInsertApply() { + this.dialogInsertFile = false; + + var obj = { + ids: this.fileFrom.ids, + pwd: this.fileFrom.pwd, + tabs: ["鍏冩暟鎹〃"], + entities: ["sysmeta"], + descr: this.fileFrom.descr, + depcodes: this.fileFrom.depcodes, + }; + + const data = await apply_insertApply(JSON.stringify(obj)); + this.handleInsertFileClose(); + if (data.code != 200) { + this.$message.error("鏁版嵁鐢宠澶辫触"); + return; + } + this.$message({ + message: "鏁版嵁鐢宠鎴愬姛", + type: "success", + }); + }, + handleInsertFileClose() { + this.dialogInsertFile = false; + this.fileFrom = { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null, + }; + }, + closeDown() { this.showCodeBox = false; this.codeForm.password = ""; @@ -1386,6 +1988,47 @@ return father.pid == 0; // 杩斿洖涓�绾ц彍鍗� }); }, + showPreview(row) { + let name = row.name; + if (!name) return false; + return ( + name.indexOf("pdf") != -1 || + name.indexOf("jpg") != -1 || + name.indexOf("gif") != -1 || + name.indexOf("png") != -1 || + name.indexOf("jpeg") != -1 + ); + }, + handlePreview(row) { + let name = row.name; + this.refreshAttatchDetail(); + + if (name.indexOf(".pdf") != -1) { + this.dialog.isPdf = true; + } else if ( + name.indexOf(".jpg") != -1 || + name.indexOf(".gif") != -1 || + name.indexOf(".png") != -1 || + name.indexOf(".jpeg") != -1 + ) { + this.dialog.isJpg = true; + } + this.dialog.dialogVisible = true; + + var url = + BASE_URL + + "/inquiry/downloadForView?guid=" + + row.guid + + "&token=" + + getToken(); + this.dialog.src = url; + }, + refreshAttatchDetail() { + this.dialog.src = ""; + this.dialog.dialogVisible = false; + this.dialog.isPdf = false; + this.dialog.isJpg = false; + }, }, }; </script> @@ -1394,15 +2037,15 @@ .authorityManagement_box { height: 98%; width: 98%; - padding: 1%; + padding: 0.5%; .inquire { padding: 8px; - margin-top: 20px; + //margin-top: 20px; border-radius: 5px; - margin-bottom: 20px; + //margin-bottom: 20px; .el-form-item { margin: 5px; } @@ -1415,6 +2058,7 @@ display: block; margin-left: 10px; //杩欎釜鐢ㄤ簬鍦嗙偣灞呬腑 } + .downloadBox { position: absolute; top: 20%; @@ -1425,5 +2069,32 @@ border-radius: 10px; } + .preview-dialog { + .pdfClass { + height: 70vh; + width: 100%; + position: relative; + } + } + .el-divider--horizontal { + margin: 15px 0; + } + .gdbTableBox { + width: 100%; + height: 740px; + overflow-y: auto; + } + .loadBox { + position: fixed; + z-index: 2002; + background: rgba(0, 0, 0, 0.2); + width: 100%; + height: 100%; + top: 0; + left: 0; + .el-loading-mask { + background: transparent !important; + } + } } </style> -- Gitblit v1.9.3