增加shift+鼠标左键定位代码功能,增加自动创建资源权限标识功能,细节调优。 (#1225)
* fix: 增加索引解决登录太慢的问题 * 增加shift+鼠标左键自动定位到编辑工具代码行的功能 * 过滤功能性标签 防止意外错误 * [utils\validator.go]:修复了当判断字符长度时,当字符串长度为中文,会判断错误。 * 增加资源标识 Co-authored-by: hexiang3000 <91460121+hexiang3000@users.noreply.github.com> Co-authored-by: fanyibo <29974992@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
hexiang3000
fanyibo
parent
b5c79be625
commit
ef35c53712
@@ -12,6 +12,8 @@ import run from '@/core/gin-vue-admin.js'
|
||||
import auth from '@/directive/auth'
|
||||
import { store } from '@/pinia'
|
||||
import App from './App.vue'
|
||||
import { initDom } from './utils/positionToCode'
|
||||
initDom()
|
||||
/**
|
||||
* @description 导入加载进度条,防止首屏加载时间过长,用户等待
|
||||
*
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
export const initDom = () => {
|
||||
if (import.meta.env.MODE === 'development') {
|
||||
document.onmousedown = function(e) {
|
||||
if (e.shiftKey && e.button === 0) {
|
||||
e.preventDefault()
|
||||
sendRequestToOpenFileInEditor(getFilePath(e))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getFilePath = (e) => {
|
||||
let element = e
|
||||
if (e.target) {
|
||||
element = e.target
|
||||
}
|
||||
if (!element || !element.getAttribute) return null
|
||||
if (element.getAttribute('code-location')) {
|
||||
return element.getAttribute('code-location')
|
||||
}
|
||||
return getFilePath(element.parentNode)
|
||||
}
|
||||
|
||||
const sendRequestToOpenFileInEditor = (filePath) => {
|
||||
const protocol = window.location.protocol
|
||||
? window.location.protocol
|
||||
: 'http:'
|
||||
const hostname = window.location.hostname
|
||||
? window.location.hostname
|
||||
: 'localhost'
|
||||
const port = window.location.port ? window.location.port : '80'
|
||||
fetch(`${protocol}//${hostname}:${port}/gvaPositionCode?filePath=${filePath}`)
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
@@ -5,7 +5,9 @@
|
||||
</div>
|
||||
<div class="log">
|
||||
<div v-for="(item,key) in dataTimeline" :key="key" class="log-item">
|
||||
<div class="flex-1 flex key-box"><span class="key" :class="key<3&&'top'">{{ key+1 }}</span></div>
|
||||
<div class="flex-1 flex key-box">
|
||||
<span class="key" :class="key<3&&'top'">{{ key+1 }}</span>
|
||||
</div>
|
||||
<div class="flex-5 flex message">{{ item.message }}</div>
|
||||
<div class="flex-3 flex form">{{ item.from }}</div>
|
||||
</div>
|
||||
|
||||
@@ -71,6 +71,14 @@
|
||||
<el-icon class="auto-icon" @click="getPkgs"><refresh /></el-icon>
|
||||
<el-icon class="auto-icon" @click="goPkgs"><document-add /></el-icon>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<el-tooltip content="注:会自动在结构体添加 created_by updated_by deleted_by,方便用户进行资源权限控制" placement="bottom" effect="light">
|
||||
<div> 创建资源标识 <el-icon><QuestionFilled /></el-icon> </div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<el-checkbox v-model="form.autoCreateResource" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
<el-tooltip content="注:把自动生成的API注册进数据库" placement="bottom" effect="light">
|
||||
@@ -228,6 +236,7 @@ const form = ref({
|
||||
description: '',
|
||||
autoCreateApiToSql: true,
|
||||
autoMoveFile: true,
|
||||
autoCreateResource: false,
|
||||
fields: []
|
||||
})
|
||||
const rules = ref({
|
||||
|
||||
Reference in New Issue
Block a user