three-trees-ui 1.0.99 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,115 +0,0 @@
1
- <template>
2
- <van-popup
3
- v-if="dialogVisible"
4
- v-model="dialogVisible"
5
- position="right"
6
- get-container="body"
7
- class="ht-sub-edit-mode-dialog"
8
- >
9
- <van-nav-bar
10
- title="子表编辑"
11
- left-arrow
12
- @click-left="dialogVisible = false"
13
- />
14
- <el-form
15
- v-if="dialogVisible"
16
- v-form="{
17
- formItemAlign: 'top',
18
- inputsDisplay: 'block',
19
- roInputDisplayMode: 'text',
20
- }"
21
- class="sub-edit-main"
22
- :data-vv-scope="searchFormScope"
23
- label-position="top"
24
- >
25
- <slot :row="{ row, index: 0 }"></slot>
26
- </el-form>
27
- <div class="sub-edit-footer">
28
- <el-button @click="dialogVisible = false">取 消</el-button>
29
- <el-button type="primary" @click="handleConfirm">确 定</el-button>
30
- </div>
31
- </van-popup>
32
- </template>
33
- <script>
34
- import { cloneDeep } from 'lodash'
35
- import utils from '@/utils.js'
36
-
37
- export default {
38
- name: 'HtSubEditModeDialog',
39
- props: {},
40
- data() {
41
- return {
42
- dialogVisible: false,
43
- dialogType: 'add',
44
- row: {},
45
- orgRow: {}, // 存储原始数据,用来修改子表的数据
46
- data: {}, // 主表数据,用来处理参数绑定、值回显等问题
47
- permission: {},
48
- }
49
- },
50
- computed: {
51
- searchFormScope() {
52
- return `Form${utils.guid()}`
53
- },
54
- },
55
- methods: {
56
- showDialog({ type, data, mainData }) {
57
- this.dialogVisible = true
58
- this.permission = utils.getOnlineFormInstance(this).permission || {}
59
- this.dialogType = type
60
- this.orgRow = data
61
- this.data = mainData
62
- this.row = cloneDeep(data)
63
- },
64
- handleConfirm() {
65
- utils
66
- .validateForm(this, this.searchFormScope)
67
- .then(() => {
68
- this.dialogVisible = false
69
- // 点击确认更新子表数据
70
- const keys = Object.keys(this.orgRow || {})
71
- keys.forEach((key) => {
72
- if (this.orgRow[key] !== this.row[key]) {
73
- this.orgRow[key] = this.row[key]
74
- }
75
- })
76
- this.$emit('getSubEditModeData', this.row, this.dialogType)
77
- })
78
- .catch(() => {})
79
- },
80
- },
81
- }
82
- </script>
83
- <style lang="scss" scoped>
84
- ::v-deep {
85
- .el-row {
86
- display: flex;
87
- flex-wrap: wrap;
88
- }
89
- }
90
- </style>
91
- <style lang="scss">
92
- .ht-sub-edit-mode-dialog {
93
- width: 100%;
94
- height: 100vh;
95
- display: flex;
96
- flex-direction: column;
97
-
98
- .sub-edit-main {
99
- flex: 1;
100
- padding: 16px;
101
- overflow-y: auto;
102
- &.el-form--label-top .el-form-item__label {
103
- padding-bottom: 0;
104
- }
105
- }
106
- .sub-edit-footer {
107
- height: 46px;
108
- display: flex;
109
- align-items: center;
110
- justify-content: center;
111
- padding: 0 24px;
112
- border-top: 1px solid #ebebeb;
113
- }
114
- }
115
- </style>