|
@@ -154,6 +154,18 @@
|
|
|
icon="el-icon-document" @click="historyReport">运行记录
|
|
|
</el-button>
|
|
|
<el-button type="danger" size="mini" icon="el-icon-circle-close" @click="cancelSaveReport">关闭</el-button>
|
|
|
+ <div style="float: right;" v-if="this.showReportTableType == 1 || this.showReportTableType == 0">
|
|
|
+ <label>频率:</label>
|
|
|
+ <el-select style="width: 90px;" size="mini" placeholder="请选择频率"
|
|
|
+ v-model="reportInterval" @change="reportIntervalChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in reportIntervalOptions"
|
|
|
+ :key="item"
|
|
|
+ :label="item + '秒'"
|
|
|
+ :value="item">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
</el-row>
|
|
|
<el-row v-if="btnType == 'showChild'" style="margin: 10px 20px;">
|
|
|
<el-button type="primary" size="mini" icon="el-icon-download" @click="downloadReport">下载</el-button>
|
|
@@ -740,8 +752,10 @@ export default {
|
|
|
reportPage: 1,
|
|
|
reportLimit: 10,
|
|
|
reportDataList: [],
|
|
|
- reportInterval: 30 * 1000, // 手动报表更新数据频率
|
|
|
+ reportIntervalOptions: [5, 10, 15, 20, 25, 30],
|
|
|
+ reportInterval: 30, // 手动报表更新数据频率
|
|
|
reportIntervalTag: null,
|
|
|
+ showReportTableType: null,
|
|
|
reportRules: {
|
|
|
reportTableName: [
|
|
|
{required: true, message: '请输入报表名称', trigger: 'blur'}
|
|
@@ -837,6 +851,10 @@ export default {
|
|
|
luckysheet.destroy()
|
|
|
},
|
|
|
methods: {
|
|
|
+ reportIntervalChange(val) {
|
|
|
+ this.reportInterval = val
|
|
|
+ this.pollingReportData()
|
|
|
+ },
|
|
|
/** 实现类似刷新效果 */
|
|
|
forceRefreshLuckysheet() {
|
|
|
if (luckysheet) {
|
|
@@ -1512,6 +1530,7 @@ export default {
|
|
|
if (this.searchTxt && this.searchTxt.trim()) {
|
|
|
params.reportTableName = this.searchTxt
|
|
|
}
|
|
|
+ params.isDelete = 0
|
|
|
getAllOkReportTable(params).then(res => {
|
|
|
loading.close()
|
|
|
if (!res || !res.data) {
|
|
@@ -1725,18 +1744,22 @@ export default {
|
|
|
}
|
|
|
this.setLuckysheetStatus(_data, true, type, loading)
|
|
|
// 手动报表,循环查询数据
|
|
|
- if (_data.reportTableType == 0) {
|
|
|
- this.reportIntervalTag = setInterval(() => {
|
|
|
- this.reloadReportNode()
|
|
|
- }, this.reportInterval)
|
|
|
- } else {
|
|
|
- if (this.reportIntervalTag) clearInterval(this.reportIntervalTag)
|
|
|
- }
|
|
|
+ this.showReportTableType = _data.reportTableType
|
|
|
+ this.pollingReportData()
|
|
|
}).catch((e) => {
|
|
|
loading.close()
|
|
|
showAlertWin(this, null, e)
|
|
|
})
|
|
|
},
|
|
|
+ /** 轮询更新报表数据 */
|
|
|
+ pollingReportData() {
|
|
|
+ if (this.reportIntervalTag) clearInterval(this.reportIntervalTag)
|
|
|
+ if (this.showReportTableType == 0 || this.showReportTableType == 1) {
|
|
|
+ this.reportIntervalTag = setInterval(() => {
|
|
|
+ this.reloadReportNode()
|
|
|
+ }, this.reportInterval * 1000)
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 报表reload事件 */
|
|
|
reloadReportNode() {
|
|
|
if (!this.chooseMyReport || !this.chooseMyReport.id) {
|