Browse Source

fix(gui-v2): order & meta input style

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
975ccc7332
  1. 53
      packages/nc-gui-v2/components/smartsheet/Form.vue

53
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -144,7 +144,7 @@ function onMove(event: any) {
} else if (newIndex === 0) { } else if (newIndex === 0) {
element.order = (localColumns.value[1]?.order || 0) / 2 element.order = (localColumns.value[1]?.order || 0) / 2
} else { } else {
element.order = (localColumns.value[newIndex - 1]?.order || 0) + (localColumns.value[newIndex + 1].order || 0) / 2 element.order = ((localColumns.value[newIndex - 1]?.order || 0) + (localColumns.value[newIndex + 1].order || 0)) / 2
} }
saveOrUpdate(element, newIndex) saveOrUpdate(element, newIndex)
} }
@ -503,27 +503,32 @@ onMounted(async () => {
<SmartsheetCell v-model="formState[element.title]" class="nc-input" :column="element" :edit-enabled="true" /> <SmartsheetCell v-model="formState[element.title]" class="nc-input" :column="element" :edit-enabled="true" />
</a-form-item> </a-form-item>
<div v-if="activeRow === element.title"> <div v-if="activeRow === element.title">
<a-input <a-form-item class="my-0 w-1/2">
v-model:value="element.label" <a-input
size="large" v-model:value="element.label"
:placeholder="$t('msg.info.formInput')" class="form-meta-input !bg-[#dbdbdb]"
@change="updateColMeta(element)" :placeholder="$t('msg.info.formInput')"
> @change="updateColMeta(element)"
</a-input> >
<a-input </a-input>
v-model:value="element.description" </a-form-item>
class="nc-input" <a-form-item class="mt-2 mb-0 w-1/2">
:placeholder="$t('msg.info.formHelpText')" <a-input
size="large" v-model:value="element.description"
@change="updateColMeta(element)" class="form-meta-input !bg-[#dbdbdb]"
/> :placeholder="$t('msg.info.formHelpText')"
<a-switch @change="updateColMeta(element)"
v-model:checked="element.required" />
class="mb-2" </a-form-item>
:checked-children="$t('general.required')" <div>
un-checked-children="Not Required" <a-switch
@change="updateColMeta(element)" v-model:checked="element.required"
/> class="my-2"
:checked-children="$t('general.required')"
un-checked-children="Not Required"
@change="updateColMeta(element)"
/>
</div>
</div> </div>
<span class="text-gray-500">{{ element.description }}</span> <span class="text-gray-500">{{ element.description }}</span>
</div> </div>
@ -591,4 +596,8 @@ onMounted(async () => {
.nc-input { .nc-input {
@apply w-full !bg-white rounded px-2 py-2 min-h-[40px] mt-2 mb-2 flex align-center border-solid border-1 border-primary; @apply w-full !bg-white rounded px-2 py-2 min-h-[40px] mt-2 mb-2 flex align-center border-solid border-1 border-primary;
} }
.form-meta-input::placeholder {
@apply text-[#3d3d3d] italic;
}
</style> </style>

Loading…
Cancel
Save