diff --git a/.commitlintrc.cjs b/.commitlintrc.cjs
index 34fee141..9ead01b6 100644
--- a/.commitlintrc.cjs
+++ b/.commitlintrc.cjs
@@ -17,12 +17,18 @@ module.exports = {
'perf', // 性能优化
]
],
- 'type-case': [0],
- 'type-empty': [0],
- 'scope-empty': [0],
'scope-case': [0],
- 'subject-full-stop': [0, 'never'],
- 'subject-case': [0, 'never'],
- 'header-max-length': [0, 'always', 72]
- }
+ },
+ plugins: [
+ {
+ rules: {
+ "commit-rule": ({ raw }) => {
+ return [
+ /^\[(build|feat|fix|update|refactor|docs|chore|style|revert|perf)].+/g.test(raw),
+ `commit备注信息格式错误,格式为 <[type] 修改内容>,type支持${types.join(",")}`
+ ]
+ }
+ }
+ }
+ ]
}
\ No newline at end of file
diff --git a/components.d.ts b/components.d.ts
index ec16f58f..45441c3e 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -46,6 +46,8 @@ declare module '@vue/runtime-core' {
PermissionButton: typeof import('./src/components/PermissionButton/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
+ SearchItem: typeof import('./src/components/Search/Item.vue')['default']
+ SearchSearch: typeof import('./src/components/Search/Search.vue')['default']
Table: typeof import('./src/components/Table/index.vue')['default']
TitleComponent: typeof import('./src/components/TitleComponent/index.vue')['default']
ValueItem: typeof import('./src/components/ValueItem/index.vue')['default']
diff --git a/config/config.ts b/config/config.ts
index 88915884..108726d5 100644
--- a/config/config.ts
+++ b/config/config.ts
@@ -1,6 +1,6 @@
export default {
theme: {
- 'primary-color': '#00A4FF',
+ 'primary-color': '#1d39c4',
},
logo: '/favicon.ico',
title: 'Jetlinks'
diff --git a/src/api/device.ts b/src/api/device/instance.ts
similarity index 100%
rename from src/api/device.ts
rename to src/api/device/instance.ts
diff --git a/src/api/device/product.ts b/src/api/device/product.ts
new file mode 100644
index 00000000..ac44c574
--- /dev/null
+++ b/src/api/device/product.ts
@@ -0,0 +1,3 @@
+import server from '@/utils/request'
+
+export const queryNoPagingPost = (data: any) => server.post(`/device-product/_query/no-paging?paging=false`, data)
\ No newline at end of file
diff --git a/src/components/Form/FormBuilder.vue b/src/components/Form/FormBuilder.vue
index cac91d0a..afcbfa2d 100644
--- a/src/components/Form/FormBuilder.vue
+++ b/src/components/Form/FormBuilder.vue
@@ -241,7 +241,7 @@ watch(props.initValue, (newValue: any) => {
})
defineExpose({
- resetModel,
+ reset: resetModel,
formValidate,
setItemValue,
setData
diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue
index cbeb5c37..d211e2ee 100644
--- a/src/components/PermissionButton/index.vue
+++ b/src/components/PermissionButton/index.vue
@@ -25,7 +25,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue
new file mode 100644
index 00000000..2bcd6615
--- /dev/null
+++ b/src/components/Search/Search.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Search/index.ts b/src/components/Search/index.ts
new file mode 100644
index 00000000..4edb3b21
--- /dev/null
+++ b/src/components/Search/index.ts
@@ -0,0 +1,3 @@
+import Search from './Search.vue'
+
+export default Search
\ No newline at end of file
diff --git a/src/components/Search/util.ts b/src/components/Search/util.ts
new file mode 100644
index 00000000..573b0d7d
--- /dev/null
+++ b/src/components/Search/util.ts
@@ -0,0 +1,4 @@
+export const typeOptions = [
+ { label: '或者', value: 'or' },
+ { label: '并且', value: 'and' },
+]
\ No newline at end of file
diff --git a/src/components/index.ts b/src/components/index.ts
index 36905405..1c14b417 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -5,6 +5,7 @@ import JTable from './Table/index'
import TitleComponent from "./TitleComponent/index.vue";
import Form from './Form';
import CardBox from './CardBox/index.vue';
+import Search from './Search'
export default {
install(app: App) {
@@ -14,5 +15,6 @@ export default {
.component('TitleComponent', TitleComponent)
.component('Form', Form)
.component('CardBox', CardBox)
+ .component('Search', Search)
}
}
diff --git a/src/router/index.ts b/src/router/index.ts
index 2da56030..389b7053 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -8,9 +8,15 @@ const router = createRouter({
routes: menus
})
+const filterPath = [
+ '/form',
+ '/search'
+]
+
router.beforeEach((to, from, next) => {
const token = LocalStore.get(TOKEN_KEY)
- if (token) {
+
+ if (token || filterPath.includes(to.path)) {
next()
} else {
if (to.path === LoginPath) {
diff --git a/src/router/menu.ts b/src/router/menu.ts
index 28580cad..8bb794ae 100644
--- a/src/router/menu.ts
+++ b/src/router/menu.ts
@@ -45,8 +45,8 @@ export default [
component: () => import('@/views/demo/Form.vue')
},
{
- path: '/test',
- component: () => import('@/views/demo/test')
+ path: '/search',
+ component: () => import('@/views/demo/Search.vue')
},
// end: 测试用, 可删除
diff --git a/src/utils/request.ts b/src/utils/request.ts
index aef2bd54..cc606fea 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -26,23 +26,24 @@ export const request = axios.create({
* @param {String} responseType 如果接口是需要导出文件流,那么responseType = 'blob'
* @returns {AxiosInstance}
*/
-export const post = function(url: string, data = {}, params = {}) {
+export const post = function(url: string, data = {}, params = {}) {
params = typeof params === 'string' ? { responseType: params } : params
- return request({
+ return request>({
...params,
method: 'POST',
url,
data
})
}
+
/**
* put method request
* @param {String} url
* @param {Object} [data]
* @returns {AxiosInstance}
*/
-export const put = function(url: string, data = {},) {
- return request({
+export const put = function(url: string, data = {},) {
+ return request>({
method: 'PUT',
url,
data
@@ -55,8 +56,8 @@ export const put = function(url: string, data = {},) {
* @param {Object} [data]
* @returns {AxiosInstance}
*/
-export const patch = function(url: string, data = {}) {
- return request({
+export const patch = function(url: string, data = {}) {
+ return request>({
method: 'PATCH',
url,
data
@@ -69,8 +70,8 @@ export const patch = function(url: string, data = {}) {
* @param {Object} [ext] 扩展参数
* @returns {AxiosInstance}
*/
-export const get = function(url: string, params = {}, ext?: any) {
- return request({
+export const get = function(url: string, params = {}, ext?: any) {
+ return request>({
method: 'GET',
url,
params,
@@ -85,8 +86,8 @@ export const get = function(url: string, params = {}, ext?: any) {
* @param {Object} [ext] 扩展参数
* @returns {AxiosInstance}
*/
-export const remove = function(url: string, params = {}, ext?: any) {
- return request({
+export const remove = function(url: string, params = {}, ext?: any) {
+ return request>({
method: 'DELETE',
url,
params,
@@ -101,7 +102,7 @@ export const remove = function(url: string, params = {}, ext?: any) {
* @return {*}
*/
export const getStream = function(url: string, params = {}) {
- return get(url, params, {
+ return get(url, params, {
responseType: 'arraybuffer' // 设置请求数据类型,返回blob可解析类型
})
}
diff --git a/src/views/demo/Form.vue b/src/views/demo/Form.vue
index cd585a77..41b6f7e0 100644
--- a/src/views/demo/Form.vue
+++ b/src/views/demo/Form.vue
@@ -21,7 +21,7 @@ const submit = () => {
}
const reset = () => {
-
+ form.value.reset()
}
const setValue =() => {
diff --git a/src/views/demo/Search.vue b/src/views/demo/Search.vue
new file mode 100644
index 00000000..e7445026
--- /dev/null
+++ b/src/views/demo/Search.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/user/Login/index.vue b/src/views/user/Login/index.vue
index 2f802f1e..1b1d8968 100644
--- a/src/views/user/Login/index.vue
+++ b/src/views/user/Login/index.vue
@@ -9,7 +9,6 @@
/>