4646 </a-space >
4747 </template >
4848
49- <a-space v-if =" quickSelectOptions.length > 0" wrap class =" quick-select-options" >
50- <a-tag
51- v-for =" option in quickSelectOptions"
52- :key =" option.value"
53- color =" arcoblue"
54- checkable
55- @click =" selectQuickOption(option)"
56- >
57- {{ option.name }}
58- </a-tag >
59- </a-space >
49+ <div class =" input-field-stack" >
50+ <div v-if =" quickSelectOptions.length > 0" class =" quick-select-options" >
51+ <a-tag
52+ v-for =" option in quickSelectOptions"
53+ :key =" option.value"
54+ color =" arcoblue"
55+ checkable
56+ :checked =" isQuickOptionSelected(option)"
57+ @click =" selectQuickOption(option)"
58+ >
59+ {{ option.name }}
60+ </a-tag >
61+ </div >
6062
61- <div v-if =" !isMultiLine" class =" input-inline-row" >
6263 <a-input
64+ v-if =" !isMultiLine"
6365 ref =" inputRef"
6466 v-model =" inputValue"
67+ class =" input-with-editor"
6568 :type =" inputType"
6669 :placeholder =" config.tip || '请输入内容...'"
6770 :status =" hasError ? 'error' : undefined"
6871 allow-clear
6972 @keyup.enter =" handleSubmit"
7073 @input =" handleInput"
71- />
72- <a-button class =" input-inline-action" @click =" openTextEditor" >大文本</a-button >
74+ >
75+ <template #suffix >
76+ <a-button
77+ type =" text"
78+ size =" mini"
79+ class =" input-editor-icon-button"
80+ title =" 打开大文本编辑器"
81+ @click.stop =" openTextEditor"
82+ >
83+ <template #icon >
84+ <IconEdit />
85+ </template >
86+ </a-button >
87+ </template >
88+ </a-input >
89+
90+ <template v-else >
91+ <a-textarea
92+ ref =" inputRef"
93+ v-model =" inputValue"
94+ :placeholder =" config.tip || '请输入内容...'"
95+ :auto-size =" { minRows: Number(config.multiLine) || 4, maxRows: 10 }"
96+ :status =" hasError ? 'error' : undefined"
97+ allow-clear
98+ @input =" handleInput"
99+ />
100+
101+ <a-button size =" small" class =" text-editor-button" @click =" openTextEditor" >
102+ 打开大文本编辑器
103+ </a-button >
104+ </template >
73105 </div >
74-
75- <a-textarea
76- v-else
77- ref =" inputRef"
78- v-model =" inputValue"
79- :placeholder =" config.tip || '请输入内容...'"
80- :auto-size =" { minRows: Number(config.multiLine) || 4, maxRows: 10 }"
81- :status =" hasError ? 'error' : undefined"
82- allow-clear
83- @input =" handleInput"
84- />
85-
86- <a-button v-if =" isMultiLine" size =" small" class =" text-editor-button" @click =" openTextEditor" >
87- 打开大文本编辑器
88- </a-button >
89106 </a-form-item >
90107 </a-form >
91108
119136 <ActionShell
120137 :visible =" showTextEditor "
121138 title="大文本编辑器"
122- :width =" 800 "
139+ :width =" 720 "
140+ custom-class="action-text-editor-modal"
123141 @close =" closeTextEditor "
124142 >
125143 <a-textarea
126144 ref =" textEditorRef"
127145 v-model =" editorText"
146+ class =" action-text-editor-textarea"
128147 placeholder =" 请输入文本内容..."
129- :auto-size =" { minRows: 10 , maxRows: 16 }"
148+ :auto-size =" { minRows: 9 , maxRows: 13 }"
130149 />
131150
132151 <template #footer >
143162
144163<script >
145164import { ref , computed , watch , nextTick , onMounted , onUnmounted } from ' vue'
165+ import { IconEdit } from ' @arco-design/web-vue/es/icon'
146166import ActionShell from ' ./shared/ActionShell.vue'
147167import ActionMessage from ' ./shared/ActionMessage.vue'
148168import ActionMedia from ' ./shared/ActionMedia.vue'
@@ -167,7 +187,8 @@ export default {
167187 ActionMessage,
168188 ActionMedia,
169189 ActionTimeout,
170- ActionFooter
190+ ActionFooter,
191+ IconEdit
171192 },
172193 props: {
173194 config: {
@@ -751,10 +772,14 @@ export default {
751772 validateInput (inputValue .value )
752773 }
753774
775+ const isQuickOptionSelected = (option ) => {
776+ return String (inputValue .value ) === String (option .value )
777+ }
778+
754779 const selectQuickOption = (option ) => {
755780 inputValue .value = option .value
756781 validateInput (option .value )
757-
782+
758783 // 如果只允许快速选择,直接提交
759784 if (props .config .onlyQuickSelect ) {
760785 nextTick (() => {
@@ -911,6 +936,7 @@ export default {
911936 handleReset,
912937 handleImageClick,
913938 selectQuickOption,
939+ isQuickOptionSelected,
914940 // 大文本编辑器相关
915941 textEditorRef,
916942 showTextEditor,
@@ -928,25 +954,40 @@ export default {
928954 width: 100 % ;
929955}
930956
931- .quick - select- options {
932- margin- bottom: 12px ;
957+ .input - field- stack {
958+ display: flex;
959+ flex- direction: column;
960+ gap: 10px ;
961+ width: 100 % ;
933962}
934963
935- .input - inline - row {
964+ .quick - select - options {
936965 display: flex;
966+ flex- wrap: wrap;
937967 align- items: flex- start;
938968 gap: 8px ;
939969 width: 100 % ;
940- margin- top: 4px ;
941970}
942971
943- .input - inline- row : deep (.arco - input - wrapper ) {
944- flex: 1 ;
945- min- width: 0 ;
972+ .input - with - editor {
973+ width: 100 % ;
974+ }
975+
976+ .input - editor- icon- button {
977+ color: var (-- color- text- 2 );
978+ }
979+
980+ .input - editor- icon- button: hover {
981+ color: rgb (var (-- primary- 6 ));
982+ background: var (-- color- fill- 2 );
983+ }
984+
985+ .action - text- editor- textarea {
986+ width: 100 % ;
946987}
947988
948- .input - inline - action {
949- flex - shrink : 0 ;
989+ .action - text - editor - textarea : deep ( textarea ) {
990+ line - height : 1.55 ;
950991}
951992
952993.input - extra {
0 commit comments