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

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

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