当前位置:首页 » 编程语言 » sqleditor

sqleditor

发布时间: 2024-07-05 12:20:39

Ⅰ oracle鏁版嵁搴撴庝箞镓揿紑sql绐楀彛锛堣緭鍏ユ煡澶勮鍙ワ级

1銆佸畨瑁呭苟镓揿紑toad鍙瑙嗗寲宸ュ叿銆

Ⅱ 如何采用element-plus,基于codemirror6实现sql在线编辑器

js在线sql编辑器,下载后导入IDE工具中,在浏览器访问sql-editor-master/index.html ,效果如下(含括号高亮显示、显示折叠栏):
codeMirror官网https://codemirror.net/, 官网js/css资源文件,也可自行去官网下载,但是官网比较慢,需引入的核心页面代码:
<link rel="stylesheet" href="css/codemirror.css" />
<link rel="stylesheet" href="test/addon/fold/foldgutter.css">
<link rel="stylesheet" href="css/theme/dracula.css" />
<link rel="stylesheet" href="css/show-hint.css" />
<link rel="stylesheet" href="js/jquery-easyui/themes/default/easyui.css">
<link rel="stylesheet" href="js/layui/css/layui.css">

<link rel="stylesheet" href="css/index.css" />
<script type="text/javascript">var baseUrl ="";</script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/editor/codemirror.js"></script>
<!-- 折叠栏显示 -->
<script type="text/javascript" src="test/addon/fold/foldcode.js"></script>
<script type="text/javascript" src="test/addon/fold/foldgutter.js"></script>
<script type="text/javascript" src="test/addon/fold/comment-fold.js"></script>
<!-- 括号高亮匹配 -->
<script type="text/javascript" src="test/addon/fold/matchbrackets.js"></script>

<script type="text/javascript" src="js/editor/sublime.js"></script>
<script type="text/javascript" src="js/editor/sql.js"></script>
<script type="text/javascript" src="js/editor/sql-hint.js"></script>
<script type="text/javascript" src="js/editor/show-hint.js"></script>
<!-- sql格式 -->
<script type="text/javascript" src="js/editor/formatting.js"></script>
<script type="text/javascript" src="js/editor/sql-formatter.min.js"></script>

<script type="text/javascript" src="js/layui/layui.js"></script>
<script type="text/javascript" src="js/index.js"></script>

<textarea id="code"></textarea>

核心js代码:

//根据DOM元素的id构造出一个编辑器
var editor=CodeMirror.fromTextArea(document.getElementById("code"),{
mode:"text/c-mysql", //实现Java代码高亮
lineNumbers:true,
matchBrackets: true, //括号高亮匹配
theme:"default",
keyMap: "default",
extraKeys:{"Tab":"autocomplete"},
hint: CodeMirror.hint.sql,
lineWrapping: true, //是否换行
foldGutter: true, //是否折叠
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], //添加行号栏,折叠栏
hintOptions: {
tables: tablewords

}

});

输入关键词提示等信息的配置:allWords.json

动态设置表字段等信息:

let tableWords = {"al": []};
let tableName = "tn_user";
tableWords[tableName].push("userId");
editor.setOption("hintOptions", {"tables": tableWords});
tableWords json格式如下:

"tableWords": {
"cp_sku": [
"skuid",
"cpbh",
"tcbh"
],
"user_info": [
"user_id",
"user_token",
"user_name",
"user_type",
"password"
]
}

Ⅲ 鍦∣racle浣跨敤sql璇鍙ヤ腑濡备綍鎻掑叆镞ユ湡镙煎纺镄勬暟鎹

1銆佽緭鍏ユ湇锷″櫒鍦板潃銆佹暟鎹搴撶橱褰旷敤鎴峰悕銆佺橱褰曞瘑镰侊纴瀹屾垚鏁版嵁搴撶橱褰曟搷浣溿

热点内容
系数参数配置什么意思 发布:2025-01-17 00:34:03 浏览:755
台湾免费服务器云主机 发布:2025-01-17 00:29:07 浏览:870
c语言sizeofchar 发布:2025-01-17 00:29:01 浏览:469
安卓手机的云备份在哪里能找到 发布:2025-01-17 00:14:12 浏览:472
诈骗的脚本 发布:2025-01-16 23:51:27 浏览:315
电脑配置有点低怎么玩和平精英 发布:2025-01-16 23:46:14 浏览:819
ipfs分布式服务器是什么币种 发布:2025-01-16 23:32:29 浏览:992
android动态icon 发布:2025-01-16 23:03:12 浏览:605
优酷电脑缓存在哪 发布:2025-01-16 22:58:29 浏览:298
进口途锐哪个配置好 发布:2025-01-16 22:35:24 浏览:962