From e4e076e6707f557a70264a06c1e57e67b753a224 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 13 十一月 2024 11:54:26 +0800 Subject: [PATCH] 1、定时任务页面增加字段 2、全局项目有关名称改为中国航发成发以及调整logo --- src/assets/logo.png | 0 src/components/tools/UserMenu.vue | 50 +- vue.config.js | 1 public/index.html | 4 src/components/tools/Logo.vue | 6 src/views/user/Login.vue | 4 src/views/system/WorkshopSignageManagement.vue | 535 +++++++++++++++++++++ src/views/system/QuartzJobList.vue | 82 ++ src/views/system/modules/SelectDeviceDrawer.vue | 1 public/logo.png | 0 src/views/system/modules/QuartzJobListModal.vue | 422 ++++++++++++++++ src/views/system/modules/QuartzJobDetails.vue | 75 +++ src/components/page/GlobalHeader.vue | 41 + src/components/layouts/TabLayout.vue | 2 src/views/system/modules/QuartzJobModal.vue | 103 ++-- src/views/system/modules/WorkshopModal.vue | 144 +++++ 16 files changed, 1,362 insertions(+), 108 deletions(-) diff --git a/public/index.html b/public/index.html index a58c86b..2740535 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> - <title>JeecgBoot 浼佷笟绾т綆浠g爜骞冲彴</title> + <title>涓浗鑸彂鎴愬彂</title> <link rel="icon" href="<%= BASE_URL %>logo.png"> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <style> @@ -249,7 +249,7 @@ <div id="loader"></div> <div class="loader-section section-left"></div> <div class="loader-section section-right"></div> - <div class="load_title">姝e湪鍔犺浇 JeecgBoot 浣庝唬鐮佸钩鍙�,璇疯�愬績绛夊緟 + <div class="load_title">姝e湪鍔犺浇涓浗鑸彂鎴愬彂绠$悊绯荤粺,璇疯�愬績绛夊緟 </div> </div> diff --git a/public/logo.png b/public/logo.png index 1c356e3..6f4fef4 100644 --- a/public/logo.png +++ b/public/logo.png Binary files differ diff --git a/src/assets/logo.png b/src/assets/logo.png index 1c356e3..6f4fef4 100644 --- a/src/assets/logo.png +++ b/src/assets/logo.png Binary files differ diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index 4249c19..8197cff 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -183,7 +183,7 @@ * @param title 瑕佷慨鏀圭殑鏂版爣棰� */ changeTitle(title) { - let projectTitle = "Jeecg-Boot 浼佷笟绾т綆浠g爜骞冲彴" + let projectTitle = "涓浗鑸彂鎴愬彂" // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { document.title = projectTitle diff --git a/src/components/page/GlobalHeader.vue b/src/components/page/GlobalHeader.vue index 4463912..8223270 100644 --- a/src/components/page/GlobalHeader.vue +++ b/src/components/page/GlobalHeader.vue @@ -17,8 +17,8 @@ :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="toggle"/> - <span v-if="device === 'desktop'">娆㈣繋杩涘叆 Jeecg-Boot 浼佷笟绾т綆浠g爜骞冲彴</span> - <span v-else>Jeecg-Boot</span> + <span v-if="device === 'desktop'">娆㈣繋杩涘叆 涓浗鑸彂鎴愬彂</span> + <span v-else>涓浗鑸彂鎴愬彂</span> <user-menu :theme="theme"/> </div> @@ -27,6 +27,10 @@ <div class="header-index-wide"> <div class="header-index-left" :style="topMenuStyle.headerIndexLeft"> <logo class="top-nav-header" :show-title="device !== 'mobile'" :style="topMenuStyle.topNavHeader"/> + <div class="top-nav-text"> + <div style="width:100%;height: 50%;line-height:35px">瀵嗙骇锛氬唴閮�</div> + <div style="width:100%;height: 50%;line-height:25px">璀﹀憡锛氭湰绯荤粺绂佹瀛樺偍銆佸鐞嗐�佷紶杈撴秹瀵嗕俊鎭�</div> + </div> <div v-if="device !== 'mobile'" :style="topMenuStyle.topSmenuStyle"> <s-menu mode="horizontal" @@ -223,5 +227,38 @@ } /* update_end author:scott date:20190220 for: 缂╁皬棣栭〉甯冨眬椤堕儴鐨勯珮搴�*/ + .top-nav-text { + color: #f00; + height: 100% + } + @media screen and (min-width: 1920px) { + .top-nav-text { + min-width: 400px; + } + } + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .top-nav-text { + min-width: 300px; + } + } + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .top-nav-text { + min-width: 300px; + } + } + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .top-nav-text { + min-width: 450px; + } + } + + @media screen and (max-width: 1280px) { + .top-nav-text { + min-width: 300px; + } + } </style> \ No newline at end of file diff --git a/src/components/tools/Logo.vue b/src/components/tools/Logo.vue index 7808fba..070ec68 100644 --- a/src/components/tools/Logo.vue +++ b/src/components/tools/Logo.vue @@ -3,8 +3,8 @@ <router-link :to="routerLinkTo"> <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo棰滆壊鏍规嵁涓婚棰滆壊鍙樺寲 --> - <img v-if="navTheme === 'dark'" src="~@/assets/logo-white.png" alt="logo"> - <img v-else src="~@/assets/logo.svg" alt="logo"> + <!--<img v-if="navTheme === 'dark'" src="~@/assets/logo_white.png" alt="logo">--> + <img src="~@/assets/logo.png" alt="logo"> <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo棰滆壊鏍规嵁涓婚棰滆壊鍙樺寲 --> <h1 v-if="showTitle">{{ title }}</h1> @@ -21,7 +21,7 @@ props: { title: { type: String, - default: 'Jeecg-Boot Pro', + default: '涓浗鑸彂鎴愬彂', required: false }, showTitle: { diff --git a/src/components/tools/UserMenu.vue b/src/components/tools/UserMenu.vue index f8e3d4e..e3d3580 100644 --- a/src/components/tools/UserMenu.vue +++ b/src/components/tools/UserMenu.vue @@ -26,11 +26,11 @@ <!-- update-end author:sunjianlei date:20200219 for: 鑿滃崟鎼滅储鏀逛负鍔ㄦ�佺粍浠讹紝鍦ㄦ墜鏈虹鍛堢幇鍑哄脊鍑烘 --> <!-- update-end author:sunjianlei date:20191220 for: 瑙e喅鍏ㄥ眬鏍峰紡鍐茬獊鐨勯棶棰� --> <!-- update_end author:zhaoxin date:20191129 for: 鍋氬ご閮ㄨ彍鍗曟爮瀵艰埅 --> - <span class="action"> - <a class="logout_title" target="_blank" href="http://doc.jeecg.com"> - <a-icon type="question-circle-o"></a-icon> - </a> - </span> + <!--<span class="action">--> + <!--<a class="logout_title" target="_blank" href="http://doc.jeecg.com">--> + <!--<a-icon type="question-circle-o"></a-icon>--> + <!--</a>--> + <!--</span>--> <header-notice class="action"/> <a-dropdown> <span class="action action-full ant-dropdown-link user-dropdown-menu"> @@ -38,30 +38,30 @@ <span v-if="isDesktop()">娆㈣繋鎮紝{{ nickname() }}</span> </span> <a-menu slot="overlay" class="user-dropdown-menu-wrapper"> - <a-menu-item key="0"> - <router-link :to="{ name: 'account-center' }"> - <a-icon type="user"/> - <span>涓汉涓績</span> - </router-link> - </a-menu-item> - <a-menu-item key="1"> - <router-link :to="{ name: 'account-settings-base' }"> - <a-icon type="setting"/> - <span>璐︽埛璁剧疆</span> - </router-link> - </a-menu-item> - <a-menu-item key="3" @click="systemSetting"> - <a-icon type="tool"/> - <span>绯荤粺璁剧疆</span> - </a-menu-item> + <!--<a-menu-item key="0">--> + <!--<router-link :to="{ name: 'account-center' }">--> + <!--<a-icon type="user"/>--> + <!--<span>涓汉涓績</span>--> + <!--</router-link>--> + <!--</a-menu-item>--> + <!--<a-menu-item key="1">--> + <!--<router-link :to="{ name: 'account-settings-base' }">--> + <!--<a-icon type="setting"/>--> + <!--<span>璐︽埛璁剧疆</span>--> + <!--</router-link>--> + <!--</a-menu-item>--> + <!--<a-menu-item key="3" @click="systemSetting">--> + <!--<a-icon type="tool"/>--> + <!--<span>绯荤粺璁剧疆</span>--> + <!--</a-menu-item>--> <a-menu-item key="4" @click="updatePassword"> <a-icon type="setting"/> <span>瀵嗙爜淇敼</span> </a-menu-item> - <a-menu-item key="5" @click="updateCurrentDepart"> - <a-icon type="cluster"/> - <span>鍒囨崲閮ㄩ棬</span> - </a-menu-item> + <!--<a-menu-item key="5" @click="updateCurrentDepart">--> + <!--<a-icon type="cluster"/>--> + <!--<span>鍒囨崲閮ㄩ棬</span>--> + <!--</a-menu-item>--> <a-menu-item key="6" @click="clearCache"> <a-icon type="sync"/> <span>娓呯悊缂撳瓨</span> 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/WorkshopSignageManagement.vue b/src/views/system/WorkshopSignageManagement.vue new file mode 100644 index 0000000..1c02197 --- /dev/null +++ b/src/views/system/WorkshopSignageManagement.vue @@ -0,0 +1,535 @@ +<template> + <a-row :gutter="10"> + <a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px"> + <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="8" :sm="8"> + <a-form-item label="杞﹂棿鍚嶇О" :labelCol="{ span: 5 }" :wrapperCol="{ span: 19}"> + <a-input placeholder="" v-model="queryParam.workshopName"></a-input> + </a-form-item> + </a-col> + <span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> + <a-col> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </span> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" style="margin: 5px 0 10px 2px"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板缓杞﹂棿</a-button> + </div> + + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> + <i class="anticon anticon-info-circle ant-alert-icon"> </i> 宸查�夋嫨 + <a + ><b>{{ selectedRowKeys1.length }}</b></a + >椤� + <a style="margin-left: 24px" @click="onClearSelected1">娓呯┖</a> + </div> + + <div style="margin-top: 15px"> + <a-table + style="height: 500px" + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{ selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type: 'radio' }" + @change="handleTableChange" + > + <template slot="backgroundImage" slot-scope="text, record"> + <img :src="getImgView(record.backgroundImage)" width="50" height="50" /> + </template> + <span slot="action" slot-scope="text, record"> + <a @click="handleOpen(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="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete1(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + </a-table> + </div> + </a-card> + </a-col> + <a-col :md="rightColMd" :sm="24" v-if="this.rightcolval == 1"> + <a-card :bordered="false"> + <div @click="hideUserList" class="close-circle"> + <a-icon type="close-circle"/> + </div> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline"> + <a-row :gutter="24"> + <a-col :md="12" :sm="12"> + <a-form-item label="缁熶竴缂栫爜"> + <a-input placeholder="" v-model="queryParam2.equipmentId"></a-input> + </a-form-item> + </a-col> + <span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> + <a-col :md="9" :sm="24"> + <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </a-col> + </span> + </a-row> + </a-form> + </div> + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator" :md="24" :sm="24"> + <a-button @click="handleAddDeviceInWorkshop" type="primary" icon="plus" style="margin: 5px 0 10px 2px" + >宸叉湁璁惧 + </a-button> + + <a-dropdown v-if="selectedRowKeys2.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel2"> + <a-icon type="delete" /> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> + 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 + <a style="font-weight: 600">{{ selectedRowKeys2.length }}</a + >椤� + <a style="margin-left: 24px" @click="onClearSelected2">娓呯┖</a> + </div> + <a-table + style="height: 500px" + ref="table2" + bordered + size="middle" + rowKey="equipmentId" + :columns="columns2" + :dataSource="dataSource2" + :pagination="ipagination2" + :loading="loading2" + :rowSelection="{ selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 }" + @change="handleTableChange2" + > + <span slot="action" slot-scope="text, record"> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete2(record.equipmentId)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + </div> + </a-card> + </a-col> + <!-- 琛ㄥ崟鍖哄煙 --> + <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal> + <!--鏂板杞﹂棿--> + <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'娣诲姞宸叉湁璁惧'"></select-device-drawer> + <!--宸叉湁璁惧--> + </a-row> +</template> +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { deleteAction, postAction, getAction } from '@/api/manage' +import SelectDeviceDrawer from './modules/SelectDeviceDrawer' +import WorkshopModal from './modules/WorkshopModal' +import { filterObj } from '@/utils/util' +import moment from 'moment' + +export default { + name: 'WorkshopSignageManagement', + mixins: [JeecgListMixin], + components: { + SelectDeviceDrawer, + WorkshopModal, + moment, + }, + data() { + return { + model1: {}, + model2: {}, + currentRoleId: '', + currentWorkshopId: '', + queryParam1: {}, + queryParam2: {}, + dataSource1: [], + dataSource2: [], + ipagination1: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + ipagination2: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0, + }, + isorter1: { + column: 'createTime', + order: 'desc', + }, + isorter2: { + column: 'createTime', + order: 'desc', + }, + filters1: {}, + filters2: {}, + loading1: false, + loading2: false, + selectedRowKeys1: [], + selectedRowKeys2: [], + selectionRows1: [], + selectionRows2: [], + test: {}, + rightcolval: 0, + columns: [ + { + title: '杞﹂棿鍚嶇О', + align: 'center', + dataIndex: 'workshopName', + }, + { + title: '杞﹂棿鑳屾櫙鍥�', + dataIndex: 'backgroundImage', + align: 'center', + scopedSlots: { customRender: 'backgroundImage' }, + }, + { + title: '璁惧缂栧彿棰滆壊', + dataIndex: 'equipmentIdColor', + align: 'center', + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + }, + ], + columns2: [ + { + title: '缁熶竴缂栫爜', + align: 'center', + dataIndex: 'equipmentId', + width: 120, + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 100, + dataIndex: 'equipmentName', + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 80, + dataIndex: 'equipmentType', + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 120, + }, + ], + // 楂樼骇鏌ヨ鍙傛暟 + superQueryParams2: '', + // 楂樼骇鏌ヨ鎷兼帴鏉′欢 + superQueryMatchType2: 'and', + url: { + list: '/mdc/mdcWorkshopInfo/list', + delete: '/mdc/mdcWorkshopInfo/delete', + list2: '/mdc/mdcWorkshopInfo/workshopEquipmentList', + addDeviceInWorkshop: '/mdc/mdcWorkshopInfo/addWorkshopEquipment', + delete2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', + deleteBatch2: '/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', + }, + } + }, + computed: { + leftColMd() { + return this.selectedRowKeys1.length === 0 ? 24 : 12 + }, + rightColMd() { + return this.selectedRowKeys1.length === 0 ? 0 : 12 + }, + }, + methods: { + onSelectChange2(selectedRowKeys, selectionRows) { + this.selectedRowKeys2 = selectedRowKeys + this.selectionRows2 = selectionRows + }, + onClearSelected2() { + this.selectedRowKeys2 = [] + this.selectionRows2 = [] + }, + onClearSelected1() { + this.selectedRowKeys1 = [] + this.selectionRows1 = [] + }, + onSelectChange1(selectedRowKeys, selectionRows) { + this.rightcolval = 1 + this.selectedRowKeys1 = selectedRowKeys + this.selectionRows1 = selectionRows + this.model1 = Object.assign({}, selectionRows[0]) + this.currentWorkshopId = selectedRowKeys[0] + this.loadData2() + }, + getQueryParams2() { + //鑾峰彇鏌ヨ鏉′欢 + let sqp = {} + if (this.superQueryParams2) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams2) + sqp['superQueryMatchType'] = this.superQueryMatchType2 + } + var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2) + param.field = this.getQueryField2() + param.pageNo = this.ipagination2.current + param.pageSize = this.ipagination2.pageSize + return filterObj(param) + }, + getQueryField2() { + //TODO 瀛楁鏉冮檺鎺у埗 + var str = 'id,' + this.columns2.forEach(function (value) { + str += ',' + value.dataIndex + }) + return str + }, + modalFormOk2() { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData2() + }, + loadData2(arg) { + if (!this.url.list2) { + this.$message.error('璇疯缃畊rl.list2灞炴��!') + return + } + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination2.current = 1 + } + if (this.currentWorkshopId === '') return + let params = this.getQueryParams2() //鏌ヨ鏉′欢 + params.workshopId = this.currentWorkshopId + this.loading2 = true + getAction(this.url.list2, params).then((res) => { + if (res.success) { + this.dataSource2 = res.result.records + this.ipagination2.total = res.result.total + }else{ + this.dataSource2=[] + } + this.loading2 = false + }) + }, + handleDelete1: function (id) { + this.handleDelete(id) + this.dataSource2 = [] + this.currentRoleId = '' + }, + + /** + * 鐐瑰嚮璁惧琛ㄦ牸涓殑鍒犻櫎鎸夐挳鍚庤Е鍙戝垹闄ゅ崟涓溅闂翠笌璁惧鐨勫叧绯� + * @param equipmentId 褰撳墠琛岀殑璁惧缂栧彿 + */ + handleDelete2: function (equipmentId) { + if (!this.url.delete2) { + this.$notification.error({ + message:'娑堟伅', + description:'璇疯缃畊rl.delete2灞炴��!' + }); + return + } + var that = this + deleteAction(that.url.delete2, { workshopId: this.currentWorkshopId, equipmentId }).then((res) => { + if (res.success) { + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.loadData2() + } else { + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + }, + + /** + * 鎵归噺鍒犻櫎杞﹂棿涓庤澶囩殑鍏崇郴 + */ + batchDel2: function () { + if (!this.url.deleteBatch2) { + this.$message.error('璇疯缃畊rl.deleteBatch2灞炴��!') + return + } + if (this.selectedRowKeys2.length <= 0) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + this.$notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�', + }) + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys2.length; a++) { + ids += this.selectedRowKeys2[a] + ',' + } + var that = this + this.$confirm({ + title: '纭鍒犻櫎', + content: '鏄惁鍒犻櫎閫変腑鏁版嵁?', + onOk: function () { + deleteAction(that.url.deleteBatch2, { + workshopId: that.currentWorkshopId, + equipmentIds: ids, + }).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData2() + that.onClearSelected2() + } else { + that.$message.warning(res.message) + } + }) + }, + }) + } + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶� + */ + selectOK(data) { + let params = {} + params.workshopId = this.currentWorkshopId + params.equipmentIdList = [] + for (var a = 0; a < data.length; a++) { + params.equipmentIdList.push(data[a]) + } + console.log(params) + postAction(this.url.addDeviceInWorkshop, params).then((res) => { + if (res.success) { + this.loadData2() + this.$notification.success({ + message:'娑堟伅', + description:res.message + }); + } else { + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }) + }, + + /** + * 鐐瑰嚮宸叉湁璁惧鎸夐挳瑙﹀彂 + */ + handleAddDeviceInWorkshop() { + if (this.currentWorkshopId == '') { + this.$message.error('璇烽�夋嫨涓�涓溅闂�!') + } else { + this.$refs.selectDeviceDrawer.visible = true + this.$refs.selectDeviceDrawer.selectedRowKeys = [] + this.$refs.selectDeviceDrawer.selectedRows = [] + this.$refs.selectDeviceDrawer.checkedKeys = [] + this.$refs.selectDeviceDrawer.expandAll() + } + }, + + /** + * 鐐瑰嚮褰撳墠琛岃溅闂撮�夐」鍚庤Е鍙戜簨浠� + * @param record 褰撳墠琛屾暟鎹� + */ + handleOpen(record) { + this.rightcolval = 1 + this.selectedRowKeys1 = [record.id] + this.model1 = Object.assign({}, record) + this.currentWorkshopId = record.id + this.onClearSelected2() + this.loadData2() + }, + + searchQuery2() { + this.loadData2(1) + }, + searchReset2() { + this.queryParam2 = {} + this.loadData2(1) + }, + handleTableChange2(pagination, filters, sorter) { + //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 + //TODO 绛涢�� + if (Object.keys(sorter).length > 0) { + this.isorter2.column = sorter.field + this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc' + } + this.ipagination2 = pagination + this.loadData2() + }, + hideUserList() { + //this.rightcolval = 0 + this.selectedRowKeys1 = [] + }, + }, +} +</script> +<style scoped> +/** Button鎸夐挳闂磋窛 */ +.ant-btn { + margin-left: 8px; +} + .close-circle{ + position: absolute; + z-index: 1; + right: 15px; + top: 15px; + cursor: pointer; + } +</style> \ No newline at end of file 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> diff --git a/src/views/system/modules/QuartzJobModal.vue b/src/views/system/modules/QuartzJobModal.vue index c27c6aa..514df3a 100644 --- a/src/views/system/modules/QuartzJobModal.vue +++ b/src/views/system/modules/QuartzJobModal.vue @@ -11,21 +11,23 @@ <a-spin :spinning="confirmLoading"> <a-form-model ref="form" :model="model" :rules="validatorRules"> - - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="浠诲姟绫诲悕" prop="jobClassName" hasFeedback > - <a-input placeholder="璇疯緭鍏ヤ换鍔$被鍚�" v-model="model.jobClassName" /> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="浠诲姟鍚嶇О" prop="jobName" hasFeedback> + <a-input placeholder="璇疯緭鍏ヤ换鍔″悕绉�" v-model="model.jobName"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="浠诲姟绫诲悕" prop="jobClassName" hasFeedback> + <a-input placeholder="璇疯緭鍏ヤ换鍔$被鍚�" v-model="model.jobClassName"/> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="Cron琛ㄨ揪寮�" prop="cronExpression"> <!-- <j-cron v-model="model.cronExpression"/>--> - <j-easy-cron v-model="model.cronExpression" /> + <j-easy-cron v-model="model.cronExpression"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍙傛暟" prop="parameter" > - <a-textarea placeholder="璇疯緭鍏ュ弬鏁�" :rows="5" v-model="model.parameter" /> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍙傛暟" prop="parameter"> + <a-textarea placeholder="璇疯緭鍏ュ弬鏁�" :rows="5" v-model="model.parameter"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎻忚堪" prop="description"> - <a-textarea placeholder="璇疯緭鍏ユ弿杩�" :rows="3" v-model="model.description" /> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎻忚堪" prop="description"> + <a-textarea placeholder="璇疯緭鍏ユ弿杩�" :rows="3" v-model="model.description"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鐘舵��" prop="status"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鐘舵��" prop="status"> <j-dict-select-tag type="radioButton" v-model="model.status" dictCode="quartz_status"/> </a-form-model-item> </a-form-model> @@ -36,26 +38,26 @@ <script> import { httpAction } from '@/api/manage' // import JCron from "@/components/jeecg/JCron"; - import cronValidator from "@/components/jeecg/JEasyCron/validator"; + import cronValidator from '@/components/jeecg/JEasyCron/validator' export default { - name: "QuartzJobModal", + name: 'QuartzJobModal', components: { // JCron, }, - data () { + data() { return { - title:"鎿嶄綔", + title: '鎿嶄綔', buttonStyle: 'solid', visible: false, model: {}, labelCol: { xs: { span: 24 }, - sm: { span: 5 }, + sm: { span: 5 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 }, + sm: { span: 16 } }, cron: { label: '', @@ -64,73 +66,74 @@ confirmLoading: false, validatorRules: { cronExpression: [ - {required: true, message: '璇疯緭鍏ron琛ㄨ揪寮�!'}, - {validator: cronValidator,} + { required: true, message: '璇疯緭鍏ron琛ㄨ揪寮�!' }, + { validator: cronValidator } ], - jobClassName: [{required: true, message: '璇疯緭鍏ヤ换鍔$被鍚�!'}] + jobName: [{ required: true, message: '璇疯緭鍏ヤ换鍔″悕绉�!' }], + jobClassName: [{ required: true, message: '璇疯緭鍏ヤ换鍔$被鍚�!' }] }, url: { - add: "/sys/quartzJob/add", - edit: "/sys/quartzJob/edit", - }, + add: '/sys/quartzJob/add', + edit: '/sys/quartzJob/edit' + } } }, - created () { + created() { }, methods: { add() { // 缁熶竴璁剧疆榛樿鍊� this.edit({ cronExpression: '* * * * * ? *', - status: 0, + status: 0 }) }, - edit (record) { - this.visible = true; + edit(record) { + this.visible = true this.$nextTick(() => { this.$refs.form.resetFields() this.model = Object.assign({}, record) }) }, - close () { - this.$emit('close'); - this.visible = false; + close() { + this.$emit('close') + this.visible = false }, - handleOk () { - const that = this; + handleOk() { + const that = this // 瑙﹀彂琛ㄥ崟楠岃瘉 this.$refs.form.validate((ok, err) => { if (ok) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + httpurl += this.url.edit + method = 'put' } - console.log('鎻愪氦鍙傛暟',this.model) - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - that.close(); - }else{ - that.$message.warning(res.message); + console.log('鎻愪氦鍙傛暟', this.model) + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) } }).finally(() => { - that.confirmLoading = false; + that.confirmLoading = false }) } }) }, - handleCancel () { + handleCancel() { this.close() - }, + } } } diff --git a/src/views/system/modules/SelectDeviceDrawer.vue b/src/views/system/modules/SelectDeviceDrawer.vue index 6015831..af9990b 100644 --- a/src/views/system/modules/SelectDeviceDrawer.vue +++ b/src/views/system/modules/SelectDeviceDrawer.vue @@ -90,6 +90,7 @@ data() { return { searchInput: '', + searchValue: '', cardLoading: false, loading: false, treeDataSource: [], diff --git a/src/views/system/modules/WorkshopModal.vue b/src/views/system/modules/WorkshopModal.vue new file mode 100644 index 0000000..2118a6d --- /dev/null +++ b/src/views/system/modules/WorkshopModal.vue @@ -0,0 +1,144 @@ +<template> + <a-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + wrapClassName="ant-modal-cust-warp" + style="top:5%;height: 85%;overflow-y: hidden"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> + <a-form-model-item label="杞﹂棿鍚嶇О" required prop="workshopName"> + <a-input v-model="model.workshopName" placeholder="璇疯緭鍏ヨ溅闂村悕绉�"/> + </a-form-model-item> + <a-form-model-item label="杞﹂棿鑳屾櫙鍥�" required prop="backgroundImage"> + <j-image-upload class="avatar-uploader" text="涓婁紶" v-model="model.backgroundImage"></j-image-upload> + </a-form-model-item> + <a-form-model-item label="璁惧缂栧彿棰滆壊"> + <a-input type="color" v-model="model.equipmentIdColor"></a-input> + </a-form-model-item> + <a-form-model-item label="鎺堟潈鏍囪瘑"> + <a-input placeholder="璇疯緭鍏ユ巿鏉冩爣璇�" v-model="model.perms"/> + </a-form-model-item> + </a-form-model> + </a-spin> + </a-modal> +</template> + +<script> + import api from '@/api/mdc' + + export default { + name: 'WorkshopModal', + components: {}, + data() { + return { + title: '鎿嶄綔', + visible: false, + isEdit: false, + model: {}, + layout: { + labelCol: { span: 3 }, + wrapperCol: { span: 14 } + }, + confirmLoading: false, + validatorRules: { + workshopName: [ + { required: true, message: '璇疯緭鍏ヨ溅闂村悕绉�!' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' } + ], + id: [ + { required: true, message: '璇疯緭鍏ヨ溅闂寸紪鍙�!' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateRoleCode } + ], + backgroundImage: [ + { required: true, message: '璇蜂笂浼犺溅闂磋儗鏅浘!' } + ] + } + } + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)) + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + //缂栬緫椤甸潰绂佹淇敼瑙掕壊缂栫爜 + if (this.model.id) { + this.isEdit = true + } else { + this.isEdit = false + } + }, + close() { + this.$refs.form.clearValidate() + this.$emit('close') + this.visible = false + }, + handleOk() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + console.log('瑙﹀彂') + that.confirmLoading = true + let obj + if (!this.isEdit) { + console.log('瑙﹀彂鏂板') + obj = api.addWorkshopApi(this.model) + } else { + console.log('瑙﹀彂淇敼') + obj = api.editWorkshopApi(this.model) + } + obj.then((res) => { + if (res.success) { + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); + that.$emit('ok') + } else { + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() => { + that.confirmLoading = false + that.close() + }) + } else { + return false + } + }) + }, + handleCancel() { + this.close() + }, + validateRoleCode(rule, value, callback) { + if (/[\u4E00-\u9FA5]/g.test(value)) { + callback('杞﹂棿缂栧彿涓嶅彲杈撳叆姹夊瓧!') + } else { + callback() + } + } + } + } +</script> + +<style scoped> + .avatar-uploader > .ant-upload { + width: 104px; + height: 104px; + } +</style> \ No newline at end of file diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index e7d4f86..76e68d9 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -5,8 +5,8 @@ <div class="top"> <div class="header"> <a href="/"> - <img src="~@/assets/lxzn.png" class="logo" alt="logo"> - <span class="title">MDC鏅烘収杞﹂棿</span> + <img src="~@/assets/logo.png" class="logo" alt="logo"> + <span class="title">涓浗鑸彂鎴愬彂</span> </a> </div> </div> diff --git a/vue.config.js b/vue.config.js index dd1ecae..7867c2c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -87,6 +87,7 @@ devServer: { port: 3000, + open:true, // hot: true, // disableHostCheck: true, // overlay: { -- Gitblit v1.9.3