Просмотр исходного кода

【更新】修改日志列表title名称,日志列表、文件列表、定时器列表增加文本超出自动省略,代码规范优化

俞宝山 4 лет назад
Родитель
Сommit
153e66647e

+ 1 - 18
_web/src/views/system/file/detailForm.vue

@ -9,16 +9,9 @@
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item
          style="display: none;"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
        <a-form-item v-show="false">
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="文件存储位置"
        :labelCol="labelCol"
@ -26,7 +19,6 @@
      >
        {{fileDetail.fileLocation}}
      </a-form-item>
        <a-form-item
          label="文件仓库"
          :labelCol="labelCol"
@ -34,7 +26,6 @@
        >
          {{fileDetail.fileBucket}}
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
@ -71,16 +62,11 @@
        >
          {{fileDetail.filePath}}
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
  export default {
    data () {
      return {
@ -97,8 +83,6 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
@ -106,7 +90,6 @@
        this.fileDetail = record
        this.visible = true
      },
      handleCancel () {
        this.form.resetFields();
        this.visible = false

+ 53 - 73
_web/src/views/system/file/index.vue

@ -1,7 +1,6 @@
<template>
  <a-spin :spinning="cardLoading">
  <a-card :bordered="false">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysFileInfo:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
@ -16,7 +15,6 @@
            <a-form-item label="文件仓库">
              <a-input v-model="queryParam.fileBucket" placeholder="请输入文件仓库"/>
            </a-form-item>
          </a-col>
          <template v-if="advanced">
            <a-col :md="8" :sm="24">
@ -38,9 +36,9 @@
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysFileInfo:upload')">
      <a-upload
        v-if="hasPerm('sysFileInfo:upload')"
         name="file"
        :multiple="true"
         :customRequest="customRequest"
@ -49,63 +47,59 @@
        <a-button> <a-icon type="upload" />上传文件</a-button>
      </a-upload>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.id"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="fileLocation" slot-scope="text">
            {{ fileLocationFilter(text)  }}
          </span>
          <span slot="fileSuffix" slot-scope="text">
              <a-tag color="blue">{{ text }}</a-tag>
          </span>
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysFileInfo:download')" @click="sysFileInfoDownload(record)">下载</a>
            <a-divider type="vertical" v-if="hasPerm('sysFileInfo:download') & hasPerm('sysFileInfo:detail')"/>
            <a v-if="hasPerm('sysFileInfo:detail')" @click="$refs.detailForm.detail(record)">详情</a>
            <a-divider type="vertical" v-if="hasPerm('sysFileInfo:detail') & hasPerm('sysFileInfo:delete')"/>
            <a-popconfirm v-if="hasPerm('sysFileInfo:delete')" placement="topRight" title="确认删除?" @confirm="() => sysFileInfoDelete(record)">
                  <a>删除</a>
            </a-popconfirm>
            <a-divider type="vertical" v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg' || record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' ) & hasPerm('sysFileInfo:delete')"/>
            <a v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg'|| record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' )" @click="$refs.previewForm.preview(record)">预览</a>
          </span>
        </s-table>
    <detail-form ref="detailForm" @ok="handleOk" />
    <preview-form ref="previewForm"/>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="fileOriginName" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="fileObjectName" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="fileLocation" slot-scope="text">
        {{ fileLocationFilter(text)  }}
      </span>
      <span slot="fileSuffix" slot-scope="text">
          <a-tag color="blue">{{ text }}</a-tag>
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysFileInfo:download')" @click="sysFileInfoDownload(record)">下载</a>
        <a-divider type="vertical" v-if="hasPerm('sysFileInfo:download') & hasPerm('sysFileInfo:detail')"/>
        <a v-if="hasPerm('sysFileInfo:detail')" @click="$refs.detailForm.detail(record)">详情</a>
        <a-divider type="vertical" v-if="hasPerm('sysFileInfo:detail') & hasPerm('sysFileInfo:delete')"/>
        <a-popconfirm v-if="hasPerm('sysFileInfo:delete')" placement="topRight" title="确认删除?" @confirm="() => sysFileInfoDelete(record)">
          <a>删除</a>
        </a-popconfirm>
        <a-divider type="vertical" v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg' || record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' ) & hasPerm('sysFileInfo:delete')"/>
        <a v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg'|| record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' )" @click="$refs.previewForm.preview(record)">预览</a>
      </span>
    </s-table>
    <detail-form ref="detailForm" @ok="handleOk" v-if="hasPerm('sysFileInfo:detail')"/>
    <preview-form ref="previewForm" v-if="hasPerm('sysFileInfo:preview')"/>
  </a-card>
  </a-spin>
</template>
<script>
  import { STable } from '@/components'
  import { STable,Ellipsis } from '@/components'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import { sysFileInfoPage ,sysFileInfoDelete ,sysFileInfoUpload ,sysFileInfoDownload} from '@/api/modular/system/fileManage'
  import detailForm from './detailForm'
  import previewForm from './previewForm'
  export default {
    components: {
      STable,
      Ellipsis,
      detailForm,
      previewForm
    },
    data () {
      return {
        // 高级搜索 展开/关闭
        advanced: false,
        // 查询参数
@ -123,7 +117,8 @@
          },
          {
            title: '文件名称',
            dataIndex: 'fileOriginName'
            dataIndex: 'fileOriginName',
            scopedSlots: { customRender: 'fileOriginName' },
          },
          {
            title: '文件后缀',
@ -136,7 +131,8 @@
          },
          {
            title: '唯一标识id',
            dataIndex: 'fileObjectName'
            dataIndex: 'fileObjectName',
            scopedSlots: { customRender: 'fileObjectName' },
          },
        ],
@ -150,11 +146,8 @@
        fileLocationDictTypeDropDown:[],
        selectedRowKeys: [],
        selectedRows: [],
    }
      }
    },
    created(){
      this.sysDictTypeDropDown()
      if(this.hasPerm('sysPos:edit') || this.hasPerm('sysPos:delete')){
@ -166,16 +159,13 @@
        })
      }
    },
    methods: {
      fileLocationFilter (fileLocation) {
        const fileLocation_value = this.fileLocationDictTypeDropDown.filter(item => item.code == fileLocation)
        if(fileLocation_value.length>0){
          return fileLocation_value[0].value
        }
      },
      /**
       * 获取字典数据
       */
@ -184,7 +174,6 @@
          this.fileLocationDictTypeDropDown=res.data
        })
      },
      /**
       * 下载文件(所有文件)
       */
@ -215,8 +204,6 @@
        document.body.removeChild(downloadElement); //下载完成移除元素
        window.URL.revokeObjectURL(href);
      },
      sysFileInfoDelete(record){
        sysFileInfoDelete(record).then((res)=>{
          if(res.success) {
@ -229,28 +216,24 @@
          this.$message.error('删除错误:'+err.message)
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      /**
       * 上传文件
       */
      customRequest(data){
          const formData = new FormData()
          formData.append('file', data.file)
          sysFileInfoUpload(formData).then((res) => {
            if (res.success) {
              this.$message.success('上传成功');
              this.$refs.table.refresh()
            } else {
              this.$message.error('上传失败:' + res.message);
            }
          })
        const formData = new FormData()
        formData.append('file', data.file)
        sysFileInfoUpload(formData).then((res) => {
          if (res.success) {
            this.$message.success('上传成功');
            this.$refs.table.refresh()
          } else {
            this.$message.error('上传失败:' + res.message);
          }
        })
      },
      handleOk () {
        this.$refs.table.refresh()
      },
@ -259,10 +242,8 @@
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
@ -270,5 +251,4 @@
  button {
    margin-right: 8px;
  }
</style>

+ 0 - 10
_web/src/views/system/file/previewForm.vue

@ -7,19 +7,14 @@
    @cancel="handleCancel"
  >
    <a-spin :spinning="divLoading">
      <div style="text-align: center">
        <img :src ="src" style="max-width: 99%">
      </div>
    </a-spin>
  </a-modal>
</template>
<script>
  import { sysFileInfoPreview} from '@/api/modular/system/fileManage'
  export default {
    data () {
      return {
@ -27,8 +22,6 @@
        src:'',
        divLoading: false,
      }
    },
    methods: {
      /**
@ -39,7 +32,6 @@
        this.divLoading = true
        this.sysFileInfoPreview(record)
      },
      /**
       * 获取图片并转为链接
       */
@ -52,7 +44,6 @@
          this.$message.error('预览错误:'+err.message)
        })
      },
      /**
       * 转图片类型
       */
@ -60,7 +51,6 @@
        let blob = new Blob([res]);
        this.src  = window.URL.createObjectURL(blob);
      },
      handleCancel () {
        this.src=''
        this.visible = false

+ 0 - 14
_web/src/views/system/log/oplog/details.vue

@ -6,11 +6,8 @@
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
            <a-form-item
@ -31,7 +28,6 @@
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
            <a-form-item
@ -52,7 +48,6 @@
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
            <a-form-item
@ -73,7 +68,6 @@
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
            <a-form-item
@ -94,16 +88,10 @@
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
  export default {
    data () {
@ -120,7 +108,6 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
@ -141,7 +128,6 @@
          );
        },100)
      },
      handleCancel () {
        this.form.resetFields();
        this.visible = false

+ 18 - 26
_web/src/views/system/log/oplog/index.vue

@ -1,6 +1,5 @@
<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysOpLog:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
@ -36,13 +35,11 @@
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysOpLog:delete')">
      <a-popconfirm  placement="top" title="确认清空日志?" @confirm="() => sysOpLogDelete()">
        <a-button >清空日志</a-button>
      </a-popconfirm>
    </div>
    <s-table
      ref="table"
      size="default"
@ -58,30 +55,35 @@
      <span slot="success" slot-scope="text">
        {{ successFilter(text) }}
      </span>
      <span slot="name" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="url" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="opTime" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="action" slot-scope="text, record">
          <span slot="action" >
            <a @click="$refs.detailsOplog.details(record)">查看详情</a>
          </span>
      </span>
    </s-table>
    <details-oplog ref="detailsOplog"/>
  </a-card>
</template>
<script>
  import { STable } from '@/components'
  import { STable ,Ellipsis} from '@/components'
  import { sysOpLogPage,sysOpLogDelete } from '@/api/modular/system/logManage'
  import detailsOplog from './details'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    components: {
      STable,
      Ellipsis,
      detailsOplog
    },
    data () {
      return {
        advanced: false,
@ -91,10 +93,11 @@
        columns: [
          {
            title: '日志名称',
            dataIndex: 'name'
            dataIndex: 'name',
            scopedSlots: {customRender: 'name'}
          },
          {
            title: '是否成功',
            title: '操作类型',
            dataIndex: 'opType',
            scopedSlots: { customRender: 'opType' }
          },
@ -109,11 +112,13 @@
          },
          {
            title: '请求地址',
            dataIndex: 'url'
            dataIndex: 'url',
            scopedSlots: {customRender: 'url'}
          },
          {
            title: '操作时间',
            dataIndex: 'opTime'
            dataIndex: 'opTime',
            scopedSlots: {customRender: 'opTime'}
          },
          {
            title: '操作人',
@ -135,19 +140,13 @@
        selectedRowKeys: [],
        selectedRows: [],
        defaultExpandedKeys:[],
        replaceFields: {
          key: 'id',
        },
        opTypeDict:[],
        successDict:[],
      }
    },
    created () {
      this.sysDictTypeDropDown()
    },
    methods: {
      opTypeFilter (opType) {
        const opType_value = this.opTypeDict.filter(item => item.code == opType)
@ -161,7 +160,6 @@
          return success_value[0].value
        }
      },
      /**
       * 获取字典数据
       */
@ -173,7 +171,6 @@
          this.successDict=res.data
        })
      },
      /**
       * 清空日志
       */
@ -187,20 +184,16 @@
          }
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
@ -208,5 +201,4 @@
  button {
    margin-right: 8px;
  }
</style>

+ 0 - 12
_web/src/views/system/log/vislog/details.vue

@ -6,13 +6,8 @@
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-form-item
          label="具体消息"
          :labelCol="labelCol"
@ -20,15 +15,10 @@
        >
          <a-textarea :rows="4"  v-decorator="['message']"/>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
  export default {
    data () {
@ -45,7 +35,6 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
@ -59,7 +48,6 @@
          );
        },100)
      },
      handleCancel () {
        this.form.resetFields();
        this.visible = false

+ 12 - 25
_web/src/views/system/log/vislog/index.vue

@ -1,6 +1,5 @@
<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysVisLog:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
@ -38,13 +37,11 @@
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysVisLog:delete')">
        <a-popconfirm  v-if="hasPerm('sysVisLog:delete')" placement="top" title="确认清空日志?" @confirm="() => sysVisLogDelete()">
          <a-button >清空日志</a-button>
        </a-popconfirm>
    </div>
    <s-table
      ref="table"
      size="default"
@ -54,37 +51,38 @@
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="name" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="visTime" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="visType" slot-scope="text">
        {{ visTypeFilter(text) }}
      </span>
      <span slot="success" slot-scope="text">
        {{ successFilter(text) }}
      </span>
      <span slot="action" slot-scope="text, record">
          <span slot="action" >
            <a @click="$refs.detailsVislog.details(record)">查看详情</a>
          </span>
      </span>
    </s-table>
    <details-vislog ref="detailsVislog"/>
  </a-card>
</template>
<script>
  import { STable } from '@/components'
  import { STable,Ellipsis } from '@/components'
  import { sysVisLogPage ,sysVisLogDelete } from '@/api/modular/system/logManage'
  import detailsVislog from './details'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    components: {
      STable,
      Ellipsis,
      detailsVislog
    },
    data () {
      return {
        advanced: false,
@ -94,7 +92,8 @@
        columns: [
          {
            title: '日志名称',
            dataIndex: 'name'
            dataIndex: 'name',
            scopedSlots: {customRender: 'name'}
          },
          {
            title: '访问类型',
@ -116,7 +115,8 @@
          },
          {
            title: '访问时间',
            dataIndex: 'visTime'
            dataIndex: 'visTime',
            scopedSlots: {customRender: 'visTime'}
          },
          {
            title: '访问人',
@ -138,22 +138,16 @@
        selectedRowKeys: [],
        selectedRows: [],
        defaultExpandedKeys:[],
        replaceFields: {
          key: 'id',
        },
        visTypeDict:[],
        successDict:[]
      }
    },
    /**
     * 相当于html的onload方法,进来初始化
     */
    created () {
      this.sysDictTypeDropDown()
    },
    methods: {
      visTypeFilter (visType) {
        const visType_value = this.visTypeDict.filter(item => item.code == visType)
@ -167,7 +161,6 @@
          return success_value[0].value
        }
      },
      /**
       * 获取字典数据
       */
@ -179,7 +172,6 @@
          this.successDict=res.data
        })
      },
      /**
       * 清空日志
       */
@ -193,20 +185,16 @@
          }
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
@ -214,5 +202,4 @@
  button {
    margin-right: 8px;
  }
</style>

+ 64 - 79
_web/src/views/system/timers/index.vue

@ -1,91 +1,85 @@
<template>
  <a-card :bordered="false">
        <div class="table-page-search-wrapper" v-if="hasPerm('sysTimers:page')">
          <a-form layout="inline">
            <a-row :gutter="48">
              <a-col :md="8" :sm="24">
                <a-form-item label="任务名称">
                  <a-input v-model="queryParam.timerName" allow-clear placeholder="请输入任务名称"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="任务状态">
                  <a-select v-model="queryParam.jobStatus" placeholder="请选择状态" >
                    <a-select-option v-for='(item,index) in jobStatusDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
              </a-col>
            </a-row>
          </a-form>
        </div>
    <div class="table-page-search-wrapper" v-if="hasPerm('sysTimers:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="任务名称">
              <a-input v-model="queryParam.timerName" allow-clear placeholder="请输入任务名称"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="任务状态">
              <a-select v-model="queryParam.jobStatus" placeholder="请选择状态" >
                <a-select-option v-for='(item,index) in jobStatusDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="!advanced && 8 || 24" :sm="24">
        <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
          <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
          <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
        </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysTimers:add')" >
      <a-button type="primary" v-if="hasPerm('sysTimers:add')" icon="plus" @click="$refs.addForm.add()">新增定时器</a-button>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.id"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="jobStatus" slot-scope="text,record" v-if="hasPerm('sysTimers:start') || hasPerm('sysTimers:stop')">
              <a-popconfirm  placement="top"  :title="text===1? '确定停止该任务?':'确定启动该任务?'" @confirm="() => editjobStatusStatus(text,record)">
                <a-badge :status="text===1? 'processing':'default'" />
                <a>{{ jobStatusFilter(text)  }}</a>
              </a-popconfirm>
          </span>
          <span slot="jobStatus" v-else>
            <a-badge :status="text===1? 'processing':'default'" />
             {{ jobStatusFilter(text)  }}
          </span>
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysTimers:edit')" @click="$refs.editForm.edit(record)">编辑</a>
            <a-divider type="vertical" v-if="hasPerm('sysTimers:edit') & hasPerm('sysTimers:delete')"/>
            <a-popconfirm v-if="hasPerm('sysTimers:delete')" placement="topRight" title="确认删除?" @confirm="() => sysTimersDelete(record)">
                  <a>删除</a>
            </a-popconfirm>
          </span>
        </s-table>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
     >
      <span slot="actionClass" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="remark" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="jobStatus" slot-scope="text,record" v-if="hasPerm('sysTimers:start') || hasPerm('sysTimers:stop')">
        <a-popconfirm  placement="top"  :title="text===1? '确定停止该任务?':'确定启动该任务?'" @confirm="() => editjobStatusStatus(text,record)">
          <a-badge :status="text===1? 'processing':'default'" />
          <a>{{ jobStatusFilter(text)  }}</a>
        </a-popconfirm>
      </span>
      <span slot="jobStatus" v-else>
        <a-badge :status="text===1? 'processing':'default'" />
         {{ jobStatusFilter(text)  }}
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysTimers:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysTimers:edit') & hasPerm('sysTimers:delete')"/>
        <a-popconfirm v-if="hasPerm('sysTimers:delete')" placement="topRight" title="确认删除?" @confirm="() => sysTimersDelete(record)">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
  </a-card>
</template>
<script>
  import { STable } from '@/components'
  import { STable ,Ellipsis} from '@/components'
  import { sysTimersPage ,sysTimersDelete,sysTimersStart,sysTimersStop } from '@/api/modular/system/timersManage'
  import addForm from './addForm'
  import editForm from './editForm'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    name: 'pos_index',
    components: {
      STable,
      Ellipsis,
      addForm,
      editForm,
    },
    data () {
      return {
        // 高级搜索 展开/关闭
        advanced: false,
        // 查询参数
        queryParam: {},
        // 表头
@ -96,7 +90,8 @@
          },
          {
            title: '任务class类名',
            dataIndex: 'actionClass'
            dataIndex: 'actionClass',
            scopedSlots: {customRender: 'actionClass'}
          },
          {
            title: '定时任务表达式',
@ -104,7 +99,8 @@
          },
          {
            title: '备注',
            dataIndex: 'remark'
            dataIndex: 'remark',
            scopedSlots: {customRender: 'remark'}
          },
          {
            title: '状态',
@ -121,10 +117,8 @@
        selectedRowKeys: [],
        selectedRows: [],
        jobStatusDictTypeDropDown:[]
    }
      }
    },
    created(){
      this.sysDictTypeDropDown()//注释掉
      if(this.hasPerm('sysTimers:edit') || this.hasPerm('sysTimers:delete')){
@ -136,7 +130,6 @@
        })
      }
    },
    methods: {
      /**
       * 获取字典数据
@ -146,14 +139,12 @@
          this.jobStatusDictTypeDropDown=res.data
        })
      },
      jobStatusFilter (jobStatus) {
        const jobStatus_value = this.jobStatusDictTypeDropDown.filter(item => item.code == jobStatus)
        if(jobStatus_value.length>0){
          return jobStatus_value[0].value
        }
      },
      /**
       * 启动停止
       */
@ -177,9 +168,7 @@
            }
          }))
        }
      },
      sysTimersDelete(record){
        sysTimersDelete(record).then((res)=>{
          if(res.success) {
@ -192,7 +181,6 @@
          this.$message.error('删除错误:'+err.message)
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
@ -204,10 +192,8 @@
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
@ -215,5 +201,4 @@
  button {
    margin-right: 8px;
  }
</style>