當前位置:首頁 » 編程語言 » 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 03:03:06 瀏覽:134
幼兒園源碼php 發布:2025-01-17 02:41:45 瀏覽:401
win引導Linux 發布:2025-01-17 02:36:49 瀏覽:263
ftp是傳輸類協議嗎 發布:2025-01-17 02:36:47 瀏覽:311
查看電視配置下載什麼軟體 發布:2025-01-17 02:36:41 瀏覽:159
寶馬x330i比28i多哪些配置 發布:2025-01-17 02:35:59 瀏覽:573
伺服器運維安全雲幫手 發布:2025-01-17 02:35:48 瀏覽:72
c應用編程 發布:2025-01-17 02:35:16 瀏覽:941
ios清除app緩存數據免費 發布:2025-01-17 02:34:33 瀏覽:375
微信企業號上傳文件 發布:2025-01-17 02:10:28 瀏覽:64