Commit 47298b37 authored by 王纵's avatar 王纵

表格只显示6行,lov滑动问题

parent 04c6ab6b
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-20 09:56:05
* @LastEditTime: 2024-08-27 17:46:20
* @Version: 1.0.0
* @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -59,7 +59,7 @@
placeholder="搜索"
@search="onSearch"
/>
<scroll
<d-scroll
ref="scroll"
:pullUp="true"
@pullingUp="getLovData">
......@@ -86,7 +86,7 @@
</div>
</li>
</ul>
</scroll>
</d-scroll>
<div class="footer" v-if="multiple">
<van-checkbox shape="square" v-model="selectAllFlag" @change="selectAllData">全选</van-checkbox>
<button type="primary" @click="confirm">确定</button>
......@@ -98,12 +98,15 @@
<script>
import {Cell, Switch, Icon, Popup, Search, Checkbox, Tag, Field} from 'vant';
import DLabel from './DLabel';
import {DScroll} from '../../../LayoutComponents';
import {getLovConfig, getLovData} from '../../../service';
import { DScroll } from '../../../LayoutComponents';
export default {
name: 'DLov',
components: {
DLabel,
DScroll,
[Cell.name]: Cell,
[Switch.name]: Switch,
[Icon.name]: Icon,
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-01 09:55:12
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 17:05:26
* @LastEditTime: 2024-08-27 17:45:39
* @Version: 1.0.0
* @Description: 动态渲染-Select
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -237,6 +237,8 @@ export default {
@import '../../../index.less';
.d-select-popup {
max-height: 60%;
display: flex;
flex-direction: column;
.title{
padding: 13px;
display: flex;
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-07-29 10:51:56
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 17:36:07
* @LastEditTime: 2024-08-27 17:50:40
* @Version: 1.0.0
* @Description: 表格渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -22,7 +22,7 @@
>
<van-checkbox-group v-model="checkResult">
<div v-for="(item, pIndex) in tableData" :key="item[tabInfo.primaryKey]" class="d-table">
<fragment v-for="(column, index) in columns" :key="column.columnName" >
<fragment v-for="(column, index) in showColumns" :key="column.columnName" >
<div v-if="index === 0" class="d-table-th">
<van-checkbox :name="item[tabInfo.primaryKey]">
{{column.description}}:
......@@ -32,7 +32,7 @@
:index="pIndex"
:record="item" />
</van-checkbox>
<van-icon name="records-o" v-if="showEdit" @click="showRecord(item, pIndex)"/>
<van-icon name="records-o" @click="showRecord(item, pIndex)"/>
</div>
<div v-else class="d-table-tr">
<span>{{column.description}}</span>
......@@ -74,9 +74,10 @@
<van-button
round
@click.native="cancelRecord"
>取消</van-button>
>{{showEdit ? "取消" : "关闭"}}</van-button>
<van-button
type="info"
v-if="showEdit"
round
@click.native="saveRecord"
>保存</van-button>
......@@ -147,6 +148,7 @@ export default {
},
page: 0,
size: 10,
showColumns: [],
queryParams: {},
tableData: [], // 表格数据
checkResult: [],
......@@ -180,7 +182,7 @@ export default {
EventBus.$on('tableQuery', this.listenHandle);
}
this.refresh();
this.showColumns = this.columns.length > 6 ? this.columns.slice(0, 6) : this.columns;
this.readOnly = this.dynamicConfigInfo.queryParams.readOnly;
// 设置是否可以编辑
if (this.dynamicConfigInfo.queryParams.readOnly) {
......@@ -222,14 +224,9 @@ export default {
})
},
showRecord(res, index) {
if (this.tabInfo.createUrl) {
this.record = {...res};
this.recordIndex = index;
this.visible = true;
// console.log('this.record', this.record)
} else {
Toast.fail('保存接口未配置,请检查配置');
}
this.record = {...res};
this.recordIndex = index;
this.visible = true;
},
dateDescription(type, val) {
if (val) {
......@@ -239,6 +236,10 @@ export default {
return val;
},
async saveRecord() { //表格数据保存
if (!this.tabInfo.createUrl) {
Toast.fail('保存接口未配置,请检查配置');
return;
}
const {allValues} = await this.$refs.dformRef.validate();
let method = saveTableRecord; // 默认新增
let url = this.tabInfo.createUrl;
......@@ -275,7 +276,11 @@ export default {
} else {
switch (btn.name) {
case 'create':
this.showRecord({}, -1);
if (this.tabInfo.createUrl) {
this.showRecord({}, -1);
} else {
Toast.fail('保存接口未配置,请检查配置');
}
break;
case 'query':
this.refresh();
......@@ -356,9 +361,13 @@ export default {
background: #fafafa;
box-shadow: 0 -.533vw 2.4vw 0 #e2e2e2;
.van-button {
width: 48%;
// width: 48%;
flex-grow: 1;
font-size: 16px;
font-weight: 600;
& + .van-button {
margin-left: 12px;
}
}
}
}
......
......@@ -2,7 +2,7 @@
* @Author: zong.wang01@hand-china.com
* @Date: 2024-08-16 09:39:36
* @LastEditors: zong.wang01@hand-china.com
* @LastEditTime: 2024-08-21 16:52:42
* @LastEditTime: 2024-08-26 09:55:22
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -50,7 +50,7 @@ export default {
}
},
created() {
window.localStorage.access_token = '5a9de092-e1ad-42b7-9240-90c2d5acb34e'
window.localStorage.access_token = '3e4ed606-6b81-40c2-8ba3-54f73832504e'
},
methods: {
configLoadHandle(config) { // 查询配置信息之后的回调
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment