feat:代码生成脚本
This commit is contained in:
@@ -1,209 +1,180 @@
|
||||
|
||||
$.inputArea = undefined;
|
||||
$.outputArea = undefined;
|
||||
|
||||
$(function(){
|
||||
//powered by zhengkai.blog.csdn.net
|
||||
$(function () {
|
||||
$.inputArea = CodeMirror.fromTextArea(document.getElementById("inputArea"), {
|
||||
mode: "text/x-sql", // SQL
|
||||
theme: "idea", // IDEA主题
|
||||
lineNumbers: true, //显示行号
|
||||
smartIndent: true, // 自动缩进
|
||||
autoCloseBrackets: true// 自动补全括号
|
||||
});
|
||||
$.inputArea.setSize('auto', 'auto');
|
||||
|
||||
//init input code area
|
||||
$.inputArea = CodeMirror.fromTextArea(document.getElementById("inputArea"), {
|
||||
mode: "text/x-sql", // SQL
|
||||
theme: "idea", // IDEA主题
|
||||
lineNumbers: true, //显示行号
|
||||
smartIndent: true, // 自动缩进
|
||||
autoCloseBrackets: true// 自动补全括号
|
||||
});
|
||||
$.inputArea.setSize('auto','auto');
|
||||
|
||||
// init output code area
|
||||
$.outputArea = CodeMirror.fromTextArea(document.getElementById("outputArea"), {
|
||||
mode: "text/x-java", // JAV
|
||||
theme: "idea", // IDEA主题
|
||||
lineNumbers: true, //显示行号
|
||||
smartIndent: true, // 自动缩进
|
||||
autoCloseBrackets: true// 自动补全括号
|
||||
});
|
||||
$.outputArea.setSize('auto','auto');
|
||||
// init output code area
|
||||
$.outputArea = CodeMirror.fromTextArea(document.getElementById("outputArea"), {
|
||||
mode: "text/x-java", // JAV
|
||||
theme: "idea", // IDEA主题
|
||||
lineNumbers: true, //显示行号
|
||||
smartIndent: true, // 自动缩进
|
||||
autoCloseBrackets: true// 自动补全括号
|
||||
});
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
|
||||
});
|
||||
|
||||
|
||||
const vm = new Vue({
|
||||
el: '#rrapp',
|
||||
data: {
|
||||
formData: {
|
||||
tableSql: "CREATE TABLE 'sys_user_info' (\n" +
|
||||
" 'user_id' int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号',\n" +
|
||||
" 'user_name' varchar(255) NOT NULL COMMENT '用户名',\n" +
|
||||
" 'status' tinyint(1) NOT NULL COMMENT '状态',\n" +
|
||||
" 'create_time' datetime NOT NULL COMMENT '创建时间',\n" +
|
||||
//下面可以留着方便开发调试时打开
|
||||
// " `updateTime` datetime NOT NULL COMMENT '更新时间',\n" +
|
||||
// " ABc_under_Line-Hypen-CamelCase varchar comment '乱七八糟的命名风格',\n" +
|
||||
" PRIMARY KEY ('user_id')\n" +
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息'",
|
||||
options: {
|
||||
dataType: "sql",
|
||||
el: '#rrapp',
|
||||
data: {
|
||||
formData: {
|
||||
tableSql: "CREATE TABLE 'sys_user_info' (\n" +
|
||||
" 'user_id' int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号',\n" +
|
||||
" 'user_name' varchar(255) NOT NULL COMMENT '用户名',\n" +
|
||||
" 'status' tinyint(1) NOT NULL COMMENT '状态',\n" +
|
||||
" 'create_time' datetime NOT NULL COMMENT '创建时间',\n" +
|
||||
//下面可以留着方便开发调试时打开
|
||||
// " `updateTime` datetime NOT NULL COMMENT '更新时间',\n" +
|
||||
// " ABc_under_Line-Hypen-CamelCase varchar comment '乱七八糟的命名风格',\n" +
|
||||
" PRIMARY KEY ('user_id')\n" +
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息'",
|
||||
options: {
|
||||
dataType: "sql",
|
||||
|
||||
authorName: "${(value.author)!!}",
|
||||
packageName: "${(value.packageName)!!}",
|
||||
returnUtilSuccess: "${(value.returnUtilSuccess)!!}",
|
||||
returnUtilFailure: "${(value.returnUtilFailure)!!}",
|
||||
authorName: "${(value.author)!!}",
|
||||
packageName: "${(value.packageName)!!}",
|
||||
returnUtilSuccess: "${(value.returnUtilSuccess)!!}",
|
||||
returnUtilFailure: "${(value.returnUtilFailure)!!}",
|
||||
|
||||
isPackageType: true,
|
||||
isSwagger: false,
|
||||
isAutoImport: false,
|
||||
isWithPackage: false,
|
||||
isComment: true,
|
||||
isLombok: true,
|
||||
isPackageType: true,
|
||||
isSwagger: false,
|
||||
isAutoImport: false,
|
||||
isWithPackage: false,
|
||||
isComment: true,
|
||||
isLombok: true,
|
||||
|
||||
ignorePrefix:"sys_",
|
||||
tinyintTransType: "int",
|
||||
nameCaseType: "CamelCase",
|
||||
timeTransType: "Date"
|
||||
}
|
||||
},
|
||||
templates:[{}],
|
||||
historicalData:[],
|
||||
currentSelect:'plusentity',
|
||||
outputStr: "${(value.outputStr)!!}",
|
||||
outputJson: {}
|
||||
},
|
||||
methods: {
|
||||
//set the template for output 选择页面输出的模板类型
|
||||
setOutputModel: function (event) {
|
||||
const targetModel = event.target.innerText.trim();
|
||||
console.log(targetModel);
|
||||
vm.currentSelect = targetModel ;
|
||||
if(vm.outputStr.length>30){
|
||||
vm.outputStr=vm.outputJson[targetModel];
|
||||
$.outputArea.setValue(vm.outputStr.trim());
|
||||
//console.log(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
}
|
||||
},
|
||||
//switch HistoricalData
|
||||
switchHistoricalData: function (event) {
|
||||
const tableName = event.target.innerText.trim();
|
||||
console.log(tableName);
|
||||
if (window.sessionStorage){
|
||||
const valueSession = sessionStorage.getItem(tableName);
|
||||
vm.outputJson = JSON.parse(valueSession);
|
||||
console.log(valueSession);
|
||||
alert("切换历史记录成功:"+tableName);
|
||||
}else{
|
||||
alert("浏览器不支持sessionStorage");
|
||||
}
|
||||
vm.outputStr=vm.outputJson[vm.currentSelect].trim();
|
||||
$.outputArea.setValue(vm.outputStr);
|
||||
//console.log(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
},
|
||||
setHistoricalData : function (tableName){
|
||||
//add new table only
|
||||
if(vm.historicalData.indexOf(tableName)<0){
|
||||
vm.historicalData.unshift(tableName);
|
||||
}
|
||||
//remove last record , if more than N
|
||||
if(vm.historicalData.length>9){
|
||||
vm.historicalData.splice(9,1);
|
||||
}
|
||||
//get and set to session data
|
||||
const valueSession = sessionStorage.getItem(tableName);
|
||||
//remove if exists
|
||||
if(valueSession!==undefined && valueSession!=null){
|
||||
sessionStorage.removeItem(tableName);
|
||||
}
|
||||
//set data to session
|
||||
sessionStorage.setItem(tableName,JSON.stringify(vm.outputJson));
|
||||
//console.log(vm.historicalData);
|
||||
},
|
||||
//request with formData to generate the code 根据参数生成代码
|
||||
generate : function(){
|
||||
//get value from codemirror
|
||||
vm.formData.tableSql=$.inputArea.getValue();
|
||||
axios.post(basePath+"/code/generate",vm.formData).then(function(res){
|
||||
if(res.status===500||res.data.code===500){
|
||||
console.log(res);
|
||||
error("生成失败,请检查SQL语句!!!"+res.data.msg);
|
||||
return;
|
||||
}
|
||||
setAllCookie();
|
||||
//console.log(res.outputJson);
|
||||
vm.outputJson = res.data.data;
|
||||
//兼容后端返回数据格式
|
||||
// if(res.data){
|
||||
// vm.outputJson = res.data.outputJson;
|
||||
// }else {
|
||||
// vm.outputJson = res.outputJson;
|
||||
// }
|
||||
|
||||
// console.log(vm.outputJson["bootstrap-ui"]);
|
||||
vm.outputStr=vm.outputJson[vm.currentSelect].trim();
|
||||
//console.log(vm.outputJson["bootstrap-ui"]);
|
||||
//console.log(vm.outputStr);
|
||||
$.outputArea.setValue(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
//add to historicalData
|
||||
vm.setHistoricalData(vm.outputJson.tableName);
|
||||
alert("生成成功");
|
||||
});
|
||||
},
|
||||
copy : function (){
|
||||
navigator.clipboard.writeText(vm.outputStr.trim()).then(r => {alert("已复制")});
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
//load all templates for selections 加载所有模板供选择
|
||||
axios.post(basePath+"/template/all",{
|
||||
id:1234
|
||||
}).then(function(res){
|
||||
//console.log(res.templates);
|
||||
// vm.templates = JSON.parse(res.templates);
|
||||
console.log('origin res',res);
|
||||
vm.templates = res.data.data
|
||||
console.log('templates',vm.templates);
|
||||
//兼容后端返回数据格式
|
||||
// if(res.data){
|
||||
// vm.templates = res.data.templates;
|
||||
// }else {
|
||||
// vm.templates = res.templates;
|
||||
// }
|
||||
});
|
||||
},
|
||||
updated: function () {
|
||||
}
|
||||
ignorePrefix: "sys_",
|
||||
tinyintTransType: "int",
|
||||
nameCaseType: "CamelCase",
|
||||
timeTransType: "Date"
|
||||
}
|
||||
},
|
||||
templates: [{}],
|
||||
historicalData: [],
|
||||
currentSelect: 'plusentity',
|
||||
outputStr: "${(value.outputStr)!!}",
|
||||
outputJson: {}
|
||||
},
|
||||
methods: {
|
||||
setOutputModel: function (event) {
|
||||
const targetModel = event.target.innerText.trim();
|
||||
console.log(targetModel);
|
||||
vm.currentSelect = targetModel;
|
||||
if (vm.outputStr.length > 30) {
|
||||
vm.outputStr = vm.outputJson[targetModel];
|
||||
$.outputArea.setValue(vm.outputStr.trim());
|
||||
//console.log(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
}
|
||||
},
|
||||
switchHistoricalData: function (event) {
|
||||
const tableName = event.target.innerText.trim();
|
||||
console.log(tableName);
|
||||
if (window.sessionStorage) {
|
||||
const valueSession = sessionStorage.getItem(tableName);
|
||||
vm.outputJson = JSON.parse(valueSession);
|
||||
console.log(valueSession);
|
||||
alert("切换历史记录成功:" + tableName);
|
||||
} else {
|
||||
alert("浏览器不支持sessionStorage");
|
||||
}
|
||||
vm.outputStr = vm.outputJson[vm.currentSelect].trim();
|
||||
$.outputArea.setValue(vm.outputStr);
|
||||
//console.log(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
},
|
||||
setHistoricalData: function (tableName) {
|
||||
//add new table only
|
||||
if (vm.historicalData.indexOf(tableName) < 0) {
|
||||
vm.historicalData.unshift(tableName);
|
||||
}
|
||||
//remove last record , if more than N
|
||||
if (vm.historicalData.length > 9) {
|
||||
vm.historicalData.splice(9, 1);
|
||||
}
|
||||
//get and set to session data
|
||||
const valueSession = sessionStorage.getItem(tableName);
|
||||
//remove if exists
|
||||
if (valueSession !== undefined && valueSession != null) {
|
||||
sessionStorage.removeItem(tableName);
|
||||
}
|
||||
//set data to session
|
||||
sessionStorage.setItem(tableName, JSON.stringify(vm.outputJson));
|
||||
//console.log(vm.historicalData);
|
||||
},
|
||||
generate: function () {
|
||||
vm.formData.tableSql = $.inputArea.getValue();
|
||||
axios.post(basePath + "/code/generate", vm.formData).then(function (res) {
|
||||
if (res.data.code === '200' && res.data.message === 'success') {
|
||||
setAllCookie();
|
||||
vm.outputJson = res.data.data[0];
|
||||
//兼容后端返回数据格式
|
||||
vm.outputStr = vm.outputJson[vm.currentSelect].trim();
|
||||
$.outputArea.setValue(vm.outputStr);
|
||||
$.outputArea.setSize('auto', 'auto');
|
||||
vm.setHistoricalData(vm.outputJson.tableName);
|
||||
alert("生成成功");
|
||||
return;
|
||||
}
|
||||
console.log(res);
|
||||
error("生成失败,请检查SQL语句!!!" + res.data.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
//load all templates for selections 加载所有模板供选择
|
||||
axios.post(basePath + "/template/all", {
|
||||
id: 1234
|
||||
}).then(function (res) {
|
||||
console.log('origin res', res);
|
||||
vm.templates = res.data.data
|
||||
console.log('templates', vm.templates);
|
||||
//兼容后端返回数据格式
|
||||
});
|
||||
},
|
||||
updated: function () {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 将所有 需要 保留历史纪录的字段写入Cookie中
|
||||
*/
|
||||
function setAllCookie() {
|
||||
var arr = list_key_need_load();
|
||||
for (var str of arr){
|
||||
setOneCookie(str);
|
||||
}
|
||||
var arr = list_key_need_load();
|
||||
for (var str of arr) {
|
||||
setOneCookie(str);
|
||||
}
|
||||
}
|
||||
|
||||
function setOneCookie(key) {
|
||||
setCookie(key, vm.formData.options[key]);
|
||||
setCookie(key, vm.formData.options[key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将所有 历史纪录 重加载回页面
|
||||
*/
|
||||
function loadAllCookie() {
|
||||
//console.log(vm);
|
||||
var arr = list_key_need_load();
|
||||
for (var str of arr){
|
||||
loadOneCookie(str);
|
||||
}
|
||||
//console.log(vm);
|
||||
var arr = list_key_need_load();
|
||||
for (var str of arr) {
|
||||
loadOneCookie(str);
|
||||
}
|
||||
}
|
||||
|
||||
function loadOneCookie(key) {
|
||||
if (getCookie(key)!==""){
|
||||
vm.formData.options[key] = getCookie(key);
|
||||
}
|
||||
if (getCookie(key) !== "") {
|
||||
vm.formData.options[key] = getCookie(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,5 +182,5 @@ function loadOneCookie(key) {
|
||||
* @returns {[string]}
|
||||
*/
|
||||
function list_key_need_load() {
|
||||
return ["authorName","packageName","returnUtilSuccess","returnUtilFailure","ignorePrefix","tinyintTransType","timeTransType"];
|
||||
return ["authorName", "packageName", "returnUtilSuccess", "returnUtilFailure", "ignorePrefix", "tinyintTransType", "timeTransType"];
|
||||
}
|
||||
|
||||
@@ -1,39 +1,42 @@
|
||||
[{
|
||||
"group": "ui",
|
||||
"templates": [{
|
||||
"id": "10",
|
||||
"name": "swagger-ui",
|
||||
"description": "swagger-ui"
|
||||
[
|
||||
{
|
||||
"group": "ui",
|
||||
"templates": [
|
||||
{
|
||||
"id": "10",
|
||||
"name": "swagger-ui",
|
||||
"description": "swagger-ui"
|
||||
},
|
||||
{
|
||||
"id": "11",
|
||||
"name": "element-ui",
|
||||
"description": "element-ui"
|
||||
},
|
||||
{
|
||||
"id": "12",
|
||||
"name": "bootstrap-ui",
|
||||
"description": "bootstrap-ui"
|
||||
},
|
||||
{
|
||||
"id": "13",
|
||||
"name": "layui-edit",
|
||||
"description": "layui-edit"
|
||||
},
|
||||
{
|
||||
"id": "14",
|
||||
"name": "layui-list",
|
||||
"description": "layui-list"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "11",
|
||||
"name": "element-ui",
|
||||
"description": "element-ui"
|
||||
},
|
||||
{
|
||||
"id": "12",
|
||||
"name": "bootstrap-ui",
|
||||
"description": "bootstrap-ui"
|
||||
},
|
||||
{
|
||||
"id": "13",
|
||||
"name": "layui-edit",
|
||||
"description": "layui-edit"
|
||||
},
|
||||
{
|
||||
"id": "14",
|
||||
"name": "layui-list",
|
||||
"description": "layui-list"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "mybatis",
|
||||
"templates": [{
|
||||
"id": "20",
|
||||
"name": "controller",
|
||||
"description": "controller"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "20",
|
||||
"name": "controller",
|
||||
"description": "controller"
|
||||
},
|
||||
{
|
||||
"id": "21",
|
||||
"name": "service",
|
||||
@@ -68,11 +71,12 @@
|
||||
},
|
||||
{
|
||||
"group": "jpa",
|
||||
"templates": [{
|
||||
"id": "30",
|
||||
"name": "entity",
|
||||
"description": "entity"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "30",
|
||||
"name": "entity",
|
||||
"description": "entity"
|
||||
},
|
||||
{
|
||||
"id": "31",
|
||||
"name": "repository",
|
||||
@@ -85,14 +89,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "jdbc-template",
|
||||
"templates": [{
|
||||
"id": "40",
|
||||
"name": "jtdao",
|
||||
"description": "jtdao"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "40",
|
||||
"name": "jtdao",
|
||||
"description": "jtdao"
|
||||
},
|
||||
{
|
||||
"id": "41",
|
||||
"name": "jtdaoimpl",
|
||||
@@ -100,14 +104,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "beetlsql",
|
||||
"templates": [{
|
||||
"id": "50",
|
||||
"name": "beetlmd",
|
||||
"description": "beetlmd"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "50",
|
||||
"name": "beetlmd",
|
||||
"description": "beetlmd"
|
||||
},
|
||||
{
|
||||
"id": "51",
|
||||
"name": "beetlentity",
|
||||
@@ -120,14 +124,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "mybatis-plus",
|
||||
"templates": [{
|
||||
"id": "60",
|
||||
"name": "pluscontroller",
|
||||
"description": "pluscontroller"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "60",
|
||||
"name": "pluscontroller",
|
||||
"description": "pluscontroller"
|
||||
},
|
||||
{
|
||||
"id": "61",
|
||||
"name": "plusservice",
|
||||
@@ -145,14 +149,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "util",
|
||||
"templates": [{
|
||||
"id": "70",
|
||||
"name": "beanutil",
|
||||
"description": "beanutil"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "70",
|
||||
"name": "beanutil",
|
||||
"description": "beanutil"
|
||||
},
|
||||
{
|
||||
"id": "71",
|
||||
"name": "json",
|
||||
@@ -175,14 +179,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "common-mapper",
|
||||
"templates": [{
|
||||
"id": "81",
|
||||
"name": "tkentity",
|
||||
"description": "tkentity"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "81",
|
||||
"name": "tkentity",
|
||||
"description": "tkentity"
|
||||
},
|
||||
{
|
||||
"id": "82",
|
||||
"name": "tkmapper",
|
||||
@@ -190,14 +194,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"group": "renren-fast",
|
||||
"templates": [{
|
||||
"id": "91",
|
||||
"name": "menu-sql",
|
||||
"description": "menu-sql"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "91",
|
||||
"name": "menu-sql",
|
||||
"description": "menu-sql"
|
||||
},
|
||||
{
|
||||
"id": "92",
|
||||
"name": "vue-list",
|
||||
@@ -232,11 +236,12 @@
|
||||
},
|
||||
{
|
||||
"group": "jpa-starp",
|
||||
"templates": [{
|
||||
"id": "101",
|
||||
"name": "starp-entity",
|
||||
"description": "entity"
|
||||
},
|
||||
"templates": [
|
||||
{
|
||||
"id": "101",
|
||||
"name": "starp-entity",
|
||||
"description": "entity"
|
||||
},
|
||||
{
|
||||
"id": "102",
|
||||
"name": "starp-repository",
|
||||
@@ -251,20 +256,22 @@
|
||||
},
|
||||
{
|
||||
"group": "bi",
|
||||
"templates": [{
|
||||
"id": "201",
|
||||
"name": "qliksense",
|
||||
"description": "qlik sense"
|
||||
}]
|
||||
"templates": [
|
||||
{
|
||||
"id": "201",
|
||||
"name": "qliksense",
|
||||
"description": "qlik sense"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "cloud",
|
||||
"templates": [
|
||||
{
|
||||
"id": "301",
|
||||
"name": "bigquery",
|
||||
"description": "GCP BigQuery"
|
||||
},
|
||||
"id": "301",
|
||||
"name": "bigquery",
|
||||
"description": "GCP BigQuery"
|
||||
},
|
||||
{
|
||||
"id": "302",
|
||||
"name": "dataflowjjs",
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>${(value.title)!!}</title>
|
||||
<meta name="keywords" content="${(value.keywords)!!}">
|
||||
<title>代码生成</title>
|
||||
|
||||
<script>
|
||||
/*统计代码,便于统计流量,请勿移除,谢谢!*/
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?97fd5ca1a4298ac8349c7e0de9029a0f";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
//set base path for fixing the revertProxy forwarding path issue
|
||||
var basePath = "${request.contextPath}";
|
||||
console.log("basePath",basePath)
|
||||
var basePath = "/system/generator";
|
||||
</script>
|
||||
|
||||
<#if value.mode=='local'>
|
||||
<#include "/newui-import-local.html">
|
||||
<#else>
|
||||
<#include "/newui-import-CDN.html">
|
||||
</#if>
|
||||
<script src="/statics/libs/jquery/jquery.min.js"></script>
|
||||
<script src="/statics/libs/vue/vue.min.js"></script>
|
||||
<script src="/statics/libs/axios/axios.min.js"></script>
|
||||
<script src="/statics/libs/element-ui/index.min.js"></script>
|
||||
<link href="/statics/libs/element-ui/index.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!-- bootstrap -->
|
||||
<script src="/statics/libs/bootstrap/bootstrap.bundle.min.js" type="application/javascript"></script>
|
||||
<link href="/statics/libs/bootstrap/bootstrap.min.css" type="text/css" rel="stylesheet" />
|
||||
<!-- 引入 Bootstrap Icons CSS -->
|
||||
<link href="/statics/libs/bootstrap-icons/bootstrap-icons.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!--common.js-->
|
||||
<script src="/statics/js/common.js"></script>
|
||||
<!-- <link rel="stylesheet" href="/statics/css/main.css"> -->
|
||||
|
||||
<script src="/statics/libs/toastr.js/toastr.min.js"></script>
|
||||
<!-- Toastr CSS -->
|
||||
<link href="/statics/libs/toastr.js/toastr.min.css" rtype="text/css" rel="stylesheet" >
|
||||
|
||||
<!-- import codemirror -->
|
||||
<script src="/statics/libs/codemirror/codemirror.min.js"></script>
|
||||
<script src="/statics/libs/codemirror/mode/sql/sql.min.js"></script>
|
||||
<script src="/statics/libs/codemirror/mode/clike/clike.min.js"></script>
|
||||
<link href="/statics/libs/codemirror/codemirror.min.css" type="text/css" rel="stylesheet" >
|
||||
<link href="/statics/libs/codemirror/theme/idea.min.css" type="text/css" rel="stylesheet" >
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<!--###################################################-->
|
||||
<!--### StaticFile CDN : by https://www.staticfile.org/ -->
|
||||
<!--###################################################-->
|
||||
|
||||
<!--jquery | vue | element-ui | axios-->
|
||||
<script src="//cdn.staticfile.net/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="//cdn.staticfile.net/vue/2.6.14/vue.min.js"></script>
|
||||
<script src="//cdn.staticfile.net/axios/0.26.0/axios.min.js"></script>
|
||||
<script src="//cdn.staticfile.net/element-ui/2.15.7/index.min.js"></script>
|
||||
<link href="//cdn.staticfile.net/element-ui/2.15.7/theme-chalk/index.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!-- bootstrap -->
|
||||
<script src="//cdn.staticfile.net/bootstrap/5.1.3/js/bootstrap.bundle.min.js" type="application/javascript"></script>
|
||||
<link href="//cdn.staticfile.net/bootstrap/5.1.3/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
|
||||
<!-- 引入 Bootstrap Icons CSS -->
|
||||
<link href="//cdn.staticfile.net/bootstrap-icons/1.8.1/font/bootstrap-icons.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!--common.js-->
|
||||
<script src="${request.contextPath}/statics/js/common.js"></script>
|
||||
<!-- <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css"> -->
|
||||
|
||||
<script src="//cdn.staticfile.net/toastr.js/2.1.4/toastr.min.js"></script>
|
||||
<!-- Toastr CSS -->
|
||||
<link href="//cdn.staticfile.net/toastr.js/2.1.4/toastr.min.css" rtype="text/css" rel="stylesheet" >
|
||||
|
||||
<!-- import codemirror -->
|
||||
<script src="//cdn.staticfile.net/codemirror/5.65.2/codemirror.min.js"></script>
|
||||
<script src="//cdn.staticfile.net/codemirror/5.65.2/mode/sql/sql.min.js"></script>
|
||||
<script src="//cdn.staticfile.net/codemirror/5.65.2/mode/clike/clike.min.js" type="application/javascript"></script>
|
||||
<link href="//cdn.staticfile.net/codemirror/5.65.2/codemirror.min.css" type="text/css" rel="stylesheet" >
|
||||
<link href="//cdn.staticfile.net/codemirror/5.65.2/theme/idea.min.css" type="text/css" rel="stylesheet" >
|
||||
@@ -1,31 +0,0 @@
|
||||
<!--###################################################-->
|
||||
<!--### CDN version -->
|
||||
<!--###################################################-->
|
||||
|
||||
<!--jquery | vue | element-ui | axios-->
|
||||
<script src="${request.contextPath}/statics/libs/jquery/jquery.min.js"></script>
|
||||
<script src="${request.contextPath}/statics/libs/vue/vue.min.js"></script>
|
||||
<script src="${request.contextPath}/statics/libs/axios/axios.min.js"></script>
|
||||
<script src="${request.contextPath}/statics/libs/element-ui/index.min.js"></script>
|
||||
<link href="${request.contextPath}/statics/libs/element-ui/index.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!-- bootstrap -->
|
||||
<script src="${request.contextPath}/statics/libs/bootstrap/bootstrap.bundle.min.js" type="application/javascript"></script>
|
||||
<link href="${request.contextPath}/statics/libs/bootstrap/bootstrap.min.css" type="text/css" rel="stylesheet" />
|
||||
<!-- 引入 Bootstrap Icons CSS -->
|
||||
<link href="${request.contextPath}/statics/libs/bootstrap-icons/bootstrap-icons.min.css" type="text/css" rel="stylesheet" />
|
||||
|
||||
<!--common.js-->
|
||||
<script src="${request.contextPath}/statics/js/common.js"></script>
|
||||
<!-- <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css"> -->
|
||||
|
||||
<script src="${request.contextPath}/statics/libs/toastr.js/toastr.min.js"></script>
|
||||
<!-- Toastr CSS -->
|
||||
<link href="${request.contextPath}/statics/libs/toastr.js/toastr.min.css" rtype="text/css" rel="stylesheet" >
|
||||
|
||||
<!-- import codemirror -->
|
||||
<script src="${request.contextPath}/statics/libs/codemirror/codemirror.min.js"></script>
|
||||
<script src="${request.contextPath}/statics/libs/codemirror/mode/sql/sql.min.js"></script>
|
||||
<script src="${request.contextPath}/statics/libs/codemirror/mode/clike/clike.min.js"></script>
|
||||
<link href="${request.contextPath}/statics/libs/codemirror/codemirror.min.css" type="text/css" rel="stylesheet" >
|
||||
<link href="${request.contextPath}/statics/libs/codemirror/theme/idea.min.css" type="text/css" rel="stylesheet" >
|
||||
@@ -49,26 +49,16 @@
|
||||
z-index: 1000;
|
||||
}
|
||||
.last-card {
|
||||
margin-bottom: 70px; /* 增加输出代码区域与底部的距离 */
|
||||
margin-bottom: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div class="header-bar">
|
||||
<div class="logo">
|
||||
<i class="bi bi-code"></i>
|
||||
${(value.title)!!}
|
||||
</div>
|
||||
<small>${(value.slogan)!!}</small>
|
||||
<div class="links">
|
||||
<a href="https://github.com/moshowgame/SpringBootCodeGenerator/" target="_blank">GitHub</a> <a href="https://zhengkai.blog.csdn.net/" target="_blank">CSDN</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<blockquote class="quote-secondary">
|
||||
${(value.description)!!}
|
||||
欢迎使用Java代码生成工具!!!
|
||||
</blockquote>
|
||||
<div class="col-lg-12">
|
||||
<div id="rrapp" v-cloak>
|
||||
@@ -91,7 +81,7 @@
|
||||
<hr>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title m-0">生成设置</h5>
|
||||
<h5 class="card-title m-0">生成设置 <el-button type="primary" icon="el-icon-caret-right" @click="generate">生成</el-button></h5>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="折叠">
|
||||
<i class="fas fa-minus"></i>
|
||||
@@ -172,29 +162,6 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<el-button type="primary" icon="el-icon-caret-right" @click="generate">生成</el-button>
|
||||
<el-button type="primary" icon="el-icon-document-copy" @click="copy" plain>复制</el-button>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="折叠">
|
||||
<i class="fas fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<span v-if="historicalData.length > 0">
|
||||
<el-button-group>
|
||||
<el-button type="primary" plain disabled round>历史记录</el-button>
|
||||
<span v-for="(item, index) in historicalData" :key="index">
|
||||
<el-button @click="switchHistoricalData">{{ item }}</el-button>
|
||||
</span>
|
||||
</el-button-group>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@@ -246,14 +213,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="${request.contextPath}/statics/js/main.js"></script>
|
||||
<script src="/statics/js/main.js"></script>
|
||||
<script>
|
||||
//console.log(vm);
|
||||
vm.formData.options.authorName="${(value.author)!!}";
|
||||
vm.formData.options.packageName="${(value.packageName)!!}";
|
||||
vm.formData.options.returnUtilSuccess="${(value.returnUtilSuccess)!!}";
|
||||
vm.formData.options.returnUtilFailure="${(value.returnUtilFailure)!!}";
|
||||
vm.outputStr="${(value.outputStr)!!}";
|
||||
loadAllCookie()
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user