Comments (2)
数据字典中定义为查询语句时上传excel会有问题,做了如下修改,你看看怎么改
private static List<CellOptions> GetExportColumnInfo(string tableName, bool temlate = false, bool filterKeyValue = true) { //&& x.IsDisplay == 1&&x.IsReadDataset==0只导出代码生器中设置为显示并且不是只读的列,可根据具体业务设置导出列 List<CellOptions> cellOptions = DBServerProvider.DbContext.Set<Sys_TableColumn>() .Where(x => x.TableName == tableName && x.IsDisplay == 1 && x.IsReadDataset == 0).Select(c => new CellOptions() { ColumnName = c.ColumnName, ColumnCNName = c.ColumnCnName, DropNo = c.DropNo, Requierd = c.IsNull > 0 ? false : true, ColumnWidth = c.ColumnWidth ?? 90 }).ToList(); if (temlate) return cellOptions; var dicNos = cellOptions.Where(x => !string.IsNullOrEmpty(x.DropNo)).Select(c => c.DropNo); if (dicNos.Count() == 0) return cellOptions; List<Sys_Dictionary> dictionaries = DictionaryManager.GetDictionaries(dicNos); //获取绑定字典数据源下拉框的值 foreach (string dicNo in dicNos.Distinct()) { Dictionary<string, string> keyValues = null; if (dictionaries.Find(p => p.DicNo == dicNo).DbSql != string.Empty)//通过查询语句 { var data = DBServerProvider.SqlDapper.QueryList<KeyValueDto>(dictionaries .Find(p => p.DicNo == dicNo).DbSql, null).ToList(); if (filterKeyValue) { keyValues = data .Where(w => w.key != w.value)? //key==value相同的则不处理 .ToDictionary(r => r.key, r => r.value); } else { keyValues = data.ToDictionary(r => r.key, r => r.value); } } else//通过数据字典 { var query = dictionaries .Where(x => x.DicNo == dicNo && x.Sys_DictionaryList != null) .Select(s => s.Sys_DictionaryList); // .FirstOrDefault() //.Where(w => (filterKeyValue && w.DicName != w.DicValue)|| !filterKeyValue) //key==value相同的则不处理 // .ToDictionary(r => r.DicValue, r => r.DicName); if (filterKeyValue) { keyValues = query.FirstOrDefault()? .Where(w => w.DicName != w.DicValue)? //key==value相同的则不处理 .ToDictionary(r => r.DicValue, r => r.DicName); } else { keyValues = query.FirstOrDefault()?.ToDictionary(r => r.DicValue, r => r.DicName); } } foreach (CellOptions options in cellOptions.Where(x => x.DropNo == dicNo)) { options.KeyValues = keyValues; } } return cellOptions; } } public class KeyValueDto { public string key { get; set; } public string value { get; set; } }
你的理解是对的,这个导入时自定义sql校验数据源我们目前还没实际用到所以功能一直没处理,因为还要考虑其他一些细节,没有按你的方式写,你获取下,另外能否把你动态修改表单组件添加的datetime类型这个代码截图下,我这里测试没有发现异常
from vue.netcore.
多谢!
from vue.netcore.
Related Issues (20)
- 前端的table组件在编辑状态下是否可以添加一个单元格获得焦点事件 HOT 3
- 有重写vue3 版本的想法吗 可以帮忙 HOT 2
- 对于新增界面可以增加引用历史记录,实现一键填单的功能
- Vol项目
- 这个项目生成的前端能不能分离出来对接我自己的后台 HOT 1
- vs2002下发布选择“生成单个文件”时无法正常启动 HOT 4
- PGSQL 查询异常 HOT 1
- 新用户菜单显示问题 HOT 1
- 前端项目应该用哪个目录下的代码,vue3目录下我看是vue2写法! HOT 1
- 请问大佬,Vol.Vue3版本,点击左边每个菜单选项为什么会在控制台上报错,如图 HOT 1
- 关于解密判断入参IsBase64的优化建议
- 后台可以支持一个主表,多个子表新增编辑删除吗?具体代码怎么实现呢 HOT 6
- 老大,h5部分砍了吗,guide就放几张截图是啥意思啊 HOT 2
- 存储过程支持代码生成吗,代码生成只支持视图和单表吗 HOT 2
- 全局的时间格式配置不生效 HOT 2
- 这个框架如何集成Azure AD SSO登录呢? HOT 1
- UploadExcel组件的错误 HOT 1
- 这是多租户吗? HOT 3
- 建议增加接口限流
- vol.pro开发框架中的语言设置在后台怎么配置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue.netcore.