Commit cbd6cce2 authored by 王纵's avatar 王纵

动态页面表格可编辑

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