更新模版
This commit is contained in:
parent
11faf6c352
commit
d538de0fde
@ -27,21 +27,46 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "InputNumber") {
|
} else if(@column.EffectType == "InputNumber") {
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="@column.ColumnComment">
|
||||||
|
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" clearable placeholder="请输入@(@column.ColumnComment)" @@keyup.enter.native="handleQuery(true)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
} else if(@column.EffectType == "fk") {
|
} else if(@column.EffectType == "fk") {
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="@column.ColumnComment">
|
||||||
|
<el-select clearable="" filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)">
|
||||||
|
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
} else if(@column.EffectType == "Select") {
|
} else if(@column.EffectType == "Select") {
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable clearable placeholder="请选择@(@column.ColumnComment)" @@keyup.enter.native="handleQuery(true)" />
|
||||||
|
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
} else if(@column.EffectType == "EnumSelector") {
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable clearable placeholder="请选择@(@column.ColumnComment)">
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable clearable placeholder="请选择@(@column.ColumnComment)" @@keyup.enter.native="handleQuery(true)" />
|
||||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`[${item.code}] ${item.value}`" />
|
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
} else if(@column.EffectType == "DatePicker") {
|
} else if(@column.EffectType == "DatePicker") {
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="@column.ColumnComment">
|
||||||
|
if(@column.QueryType == "~"){
|
||||||
|
<el-date-picker type="daterange" v-model="state.queryParams.@(@column.LowerPropertyName)Range" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
<el-date-picker placeholder="请选择@(@column.ColumnComment)" value-format="YYYY/MM/DD" v-model="state.queryParams.@(@column.LowerPropertyName)" />
|
||||||
|
}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,11 +96,34 @@
|
|||||||
</template>
|
</template>
|
||||||
@foreach (var column in Model.TableField) {
|
@foreach (var column in Model.TableField) {
|
||||||
if(@column.WhetherTable == "Y") {
|
if(@column.WhetherTable == "Y") {
|
||||||
if(@column.EffectType == "EnumSelector") {
|
|
||||||
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
||||||
|
if(@column.EffectType == "Upload") {
|
||||||
|
@:<el-image
|
||||||
|
style="width: 60px; height: 60px"
|
||||||
|
:src="fetchFileUrl(row)"
|
||||||
|
alt="无法预览"
|
||||||
|
lazy
|
||||||
|
hide-on-click-modal
|
||||||
|
:preview-src-list="[fetchFileUrl(row)]"
|
||||||
|
:initial-index="0"
|
||||||
|
fit="scale-down"
|
||||||
|
preview-teleported
|
||||||
|
></el-image>
|
||||||
|
} else if(@column.EffectType == "fk") {
|
||||||
|
@:<span>{{ row.@LowerFirstLetter(@column.PropertyName)@(@column.FkColumnName) }}</span>
|
||||||
|
} else if(@column.EffectType == "ApiTreeSelect") {
|
||||||
|
@:<span>{{ row.@LowerFirstLetter(@column.PropertyName)@(column.DisplayColumn) }}</span>
|
||||||
|
} else if(@column.EffectType == "Switch") {
|
||||||
|
@:<el-tag v-if="row.@(@column.LowerPropertyName)"> 是 </el-tag>
|
||||||
|
@:<el-tag type="danger" v-else> 否 </el-tag>
|
||||||
|
} else if(@column.EffectType == "ConstSelector") {
|
||||||
|
@:<span>{{codeToName(row.@(@column.LowerPropertyName), '@(@column.DictTypeCode)')}}</span>
|
||||||
|
} else if(@column.EffectType == "Select") {
|
||||||
|
@:<el-tag :type="di('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dv('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag>
|
||||||
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
@:<el-tag :type="dv('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dv('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag>
|
@:<el-tag :type="dv('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dv('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag>
|
||||||
@:</template>
|
|
||||||
}
|
}
|
||||||
|
@:</template>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<template #row_record="{ row }">
|
<template #row_record="{ row }">
|
||||||
@ -151,7 +199,7 @@ import { getAPI } from '/@@/utils/axios-utils';
|
|||||||
import { @(@Model.EntityName)Api } from '/@@/api-services/api';
|
import { @(@Model.EntityName)Api } from '/@@/api-services/api';
|
||||||
|
|
||||||
// 模型
|
// 模型
|
||||||
import { @(@Model.EntityName), @(@Model.EntityName)Input, @(@Model.EntityName)Output } from '/@@/api-services/_lab/models';
|
import { @(@Model.EntityName), @(@Model.EntityName)Input, @(@Model.EntityName)Output } from '/@@/api-services/models';
|
||||||
|
|
||||||
// 子窗口对象
|
// 子窗口对象
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
@ -189,22 +237,22 @@ const options = useVxeTable<@(@Model.EntityName)>({
|
|||||||
if(@column.WhetherTable == "Y") {
|
if(@column.WhetherTable == "Y") {
|
||||||
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
|
if(@column.EffectType == "Upload" || @column.EffectType == "fk" || @column.EffectType == "ApiTreeSelect" || @column.EffectType == "Switch" || @column.EffectType == "ConstSelector") {
|
||||||
if(@column.EffectType == "Upload") {
|
if(@column.EffectType == "Upload") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "fk") {
|
} else if(@column.EffectType == "fk") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "ApiTreeSelect") {
|
} else if(@column.EffectType == "ApiTreeSelect") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "Switch") {
|
} else if(@column.EffectType == "Switch") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "ConstSelector") {
|
} else if(@column.EffectType == "ConstSelector") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
}
|
}
|
||||||
} else if(@column.EffectType == "Select") {
|
} else if(@column.EffectType == "Select") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "EnumSelector") {
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else if(@column.EffectType == "DatePicker") {
|
} else if(@column.EffectType == "DatePicker") {
|
||||||
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||||
} else {
|
} else {
|
||||||
if(@column.LowerPropertyName != "remark") {
|
if(@column.LowerPropertyName != "remark") {
|
||||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip' },
|
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip' },
|
||||||
@ -305,6 +353,21 @@ const handleDelete = (row: any) => {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@foreach (var column in Model.TableField) {
|
||||||
|
if(@column.WhetherTable == "Y") {
|
||||||
|
if(@column.EffectType == "Upload") {
|
||||||
|
// 获取文件地址
|
||||||
|
const fetchFileUrl = (row: SysFile): string => {
|
||||||
|
if (row.bucketName == 'Local') {
|
||||||
|
return `/${row.filePath}/${row.id}${row.suffix}`;
|
||||||
|
} else {
|
||||||
|
return row.url!;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user