更新模版
This commit is contained in:
parent
9f93b94c21
commit
11faf6c352
@ -15,14 +15,36 @@
|
||||
}
|
||||
<template>
|
||||
<div class="@(@Model.LowerEntityName)-container" v-loading="options.loading">
|
||||
<el-card shadow="hover" :body-style="{ padding: '5px 5px 0 5px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 0px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" :label-width="'60px'" style="flex: 1 1 0%">
|
||||
<el-row :gutter="10">
|
||||
@if(Model.QueryWhetherList.Count > 0){
|
||||
foreach (var column in Model.QueryWhetherList) {
|
||||
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
||||
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="state.queryParams.title" placeholder="标题" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||
<el-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "InputNumber") {
|
||||
|
||||
} else if(@column.EffectType == "fk") {
|
||||
|
||||
} else if(@column.EffectType == "Select") {
|
||||
|
||||
} else if(@column.EffectType == "EnumSelector") {
|
||||
<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)">
|
||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`[${item.code}] ${item.value}`" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
} else if(@column.EffectType == "DatePicker") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
@ -126,7 +148,7 @@ import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
||||
import { getAPI } from '/@@/utils/axios-utils';
|
||||
|
||||
// 接口
|
||||
import { @(@Model.EntityName)Api } from '/@@/api-services/_lab/api';
|
||||
import { @(@Model.EntityName)Api } from '/@@/api-services/api';
|
||||
|
||||
// 模型
|
||||
import { @(@Model.EntityName), @(@Model.EntityName)Input, @(@Model.EntityName)Output } from '/@@/api-services/_lab/models';
|
||||
@ -139,8 +161,11 @@ const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
||||
// 变量
|
||||
const state = reactive({
|
||||
queryParams: {
|
||||
title: undefined,
|
||||
type: undefined,
|
||||
@if(Model.QueryWhetherList.Count > 0) {
|
||||
@foreach (var column in Model.QueryWhetherList) {
|
||||
@:@(@column.LowerPropertyName): undefined,
|
||||
}
|
||||
}
|
||||
},
|
||||
tableParams: {
|
||||
page: 1,
|
||||
@ -178,7 +203,9 @@ const options = useVxeTable<@(@Model.EntityName)>({
|
||||
|
||||
} else if(@column.EffectType == "EnumSelector") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip', slots: { default: 'row_@column.LowerPropertyName' } },
|
||||
} else {
|
||||
} else if(@column.EffectType == "DatePicker") {
|
||||
|
||||
} else {
|
||||
if(@column.LowerPropertyName != "remark") {
|
||||
@:{ field: '@column.LowerPropertyName', title: '@column.ColumnComment', minWidth: 100, showOverflow: 'tooltip' },
|
||||
}
|
||||
@ -248,8 +275,21 @@ const handleEdit = (row: any) => {
|
||||
};
|
||||
|
||||
// 打开打印页面
|
||||
const handlePrint = (row: any) => {
|
||||
editTitle.value = '打印@(@Model.BusName)';
|
||||
const handlePrint = async (row: any) => {
|
||||
state.title = '打印@(@Model.BusName)';
|
||||
@if(@Model.PrintType == "custom"){
|
||||
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
||||
@:var printTemplate = res.data.result as SysPrint;
|
||||
@:var template = JSON.parse(printTemplate.template);
|
||||
@:var width = template.panels[0].width;
|
||||
@:row['barCode'] = row.code;
|
||||
@:row['qrCode'] = row.code;
|
||||
@:row["printDate"] = formatDate(new Date(), 'YYYY-mm-dd HH:MM');
|
||||
@:printDialogRef.value.showDialog(new hiprint.PrintTemplate({template: template}), row, width);
|
||||
}
|
||||
@if(@Model.PrintType == "auto"){
|
||||
@:printDialogRef.value.showDialog(row);
|
||||
}
|
||||
};
|
||||
|
||||
// 删除
|
||||
|
||||
Loading…
Reference in New Issue
Block a user