|
@@ -12,13 +12,18 @@
|
|
|
<admSearch @SearchValue="searchValue" class="item"/>
|
|
|
<el-upload
|
|
|
style="float: right"
|
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
+ action="/datacenter/object/equip/import"
|
|
|
+ :disabled="true"
|
|
|
+ :headers="{ projectId: projectId, groupCode: 'WD' }"
|
|
|
+ :data="{ projectId: projectId, classCode: deviceType }"
|
|
|
:show-file-list="false"
|
|
|
multiple
|
|
|
>
|
|
|
- <el-button>上传Excle</el-button>
|
|
|
+ <el-button :disabled="!deviceType">上传Excle</el-button>
|
|
|
</el-upload>
|
|
|
- <el-button style="float: right; margin-right: 12px" @click="handleClickDownload">下载模板</el-button>
|
|
|
+ <el-tooltip effect="dark" content="请选择设备类型" placement="top">
|
|
|
+ <el-button style="float: right; margin-right: 12px" :disabled="!deviceType" @click="handleClickDownload">下载模板</el-button>
|
|
|
+ </el-tooltip>
|
|
|
</div>
|
|
|
<div v-loading="loading" style="height: calc(100% - 100px); padding: 0 12px; position: relative">
|
|
|
<template style="height: 100%" v-if="tableData.length">
|
|
@@ -58,7 +63,7 @@
|
|
|
<script lang="ts">
|
|
|
import { Vue, Component, Ref } from "vue-property-decorator";
|
|
|
import { allDevice, dictInfo } from "@/api/equipComponent";
|
|
|
-import { queryEquip, updateEquip } from "@/api/datacenter";
|
|
|
+import { queryEquip, updateEquip, exportEquip } from "@/api/datacenter";
|
|
|
import { AdmMultiTable, AdmSearch, Pagination, baseDataForm } from "@/views/maintain/components/index";
|
|
|
import { UserModule } from "@/store/modules/user";
|
|
|
import tools from "@/utils/maintain";
|
|
@@ -274,8 +279,22 @@ export default class EquipTab extends Vue {
|
|
|
/**
|
|
|
* 下载模板
|
|
|
*/
|
|
|
- private handleClickDownload() {
|
|
|
+ private async handleClickDownload() {
|
|
|
console.log("下载模板");
|
|
|
+ /**
|
|
|
+ * TODO:下载模板代码
|
|
|
+ */
|
|
|
+ // if (!this.projectId) {
|
|
|
+ // this.$message.info("请选择项目");
|
|
|
+ // } else if (!this.deviceType) {
|
|
|
+ // this.$message.info("请选择设备类型");
|
|
|
+ // } else {
|
|
|
+ // const getParams = {
|
|
|
+ // projectId: this.projectId,
|
|
|
+ // classCode: this.deviceType
|
|
|
+ // }
|
|
|
+ // exportEquip(getParams);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
/**
|