|
@@ -12,6 +12,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
<el-button v-if="btnType != 'show'" type="primary" class="cy-nav-btn" icon="el-icon-circle-plus-outline"
|
|
<el-button v-if="btnType != 'show'" type="primary" class="cy-nav-btn" icon="el-icon-circle-plus-outline"
|
|
size="mini" @click="addReportEvent">新增</el-button>
|
|
size="mini" @click="addReportEvent">新增</el-button>
|
|
|
|
+ <el-button v-if="btnType != 'show'" type="success" class="cy-nav-btn" icon="el-icon-refresh"
|
|
|
|
+ size="mini" @click="refreshReportEvent">刷新</el-button>
|
|
<el-divider></el-divider>
|
|
<el-divider></el-divider>
|
|
<div class="cy-main">
|
|
<div class="cy-main">
|
|
<div class="cy-main-left" v-if="!showMainView">
|
|
<div class="cy-main-left" v-if="!showMainView">
|
|
@@ -19,8 +21,11 @@
|
|
<ul v-if="reportDataList.length > 0">
|
|
<ul v-if="reportDataList.length > 0">
|
|
<li v-for="item in reportDataList">
|
|
<li v-for="item in reportDataList">
|
|
<i v-if="uid == item.userId" class="el-icon-delete"
|
|
<i v-if="uid == item.userId" class="el-icon-delete"
|
|
- style="float: right; margin-top: -10px; margin-right: -10px; cursor: pointer;"
|
|
|
|
|
|
+ style="float: right; cursor: pointer;"
|
|
@click="removeReportItem(item)"></i>
|
|
@click="removeReportItem(item)"></i>
|
|
|
|
+ <i v-if="uid == item.userId" class="el-icon-edit"
|
|
|
|
+ style="float: right; cursor: pointer; margin-right: 10px; margin-left: 10px;"
|
|
|
|
+ @click="editReportItem(item)"></i>
|
|
<div class="cy-item-name" @click="handleReportNodeClick(item)" :title="item.reportTableName">{{ item.reportTableName }}</div>
|
|
<div class="cy-item-name" @click="handleReportNodeClick(item)" :title="item.reportTableName">{{ item.reportTableName }}</div>
|
|
<div style="display: flex; float: left; cursor: pointer;"
|
|
<div style="display: flex; float: left; cursor: pointer;"
|
|
@click="setUserGroupEvent(item)" v-if="uid == item.userId">
|
|
@click="setUserGroupEvent(item)" v-if="uid == item.userId">
|
|
@@ -34,7 +39,18 @@
|
|
<el-switch v-else :value="item.isAutoReport == '1'" active-color="#13ce66"
|
|
<el-switch v-else :value="item.isAutoReport == '1'" active-color="#13ce66"
|
|
@change="switchChangeEvent($event, item)" :disabled="uid != item.userId"></el-switch>
|
|
@change="switchChangeEvent($event, item)" :disabled="uid != item.userId"></el-switch>
|
|
</div>
|
|
</div>
|
|
- <div class="cy-list-item">{{ item.createTime }}</div>
|
|
|
|
|
|
+ <div class="cy-list-item">
|
|
|
|
+ <div style="display: inline-block;" title="定时任务表达式">
|
|
|
|
+ <template v-if="item.cron">
|
|
|
|
+ <i class="el-icon-bell"></i>
|
|
|
|
+ <span style="margin-left: 5px;">{{ item.cron }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ <div title="创建时间">
|
|
|
|
+ <i class="el-icon-alarm-clock"></i>
|
|
|
|
+ <span style="margin-left: 5px;">{{ item.createTime }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
<el-empty v-else description="暂无数据"></el-empty>
|
|
<el-empty v-else description="暂无数据"></el-empty>
|
|
@@ -188,7 +204,7 @@ import {
|
|
getAllReportTable,
|
|
getAllReportTable,
|
|
getAllTableTemplate, getChartData,
|
|
getAllTableTemplate, getChartData,
|
|
getDataModelById, getReportTableById, getTableData,
|
|
getDataModelById, getReportTableById, getTableData,
|
|
- getTableTemplateById, saveReport, tableAssignUserById, tableExchangeTypeById
|
|
|
|
|
|
+ getTableTemplateById, saveReport, tableAssignUserById, tableExchangeTypeById, updateTableNameById
|
|
} from '@/api/datasource'
|
|
} from '@/api/datasource'
|
|
import {insertEChart} from 'luckytool'
|
|
import {insertEChart} from 'luckytool'
|
|
// import {insertEChart, exportExcel, packtable} from 'luckytool'
|
|
// import {insertEChart, exportExcel, packtable} from 'luckytool'
|
|
@@ -360,6 +376,11 @@ export default {
|
|
this.getAllReportTemplate()
|
|
this.getAllReportTemplate()
|
|
this.dialogReportTemplateVisible = true
|
|
this.dialogReportTemplateVisible = true
|
|
},
|
|
},
|
|
|
|
+ /** 刷新报表 */
|
|
|
|
+ refreshReportEvent() {
|
|
|
|
+ this.reportPage = 1
|
|
|
|
+ this.loadReport()
|
|
|
|
+ },
|
|
/** 模版报表选择 */
|
|
/** 模版报表选择 */
|
|
chooseReportEvent() {
|
|
chooseReportEvent() {
|
|
this.$refs['reportForm'].validate((valid) => {
|
|
this.$refs['reportForm'].validate((valid) => {
|
|
@@ -862,6 +883,50 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ /** 修改报表信息 */
|
|
|
|
+ editReportItem(data) {
|
|
|
|
+ this.$prompt('请输入报表名称', '保存', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ inputValue: data.reportTableName,
|
|
|
|
+ customClass: 'close_confirm',
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
+ inputValidator: (val) => {
|
|
|
|
+ if (!val || !val.trim()) {
|
|
|
|
+ return '报表名称不能为空'
|
|
|
|
+ }
|
|
|
|
+ if (val.length > 20) {
|
|
|
|
+ return '报表名称必须在20字以内'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }).then(({value}) => {
|
|
|
|
+ const loading = showLoading(this, '修改中,请稍候···')
|
|
|
|
+ let params = {
|
|
|
|
+ 'id': data.id,
|
|
|
|
+ 'reportTableName': value
|
|
|
|
+ }
|
|
|
|
+ updateTableNameById(params).then(res => {
|
|
|
|
+ loading.close()
|
|
|
|
+ let msg = res.data ? '修改成功!' : '修改失败!'
|
|
|
|
+ let msgType = res.data ? 'success' : 'warning'
|
|
|
|
+ this.$message({
|
|
|
|
+ message: msg,
|
|
|
|
+ type: msgType
|
|
|
|
+ })
|
|
|
|
+ this.reportPage = 1
|
|
|
|
+ this.loadReport()
|
|
|
|
+ }).catch((e) => {
|
|
|
|
+ loading.close()
|
|
|
|
+ this.$alert(e, '操作失败!', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ callback: action => {
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }).catch((e) => {
|
|
|
|
+ console.log(e)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
/** 报表移除 */
|
|
/** 报表移除 */
|
|
removeReportItem(data) {
|
|
removeReportItem(data) {
|
|
this.$confirm('您确定要删除该报表吗?', '温馨提示', {
|
|
this.$confirm('您确定要删除该报表吗?', '温馨提示', {
|
|
@@ -1149,7 +1214,6 @@ export default {
|
|
this.cronList.push({ value: '0 0/30 9-17 * * ?', label: '表示在每天的上午9点到下午5点的范围内每30分钟执行一次任务' })
|
|
this.cronList.push({ value: '0 0/30 9-17 * * ?', label: '表示在每天的上午9点到下午5点的范围内每30分钟执行一次任务' })
|
|
this.cronList.push({ value: '0 0 12 ? * WED', label: '表示在每周星期三中午12点执行一次任务' })
|
|
this.cronList.push({ value: '0 0 12 ? * WED', label: '表示在每周星期三中午12点执行一次任务' })
|
|
this.cronList.push({ value: '0 0 2 1 * ?', label: '表示在每月的1日的凌晨2点执行一次任务' })
|
|
this.cronList.push({ value: '0 0 2 1 * ?', label: '表示在每月的1日的凌晨2点执行一次任务' })
|
|
- this.cronList.push({ value: '0 15 10 * * ? 2023', label: '表示在2023年每天上午10点15分执行一次任务' })
|
|
|
|
},
|
|
},
|
|
/** 取消保存报表 */
|
|
/** 取消保存报表 */
|
|
cancelSaveReport() {
|
|
cancelSaveReport() {
|
|
@@ -1233,7 +1297,7 @@ export default {
|
|
width: 23%;
|
|
width: 23%;
|
|
margin: 10px 1%;
|
|
margin: 10px 1%;
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
- height: 90px;
|
|
|
|
|
|
+ height: 110px;
|
|
padding: 15px;
|
|
padding: 15px;
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
|
|
|
|
@@ -1254,7 +1318,8 @@ export default {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
color: #f6f6f6;
|
|
color: #f6f6f6;
|
|
width: 100%;
|
|
width: 100%;
|
|
- display: flex;
|
|
|
|
|
|
+ //display: flex;
|
|
|
|
+ margin-top: 40px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|