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

Loading…
Cancel
Save