管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-03-03 38270b3ee920d80ad57e8f60dea8232887861a02
数据库管理-信息管理&综合展示-资料馆实现文件预览功能
已添加2个文件
已修改5个文件
1041 ■■■■ 文件已修改
src/api/screen.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/lang/en.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/lang/zh.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FilePreview/ImagePreview.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/validata.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Archive/index.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/metadataManage.vue 909 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/screen.js
@@ -109,3 +109,8 @@
export function selectPipelines(params) {
  return request.get("/comprehensive/selectPipelines", { params: params })
}
// æ–‡ä»¶é¢„览接口
export function dataLibView(params) {
  return request.get("/dataLib/downloadForView", { params: params })
}
src/assets/lang/en.js
@@ -49,7 +49,8 @@
    pleaseInputPassworld: 'Please input a password',
    passworld: 'Passworld',
    language: "中文",
    title: 'Title'
    title: 'Title',
    preview: 'preview'
  },
  dataManage: {
src/assets/lang/zh.js
@@ -49,7 +49,8 @@
    pleaseInputPassworld: '请输入密码',
    passworld: '密码',
    language: "English",
    title: '标题'
    title: '标题',
    preview: '预览'
  },
  dataManage: {
    dataManage: '数据管理',
src/components/FilePreview/ImagePreview.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
<template>
  <el-image
    :src="`${realSrc}`"
    fit="cover"
    :style="`width:${realWidth};height:${realHeight};`"
    :preview-src-list="realSrcList"
  >
    <div slot="error" class="image-slot">
      <i class="el-icon-picture-outline"></i>
    </div>
  </el-image>
</template>
<script>
import { isExternal } from "@/utils/validate";
export default {
  name: "ImagePreview",
  props: {
    src: {
      type: String,
      default: ""
    },
    width: {
      type: [Number, String],
      default: ""
    },
    height: {
      type: [Number, String],
      default: ""
    }
  },
  computed: {
    realSrc() {
      if (!this.src) {
        return;
      }
      let real_src = this.src.split(",")[0];
      if (isExternal(real_src)) {
        return real_src;
      }
      return BASE_URL + real_src;
    },
    realSrcList() {
      if (!this.src) {
        return;
      }
      let real_src_list = this.src.split(",");
      let srcList = [];
      real_src_list.forEach(item => {
        if (isExternal(item)) {
          return srcList.push(item);
        }
        return srcList.push(process.env.VUE_APP_BASE_API + item);
      });
      return srcList;
    },
    realWidth() {
      return typeof this.width == "string" ? this.width : `${this.width}px`;
    },
    realHeight() {
      return typeof this.height == "string" ? this.height : `${this.height}px`;
    }
  },
};
</script>
<style lang="scss" scoped>
.el-image {
  border-radius: 5px;
  background-color: #ebeef5;
  box-shadow: 0 0 5px 1px #ccc;
  ::v-deep .el-image__inner {
    transition: all 0.3s;
    cursor: pointer;
    &:hover {
      transform: scale(1.2);
    }
  }
  ::v-deep .image-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: #909399;
    font-size: 30px;
  }
}
</style>
src/utils/validata.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,3 @@
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}
src/views/Archive/index.vue
@@ -181,6 +181,13 @@
              <span v-show="formInline.dataType !='type2'">{{item.tabDesc}}</span>
              <div style="float: right; padding: 3px 0">
                <i
                  v-show="!showView(item.type) && formInline.dataType=='type2'"
                  class="el-icon-view"
                  :title="$t('common.preview')"
                  @click="setAttatchFileView(index, item)"
                ></i>
                <i
                style="margin-left:10px"
                  class="el-icon-tickets"
                  :title="$t('common.details')"
                  @click="setCardDetails(item)"
@@ -1069,6 +1076,7 @@
  dataLib_selectFiles,
  dataLib_deletes
} from '../../api/api';
import {dataLibView } from '@/api/screen.js'
export default {
  components: {
    MyBread, MapSdk
@@ -1200,6 +1208,7 @@
      }
    };
  },
  mounted() {
    this.getDepTreeData();
    this.getCategorySelectData();
@@ -1247,7 +1256,6 @@
    },
    //附件查看
    setAttatchDetail(index, row) {
      this.refreshAttatchDetail()
      var name = row.name;
      if (name.indexOf('.pdf') != -1) {
@@ -1260,7 +1268,25 @@
        this.dialog.isJpg = true;
        var url = BASE_URL + "/res/downloadForView?guid=" + row.guid + "&token=" + getToken();
        this.dialog.src = url
      }
    },
    setAttatchFileView(index, row) {
      this.refreshAttatchDetail()
      var name = `${row.name}.${row.type}`;
      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;
      this.dialog.isPdf = true;
      var url = BASE_URL + "/dataLib/downloadForView?guid=" + row.guid + "&token=" + getToken();
      this.dialog.src = url;
    },
    showView(name) {
      if (!name) return false
      return name.indexOf('pdf') || name.indexOf('jpg') != -1 || name.indexOf('gif') != -1 || name.indexOf('png') != -1 || name.indexOf('jpeg') != -1
    },
    //附件刪除
    async setAttachDel() {
src/views/datamanage/metadataManage.vue
@@ -1,19 +1,14 @@
<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 size="small">
@@ -98,25 +93,22 @@
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              prop="name"
              size="small"
            >
            <el-form-item prop="name" size="small">
              <!--            suffix-icon="el-icon-edit"  :placeholder="$t('common.pleaseInput')"-->
              <el-input
                v-model="queryForm.name"
                :placeholder="$t('shuJuGuanLi.lable2')"
                style="width: 200px"
              ><i
                ><i
                  slot="suffix"
                  class="el-icon-search"
                  @click="queryInfo()"
                  style="padding-right: 8px"
                ></i></el-input>
                ></i
              ></el-input>
            </el-form-item>
          </div>
          <div>
            <!--            <el-form-item>
              <el-button
                  @click="queryInfo()"
@@ -133,7 +125,7 @@
                size="small"
                @click="deleteMetaInfo"
                icon="el-icon-delete"
              >{{ $t("common.delete") }}
                >{{ $t("common.delete") }}
              </el-button>
            </el-form-item>
            <el-form-item v-if="btnStatus.download">
@@ -142,7 +134,7 @@
                icon="el-icon-download"
                type="success"
                size="small"
              >{{ $t("common.download") }}
                >{{ $t("common.download") }}
              </el-button>
            </el-form-item>
@@ -152,10 +144,9 @@
                icon="el-icon-refresh"
                type="info"
                size="small"
              >{{ $t("common.reset") }}
                >{{ $t("common.reset") }}
              </el-button>
            </el-form-item>
          </div>
        </div>
@@ -204,10 +195,7 @@
      </el-form>
    </div>
    <div class="dividing-line"></div>
    <div
      class="table_box subpage_Div"
      :style="styleVar"
    >
    <div class="table_box subpage_Div" :style="styleVar">
      <el-table
        :data="tableData"
        style="width: 100%"
@@ -215,10 +203,7 @@
        @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"
@@ -233,22 +218,23 @@
                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
            <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>
                >{{ 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')" />
        <el-table-column
          prop="sizes"
          :label="$t('dataManage.vmobj.size')"
@@ -271,10 +257,9 @@
          <template slot-scope="scope">
            <!-- <span ></span> -->
            <el-link></el-link>
            <el-link
              :underline="false"
              @click="detail(scope.row)"
            >{{ scope.row.tab }}</el-link>
            <el-link :underline="false" @click="detail(scope.row)">{{
              scope.row.tab
            }}</el-link>
          </template>
        </el-table-column>
@@ -283,10 +268,7 @@
              :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
          prop="uname"
          :label="$t('dataManage.vmobj.createonuser')"
@@ -296,17 +278,14 @@
          :label="$t('dataManage.vmobj.createontime')"
          :formatter="formatData"
        />
        <el-table-column
          min-width="180"
          :label="$t('common.operate')"
        >
        <el-table-column min-width="180" :label="$t('common.operate')">
          <template slot-scope="scope">
            <el-button
              @click="showDetail(scope.row)"
              type="primary"
              plain
              size="small"
            >{{ $t("common.details") }}
              >{{ $t("common.details") }}
            </el-button>
            <el-button
              type="warning"
@@ -315,15 +294,20 @@
              v-if="btnStatus.update"
              @click="editInfo(scope.row)"
              style="margin-left: 10px"
            >{{ $t("common.edit") }}
              >{{ $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"
        style="margin-top: 15px"
      >
      <div class="pagination_box" style="margin-top: 15px">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
@@ -336,28 +320,16 @@
        </el-pagination>
      </div>
    </div>
    <div
      class="infoBox_box"
      v-show="showinfoBox"
    >
    <div class="infoBox_box" v-show="showinfoBox">
      <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>
@@ -412,36 +384,24 @@
      :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')"
@@ -507,10 +467,7 @@
          :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')"
@@ -519,44 +476,28 @@
          <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")
          }}
      <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") }}
          >{{ $t("common.submit") }}
        </el-button>
      </div>
      <div
        v-else
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          size="small"
          @click="cancelAdd('editForm')"
        >{{
            $t("common.reset")
          }}
      <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") }}
          >{{ $t("common.submit") }}
        </el-button>
      </div>
    </el-dialog>
@@ -588,10 +529,7 @@
            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"
@@ -605,10 +543,7 @@
        </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"
@@ -617,20 +552,14 @@
        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"
@@ -638,19 +567,11 @@
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            class="primary"
            size="small"
            @click="download('codeForm')"
          >{{ $t("common.confirm") }}
          <el-button 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 type="info" size="small" @click="closeDown('codeForm')"
            >{{ $t("common.cancel") }}
          </el-button>
        </el-form-item>
      </el-form>
@@ -661,30 +582,17 @@
      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 type="primary" size="small" @click="setSearchMetaData()"
              >查询
            </el-button>
            <el-button
              type="info"
              size="small"
              @click="setRestMetaData()"
            >重置
            <el-button type="info" size="small" @click="setRestMetaData()"
              >重置
            </el-button>
          </el-form-item>
        </el-form>
@@ -740,12 +648,9 @@
            :label="$t('dataManage.dataUpObj.tableName')"
          >
            <template slot-scope="scope">
              <a
                class="scopeRowColor"
                @click="detail(scope.row)"
              >{{
                  scope.row.tab
                }}</a>
              <a class="scopeRowColor" @click="detail(scope.row)">{{
                scope.row.tab
              }}</a>
            </template>
          </el-table-column>
          <el-table-column
@@ -759,10 +664,7 @@
            :label="$t('dataManage.dataUpObj.describe')"
          />
        </el-table>
        <div
          class="pagination_box"
          style="margin-top: 15px"
        >
        <div class="pagination_box" style="margin-top: 15px">
          <el-pagination
            @size-change="handleMetaSizeChange"
            @current-change="handMetaCurrentChange"
@@ -782,7 +684,6 @@
      width="70%"
    >
      <div style="height: 65vh; width: 100%">
        <el-table
          ref="filterTable"
          :data="metaDataTable1"
@@ -835,12 +736,9 @@
            :label="$t('dataManage.dataUpObj.tableName')"
          >
            <template slot-scope="scope">
              <a
                class="scopeRowColor"
                @click="detail(scope.row)"
              >{{
                  scope.row.tab
                }}</a>
              <a class="scopeRowColor" @click="detail(scope.row)">{{
                scope.row.tab
              }}</a>
            </template>
          </el-table-column>
          <el-table-column
@@ -854,9 +752,30 @@
            :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">
        <img style="width: 100%; height: 100%" :src="dialog.src" alt="" />
      </div>
    </el-dialog>
    <iframe
      id="downFrame"
      src=""
@@ -866,8 +785,8 @@
</template>
<script>
import $ from "jquery";
import { getToken } from "@/utils/auth";
import $ from "jquery"
import { getToken } from "@/utils/auth"
import {
  deleteMeta,
  insertMeta,
@@ -882,10 +801,10 @@
  selectdirTab,
  sign_getPublicKey,
  updateMeta,
  meta_selectById
} from "../../api/api";
  meta_selectById,
} from "../../api/api"
import MyBread from "../../components/MyBread.vue";
import MyBread from "../../components/MyBread.vue"
export default {
  name: "metadataManage",
@@ -893,22 +812,22 @@
  data() {
    var repasswordValidator = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
        callback(new Error("请再次输入密码"))
      } else if (value !== this.codeForm.password) {
        callback(new Error("两次输入密码不一致!"));
        callback(new Error("两次输入密码不一致!"))
      } else {
        callback();
        callback()
      }
    };
    }
    var passwordValidator = (rule, value, callback) => {
      var passwordreg =
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/
      if (!passwordreg.test(value)) {
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"));
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"))
      } else {
        callback();
        callback()
      }
    };
    }
    return {
      verOptions: [],
      defaultProps: {
@@ -1007,276 +926,281 @@
      metaDataTable: [],
      queryMetaFlag1: false,
      metaDataTable1: [],
    };
      dialog: {
        dialogVisible: false,
        isPdf: false,
        isJpg: false,
        src: "",
      },
    }
  },
  created() {
    // this.getSelectDictTab();
    this.showPermsBtn();
    this.getQueryDepTree();
    this.showPermsBtn()
    this.getQueryDepTree()
    this.signGetPublicKey();
    this.signGetPublicKey()
  },
  beforeDestroy() {
    this.timer && clearTimeout(this.timer);
    window.removeEventListener("resize", this.onResize);
    this.timer && clearTimeout(this.timer)
    window.removeEventListener("resize", this.onResize)
  },
  mounted() {
    window.addEventListener("resize", this.onResize);
    this.calHeight();
    window.addEventListener("resize", this.onResize)
    this.calHeight()
  },
  methods: {
    //大小值改变
    changeSizeFile(row, column, cellValue, index) {
      if (cellValue >= 1024) {
        return parseFloat(cellValue / 1204).toFixed(3) + "GB";
        return parseFloat(cellValue / 1204).toFixed(3) + "GB"
      } else {
        return cellValue + "MB";
        return cellValue + "MB"
      }
    },
    setRestMetaData() {
      this.fromQueryMeta.name = "";
      this.listMetaData.name = this.fromQueryMeta.name;
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = 10;
      this.fromQueryMeta.name = ""
      this.listMetaData.name = this.fromQueryMeta.name
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = 10
      this.startQueryMetaData();
      this.startQueryMetaData()
    },
    setSearchMetaData() {
      this.listMetaData.name = this.fromQueryMeta.name;
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = 10;
      this.listMetaData.name = this.fromQueryMeta.name
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = 10
      this.startQueryMetaData();
      this.startQueryMetaData()
    },
    //源数据页面切换
    handleMetaSizeChange(val) {
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = val;
      this.startQueryMetaData();
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = val
      this.startQueryMetaData()
    },
    //源数据页面切换
    handMetaCurrentChange(val) {
      this.listMetaData.pageIndex = val;
      this.startQueryMetaData();
      this.listMetaData.pageIndex = val
      this.startQueryMetaData()
    },
    //元数据查询
    async setMetaDataQuery(row) {
      this.fromQueryMeta.title = row.name;
      this.fromQueryMeta.title = row.name
      this.listMetaData = {
        id: row.metaid,
        // name: "",
        // pageIndex: 1,
        // pageSize: 10,
        // count: 0,
      };
      const data = await meta_selectById(this.listMetaData);
      }
      const data = await meta_selectById(this.listMetaData)
      if (data.code != 200) {
        return;
        return
      }
      this.queryMetaFlag1 = true;
      this.metaDataTable1 = [data.result];
      this.queryMetaFlag1 = true
      this.metaDataTable1 = [data.result]
      // this.listMetaData.count = data.count;
    },
    //源数据查询
    setQueryMetaData(row) {
      this.fromQueryMeta.title = row.name;
      this.fromQueryMeta.title = row.name
      this.listMetaData = {
        metaid: row.id,
        name: "",
        pageIndex: 1,
        pageSize: 10,
        count: 0,
      };
      this.startQueryMetaData();
      this.queryMetaFlag = true;
      }
      this.startQueryMetaData()
      this.queryMetaFlag = true
    },
    async startQueryMetaData() {
      const data = await meta_selectPageAndCountByPid(this.listMetaData);
      const data = await meta_selectPageAndCountByPid(this.listMetaData)
      if (data.code != 200) {
        return;
        return
      }
      this.metaDataTable = data.result;
      this.listMetaData.count = data.count;
      this.metaDataTable = data.result
      this.listMetaData.count = data.count
    },
    onResize() {
      this.timer && clearTimeout(this.timer);
      this.timer && clearTimeout(this.timer)
      this.timer = setTimeout(() => {
        this.calHeight();
      }, 500);
        this.calHeight()
      }, 500)
    },
    calHeight() {
      this.$nextTick(() => {
        const rect = this.$refs.container.getBoundingClientRect();
        this.tableHeight = `${rect.height + 97}px`;
        this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`;
      });
        const rect = this.$refs.container.getBoundingClientRect()
        this.tableHeight = `${rect.height + 97}px`
        this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`
      })
    },
    async detail(res) {
      var val = res.tab.split(".");
      var val = res.tab.split(".")
      const data = await meta_selectFields({
        ns: val[0],
        tab: val[1],
      });
      })
      if (data.code != 200) {
        this.$message.error("字段列表调用失败");
        return;
        this.$message.error("字段列表调用失败")
        return
      }
      this.dialogVisible = true;
      this.dialogVisible = true
      this.attributeData = data.result;
      this.attributeData = data.result
      this.listLoader = {
        id: res.id,
        pageIndex: 1,
        pageSize: 10,
      };
      this.getDataLoaderSelectDbData();
      }
      this.getDataLoaderSelectDbData()
    },
    async getDataLoaderSelectDbData() {
      const data1 = await meta_selectByPageForUpload(this.listLoader);
      const data1 = await meta_selectByPageForUpload(this.listLoader)
      if (data1.code != 200) {
        this.$message.error("字段列表调用失败");
        return;
        this.$message.error("字段列表调用失败")
        return
      }
      var option = data1.result;
      var option = data1.result
      for (var i in option) {
        option[i].dirid = option[i].dirName;
        option[i].depid = option[i].depName;
        option[i].createuser = option[i].createName;
        option[i].updateuser = option[i].updateName;
        option[i].verid = option[i].verName;
        option[i].dirid = option[i].dirName
        option[i].depid = option[i].depName
        option[i].createuser = option[i].createName
        option[i].updateuser = option[i].updateName
        option[i].verid = option[i].verName
        if (option[i].createtime != null) {
          option[i].createtime = this.setInfoBoxTime(option[i].createtime);
          option[i].createtime = this.setInfoBoxTime(option[i].createtime)
        }
        if (option[i].updatetime != null) {
          option[i].updatetime = this.setInfoBoxTime(option[i].updatetime);
          option[i].updatetime = this.setInfoBoxTime(option[i].updatetime)
        }
      }
      this.dbTableData = data1.result;
      this.count1 = data1.count;
      this.dbTableData = data1.result
      this.count1 = data1.count
    },
    handleLoaderSizeChange(val) {
      this.listLoader.pageIndex = 1;
      this.listLoader.pageSize = val;
      this.getDataLoaderSelectDbData();
      this.listLoader.pageIndex = 1
      this.listLoader.pageSize = val
      this.getDataLoaderSelectDbData()
    },
    handleLoaderCurrentChange(val) {
      this.listLoader.pageIndex = val;
      this.getDataLoaderSelectDbData();
      this.listLoader.pageIndex = val
      this.getDataLoaderSelectDbData()
    },
    async signGetPublicKey() {
      const res = await sign_getPublicKey();
      const res = await sign_getPublicKey()
      if (res && res.code == 200) {
        window.encrypt = new JSEncrypt();
        encrypt.setPublicKey(res.result);
        window.encrypt = new JSEncrypt()
        encrypt.setPublicKey(res.result)
      }
    },
    //单位列表获取
    async getQueryDepTree() {
      const res = await selectdepTab();
      const res = await selectdepTab()
      if (res.code != 200) {
        this.$message.error("单位列表获取失败");
        return;
        this.$message.error("单位列表获取失败")
        return
      }
      this.companyOption1 = this.treeData(res.result);
      this.queryForm.depcode = this.companyOption1[0].code;
      this.queryForm.depName = this.companyOption1[0].name;
      this.getQueryDirTree();
      this.companyOption1 = this.treeData(res.result)
      this.queryForm.depcode = this.companyOption1[0].code
      this.queryForm.depName = this.companyOption1[0].name
      this.getQueryDirTree()
    },
    async getQueryDirTree() {
      const res = await selectdirTab();
      const res = await selectdirTab()
      if (res.code != 200) {
        this.$message.error("单位列表获取失败");
        return;
        this.$message.error("单位列表获取失败")
        return
      }
      this.companyOption = this.treeData(res.result);
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.dircode = this.companyOption[0].code;
      this.queryForm.dirName = this.companyOption[0].name;
      this.getQueryVerList();
      this.companyOption = this.treeData(res.result)
      this.queryForm.dirid = this.companyOption[0].id
      this.queryForm.dircode = this.companyOption[0].code
      this.queryForm.dirName = this.companyOption[0].name
      this.getQueryVerList()
    },
    async getQueryVerList() {
      const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid });
      const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid })
      if (data.code != 200) {
        this.$message.error("版本列表获取失败");
        return;
        this.$message.error("版本列表获取失败")
        return
      }
      this.verOptions = data.result;
      this.queryForm.verid = data.result[0].id;
      this.getMetaData();
      this.verOptions = data.result
      this.queryForm.verid = data.result[0].id
      this.getMetaData()
    },
    verHandleChange(val) {
      this.queryForm.verid = val;
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getMetaData();
      this.queryForm.verid = val
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.getMetaData()
    },
    handleChange(data, node, nodeData) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.dircode = data.code;
      this.queryForm.dirid = data.id;
      this.queryForm.dirName = data.name;
      this.getQueryVerList();
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.queryForm.dircode = data.code
      this.queryForm.dirid = data.id
      this.queryForm.dirName = data.name
      this.getQueryVerList()
    },
    handleChange1(data, node, nodeData) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.depcode = data.code;
      this.queryForm.depName = data.name;
      this.getMetaData();
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.queryForm.depcode = data.code
      this.queryForm.depName = data.name
      this.getMetaData()
    },
    handleChange2(data, node, nodeData) {
      this.editForm.depid = data.id;
      this.editForm.depcode = data.code;
      this.editForm.depName = data.name;
      this.editForm.depid = data.id
      this.editForm.depcode = data.code
      this.editForm.depName = data.name
    },
    handleChange3(data, node, nodeData) {
      this.editForm.dirid = data.id;
      this.editForm.dircode = data.code;
      this.editForm.dirName = data.name;
      this.editForm.dirid = data.id
      this.editForm.dircode = data.code
      this.editForm.dirName = data.name
    },
    //格式化列表
    formatData(row, column) {
      let data = row[column.property];
      let data = row[column.property]
      if (data == null) {
        return data;
        return data
      }
      return this.format(data);
      return this.format(data)
    },
    setInfoBoxTime(res) {
      if (res == null) {
        return res;
        return res
      }
      return this.format(res);
      return this.format(res)
    },
    setInfoBoxSize(res) {
      if (res >= 1024) {
        return parseFloat(res / 1024).toFixed(3) + " GB";
        return parseFloat(res / 1024).toFixed(3) + " GB"
      } else {
        return res + " MB";
        return res + " MB"
      }
    },
    //格式化时间
    format(shijianchuo) {
      //shijianchuo是整数,否则要parseInt转换
      var time = new Date(shijianchuo);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      var time = new Date(shijianchuo)
      var y = time.getFullYear()
      var m = time.getMonth() + 1
      var d = time.getDate()
      var h = time.getHours()
      var mm = time.getMinutes()
      var s = time.getSeconds()
      return (
        y +
        "-" +
@@ -1289,47 +1213,47 @@
        mm +
        ":" +
        s
      );
      )
    },
    //格式化时间
    add0(m) {
      return m < 10 ? "0" + m : m;
      return m < 10 ? "0" + m : m
    },
    //单位转换
    stateFormatSizes(row, column) {
      if (row.sizes >= 1024) {
        const val = parseFloat(row.sizes / 1024).toFixed(3);
        return val + " GB";
        const val = parseFloat(row.sizes / 1024).toFixed(3)
        return val + " GB"
      } else {
        return row.sizes + " MB";
        return row.sizes + " MB"
      }
    },
    //目录树获取
    async getSelectDictTab() {
      const res = await selectdirTab();
      const res = await selectdirTab()
      if (res.code != 200) {
        this.$message.error("列表调用失败");
        this.$message.error("列表调用失败")
      }
      this.optionCount = this.treeData(res.result);
      this.dirComPanyOption = this.treeData(res.result);
      this.listData.depcode = this.optionCount[0].code;
      this.optionCount = this.treeData(res.result)
      this.dirComPanyOption = this.treeData(res.result)
      this.listData.depcode = this.optionCount[0].code
    },
    handleNodeClick(data) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.listData.dirid = data.id;
      this.getMetaData();
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.listData.dirid = data.id
      this.getMetaData()
    },
    getTableDesc(res) {
      this.activeName = res.tab;
      this.activeName = res.tab
    },
    //显示权限按钮
    showPermsBtn() {
      let currentPerms = this.$store.state.currentPerms;
      let permsEntity = this.$store.state.permsEntity;
      let currentPerms = this.$store.state.currentPerms
      let permsEntity = this.$store.state.permsEntity
      permsEntity
        .filter((item) => item.perms == currentPerms)
        .map((item) => (this.btnStatus[item.tag.substr(1)] = true));
        .filter(item => item.perms == currentPerms)
        .map(item => (this.btnStatus[item.tag.substr(1)] = true))
    },
    // ShowWindowFly(res) {
    //   console.log(res);
@@ -1365,83 +1289,83 @@
    // },
    // è¯·æ±‚数据内容
    getMetaData() {
      this.listData.depcode = this.queryForm.depcode;
      this.listData.dircode = this.queryForm.dircode;
      this.listData.depcode = this.queryForm.depcode
      this.listData.dircode = this.queryForm.dircode
      this.listData.verid = this.queryForm.verid;
      this.listData.verid = this.queryForm.verid
      // this.listData.dirid = 57
      select_meta_ByPageAndCount(this.listData).then((res) => {
        this.tableData = res.result;
        this.count = res.count;
      });
      select_meta_ByPageAndCount(this.listData).then(res => {
        this.tableData = res.result
        this.count = res.count
      })
    },
    // æŸ¥è¯¢
    queryInfo() {
      this.listData.name = this.queryForm.name.trim();
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getMetaData();
      this.listData.name = this.queryForm.name.trim()
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.getMetaData()
    },
    // é‡ç½®æŸ¥è¯¢
    resetInfo(formName) {
      this.$refs[formName].resetFields();
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.listData.name = null;
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.depid = this.companyOption1[0].id;
      this.queryForm.dircode = this.companyOption[0].code;
      this.queryForm.depcode = this.companyOption1[0].code;
      this.queryForm.dirName = this.companyOption[0].name;
      this.queryForm.depName = this.companyOption1[0].name;
      this.getQueryVerList();
      this.getMetaData();
      this.$refs[formName].resetFields()
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.listData.name = null
      this.queryForm.dirid = this.companyOption[0].id
      this.queryForm.depid = this.companyOption1[0].id
      this.queryForm.dircode = this.companyOption[0].code
      this.queryForm.depcode = this.companyOption1[0].code
      this.queryForm.dirName = this.companyOption[0].name
      this.queryForm.depName = this.companyOption1[0].name
      this.getQueryVerList()
      this.getMetaData()
    },
    //新增按钮
    showAddDialog() {
      this.behavior = "新增用户";
      this.editForm = {};
      this.dialogFormVisible = true;
      this.behavior = "新增用户"
      this.editForm = {}
      this.dialogFormVisible = true
    },
    cancelAdd(formName) {
      this.editForm = {};
      this.$refs[formName].resetFields();
      this.editForm = {}
      this.$refs[formName].resetFields()
    },
    sendAdd(formName) {
      this.$refs[formName].validate((valid) => {
      this.$refs[formName].validate(valid => {
        if (valid) {
          this.fullscreenLoading = true;
          this.fullscreenLoading = true
          insertMeta(this.editForm)
            .then((res) => {
            .then(res => {
              setTimeout(() => {
                this.fullscreenLoading = false;
                this.fullscreenLoading = false
                if (res.code == 200) {
                  this.listData.pageSize = 10;
                  this.listData.pageIndex = 1;
                  this.getMetaData();
                  this.listData.pageSize = 10
                  this.listData.pageIndex = 1
                  this.getMetaData()
                  this.$message({
                    message: "添加成功",
                    type: "success",
                  });
                  this.editForm = {};
                  this.dialogFormVisible = false;
                  })
                  this.editForm = {}
                  this.dialogFormVisible = false
                }
              }, 500);
              }, 500)
            })
            .catch((res) => {
              alert("修改失败,请重试!");
              this.fullscreenLoading = false;
            });
            .catch(res => {
              alert("修改失败,请重试!")
              this.fullscreenLoading = false
            })
        } else {
          console.log("error submit!!");
          return false;
          console.log("error submit!!")
          return false
        }
      });
      })
    },
    // èŽ·å–å¤šé€‰é€‰ä¸­çš„å¯¹è±¡
    handleSelectionChange(val) {
      this.multipleSelection = val;
      this.multipleSelection = val
    },
    // åˆ é™¤å¤šæ¡
    deleteMetaInfo() {
@@ -1451,63 +1375,62 @@
        type: "warning",
      })
        .then(() => {
          var std = [];
          var std = []
          for (var i in this.multipleSelection) {
            std.push(this.multipleSelection[i].id);
            std.push(this.multipleSelection[i].id)
          }
          deleteMeta({ ids: std.toString() }).then((res) => {
          deleteMeta({ ids: std.toString() }).then(res => {
            if (res.code == 200) {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              this.multipleSelection = [];
              this.listData.pageSize = 10;
              this.listData.pageIndex = 1;
              this.getMetaData();
              })
              this.multipleSelection = []
              this.listData.pageSize = 10
              this.listData.pageIndex = 1
              this.getMetaData()
            } else {
              this.$message.error("删除失败");
              this.multipleSelection = [];
              this.$message.error("删除失败")
              this.multipleSelection = []
            }
          });
          })
        })
        .catch(() => {
          this.$message("已取消删除");
        });
          this.$message("已取消删除")
        })
    },
    // æŸ¥çœ‹ç•Œé¢
    showDetail(row) {
      // console.log(index, row);
      this.showinfoBox = true;
      this.itemdetail = row;
      this.showinfoBox = true
      this.itemdetail = row
    },
    // å…³é—­æŸ¥çœ‹
    closeDetial() {
      this.showinfoBox = false;
      this.itemdetail = {};
      this.showinfoBox = false
      this.itemdetail = {}
    },
    // ä¿®æ”¹ç•Œé¢
    editInfo(row) {
      // console.log(row);
      delete row.createTime;
      delete row.createUser;
      delete row.updateUser;
      delete row.updateUser;
      this.initialForm = JSON.stringify(row); //备份
      this.behavior = "修改信息";
      this.editForm = JSON.parse(JSON.stringify(row));
      this.dialogFormVisible = true;
      this.getSelectDictTab();
      delete row.createTime
      delete row.createUser
      delete row.updateUser
      delete row.updateUser
      this.initialForm = JSON.stringify(row) //备份
      this.behavior = "修改信息"
      this.editForm = JSON.parse(JSON.stringify(row))
      this.dialogFormVisible = true
      this.getSelectDictTab()
    },
    handleClose(done) {
      this.$confirm("确认关闭?")
        .then((_) => {
          this.editForm = {};
          done();
        .then(_ => {
          this.editForm = {}
          done()
        })
        .catch((_) => {
        });
        .catch(_ => {})
    },
    // æäº¤ä¿®æ”¹
@@ -1518,61 +1441,61 @@
        type: "warning",
      })
        .then(() => {
          this.dialogFormVisible = false;
          updateMeta(this.editForm).then((res) => {
          this.dialogFormVisible = false
          updateMeta(this.editForm).then(res => {
            setTimeout(() => {
              this.fullscreenLoading = false;
              this.fullscreenLoading = false
              if (res.code == 200) {
                this.listData.pageSize = 10;
                this.listData.pageIndex = 1;
                this.getMetaData();
                this.listData.pageSize = 10
                this.listData.pageIndex = 1
                this.getMetaData()
                this.$message({
                  message: "修改成功",
                  type: "success",
                });
                this.editForm = {};
                this.dialogFormVisible = false;
                })
                this.editForm = {}
                this.dialogFormVisible = false
              }
            }, 500);
          });
            }, 500)
          })
        })
        .catch(() => {
          alert("修改失败,请重试!");
          this.fullscreenLoading = false;
        });
          alert("修改失败,请重试!")
          this.fullscreenLoading = false
        })
    },
    cancelEdit() {
      this.$nextTick(() => {
        this.editForm = JSON.parse(this.initialForm);
      });
        this.editForm = JSON.parse(this.initialForm)
      })
    },
    async download() {
      var std = [];
      var std = []
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].id);
        std.push(this.multipleSelection[i].id)
      }
      var obj = {
        pwd: encrypt.encrypt(this.codeForm.repassword),
        ids: std,
      };
      const res = await meta_downloadReq(JSON.stringify(obj));
      }
      const res = await meta_downloadReq(JSON.stringify(obj))
      if (res.code != 200) {
        this.$message.error("下载请求失败");
        return;
        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_selectDownloadFile(downObj)
      if (data.code != 200) {
        this.$message.error("下载请求失败");
        return;
        this.$message.error("下载请求失败")
        return
      }
      var token = getToken();
      var token = getToken()
      var url =
        BASE_URL +
        "/meta/downloadFile?token=" +
@@ -1580,45 +1503,86 @@
        "&guid=" +
        res.result +
        "&pwd=" +
        encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
        encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
      $("#downFrame").attr("src", url).click();
      this.closeDown();
      $("#downFrame").attr("src", url).click()
      this.closeDown()
    },
    closeDown() {
      this.showCodeBox = false;
      this.codeForm.password = "";
      this.codeForm.repassword = "";
      this.showCodeBox = false
      this.codeForm.password = ""
      this.codeForm.repassword = ""
    },
    downFormData() {
      if (this.multipleSelection.length == 0) {
        alert("请先选择要下载的文件");
        return;
        alert("请先选择要下载的文件")
        return
      }
      this.showCodeBox = true;
      this.showCodeBox = true
    },
    handleSizeChange(val) {
      this.listData.pageSize = val;
      this.listData.pageIndex = 1;
      this.getMetaData();
      this.listData.pageSize = val
      this.listData.pageIndex = 1
      this.getMetaData()
    },
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      this.getMetaData();
      this.listData.pageIndex = val
      this.getMetaData()
    },
    //树列表生成
    treeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)); // å¯¹æºæ•°æ®æ·±åº¦å…‹éš†
      return cloneData.filter((father) => {
      let cloneData = JSON.parse(JSON.stringify(source)) // å¯¹æºæ•°æ®æ·±åº¦å…‹éš†
      return cloneData.filter(father => {
        // å¾ªçŽ¯æ‰€æœ‰é¡¹
        let branchArr = cloneData.filter((child) => father.id == child.pid); // å¯¹æ¯”ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : ""; // ç»™çˆ¶çº§æ·»åŠ ä¸€ä¸ªchildren属性,并赋值
        return father.pid == 0; // è¿”回一级菜单
      });
        let branchArr = cloneData.filter(child => father.id == child.pid) // å¯¹æ¯”ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : "" // ç»™çˆ¶çº§æ·»åŠ ä¸€ä¸ªchildren属性,并赋值
        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
      this.dialog.isPdf = 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>
<style lang="less" scoped>
//@import url(); å¼•入公共cssç±»
@@ -1657,5 +1621,12 @@
    border-radius: 10px;
  }
  .preview-dialog {
    .pdfClass {
      height: 70vh;
      width: 100%;
      position: relative;
    }
  }
}
</style>