1
This commit is contained in:
88
iMES.WebApi/Template/AppHtml/news.html
Normal file
88
iMES.WebApi/Template/AppHtml/news.html
Normal file
@@ -0,0 +1,88 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title> {title} </title>
|
||||
<meta name="Generator" content="vue.netcore">
|
||||
<meta id="viewport" name="viewport"
|
||||
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
|
||||
<meta name="Author" content="">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="Keywords" content="">
|
||||
<meta name="Description" content="">
|
||||
<style>
|
||||
body {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
max-width: 880px;
|
||||
margin: 0 auto;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.title h2 {
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
color: #4d4f53;
|
||||
letter-spacing: 1px;
|
||||
line-height: 54px;
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 13px;
|
||||
border-bottom: 1px dashed #ccc;
|
||||
}
|
||||
|
||||
.title .source {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title .date,
|
||||
.title .author,
|
||||
.title .count {
|
||||
letter-spacing: 1px;
|
||||
margin-left: 50px;
|
||||
font-size: 14px;
|
||||
color: #8c8b8b;
|
||||
}
|
||||
|
||||
#count {
|
||||
font-size: 14px;
|
||||
color: #8c8b8b;
|
||||
}
|
||||
|
||||
.tm-content {
|
||||
margin-top: 40px;
|
||||
font-size: 18px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="title">
|
||||
<h2>
|
||||
{title}
|
||||
</h2>
|
||||
<div class="source">
|
||||
<span class="author">来源:vol-core</span>
|
||||
<span class="date">发布时间:{date}</span>
|
||||
<span class="count">浏览次数:</span><span id="count">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tm-content">
|
||||
{content}
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script>
|
||||
var count = 0;
|
||||
window.onload = function () {
|
||||
var params = window.location.href.split("?");
|
||||
if (!params || params.length <= 1) {
|
||||
return;
|
||||
}
|
||||
params[1].split("&").forEach(function (item) {
|
||||
var query = item.split("=");
|
||||
if (query.length > 0 && query[0] == "c") {
|
||||
document.getElementById("count").innerText = (~~query[1]) + 1;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
34
iMES.WebApi/Template/AppHtml/productDesc.html
Normal file
34
iMES.WebApi/Template/AppHtml/productDesc.html
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
|
||||
<title>商品详情</title>
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-control" content="no-cache">
|
||||
<meta http-equiv="Cache" content="no-cache">
|
||||
<meta name="description" content="">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<link href="/Content/app/static.css?v=1.01" rel="stylesheet" />
|
||||
<script src="/Scripts/share.js?v=1.01"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
<section class="g-article js-article">
|
||||
<div class="js-article-inner">
|
||||
<h1 class="g-title">商品详情</h1><div class="g-subtitle">
|
||||
</div>
|
||||
</div>
|
||||
<article id="main-content" class="g-main-content js-main-content active">
|
||||
{#Content}
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
24
iMES.WebApi/Template/Controller/Controller.html
Normal file
24
iMES.WebApi/Template/Controller/Controller.html
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 此代码由框架生成,请勿随意更改
|
||||
*/
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {Namespace}.IServices;
|
||||
using {StartName}.Core.Controllers.Basic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using iMES.Entity.AttributeManager;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
[PermissionTable(Name = "{TableName}")]
|
||||
public partial class {TableName}Controller : BaseController<I{TableName}Service>
|
||||
{
|
||||
public {TableName}Controller(I{TableName}Service service)
|
||||
: base({BaseOptions}, service)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
21
iMES.WebApi/Template/Controller/ControllerApi.html
Normal file
21
iMES.WebApi/Template/Controller/ControllerApi.html
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*如果要增加方法请在当前目录下Partial文件夹{TableName}Controller编写
|
||||
*/
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using iMES.Core.Controllers.Basic;
|
||||
using iMES.Entity.AttributeManager;
|
||||
using {Namespace}.IServices;
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
[Route("api/{TableName}")]
|
||||
[PermissionTable(Name = "{TableName}")]
|
||||
public partial class {TableName}Controller : ApiBaseController<I{TableName}Service>
|
||||
{
|
||||
public {TableName}Controller(I{TableName}Service service)
|
||||
: base(service)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
iMES.WebApi/Template/Controller/ControllerApiPartial.html
Normal file
33
iMES.WebApi/Template/Controller/ControllerApiPartial.html
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
*接口编写处...
|
||||
*如果接口需要做Action的权限验证,请在Action上使用属性
|
||||
*如: [ApiActionPermission("{TableName}",Enums.ActionPermissionOptions.Search)]
|
||||
*/
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using {Namespace}.IServices;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
public partial class {TableName}Controller
|
||||
{
|
||||
private readonly I{TableName}Service _service;//访问业务代码
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
[ActivatorUtilitiesConstructor]
|
||||
public {TableName}Controller(
|
||||
I{TableName}Service service,
|
||||
IHttpContextAccessor httpContextAccessor
|
||||
)
|
||||
: base(service)
|
||||
{
|
||||
_service = service;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
iMES.WebApi/Template/Controller/ControllerPartial.html
Normal file
15
iMES.WebApi/Template/Controller/ControllerPartial.html
Normal file
@@ -0,0 +1,15 @@
|
||||
using {StartName}.Core.Extensions;
|
||||
using {StartName}.Core.Filter;
|
||||
using {StartName}.Core.Utility;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace {Namespace}.Controllers
|
||||
{
|
||||
public partial class {TableName}Controller
|
||||
{
|
||||
}
|
||||
}
|
||||
16
iMES.WebApi/Template/DomianModel/ApiInputDomainModel.html
Normal file
16
iMES.WebApi/Template/DomianModel/ApiInputDomainModel.html
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {StartName}.Entity;
|
||||
|
||||
namespace {Namespace}.DomainModels
|
||||
{
|
||||
public class Api{TableName}Input
|
||||
{
|
||||
{AttributeList}
|
||||
}
|
||||
}
|
||||
16
iMES.WebApi/Template/DomianModel/ApiOutputDomainModel.html
Normal file
16
iMES.WebApi/Template/DomianModel/ApiOutputDomainModel.html
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {StartName}.Entity;
|
||||
|
||||
namespace {Namespace}.DomainModels
|
||||
{
|
||||
public class Api{TableName}Output
|
||||
{
|
||||
{AttributeList}
|
||||
}
|
||||
}
|
||||
21
iMES.WebApi/Template/DomianModel/DomainModel.html
Normal file
21
iMES.WebApi/Template/DomianModel/DomainModel.html
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*如果数据库字段发生变化,请在代码生器重新生成此Model
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {Namespace}.SystemModels;
|
||||
|
||||
namespace {Namespace}.DomainModels
|
||||
{
|
||||
{AttributeManager}
|
||||
public partial class {TableName}:{Temp_Entity}
|
||||
{
|
||||
{AttributeList}
|
||||
}
|
||||
}
|
||||
16
iMES.WebApi/Template/DomianModel/MappingConfiguration.html
Normal file
16
iMES.WebApi/Template/DomianModel/MappingConfiguration.html
Normal file
@@ -0,0 +1,16 @@
|
||||
using {StartName}.Entity.MappingConfiguration;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace {Namespace}.MappingConfiguration
|
||||
{
|
||||
public class {TableName}MapConfig : EntityMappingConfiguration<{TableName}>
|
||||
{
|
||||
public override void Map(EntityTypeBuilder<{TableName}>
|
||||
builderTable)
|
||||
{
|
||||
//b.Property(x => x.StorageName).HasMaxLength(45);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
iMES.WebApi/Template/IRepositorys/BaseIRepositorie.html
Normal file
18
iMES.WebApi/Template/IRepositorys/BaseIRepositorie.html
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹I{TableName}Repository编写接口
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using {StartName}.Core.Extensions.AutofacManager;
|
||||
namespace {Namespace}.IRepositories
|
||||
{
|
||||
public partial interface I{TableName}Repository : IDependency,IRepository<{TableName}>
|
||||
{
|
||||
}
|
||||
}
|
||||
12
iMES.WebApi/Template/IServices/IServiceBase.html
Normal file
12
iMES.WebApi/Template/IServices/IServiceBase.html
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*/
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
|
||||
namespace {Namespace}.IServices
|
||||
{
|
||||
public partial interface I{TableName}Service : IService<{TableName}>
|
||||
{
|
||||
}
|
||||
}
|
||||
13
iMES.WebApi/Template/IServices/IServiceBasePartial.html
Normal file
13
iMES.WebApi/Template/IServices/IServiceBasePartial.html
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
*所有关于{TableName}类的业务代码接口应在此处编写
|
||||
*/
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using iMES.Core.Utilities;
|
||||
using System.Linq.Expressions;
|
||||
namespace {Namespace}.IServices
|
||||
{
|
||||
public partial interface I{TableName}Service
|
||||
{
|
||||
}
|
||||
}
|
||||
46
iMES.WebApi/Template/Page/SearchPage.html
Normal file
46
iMES.WebApi/Template/Page/SearchPage.html
Normal file
@@ -0,0 +1,46 @@
|
||||
@*
|
||||
*Author:COCO
|
||||
* 此代码由框架生成,请勿随意更改
|
||||
*@
|
||||
@{
|
||||
Layout = "~/Views/Shared/ManagerLayout.cshtml";
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div style=" padding: 0px 5px 0px 2px; height: 100%;">
|
||||
|
||||
<div id="lay-search-panel" class="panel lay-panel" style=" margin-bottom: 5px;border:0px;">
|
||||
</div>
|
||||
<div id="lay-reslut" class=" lay-reslut ">
|
||||
<table id="dataGrid"></table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{#uploader}
|
||||
{#ueditor}
|
||||
|
||||
|
||||
<script>
|
||||
{#dropDownIds}
|
||||
var searchData = {#searchHtml};
|
||||
var editData = {#editSource};
|
||||
|
||||
|
||||
var gridParameters = {#gridParameters};
|
||||
|
||||
var $elementGrid;
|
||||
window.onload = function () {
|
||||
$elementGrid = $('#dataGrid').datagrid(gridParameters);
|
||||
}
|
||||
|
||||
var $elementDetailGrid;
|
||||
var gridDetailParameters = {#gridDetailParameters};
|
||||
</script>
|
||||
55
iMES.WebApi/Template/Page/Vue3SearchPage.html
Normal file
55
iMES.WebApi/Template/Page/Vue3SearchPage.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!--
|
||||
*Author:COCO
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/#folder/#TableName.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/#folder/#TableName.js";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: '#key',
|
||||
footer: "Foots",
|
||||
cnName: '#cnName',
|
||||
name: '#TableName',
|
||||
url: "#url",
|
||||
sortName: "#SortName"
|
||||
});
|
||||
const editFormFields = ref(#editFormFileds);
|
||||
const editFormOptions = ref(#editFormOptions);
|
||||
const searchFormFields = ref(#searchFormFileds);
|
||||
const searchFormOptions = ref(#searchFormOptions);
|
||||
const columns = ref([#columns]);
|
||||
const detail = ref({
|
||||
cnName: "#detailCnName",
|
||||
table: "#detailTable",
|
||||
columns: [#detailColumns],
|
||||
sortName: "#detailSortName",
|
||||
key: "#detailKey"
|
||||
});
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
73
iMES.WebApi/Template/Page/VueExtension.html
Normal file
73
iMES.WebApi/Template/Page/VueExtension.html
Normal file
@@ -0,0 +1,73 @@
|
||||
/*****************************************************************************************
|
||||
** Author:COCO 2022
|
||||
*****************************************************************************************/
|
||||
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
|
||||
|
||||
let extension = {
|
||||
components: {
|
||||
//查询界面扩展组件
|
||||
gridHeader: '',
|
||||
gridBody: '',
|
||||
gridFooter: '',
|
||||
//新建、编辑弹出框扩展组件
|
||||
modelHeader: '',
|
||||
modelBody: '',
|
||||
modelFooter: ''
|
||||
},
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
//示例:在按钮的最前面添加一个按钮
|
||||
// this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组
|
||||
// name: '按钮', //按钮名称
|
||||
// icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档)
|
||||
// type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button
|
||||
// onClick: function () {
|
||||
// this.$Message.success('点击了按钮');
|
||||
// }
|
||||
// });
|
||||
|
||||
//示例:设置修改新建、编辑弹出框字段标签的长度
|
||||
// this.boxOptions.labelWidth = 150;
|
||||
//显示序号(默认隐藏)
|
||||
this.columnIndex = true;
|
||||
},
|
||||
onInited() {
|
||||
//框架初始化配置后
|
||||
//如果要配置明细表,在此方法操作
|
||||
//this.detailOptions.columns.forEach(column=>{ });
|
||||
},
|
||||
searchBefore(param) {
|
||||
//界面查询前,可以给param.wheres添加查询参数
|
||||
//返回false,则不会执行查询
|
||||
return true;
|
||||
},
|
||||
searchAfter(result) {
|
||||
//查询后,result返回的查询数据,可以在显示到表格前处理表格的值
|
||||
return true;
|
||||
},
|
||||
addBefore(formData) {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
},
|
||||
updateBefore(formData) {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
},
|
||||
rowClick({ row, column, event }) {
|
||||
//查询界面点击行事件
|
||||
// this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
|
||||
},
|
||||
modelOpenAfter(row) {
|
||||
//点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
|
||||
//(1)判断是编辑还是新建操作: this.currentAction=='Add';
|
||||
//(2)给弹出框设置默认值
|
||||
//(3)this.editFormFields.字段='xxx';
|
||||
//如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
|
||||
//看不懂就把输出看:console.log(this.editFormOptions)
|
||||
}
|
||||
}
|
||||
};
|
||||
export default extension;
|
||||
58
iMES.WebApi/Template/Page/VueSearchPage.html
Normal file
58
iMES.WebApi/Template/Page/VueSearchPage.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!--
|
||||
*Author:COCO
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/#folder/#TableName.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<view-grid
|
||||
ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormFileds="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormFileds="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import extend from "@/extension/#folder/#TableName.js";
|
||||
import ViewGrid from "@/components/basic/ViewGrid.vue";
|
||||
var vueParam = {
|
||||
components: {
|
||||
ViewGrid
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
table: {
|
||||
key: '#key',
|
||||
footer: "Foots",
|
||||
cnName: '#cnName',
|
||||
name: '#TableName',
|
||||
url: "#url",
|
||||
sortName: "#SortName"
|
||||
},
|
||||
extend: extend,
|
||||
editFormFields: #editFormFileds,
|
||||
editFormOptions: #editFormOptions,
|
||||
searchFormFields: #searchFormFileds,
|
||||
searchFormOptions: #searchFormOptions,
|
||||
columns: [#columns],
|
||||
detail: {
|
||||
cnName: "#detailCnName",
|
||||
table: "#detailTable",
|
||||
columns: [#detailColumns],
|
||||
sortName: "#detailSortName",
|
||||
key:"#detailKey"
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
export default vueParam;
|
||||
</script>
|
||||
99
iMES.WebApi/Template/Page/app/extension.html
Normal file
99
iMES.WebApi/Template/Page/app/extension.html
Normal file
@@ -0,0 +1,99 @@
|
||||
//************************************************
|
||||
// *Author:COCO
|
||||
// *自定义业务逻辑扩展
|
||||
//************************************************
|
||||
export default function() {
|
||||
return {
|
||||
methods: {
|
||||
onInited() { //页面参数初始化
|
||||
//设置table超出换行显示
|
||||
//this.textInline = false;
|
||||
|
||||
//设置列宽度
|
||||
//this.columns[1].width = 70;
|
||||
|
||||
//设置table为水平显示或者list列表显示
|
||||
//this.direction = 'horizontal'//list
|
||||
//如果为list列表显示,指定list的标题列
|
||||
//this.titleField="字段";
|
||||
|
||||
//设置自定义格式显示
|
||||
//this.columns.forEach(column=>{
|
||||
// if(column.field=='字段'){
|
||||
// //自定义格式化显示,在下面的formatter实现具体逻辑
|
||||
// //column.formatter=true;
|
||||
|
||||
// //开启table单元格点击事件(仅设置this.direction = 'horizontal属性后生效)
|
||||
// column.click=true;
|
||||
|
||||
// //指定字段为date类型不显示时分秒
|
||||
// //column.type="date";
|
||||
// //设置列宽度
|
||||
// //column.width = 70;
|
||||
// }
|
||||
// })
|
||||
|
||||
//页面打开时禁用加载数据
|
||||
//this.load=false;
|
||||
//页面打开时默认弹出查询框
|
||||
//this.searchModel = true;
|
||||
},
|
||||
formatter(row, column,index) { //自定义格式化
|
||||
// if(column.field=='xx'){
|
||||
// return '<a style="color:red;">' + row[column.field] + '</a>';
|
||||
// }
|
||||
//return row[column.field]
|
||||
},
|
||||
rowClick(index, row, column) { //行点击事件(默认触发编辑)
|
||||
return true;
|
||||
},
|
||||
cellClick(index, row, column) { //单元格击事件(默认触发编辑)
|
||||
//仅onInited中设置:this.direction = "horizontal", this.columns的字段设置为click=true后生效
|
||||
return true;
|
||||
},
|
||||
rowButtons(index, row) { //列表显示的按钮
|
||||
//自定义按钮,仅onInited中设置:this.direction = "list"后生效
|
||||
// return [{
|
||||
// text: "测试",
|
||||
// icon: "edit-pen",
|
||||
// type: "primary",
|
||||
// plain:true,
|
||||
// shape:"circle",
|
||||
// disabled: false
|
||||
// },{
|
||||
// text: "删除",
|
||||
// icon: "trash",
|
||||
// type: "error",
|
||||
// plain:true,
|
||||
// shape:"circle",
|
||||
// //shape:"",//square、circle
|
||||
// disabled: false
|
||||
// }];
|
||||
},
|
||||
rowButtonClick(btn,index, row){ //列表显示的按钮点击事件
|
||||
// if(btn.text=='删除'){
|
||||
// this.$toast('删除')
|
||||
// }
|
||||
},
|
||||
searchBefore(params){ //查询前
|
||||
return true;
|
||||
},
|
||||
updateBefore(formData) { //更新保存前操作
|
||||
return true;
|
||||
},
|
||||
addBefore(formData) {//新建保存前操作
|
||||
return true;
|
||||
},
|
||||
searchFormOnChange(field,value){ //查询弹出框下拉框或日期选中事件
|
||||
//if(field=="字段"){
|
||||
// console.log(value)
|
||||
//}
|
||||
},
|
||||
editFormOnChange(field,value){ //新建编辑弹出框下拉框或日期选中事件
|
||||
//if(field=="字段"){
|
||||
// console.log(value)
|
||||
//}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
22
iMES.WebApi/Template/Page/app/options.html
Normal file
22
iMES.WebApi/Template/Page/app/options.html
Normal file
@@ -0,0 +1,22 @@
|
||||
//************************************************
|
||||
// *Author:COCO
|
||||
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
// *业务请在#TableName.js中编写
|
||||
//************************************************
|
||||
export default function() {
|
||||
return {
|
||||
editFormFields: #editFormFileds,
|
||||
editFormOptions: #editFormOptions,
|
||||
searchFormFields: #searchFormFileds,
|
||||
searchFormOptions: #searchFormOptions,
|
||||
columns: [#columns],
|
||||
table: {
|
||||
key: '#key',
|
||||
footer: "Foots",
|
||||
cnName: '#cnName',
|
||||
name: '#TableName',
|
||||
url: "#url",
|
||||
sortName: "#SortName"
|
||||
}
|
||||
}
|
||||
}
|
||||
40
iMES.WebApi/Template/Page/app/page.html
Normal file
40
iMES.WebApi/Template/Page/app/page.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<view>
|
||||
<view-grid ref="grid" :index="true" :options="options">
|
||||
<!-- 自定义slot -->
|
||||
<view @click="viewClick" slot="gridHeader" class="grid-header">
|
||||
{{gridHeaderText}}
|
||||
</view>
|
||||
</view-grid>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//************************************************
|
||||
// *Author:COCO
|
||||
// *自定义业务逻辑扩展
|
||||
//************************************************
|
||||
import extend from './#TableNameExtend.js'
|
||||
import options from './#TableNameOptions.js';
|
||||
let _options = options();
|
||||
_options.extend = extend;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
gridHeaderText: "",//随便输入字符后可以显示出来
|
||||
options: _options
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
viewClick() {
|
||||
//获取生成页面grid的对象
|
||||
console.log(this.$refs.grid.searchFormFields)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
24
iMES.WebApi/Template/Page/gridParameters.html
Normal file
24
iMES.WebApi/Template/Page/gridParameters.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
loadMsg: '数据正在加载。。。。',
|
||||
//rownumbers: true,
|
||||
pageSize: 30,
|
||||
pageList: [10, 20, 30, 50, 80, 100, 200, 500, 1000],
|
||||
height: 340,
|
||||
key:'#key',
|
||||
url: '#Url',
|
||||
nameSpace:'',
|
||||
queryParams: {TableName:'#TableName',sort:'#SortName',Foots:'#Foots',Wheres:'{}'},
|
||||
pagination: true,
|
||||
striped:true,
|
||||
fileLink:#fileLink,
|
||||
richText:#richText,
|
||||
hasSection:false,
|
||||
cnName:'#cnName',
|
||||
calculateHeight:{id:'#lay-search-panel'},
|
||||
calculateWidth:{id:'#lay-search-panel'{#Width}},
|
||||
frozenColumns: [[
|
||||
{ field: 'ck', checkbox: true }
|
||||
]],
|
||||
//showFooter: true,
|
||||
columns: [[{#columns}]]
|
||||
}
|
||||
5
iMES.WebApi/Template/Page/router.html
Normal file
5
iMES.WebApi/Template/Page/router.html
Normal file
@@ -0,0 +1,5 @@
|
||||
,{
|
||||
path: '/#TableName',
|
||||
name: '#TableName',
|
||||
component: () => import('@/views/#folder/#TableName.vue')
|
||||
}]
|
||||
24
iMES.WebApi/Template/Repositorys/BaseRepository.html
Normal file
24
iMES.WebApi/Template/Repositorys/BaseRepository.html
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹{TableName}Repository编写代码
|
||||
*/
|
||||
using {Namespace}.IRepositories;
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Core.EFDbContext;
|
||||
using {StartName}.Core.Extensions.AutofacManager;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
|
||||
namespace {Namespace}.Repositories
|
||||
{
|
||||
public partial class {TableName}Repository : RepositoryBase<{TableName}> , I{TableName}Repository
|
||||
{
|
||||
public {TableName}Repository({DbContext} dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
|
||||
}
|
||||
public static I{TableName}Repository Instance
|
||||
{
|
||||
get { return AutofacContainerModule.GetService<I{TableName}Repository>(); } }
|
||||
}
|
||||
}
|
||||
16
iMES.WebApi/Template/Repositorys/BaseRepositoryPartial.html
Normal file
16
iMES.WebApi/Template/Repositorys/BaseRepositoryPartial.html
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*Repository提供数据库操作,如果要增加数据库操作请在此处编写代码
|
||||
*/
|
||||
using {Namespace}.IRepositories;
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Core.Extensions.AutofacManager;
|
||||
using {StartName}.Core.RepositoryEF;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
|
||||
namespace {Namespace}.Repositories
|
||||
{
|
||||
public partial class {TableName}Repository
|
||||
{
|
||||
}
|
||||
}
|
||||
26
iMES.WebApi/Template/Services/ServiceBase.html
Normal file
26
iMES.WebApi/Template/Services/ServiceBase.html
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
*Author:COCO
|
||||
*代码由框架生成,此处任何更改都可能导致被代码生成器覆盖
|
||||
*所有业务编写全部应在Partial文件夹下{TableName}Service与I{TableName}Service中编写
|
||||
*/
|
||||
using {Namespace}.IRepositories;
|
||||
using {Namespace}.IServices;
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Core.Extensions.AutofacManager;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
|
||||
namespace {Namespace}.Services
|
||||
{
|
||||
public partial class {TableName}Service : ServiceBase<{TableName}, I{TableName}Repository>
|
||||
, I{TableName}Service, IDependency
|
||||
{
|
||||
public {TableName}Service(I{TableName}Repository repository)
|
||||
: base(repository)
|
||||
{
|
||||
Init(repository);
|
||||
}
|
||||
public static I{TableName}Service Instance
|
||||
{
|
||||
get { return AutofacContainerModule.GetService<I{TableName}Service>(); } }
|
||||
}
|
||||
}
|
||||
41
iMES.WebApi/Template/Services/ServiceBasePartial.html
Normal file
41
iMES.WebApi/Template/Services/ServiceBasePartial.html
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
*所有关于{TableName}类的业务代码应在此处编写
|
||||
*可使用repository.调用常用方法,获取EF/Dapper等信息
|
||||
*如果需要事务请使用repository.DbContextBeginTransaction
|
||||
*也可使用DBServerProvider.手动获取数据库相关信息
|
||||
*用户信息、权限、角色等使用UserContext.Current操作
|
||||
*{TableName}Service对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
|
||||
*/
|
||||
using {StartName}.Core.BaseProvider;
|
||||
using {StartName}.Core.Extensions.AutofacManager;
|
||||
using {StartName}.Entity.DomainModels;
|
||||
using System.Linq;
|
||||
using iMES.Core.Utilities;
|
||||
using System.Linq.Expressions;
|
||||
using {StartName}.Core.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using {Namespace}.IRepositories;
|
||||
|
||||
namespace {Namespace}.Services
|
||||
{
|
||||
public partial class {TableName}Service
|
||||
{
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly I{TableName}Repository _repository;//访问数据库
|
||||
|
||||
[ActivatorUtilitiesConstructor]
|
||||
public {TableName}Service(
|
||||
I{TableName}Repository dbRepository,
|
||||
IHttpContextAccessor httpContextAccessor
|
||||
)
|
||||
: base(dbRepository)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_repository = dbRepository;
|
||||
//多租户会用到这init代码,其他情况可以不用
|
||||
//base.Init(dbRepository);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user