Skip to content

Commit abdf388

Browse files
committed
fix: eslint
1 parent 9206279 commit abdf388

File tree

19 files changed

+179
-141
lines changed

19 files changed

+179
-141
lines changed

packages/web/package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"name": "laf-web",
33
"version": "0.1.0",
4+
"license": "MIT",
5+
"bugs": {
6+
"url": "https://github.com/labring/laf/issues"
7+
},
8+
"keywords": [
9+
"laf.js",
10+
"cloudfunction",
11+
"serverless",
12+
"element-ui",
13+
"less-api"
14+
],
15+
"engines": {
16+
"node": ">=16",
17+
"npm": ">= 6.0.0"
18+
},
419
"scripts": {
520
"build": "vite build",
621
"dev": "vite --port 3333 --open",
@@ -67,21 +82,6 @@
6782
"> 1%",
6883
"last 2 versions"
6984
],
70-
"bugs": {
71-
"url": "https://github.com/labring/laf/issues"
72-
},
73-
"engines": {
74-
"node": ">=16",
75-
"npm": ">= 6.0.0"
76-
},
77-
"keywords": [
78-
"laf.js",
79-
"cloudfunction",
80-
"serverless",
81-
"element-ui",
82-
"less-api"
83-
],
84-
"license": "MIT",
8585
"lint-staged": {
8686
"src/**/*.{js,vue}": [
8787
"eslint --fix",
@@ -91,4 +91,4 @@
9191
"eslintConfig": {
9292
"extends": "@antfu"
9393
}
94-
}
94+
}

packages/web/src/api/application.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export async function exportApplication(appid: string) {
144144
* @param {File} file
145145
* @returns
146146
*/
147-
export async function importApplication(appid: string, file: string | Blob) {
147+
export async function importApplication(appid: string, file: string | Blob): Promise<any> {
148148
const form = new FormData()
149149
form.append('file', file)
150150
const res = await request({

packages/web/src/components/JsonEditor/rule.vue

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
1-
<template>
2-
<div class="json-editor">
3-
<div ref="jsonEditor" class="editor" :style="{minHeight: `${minHeight}px`}" />
4-
</div>
5-
</template>
6-
71
<script>
82
import * as monaco from 'monaco-editor'
93
import { rules_schemas } from '@/components/JsonEditor/schemas'
104
// configure the JSON language support with schemas and schema associations
115
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
126
validate: true,
13-
schemas: rules_schemas
7+
schemas: rules_schemas,
148
})
159
export default {
1610
name: 'RuleJsonEditor',
17-
/* eslint-disable vue/require-prop-types */
11+
1812
props: ['value', 'lineNumbers', 'mode', 'dark', 'height', 'fontsize'],
1913
data() {
2014
return {
21-
editor: false
15+
editor: false,
2216
}
2317
},
2418
computed: {
2519
minHeight() {
2620
return this.height || 150
27-
}
21+
},
2822
},
2923
watch: {
3024
value(value) {
3125
const editorValue = this.editor.getValue()
32-
if (value !== editorValue) {
26+
if (value !== editorValue)
3327
this.editor.setValue(JSON.stringify(this.value, null, 2))
34-
}
35-
}
28+
},
3629
},
3730
mounted() {
3831
this.editor = monaco.editor.create(this.$refs.jsonEditor, {
@@ -48,7 +41,7 @@ export default {
4841
fontWeight: 'bold',
4942
cursorBlinking: 'expand',
5043
smoothScrolling: true,
51-
renderWhitespace: 'selection'
44+
renderWhitespace: 'selection',
5245
})
5346
5447
this.editor.onDidChangeModelContent((e) => {
@@ -61,11 +54,17 @@ export default {
6154
methods: {
6255
getValue() {
6356
return this.editor.getValue()
64-
}
65-
}
57+
},
58+
},
6659
}
6760
</script>
6861

62+
<template>
63+
<div class="json-editor">
64+
<div ref="jsonEditor" class="editor" :style="{ minHeight: `${minHeight}px` }" />
65+
</div>
66+
</template>
67+
6968
<style lang="scss" scoped>
7069
.json-editor {
7170
width: 100%;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export const rules_schemas = [
32
{
43
uri: 'http://less/permission.json', // id of the first schema
@@ -7,87 +6,87 @@ export const rules_schemas = [
76
type: 'object',
87
properties: {
98
read: {
10-
$ref: 'http://less/permission-config.json'
9+
$ref: 'http://less/permission-config.json',
1110
},
1211
update: {
13-
$ref: 'http://less/permission-config-for-data.json'
12+
$ref: 'http://less/permission-config-for-data.json',
1413
},
1514
add: {
16-
$ref: 'http://less/permission-config-for-data.json'
15+
$ref: 'http://less/permission-config-for-data.json',
1716
},
1817
remove: {
19-
$ref: 'http://less/permission-config.json'
18+
$ref: 'http://less/permission-config.json',
2019
},
2120
count: {
22-
$ref: 'http://less/permission-config.json'
21+
$ref: 'http://less/permission-config.json',
2322
},
24-
'$schema': {
25-
$ref: 'http://less/data.schema.json'
26-
}
27-
}
28-
}
23+
$schema: {
24+
$ref: 'http://less/data.schema.json',
25+
},
26+
},
27+
},
2928
},
3029
{
3130
uri: 'http://less/permission-config.json', // id of the second schema
3231
schema: {
3332
type: ['boolean', 'string', 'object'],
3433
properties: {
3534
condition: {
36-
type: ['string', 'boolean']
35+
type: ['string', 'boolean'],
3736
},
3837
cond: {
39-
type: ['string', 'boolean']
38+
type: ['string', 'boolean'],
4039
},
4140
query: {
42-
$ref: 'http://less/data.schema.json'
41+
$ref: 'http://less/data.schema.json',
4342
},
4443
multi: {
45-
type: ['boolean', 'string']
46-
}
47-
}
48-
}
44+
type: ['boolean', 'string'],
45+
},
46+
},
47+
},
4948
},
5049
{
5150
uri: 'http://less/permission-config-for-data.json', // id of the second schema
5251
schema: {
5352
type: ['boolean', 'string', 'object'],
5453
properties: {
5554
condition: {
56-
type: ['string', 'boolean']
55+
type: ['string', 'boolean'],
5756
},
5857
cond: {
59-
type: ['string', 'boolean']
58+
type: ['string', 'boolean'],
6059
},
6160
query: {
62-
$ref: 'http://less/data.schema.json'
61+
$ref: 'http://less/data.schema.json',
6362
},
6463
data: {
65-
$ref: 'http://less/data.schema.json'
64+
$ref: 'http://less/data.schema.json',
6665
},
6766
multi: {
68-
type: ['boolean', 'string']
69-
}
70-
}
71-
}
67+
type: ['boolean', 'string'],
68+
},
69+
},
70+
},
7271
},
7372
{
7473
uri: 'http://less/data.schema.json', // id of the second schema
7574
schema: {
7675
type: ['object', 'boolean', 'string'],
7776
patternProperties: {
7877
'.*': {
79-
$ref: 'http://less/constraints.json'
80-
}
81-
}
82-
}
78+
$ref: 'http://less/constraints.json',
79+
},
80+
},
81+
},
8382
},
8483
{
8584
uri: 'http://less/constraints.json', // id of the second schema
8685
schema: {
8786
type: 'object',
8887
properties: {
8988
condition: {
90-
type: ['string', 'boolean']
89+
type: ['string', 'boolean'],
9190
},
9291
required: { type: 'boolean' },
9392
default: { type: ['string', 'boolean', 'number', 'array', 'object'] },
@@ -96,21 +95,21 @@ export const rules_schemas = [
9695
type: 'array',
9796
items: [
9897
{ type: 'number' },
99-
{ type: 'number' }
100-
]
98+
{ type: 'number' },
99+
],
101100
},
102101
length: {
103102
type: 'array',
104103
items: [
105104
{ type: 'integer' },
106-
{ type: 'integer' }
107-
]
105+
{ type: 'integer' },
106+
],
108107
},
109108
in: { type: 'array' },
110109
match: { type: 'string' },
111110
exists: { type: 'string' },
112-
notExists: { type: 'string' }
113-
}
114-
}
115-
}
111+
notExists: { type: 'string' },
112+
},
113+
},
114+
},
116115
]

packages/web/src/layout/TopBarLayout.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import TopBar from './components/TopBar.vue'
55
<template>
66
<el-container fixed top-0 bottom-0 left-0 right-0>
77
<el-header relative z-5 style="--el-header-padding: 0;">
8-
<top-bar />
8+
<TopBar />
99
</el-header>
1010

1111
<el-main style="--el-main-padding: 0;" bg-light>

packages/web/src/layout/components/ResetPassword.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import type { ElForm } from 'element-plus'
2+
import { ElForm } from 'element-plus'
33
import { resetPassword } from '~/api/user'
44
import { useUserStore } from '~/store'
55
import { passwordField, requiredField } from '~/utils/form'
@@ -48,7 +48,7 @@ defineExpose({ open, close })
4848

4949
<template>
5050
<el-dialog ref="dialogEl" v-model="dialogVisible" destroy-on-close append-to-body :close-on-click-modal="false" :close-on-press-escape="false" title="重置密码">
51-
<el-form ref="formEl" label-position="top" :model="formData">
51+
<ElForm ref="formEl" label-position="top" :model="formData">
5252
<el-form-item
5353
:label="$t('layout.components.reset-password.form.new-password')"
5454
prop="password"
@@ -79,7 +79,7 @@ defineExpose({ open, close })
7979
auto-complete="off"
8080
/>
8181
</el-form-item>
82-
</el-form>
82+
</ElForm>
8383
<template #footer>
8484
<el-button type="primary" @click="submitForm">
8585
{{ $t('utils.form.submit') }}

packages/web/src/layout/components/TopBar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import UserMenu from './UserMenu.vue'
1919
<LogoGithub />
2020
</el-icon>
2121
</a>
22-
<language-menu />
23-
<user-menu />
22+
<LanguageMenu />
23+
<UserMenu />
2424
</el-space>
2525
</div>
2626
</div>

packages/web/src/layout/components/UserMenu.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const logOut = async () => {
2424
<el-dropdown-item @click="open">
2525
{{ $t('layout.topbar.user.reset-password') }}
2626
</el-dropdown-item>
27-
<reset-password :ref="setRef" />
27+
<ResetPassword :ref="setRef" />
2828
</common-opener>
2929
<el-dropdown-item @click="logOut">
3030
{{ $t('layout.topbar.user.logout') }}

packages/web/src/pages/app/[appid]/cloudfunction/logs/[id].vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ function setTagViewTitle() {
9090
<!-- 数据检索区 -->
9191
<div class="filter-container mb-24px">
9292
<el-input
93-
v-model="listQuery.keyword" placeholder="Request ID" style="width: 320px; margin-right: 10px"
94-
class="filter-item" @keyup.enter="handleFilter"
93+
v-model="listQuery.keyword" placeholder="Request ID" style="width: 320px; margin-right: 10px"
94+
class="filter-item" @keyup.enter="handleFilter"
9595
/>
9696
<el-button class="filter-item" type="primary" icon="Search" @click="handleFilter">
9797
搜索
@@ -126,8 +126,8 @@ function setTagViewTitle() {
126126
<el-table-column label="创建时间" width="180" align="center">
127127
<template #default="{ row }">
128128
<span v-if="row.created_at">{{
129-
$filters.formatTime(row.created_at)
130-
}}</span>
129+
$filters.formatTime(row.created_at)
130+
}}</span>
131131
<span v-else>-</span>
132132
</template>
133133
</el-table-column>
@@ -147,8 +147,8 @@ function setTagViewTitle() {
147147

148148
<!-- 分页 -->
149149
<el-pagination
150-
v-model:currentPage="listQuery.page" class="mt-24px" :page-size="listQuery.limit" background
151-
layout="->, total, prev, pager, next" :total="total" @size-change="getList" @current-change="getList"
150+
v-model:currentPage="listQuery.page" class="mt-24px" :page-size="listQuery.limit" background
151+
layout="->, total, prev, pager, next" :total="total" @size-change="getList" @current-change="getList"
152152
/>
153153

154154
<!-- 日志详情对话框 -->

packages/web/src/pages/app/[appid]/collaborate/index.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,11 @@ async function handleDelete(row: any) {
109109
110110
if (res.error) {
111111
ElMessage.error(`出错了:${res.error}`)
112-
113-
} else {
112+
}
113+
else {
114114
ElMessage.success('操作成功')
115115
loadCollaborators()
116116
}
117-
118117
}
119118
120119
onMounted(async () => {
@@ -140,7 +139,7 @@ onMounted(async () => {
140139
<el-table-column align="center" label="用户名">
141140
<template #default="{ row }">
142141
<span v-if="row.user && row.user.username">{{
143-
row.user.username
142+
row.user.username
144143
}}</span>
145144
<span v-else>-</span>
146145
</template>

0 commit comments

Comments
 (0)