buli
2023-07-14 5b5c1e16deaa3a9d6d0ed1ffca390655ed103df7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!-- sldsValidatorIgnore -->
<!-- sldsValidatorIgnore -->
<template>
    <template if:true={isDoctor}>
        <!-- 展示 -->
        <section
            role="dialog"
            tabindex="-1"
            aria-modal="true"
            aria-labelledby="modal-heading-01"
            class="slds-modal slds-fade-in-open slds-modal_medium"
        >
            <div class="slds-modal__container">
                <div class="slds-scrollable">
                    <button
                        class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
                    >
                        <svg
                            class="slds-button__icon slds-button__icon_large"
                            aria-hidden="true"
                        >
                            <use
                                xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#close"
                            ></use>
                        </svg>
                        <span class="slds-assistive-text"
                            >Cancel and close</span
                        >
                    </button>
                    <div class="slds-modal__header">
                        <h1
                            id="modal-heading-01"
                            class="slds-modal__title slds-hyphenate"
                        >
                            新建客户人员
                        </h1>
                    </div>
                    <div class="slds-modal__content" id="modal-content-id-1">
                        <lightning-card class="slds-text-align_center">
                            <template if:true={isShowSpinner}>
                                <lightning-spinner
                                    size="large"
                                    alternative-text="Loading"
                                    style="height: 100%"
                                ></lightning-spinner>
                            </template>
                            <lightning-record-edit-form
                                object-api-name={sobjectType}
                                record-type-id={recordTypeId}
                                record-id={recordId}
                                onsubmit={handleSubmit}
                                onsuccess={handleSuccess}
                                onerror={handleError}
                            >
                                <template
                                    for:each={layout}
                                    for:item="layoutSection"
                                >
                                    <lightning-accordion
                                        lwc:if={layoutSection.editHeading}
                                        class="greyyyy"
                                        active-section-name={sectionName}
                                        allow-multiple-sections-open
                                        key={layoutSection.name}
                                    >
                                        <lightning-accordion-section
                                            name={layoutSection.label}
                                            label={layoutSection.label}
                                        >
                                            <lightning-layout
                                                multiple-rows="true"
                                            >
                                                <template
                                                    for:each={layoutSection.layoutColumns}
                                                    for:item="layoutColumns"
                                                >
                                                    <lightning-layout-item
                                                        class="hehe-layoutItem"
                                                        size="6"
                                                        key={layoutColumns.index}
                                                    >
                                                        <template
                                                            for:each={layoutColumns.layoutItems}
                                                            for:item="layoutField"
                                                        >
                                                            <template
                                                                if:false={layoutField.isDisable}
                                                            >
                                                                <template
                                                                    if:false={layoutField.isModify}
                                                                >
                                                                    <lightning-input-field
                                                                        field-name={layoutField.field}
                                                                        value={layoutField.value}
                                                                        required={layoutField.isRequired}
                                                                        data-field={layoutField.field}
                                                                        key={layoutField.field}
                                                                    >
                                                                    </lightning-input-field>
                                                                </template>
                                                                <template
                                                                    if:true={layoutField.isModify}
                                                                >
                                                                    <lightning-input
                                                                        label={layoutField.fieldLabel}
                                                                        value={layoutField.value}
                                                                        required={layoutField.isRequired}
                                                                        data-field={layoutField.field}
                                                                        variant="label-inline"
                                                                        onchange={dataChange}
                                                                        key={layoutField.field}
                                                                    >
                                                                    </lightning-input>
                                                                </template>
                                                            </template>
                                                        </template>
                                                    </lightning-layout-item>
                                                </template>
                                            </lightning-layout>
                                        </lightning-accordion-section>
                                    </lightning-accordion>
                                </template>
                            </lightning-record-edit-form>
                        </lightning-card>
                    </div>
                </div>
                <div class="slds-modal__footer">
                    <div class="slds-text-align_center">
                        <lightning-button
                            label="保存"
                            type="submit"
                            onsubmit={handleSubmit}
                            class="slds-m-right_x-small"
                        ></lightning-button>
                        <lightning-button
                            label="取消"
                            onclick={cancel}
                            class="slds-m-right_x-small"
                        ></lightning-button>
                    </div>
                </div>
            </div>
        </section>
    </template>
    <div class="slds-backdrop slds-backdrop_open"></div>
</template>