修正移动端模板的一些问题,textarea v-model 重复问题;maxlength 为 0 问题;列表 query 参数不对问题

This commit is contained in:
thinkgem
2025-04-27 14:24:04 +08:00
parent 7358034209
commit 864e996f64
2 changed files with 7 additions and 6 deletions

View File

@@ -41,11 +41,11 @@
%> %>
<% if(c.showType == 'input'){ %> <% if(c.showType == 'input'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180"> <u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text" maxlength="${c.dataLength}"></u-input> <u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''}></u-input>
</u-form-item> </u-form-item>
<% }else if(c.showType == 'textarea'){ %> <% }else if(c.showType == 'textarea'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180" label-position="top"> <u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180" label-position="top">
<u-input type="textarea" placeholder="请输入${c.columnLabel}" v-model="model.testTextarea" height="100" maxlength="${c.dataLength}" /> <u-input type="textarea" placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" height="100"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''} />
</u-form-item> </u-form-item>
<% }else if(c.showType == 'select' || c.showType == 'select_multiple'){ <% }else if(c.showType == 'select' || c.showType == 'select_multiple'){
var isMultiple = (c.showType == 'select_multiple'); %> var isMultiple = (c.showType == 'select_multiple'); %>
@@ -63,7 +63,7 @@
<% }else if(c.showType == 'date' || c.showType == 'datetime'){ <% }else if(c.showType == 'date' || c.showType == 'datetime'){
var isTime = (c.showType == 'datetime'); %> var isTime = (c.showType == 'datetime'); %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180"> <u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" format="yyyy-MM-dd${isTime?' HH:mm':''}" type="text" maxlength="${c.dataLength}"></u-input> <u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" format="yyyy-MM-dd${isTime?' HH:mm':''}" type="text"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''}></u-input>
</u-form-item> </u-form-item>
<% }else if(c.showType == 'userselect'){ %> <% }else if(c.showType == 'userselect'){ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180"> <u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
@@ -87,7 +87,7 @@
</u-form-item> </u-form-item>
<% }else{ %> <% }else{ %>
<u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180"> <u-form-item label="${c.columnLabel}" prop="${c.attrName}" label-width="180">
<u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text" maxlength="${c.dataLength}"></u-input> <u-input placeholder="请输入${c.columnLabel}" v-model="model.${c.attrName}" type="text"${c.dataLength != "0" ? ' maxlength="'+c.dataLength+'"' : ''}></u-input>
</u-form-item> </u-form-item>
<% } %> <% } %>
<% <%

View File

@@ -15,7 +15,7 @@
<u-cell-group class="list" :border="false"> <u-cell-group class="list" :border="false">
<u-swipe-action :options="options" v-for="(item, index) in list" :key="item.id" :index="index" @click="optionsClick"> <u-swipe-action :options="options" v-for="(item, index) in list" :key="item.id" :index="index" @click="optionsClick">
<% <%
var idParam = '', idParam2 = ''; var idParam = '', idParam2 = '', queryField = '';
for(pk in table.pkList){ for(pk in table.pkList){
idParam = idParam + (pk.attrName + '=\'+item.' + pk.attrName); idParam = idParam + (pk.attrName + '=\'+item.' + pk.attrName);
idParam2 = idParam2 + ('item.' + pk.attrName); idParam2 = idParam2 + ('item.' + pk.attrName);
@@ -39,6 +39,7 @@
<text slot="label">创建者:{{item.createBy}} &nbsp;|&nbsp; 时间:{{item.createDate}}</text> <text slot="label">创建者:{{item.createBy}} &nbsp;|&nbsp; 时间:{{item.createDate}}</text>
</u-cell-item> </u-cell-item>
<% <%
queryField = c.attrName;
break; break;
} }
} }
@@ -130,7 +131,7 @@ export default {
search(value) { search(value) {
this.list = []; this.list = [];
this.query.pageNo = 0; this.query.pageNo = 0;
this.query.testInput = value; this.query.${queryField} = value;
this.loadList(); this.loadList();
}, },
navTo(url) { navTo(url) {