|
@@ -24,12 +24,12 @@
|
|
|
<el-form-item>
|
|
|
<el-popconfirm title="确认更新数据?" @confirm="onSubmitOptimize">
|
|
|
<template #reference>
|
|
|
- <el-button type="primary">提交数据</el-button>
|
|
|
+ <el-button type="primary">修改数据</el-button>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
<el-popconfirm title="确认提交数据?" @confirm="onUploadData">
|
|
|
<template #reference>
|
|
|
- <el-button type="primary">上传数据</el-button>
|
|
|
+ <el-button type="primary">上报数据</el-button>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
</el-form-item>
|
|
@@ -57,7 +57,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { appReportList, appReportUpdate, appReportUpload } from '@/api/portrait';
|
|
|
+import {
|
|
|
+ appReportList,
|
|
|
+ appReportUpdate,
|
|
|
+ appReportUpload
|
|
|
+} from '@/api/portrait';
|
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import 'element-plus/lib/theme-chalk/el-message.css';
|
|
@@ -105,12 +109,19 @@ export default {
|
|
|
clientOnlineUser,
|
|
|
webOnlineUser,
|
|
|
clientAvgDuration
|
|
|
- }).then(() => {
|
|
|
- ElMessage({
|
|
|
- message: '成功',
|
|
|
- type: 'success'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: '成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ ElMessage({
|
|
|
+ message: err.message || '请重试',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}, 200);
|
|
|
},
|
|
|
onUploadData() {
|
|
@@ -129,12 +140,19 @@ export default {
|
|
|
appReportUpload({
|
|
|
id,
|
|
|
loginName: userinfo.loginname || ''
|
|
|
- }).then(() => {
|
|
|
- ElMessage({
|
|
|
- message: '成功',
|
|
|
- type: 'success'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: '成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ ElMessage({
|
|
|
+ message: err.message || '请重试',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}, 200);
|
|
|
}
|
|
|
},
|