1、定时任务页面增加字段
2、全局项目有关名称改为中国航发成发以及调整logo
已添加4个文件
已修改12个文件
1470 ■■■■■ 文件已修改
public/index.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/logo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layouts/TabLayout.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/GlobalHeader.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/Logo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/UserMenu.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/QuartzJobList.vue 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/WorkshopSignageManagement.vue 535 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/QuartzJobDetails.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/QuartzJobListModal.vue 422 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/QuartzJobModal.vue 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectDeviceDrawer.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/WorkshopModal.vue 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/user/Login.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 ä¼ä¸šçº§ä½Žä»£ç å¹³å°</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">正在加载 JeecgBoot ä½Žä»£ç å¹³å°,请耐心等待
    <div class="load_title">正在加载中国航发成发管理系统,请耐心等待
    </div>
  </div>
public/logo.png

src/assets/logo.png

src/components/layouts/TabLayout.vue
@@ -183,7 +183,7 @@
       * @param title è¦ä¿®æ”¹çš„æ–°æ ‡é¢˜
       */
      changeTitle(title) {
        let projectTitle = "Jeecg-Boot ä¼ä¸šçº§ä½Žä»£ç å¹³å°"
        let projectTitle = "中国航发成发"
        // é¦–页特殊处理
        if (this.$route.path === indexKey) {
          document.title = projectTitle
src/components/page/GlobalHeader.vue
@@ -17,8 +17,8 @@
        :type="collapsed ? 'menu-unfold' : 'menu-fold'"
        @click="toggle"/>
      <span v-if="device === 'desktop'">欢迎进入 Jeecg-Boot ä¼ä¸šçº§ä½Žä»£ç å¹³å°</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>
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: {
src/components/tools/UserMenu.vue
@@ -26,11 +26,11 @@
    <!-- update-end author:sunjianlei date:20200219 for: èœå•搜索改为动态组件,在手机端呈现出弹出框 -->
    <!-- update-end author:sunjianlei date:20191220 for: è§£å†³å…¨å±€æ ·å¼å†²çªçš„问题 -->
    <!-- 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>
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">正常</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;
      },
      //筛选需要重写handleTableChange
      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
                });
              }
            });
          }
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('请设置url.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:'请设置url.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('请设置url.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>
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>
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中声明非字符串值的属性 */
        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); //释放掉blob对象
          }
        })
      },
      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("请设置url.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>
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: '请输入cron表达式!'},
            {validator: cronValidator,}
            { required: true, message: '请输入cron表达式!' },
            { 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()
      },
      }
    }
  }
src/views/system/modules/SelectDeviceDrawer.vue
@@ -90,6 +90,7 @@
    data() {
      return {
        searchInput: '',
        searchValue: '',
        cardLoading: false,
        loading: false,
        treeDataSource: [],
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>
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>
vue.config.js
@@ -87,6 +87,7 @@
  devServer: {
    port: 3000,
    open:true,
    // hot: true,
    // disableHostCheck: true,
    // overlay: {