Comparing version 1.1.7 to 1.1.8
@@ -48,2 +48,4 @@ <%# | ||
<% for (let i=0; i<50; i++) { %><br><% } %> | ||
<style> | ||
@@ -50,0 +52,0 @@ th:nth-child(1) {width: 8%;} |
@@ -32,3 +32,3 @@ /*<%# | ||
// <%# const name = c.COLUMN_NAME; %> | ||
// <%# const nick = (c.COLUMN_COMMENT || name).substr(0,20); %> | ||
// <%# const nick = (c.COLUMN_COMMENT || name).substr(0,20).split(' ')[0]; %> | ||
// <%# if (i==0) { %> | ||
@@ -35,0 +35,0 @@ { field: '<%= name %>', name: '<%= nick %>', show: true, sortEnable: true, type: '<%= c.COLUMN_TYPE %>', width: 100 }, |
@@ -34,7 +34,8 @@ /*<%# | ||
// <%# const cname = c.COLUMN_NAME; %> | ||
// <%# const cnick = (c.COLUMN_COMMENT || cname).split(' ')[0]; %> | ||
// <%# if (c.COLUMN_KEY === 'PRI') { continue; } %> | ||
// <%# if (c.IS_NULLABLE === 'YES') {%> | ||
'<%= cname %>': { rgx: /.*/, msg: '<%= c.COLUMN_COMMENT || cname %>输入有误' }, | ||
'<%= cname %>': { rgx: /.*/, msg: '(<%= cnick %>输入有误' }, | ||
// <%# } else { %> | ||
'<%= cname %>': { rgx: /.+/, msg: '<%= c.COLUMN_COMMENT || cname %>不能为空' }, | ||
'<%= cname %>': { rgx: /.+/, msg: '<%= cnick %>不能为空' }, | ||
// <%# } %> | ||
@@ -41,0 +42,0 @@ // <%# } %> |
@@ -51,3 +51,4 @@ /*<%# | ||
// <%# for (const c of columns) { %> | ||
'<%= c.COLUMN_NAME %>': { rgx: /.*/, msg: '<%= c.COLUMN_COMMENT || c.COLUMN_NAME %>输入有误' }, | ||
// <%# const cnick = (c.COLUMN_COMMENT || c.COLUMN_NAME).split(' ')[0]; %> | ||
'<%= c.COLUMN_NAME %>': { rgx: /.*/, msg: '<%= cnick %>输入有误' }, | ||
// <%# } %> | ||
@@ -54,0 +55,0 @@ } |
@@ -81,3 +81,3 @@ xf.module({ | ||
t.Modal.callback({}); | ||
t.Page.close(); | ||
t.Page.back(); | ||
}); | ||
@@ -84,0 +84,0 @@ }, |
@@ -61,2 +61,8 @@ | ||
// 模式 | ||
mode: function () { | ||
var para = this.Context.para || {}; | ||
return para.mode; | ||
}, | ||
// 可见字段 | ||
@@ -459,2 +465,12 @@ listFields: function () { | ||
return JSON.stringify(row); | ||
}, | ||
// 选择并返回 | ||
selectBack: function (e) { | ||
var t = this; | ||
var row = t.selectedRow; | ||
if (row) { | ||
t.Modal.callback(row); | ||
t.Page.back(); | ||
} | ||
} | ||
@@ -461,0 +477,0 @@ }, |
@@ -5,5 +5,5 @@ xf.module({ | ||
module: function() { | ||
module: function () { | ||
var Builder = function(context, opt) { | ||
var Builder = function (context, opt) { | ||
@@ -56,3 +56,3 @@ var t = this; | ||
// 创建Vue对象 | ||
vue: function(name) { | ||
vue: function (name) { | ||
@@ -69,6 +69,6 @@ var t = this; | ||
computed: { | ||
Page: function() { return t.context.page; }, // 页面对象 | ||
View: function() { return t.context.view; }, // 视图对象 | ||
Context: function() { return t.context; }, // 上下文 | ||
Modal: function() { return t; } // 视图控制器 | ||
Page: function () { return t.context.page; }, // 页面对象 | ||
View: function () { return t.context.view; }, // 视图对象 | ||
Context: function () { return t.context; }, // 上下文 | ||
Modal: function () { return t; } // 视图控制器 | ||
}, | ||
@@ -109,3 +109,3 @@ methods: { | ||
// 视图控制器创建就绪 | ||
ready: function(fn) { | ||
ready: function (fn) { | ||
var t = this; | ||
@@ -120,3 +120,3 @@ var c = t.context; | ||
// 提交数据 | ||
post: function(url, data, option) { | ||
post: function (url, data, option) { | ||
var t = this; | ||
@@ -128,3 +128,3 @@ | ||
opt.beforeSend = function() { | ||
opt.beforeSend = function () { | ||
t._postRemain = t._postRemain || 0; | ||
@@ -135,3 +135,3 @@ t._postRemain++; | ||
opt.beforeReady = function() { | ||
opt.beforeReady = function () { | ||
t._postRemain--; | ||
@@ -147,3 +147,3 @@ if (t._postRemain === 0) { | ||
// 检查数据 | ||
checker: function(row, rules, opt) { | ||
checker: function (row, rules, opt) { | ||
var t = this; | ||
@@ -153,3 +153,3 @@ opt = opt || {}; | ||
// 在元素上显示错误 | ||
var tip = function(key, msg) { | ||
var tip = function (key, msg) { | ||
var el = opt.box.querySelector('[data-checker="' + key + '"]'); | ||
@@ -163,3 +163,3 @@ if (!el) return false; | ||
el._checker_msg = xf.el('div', { className: 'checker-msg' }); | ||
el.addEventListener('click', function(e) { | ||
el.addEventListener('click', function (e) { | ||
e.target.classList.remove('error'); | ||
@@ -208,5 +208,20 @@ el._checker_msg.remove(); | ||
// 回调函数 | ||
callback: function(para) { | ||
callback: function (para) { | ||
xf.log('[#93B983]callback', para); | ||
return this.context.para.callback.call(this, para); | ||
}, | ||
// 到其他页面选取信息 | ||
goSelect: function (para, map, key) { | ||
var t = this; | ||
var page = t.context.page; | ||
var sec = para.split(/\#|\./g); | ||
var name = '@' + sec[1] + '-grid'; | ||
page.go(name, { | ||
mode: 'select', | ||
callback: function (item) { | ||
map[key] = item[sec[2]]; | ||
} | ||
}); | ||
} | ||
@@ -218,3 +233,3 @@ }; | ||
// 在数组中,根据value找key | ||
Builder.findKey = function(arr, val) { | ||
Builder.findKey = function (arr, val) { | ||
arr = arr || []; | ||
@@ -221,0 +236,0 @@ var len = arr.length; |
{ | ||
"name": "koa-rtapi", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "koa api in rtworld company", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
521397
13208