Browse Source

组件属性重命名及拆分属性

main
likunming 1 year ago
parent
commit
a6b49b897e
  1. 4
      io.sc.platform.core.frontend/src/platform/components/form/WForm.vue
  2. 57
      io.sc.platform.core.frontend/src/platform/components/grid/TreeGridRow.vue
  3. 4
      io.sc.platform.core.frontend/src/platform/components/panel/WInfoPanel.vue

4
io.sc.platform.core.frontend/src/platform/components/form/WForm.vue

@ -9,8 +9,8 @@
(field.colspan === 'full'
? ' col-span-' + screenColsNumComputed
: field.colspan && screenColsNumComputed >= field.colspan
? ' col-span-' + field.colspan
: ' col-span-1')
? ' col-span-' + field.colspan
: ' col-span-1')
"
>
<component

57
io.sc.platform.core.frontend/src/platform/components/grid/TreeGridRow.vue

@ -0,0 +1,57 @@
<template>
<q-tr>
<q-td :style="{ 'padding-left': '2px' }">
<div class="flex flex-nowrap items-center">
<!--层级占位符-->
<span :style="`width:${27 * props.level}px;`"></span>
<!--展开按钮-->
<q-btn
v-if="data.children && data.children.length > 0"
flat
size="16px"
dense
padding="0px 0px"
:icon="data.expand ? 'bi-dash' : 'bi-plus'"
@click="data.expand = !data.expand"
/>
<!--展开按钮占位符-->
<span v-else style="width: 27px"></span>
<!--选择框-->
<q-checkbox v-model="data.selected" flat size="40px" dense />
<!--文件夹图标-->
<q-icon v-if="data.children && data.children.length > 0" :name="data.expand ? 'folder_open' : 'folder'" color="amber" size="20px" class="px-1"></q-icon>
<!--文件图标-->
<q-icon v-else name="bi-file-earmark" size="16px" class="px-1"></q-icon>
</div>
</q-td>
<q-td v-for="col in cols" :key="col.name" :style="{ 'padding-left': '7px' }">
<div class="flex flex-nowrap items-center">
<div v-dompurify-html="col.format ? col.format(data[col.name], data) : col.value"></div>
</div>
</q-td>
</q-tr>
<template v-for="child in data.children" :key="child.id">
<TreeGridRow v-if="data.expand" :cols="cols" :data="child" :level="props.level + 1"></TreeGridRow>
</template>
</template>
<script setup lang="ts">
const props = defineProps({
level: { type: Number, default: 0 },
cols: {
type: Array,
default: () => {
return [];
},
},
data: {
type: Object,
default: () => {
return {};
},
},
});
const cols = props.cols;
const data = props.data;
console.info('cols===============', cols);
</script>

4
io.sc.platform.core.frontend/src/platform/components/panel/WInfoPanel.vue

@ -7,8 +7,8 @@
<template v-for="(tdItem, tdIndex) in trItem as any" :key="tdIndex">
<td :class="labelAlignClassComputed">{{ tdItem.label }}</td>
<td :class="valueAlignClassComputed">
<template v-if="tdItem.value && typeof tdItem.value === 'object' && tdItem.value.type && tdItem.value._vuecomp_">
<component :is="tdItem.value.type" v-bind="tdItem.value.props"></component>
<template v-if="tdItem.value && typeof tdItem.value === 'object' && tdItem.value.componentsType">
<component :is="tdItem.value.componentsType" v-bind="tdItem.value.attrs"></component>
</template>
<template v-else>
{{ tdItem.value }}

Loading…
Cancel
Save