diff --git a/src/frontend/devops-op/.eslintrc.js b/src/frontend/devops-op/.eslintrc.js index f916eec2a1..de03107061 100644 --- a/src/frontend/devops-op/.eslintrc.js +++ b/src/frontend/devops-op/.eslintrc.js @@ -17,13 +17,23 @@ module.exports = { 'vue/max-attributes-per-line': [2, { 'singleline': 10, 'multiline': { - 'max': 1, - 'allowFirstLine': false + 'max': 1 } }], + 'vue/no-lone-template': ['error', { + 'ignoreAccessible': true + }], + 'vue/component-definition-name-casing': ['error', 'PascalCase'], + 'vue/multi-word-component-names': 'off', + 'vue/no-mutating-props': ['error', { + 'shallowOnly': true + }], + 'vue/first-attribute-linebreak': ['error', { + 'singleline': 'ignore', + 'multiline': 'below' + }], 'vue/singleline-html-element-content-newline': 'off', 'vue/multiline-html-element-content-newline': 'off', - 'vue/name-property-casing': ['error', 'PascalCase'], 'vue/no-v-html': 'off', 'accessor-pairs': 2, 'arrow-spacing': [2, { diff --git a/src/frontend/devops-op/package.json b/src/frontend/devops-op/package.json index 7d9d10b7bd..158d2b470d 100644 --- a/src/frontend/devops-op/package.json +++ b/src/frontend/devops-op/package.json @@ -25,7 +25,7 @@ "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-browserify": "^1.0.1", - "path-to-regexp": "2.4.0", + "path-to-regexp": "8.0.0", "vue": "2.6.14", "vue-router": "3.0.6", "vuex": "3.1.0" @@ -38,10 +38,11 @@ "babel-plugin-dynamic-import-node": "2.3.3", "chalk": "2.4.2", "connect": "3.6.6", + "eslint-plugin-vue": "^9.28.0", "html-webpack-plugin": "^5.6.0", - "tasksfile": "^5.1.1", "serve-static": "1.13.2", - "svgo": "3.3.2" + "svgo": "3.3.2", + "tasksfile": "^5.1.1" }, "browserslist": [ "> 1%", diff --git a/src/frontend/devops-op/src/icons/index.js b/src/frontend/devops-op/src/icons/index.js index 2c6b309c96..05d6e7e056 100644 --- a/src/frontend/devops-op/src/icons/index.js +++ b/src/frontend/devops-op/src/icons/index.js @@ -2,7 +2,7 @@ import Vue from 'vue' import SvgIcon from '@/components/SvgIcon'// svg component // register globally -Vue.component('svg-icon', SvgIcon) +Vue.component('SvgIcon', SvgIcon) const req = require.context('./svg', false, /\.svg$/) const requireAll = requireContext => requireContext.keys().map(requireContext) diff --git a/src/frontend/devops-op/src/views/ext-permission/components/PermissionDeleteDialog.vue b/src/frontend/devops-op/src/views/ext-permission/components/PermissionDeleteDialog.vue index 5c991a1152..2c6444cc3d 100644 --- a/src/frontend/devops-op/src/views/ext-permission/components/PermissionDeleteDialog.vue +++ b/src/frontend/devops-op/src/views/ext-permission/components/PermissionDeleteDialog.vue @@ -1,26 +1,24 @@ - - - - {{ permission.projectId }} - {{ permission.repoName }} - {{ permission.url }} - {{ permission.scope }} - {{ permission.enabled }} - - - 取 消 - 删除 - - - - - - 返 回 - - + + + {{ permission.projectId }} + {{ permission.repoName }} + {{ permission.url }} + {{ permission.scope }} + {{ permission.enabled }} + + + 取 消 + 删除 + + + + + 返 回 + + diff --git a/src/frontend/devops-op/src/views/ext-permission/components/PermissionDetailDialog.vue b/src/frontend/devops-op/src/views/ext-permission/components/PermissionDetailDialog.vue index 3ea438026e..8603cdcff1 100644 --- a/src/frontend/devops-op/src/views/ext-permission/components/PermissionDetailDialog.vue +++ b/src/frontend/devops-op/src/views/ext-permission/components/PermissionDetailDialog.vue @@ -92,7 +92,6 @@ export default { this.permissionDetail.enabled ) promise.then(() => { - this.permission = this.permissionDetail this.updateResult = true this.resultTitle = '更新成功' this.resultIcon = 'success' diff --git a/src/frontend/devops-op/src/views/ext-permission/index.vue b/src/frontend/devops-op/src/views/ext-permission/index.vue index cf85bba829..45203c2304 100644 --- a/src/frontend/devops-op/src/views/ext-permission/index.vue +++ b/src/frontend/devops-op/src/views/ext-permission/index.vue @@ -83,6 +83,10 @@ import PermissionDeleteDialog from '@/views/ext-permission/components/Permission export default { name: 'ExtPermission', components: { PermissionCreateDialog, PermissionDetailDialog, PermissionDeleteDialog }, + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { loading: false, @@ -113,10 +117,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { formatDate(date) { return formatDate(date) diff --git a/src/frontend/devops-op/src/views/node/EmptyFolder.vue b/src/frontend/devops-op/src/views/node/EmptyFolder.vue index 31fab9c4c1..ac33b00710 100644 --- a/src/frontend/devops-op/src/views/node/EmptyFolder.vue +++ b/src/frontend/devops-op/src/views/node/EmptyFolder.vue @@ -71,7 +71,11 @@ import { searchProjects } from '@/api/project' import { listRepositories } from '@/api/repository' export default { - name: 'Node', + name: 'EmptyFolder', + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { rules: { @@ -94,10 +98,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { validateName(rule, value, callback) { this.regexValidate(value, /^[\w-]+$/, callback) diff --git a/src/frontend/devops-op/src/views/node/FileSystem.vue b/src/frontend/devops-op/src/views/node/FileSystem.vue index fb7a4e61d1..e9baec6801 100644 --- a/src/frontend/devops-op/src/views/node/FileSystem.vue +++ b/src/frontend/devops-op/src/views/node/FileSystem.vue @@ -126,6 +126,10 @@ import FileSystemStatusRecordDialog from '@/views/node/components/FileSystemStat export default { name: 'FileSystem', components: { FileSystemStatusRecordDialog }, + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { loading: false, @@ -158,10 +162,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { queryProjects(queryStr, cb) { searchProjects(queryStr).then(res => { diff --git a/src/frontend/devops-op/src/views/node/FileSystemRecord.vue b/src/frontend/devops-op/src/views/node/FileSystemRecord.vue index 7676fd86ce..a9071aeb9b 100644 --- a/src/frontend/devops-op/src/views/node/FileSystemRecord.vue +++ b/src/frontend/devops-op/src/views/node/FileSystemRecord.vue @@ -87,7 +87,11 @@ import { formatNormalDate } from '@/utils/date' import moment from 'moment' export default { - name: 'FileSystem', + name: 'FileSystemRecord', + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { loading: false, @@ -115,10 +119,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { queryProjects(queryStr, cb) { searchProjects(queryStr).then(res => { diff --git a/src/frontend/devops-op/src/views/node/FirstLevelFolder.vue b/src/frontend/devops-op/src/views/node/FirstLevelFolder.vue index 8fa046afa2..031c05ce83 100644 --- a/src/frontend/devops-op/src/views/node/FirstLevelFolder.vue +++ b/src/frontend/devops-op/src/views/node/FirstLevelFolder.vue @@ -66,6 +66,10 @@ import { statisticalFirstLevelFolder } from '@/api/node' import { convertFileSize } from '@/utils/file' export default { + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { projectSelect: '', @@ -88,10 +92,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { queryProjects(queryStr, cb) { searchProjects(queryStr).then(res => { diff --git a/src/frontend/devops-op/src/views/node/ProjectMetrics.vue b/src/frontend/devops-op/src/views/node/ProjectMetrics.vue index e7986f4021..fdb324ba42 100644 --- a/src/frontend/devops-op/src/views/node/ProjectMetrics.vue +++ b/src/frontend/devops-op/src/views/node/ProjectMetrics.vue @@ -108,6 +108,10 @@ import { searchProjects } from '@/api/project' export default { name: 'ProjectMetrics', + beforeRouteUpdate(to, from, next) { + this.onRouteUpdate(to) + next() + }, data() { return { loading: true, @@ -125,10 +129,6 @@ export default { mounted() { this.onRouteUpdate(this.$route) }, - beforeRouteUpdate(to, from, next) { - this.onRouteUpdate(to) - next() - }, methods: { queryProjects(queryStr, cb) { searchProjects(queryStr).then(res => { diff --git a/src/frontend/devops-op/src/views/node/components/FileDeleteDialog.vue b/src/frontend/devops-op/src/views/node/components/FileDeleteDialog.vue index b9187c9833..99112c1f68 100644 --- a/src/frontend/devops-op/src/views/node/components/FileDeleteDialog.vue +++ b/src/frontend/devops-op/src/views/node/components/FileDeleteDialog.vue @@ -1,30 +1,28 @@ - - - - {{ node.name }} - {{ node.fullPath }} - - - 取 消 - 删除 - - - - - - 删除 - {{ deleteResult.deletedNumber }} - 个文件, - 总大小 - {{ fileSize(deleteResult.deletedSize) }} - - - 返 回 - - + + + {{ node.name }} + {{ node.fullPath }} + + + 取 消 + 删除 + + + + + 删除 + {{ deleteResult.deletedNumber }} + 个文件, + 总大小 + {{ fileSize(deleteResult.deletedSize) }} + + + 返 回 + + diff --git a/src/frontend/devops-op/src/views/node/components/FileRestoreDialog.vue b/src/frontend/devops-op/src/views/node/components/FileRestoreDialog.vue index c1dabbba57..9b89a9d2ca 100644 --- a/src/frontend/devops-op/src/views/node/components/FileRestoreDialog.vue +++ b/src/frontend/devops-op/src/views/node/components/FileRestoreDialog.vue @@ -1,35 +1,33 @@ - - - - {{ node.name }} - {{ node.fullPath }} - {{ formatDate(node.deleted) }} - - - 取 消 - 开始恢复 - - - - - - 恢复 - {{ restoreResult.restoreCount }} - 个文件, - 跳过 - {{ restoreResult.skipCount }} - 个文件, - 覆盖 - {{ restoreResult.conflictCount }} - 个文件 - - - 返 回 - - + + + {{ node.name }} + {{ node.fullPath }} + {{ formatDate(node.deleted) }} + + + 取 消 + 开始恢复 + + + + + 恢复 + {{ restoreResult.restoreCount }} + 个文件, + 跳过 + {{ restoreResult.skipCount }} + 个文件, + 覆盖 + {{ restoreResult.conflictCount }} + 个文件 + + + 返 回 + + diff --git a/src/frontend/devops-op/src/views/node/components/FileScanDialog.vue b/src/frontend/devops-op/src/views/node/components/FileScanDialog.vue index c0195c66d8..da4e04e542 100644 --- a/src/frontend/devops-op/src/views/node/components/FileScanDialog.vue +++ b/src/frontend/devops-op/src/views/node/components/FileScanDialog.vue @@ -1,6 +1,6 @@ - + 取 消 确 定 - + diff --git a/src/frontend/devops-op/src/views/node/components/FileSystemStatusRecordDialog.vue b/src/frontend/devops-op/src/views/node/components/FileSystemStatusRecordDialog.vue index 746423aeef..7004b2164a 100644 --- a/src/frontend/devops-op/src/views/node/components/FileSystemStatusRecordDialog.vue +++ b/src/frontend/devops-op/src/views/node/components/FileSystemStatusRecordDialog.vue @@ -1,8 +1,8 @@ - + - + - + - + @@ -49,7 +49,7 @@ @current-change="handleCurrentChange" /> - +