mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2025-12-26 13:52:39 +08:00
commit
adab6d7809
@ -42,3 +42,28 @@ window.confirm = function(msg, callback){
|
|||||||
function isBlank(value) {
|
function isBlank(value) {
|
||||||
return !value || !/\S/.test(value)
|
return !value || !/\S/.test(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setCookie(key, val, expire_second) {
|
||||||
|
var d = new Date();
|
||||||
|
var expires ="";
|
||||||
|
if (expire_second){
|
||||||
|
d.setDate(d.getTime()+(expire_second*1000));
|
||||||
|
expires='; expires=' + d.toGMTSring();
|
||||||
|
}
|
||||||
|
document.cookie = key + "="+ val + expires;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCookie(name) {
|
||||||
|
var data = "";
|
||||||
|
if (document.cookie){
|
||||||
|
var arr = document.cookie.split(';');
|
||||||
|
for (var str of arr) {
|
||||||
|
var temp = str.split("=")
|
||||||
|
if (temp[0].replace(/(^\s*)/g,'') === name){
|
||||||
|
data = unescape(temp[1]);
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
@ -123,6 +123,7 @@ const vm = new Vue({
|
|||||||
error("生成失败");
|
error("生成失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setAllCookie();
|
||||||
//console.log(res.outputJson);
|
//console.log(res.outputJson);
|
||||||
vm.outputJson=res.outputJson;
|
vm.outputJson=res.outputJson;
|
||||||
// console.log(vm.outputJson["bootstrap-ui"]);
|
// console.log(vm.outputJson["bootstrap-ui"]);
|
||||||
@ -154,3 +155,41 @@ const vm = new Vue({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将所有 需要 保留历史纪录的字段写入Cookie中
|
||||||
|
*/
|
||||||
|
function setAllCookie() {
|
||||||
|
var arr = list_key_need_load();
|
||||||
|
for (var str of arr){
|
||||||
|
setOneCookie(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setOneCookie(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadOneCookie(key) {
|
||||||
|
if (getCookie(key)!==""){
|
||||||
|
vm.formData.options[key] = getCookie(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 所有 需要 纪录的 字段写入数组
|
||||||
|
* @returns {[string]}
|
||||||
|
*/
|
||||||
|
function list_key_need_load() {
|
||||||
|
return ["authorName","packageName","returnUtilSuccess","returnUtilFailure","ignorePrefix","tinyintTransType","timeTransType"];
|
||||||
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
/**
|
/**
|
||||||
* @description ${classInfo.classComment}
|
* @description ${classInfo.classComment}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.mapper;</#if>
|
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.repository;</#if>
|
||||||
<#if isAutoImport?exists && isAutoImport==true>import ${packageName}.entity.${classInfo.className};
|
<#if isAutoImport?exists && isAutoImport==true>import ${packageName}.entity.${classInfo.className};
|
||||||
|
|
||||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||||
|
|||||||
@ -140,6 +140,7 @@
|
|||||||
vm.formData.options.returnUtilSuccess="${(value.returnUtilSuccess)!!}";
|
vm.formData.options.returnUtilSuccess="${(value.returnUtilSuccess)!!}";
|
||||||
vm.formData.options.returnUtilFailure="${(value.returnUtilFailure)!!}";
|
vm.formData.options.returnUtilFailure="${(value.returnUtilFailure)!!}";
|
||||||
vm.outputStr="${(value.outputStr)!!}";
|
vm.outputStr="${(value.outputStr)!!}";
|
||||||
|
loadAllCookie()
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user