Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复数据显示模板list1无法翻页错误 #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions assets/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ var $vue = new Vue({
return item[_.camelCase(attributeName)];
},

largeImage: function(item, attributeName) {
var imageUrl = this.getAttributeValue(item, attributeName);
largeImage: function(imageUrl) {
//var imageUrl = this.getAttributeValue(item, attributeName);
Swal.fire({
imageUrl: imageUrl,
showConfirmButton: false,
Expand Down Expand Up @@ -101,7 +101,7 @@ var $vue = new Vue({

this.pageType = 'loading';
$api.get(this.apiUrl + '/ss.form/' + this.siteId + '/' + this.formId, {
page: page
params: {page: page}
}).then(function (res) {
$this.fieldInfoList = res.data.fieldInfoList;
$this.allAttributeNames = res.data.allAttributeNames;
Expand Down
7 changes: 6 additions & 1 deletion assets/js/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ if (window.DatePicker) {
if (!error) {
var res = JSON.parse(file.serverId);
var fieldInfo = _.find(this.fieldInfoList, function(o) { return o.id === res.fieldId; });
fieldInfo.value = res.value;
if (fieldInfo.value){
fieldInfo.value += ',' + res.value;
}
else{
fieldInfo.value = res.value;
}
}
},

Expand Down
5 changes: 2 additions & 3 deletions pages/logAdd.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,15 @@ <h4 v-else class="m-t-0 m-b-30 header-title">新增</h4>

<template v-else-if="fieldInfo.fieldType === 'Image'">
<file-pond
:allow-multiple="false"
:allow-multiple="true"
:server="getUploadUrl(fieldInfo)"
:files="files"
accepted-file-types="image/jpeg, image/png, image/webp"
label-idle="点击上传或将图片拖动至此区域..."
label-file-processing="上传中..."
label-file-processing-complete="上传成功"
v-on:processfile="imageUploaded"
v-on:removefile="imageRemoved(fieldInfo)"
></file-pond>
v-on:removefile="imageRemoved(fieldInfo)"/>

<input
v-model="fieldInfo.value"
Expand Down
7 changes: 6 additions & 1 deletion pages/logAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ var methods = {
if (!error) {
var res = JSON.parse(file.serverId);
var fieldInfo = _.find(this.fieldInfoList, function(o) { return o.id === res.fieldId; });
fieldInfo.value = res.value;
if (fieldInfo.value){
fieldInfo.value += ',' + res.value;
}
else{
fieldInfo.value = res.value;
}
}
},

Expand Down
10 changes: 6 additions & 4 deletions pages/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@
<tbody>
<tr v-for="item in items" :key="item.id">
<td v-for="attributeName in allAttributeNames" :key="attributeName" v-if="listAttributeNames.indexOf(attributeName) !== -1">
<img v-if="getAttributeType(attributeName) === 'Image'" :src="getAttributeValue(item, attributeName)" style="max-height: 100px; max-width: 100px; cursor: pointer;" v-on:click="largeImage(item, attributeName)">
<div v-else>
{{ getAttributeValue(item, attributeName) }}
</div>
<div v-if="getAttributeType(attributeName) === 'Image'">
<img v-for="imageUrl in getAttributeValue(item, attributeName).split(',')" :src="imageUrl" style="max-height: 100px; max-width: 100px; cursor: pointer;" v-on:click="largeImage(imageUrl)">
</div>
<div v-else>
{{ getAttributeValue(item, attributeName) }}
</div>
</td>
<td v-if="isReply">
<strong v-if="item.isReplied" class="text-primary">已回复</strong>
Expand Down
4 changes: 2 additions & 2 deletions pages/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ var methods = {
return item[_.lowerFirst(attributeName)];
},

largeImage: function(item, attributeName) {
var imageUrl = this.getAttributeValue(item, attributeName);
largeImage: function(imageUrl) {
//var imageUrl = this.getAttributeValue(item, attributeName);
swal2.fire({
imageUrl: imageUrl,
showConfirmButton: false,
Expand Down
14 changes: 8 additions & 6 deletions templates/list1/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>

<head>
Expand All @@ -23,20 +23,22 @@
<template v-else>
<div class="card-box">
<div class="table-responsive mt-3">

<table class="table tablesaw table-hover m-0">
<thead>
<tr>
<th v-for="attributeName in allAttributeNames" v-if="listAttributeNames.indexOf(attributeName) !== -1">
<th v-for="attributeName in allAttributeNames" v-if="listAttributeNames.indexOf(attributeName) !== -1 && getAttributeType(attributeName) !== 'Hidden'">
{{ getAttributeText(attributeName) }}
</th>
</tr>
</thead>
<tbody>
<tr v-for="item in items">
<td v-for="attributeName in allAttributeNames" :key="attributeName" v-if="listAttributeNames.indexOf(attributeName) !== -1">

<img v-if="getAttributeType(attributeName) === 'Image'" :src="getAttributeValue(item, attributeName)" style="max-height: 100px; max-width: 100px; cursor: pointer;" v-on:click="largeImage(item, attributeName)">
<div v-else>
<td v-for="attributeName in allAttributeNames" :key="attributeName" v-if="listAttributeNames.indexOf(attributeName) !== -1 && getAttributeType(attributeName) !== 'Hidden'">
<div v-if="getAttributeType(attributeName) === 'Image'">
<img v-for="imageUrl in getAttributeValue(item, attributeName).split(',')" :src="imageUrl" style="max-height: 100px; max-width: 100px; cursor: pointer;" v-on:click="largeImage(imageUrl)">
</div>
<div v-else>
{{ getAttributeValue(item, attributeName) }}
</div>

Expand Down
17 changes: 11 additions & 6 deletions templates/submit1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script type="text/javascript" src="../../assets/lib/iframe-resizer-3.6.3/iframeResizer.contentWindow.min.js"></script>
<link href="../../assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.filepond--item {
width: calc(33% - .5em);
}
</style>
</head>

<body class="p-3">
<div id="form_submit">
<template v-if="pageType === 'form'">
<div v-for="fieldInfo in fieldInfoList" class="form-group">
<div v-for="fieldInfo in fieldInfoList" v-if="fieldInfo.fieldType !== 'Hidden'" class="form-group">
<label> {{ fieldInfo.title }} <span v-if="fieldInfo.validate.indexOf('required') !== -1" class="text-danger">*</span>
<small v-show="errors.has(fieldInfo.title)" class="text-danger">{{ errors.first(fieldInfo.title) }}</small>
</label>
Expand Down Expand Up @@ -71,16 +76,16 @@
</template>
<template v-else-if="fieldInfo.fieldType === 'Image'">
<file-pond
:allow-multiple="false"
allow-multiple="true"
max-files="3"
:server="getUploadUrl(fieldInfo)"
:files="files"
accepted-file-types="image/jpeg, image/png, image/webp"
label-idle="点击上传或将图片拖动至此区域..."
label-file-processing="上传中..."
label-file-processing-complete="上传成功"
v-on:processfile="imageUploaded"
v-on:removefile="imageRemoved(fieldInfo)"
></file-pond>
v-on:removefile="imageRemoved(fieldInfo)"/>

<input
v-model="fieldInfo.value"
Expand Down Expand Up @@ -116,8 +121,8 @@
</div>
</div>
<hr />
<div class="text-center">
<button type="button" @click="btnSubmitClick" class="btn btn-primary w-md mr-2">提 交</button>
<div style="text-align: right;">
<button type="button" @click="btnSubmitClick" style="background-color: #CC0000; border-color: #CC0000;" class="btn btn-primary w-md mr-2">提 交</button>
</div>
</template>
<template v-else-if="pageType === 'error'">
Expand Down