管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-18 4c634c5542c4d61f33c98bc4756aca6e195ac6d2
src/views/datamanage/uploadmanage.vue
@@ -122,6 +122,13 @@
            ></i></el-input>
        </el-form-item>
        <el-form-item style="float:right">
          <!-- 发布 -->
          <el-button
            type="success"
            size="small"
            icon="el-icon-s-promotion"
          >{{$t('common.publish')}}</el-button>
          <!-- 重置 -->
          <el-button
            type="info"
            size="small"
@@ -184,16 +191,37 @@
            align="center"
          />
          <el-table-column
            prop="layer"
            :label="$t('common.publishAddress')"
            align="center"
          />
          <el-table-column
            prop="uname"
            :label="$t('dataManage.vmobj.createonuser')"
            :label="$t('common.releaseTime')"
            align="center"
          />
          <el-table-column
            prop="createTime"
            :label="$t('dataManage.vmobj.createontime')"
            :label="$t('common.rublisher')"
            :formatter="formatData"
            align="center"
          />
          <el-table-column
            min-width="150"
            :label="$t('common.operate')"
          >
            <template slot-scope="scope">
              <el-button
                v-if="scope.row.layer"
                size="small"
                type="success"
                plain
                @click="setPreviewLayer(scope.row)"
              >{{$t('common.preview')}}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div
@@ -204,7 +232,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-sizes="[100, 200, 500, 1000]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="listData.count"
@@ -212,15 +240,29 @@
        </el-pagination>
      </div>
    </div>
    <!-- 地址预览 -->
    <el-dialog
      :title="$t('common.preview')"
      :visible.sync="dialogVisible"
      width="70%"
      :before-close="handleClose"
      top="13vh"
    >
      <div style="width:100%;height:65vh">
        <mapview v-if="showMapView"></mapview>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import mapview from '../../components/preview_map.vue'
import MyBread from "../../components/MyBread.vue"
import { selectdepTab, selectdirTab, meta_selectVerByDirid } from '../../api/api.js'
import { selectdepTab, selectdirTab, meta_selectVerByDirid, publish_selectMetasByPage } from '../../api/api.js'
export default {
  components: { MyBread },
  components: { MyBread, mapview },
  data() {
    return {
      active: 'first',
@@ -235,7 +277,7 @@
      },
      listData: {
        pageIndex: 1,
        pageSize: 10,
        pageSize: 100,
        count: 0
      },
      multipleSelection: [],
@@ -244,19 +286,16 @@
      dirOption: [],
      verOption: [],
      typeOption: [{
        value: 't1',
        label: '全部'
      }, {
        value: 't2',
        value: 'DOM',
        label: '影像数据(.tif, .img)'
      }, {
        value: 't3',
        value: 'MPT',
        label: '场景数据(.mpt)'
      }, {
        value: 't4',
        value: '3DML',
        label: '三维模型(.3dml)'
      }, {
        value: 't5',
        value: 'BIM',
        label: '三维模型(.fbx, .ifc, .rvt)'
      }],
      defaultProps: {
@@ -266,9 +305,27 @@
        checkStrictly: true,
        emitPath: false,
      },
      dialogVisible: false,
      showMapView: false,
    }
  },
  methods: {
    //预览弹窗打开
    setPreviewLayer(res) {
      this.$store.state.previewLayer = res;
      this.dialogVisible = true;
      this.showMapView = true;
    },
    //预览弹窗关闭
    handleClose() {
      this.dialogVisible = false;
      this.showMapView = false;
    },
    // 获取多选选中的对象
    handleSelectionChange(val) {
      this.multipleSelection = val
@@ -281,6 +338,15 @@
      } else {
        return row.sizes + " MB"
      }
    },
    //格式化地址
    formatLayer(row, column) {
      let data = row.layer
      if (data == null) {
        return data
      }
      return data.replace("{host}", iisHost)
    },
    //格式化时间
    formatData(row, column) {
@@ -328,7 +394,7 @@
      }
      this.listData = {
        pageIndex: 1,
        pageSize: 10,
        pageSize: 100,
        count: 0
      }
      this.formInline.type = this.typeOption[0].value;
@@ -343,7 +409,7 @@
        return
      }
      this.dirOption = this.treeData(data.result);
      this.formInline.dirid = this.dirOption[0].id;
      this.formInline.dirid = this.dirOption[0].code;
      this.formInline.dirName = this.dirOption[0].name;
      this.getVerList()
    },
@@ -370,19 +436,68 @@
    },
    //单位列表切换
    handleDepChange(data, node, nodeData) {
      this.formInline.depid = data.id
      this.formInline.depid = data.code
      this.formInline.depName = data.name
      this.getTableData();
    },
    //单位列表切换
    //目录列表切换
    handleDirChange(data, node, nodeData) {
      this.formInline.dirid = data.id
      this.formInline.dirid = data.code
      this.formInline.dirName = data.name
      this.getVerList()
    },
    //获取Table表格数据
    getTableData() {
    async getTableData() {
      this.listData.depcode = this.formInline.depid;
      this.listData.dircode = this.formInline.dirid;
      this.listData.name = this.formInline.name;
      this.listData.type = this.formInline.type;
      this.listData.verid = this.formInline.verid;
      const data = await publish_selectMetasByPage(this.listData)
      if (data.code != 200) {
      }
      var that = this
      var val = data.result.filter((res) => {
        if (res.createTime) {
          res.createTime = that.format(res.createTime);
        }
        if (res.layer) {
          res.layer = res.layer.replace("{host}", iisHost);
        }
        return res
      })
      this.tableData = val;
      this.listData.count = data.count;
    },
    //格式化时间
    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();
      return (
        y +
        '-' +
        this.add0(m) +
        '-' +
        this.add0(d) +
        ' ' +
        h +
        ':' +
        mm +
        ':' +
        s
      );
    },
    //格式化时间
    add0(m) {
      return m < 10 ? '0' + m : m;
    },
    //获取单位列表
    async getDepTreeList() {
@@ -392,7 +507,7 @@
        return
      }
      this.depOption = this.treeData(data.result);
      this.formInline.depid = this.depOption[0].id
      this.formInline.depid = this.depOption[0].code
      this.formInline.depName = this.depOption[0].name
    },
    //树列表生成