Ver código fonte

:art: Improving structure / format of the code.按照eslint规范调整部分代码

lishangbu 6 anos atrás
pai
commit
142fdea35e

+ 1 - 2
src/page/index/index.vue

@@ -77,7 +77,6 @@ export default {
     this.initWebSocket()
   },
   computed: mapGetters(['userInfo', 'isLock', 'isCollapse', 'website', 'expires_in']),
-  props: [],
   methods: {
     showCollapse() {
       this.$store.commit('SET_COLLAPSE')
@@ -138,7 +137,7 @@ export default {
       this.socket = new SockJS('/act/ws')// 连接服务端提供的通信接口,连接以后才可以订阅广播消息和个人消息
       // 获取STOMP子协议的客户端对象
       this.stompClient = Stomp.over(this.socket)
-      this.stompClient.debug=null
+      this.stompClient.debug = null
       // 向服务器发起websocket连接
       this.stompClient.connect(headers, () => {
         this.stompClient.subscribe('/task/' + this.userInfo.username + '-' + TENANT_ID + '/remind', (msg) => { // 订阅服务端提供的某个topic;

+ 7 - 7
src/page/index/top/index.vue

@@ -71,7 +71,7 @@
         </div>
       </el-tooltip>
       <el-tooltip
-        v-if="this.userInfo.avatar"
+        v-if="userInfo.avatar"
         effect="dark"
         content="用户头像"
         placement="bottom">
@@ -131,12 +131,6 @@ export default {
   data() {
     return {}
   },
-  created() {
-    handleImg(this.userInfo.avatar, 'thumbnail')
-  },
-  mounted() {
-    listenfullscreen(this.setScreen)
-  },
   computed: {
     ...mapState({
       showDebug: state => state.common.showDebug,
@@ -159,6 +153,12 @@ export default {
       'logsFlag'
     ])
   },
+  created() {
+    handleImg(this.userInfo.avatar, 'thumbnail')
+  },
+  mounted() {
+    listenfullscreen(this.setScreen)
+  },
   methods: {
     handleScreen() {
       fullscreenToggel()

+ 0 - 1
src/page/index/top/top-lock.vue

@@ -49,7 +49,6 @@ export default {
   computed: {
     ...mapGetters(['lockPasswd'])
   },
-  props: [],
   methods: {
     handleSetLock() {
       this.$refs['form'].validate(valid => {

+ 0 - 1
src/page/index/top/top-logs.vue

@@ -32,7 +32,6 @@ export default {
   computed: {
     ...mapGetters(['logsFlag', 'logsLen'])
   },
-  props: [],
   methods: {
     handleOpen() {
       this.box = true

+ 3 - 3
src/page/index/top/top-theme.vue

@@ -65,15 +65,15 @@ export default {
       ]
     }
   },
+  computed: {
+    ...mapGetters(['themeName'])
+  },
   watch: {
     text: function(val) {
       this.$store.commit('SET_THEME_NAME', val)
       setTheme(val)
     }
   },
-  computed: {
-    ...mapGetters(['themeName'])
-  },
   mounted() {
     this.text = this.themeName
     if (!this.text) {

+ 0 - 1
src/page/lock/index.vue

@@ -47,7 +47,6 @@ export default {
     }),
     ...mapGetters(['tag', 'lockPasswd'])
   },
-  props: [],
   methods: {
     handleLogout() {
       this.$confirm('是否退出系统, 是否继续?', '提示', {

+ 0 - 1
src/page/login/codelogin.vue

@@ -90,7 +90,6 @@ export default {
   computed: {
     ...mapGetters(['tagWel'])
   },
-  props: [],
   methods: {
     handleSend() {
       if (this.msgKey) return

+ 0 - 1
src/page/login/index.vue

@@ -113,7 +113,6 @@
     computed: {
       ...mapGetters(['website', 'tagWel'])
     },
-    props: [],
     methods: {
       handleCommand(command) {
         setStore({name: 'tenantId', content: command})

+ 0 - 1
src/page/logs/index.vue

@@ -48,7 +48,6 @@ export default {
   computed: {
     ...mapGetters(['logsList'])
   },
-  props: [],
   methods: {
     send() {
       this.$confirm('确定上传本地日志到服务器?', '提示', {

+ 3 - 3
src/views/daemon/job-log/index.vue

@@ -12,7 +12,7 @@
         @search-change="handleFilter"
         @search-reset="handleSearchReset">
         <template slot-scope="scope" slot="jobLogStatus">
-          <div v-if="scope.row.jobLogStatus == 0">
+          <div v-if="scope.row.jobLogStatus === '0'">
             <el-tag type="success">{{ getDicNameJobExecuteStatus(scope.row.jobLogStatus) }}</el-tag>
           </div>
           <div v-else>
@@ -101,7 +101,7 @@ export default {
     getDicNameCache(type) {
       remote(type).then(response => {
         const code = response.data.code
-        if (code == 0) {
+        if (code === 0) {
           const _data = response.data.data
           this.JobExecuteStatusDicCache = _data
         }
@@ -113,7 +113,7 @@ export default {
     getDicNameJobExecuteStatus(value) {
       let re = ''
       this.JobExecuteStatusDicCache.forEach(obj => {
-        if (obj.value == value) {
+        if (obj.value === value) {
           re = obj.label
           return
         }

+ 21 - 21
src/views/daemon/job-manage/index.vue

@@ -15,18 +15,18 @@
         @search-change="handleFilter"
         @search-reset="handleSearchReset">
         <template slot-scope="scope" slot="jobStatus">
-          <div v-if="scope.row.jobStatus == 1">
+          <div v-if="scope.row.jobStatus === '1'">
             <el-tag type="info">{{ getDicNameJobStatus(scope.row.jobStatus) }}</el-tag>
           </div>
-          <div v-else-if="scope.row.jobStatus == 2">
+          <div v-else-if="scope.row.jobStatus === '2'">
             <el-tag type="success">{{ getDicNameJobStatus(scope.row.jobStatus) }}</el-tag>
           </div>
-          <div v-else-if="scope.row.jobStatus == 3">
+          <div v-else-if="scope.row.jobStatus === '3'">
             <el-tag type="danger">{{ getDicNameJobStatus(scope.row.jobStatus) }}</el-tag>
           </div>
         </template>
         <template slot-scope="scope" slot="jobExecuteStatus">
-          <div v-if="scope.row.jobExecuteStatus == 0">
+          <div v-if="scope.row.jobExecuteStatus === '0'">
             <el-tag type="success">{{ getDicNameJobExecuteStatus(scope.row.jobExecuteStatus) }}</el-tag>
           </div>
           <div v-else>
@@ -173,13 +173,13 @@ export default {
       JobStatusDicCache: []
     }
   },
+  computed: {
+    ...mapGetters(['permissions'])
+  },
   mounted: function() {
     this.getDicJobExecuteStatusCache('job_execute_status')// 获取定时任务运行时状态
     this.getDicJobStatusCache('job_status')// 获取定时任务状态
   },
-  computed: {
-    ...mapGetters(['permissions'])
-  },
   methods: {
     changeCron(val) {
       this.form.cronExpression = val
@@ -227,7 +227,7 @@ export default {
        */
     handleStartJob(row) {
       const jobStatus = row.jobStatus
-      if (jobStatus == '1' || jobStatus == '3') {
+      if (jobStatus === '1' || jobStatus === '3') {
         this.$confirm(
           '即将发布或启动(任务名称:' + row.jobName + '), 是否继续?',
           '提示',
@@ -239,7 +239,7 @@ export default {
         ).then(() => {
           startJobRa(row.jobId).then(response => {
             const code = response.data.code
-            if (code == '0') {
+            if (code === 0) {
               this.$notify({
                 title: '成功',
                 message: '启动成功',
@@ -272,7 +272,7 @@ export default {
        */
     handleUpdate(row, index) {
       const jobStatus = row.jobStatus
-      if (jobStatus == '1' || jobStatus == '3') {
+      if (jobStatus === '1' || jobStatus === '3') {
         this.$refs.crud.rowEdit(row, index)
       } else {
         this.$notify.error({
@@ -286,7 +286,7 @@ export default {
        */
     handleShutDownJob(row) {
       const jobStatus = row.jobStatus
-      if (jobStatus == '2') {
+      if (jobStatus === '2') {
         this.$confirm(
           '即将暂停(任务名称:' + row.jobName + '), 是否继续?',
           '提示',
@@ -298,7 +298,7 @@ export default {
         ).then(() => {
           shutDownJobRa(row.jobId).then(response => {
             const code = response.data.code
-            if (code == '0') {
+            if (code === 0) {
               this.getList(this.page)
               this.$notify({
                 title: '成功',
@@ -367,7 +367,7 @@ export default {
         shutdownJobsRa().then(response => {
           const code = response.data.code
           const msg = response.data.msg
-          if (code == '0') {
+          if (code === 0) {
             this.getList(this.page)
             this.$notify({
               title: '成功',
@@ -404,7 +404,7 @@ export default {
       ).then(() => {
         startJobsRa().then(response => {
           const code = response.data.code
-          if (code == '0') {
+          if (code === 0) {
             this.getList(this.page)
             this.$notify({
               title: '成功',
@@ -441,7 +441,7 @@ export default {
       ).then(() => {
         refreshJobsRa().then(response => {
           const code = response.data.code
-          if (code == '0') {
+          if (code === 0) {
             this.getList(this.page)
             this.$notify({
               title: '成功',
@@ -473,7 +473,7 @@ export default {
         'jobGroup': row.jobGroup
       }).then(response => {
         const result = response.data.data
-        if (result != 0) {
+        if (result !== 0) {
           this.$notify.error({
             title: '错误',
             message: '任务名称与任务组重复,请确认后重新添加'
@@ -517,7 +517,7 @@ export default {
        */
     handleDelete(row) {
       const jobStatus = row.jobStatus
-      if (jobStatus == '1' || jobStatus == '3') {
+      if (jobStatus === '1' || jobStatus === '3') {
         this.$confirm('是否确认删除(任务名称:' + row.jobName + '), 是否继续?删除后不可恢复', '警告', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -548,7 +548,7 @@ export default {
     getDicJobExecuteStatusCache(type) {
       remote(type).then(response => {
         const code = response.data.code
-        if (code == 0) {
+        if (code === 0) {
           const _data = response.data.data
           this.JobExecuteStatusDicCache = _data
         }
@@ -560,7 +560,7 @@ export default {
     getDicJobStatusCache(type) {
       remote(type).then(response => {
         const code = response.data.code
-        if (code == 0) {
+        if (code === 0) {
           const _data = response.data.data
           this.JobStatusDicCache = _data
         }
@@ -572,7 +572,7 @@ export default {
     getDicNameJobExecuteStatus(value) {
       let re = ''
       this.JobExecuteStatusDicCache.forEach(obj => {
-        if (obj.value == value) {
+        if (obj.value === value) {
           re = obj.label
           return
         }
@@ -585,7 +585,7 @@ export default {
     getDicNameJobStatus(value) {
       let re = ''
       this.JobStatusDicCache.forEach(obj => {
-        if (obj.value == value) {
+        if (obj.value === value) {
           re = obj.label
           return
         }