FinalYu 2 rokov pred
rodič
commit
cbaea7ec02

+ 5 - 2
chuanyi_client2/src/views/group_item/index.vue

@@ -403,12 +403,15 @@ export default {
     editConfirmEvent() {
       const loading = showLoading(this, '加载中,请稍候···')
       // 若驱动报表事件任意一项为空,则清空报表事项
-      if (!this.itemForm.eventMode || !this.itemForm.eventValue || !this.itemForm.tableReportId) {
+      if (!this.itemForm.eventMode
+          || (this.itemForm.eventValue == null || this.itemForm.eventValue < 0)
+          || !this.itemForm.tableReportId) {
         this.itemForm.eventMode = null
         this.itemForm.eventValue = null
         this.itemForm.tableReportId = null
       }
-      updateItem(this.itemForm).then(res => {
+      let params = JSON.parse(JSON.stringify(this.itemForm))
+      updateItem(params).then(res => {
         loading.close()
         let msg = res.data ? '编辑成功!' : '编辑失败!'
         let msgType = res.data ? 'success' : 'error'

+ 1 - 1
chuanyi_client2/src/views/my_report/index.vue

@@ -50,7 +50,7 @@
                 align="center"
                 label="报表状态"
                 prop="isAutoReport"
-                width="180">
+                width="350">
               <template slot-scope="scope">
                 <el-tag v-if="scope.row.userId != uid" type="success" style="margin-right: 5px;">被分享</el-tag>
                 <el-tag v-if="uid == scope.row.userId && scope.row.userGroupList && scope.row.userGroupList.length > 0"

+ 39 - 15
chuanyi_client2/src/views/run_config/index.vue

@@ -51,7 +51,7 @@
                 align="center"
                 label="报表状态"
                 prop="isAutoReport"
-                width="180">
+                width="350">
               <template slot-scope="scope">
                 <el-tag v-if="scope.row.userId != uid" type="success" style="margin-right: 5px;">被分享</el-tag>
                 <el-tag v-if="uid == scope.row.userId && scope.row.userGroupList && scope.row.userGroupList.length > 0"
@@ -62,19 +62,19 @@
                 <el-tag v-if="scope.row.isAutoReport == 3" style="margin-right: 5px;">事件驱动报表</el-tag>
               </template>
             </el-table-column>
-            <el-table-column
-                align="center"
-                label="自动报表"
-                prop="isAutoReport"
-                width="150">
-              <template slot-scope="scope">
-                <el-switch v-if="scope.row.isAutoReport == '2'" :value="true" active-color="#13ce66"
-                           disabled></el-switch>
-                <el-switch v-else :value="scope.row.isAutoReport == '1'" active-color="#13ce66"
-                           @change="switchChangeEvent($event, scope.row)"
-                           :disabled="uid != scope.row.userId"></el-switch>
-              </template>
-            </el-table-column>
+<!--            <el-table-column-->
+<!--                align="center"-->
+<!--                label="自动报表"-->
+<!--                prop="isAutoReport"-->
+<!--                width="150">-->
+<!--              <template slot-scope="scope">-->
+<!--                <el-switch v-if="scope.row.isAutoReport == '2'" :value="true" active-color="#13ce66"-->
+<!--                           disabled></el-switch>-->
+<!--                <el-switch v-else :value="scope.row.isAutoReport == '1'" active-color="#13ce66"-->
+<!--                           @change="switchChangeEvent($event, scope.row)"-->
+<!--                           :disabled="uid != scope.row.userId"></el-switch>-->
+<!--              </template>-->
+<!--            </el-table-column>-->
             <el-table-column
                 align="center"
                 label="当前版本"
@@ -89,7 +89,7 @@
                 prop="createTime"
                 width="200">
             </el-table-column>
-            <el-table-column label="操作" align="center" width="300">
+            <el-table-column label="操作" align="center" width="380">
               <template slot-scope="scope">
                 <el-button type="text"
                            v-if="uid == scope.row.userId"
@@ -100,6 +100,12 @@
                 <el-button type="text"
                            v-if="uid == scope.row.userId"
                            size="small"
+                           icon="el-icon-setting"
+                           @click="setReportStatus(scope.row)">设置报表状态
+                </el-button>
+                <el-button type="text"
+                           v-if="uid == scope.row.userId"
+                           size="small"
                            icon="el-icon-user"
                            @click="setUserGroupEvent(scope.row)">授权
                 </el-button>
@@ -353,6 +359,7 @@
         :append-to-body="true">
       <div style="text-align: center;">
         <el-radio v-model="reportType" label="0">手动报表</el-radio>
+        <el-radio v-model="reportType" label="1">自动报表</el-radio>
         <el-radio v-model="reportType" label="3">事件驱动报表</el-radio>
       </div>
       <span slot='footer'>
@@ -869,6 +876,18 @@ export default {
           type: 'warning'
         })
       }
+      // 自动报表
+      if (this.reportType == '1') {
+        this.resetRadioVal()
+        getReportTableById(this.reportId).then(res => {
+          this.dialogAutoReportVisible = true
+          this.cronVal = res.data.cron
+          this.analysisCron()
+        }).catch((e) => {
+          showAlertWin(this, e)
+        })
+        return
+      }
       const loading = showLoading(this, '请稍候···')
       let params = {
         'id': this.reportId,
@@ -898,6 +917,11 @@ export default {
       }
       this.dialogReportTypeVisible = true
     },
+    setReportStatus(data) {
+      this.reportId = data.id
+      this.reportType = data.isAutoReport + ''
+      this.dialogReportTypeVisible = true
+    },
     /** 新增报表 */
     addReportEvent() {
       this.getAllReportTemplate()