Browse Source

监控设备取消获取表格数据

feature
mk 3 years ago
parent
commit
ac9a32b846
  1. 113
      src/views/modules/cpts/base2/index.vue

113
src/views/modules/cpts/base2/index.vue

@ -2,11 +2,7 @@
<div class="g-main">
<div v-show="true">
<div class="m-search" ref="ref_search">
<el-form
:inline="true"
ref="ref_searchform"
label-width="100px"
>
<el-form :inline="true" ref="ref_searchform" label-width="100px">
<div>
<el-form-item
v-for="item in searchParams"
@ -35,9 +31,7 @@
>
<el-option
v-for="item in item.optionList"
:key="
'serach' + item.keyName + item.value
"
:key="'serach' + item.keyName + item.value"
:label="item.label"
:value="item.value"
>
@ -54,9 +48,7 @@
size="small"
clearable
class="u-item-width-normal"
@change="
(e) => handleChangeCascader(e, item)
"
@change="(e) => handleChangeCascader(e, item)"
>
</el-cascader>
</template>
@ -70,13 +62,7 @@
clearable
>
</el-date-picker>
<span
style="
display: inline-block;
margin: 0 10px;
"
></span
>
<span style="display: inline-block; margin: 0 10px"></span>
<el-date-picker
v-model="item.supValues[1]"
type="date"
@ -101,8 +87,6 @@
</el-date-picker>
</template>
</el-form-item>
</div>
</el-form>
<el-row>
@ -117,17 +101,14 @@
size="small"
class="diy-button--white"
@click="resetSearch"
style="margin-right: 6px;"
style="margin-right: 6px"
>重置</el-button
>
</el-col>
</el-row>
</div>
<div
class="m-table"
:style="{ height: maxTableHeight + 130 + 'px' }"
>
<div class="m-table" :style="{ height: maxTableHeight + 130 + 'px' }">
<div class="u-table-btn1">
<el-button
class="diy-button--blue"
@ -160,9 +141,7 @@
:http-request="uploadHttpRequest"
style="margin-left: 10px"
>
<el-button size="small" class="diy-button--white"
>导入</el-button
>
<el-button size="small" class="diy-button--white">导入</el-button>
</el-upload>
<el-button
@ -206,10 +185,7 @@
:height="maxTableHeight"
@selection-change="handleSelectionChange"
>
<template
v-for="(item, index) in tableParams"
:prop="item.keyName"
>
<template v-for="(item, index) in tableParams" :prop="item.keyName">
<el-table-column
v-if="item.type == 'selection'"
:key="'table-selection' + index"
@ -249,11 +225,7 @@
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
{{
scope.row[item.keyName].join(
item.arrayDiv || ","
)
}}
{{ scope.row[item.keyName].join(item.arrayDiv || ",") }}
</template>
</el-table-column>
</template>
@ -266,10 +238,7 @@
width="200"
>
<template slot-scope="scope">
<slot
name="listBtnbefore"
v-bind:item="scope.row"
></slot>
<slot name="listBtnbefore" v-bind:item="scope.row"></slot>
<el-button
v-if="infoUrl && infoAuth(scope.row)"
@click="handleWatch(scope.row)"
@ -288,27 +257,19 @@
<el-popconfirm
v-if="delUrl && delAuth(scope.row)"
title="删除之后无法回复,确认删除?"
@onConfirm="
handleDelete(scope.row, scope.$index)
"
@confirm="
handleDelete(scope.row, scope.$index)
"
@onConfirm="handleDelete(scope.row, scope.$index)"
@confirm="handleDelete(scope.row, scope.$index)"
>
<el-button
slot="reference"
type="text"
size="small"
style="margin-left: 10px"
>删除</el-button
>
</el-popconfirm>
<slot
name="listBtnSup"
v-bind:item="scope.row"
></slot>
<slot name="listBtnSup" v-bind:item="scope.row"></slot>
</template>
</el-table-column>
</el-table>
@ -507,14 +468,15 @@ export default {
},
data() {
let startDisabledDate = (time) => {//datareturn
let nowData = Date.now()
return time.getTime() > nowData
}
let startDisabledDate = (time) => {
//datareturn
let nowData = Date.now();
return time.getTime() > nowData;
};
return {
tableData: [],
startPickerOptions: {
disabledDate: startDisabledDate
disabledDate: startDisabledDate,
},
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
@ -535,17 +497,13 @@ export default {
maxTableHeight() {
const { ref_search_height } = this;
return this.$store.state.inIframe
? this.clientHeight -
ref_search_height -
290 +
this.iframeHeight
? this.clientHeight - ref_search_height - 290 + this.iframeHeight
: this.clientHeight - ref_search_height - 290;
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {},
async mounted() {
console.log(this.$store.state);
this.user = this.$store.state.user;
@ -643,13 +601,14 @@ export default {
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
message:
"导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000,
});
let than = this;
document.getElementById("clickA").addEventListener("click", function () {
than.$router.replace("/main/importRecord-index");
});
let than = this
document.getElementById('clickA').addEventListener('click',function(){
than.$router.replace('/main/importRecord-index');
})
const formData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); //
@ -684,9 +643,7 @@ export default {
// this.download(res.data, title + '.xls')
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(
res.headers["content-disposition"]
.split(";")[1]
.split("=")[1]
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], {
@ -727,9 +684,7 @@ export default {
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"]
.split(";")[1]
.split("=")[1]
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], {
@ -768,9 +723,7 @@ export default {
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"]
.split(";")[1]
.split("=")[1]
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], {
@ -796,7 +749,7 @@ export default {
this.formType = "add";
this.formTitle = "新增";
this.formShow = true;
this.formId = '';
this.formId = "";
},
handleWatch(row) {
@ -817,7 +770,7 @@ export default {
handleClose() {
this.formShow = false;
this.getTableData();
// this.getTableData();
},
handleEditSuccess() {
@ -936,7 +889,7 @@ export default {
});
}
});
this.getTableData()
this.getTableData();
},
},
};

Loading…
Cancel
Save