为什么都没了
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Font/站酷酷黑体.ttf
Normal file
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/1.jpg
Normal file
|
After Width: | Height: | Size: 135 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/2.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/3.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/4.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/5.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/6.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/7.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
framework/Api/Ewide.Web.Entry/wwwroot/Captcha/Image/8.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,16 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace @Model.NameSpace
|
||||
{
|
||||
public interface I@(@Model.ClassName)Service
|
||||
{
|
||||
Task Add(Add@(@Model.ClassName)Input input);
|
||||
Task Delete(Delete@(@Model.ClassName)Input input);
|
||||
Task<@(@Model.ClassName)> Get([FromQuery] Querye@(@Model.ClassName)Input input);
|
||||
Task<dynamic> List([FromQuery] @(@Model.ClassName)Input input);
|
||||
Task<dynamic> Page([FromQuery] @(@Model.ClassName)Input input);
|
||||
Task Update(Update@(@Model.ClassName)Input input);
|
||||
}
|
||||
}
|
||||
69
framework/Api/Ewide.Web.Entry/wwwroot/Template/Input.cs.vm
Normal file
@@ -0,0 +1,69 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace @Model.NameSpace
|
||||
{
|
||||
/// <summary>
|
||||
/// @(@Model.BusName)输入参数
|
||||
/// </summary>
|
||||
public class @(@Model.ClassName)Input : PageInputBase
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey != "True"){
|
||||
@:/// <summary>
|
||||
@:/// @column.ColumnComment
|
||||
@:/// </summary>
|
||||
@:public virtual @column.NetType @column.ColumnName { get; set; }
|
||||
@:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Add@(@Model.ClassName)Input : @(@Model.ClassName)Input
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:/// <summary>
|
||||
@:/// @column.ColumnComment
|
||||
@:/// </summary>
|
||||
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
|
||||
@:public override @column.NetType @column.ColumnName { get; set; }
|
||||
@:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Delete@(@Model.ClassName)Input
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey == "True"){
|
||||
@:/// <summary>
|
||||
@:/// @column.ColumnComment
|
||||
@:/// </summary>
|
||||
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
|
||||
@:public @column.NetType @column.ColumnName { get; set; }
|
||||
@:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Update@(@Model.ClassName)Input : @(@Model.ClassName)Input
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey == "True"){
|
||||
@:/// <summary>
|
||||
@:/// @column.ColumnComment
|
||||
@:/// </summary>
|
||||
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
|
||||
@:public @column.NetType @column.ColumnName { get; set; }
|
||||
@:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Querye@(@Model.ClassName)Input : Delete@(@Model.ClassName)Input
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
66
framework/Api/Ewide.Web.Entry/wwwroot/Template/Manage.js.vm
Normal file
@@ -0,0 +1,66 @@
|
||||
import { axios } from '@@/utils/request'
|
||||
|
||||
/**
|
||||
* 查询@(@Model.BusName)
|
||||
*
|
||||
* @@author @Model.AuthorName
|
||||
*/
|
||||
export function @(@Model.ClassName)Page (parameter) {
|
||||
return axios({
|
||||
url: '/@Model.ClassName/page',
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @(@Model.BusName)列表
|
||||
*
|
||||
* @@author @Model.AuthorName
|
||||
*/
|
||||
export function @(@Model.ClassName)List (parameter) {
|
||||
return axios({
|
||||
url: '/@Model.ClassName/list',
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加@(@Model.BusName)
|
||||
*
|
||||
* @@author @Model.AuthorName
|
||||
*/
|
||||
export function @(@Model.ClassName)Add (parameter) {
|
||||
return axios({
|
||||
url: '/@Model.ClassName/add',
|
||||
method: 'post',
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑@(@Model.BusName)
|
||||
*
|
||||
* @@author @Model.AuthorName
|
||||
*/
|
||||
export function @(@Model.ClassName)Edit (parameter) {
|
||||
return axios({
|
||||
url: '/@Model.ClassName/edit',
|
||||
method: 'post',
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除@(@Model.BusName)
|
||||
*
|
||||
* @@author @Model.AuthorName
|
||||
*/
|
||||
export function @(@Model.ClassName)Delete (parameter) {
|
||||
return axios({
|
||||
url: '/@Model.ClassName/delete',
|
||||
method: 'post',
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
18
framework/Api/Ewide.Web.Entry/wwwroot/Template/Output.cs.vm
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace @Model.NameSpace
|
||||
{
|
||||
/// <summary>
|
||||
/// @(@Model.BusName)输出参数
|
||||
/// </summary>
|
||||
public class @(@Model.ClassName)Output
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
@:/// <summary>
|
||||
@:/// @column.ColumnComment
|
||||
@:/// </summary>
|
||||
@:public @column.NetType @column.ColumnName { get; set; }
|
||||
@:
|
||||
}
|
||||
}
|
||||
}
|
||||
117
framework/Api/Ewide.Web.Entry/wwwroot/Template/Service.cs.vm
Normal file
@@ -0,0 +1,117 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DatabaseAccessor.Extensions;
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.DynamicApiController;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace @Model.NameSpace
|
||||
{
|
||||
/// <summary>
|
||||
/// @(@Model.BusName)服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "@Model.ClassName", Order = 100)]
|
||||
public class @(@Model.ClassName)Service : I@(@Model.ClassName)Service, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IRepository<@(@Model.ClassName)> _rep;
|
||||
|
||||
public @(@Model.ClassName)Service(IRepository<@(@Model.ClassName)> rep)
|
||||
{
|
||||
_rep = rep;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页查询@(@Model.BusName)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/@Model.ClassName/page")]
|
||||
public async Task<dynamic> Page([FromQuery] @(@Model.ClassName)Input input)
|
||||
{
|
||||
var entities = await _rep.DetachedEntities
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.QueryWhether == "Y"){
|
||||
if (@column.NetType == "string"){
|
||||
if(@column.QueryType == "like"){
|
||||
@:.Where(!string.IsNullOrEmpty(input.@column.ColumnName), u => EF.Functions.Like(u.@(@column.ColumnName), $"%{input.@(@column.ColumnName).Trim()}%"))
|
||||
}else{
|
||||
@:.Where(!string.IsNullOrEmpty(input.@column.ColumnName), u => u.@(@column.ColumnName) @column.QueryType input.@(@column.ColumnName))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ToPagedListAsync(input.PageNo, input.PageSize);
|
||||
return XnPageResult<@(@Model.ClassName)>.PageResult(entities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加@(@Model.BusName)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/@Model.ClassName/add")]
|
||||
public async Task Add(Add@(@Model.ClassName)Input input)
|
||||
{
|
||||
var entity = input.Adapt<@(@Model.ClassName)>();
|
||||
await entity.InsertAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除@(@Model.BusName)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/@Model.ClassName/delete")]
|
||||
public async Task Delete(Delete@(@Model.ClassName)Input input)
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey == "True"){
|
||||
@:var entity = await _rep.FirstOrDefaultAsync(u => u.@(@column.ColumnName) == input.@(@column.ColumnName));
|
||||
}
|
||||
}
|
||||
await entity.DeleteAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新@(@Model.BusName)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/@Model.ClassName/edit")]
|
||||
public async Task Update(Update@(@Model.ClassName)Input input)
|
||||
{
|
||||
var entity = input.Adapt<@(@Model.ClassName)>();
|
||||
await entity.UpdateAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取@(@Model.BusName)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/@Model.ClassName/detail")]
|
||||
public async Task<@(@Model.ClassName)> Get([FromQuery] Querye@(@Model.ClassName)Input input)
|
||||
{
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey == "True"){
|
||||
@:return await _rep.DetachedEntities.FirstOrDefaultAsync(u => u.@(@column.ColumnName) == input.@(@column.ColumnName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取@(@Model.BusName)列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/@Model.ClassName/list")]
|
||||
public async Task<dynamic> List([FromQuery] @(@Model.ClassName)Input input)
|
||||
{
|
||||
return await _rep.DetachedEntities.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
198
framework/Api/Ewide.Web.Entry/wwwroot/Template/addForm.vue.vm
Normal file
@@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<a-modal
|
||||
title="新增@(@Model.BusName)"
|
||||
:width="900"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@@ok="handleSubmit"
|
||||
@@cancel="handleCancel">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey != "True"){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:<a-form-item label="@column.ColumnComment" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
}else{
|
||||
@:<a-form-item label="@column.ColumnComment" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
||||
}
|
||||
if (@column.EffectType == "user"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<user-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<user-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "depart"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<depart-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<depart-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "input"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-input placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<a-input placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "textarea"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-textarea placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/>
|
||||
}else{
|
||||
@:<a-textarea placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" :auto-size="{ minRows: 3, maxRows: 6 }"/>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "inputnumber"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-input-number placeholder="请输入@(@column.ColumnComment)" style="width: 100%" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<a-input-number placeholder="请输入@(@column.ColumnComment)" style="width: 100%" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "select"){
|
||||
if (@column.whetherRequired == "Y"){
|
||||
<text><a-select style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select></text>
|
||||
}else{
|
||||
<text><a-select style="width: 100%" placeholder="请选择@(@column.ColumnComment)">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "radio"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
<text><a-radio-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" >
|
||||
<a-radio v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group></text>
|
||||
}else{
|
||||
<text><a-radio-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" >
|
||||
<a-radio v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "checkbox"){
|
||||
if (@column.whetherRequired == "Y"){
|
||||
<text><a-checkbox-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" >
|
||||
<a-checkbox v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-checkbox>
|
||||
</a-checkbox-group></text>
|
||||
}else{
|
||||
<text><a-checkbox-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" >
|
||||
<a-checkbox v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-checkbox>
|
||||
</a-checkbox-group></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "datepicker"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" @@change="onChange@(@column.ColumnName)"/>
|
||||
}else{
|
||||
@:<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" @@change="onChange@(@column.ColumnName)"/>
|
||||
}
|
||||
}
|
||||
@:</a-form-item>
|
||||
}
|
||||
}
|
||||
}
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { @(@Model.ClassName)Add } from '@@/api/modular/main/@(@Model.ClassName)Manage'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 15 }
|
||||
},
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.DictTypeCode != ""){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:@(@column.ColumnName)Data: [],
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:@(@column.ColumnName)DateString: '',
|
||||
}
|
||||
}
|
||||
}
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始化方法
|
||||
add (record) {
|
||||
this.visible = true
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.DictTypeCode != ""){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
<text>const @(@column.ColumnName)Option = this.$options
|
||||
this.@(@column.ColumnName)Data = @(@column.ColumnName)Option.filters['dictData']('@column.DictTypeCode')</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 提交表单
|
||||
*/
|
||||
handleSubmit () {
|
||||
const { form: { validateFields } } = this
|
||||
this.confirmLoading = true
|
||||
validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
for (const key in values) {
|
||||
if (typeof (values[key]) === 'object') {
|
||||
values[key] = JSON.stringify(values[key])
|
||||
}
|
||||
}
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:values.@column.ColumnName = this.@(@column.ColumnName)DateString
|
||||
}
|
||||
}
|
||||
}
|
||||
@(@Model.ClassName)Add(values).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('新增成功')
|
||||
this.confirmLoading = false
|
||||
this.$emit('ok', values)
|
||||
this.handleCancel()
|
||||
} else {
|
||||
this.$message.error('新增失败')// + res.message
|
||||
}
|
||||
}).finally((res) => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
} else {
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:onChange@(@column.ColumnName)(date, dateString) {
|
||||
@:this.@(@column.ColumnName)DateString = dateString
|
||||
@:},
|
||||
}
|
||||
}
|
||||
}
|
||||
handleCancel () {
|
||||
this.form.resetFields()
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
260
framework/Api/Ewide.Web.Entry/wwwroot/Template/editForm.vue.vm
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<a-modal
|
||||
title="编辑@(@Model.BusName)"
|
||||
:width="900"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@@ok="handleSubmit"
|
||||
@@cancel="handleCancel">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.ColumnKey == "True"){
|
||||
@:<a-form-item v-show="false"><a-input v-decorator="['@column.ColumnName']" /></a-form-item>
|
||||
}else{
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:<a-form-item label="@column.ColumnComment" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
}else{
|
||||
@:<a-form-item label="@column.ColumnComment" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
||||
}
|
||||
if (@column.EffectType == "user"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<user-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<user-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "depart"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<depart-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<depart-select placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "input"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-input placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<a-input placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "textarea"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-textarea placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" :auto-size="{ minRows: 3, maxRows: 6 }"/>
|
||||
}else{
|
||||
@:<a-textarea placeholder="请输入@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" :auto-size="{ minRows: 3, maxRows: 6 }"/>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "inputnumber"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-input-number placeholder="请输入@(@column.ColumnComment)" style="width: 100%" v-decorator="['@column.ColumnName', {rules: [{required: true, message: '请输入@(@column.ColumnComment)!'}]}]" />
|
||||
}else{
|
||||
@:<a-input-number placeholder="请输入@(@column.ColumnComment)" style="width: 100%" v-decorator="['@column.ColumnName']" />
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "select"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
<text><a-select style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName', {rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select></text>
|
||||
}else{
|
||||
<text><a-select style="width: 100%" placeholder="请选择@(@column.ColumnComment)">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "radio"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
<text><a-radio-group placeholder="请选择@(@column.ColumnComment)}" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" >
|
||||
<a-radio v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group></text>
|
||||
}else{
|
||||
<text><a-radio-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" >
|
||||
<a-radio v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-radio>
|
||||
</a-radio-group></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "checkbox"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
<text><a-checkbox-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" >
|
||||
<a-checkbox v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-checkbox>
|
||||
</a-checkbox-group></text>
|
||||
}else{
|
||||
<text><a-checkbox-group placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" >
|
||||
<a-checkbox v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-checkbox>
|
||||
</a-checkbox-group></text>
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "datepicker"){
|
||||
if (@column.WhetherRequired == "Y"){
|
||||
@:<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName',{rules: [{ required: true, message: '请选择@(@column.ColumnComment)!' }]}]" @@change="onChange@(@column.ColumnName)"/>
|
||||
}else{
|
||||
@:<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-decorator="['@column.ColumnName']" @@change="onChange@(@column.ColumnName)"/>
|
||||
}
|
||||
}
|
||||
@:</a-form-item>
|
||||
}
|
||||
}
|
||||
}
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@{
|
||||
var editData = 0;
|
||||
var DateQuery = "N";
|
||||
}
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
DateQuery="Y";
|
||||
}
|
||||
if(@column.ColumnKey != "True"){
|
||||
if(@column.EffectType != "datepicker"){
|
||||
editData++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@if(DateQuery == "Y"){
|
||||
@:import moment from 'moment'
|
||||
}
|
||||
import { @(@Model.ClassName)Edit } from '@@/api/modular/main/@(@Model.ClassName)Manage'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 15 }
|
||||
},
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.DictTypeCode != ""){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:@(@column.ColumnName)Data: [],
|
||||
}
|
||||
}
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:@(@column.ColumnName)DateString: '',
|
||||
}
|
||||
}
|
||||
}
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@if(DateQuery == "Y"){
|
||||
@:moment,
|
||||
}
|
||||
// 初始化方法
|
||||
edit (record) {
|
||||
this.visible = true
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.DictTypeCode != ""){
|
||||
if (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
<text>const @(@column.ColumnName)Option = this.$options
|
||||
this.@(@column.ColumnName)Data = @(@column.ColumnName)Option.filters['dictData']('@column.DictTypeCode')</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.form.setFieldsValue(
|
||||
{
|
||||
@{var editDataColumn = 0;}
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.ColumnKey == "True"){
|
||||
@:@column.ColumnName: record.@column.ColumnName,
|
||||
}else{
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "checkbox"){
|
||||
editDataColumn++;
|
||||
if(editDataColumn != editData) {
|
||||
@:@column.ColumnName: JSON.parse(record.@column.ColumnName),
|
||||
}else{
|
||||
@:@column.ColumnName: JSON.parse(record.@column.ColumnName)
|
||||
}
|
||||
}else if (@column.EffectType != "datepicker"){
|
||||
editDataColumn++;
|
||||
if(editDataColumn != editData){
|
||||
@:@column.ColumnName: record.@column.ColumnName,
|
||||
}else{
|
||||
@:@column.ColumnName: record.@column.ColumnName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}, 100)
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
// 时间单独处理
|
||||
//if (record.@column.ColumnName != null) {
|
||||
@:this.form.getFieldDecorator('@column.ColumnName', { initialValue: moment(record.@column.ColumnName, 'YYYY-MM-DD') })
|
||||
//}
|
||||
@:this.@(@column.ColumnName)DateString = moment(record.@column.ColumnName).format('YYYY-MM-DD')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSubmit () {
|
||||
const { form: { validateFields } } = this
|
||||
this.confirmLoading = true
|
||||
validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
for (const key in values) {
|
||||
if (typeof (values[key]) === 'object') {
|
||||
values[key] = JSON.stringify(values[key])
|
||||
}
|
||||
}
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:values.@column.ColumnName = this.@(@column.ColumnName)DateString
|
||||
}
|
||||
}
|
||||
}
|
||||
@(@Model.ClassName)Edit(values).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('编辑成功')
|
||||
this.confirmLoading = false
|
||||
this.$emit('ok', values)
|
||||
this.handleCancel()
|
||||
} else {
|
||||
this.$message.error('编辑失败')// + res.message
|
||||
}
|
||||
}).finally((res) => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
} else {
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherAddUpdate == "Y"){
|
||||
if (@column.EffectType == "datepicker"){
|
||||
@:onChange@(@column.ColumnName)(date, dateString) {
|
||||
@:this.@(@column.ColumnName)DateString = dateString
|
||||
@:},
|
||||
}
|
||||
}
|
||||
}
|
||||
handleCancel () {
|
||||
this.form.resetFields()
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
324
framework/Api/Ewide.Web.Entry/wwwroot/Template/index.vue.vm
Normal file
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-card :bordered="false" :bodyStyle="tstyle">
|
||||
@{var index = 0;}
|
||||
@if(Model.QueryWhetherList.Count > 0){
|
||||
<text>
|
||||
<div class="table-page-search-wrapper" v-if="hasPerm('@Model.ClassName:page')">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="48"></text>
|
||||
foreach (var column in Model.QueryWhetherList){
|
||||
index++;
|
||||
if(@index == 3){
|
||||
<text><template v-if="advanced"></text>
|
||||
}
|
||||
if(@column.EffectType == "input" || @column.EffectType == "textarea"){
|
||||
if(@index >= 3){
|
||||
<text>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-input v-model="queryParam.@column.ColumnName" allow-clear placeholder="请输入@(@column.ColumnComment)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}else{
|
||||
<text>
|
||||
<a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-input v-model="queryParam.@column.ColumnName" allow-clear placeholder="请输入@(@column.ColumnComment)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}
|
||||
}else if(@column.EffectType == "inputnumber"){
|
||||
if(@index >= 3){
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-input-number v-model="queryParam.@column.ColumnName" style="width: 100%" allow-clear placeholder="请输入@(@column.ColumnComment)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}else{
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-input-number v-model="queryParam.@column.ColumnName" style="width: 100%" allow-clear placeholder="请输入@(@column.ColumnComment)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}
|
||||
}else if(@column.EffectType == "select" || @column.EffectType == "radio"){
|
||||
if(@index >= 3){
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-select style="width: 100%" v-model="queryParam.@column.ColumnName" placeholder="请选择@(@column.ColumnComment)">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}else{
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-select style="width: 100%" v-model="queryParam.@column.ColumnName" placeholder="请选择@(@column.ColumnComment)">
|
||||
<a-select-option v-for="(item,index) in @(@column.ColumnName)Data" :key="index" :value="item.code">{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}
|
||||
}else if(@column.EffectType == "datepicker"){
|
||||
if(@index >= 3){
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-model="queryParam.@(@column.ColumnName)Date" @@change="onChange@(@column.ColumnName)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}else{
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<a-form-item label="@column.ColumnComment">
|
||||
<a-date-picker style="width: 100%" placeholder="请选择@(@column.ColumnComment)" v-model="queryParam.@(@column.ColumnName)Date" @@change="onChange@(@column.ColumnName)"/>
|
||||
</a-form-item>
|
||||
</a-col></text>
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Model.QueryWhetherList.Count > 2){
|
||||
</template>
|
||||
}if(Model.QueryWhetherList.Count > 2){
|
||||
<text>
|
||||
<a-col :md="8" :sm="24" >
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @@click="$refs.table.refresh(true)" >查询</a-button>
|
||||
<a-button style="margin-left: 8px" @@click="() => queryParam = {}">重置</a-button>
|
||||
<a @@click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? '收起' : '展开' }}
|
||||
<a-icon :type="advanced ? 'up' : 'down'"/>
|
||||
</a>
|
||||
</span>
|
||||
</a-col></text>
|
||||
}else{
|
||||
<text><a-col :md="8" :sm="24">
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @@click="$refs.table.refresh(true)">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @@click="() => queryParam = {}">重置</a-button>
|
||||
</span>
|
||||
</a-col></text>
|
||||
}
|
||||
<text>
|
||||
</text>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
}
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<s-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="true"
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.ColumnKey == "True"){
|
||||
@::rowKey="(record) => record.@column.ColumnName"
|
||||
}
|
||||
}
|
||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
|
||||
<template class="table-operator" slot="operator" v-if="hasPerm('@Model.ClassName:add')" >
|
||||
<a-button type="primary" v-if="hasPerm('@Model.ClassName:add')" icon="plus" @@click="$refs.addForm.add()">新增@(@Model.BusName)</a-button>
|
||||
</template>
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.WhetherTable == "Y"){
|
||||
if(@column.WhetherRetract == "Y" || @column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:<span slot="@(@column.ColumnName)scopedSlots" slot-scope="text">
|
||||
if(@column.WhetherRetract == "Y" && (@column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox")){
|
||||
@:<ellipsis :length="10" tooltip>{{ '@column.DictTypeCode' | dictType(text) }}</ellipsis>
|
||||
}else if(@column.WhetherRetract == "Y"){
|
||||
@:<ellipsis :length="10" tooltip>{{ text }}</ellipsis>
|
||||
}else if(@column.EffectType == "checkbox"){
|
||||
@:<a-tag v-for="textData in JSON.parse(text)" :key="textData.code" color="green">{{ 'sex' | dictType(textData) }}</a-tag>
|
||||
}else{
|
||||
@:{{ '@column.DictTypeCode' | dictType(text) }}
|
||||
}
|
||||
@:</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a v-if="hasPerm('@Model.ClassName:edit')" @@click="$refs.editForm.edit(record)">编辑</a>
|
||||
<a-divider type="vertical" v-if="hasPerm('@Model.ClassName:edit') & hasPerm('@Model.ClassName:delete')"/>
|
||||
<a-popconfirm v-if="hasPerm('@Model.ClassName:delete')" placement="topRight" title="确认删除?" @@confirm="() => @(@Model.ClassName)Delete(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</s-table>
|
||||
<add-form ref="addForm" @@ok="handleOk" />
|
||||
<edit-form ref="editForm" @@ok="handleOk" />
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@{
|
||||
var columnData = 0;
|
||||
var Ellipsis = "N";
|
||||
var DateQuery = "N";
|
||||
}
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.WhetherTable == "Y"){
|
||||
if(@column.WhetherRetract == "Y")
|
||||
Ellipsis="Y";
|
||||
columnData++;
|
||||
}
|
||||
if(@column.QueryWhether == "Y"){
|
||||
if(@column.EffectType == "datepicker")
|
||||
DateQuery="Y";
|
||||
}
|
||||
}
|
||||
@if(Ellipsis == "Y"){
|
||||
@:import { STable, Ellipsis } from '@@/components'
|
||||
}else{
|
||||
@:import { STable } from '@@/components'
|
||||
}
|
||||
@if(DateQuery == "Y"){
|
||||
@:import moment from 'moment'
|
||||
}
|
||||
import { @(@Model.ClassName)Page, @(@Model.ClassName)Delete } from '@@/api/modular/main/@(@Model.ClassName)Manage'
|
||||
import addForm from './addForm.vue'
|
||||
import editForm from './editForm.vue'
|
||||
export default {
|
||||
components: {
|
||||
@if(Ellipsis == "Y")
|
||||
@:Ellipsis,
|
||||
STable,
|
||||
addForm,
|
||||
editForm
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@if(Model.QueryWhetherList.Count > 2){
|
||||
@:advanced: false, // 高级搜索 展开/关闭
|
||||
}
|
||||
queryParam: {},
|
||||
columns: [
|
||||
@{var columnDataColumns = 0;}
|
||||
@foreach (var column in Model.TableField){
|
||||
if (@column.WhetherTable == "Y"){
|
||||
columnDataColumns++;
|
||||
@:{
|
||||
@:title: '@column.ColumnComment',
|
||||
@:align: 'center',
|
||||
if(@column.WhetherRetract == "Y" || @column.EffectType == "select" || @column.EffectType == "radio" || @column.EffectType == "checkbox"){
|
||||
@:dataIndex: '@column.ColumnName',
|
||||
@:scopedSlots: { customRender: '@(@column.ColumnName)scopedSlots' },
|
||||
}else{
|
||||
@:dataIndex: '@column.ColumnName'
|
||||
if(columnDataColumns != columnData){
|
||||
@:},
|
||||
}else{
|
||||
@:}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
@if(DateQuery == "Y"){
|
||||
@:return @(@Model.ClassName)Page(Object.assign(parameter, this.switchingDate())).then((res) => {
|
||||
}else{
|
||||
@:return @(@Model.ClassName)Page(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
}
|
||||
return res.data
|
||||
})
|
||||
},
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.QueryWhether == "Y"){
|
||||
if(@column.EffectType == "select" || @column.EffectType == "radio"){
|
||||
if(@column.DictTypeCode)
|
||||
@:@(@column.ClassName)Data: [],
|
||||
}
|
||||
}
|
||||
}
|
||||
selectedRowKeys: [],
|
||||
selectedRows: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
if (this.hasPerm('@Model.ClassName:edit') || this.hasPerm('@Model.ClassName:delete')) {
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
width: '150px',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
})
|
||||
}
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.QueryWhether == "Y"){
|
||||
if(@column.EffectType == "select" || @column.EffectType == "radio"){
|
||||
if(@column.DictTypeCode){
|
||||
<text>const @(@column.ClassName)Option = this.$options
|
||||
this.@(@column.ClassName)Data = @(@column.ClassName)Option.filters['dictData']('@column.DictTypeCode')</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@if(DateQuery == "Y"){
|
||||
@:moment,
|
||||
}
|
||||
/**
|
||||
* 查询参数组装
|
||||
*/
|
||||
switchingDate () {
|
||||
@foreach (var column in Model.TableField){
|
||||
if(@column.QueryWhether == "Y"){
|
||||
if(@column.EffectType == "datepicker"){
|
||||
@:const queryParam@(@column.ColumnName) = this.queryParam.@(@column.ColumnName)Date
|
||||
@:if (queryParam@(@column.ColumnName) != null) {
|
||||
@: this.queryParam.@column.ColumnName = moment(queryParam@(@column.ColumnName)).format('YYYY-MM-DD')
|
||||
@: if (queryParam@(@column.ColumnName).length < 1) {
|
||||
@: delete this.queryParam.@(@column.ColumnName)
|
||||
@: }
|
||||
@:}
|
||||
}
|
||||
}
|
||||
}
|
||||
const obj = JSON.parse(JSON.stringify(this.queryParam))
|
||||
return obj
|
||||
},
|
||||
@(@Model.ClassName)Delete (record) {
|
||||
@(@Model.ClassName)Delete(record).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('删除成功')
|
||||
this.$refs.table.refresh()
|
||||
} else {
|
||||
this.$message.error('删除失败') // + res.message
|
||||
}
|
||||
})
|
||||
},
|
||||
@if(Model.QueryWhetherList.Count > 2){
|
||||
@:toggleAdvanced () {
|
||||
@:this.advanced = !this.advanced
|
||||
@:},
|
||||
}
|
||||
@foreach (var column in Model.QueryWhetherList){
|
||||
if(@column.QueryWhether == "Y"){
|
||||
if(@column.EffectType == "datepicker"){
|
||||
@:onChange@(@column.ColumnName)(date, dateString) {
|
||||
@: this.@(@column.ColumnName)DateString = dateString
|
||||
@:},
|
||||
}
|
||||
}
|
||||
}
|
||||
handleOk () {
|
||||
this.$refs.table.refresh()
|
||||
},
|
||||
onSelectChange (selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
this.selectedRows = selectedRows
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||