zhaowei
2 天以前 57fdca64e4e6d2573f116917b87c4c9155053c23
src/views/system/modules/QuartzJobListModal.vue
@@ -10,20 +10,21 @@
            <a-col :md="6" :sm="6">
              <a-form-item label="任务名称">
                <a-input placeholder="请输入任务名称" v-model="queryParam.jobClassName"></a-input>
                <a-input placeholder="请输入任务名称" v-model="queryParam.jobName"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYY-MM-DD HH:mm:ss" v-model="dates"/>
                <a-range-picker show-time @change="dateParamChange" :disabledDate="disabledDate" format="YYYY-MM-DD HH:mm:ss" v-model="dates"/>
              </a-form-item>
            </a-col>
            <a-col :md="2" :sm="2">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            </a-col>
            <a-col :md="2" :sm="2">
              <a-button type="primary" icon="download" @click="handleExportXls('执行日志导出')">导出</a-button>
            <a-col :md="4" :sm="4">
              <a-space>
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                <a-button type="primary" icon="download" @click="handleExportXls('执行日志导出')">导出</a-button>
              </a-space>
            </a-col>
          </a-row>
        </a-form>
@@ -44,9 +45,7 @@
            <a-tag v-if="isSuccess==-1" color="red">失败</a-tag>
          </template>
          <span slot="action" slot-scope="text, record">
             <a v-if="record.isSuccess == -1" @click="executeImmediately(record)">查看详情</a>
             <a @click="executeImmediately(record)">查看详情</a>
        </span>
        </a-table>
      </div>
@@ -137,6 +136,7 @@
        superQueryParams: '',
        /** 高级查询拼接方式 */
        superQueryMatchType: 'and',
        columns: [
          {
            title: '#',
@@ -148,29 +148,29 @@
              return parseInt(index) + 1;
            }
          },
          // {
          //   title: '任务名称',
          //   align: 'center',
          //   dataIndex: 'jobClassName',
          // },
          // {
          //   title: 'cron表达式',
          //   align: 'center',
          //   dataIndex: 'cronExpression',
          // },
          {
            title: '任务名称',
            align: 'center',
            dataIndex: 'jobClassName',
          },
          {
            title: 'cron表达式',
            align: 'center',
            dataIndex: 'cronExpression',
            dataIndex: 'jobName'
          },
          {
            title: '参数',
            align: 'center',
            dataIndex: 'parameter'
          },
          {
            title: '描述',
            align: 'center',
            dataIndex: 'description'
          },
          {
            title: '报错信息',
            title: '日志信息',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
@@ -190,10 +190,33 @@
            title: '执行时间(毫秒)',
            align: 'center',
            dataIndex: 'executionTime',
            customRender:(t,r,index) =>{
              var milliseconds = parseInt(t)
                let hours = Math.floor(milliseconds / 3600000);
                milliseconds = milliseconds % 3600000;
                let minutes = Math.floor(milliseconds / 60000);
                milliseconds = milliseconds % 60000;
                let seconds = Math.floor(milliseconds / 1000);
                milliseconds = milliseconds % 1000;
                if(hours == 0){
                  if(minutes == 0){
                    if(seconds == 0) {
                      return `${milliseconds}毫秒`
                    }else{
                      return `${seconds}秒 ${milliseconds}毫秒`
                    }
                  }else{
                    return `${minutes}分钟 ${seconds}秒 ${milliseconds}毫秒`;
                  }
                }else{
                  return `${hours}小时 ${minutes}分钟 ${seconds}秒 ${milliseconds}毫秒`;
                }
            }
          },
          {
            title: '创建时间',
            title: '任务执行时间',
            align: 'center',
            dataIndex: 'createTime'
          },
@@ -216,9 +239,16 @@
    },
    methods: {
      searchReset() {
        let id =  this.queryParam.jobId
        this.queryParam = {}
        this.dates = []
        this.queryParam.jobId = id
        this.loadData(1);
      },
      executeImmediately:function (record) {
        this.$refs.modalForm.showDetails(record);
        this.$refs.modalForm.title = "报错信息";
        this.$refs.modalForm.title = "日志信息";
        this.$refs.modalForm.disableSubmit = false;
      },
      handleExportXls(fileName){
@@ -290,6 +320,9 @@
        param.field = this.getQueryField();
        param.pageNo = this.ipagination.current;
        param.pageSize = this.ipagination.pageSize;
        param.jobId = this.queryParam.jobId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        //获取用户定制的参数属性
        // if (this.getCustomQueryParams) {
        //   param = this.getCustomQueryParams(param);
@@ -338,7 +371,11 @@
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false