Merge branch 'master'

This commit is contained in:
不做码农 2021-11-18 14:09:07 +08:00
commit eeee51f22c
7 changed files with 80 additions and 139 deletions

View File

@ -90,8 +90,11 @@ namespace ZR.Admin.WebApi.Controllers
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
Dictionary<string, object> options = JsonConvert.DeserializeObject<Dictionary<string, object>>(genTableInfo.Options);
dto.ParentMenuId = (long)options.GetValueOrDefault("parentMenuId", 0);
if (!string.IsNullOrEmpty(genTableInfo.Options))
{
Dictionary<string, object> options = JsonConvert.DeserializeObject<Dictionary<string, object>>(genTableInfo.Options);
dto.ParentMenuId = (long)options.GetValueOrDefault("parentMenuId", 0);
}
dto.GenTable = genTableInfo;
//生成代码
CodeGeneratorTool.Generate(genTableInfo, dto);
@ -176,9 +179,9 @@ namespace ZR.Admin.WebApi.Controllers
ClassName = CodeGeneratorTool.GetClassName(tableName),
BusinessName = CodeGeneratorTool.GetClassName(tableName),
FunctionAuthor = ConfigUtils.Instance.GetConfig(GenConstants.Gen_author),
FunctionName = tabInfo.Description,
FunctionName = string.IsNullOrEmpty(tabInfo.Description) ? tableName : tabInfo.Description,
TableName = tableName,
TableComment = tabInfo.Description,
TableComment = string.IsNullOrEmpty(tabInfo.Description) ? tableName : tabInfo.Description,
Create_by = userName,
};
genTable.TableId = GenTableService.ImportGenTable(genTable);

View File

@ -19,7 +19,7 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Stage"
"ASPNETCORE_ENVIRONMENT": ""
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}

View File

@ -7,11 +7,11 @@
}
},
"ConnectionStrings": {
"conn_zrAdmin": "server=127.0.0.1;user=zr;pwd=abc;database=admin",
"conn_bus": "server=127.0.0.1;user=zr;pwd=abc;database=admin"
"conn_zrAdmin": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;uid=sa;pwd=zradmin123;database=ZrAdmin;Trusted_Connection=SSPI",
"conn_bus": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;uid=zr;pwd=zradmin123;database=ZrAdmin;Trusted_Connection=SSPI"
},
"conn_zrAdmin_type": 0, //MySql = 0, SqlServer = 1
"conn_bus_type": 0,
"conn_zrAdmin_type": 1, //MySql = 0, SqlServer = 1
"conn_bus_type": 1,
"urls": "http://localhost:8888", //url
"sysConfig": {
"DBCommandTimeout": 10,
@ -30,8 +30,8 @@
"SECRET": "XX"
},
"gen": {
"conn": "server=127.0.0.1;user=zr;pwd=abc;database={database}",
"dbType": 0, //MySql = 0, SqlServer = 1
"conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database={database};Trusted_Connection=SSPI",
"dbType": 1, //MySql = 0, SqlServer = 1
"autoPre": true, //
"author": "zr",
"tablePrefix": "live_,sys_" //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",

View File

@ -49,7 +49,7 @@ namespace {ApiControllerNamespace}.Controllers
//开始拼装查询条件
var predicate = Expressionable.Create<{ModelName}>();
//TODO 搜索条件
//TODO 自己实现搜索条件查询语法参考Sqlsugar默认查询所有
//predicate = predicate.And(m => m.Name.Contains(parm.Name));
var response = _{ModelName}Service.GetPages(predicate.ToExpression(), parm);

View File

@ -2,31 +2,14 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
placeholder="请输入公告标题"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.noticeTitle" placeholder="请输入公告标题" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="操作人员" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入操作人员"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.createBy" placeholder="请输入操作人员" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
<el-option v-for="dict in typeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
</el-select>
</el-form-item>
<el-form-item>
@ -37,33 +20,15 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
<el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:notice:edit']">修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:notice:remove']">删除
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -71,26 +36,9 @@
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column
label="公告类型"
align="center"
prop="noticeType"
:formatter="typeFormat"
width="100"
/>
<el-table-column
label="状态"
align="center"
prop="status"
:formatter="statusFormat"
width="100"
/>
<el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
<el-table-column label="公告类型" align="center" prop="noticeType" :formatter="typeFormat" width="100" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="100" />
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template slot-scope="scope">
@ -99,31 +47,14 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']">删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
@ -137,29 +68,20 @@
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
<el-option v-for="dict in typeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
<el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
<editor v-model="form.noticeContent" :min-height="192" />
</el-form-item>
</el-col>
</el-row>
@ -173,13 +95,20 @@
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
import Editor from '@/components/Editor';
import {
listNotice,
getNotice,
delNotice,
addNotice,
updateNotice,
// exportNotice,
} from "@/api/system/notice";
import Editor from "@/components/Editor";
export default {
name: "Notice",
components: {
Editor
Editor,
},
data() {
return {
@ -211,27 +140,27 @@ export default {
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
status: undefined,
},
//
form: {},
//
rules: {
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" }
{ required: true, message: "公告标题不能为空", trigger: "blur" },
],
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
{ required: true, message: "公告类型不能为空", trigger: "change" },
],
},
};
},
created() {
this.getList();
this.getDicts("sys_notice_status").then(response => {
this.getDicts("sys_notice_status").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_notice_type").then(response => {
this.getDicts("sys_notice_type").then((response) => {
this.typeOptions = response.data;
});
},
@ -239,7 +168,7 @@ export default {
/** 查询公告列表 */
getList() {
this.loading = true;
listNotice(this.queryParams).then(response => {
listNotice(this.queryParams).then((response) => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
@ -265,7 +194,7 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
status: "0"
status: "0",
};
this.resetForm("form");
},
@ -281,9 +210,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.noticeId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map((item) => item.noticeId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -294,25 +223,25 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
const noticeId = row.noticeId || this.ids;
getNotice(noticeId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改公告";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
updateNotice(this.form).then((response) => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addNotice(this.form).then(response => {
addNotice(this.form).then((response) => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -323,18 +252,24 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
const noticeIds = row.noticeId || this.ids;
this.$confirm(
'是否确认删除公告编号为"' + noticeIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
type: "warning",
}
)
.then(function () {
return delNotice(noticeIds);
}).then(() => {
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
}
}
});
},
},
};
</script>

View File

@ -9,11 +9,12 @@
<el-input v-model="form.subject"></el-input>
</el-form-item>
<el-form-item label="邮件内容" prop="content">
<el-input v-model="form.content" rows="3" type="textarea"></el-input>
<editor v-model="form.content" :min-height="192" />
</el-form-item>
<el-form-item label="附件">
<el-upload name="file" ref="upload" :data="{savetype: form.saveType, filePath: form.filePath}" :headers="headers" :auto-upload="false" :on-success="uploadSuccess" :action="uploadActionUrl">
<el-upload name="file" ref="upload" :data="{savetype: form.saveType, filePath: form.filePath}" :headers="headers" :auto-upload="false"
:on-success="uploadSuccess" :action="uploadActionUrl">
<el-button slot="trigger" size="mini" icon="el-icon-upload">选择文件</el-button>
<el-button style="margin-left: 10px;" size="mini" type="primary" @click="submitUpload">上传到服务器</el-button>
</el-upload>
@ -27,9 +28,11 @@
<script>
import { sendEmail } from "@/api/common";
import { getToken } from "@/utils/auth";
import Editor from "@/components/Editor";
export default {
name: "sendEmail",
components: { Editor },
data() {
return {
form: {

Binary file not shown.