Merge pull request '模版增加 搜索关键字' (#29) from orzsoft_admin/Admin.NET.Pro:template into main
Reviewed-on: http://101.43.53.74:3000/Admin.NET/Admin.NET.Pro/pulls/29
This commit is contained in:
commit
e0868099ec
@ -122,4 +122,10 @@ public partial class SysCodeGen : EntityBase
|
|||||||
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
[SugarColumn(ColumnDescription = "打印模版名称", Length = 32)]
|
||||||
[MaxLength(32)]
|
[MaxLength(32)]
|
||||||
public string? PrintName { get; set; }
|
public string? PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "是否使用 Api Service")]
|
||||||
|
public bool IsApiService { get; set; } = false;
|
||||||
}
|
}
|
||||||
@ -52,6 +52,8 @@ public class CustomViewEngine : ViewEngineModel
|
|||||||
|
|
||||||
public string PrintName { get; set; }
|
public string PrintName { get; set; }
|
||||||
|
|
||||||
|
public bool IsApiService { get; set; }
|
||||||
|
|
||||||
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
public List<CodeGenConfig> QueryWhetherList { get; set; }
|
||||||
|
|
||||||
public List<CodeGenConfig> TableField { get; set; }
|
public List<CodeGenConfig> TableField { get; set; }
|
||||||
|
|||||||
@ -100,6 +100,11 @@ public class CodeGenInput : BasePageInput
|
|||||||
/// 打印模版名称
|
/// 打印模版名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string PrintName { get; set; }
|
public virtual string PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AddCodeGenInput : CodeGenInput
|
public class AddCodeGenInput : CodeGenInput
|
||||||
@ -157,6 +162,11 @@ public class AddCodeGenInput : CodeGenInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
[Required(ErrorMessage = "是否生成菜单不能为空")]
|
||||||
public override bool GenerateMenu { get; set; }
|
public override bool GenerateMenu { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public override bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeleteCodeGenInput
|
public class DeleteCodeGenInput
|
||||||
|
|||||||
@ -80,4 +80,9 @@ public class CodeGenOutput
|
|||||||
/// 打印模版名称
|
/// 打印模版名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PrintName { get; set; }
|
public string PrintName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用 Api Service
|
||||||
|
/// </summary>
|
||||||
|
public bool IsApiService { get; set; }
|
||||||
}
|
}
|
||||||
@ -347,6 +347,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
||||||
PrintType = input.PrintType,
|
PrintType = input.PrintType,
|
||||||
PrintName = input.PrintName,
|
PrintName = input.PrintName,
|
||||||
|
IsApiService = input.IsApiService
|
||||||
};
|
};
|
||||||
// 模板目录
|
// 模板目录
|
||||||
var templatePathList = GetTemplatePathList(input);
|
var templatePathList = GetTemplatePathList(input);
|
||||||
@ -412,6 +413,7 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
IsUpload = joinTableList.Where(u => u.EffectType == "Upload").Any(),
|
||||||
PrintType = input.PrintType,
|
PrintType = input.PrintType,
|
||||||
PrintName = input.PrintName,
|
PrintName = input.PrintName,
|
||||||
|
IsApiService = input.IsApiService
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取模板文件并替换
|
// 获取模板文件并替换
|
||||||
|
|||||||
@ -169,16 +169,24 @@
|
|||||||
import { ref,onMounted, reactive } from "vue";
|
import { ref,onMounted, reactive } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import type { FormRules } from "element-plus";
|
import type { FormRules } from "element-plus";
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
// 接口函数
|
// 接口函数
|
||||||
import { getAPI } from '/@@/utils/axios-utils';
|
@:import { getAPI } from '/@@/utils/axios-utils';
|
||||||
|
|
||||||
// 接口
|
// 接口
|
||||||
import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
@:import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
||||||
|
|
||||||
// 模型
|
// 模型
|
||||||
import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
@:import { Update@(@Model.ClassName)Input } from '/@@/api-services/models';
|
||||||
|
} else {
|
||||||
|
@:import { add@(@Model.ClassName), update@(@Model.ClassName), detail@(@Model.ClassName) } from "/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)";
|
||||||
|
|
||||||
|
if(@Model.TableField.Any(x=>x.EffectType == "Upload")){
|
||||||
|
@:import { Plus } from "@@element-plus/icons-vue";
|
||||||
|
@:import { UploadRequestOptions } from "element-plus";
|
||||||
|
@:import {@string.Join(",",Model.TableField.Where(x=>x.EffectType == "Upload").Select(x=>"upload"+x.PropertyName).ToList())} from '/@@/api/@(@Model.PagePath)/@(@Model.LowerClassName)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
||||||
@:import { getConstType } from "/@@/utils/constHelper";
|
@:import { getConstType } from "/@@/utils/constHelper";
|
||||||
@ -244,8 +252,11 @@
|
|||||||
// 改用detail获取最新数据来编辑
|
// 改用detail获取最新数据来编辑
|
||||||
let rowData = JSON.parse(JSON.stringify(row));
|
let rowData = JSON.parse(JSON.stringify(row));
|
||||||
if (rowData.id)
|
if (rowData.id)
|
||||||
//state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
@if (@Model.IsApiService) {
|
||||||
state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
@:state.ruleForm = (await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DetailGet(rowData.id)).data.result;
|
||||||
|
} else {
|
||||||
|
@:state.ruleForm = (await detail@(@Model.ClassName)(rowData.id)).data.result;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
state.ruleForm = rowData;
|
state.ruleForm = rowData;
|
||||||
state.isShowDialog = true;
|
state.isShowDialog = true;
|
||||||
@ -268,11 +279,17 @@
|
|||||||
if (isValid) {
|
if (isValid) {
|
||||||
let values = state.ruleForm;
|
let values = state.ruleForm;
|
||||||
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
|
if (state.ruleForm.@(@pkFieldName) == undefined || state.ruleForm.@(@pkFieldName) == null || state.ruleForm.@(@pkFieldName) == "" || state.ruleForm.@(@pkFieldName) == 0) {
|
||||||
//await add@(@Model.ClassName)(values);
|
@if (@Model.IsApiService) {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)AddPost(state.ruleForm);
|
||||||
|
} else {
|
||||||
|
@:await add@(@Model.ClassName)(values);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//await update@(@Model.ClassName)(values);
|
@if (@Model.IsApiService) {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)UpdatePost(state.ruleForm);
|
||||||
|
} else {
|
||||||
|
@:await update@(@Model.ClassName)(values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
closeDialog();
|
closeDialog();
|
||||||
} else {
|
} else {
|
||||||
@ -324,7 +341,11 @@
|
|||||||
if(column.WhetherAddUpdate=="N") continue;
|
if(column.WhetherAddUpdate=="N") continue;
|
||||||
if(@column.EffectType == "Upload"){
|
if(@column.EffectType == "Upload"){
|
||||||
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
@:const upload@(@column.PropertyName)Handle = async (options: UploadRequestOptions) => {
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
@:let list = await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)Upload@(@column.FkEntityName)PostForm(options);
|
||||||
|
} else {
|
||||||
|
@:let list = await upload@(@column.PropertyName)(options);
|
||||||
|
}
|
||||||
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
@:state.ruleForm.@(column.LowerPropertyName) = res.data.result?.url;
|
||||||
@:};
|
@:};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,25 +19,30 @@
|
|||||||
}
|
}
|
||||||
<template>
|
<template>
|
||||||
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
|
<div class="@(@Model.LowerClassName)-container" v-loading="options.loading">
|
||||||
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 0px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
<el-card shadow="hover" :body-style="{ padding: '20px 20px 16px 10px', display: 'flex', width: '100%', height: '100%', alignItems: 'start' }">
|
||||||
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
<el-form :model="state.queryParams" ref="queryForm" :show-message="false" :inlineMessage="true" label-width="auto" style="flex: 1 1 0%">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
@if(Model.QueryWhetherList.Count > 0){
|
@if(Model.QueryWhetherList.Count > 0){
|
||||||
|
<el-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||||
|
<el-form-item label="关键字" prop="searchKey">
|
||||||
|
<el-input v-model="state.queryParams.searchKey" placeholder="请输入模糊查询关键字" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
foreach (var column in Model.QueryWhetherList) {
|
foreach (var column in Model.QueryWhetherList) {
|
||||||
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
if(@column.EffectType == "Input" || @column.EffectType == "InputTextArea") {
|
||||||
<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" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<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-input v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="@column.ColumnComment" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||||
</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-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment">
|
<el-form-item label="@column.ColumnComment">
|
||||||
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" />
|
<el-input-number v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请输入@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment">
|
<el-form-item label="@column.ColumnComment">
|
||||||
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
|
<el-select filterable="" v-model="state.queryParams.@(@column.LowerPropertyName)" placeholder="请选择@(@column.ColumnComment)" clearable>
|
||||||
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
<el-option v-for="(item,index) in @LowerFirstLetter(@column.FkEntityName)@(@column.PropertyName)DropdownList" :key="index" :value="item.value" :label="item.label" />
|
||||||
@ -45,7 +50,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<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 placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@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-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.code" :label="`${item.name} [${item.code}] ${item.value}`" />
|
||||||
@ -53,7 +58,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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" v-if="state.showAdvanceQueryUI">
|
||||||
<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 placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
<el-select v-model="state.queryParams.@(@column.LowerPropertyName)" filterable placeholder="请选择@(@column.ColumnComment)" clearable @@keyup.enter.native="handleQuery(true)" >
|
||||||
<el-option v-for="(item,index) in dl('@(@column.DictTypeCode)')" :key="index" :value="item.value" :label="`${item.name} [${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}`" />
|
||||||
@ -61,7 +66,7 @@
|
|||||||
</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-col class="mb5" :xs="24" :sm="12" :md="8" :lg="6" :xl="6" v-if="state.showAdvanceQueryUI">
|
||||||
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
<el-form-item label="@column.ColumnComment" prop="@(@column.LowerPropertyName)">
|
||||||
@if(@column.QueryType == "~"){
|
@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')]" />
|
@:<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')]" />
|
||||||
@ -83,6 +88,8 @@
|
|||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
|
<el-button type="primary" icon="ele-Search" @@click="handleQuery(true)" v-auth="'@(@Model.LowerClassName):page'" :loading="options.loading"> 查询 </el-button>
|
||||||
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
<el-button icon="ele-Refresh" @@click="resetQuery" :loading="options.loading"> 重置 </el-button>
|
||||||
|
<el-button icon="ele-ZoomIn" @@click="changeAdvanceQueryUI" v-if="!state.showAdvanceQueryUI" style="margin-left: 5px"> 高级查询 </el-button>
|
||||||
|
<el-button icon="ele-ZoomOut" @@click="changeAdvanceQueryUI" v-if="state.showAdvanceQueryUI" style="margin-left: 5px"> 隐藏 </el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -218,6 +225,7 @@ import PrintDialog from '/@@/views/system/print/component/hiprint/preview.vue';
|
|||||||
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
|
import EditDialog from '/@@/views/@(@Model.PagePath)/@(@Model.LowerClassName)/component/editDialog.vue';
|
||||||
import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
import ModifyRecord from '/@@/components/table/modifyRecord.vue';
|
||||||
|
|
||||||
|
@if (@Model.IsApiService) {
|
||||||
// 接口函数
|
// 接口函数
|
||||||
import { getAPI } from '/@@/utils/axios-utils';
|
import { getAPI } from '/@@/utils/axios-utils';
|
||||||
|
|
||||||
@ -227,6 +235,15 @@ import { @(@Model.ClassName)Api } from '/@@/api-services/api';
|
|||||||
// 模型
|
// 模型
|
||||||
import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
|
import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
@:import { page@(@Model.EntityName), delete@(@Model.EntityName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)';
|
||||||
|
foreach (var column in Model.QueryWhetherList){
|
||||||
|
if(@column.EffectType == "fk"){
|
||||||
|
@:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 子窗口对象
|
// 子窗口对象
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
const printDialogRef = ref<InstanceType<typeof PrintDialog>>();
|
const printDialogRef = ref<InstanceType<typeof PrintDialog>>();
|
||||||
@ -234,7 +251,9 @@ const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
|||||||
|
|
||||||
// 变量
|
// 变量
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
showAdvanceQueryUI: false,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
searchKey: undefined,
|
||||||
@if(Model.QueryWhetherList.Count > 0) {
|
@if(Model.QueryWhetherList.Count > 0) {
|
||||||
@foreach (var column in Model.QueryWhetherList) {
|
@foreach (var column in Model.QueryWhetherList) {
|
||||||
@:@(@column.LowerPropertyName): undefined,
|
@:@(@column.LowerPropertyName): undefined,
|
||||||
@ -253,6 +272,11 @@ const state = reactive({
|
|||||||
title: '',
|
title: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 改变高级查询的控件显示状态
|
||||||
|
const changeAdvanceQueryUI = () => {
|
||||||
|
state.showAdvanceQueryUI = !state.showAdvanceQueryUI;
|
||||||
|
};
|
||||||
|
|
||||||
// 表格参数配置
|
// 表格参数配置
|
||||||
const options = useVxeTable<@(@Model.ClassName)>({
|
const options = useVxeTable<@(@Model.ClassName)>({
|
||||||
id: '@(@Model.ClassName)',
|
id: '@(@Model.ClassName)',
|
||||||
@ -311,11 +335,16 @@ const handleQuery = async (reset = false) => {
|
|||||||
// 获取数据
|
// 获取数据
|
||||||
const fetchData = async (tableParams: any) => {
|
const fetchData = async (tableParams: any) => {
|
||||||
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
let params = Object.assign(state.queryParams, state.tableParams, tableParams);
|
||||||
return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
@if (@Model.IsApiService) {
|
||||||
|
@:return getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)PagePost(params);
|
||||||
|
} else {
|
||||||
|
@:return page@(@Model.ClassName)(params);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置操作
|
// 重置操作
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
|
state.queryParams.searchKey = undefined,
|
||||||
@if(Model.QueryWhetherList.Count > 0) {
|
@if(Model.QueryWhetherList.Count > 0) {
|
||||||
@foreach (var column in Model.QueryWhetherList) {
|
@foreach (var column in Model.QueryWhetherList) {
|
||||||
@:state.queryParams.@(@column.LowerPropertyName) = undefined,
|
@:state.queryParams.@(@column.LowerPropertyName) = undefined,
|
||||||
@ -354,7 +383,11 @@ const handleEdit = (row: any) => {
|
|||||||
const handlePrint = async (row: any) => {
|
const handlePrint = async (row: any) => {
|
||||||
state.title = '打印@(@Model.BusName)';
|
state.title = '打印@(@Model.BusName)';
|
||||||
@if(@Model.PrintType == "custom"){
|
@if(@Model.PrintType == "custom"){
|
||||||
|
if (@Model.IsApiService) {
|
||||||
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
@:var res = await getAPI(SysPrintApi).apiSysPrintPrintNameGet('@Model.PrintName');
|
||||||
|
} else {
|
||||||
|
@:var res = await getPrint@(@Model.ClassName)(row);
|
||||||
|
}
|
||||||
@:var printTemplate = res.data.result as SysPrint;
|
@:var printTemplate = res.data.result as SysPrint;
|
||||||
@:var template = JSON.parse(printTemplate.template);
|
@:var template = JSON.parse(printTemplate.template);
|
||||||
@:var width = template.panels[0].width;
|
@:var width = template.panels[0].width;
|
||||||
@ -375,7 +408,11 @@ const handleDelete = (row: any) => {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
@if (@Model.IsApiService) {
|
||||||
|
@:await getAPI(@(@Model.ClassName)Api).api@(@Model.ClassName)DeletePost({ id: row.id });
|
||||||
|
} else {
|
||||||
|
@:await delete@(@Model.ClassName)(row);
|
||||||
|
}
|
||||||
handleQuery();
|
handleQuery();
|
||||||
ElMessage.success('删除成功');
|
ElMessage.success('删除成功');
|
||||||
})
|
})
|
||||||
|
|||||||
@ -12,7 +12,7 @@ if exist %apiServicesPath% (
|
|||||||
|
|
||||||
echo ================================ 开始生成 api-services ================================
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%%20Groups/swagger.json -l typescript-axios -o %apiServicesPath%
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
@rem 删除不必要的文件和文件夹
|
@rem 删除不必要的文件和文件夹
|
||||||
rd /s /q %apiServicesPath%.swagger-codegen
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
|||||||
@ -14,7 +14,7 @@ fi
|
|||||||
|
|
||||||
echo "================================ 开始生成 api-services ================================"
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/Default/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
rm -rf "${apiServicesPath}".swagger-codegen
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
rm -f "${apiServicesPath}".gitignore
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
|||||||
27
Web/api_build/build_approvalFlow.bat
Normal file
27
Web/api_build/build_approvalFlow.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_approvalFlow
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_approvalFlow.sh
Normal file
28
Web/api_build/build_approvalFlow.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_approvalFlow
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/ApprovalFlow/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
27
Web/api_build/build_dingTalk.bat
Normal file
27
Web/api_build/build_dingTalk.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_dingTalk.sh
Normal file
28
Web/api_build/build_dingTalk.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_goView
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
27
Web/api_build/build_goView.bat
Normal file
27
Web/api_build/build_goView.bat
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
@echo off
|
||||||
|
CHCP 65001
|
||||||
|
|
||||||
|
set dir=%~dp0
|
||||||
|
|
||||||
|
set apiServicesPath=%dir%..\src\api-services\_goView
|
||||||
|
|
||||||
|
if exist %apiServicesPath% (
|
||||||
|
echo ================================ 删除目录 api-services ================================
|
||||||
|
rd /s /q %apiServicesPath%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ================================ 开始生成 api-services ================================
|
||||||
|
|
||||||
|
java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/GoView/swagger.json -l typescript-axios -o %apiServicesPath%
|
||||||
|
|
||||||
|
@rem 删除不必要的文件和文件夹
|
||||||
|
rd /s /q %apiServicesPath%.swagger-codegen
|
||||||
|
del /q %apiServicesPath%.gitignore
|
||||||
|
del /q %apiServicesPath%.npmignore
|
||||||
|
del /q %apiServicesPath%.swagger-codegen-ignore
|
||||||
|
del /q %apiServicesPath%git_push.sh
|
||||||
|
del /q %apiServicesPath%package.json
|
||||||
|
del /q %apiServicesPath%README.md
|
||||||
|
del /q %apiServicesPath%tsconfig.json
|
||||||
|
|
||||||
|
echo ================================ 生成结束 ================================
|
||||||
28
Web/api_build/build_goView.sh
Normal file
28
Web/api_build/build_goView.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
currPath=$(pwd)
|
||||||
|
parentPath=$(dirname "$currPath")
|
||||||
|
apiServicesPath=${parentPath}/src/api-services/_dingTalk
|
||||||
|
|
||||||
|
echo "================================ 生成目录 ${apiServicesPath} ================================"
|
||||||
|
|
||||||
|
# 判断目录是否存在
|
||||||
|
if test -d "$apiServicesPath"; then
|
||||||
|
echo "================================ 删除目录 api-services ================================"
|
||||||
|
rm -rf "${apiServicesPath}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "================================ 开始生成 api-services ================================"
|
||||||
|
|
||||||
|
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/DingTalk/swagger.json -l typescript-axios -o "${apiServicesPath}"
|
||||||
|
|
||||||
|
rm -rf "${apiServicesPath}".swagger-codegen
|
||||||
|
rm -f "${apiServicesPath}".gitignore
|
||||||
|
rm -f "${apiServicesPath}".npmignore
|
||||||
|
rm -f "${apiServicesPath}".swagger-codegen-ignore
|
||||||
|
rm -f "${apiServicesPath}"git_push.sh
|
||||||
|
rm -f "${apiServicesPath}"package.json
|
||||||
|
rm -f "${apiServicesPath}"README.md
|
||||||
|
rm -f "${apiServicesPath}"tsconfig.json
|
||||||
|
|
||||||
|
echo "================================ 生成结束 ================================"
|
||||||
@ -121,6 +121,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
|
<el-form-item label="接口模式" prop="isApiService">
|
||||||
|
<el-radio-group v-model="state.ruleForm.isApiService">
|
||||||
|
<el-radio :value="true">使用API Service</el-radio>
|
||||||
|
<el-radio :value="false">不使用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="支持打印" prop="printType">
|
<el-form-item label="支持打印" prop="printType">
|
||||||
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
|
<el-select v-model="state.ruleForm.printType" filterable class="w100" @change="printTypeChanged">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user