diff --git a/src/main/resources/modules/SpringBoot/java/module/mpr/MySQL_mapper.xml b/src/main/resources/modules/SpringBoot/java/module/mpr/MySQL_mapper.xml index 264032b1..baf379ce 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mpr/MySQL_mapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/mpr/MySQL_mapper.xml @@ -23,7 +23,6 @@ WHERE `IS_DELETED` = 0 - <#list table.fields as f> <#if f.isQuery> <#if f.fieldType.javaType() == "Boolean"> diff --git a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl index c87789a7..421e861e 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl @@ -47,7 +47,7 @@ .then(function (response) { if (response.data.errors && response.data.errors.length == 0) { nav.barFinish(); - } else if(response.data.errors && response.data.errors.length > 0) { + } else if (response.data.errors && response.data.errors.length > 0) { nav.barError(); } else { response.data = {errors: [{message: '服务器响应错误'}]}; @@ -186,10 +186,6 @@ this.mMethod = "create"; this.post(callback); }; - this.create = function (callback) { - this.mMethod = "create"; - this.post(callback); - }; this.delete = function (callback) { this.mMethod = "delete"; this.post(callback); @@ -290,7 +286,7 @@ new Ajax() .module(this.module) .target(this.target) - .data( this.vm) + .data(this.vm) .exports(function (response) { if (response.errors.length > 0) { nav.e(response.errors[0].message); @@ -502,23 +498,50 @@ onClose: callback }); }, + // 本标签打开 toOpen: function (url) { this.tipShow(); var url = url.substring(0, 1) == "/" ? url.substring(1) : url; - $("body").append($("")) + $("body").append($("")) document.getElementById("wb-open").click(); $("#wb-open").remove(); }, + // 新标签打开 toOpenNew: function (url) { var url = url.substring(0, 1) == "/" ? url.substring(1) : url; - $("body").append($("")) + $("body").append($("")) document.getElementById("wb-open").click(); $("#wb-open").remove(); }, + // 回到首页 toHome: function () { this.tipShow(); location.href = this.context + "/" }, + // 打开一个新Tab + toOpenTab: function (tab) { + if (window.index) { + window.index.addTab(tab) + } else if (window.parent.index) { + window.parent.index.addTab(tab) + } + }, + // 关闭Tab + toCloseTab: function (tabName) { + if (window.index) { + window.index.removeTab(tabName) + } else if (window.parent.index) { + window.parent.index.removeTab(tabName) + } + }, + // 关闭当前Tab + toCloseCurTab: function () { + if (window.index) { + window.index.removeTab(window.index.activeTabName) + } else if (window.parent.index) { + window.parent.index.removeTab(window.parent.index.activeTabName) + } + }, // 滚动屏蔽至顶部 scrollToTop: function () { var distance = document.documentElement.scrollTop || document.body.scrollTop; @@ -577,15 +600,15 @@ } } }, - setCookie:function (name, value, expiretime) { + setCookie: function (name, value, expiretime) { var exdate = new Date(); exdate.setDate(exdate.getTime() + expiretime); document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exdate.toGMTString() + ";path=/"; }, - getCookie:function (name) { - if (document.cookie.length > 0) { + getCookie: function (name) { + if (document.cookie.length > 0) { c_start = document.cookie.indexOf(name + "=") - if (c_start != -1){ + if (c_start != -1) { c_start = c_start + name.length + 1 c_end = document.cookie.indexOf(";", c_start) if (c_end == -1) @@ -595,7 +618,7 @@ } return "" }, - clearCookie:function (name) { + clearCookie: function (name) { this.setCookie(name, "", -1); } } @@ -609,9 +632,20 @@ }, props: { value: { - type: String, + type: String | Object, default: '' }, + valueFor: { + type: String, + default: 'key', + validator: function (value) { + var r = (['key', 'value', 'item'].indexOf(value) !== -1); + if (!r) { + console.error("value-for的值只能是['key','value','item']中的一个.") + } + return r; + } + }, dictName: { type: String, default: '' @@ -624,31 +658,42 @@ type: String, default: '' }, + change: { + type: Function, + default: function (item) { + + } + } }, methods: { - input: function (value) { - this.$emit('input', value); - } + input: function (item) { + switch (this.valueFor) { + case "key": + this.$emit('input', item.key); + break; + case "value": + this.$emit('input', item.value); + break; + case "item": + this.$emit('input', item); + break; + } + }, }, created: function () { if (this.dictName) { - new Ajax() - .module("system") - .target("dict") - .method("load") - .data({dictName: this.dictName}) - .post(function (response) { - if (response.errors.length > 0) { - console.error(response.errors[0].message) - } else { - this.options = response.dictItems; - } - }.bind(this)) + new Ajax("system", "dict", "load").data({dictName: this.dictName}).post(function (response) { + if (response.errors.length > 0) { + console.error(response.errors[0].message) + } else { + this.options = response.dictItems; + } + }.bind(this)); } }, template: '' + - '' + - ' ' + + '' + + ' ' + ' {{ item.value }}' + ' {{ item.key }}' + ' ' + @@ -659,7 +704,7 @@ data: function () { return { options: [], - props:{ + props: { multiple: false, checkStrictly: true } @@ -689,18 +734,13 @@ } }, created: function () { - new Ajax() - .module("system") - .target("dept") - .method("tree") - .data({dictName: this.dictName}) - .post(function (response) { - if (response.errors.length > 0) { - console.error(response.errors[0].message) - } else { - this.options = response.result; - } - }.bind(this)) + new Ajax("system", "dept", "tree").data({dictName: this.dictName}).post(function (response) { + if (response.errors.length > 0) { + console.error(response.errors[0].message) + } else { + this.options = response.result; + } + }.bind(this)) }, template: '' + '