From e817cabe45b7546e921d21aba3ab74cd04190a8d Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 02 一月 2025 15:57:21 +0800 Subject: [PATCH] 1、定时任务页面新增查看日志功能 2、部门管理页面调整字段 --- src/views/system/DepartList.vue | 66 ++-- src/views/system/modules/DepartModal.vue | 88 +++--- src/views/system/QuartzJobList.vue | 82 ++++- src/views/system/modules/QuartzJobListModal.vue | 422 ++++++++++++++++++++++++++++++++ src/views/system/modules/QuartzJobDetails.vue | 75 +++++ 5 files changed, 633 insertions(+), 100 deletions(-) diff --git a/src/views/system/DepartList.vue b/src/views/system/DepartList.vue index c11def5..1545593 100644 --- a/src/views/system/DepartList.vue +++ b/src/views/system/DepartList.vue @@ -88,40 +88,40 @@ placeholder="鏃�"> </a-tree-select> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCode" label="鏈烘瀯缂栫爜"> - <a-input disabled placeholder="璇疯緭鍏ユ満鏋勭紪鐮�" v-model="model.orgCode" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCategory" label="鏈烘瀯绫诲瀷"> - <template v-if="orgCategoryDisabled"> - <a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷"> - <a-radio value="1"> - 鍏徃 - </a-radio> - </a-radio-group> - </template> - <template v-else> - <a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷"> - <a-radio value="2"> - 閮ㄩ棬 - </a-radio> - <a-radio value="3"> - 宀椾綅 - </a-radio> - </a-radio-group> - </template> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="閮ㄩ棬璐熻矗浜�"> - <j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user> - </a-form-model-item> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCode" label="鏈烘瀯缂栫爜">--> + <!--<a-input disabled placeholder="璇疯緭鍏ユ満鏋勭紪鐮�" v-model="model.orgCode" />--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orgCategory" label="鏈烘瀯绫诲瀷">--> + <!--<template v-if="orgCategoryDisabled">--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="1">--> + <!--鍏徃--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--<template v-else>--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="2">--> + <!--閮ㄩ棬--> + <!--</a-radio>--> + <!--<a-radio value="3">--> + <!--宀椾綅--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="閮ㄩ棬璐熻矗浜�">--> + <!--<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>--> + <!--</a-form-model-item>--> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎺掑簭"> <a-input-number v-model="model.departOrder" /> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎵嬫満鍙�" prop="mobile"> - <a-input placeholder="璇疯緭鍏ユ墜鏈哄彿" v-model="model.mobile" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍦板潃"> - <a-input placeholder="璇疯緭鍏ュ湴鍧�" v-model="model.address"/> - </a-form-model-item> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎵嬫満鍙�" prop="mobile">--> + <!--<a-input placeholder="璇疯緭鍏ユ墜鏈哄彿" v-model="model.mobile" />--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍦板潃">--> + <!--<a-input placeholder="璇疯緭鍏ュ湴鍧�" v-model="model.address"/>--> + <!--</a-form-model-item>--> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="澶囨敞"> <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.memo"/> </a-form-model-item> @@ -445,7 +445,7 @@ //update-begin---author:wangshuai ---date:20200308 for锛歔JTC-119]鍦ㄩ儴闂ㄧ鐞嗚彍鍗曚笅璁剧疆閮ㄩ棬璐熻矗浜� this.currSelected.oldDirectorUserIds = this.oldDirectorUserIds //update-end---author:wangshuai ---date:20200308 for锛歔JTC-119]鍦ㄩ儴闂ㄧ鐞嗚彍鍗曚笅璁剧疆閮ㄩ棬璐熻矗浜� - + httpAction(this.url.edit, this.currSelected, 'put').then((res) => { if (res.success) { this.$message.success('淇濆瓨鎴愬姛!') @@ -565,7 +565,7 @@ } } //---- author:os_chengtgen -- date:20190827 -- for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------ - + }, created() { this.currFlowId = this.$route.params.id diff --git a/src/views/system/QuartzJobList.vue b/src/views/system/QuartzJobList.vue index 3e15fde..3f6c98a 100644 --- a/src/views/system/QuartzJobList.vue +++ b/src/views/system/QuartzJobList.vue @@ -7,13 +7,13 @@ <a-row :gutter="24"> <a-col :md="6" :sm="10"> - <a-form-model-item label="浠诲姟绫诲悕" prop="jobClassName"> - <a-input placeholder="璇疯緭鍏ヤ换鍔$被鍚�" v-model="queryParam.jobClassName"></a-input> + <a-form-model-item label="浠诲姟鍚嶇О" prop="jobClassName"> + <a-input placeholder="璇疯緭鍏ヤ换鍔″悕绉�" v-model="queryParam.jobName"></a-input> </a-form-model-item> </a-col> <a-col :md="6" :sm="10"> <a-form-model-item label="浠诲姟鐘舵��" prop="status"> - <a-select style="width: 220px" v-model="queryParam.status" placeholder="璇烽�夋嫨鐘舵��"> + <a-select style="width: 100%" v-model="queryParam.status" placeholder="璇烽�夋嫨鐘舵��"> <a-select-option value="">鍏ㄩ儴</a-select-option> <a-select-option value="0">姝e父</a-select-option> <a-select-option value="-1">鍋滄</a-select-option> @@ -64,7 +64,6 @@ :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" - :scroll="{x:true}" @change="handleTableChange"> <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず--> @@ -77,14 +76,19 @@ <span slot="action" slot-scope="text, record"> - <a @click="resumeJob(record)" v-if="record.status==-1">鍚姩</a> - <a @click="pauseJob(record)" v-if="record.status==0">鍋滄</a> + <a @click="executeImmediately(record)">绔嬪嵆鎵ц</a> <a-divider type="vertical" /> + <a @click="handlequartzLog(record)">鏃ュ織</a> + <a-divider type="vertical" /> <a-dropdown> <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> <a-menu slot="overlay"> - <a-menu-item><a @click="executeImmediately(record)">鎵ц涓�娆�</a></a-menu-item> + <a-menu-item> + <a @click="resumeJob(record)" v-if="record.status==-1">鍚姩</a> + <a @click="pauseJob(record)" v-if="record.status==0">鍋滄</a> + + </a-menu-item> <a-menu-item><a @click="handleEdit(record)">缂栬緫</a></a-menu-item> <a-menu-item> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> @@ -106,11 +110,15 @@ <!-- 琛ㄥ崟鍖哄煙 --> <quartzJob-modal ref="modalForm" @ok="modalFormOk"></quartzJob-modal> + + <!--鏃ュ織--> + <quartz-job-list-modal ref="modalFormList" @ok="modalFormOk"></quartz-job-list-modal> </a-card> </template> <script> import QuartzJobModal from './modules/QuartzJobModal' + import QuartzJobListModal from './modules/QuartzJobListModal' import { getAction } from '@/api/manage' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import JEllipsis from "@/components/jeecg/JEllipsis"; @@ -120,6 +128,7 @@ mixins:[JeecgListMixin], components: { QuartzJobModal, + QuartzJobListModal, JEllipsis }, data () { @@ -140,13 +149,13 @@ } }, { - title: '浠诲姟绫诲悕', + title: '浠诲姟鍚嶇О', align:"center", - dataIndex: 'jobClassName', + dataIndex: 'jobName', sorter: true, -/* customRender:function (text) { - return "*"+text.substring(9,text.length); - }*/ + /* customRender:function (text) { + return "*"+text.substring(9,text.length); + }*/ }, { title: 'cron琛ㄨ揪寮�', @@ -161,9 +170,8 @@ scopedSlots: {customRender: 'parameterRender'}, }, { - title: '鎻忚堪', + title: '璇存槑', align:"center", - width: 250, dataIndex: 'description', scopedSlots: {customRender: 'description'}, }, @@ -186,7 +194,7 @@ scopedSlots: { customRender: 'action' }, } ], - url: { + url: { list: "/sys/quartzJob/list", delete: "/sys/quartzJob/delete", deleteBatch: "/sys/quartzJob/deleteBatch", @@ -205,7 +213,11 @@ }, methods: { - + handlequartzLog: function (record) { + this.$refs.modalFormList.openPage(record); + this.$refs.modalFormList.title = "鎵ц鏃ュ織"; + this.$refs.modalFormList.disableSubmit = false; + }, //绛涢�夐渶瑕侀噸鍐檋andleTableChange handleTableChange(pagination, filters, sorter) { //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 @@ -215,7 +227,7 @@ this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" } //杩欑绛涢�夋柟寮忓彧鏀寔鍗曢�� - + // update-begin-author:liusq date:20210624 for:鍓嶅彴瀹氭椂浠诲姟鏃犳硶缈婚〉 #2666 if(filters && Object.keys(filters).length>0 && filters.status){ this.filters.status = filters.status[0]; @@ -233,11 +245,19 @@ onOk: function(){ getAction(that.url.pause,{id:record.id}).then((res)=>{ if(res.success){ - that.$message.success(res.message); + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); that.loadData(); that.onClearSelected(); }else{ - that.$message.warning(res.message); + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); } }); } @@ -253,11 +273,19 @@ onOk: function(){ getAction(that.url.resume,{id:record.id}).then((res)=>{ if(res.success){ - that.$message.success(res.message); + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); that.loadData(); that.onClearSelected(); }else{ - that.$message.warning(res.message); + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); } }); } @@ -272,11 +300,19 @@ onOk: function(){ getAction(that.url.execute,{id:record.id}).then((res)=>{ if(res.success){ - that.$message.success(res.message); + // that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); that.loadData(); that.onClearSelected(); }else{ - that.$message.warning(res.message); + // that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); } }); } diff --git a/src/views/system/modules/DepartModal.vue b/src/views/system/modules/DepartModal.vue index 8c8385a..c0cd52e 100644 --- a/src/views/system/modules/DepartModal.vue +++ b/src/views/system/modules/DepartModal.vue @@ -31,50 +31,50 @@ :disabled="condition"> </a-tree-select> </a-form-model-item> - <a-form-model-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鏈烘瀯绫诲瀷"> - <template v-if="seen"> - <a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷"> - <a-radio value="1"> - 鍏徃 - </a-radio> - </a-radio-group> - </template> - <template v-else> - <a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷"> - <a-radio value="2"> - 閮ㄩ棬 - </a-radio> - <a-radio value="3"> - 宀椾綅 - </a-radio> - </a-radio-group> - </template> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="閮ㄩ棬璐熻矗浜�"> - <j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user> - </a-form-model-item> - <a-form-model-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="mobile" - label="鐢佃瘽"> - <a-input placeholder="璇疯緭鍏ョ數璇�" v-model="model.mobile"/> - </a-form-model-item> - <a-form-model-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="浼犵湡"> - <a-input placeholder="璇疯緭鍏ヤ紶鐪�" v-model="model.fax"/> - </a-form-model-item> - <a-form-model-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="鍦板潃"> - <a-input placeholder="璇疯緭鍏ュ湴鍧�" v-model="model.address"/> - </a-form-model-item> + <!--<a-form-model-item--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--label="鏈烘瀯绫诲瀷">--> + <!--<template v-if="seen">--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="1">--> + <!--鍏徃--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--<template v-else>--> + <!--<a-radio-group v-model="model.orgCategory" placeholder="璇烽�夋嫨鏈烘瀯绫诲瀷">--> + <!--<a-radio value="2">--> + <!--閮ㄩ棬--> + <!--</a-radio>--> + <!--<a-radio value="3">--> + <!--宀椾綅--> + <!--</a-radio>--> + <!--</a-radio-group>--> + <!--</template>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="閮ㄩ棬璐熻矗浜�">--> + <!--<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="mobile"--> + <!--label="鐢佃瘽">--> + <!--<a-input placeholder="璇疯緭鍏ョ數璇�" v-model="model.mobile"/>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--label="浼犵湡">--> + <!--<a-input placeholder="璇疯緭鍏ヤ紶鐪�" v-model="model.fax"/>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--label="鍦板潃">--> + <!--<a-input placeholder="璇疯緭鍏ュ湴鍧�" v-model="model.address"/>--> + <!--</a-form-model-item>--> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" diff --git a/src/views/system/modules/QuartzJobDetails.vue b/src/views/system/modules/QuartzJobDetails.vue new file mode 100644 index 0000000..d96e548 --- /dev/null +++ b/src/views/system/modules/QuartzJobDetails.vue @@ -0,0 +1,75 @@ + +<template> + <a-modal :title="title" width="100%" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <a-card :bordered="false"> + <div> + <pre> + {{textContent}} + </pre> + + </div> + </a-card> + </a-modal> +</template> + +<script> + + + export default { + name: 'QuartzJobDetails', + // mixins: [JeecgListMixin], + components: { + + }, + props: { + + }, + data() { + return { + title:'', + visible:false, + textContent:'', + + } + }, + created() { + + }, + watch: { + + }, + methods: { + showDetails(record){ + // console.log(record) + this.visible = true + this.textContent = record.exceptionDetail + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + this.close() + }, + }, + } +</script> +<style> + @import '~@assets/less/common.less'; + + .frozenRowClass { + color: #c9c9c9; + } + + .success { + color: green; + } + + .error { + color: red; + } +</style> diff --git a/src/views/system/modules/QuartzJobListModal.vue b/src/views/system/modules/QuartzJobListModal.vue new file mode 100644 index 0000000..6bb459b --- /dev/null +++ b/src/views/system/modules/QuartzJobListModal.vue @@ -0,0 +1,422 @@ + +<template> + <a-modal :title="title" width="100%" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" + cancelText="鍏抽棴"> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + + <a-col :md="6" :sm="6"> + <a-form-item label="浠诲姟鍚嶇О"> + <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 show-time @change="dateParamChange" :disabledDate="disabledDate" format="YYYY-MM-DD HH:mm:ss" v-model="dates"/> + </a-form-item> + </a-col> + <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> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + + <!--<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>--> + </div> + <!-- table鍖哄煙-begin --> + <div> + <a-table ref="table" size="middle" bordered rowKey="index" :scroll="{聽 y: 400聽}" :columns="columns" + :dataSource="dataSource" :pagination="ipagination" :loading="loading" + @change="handleTableChange"> + <!-- 鐘舵�佹覆鏌撴ā鏉� --> + <template slot="customRenderStatus" slot-scope="isSuccess"> + <a-tag v-if="isSuccess==0" color="green">鎴愬姛</a-tag> + <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> + + </span> + </a-table> + </div> + <!-- table鍖哄煙-end --> + <quartz-job-details ref="modalForm"></quartz-job-details> + + </a-card> + </a-modal> +</template> + +<script> + import { filterObj } from '@/utils/util'; + import { + ajaxGetSelectItems + } from '@/api/api' + import JDictSelectTag from '@/components/dict/JDictSelectTag' + import { + deleteAction, + requestPut, + getAction, + downFile, + postAction + } from '@/api/manage' + import { + JeecgListMixin + } from '@/mixins/JeecgListMixin' + import JInput from '@/components/jeecg/JInput' + import JEllipsis from '@/components/jeecg/JEllipsis' + import Tooltip from 'ant-design-vue/es/tooltip' + import JDate from '@/components/jeecg/JDate' + import moment from 'moment' + import QuartzJobDetails from './QuartzJobDetails' + export default { + name: 'QuartzJobListModal', + // mixins: [JeecgListMixin], + components: { + JDictSelectTag, + JEllipsis, + JInput, + Tooltip, + JDate, + QuartzJobDetails + }, + props: { + status: { + type: Number, + default: 1 + } + }, + data() { + return { + title:'', + visible:false, + /* 鏌ヨ鏉′欢-璇蜂笉瑕佸湪queryParam涓0鏄庨潪瀛楃涓插�肩殑灞炴�� */ + queryParam: {}, + /* 鏁版嵁婧� */ + dataSource:[], + /* 鍒嗛〉鍙傛暟 */ + ipagination:{ + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + /* 鎺掑簭鍙傛暟 */ + isorter:{ + column: 'createTime', + order: 'desc', + }, + /* 绛涢�夊弬鏁� */ + filters: {}, + /* table鍔犺浇鐘舵�� */ + loading:false, + /* table閫変腑keys*/ + selectedRowKeys: [], + /* table閫変腑records*/ + selectionRows: [], + /* 鏌ヨ鎶樺彔 */ + toggleSearchStatus:false, + /* 楂樼骇鏌ヨ鏉′欢鐢熸晥鐘舵�� */ + superQueryFlag:false, + /* 楂樼骇鏌ヨ鏉′欢 */ + superQueryParams: '', + /** 楂樼骇鏌ヨ鎷兼帴鏂瑰紡 */ + superQueryMatchType: 'and', + + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + // { + // title: '浠诲姟鍚嶇О', + // align: 'center', + // dataIndex: 'jobClassName', + // }, + // { + // title: 'cron琛ㄨ揪寮�', + // align: 'center', + // dataIndex: 'cronExpression', + // }, + { + title: '浠诲姟鍚嶇О', + align: 'center', + dataIndex: 'jobName' + }, + { + title: '鍙傛暟', + align: 'center', + dataIndex: 'parameter' + }, + + { + title: '鎶ラ敊淇℃伅', + dataIndex: 'action', + align:"center", + scopedSlots: { customRender: 'action' }, + }, + { + title: '鎴愬姛鏍囧織', + align: 'center', + dataIndex: 'isSuccess', + scopedSlots: { customRender: 'customRenderStatus' }, + filterMultiple: false, + filters: [ + { text: '鎴愬姛', value: '0' }, + { text: '澶辫触', value: '-1' }, + ] + }, + { + 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: '浠诲姟鎵ц鏃堕棿', + align: 'center', + dataIndex: 'createTime' + }, + ], + sectionPData: [], + sectionData: [], + url: { + list: '/sys/quartzLog/list', + exportXlsUrl:'/sys/quartzLog/exportXls' + }, + value:undefined, + valueProduct:undefined, + dates: [], + } + }, + created() { + + }, + watch: { + + }, + 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.disableSubmit = false; + }, + handleExportXls(fileName){ + if(!fileName || typeof fileName != "string"){ + fileName = "瀵煎嚭鏂囦欢" + } + let param = this.getQueryParams(); + if(this.selectedRowKeys && this.selectedRowKeys.length>0){ + param['selections'] = this.selectedRowKeys.join(",") + } + console.log("瀵煎嚭鍙傛暟",param) + downFile(this.url.exportXlsUrl,param).then((data)=>{ + if (!data) { + this.$message.warning("鏂囦欢涓嬭浇澶辫触") + return + } + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') + }else{ + let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName+'.xls') + document.body.appendChild(link) + link.click() + document.body.removeChild(link); //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url); //閲婃斁鎺塨lob瀵硅薄 + } + }) + }, + disabledDate(current) { + return current && current > moment().subtract('days', 1); + }, + dateParamChange(v1, v2) { + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] + }, + handleTableChange(pagination, filters, sorter) { + // this.onClearSelected() + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //TODO 绛涢�� + console.log(pagination) + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field; + this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" + } + this.ipagination = pagination; + this.loadData(); + }, + openPage(record) { + // console.log(record) + this.visible = true + this.dataSource = []; + this.queryParam = { + jobId: record.id + }; + + this.loadData(); + }, + getQueryParams() { + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if(this.superQueryParams){ + sqp['superQueryParams']=encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters); + 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); + // if(!param){ + // return false; + // } + // } + + return filterObj(param); + }, + getQueryField() { + //TODO 瀛楁鏉冮檺鎺у埗 + var str = "id,"; + this.columns.forEach(function (value) { + str += "," + value.dataIndex; + }); + return str; + }, + loadData(arg) { + if(!this.url.list){ + this.$message.error("璇疯缃畊rl.list灞炴��!") + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + + if(!params){ + return false; + } + + this.loading = true; + // params.id = this.queryParam.id + getAction(this.url.list, params).then((res) => { + if (res.success) { + // console.log(res) + //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + }else{ + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ + }else{ + // this.$message.warning(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + this.loading = false + }) + }, + modalFormOk(val) { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData(); + + this.selectedRowKeys = [val.id]; + }, + searchQuery() { + this.loadData(); + }, + close() { + this.$emit('close') + this.visible = false + }, + handleCancel() { + this.close() + }, + handleOk() { + this.close() + }, + }, + } +</script> +<style> + @import '~@assets/less/common.less'; + + .frozenRowClass { + color: #c9c9c9; + } + + .success { + color: green; + } + + .error { + color: red; + } +</style> -- Gitblit v1.9.3