Skip to content

Commit

Permalink
refactor(*): upgrade to version 0.3.6 (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanoneang committed Jul 1, 2020
1 parent 84b3980 commit 026f71f
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 46 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
29 changes: 13 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,32 @@ module.exports = {
plugins: ['vue'],
extends: ['plugin:vue/essential', '@vue/airbnb'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'import/extensions': 0, // import不需要写文件扩展名
'import/no-unresolved': 0,
// 'import/no-duplicates': 0,
'no-underscore-dangle': 0, // 无下划线
camelcase: 0, // 变量可以用下划线
semi: ['error', 'never'], // 无分号
'no-extra-semi': 0, // 和prettier冲突
'no-plusplus': 0, // 禁止使用++,--
// 'no-tabs': [o],
'guard-for-in': 0,
'max-len': ['error', { code: 200 }],
'no-extra-semi': 0, // 和prettier冲突
'import/extensions': 0, // import不需要写文件扩展名
'import/no-unresolved': 0,
'no-underscore-dangle': 0, // 无下划线
'no-restricted-syntax': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['script/**/*.js'] }],
'no-restricted-syntax': 0,
'class-methods-use-this': 'off',
'consistent-return': 'off',
'arrow-parens': ['error', 'as-needed'],
'no-prototype-builtins': 'off',
'class-methods-use-this': 'off',
semi: ['error', 'never'], // 无分号
'max-len': ['error', { code: 200 }],
'arrow-parens': ['error', 'as-needed'],
'comma-dangle': ['error', 'only-multiline'],
'no-param-reassign': ['error', { props: false }],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: ['script/**/*.js'] }],
'object-curly-newline': [
'error',
{
ImportDeclaration: 'never',
},
],
'comma-dangle': ['error', 'only-multiline'],
'no-param-reassign': ['error', { props: false }],
'max-len': 0,
},
parserOptions: {
parser: 'babel-eslint',
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ QQ群搜索:Lin CMS 官方交流群 或 814597236

## 版本日志

最新版本 `0.3.5`
最新版本 `0.3.6`

### 0.3.6

1. `F` 修复一级菜单双击报错
2. `U` 统一不同编辑器换行符
3. `U` 内容提交使用“加载中”按钮

### 0.3.5

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/view/admin/group/group-create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
ref="form"
label-position="right"
label-width="100px"
v-loading="loading"
@submit.native.prevent
>
<el-form-item label="分组名称" prop="name">
Expand All @@ -30,7 +29,7 @@
</group-permissions>
</el-form-item>
<el-form-item class="submit">
<el-button type="primary" @click="submitForm('form')">保 存</el-button>
<el-button type="primary" :loading="loading" @click="submitForm('form')">保 存</el-button>
<el-button @click="resetForm('form')">重 置</el-button>
</el-form-item>
</el-form>
Expand Down
23 changes: 1 addition & 22 deletions src/view/admin/user/user-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
:rules="rules"
:label-position="labelPosition"
ref="form"
v-loading="loading"
label-width="100px"
@submit.native.prevent
>
Expand Down Expand Up @@ -35,23 +34,14 @@
<el-input size="medium" clearable type="password" v-model="form.confirm_password" autocomplete="off"></el-input>
</el-form-item>
<el-form-item v-if="pageType !== 'password'" label="选择分组">
<!-- <el-select
size="medium"
multiple
v-model="form.group_ids"
:disabled="groups.length === 0"
placeholder="请选择分组"
>
<el-option v-for="item in groups" :key="item.id" :label="item.name" :value="item.id"> </el-option>
</el-select> -->
<el-checkbox-group v-model="form.group_ids" size="small" style="transform: translateY(5px);">
<el-checkbox v-for="item in groups" :key="item.id" :label="item.id" border style="margin-left: 0">{{
item.name
}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-show="submit" class="submit">
<el-button type="primary" @click="submitForm('form')">保 存</el-button>
<el-button type="primary" :loading="loading" @click="submitForm('form')">保 存</el-button>
<el-button @click="resetForm('form')">重 置</el-button>
</el-form-item>
</el-form>
Expand Down Expand Up @@ -232,17 +222,6 @@ export default {
this.form.group_ids = temp
},
},
// watch: {
// groups: {
// // 默认选中管理员组
// handler() {
// if (this.groups && this.groups[0] && this.groups[0].id) {
// this.form.group_ids = [this.groups[0].id]
// }
// },
// immediate: true,
// },
// },
created() {
// 通过是否接收到数据来判断当前页面是添加数据还是编辑数据
if (this.pageType === 'edit') {
Expand Down
6 changes: 5 additions & 1 deletion src/view/book/book-create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</el-form-item>

<el-form-item class="submit">
<el-button type="primary" @click="submitForm('form')">保 存</el-button>
<el-button type="primary" @click="submitForm('form')" :loading="loading">保 存</el-button>
<el-button @click="resetForm('form')">重 置</el-button>
</el-form-item>
</el-form>
Expand All @@ -48,17 +48,21 @@ export default {
summary: '',
image: '',
},
loading: false,
}
},
methods: {
async submitForm(formName) {
try {
this.loading = true
const res = await book.createBook(this.form)
this.loading = false
if (res.code < window.MAX_SUCCESS_CODE) {
this.$message.success(`${res.message}`)
this.resetForm(formName)
}
} catch (error) {
this.loading = false
this.$message.error('图书添加失败,请检测填写信息')
console.log(error)
}
Expand Down
3 changes: 3 additions & 0 deletions src/view/center/center.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export default {
if (!value) {
return callback(new Error('原始密码不能为空'))
}
if (value.length < 6) {
callback(new Error('密码长度不能少于6位数'))
}
callback()
}
const validatePassword = (rule, value, callback) => {
Expand Down
5 changes: 2 additions & 3 deletions src/view/log/log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export default {
} else {
res = await log.moreLogPage()
}
console.log('res', res)
let moreLogs = res.items
if (this.isSearch && this.searchKeyword) {
Expand All @@ -229,9 +228,9 @@ export default {
this.more = false
} catch (error) {
console.log('error', error)
console.error('error', error)
if (error.data.code === 10020) {
if (error.data.code === 10220) {
this.finished = true
}
Expand Down

0 comments on commit 026f71f

Please sign in to comment.