Browse Source

feat(gui-v2): add heading & subheading to form view

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
9896cf6731
  1. 43
      packages/nc-gui-v2/components/smartsheet/Form.vue

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

@ -5,6 +5,11 @@ import { MetaInj } from '~/context'
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
const formState = reactive({
heading: 'TestForm1',
subheading: '',
})
const isEditable = isUIAllowed('editFormView' as Permission) const isEditable = isUIAllowed('editFormView' as Permission)
const meta = inject(MetaInj) const meta = inject(MetaInj)
@ -16,10 +21,12 @@ const hiddenColumns = computed(() => [])
function addAllColumns() {} function addAllColumns() {}
function removeAllColumns() {} function removeAllColumns() {}
function updateView() {}
</script> </script>
<template> <template>
<a-row class="h-full"> <a-row class="h-full flex">
<a-col v-if="isEditable" :span="6" class="bg-[#f7f7f7] shadow-md pa-5"> <a-col v-if="isEditable" :span="6" class="bg-[#f7f7f7] shadow-md pa-5">
<div class="flex"> <div class="flex">
<div class="flex flex-row flex-1 text-lg"> <div class="flex flex-row flex-1 text-lg">
@ -43,7 +50,39 @@ function removeAllColumns() {}
</div> </div>
TODO: Draggable TODO: Draggable
</a-col> </a-col>
<a-col :span="editEnabled ? 18 : 24"> TODO: Form </a-col> <a-col :span="isEditable ? 18 : 24">
<a-card class="px-10 py-20 h-full">
<a-form :model="formState" class="bg-[#fefefe]">
<!-- Header -->
<div class="pb-2">
<a-form-item class="ma-0 gap-0 pa-0">
<a-input
v-model:value="formState.heading"
class="w-full text-bold text-h3 cursor-pointer"
size="large"
hide-details
placeholder="Form Title"
:bordered="false"
@blur="updateView()"
@keydown.enter="updateView()"
/>
</a-form-item>
</div>
<!-- Sub Header -->
<a-form-item>
<a-input
v-model:value="formState.subheading"
class="w-full cursor-pointer"
size="large"
hide-details
:placeholder="$t('msg.info.formDesc')"
:bordered="false"
@click="updateView"
/>
</a-form-item>
</a-form>
</a-card>
</a-col>
</a-row> </a-row>
</template> </template>

Loading…
Cancel
Save