Giter VIP home page Giter VIP logo

yishaadmin's Introduction

YiShaAdmin

YiShaAdmin 基于.NET Core Web开发,借鉴了很多开源项目的优点,让你开发Web管理系统和移动端Api更简单,所以我也把她开源了。 她可以用于所有的Web应用程序,例如网站管理后台、CMS、CRM、ERP、OA这类的系统和移动端Api。

YiShaAdmin 版本 .NET Core 版本 是否支持 链接 Developer
7.0 7.0 支持 YiShaAdmin-Net7.0 luckearth
6.0 6.0 支持 YiShaAdmin-Net6.0 zgcwkj
3.1 3.1 支持 YiShaAdmin-Net3.1
2.2 2.2 支持 YiShaAdmin-Net2.2

内置功能

  • 员工管理:员工是系统操作者,该功能主要完成系统用户配置
  • 部门管理:配置系统组织机构(公司、部门、小组)
  • 职位管理:配置系统用户所担任职务
  • 文章中心:管理新闻及公司案例
  • 角色管理:角色菜单权限分配,角色对应权限,员工属于某个角色
  • 菜单管理:配置系统菜单,操作权限,按钮权限标识
  • 通用字典:系统里动态改变的数据,像文章类型,用字典进行维护,不变的数据,可以用枚举
  • 行政区划:全国的省市县三级数据,展示树形数据的使用
  • 系统日志(登录日志、操作日志、Api日志):查看系统的登录、操作、Api调用日志
  • 定时任务:在线(添加、修改、删除)任务调度,包含执行结果日志
  • 系统Api:Api文档与测试工具
  • 数据表管理:查看当前数据库所有表、字段及记录总数
  • 代码生成:快速生成对单表的增删改查
  • 服务器信息:查看服务器的基本信息

开发文档

文档地址:https://www.toolhelper.cn/doc

演示图

登录页面 登录进去首页 用户列表 用户列表修改

如何参与开源项目

贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。

  1. Fork本项目
  2. 创建开发分支 (git checkout -b dev)
  3. 提交更改 (git commit -m 'Add something')
  4. 推送到分支 (git push origin dev)
  5. Pull Request,建议每一个小功能提一个 PR

License

MIT

yishaadmin's People

Contributors

adminoryuan avatar ajancn avatar cscscommon avatar dependabot[bot] avatar jhzou1 avatar layneliang avatar liukuo362573 avatar xiaobei930 avatar zgcwkj avatar zhaopan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yishaadmin's Issues

任务无法正常的被调度起来

Overview of the problem

QQ图片20200615181104

Description

请问下为什么每次创建修改任务都是只更新表里面的值,而实际的任务没有运行起来,是不是还需在哪部署个服务才能正常运作起来?

请教下自动编译后更新方案

刚刚开始学习YiShaAdmin,成功运行。
不过有些问题想请教下。

问题:

目前项目是通过F5启动调试运行的,修改cshtml内容后手动刷新页面可以看到修改效果。
但是针对cs代码的修改需要重启调试才能生效。
请问有没有什么编译后自动更新的方案,不用每次都重启?

谢谢!

数据权限如何控制?

同一模块页面下,用户是否可以按照权限分配来管理不同人员的数据(查看、修改或删除)

一个小组组长或部门领导除了可以管理自己的数据,还要管理其下员工的数据;按照不同的层级,是否可以分级管理数据呢,并与功能权限相配合。

请问下,net core 3.1 好像不支持,是么?

It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found.

  • The following frameworks were found:
    2.1.17 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    3.1.3 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

C:\Program Files\dotnet\dotnet.exe (进程 10892)已退出,代码为 -2147450730。
要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。
按任意键关闭此窗口. . .

能不能把bootstrap 升级到最新版本?

非常感谢作者的代码和贡献,如果能把bootstrap 更新到4.0以上版本就好了,我把bootstrap版本替换到最新版本,结果界面就乱套了。能否做一个基于bootstrap 4 的版本?谢谢

$.fn.setWebControls checkbox BUG

yisha-plugin.js 第416行 - 424行,普通的checkbox不会生效
应该是大佬把getWebControls那段复制过来忘记修改了

ajax因为网络异常问题居然提交了两次数据。产生了两行

群主群主,发现一个很难试出来的问题。但是确实发生了几次因为网络问题。居然保存两两行数据。本来是一个数据。因为网络卡了一下。居然生成了两行。好奇怪的问题。因为是ajax提交这里问题,有没有好方法控制?

It should be important and priority

Hi,

Can you build structure to write YiSha.Admin.Web appsettings.json LoginProvider WebApi and connect with API?
YiSha.Admin.Web will not connect with the database will connect with the web api URL?

Thank you

image

表格多字段排序时,只有一个起作用

排序设置:
sortOrder: 'asc',
sortName: 'ReportTime,AqiValue,Pm25Iaqi,Pm10Iaqi',
实际只有最后一个有效。
我的办法:
修改数据库排序字段处理,sqlserver修改:SqlServerDatabase.cs 下
private async Task<(int total, IEnumerable list)> FindList(IQueryable tempData, string orderField, bool isAsc, int pageSize, int pageIndex)

            if(index==0 )
                resultExp = Expression.Call(typeof(Queryable), isAsc ? "OrderBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, tempData.Expression, Expression.Quote(orderByExp));
            else
                resultExp = Expression.Call(typeof(Queryable), isAsc ? "ThenBy" : "OrderByDescending", new Type[] { typeof(T), property.PropertyType }, resultExp, Expression.Quote(orderByExp));

SqlServerDatabase.Update<T>(IEnumerable<T> entities) 批量更新数据方法报错

Overview of the problem

使用SqlServer数据库,批量更新数据时,Update功能报错。

Description

Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'SqlServerDbContext'.

Steps to reproduce

  1. List entity;
  2. service.Update(entity);

The problem code

https://github.com/liukuo362573/YiShaAdmin/blob/master/YiSha.Data/YiSha.Data.EF/Database/SqlServerDatabase.cs
line257。

foreach (var entity in entities)
{
    await this.Update(entity); // line257
}

这里第一次执行await this.Update(entity);后,就会关闭事务,导致后续操作报错。
Insert的写法有差别。Line167。

工程内的表格单元格样式设置不起作用

在列初始化时设置单元格样式:
cellStyle:function(value,row,index){
if (value=="11"){
return { css: { "background-color": "#00E400" } };
}else {
return { css: { "background-color": "#7E0023" } };
}
}
在工程外单独的测试页面中可以按值设置背景颜色,但在本项目中设置不起作用。
工程外:
正常

本项目:
背景色不起作用

提个建议

感觉作者做得挺不错,加油,新年快乐!项目里面有不少用不到的希望再裁减一下,尽量干净,作为模范例子来使用

日期控件错位

日期控件直接打开不会错位,但是往下滚轮,那个控件也跟着往下滚 ,没有跟上面的输入框绑在一起

EXCELHELP数据类型缺失

导出excel的时候,real类型数据导出为空白,请在EXCELHELPER,建议增加单精类型,和其他类型。
case "System.Single":
case "System.Nullable`1[System.Single]":
newCell.SetCellValue(drValue.ParseToFloat());
break;

数据库备份 mysql不可用

Hi Yisha,我发现一个问题,你这个框架的数据库备份任务只适用于sql server,但是mysql的备份就不行了,我研究了下,mysql 备份要引入一下包mysqlbackup
代码如下,不知道我这样做好不好?作者有没有其他方法?
public async Task DataBaseBackup(string filePath)
{
var fileName = $"{filePath}\db_bak{DateTime.Now.ToString("yyyyMMddhhmm")}.sql";

        try
        {
            using (MySqlConnection conn =
            new MySqlConnection(dbconnString))
            {
                using (MySqlCommand cmd = new MySqlCommand())
                {
                    cmd.Connection = conn;
                    await conn.OpenAsync();

                    using (MySqlBackup mb = new MySqlBackup(cmd))
                    {
                        LogHelper.Trace(fileName+" 开始备份");
                        mb.ExportToFile(fileName);
                    }
                }
            }
            return 1;
        }
        catch (Exception ex)
        {
            LogHelper.Error(ex.Message);
            return 0;
        }
    }

自动生成的网址错误

在菜单管理里面新增一个页面,地址

http://www.hao123.com,

最终生成的网址为

http://localhost:80/http://www.hao123.com
很明显前置URI不该添加。

多数据库并存

在一个项目中,可能会涉及到多个数据库同时连接,同一种数据库也可能有多个连接,要如何管理?

字符串字段保存时空值无法更新旧值。

所有的表均存在此问题:用户在更新一个表的字符串字段时,若该字段原先有字符串值,修改为空,则无法保存空值。原值不变。 需把空值改为 string.Empty。( 用户的备注信息字段无法保存。)

按钮权限有问题

按钮权限有问题,系统没有实现按钮权限管控吧?虽然后台有配置启用禁用,但是实际没有效果。

作者有没有计划出个依赖注入为主版本的后台

这里三层架构非常清晰,项目结构很清晰,但是感觉跟微软主推的初衷有背,AspNetCore主推依赖注入aop的开发方式,但看项目感觉完全像是撇开依赖注入。强行还是原来net framework的开发模式。

表关联查询及新增

请问如何使用框架进行有外键关联或者普通的表关联增删改查,必须要自己在相应的区域进行多个BLL操作吗?

新增第三方JS组件如何生效的问题

如题,如何让自己加的第三方组件在yisha中生效。我的做法是首先在lib中加入JS组件包,
然后在头部引入文件比如:
@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment HostingEnvironment @section header{ @BundlerHelper.Render(HostingEnvironment.ContentRootPath, Url.Content("~/lib/typeahead/bootstrap3-typeahead.min.js")) @BundlerHelper.Render(HostingEnvironment.ContentRootPath, Url.Content("~/lib/reorder/bootstrap-table-reorder.js")) @BundlerHelper.Render(HostingEnvironment.ContentRootPath, Url.Content("~/lib/reorder/jquery.tablednd.js")) }
然后去代码中调用,发现是不生效的,不知道还需要哪里做设置。

但是如果我在body底部用常规方法引入是生效的,比如:
<script src="~/lib/typeahead/bootstrap3-typeahead.min.js"></script><script src="~/lib/reorder/bootstrap-table-reorder.js"></script><script src="~/lib/reorder/jquery.tablednd.js"></script>
求大佬解惑一下是否我哪里设置出错或遗漏了什么?Tks

新增用户角色权限漏洞

新增用户的时候可以选择所有的角色,如此一来分配给某用户增加新用户的权限,则其可以添加一个超级管理权限用户,则不能有效保障权限管理有效性。

新建表后代码生成器生成后提示列名无效,请留意列名是否以带下划线命名user_name

新建表后代码生成器生成后提示列名无效,请留意列名是否以带下划线命名user_name

SELECT TOP 1000 [Id]
,[UserName]
,[TelPhone]
,[IdCard]
,[Creatime]
FROM [PingAnUserMsg]
我数据库新建了一个表,然后用代码生成器生成了文件后,提示出我列名 'id_card' 无效。 列名 'tel_phone' 无效。 列名 'user_name' 无效

解决方案是:按文档的命名,字段命带下划线

希望能够加入热拔插plugin作为自动任务调度.

看了你的代码感觉相当不错,现在有精力去把所学整理成系统的人实在太少了.而且还是跨了前端和后端两个方面.
基于这个系统我有一些个人的看法,希望能够对你有所帮助.

1.能够加入热拔插plugin作为自动任务调度.Quartz中有包括启用时间和停止时间的.这个东西在实际应用中非常有用.因为你不可能将这些逻辑都放到DLL中去.而且,在执行完后,我们可以迅速的停用任务.

2.权限配置应该是由数据库中配置,而不是通过Attribute来控制.一是会增加代码量,二是维护起来会非常难受.我们正常的做法是将权限缓存到Redis或者是Cache中.

3.Swaggar API中,应该考虑400或者是500等服务端错误.保证即使服务端出现异常,也可以返回标准的JSON格式.因为前端要去处理Server Error和ResponseData要分开写,后端应当尽量减少前端对数据的处理逻辑过程.

4.加个websocket的支持.并且提供显示大屏综显DEMO.因为你的首页上面提供 的信息基本上可以放到Versions中去.至少要有个示例.显得高大上.

感谢,代码拿走了.

bootstrap tree 扩展有问题

举个例子:
列表数据是A->B->C 这样tree类型可以显示A 的parentId=0或者null

如果搜索完数据是B->C 无法显示 B的parentId是AId,但此时A不在,一直找不到,造成最后无法显示数据
bootstrap-treetable.js 里面 formatData--->target.getRootFlag(item);

修改通用字典

修改通用字典页面得字典类型,再查看字典数据页面之前的数据看不到了,看了表之后发现字典类型(sys_data_dict 中dict_type)并没有同步到字典数据(sys_data_dict_detail)这张表

Dialog的问题

    ys.openDialog({
        title: id > 0 ? "编辑文章" : "添加文章",
        content: '@Url.Content("~/OrganizationManage/News/NewsForm")' + '?id=' + id,
        callback: function (index, layero) {
            var iframeWin = window[layero.find('iframe')[0]['name']];
            iframeWin.saveForm(index);
        }
    }); 

        //Maximized: true,
        这里想打开时,默认是最大化,不知道是那个属性,这个Maximized: true,无效。

权限上有问题

例如用户管理
A公司
---B部门
-----B1员工
---C部门

B1有用户管理菜单权限,
左侧菜单就会显示
A公司
---B部门
---C部门
右侧列表会显示所有用户

其实真正上应该显示最顶级是B部门或者A公司右侧的用户也不能显示所有,毕竟不是超级管理员。这样造成越权修改一些信息了,任何一个有用户管理菜单权限的都能把用户随意创建到任意部门或者公司下面去。

建议弹窗可以跳出iframe

使用iframe做多标签页时,内部弹窗局限在iframe内部,对很多小屏电脑(比如14寸笔记本)不够友好,建议可以通过主页面弹窗的方式把弹窗释放到主页面。

启动不了项目是扫码情况?

E:\NETCore\YiShaAdmin\YiSha.Web\YiSha.Admin.Web\bin\Debug\netcoreapp3.1>dotnet YiSha.Admin.Web.exe
Error:
An assembly specified in the application dependencies manifest (YiSha.Admin.Web.deps.json) has already been found but with a different file extension:
package: 'YiSha.Admin.Web', version: '1.0.0'
path: 'YiSha.Admin.Web.dll'
previously found assembly: 'E:\NETCore\YiShaAdmin\YiSha.Web\YiSha.Admin.Web\bin\Debug\netcoreapp3.1\YiSha.Admin.Web.exe'

mysql_data.sql语句错误

INSERT INTO `SysNews` (`Id`, `BaseIsDelete`, `BaseCreateTime`, `BaseModifyTime`, `BaseCreatorId`, `BaseModifierId`, `BaseVersion`, `NewsTitle`, `NewsContent`, `NewsTag`, `ProvinceId`, `CityId`, `CountryId`, `ThumbImage`, `NewsAuthor`, `NewsSort`, `NewsDate`, `NewsType`, `ViewTimes`) VALUES
	(34571912667467776, 0, '2019-04-06 09:36:26', '2019-10-10 12:22:22', 16508640061130151, 16508640061130151, 0, 'UHC健康会', '<p>UHC 健康会,您的健康管家,为您的健康保驾护航。</p><p>\n        <img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/8722abb613cd46b4af5b4ded7ddf5fad.jpg" data-filename="/" style="width: 550px;">\n    </p><p>\n        <img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/1ffc4edd922e4cb195744c13f9eec636.jpg" data-filename="/" style="width: 550px;">\n    </p><p>\n        <img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/e0728828482542f099ab79ba7d3ef701.jpg" data-filename="/" style="width: 550px;">\n\n    </p><p>\n        <img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/57b1153fbf514d9384ba9837a46737cf.jpg" data-filename="/" style="width: 550px;">\n        <br>\n    </p>\n    <p>小程序码</p><p>\n        <img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/46ece527595a408e9e62b2334374b560.jpg" data-filename="/" style="width: 430px;">\n        <br>\n    </p><p><br></p>', '微信小程序,健康会', 0, 0, 0, 'https://www.yishasoft.com/api/Resource/News/2019/07/31/eee642de4d3443779c0670e0da8eeed7.png', '管理员', 1, '2019-04-06 09:29:00', 1, 138),
	(76797547762421760, 0, '2019-07-31 22:06:02', '2019-10-12 17:29:52', 16508640061130151, 16508640061130151, 0, '58名师', '<p>汇聚同城的各科教师,找老师,就上58名师!</p><p><img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/b0316da26b5546d1bf07fcd05e8889e0.png" data-filename="/" style="width: 270px;"></p><p><br></p><p><img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/ad812ef0248a4fcb94edfa69d1ee5a66.png" data-filename="/" style="width: 269px;"></p><p><img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/b2921e1e08e04b0d92b29485356eacb1.png" data-filename="/" style="width: 273px;"></p><p><img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/a1ee188e3d3b462c8f401a9205ddd10e.png" data-filename="/" style="width: 274px;"></p><p>小程序码</p><p><img src="https://www.yishasoft.com/api/Resource/News/2019/07/31/1c30e2bb681448bab52e566993b82472.jpg" data-filename="/" style="width: 430px;"><br></p><p><br></p>', '微信小程序,找老师', 340000, 340100, 340172, 'https://www.yishasoft.com/api/Resource/News/2019/07/31/a627c3eed0ca428391fa62a841652ea4.png', '管理员', 2, '2019-07-31 21:44:00', 1, 35);

其中,CountryId字段应为CountyId

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.