Commit cbd6cce2 authored by 王纵's avatar 王纵

动态页面表格可编辑

parent ab9138db
......@@ -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-27 17:46:20
* @LastEditTime: 2024-09-19 15:26:43
* @Version: 1.0.0
* @Description: 动态渲染-Lov
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -100,7 +100,6 @@ 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',
......
......@@ -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-27 17:50:40
* @LastEditTime: 2024-09-19 15:30:46
* @Version: 1.0.0
* @Description: 表格渲染
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -24,7 +24,7 @@
<div v-for="(item, pIndex) in tableData" :key="item[tabInfo.primaryKey]" class="d-table">
<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]">
<van-checkbox :name="item[tabInfo.primaryKey]" v-if="showEdit">
{{column.description}}:
<d-table-td
:tdRender="column.renderer"
......@@ -32,7 +32,15 @@
:index="pIndex"
:record="item" />
</van-checkbox>
<van-icon name="records-o" @click="showRecord(item, pIndex)"/>
<div v-else>
{{column.description}}:
<d-table-td
:tdRender="column.renderer"
:columnName="column.columnName"
:index="pIndex"
:record="item" />
</div>
<img src="../../assets/edit.png" class="td-edit" @click="showRecord(item, pIndex)" />
</div>
<div v-else class="d-table-tr">
<span>{{column.description}}</span>
......@@ -59,7 +67,7 @@
</div>
</van-checkbox-group>
<van-popup v-model="visible" position="top" class="d-table-form-popup" get-container="body">
<van-popup v-model="visible" position="top" class="d-table-form-popup van-safe-area-bottom" get-container="body">
<div class="form-content">
<d-form
v-if="visible"
......@@ -302,11 +310,11 @@ export default {
}
</script>
<style scoped lang="less">
<style lang="less">
@import '../../index.less';
.d-table {
margin: 0 8px 12px 8px;
margin: 0 15px 10px 15px;
padding: 4px 8px 12px 8px;
background-color: #fff;
border-radius: 4px;
......@@ -316,7 +324,7 @@ export default {
padding: 10px 16px 0 16px;
font-family: PingFangSC-Regular;
font-size: 14px;
color: #646465;
color: #a3a3a3;
span:nth-child(1){
min-width: 60px;
& + span {
......@@ -333,12 +341,14 @@ export default {
padding: 8px 0 12px 8px;
border-bottom: 1px solid #F3F3F7;;
font-family: PingFangSC-Semibold;
font-size: 15px;
font-size: 14px;
color: #4B4A4B;
font-weight: 600;
.van-icon-records-o {
font-size: 17px;
color: @primary-color;
:deep(.van-checkbox__icon) {
font-size: 16px;
}
.td-edit {
width: 14px;
}
}
}
......
......@@ -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-26 09:55:22
* @LastEditTime: 2024-09-19 15:27:44
* @Version: 1.0.0
* @Description:
* @Copyright: Copyright (c) 2021, Hand-RongJing
......@@ -50,7 +50,7 @@ export default {
}
},
created() {
window.localStorage.access_token = '3e4ed606-6b81-40c2-8ba3-54f73832504e'
window.localStorage.access_token = '71fc3203-0d1b-4f62-adea-d08dd473c0cc'
},
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