mirror of
https://gitee.com/x_discoverer/Vue.NetCore.git
synced 2025-12-06 07:49:23 +08:00
迁移旧代码到新版本
This commit is contained in:
@@ -84,7 +84,7 @@ namespace VOL.Sys.Services
|
||||
{
|
||||
return webResponse.Error("上级组织不能选择自己");
|
||||
}
|
||||
if (_repository.Exists(x => x.ParentId == dept.DepartmentId) && _repository.Exists(x => x.DepartmentId == dept.ParentId))
|
||||
if (_repository.Exists(x => x.ParentId == dept.DepartmentId && x.DepartmentId == dept.ParentId))
|
||||
{
|
||||
return webResponse.Error("不能选择此上级组织");
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace VOL.Sys.Services
|
||||
{
|
||||
return webResponse.Error("上级组织不能选择自己");
|
||||
}
|
||||
if (_repository.Exists(x => x.ParentId == dept.DepartmentId) && _repository.Exists(x => x.DepartmentId == dept.ParentId))
|
||||
if (_repository.Exists(x => x.ParentId == dept.DepartmentId&&x => x.DepartmentId == dept.ParentId))
|
||||
{
|
||||
return webResponse.Error("不能选择此上级组织");
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<vol-loading></vol-loading>
|
||||
</div>
|
||||
<el-table
|
||||
:key="randomTableKey"
|
||||
:show-summary="summaryData.length > 0"
|
||||
:summary-method="getSummaryData"
|
||||
:row-key="rowKey"
|
||||
|
||||
@@ -74,8 +74,10 @@ export const loadData = async (
|
||||
}
|
||||
//2021.06.04修复tree不刷新的问题
|
||||
if (props.rowKey) {
|
||||
randomTableKey.value++
|
||||
tableData.splice(0)
|
||||
if (props.lazy) {
|
||||
randomTableKey.value++;
|
||||
}
|
||||
tableData.splice(0);
|
||||
}
|
||||
loading.value = false
|
||||
emit(
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
** Author:jxx 2022
|
||||
** QQ:283591387
|
||||
**完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】
|
||||
**常用示例见:http://v2.volcore.xyz/document/vueDev
|
||||
**后台操作见:http://v2.volcore.xyz/document/netCoreDev
|
||||
*****************************************************************************************/
|
||||
//此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;
|
||||
},
|
||||
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;
|
||||
@@ -1,66 +0,0 @@
|
||||
// author:jxx
|
||||
// 此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js)
|
||||
let extension = {
|
||||
components: {
|
||||
// 动态扩充组件或组件路径
|
||||
// 表单header、content、footer对应位置扩充的组件
|
||||
gridHeader: '', // { template: "<div>扩展组xx件</div>" },
|
||||
gridBody: '',
|
||||
gridFooter: '',
|
||||
// 弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件
|
||||
modelHeader: '',
|
||||
modelBody: '',
|
||||
modelFooter: ''
|
||||
},
|
||||
text: '',
|
||||
buttons: {
|
||||
view: [
|
||||
{
|
||||
name: '生成语言包',
|
||||
icon: 'el-icon-plus',
|
||||
index: 1,
|
||||
type: 'primary',
|
||||
plain:true,
|
||||
onClick: function () {
|
||||
this.createLanguagePack()
|
||||
}
|
||||
}
|
||||
],
|
||||
box: [],
|
||||
detail: []
|
||||
}, // 扩展的按钮
|
||||
methods: {
|
||||
destroyed () {
|
||||
},
|
||||
// 事件扩展
|
||||
onInit () {
|
||||
this.labelWidth = 140
|
||||
this.maxBtnLength = 10
|
||||
// this.boxOptions.height = 300
|
||||
this.textInline = false
|
||||
this.continueAdd = true;
|
||||
|
||||
},
|
||||
onInited () {
|
||||
|
||||
},
|
||||
createLanguagePack () {
|
||||
this.http
|
||||
.get('/api/Sys_Language/createLanguagePack', {}, true)
|
||||
.then(x => {
|
||||
this.$Message[x.status ? 'info' : 'error'](this.$ts(x.message))
|
||||
})
|
||||
},
|
||||
searchAfter (result) {
|
||||
// 查询ViewGird表数据后param查询参数,result回返查询的结果
|
||||
// this.testList = { recordset: result };
|
||||
return true
|
||||
},
|
||||
modelOpenAfter (row) {
|
||||
if (this.currentAction == 'Add') {
|
||||
this.editFormFields.IsPackageContent = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export default extension
|
||||
@@ -1,12 +1,3 @@
|
||||
/*****************************************************************************************
|
||||
** Author:jxx 2022
|
||||
** QQ:283591387
|
||||
**完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】
|
||||
**常用示例见:http://v2.volcore.xyz/document/vueDev
|
||||
**后台操作见:http://v2.volcore.xyz/document/netCoreDev
|
||||
*****************************************************************************************/
|
||||
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
|
||||
|
||||
let extension = {
|
||||
components: {
|
||||
//查询界面扩展组件
|
||||
@@ -21,150 +12,7 @@ let extension = {
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() {
|
||||
this.paginationHide = true;
|
||||
this.lazy = false;
|
||||
|
||||
//树形结点的id字段
|
||||
this.rowKey = 'DepartmentId';
|
||||
//父级id字段
|
||||
this.rowParentField = "ParentId";
|
||||
//是否展开所有节点(默认会记录展开的节点)
|
||||
//this.defaultExpandAll=true;
|
||||
|
||||
//默认展开的节点
|
||||
// this.expandRowKeys=["id"]
|
||||
|
||||
|
||||
|
||||
},
|
||||
loadTreeChildren(tree, treeNode, resolve) {
|
||||
//加载子节点
|
||||
let url = `api/Sys_Department/getTreeTableChildrenData?departmentId=${tree.DepartmentId}`;
|
||||
this.http.post(url, {}).then((result) => {
|
||||
resolve(result.rows);
|
||||
});
|
||||
},
|
||||
/***加载后台数据见Sys_RoleController.cs文件***/
|
||||
searchBefore(params) {
|
||||
//判断加载根节点或子节点
|
||||
//没有查询条件,默认查询返回所有根节点数据
|
||||
if (!params.wheres.length) {
|
||||
params.value = 1;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onInited() {
|
||||
let hasUpdate, hasDel, hasAdd;
|
||||
this.buttons.forEach((x) => {
|
||||
if (x.value == 'Update') {
|
||||
x.hidden = true;
|
||||
hasUpdate = true;
|
||||
} else if (x.value == 'Delete') {
|
||||
hasDel = true;
|
||||
x.hidden = true; //隐藏按钮
|
||||
} else if (x.value == 'Add') {
|
||||
x.type = 'primary';
|
||||
hasAdd = true;
|
||||
}
|
||||
});
|
||||
if (!(hasUpdate || hasDel || hasAdd)) {
|
||||
return;
|
||||
}
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
field: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
{hasAdd ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
this.addBtnClick(row);
|
||||
}}
|
||||
type="primary"
|
||||
link
|
||||
icon="Plus"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasUpdate ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
this.edit(row);
|
||||
}}
|
||||
type="success"
|
||||
link
|
||||
icon="Edit"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasDel ? (
|
||||
<el-button
|
||||
link
|
||||
onClick={($e) => {
|
||||
this.del(row);
|
||||
}}
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
addBtnClick(row) {
|
||||
//这里是动态addCurrnetRow属性记录当前点击的行数据,下面modelOpenAfter设置默认值
|
||||
this.addCurrnetRow = row;
|
||||
this.add();
|
||||
},
|
||||
addAfter() {
|
||||
//添加后刷新字典
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
updateAfter() {
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
delAfter(result) {
|
||||
//查询界面的表删除后
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
modelOpenAfter(row) {
|
||||
//点击行上的添加按钮事件
|
||||
if (this.addCurrnetRow) {
|
||||
//获取当前组织构架的所有父级id,用于设置新建时父级id的默认值
|
||||
|
||||
//获取数据数据源
|
||||
let data = [];
|
||||
this.editFormOptions.forEach((options) => {
|
||||
options.forEach((option) => {
|
||||
if (option.field == 'ParentId') {
|
||||
data = option.orginData;
|
||||
}
|
||||
});
|
||||
});
|
||||
let parentIds = this.base
|
||||
.getTreeAllParent(this.addCurrnetRow.DepartmentId, data)
|
||||
.map((x) => {
|
||||
return x.id;
|
||||
});
|
||||
//设置编辑表单上级组织的默认值
|
||||
this.editFormFields.ParentId = parentIds;
|
||||
this.addCurrnetRow = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
export default extension;
|
||||
|
||||
@@ -13,22 +13,6 @@ let extension = {
|
||||
},
|
||||
buttons: [], //扩展的按钮
|
||||
methods: {
|
||||
//事件扩展
|
||||
onInit() {
|
||||
// console.log("sys_log")
|
||||
//this.setFiexdSearchForm(true);
|
||||
},
|
||||
onInited() {
|
||||
// this.height = this.height - 195;
|
||||
},
|
||||
delBefore(rows){
|
||||
console.log("删除前jsx:", rows);
|
||||
if (this.$route.path=='/Sys_Log') {
|
||||
console.log('Sys_Log');
|
||||
}
|
||||
console.log("删除前jsx:", this.$route);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
export default extension;
|
||||
@@ -21,134 +21,6 @@ let extension = {
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() {
|
||||
this.paginationHide = true;
|
||||
this.lazy = false;
|
||||
|
||||
//树形结点的id字段
|
||||
this.rowKey = 'PostId';
|
||||
//父级id字段
|
||||
this.rowParentField = "ParentId";
|
||||
//是否展开所有节点(默认会记录展开的节点)
|
||||
//this.defaultExpandAll=true;
|
||||
|
||||
//默认展开的节点
|
||||
// this.expandRowKeys=["id"]
|
||||
},
|
||||
onInited() {
|
||||
let hasUpdate, hasDel, hasAdd;
|
||||
this.buttons.forEach((x) => {
|
||||
if (x.value == 'Update') {
|
||||
x.hidden = true;
|
||||
hasUpdate = true;
|
||||
} else if (x.value == 'Delete') {
|
||||
hasDel = true;
|
||||
x.hidden = true; //隐藏按钮
|
||||
} else if (x.value == 'Add') {
|
||||
x.type = 'primary';
|
||||
hasAdd = true;
|
||||
}
|
||||
});
|
||||
if (!(hasUpdate || hasDel || hasAdd)) {
|
||||
return;
|
||||
}
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
field: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
{hasAdd ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
this.addBtnClick(row);
|
||||
}}
|
||||
type="primary"
|
||||
link
|
||||
icon="Plus"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasUpdate ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
this.edit(row);
|
||||
}}
|
||||
type="success"
|
||||
link
|
||||
icon="Edit"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasDel ? (
|
||||
<el-button
|
||||
link
|
||||
onClick={($e) => {
|
||||
this.del(row);
|
||||
}}
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
addBtnClick(row) {
|
||||
//这里是动态addCurrnetRow属性记录当前点击的行数据,下面modelOpenAfter设置默认值
|
||||
this.addCurrnetRow = row;
|
||||
this.add();
|
||||
},
|
||||
addAfter() {
|
||||
//添加后刷新字典
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
updateAfter() {
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
delAfter(result) {
|
||||
//查询界面的表删除后
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
modelOpenAfter(row) {
|
||||
if (this.currentAction=='Add') {
|
||||
this.editFormFields.Enable='1';
|
||||
}
|
||||
//点击行上的添加按钮事件
|
||||
if (this.addCurrnetRow) {
|
||||
//获取当前组织构架的所有父级id,用于设置新建时父级id的默认值
|
||||
|
||||
//获取数据数据源
|
||||
let data = [];
|
||||
this.editFormOptions.forEach((options) => {
|
||||
options.forEach((option) => {
|
||||
if (option.field == 'ParentId') {
|
||||
data = option.orginData;
|
||||
}
|
||||
});
|
||||
});
|
||||
let parentIds = this.base
|
||||
.getTreeAllParent(this.addCurrnetRow.PostId, data)
|
||||
.map((x) => {
|
||||
return x.id;
|
||||
});
|
||||
//设置编辑表单上级组织的默认值
|
||||
this.editFormFields.ParentId = parentIds;
|
||||
this.addCurrnetRow = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
export default extension;
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
** Author:jxx 2022
|
||||
** QQ:283591387
|
||||
**完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】
|
||||
**常用示例见:http://v2.volcore.xyz/document/vueDev
|
||||
**后台操作见:http://v2.volcore.xyz/document/netCoreDev
|
||||
*****************************************************************************************/
|
||||
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
|
||||
import gridHeader from './Sys_PrintOptionsGridHeader.vue'
|
||||
let extension = {
|
||||
components: {
|
||||
//查询界面扩展组件
|
||||
gridHeader: gridHeader,
|
||||
gridBody: '',
|
||||
gridFooter: '',
|
||||
//新建、编辑弹出框扩展组件
|
||||
modelHeader: '',
|
||||
modelBody: '',
|
||||
modelFooter: ''
|
||||
},
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
this.setFiexdSearchForm(true);
|
||||
let data = []
|
||||
this.http.get("api/Sys_PrintOptions/getSelect", {}, false).then(result => {
|
||||
data.push(...result);
|
||||
})
|
||||
|
||||
this.searchFormOptions.forEach(options => {
|
||||
options.forEach(op => {
|
||||
if (op.field == 'TableName') {
|
||||
op.type = "select";
|
||||
op.data = data;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.editFormOptions.forEach(options => {
|
||||
options.forEach(op => {
|
||||
if (op.field == 'TableName') {
|
||||
op.type = "select";
|
||||
op.data = data;
|
||||
op.onChange = (val, items) => {
|
||||
this.editFormFields.TableCNName = items.find(c => { return c.key == val }).value
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (this.buttons.some(c => { return c.value == 'Add' || c.value == 'Update' })) {
|
||||
this.columns.push({
|
||||
title: "操作",
|
||||
field: "op",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button
|
||||
link
|
||||
onClick={($e) => {
|
||||
this.$refs.gridHeader.open(row,row.TableName);
|
||||
}}
|
||||
style="color: #2196F3;cursor: pointer;margin-right:10px"
|
||||
>
|
||||
<Setting style="width: 1em; height: 1em; margin-right: 2px" />
|
||||
{this.$ts('模板设置')}
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
onClick={($e) => {
|
||||
this.$tabs.open({
|
||||
text: row.TableCNName,
|
||||
path: '/'+row.TableName,
|
||||
});
|
||||
|
||||
}}
|
||||
style="margin-left:1px;color: #2196F3;cursor: pointer;"
|
||||
>
|
||||
<Printer style="width: 1em; height: 1em; margin-right: 2px" />{this.$ts('打印')}
|
||||
</el-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
// formatter: (row) => {
|
||||
// return '<a style="cursor: pointer;color: #2196F3;">'+this.$ts('模板设置')+'</a>'
|
||||
// },
|
||||
// click: (row) => {
|
||||
// // console.log( this.$refs.gridHeader)
|
||||
// this.$refs.gridHeader.open(row,row.TableName);
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
onInited() {
|
||||
// this.height = this.height - 90;
|
||||
// if (this.$global.labelPosition != 'top') {
|
||||
// this.height += 20;
|
||||
// }
|
||||
//框架初始化配置后
|
||||
//如果要配置明细表,在此方法操作
|
||||
//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;
|
||||
@@ -20,196 +20,7 @@ let extension = {
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
searchAfter(result) {
|
||||
//2、查询后方法,调用自定义列表设置值
|
||||
//this.$refs.gridBody.loadList(result, this.columns)
|
||||
return true
|
||||
},
|
||||
sortEnd(newIndex, oldIndex, rows) {
|
||||
console.log(this.editFormFields)
|
||||
},
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() {
|
||||
|
||||
|
||||
//此处仅作为演示默认查询使用
|
||||
if (
|
||||
!localStorage.getItem('filter:Sys_Region:name') ||
|
||||
localStorage.getItem('filter:Sys_Region:name') == '[]'
|
||||
) {
|
||||
localStorage.setItem(
|
||||
'filter:Sys_Region:name',
|
||||
'["默认查询","北京市查询","上海市查询"]'
|
||||
)
|
||||
localStorage.setItem(
|
||||
'filter:Sys_Region',
|
||||
'[{"name":"默认查询","value":[{"field":"code","title":"编码","icon":"el-icon-document","searchType":"like","value":null,"type":"string","width":25},{"field":"name","title":"名称","icon":"el-icon-document","searchType":"like","value":null,"type":"string","width":25},{"field":"mername","title":"完整地址","icon":"el-icon-document","searchType":"like","value":null,"type":"string","width":25},{"field":"pinyin","title":"拼音","icon":"el-icon-document","searchType":null,"value":null,"type":"string","width":25}]},{"name":"北京市查询","value":[{"field":"mername","title":"完整地址","icon":"el-icon-document","searchType":"like","value":"北京","type":"string","width":25},{"field":"pinyin","title":"拼音","icon":"el-icon-document","searchType":"likeStart","value":null,"type":"string","width":25}]},{"name":"上海市查询","value":[{"field":"mername","title":"完整地址","icon":"el-icon-document","searchType":"like","value":"上海","type":"string","width":25},{"field":"name","title":"名称","icon":"el-icon-document","searchType":"like","value":null,"type":"string","width":25},{"field":"pinyin","title":"拼音","icon":"el-icon-document","searchType":"likeStart","value":null,"type":"string","width":25}]}]'
|
||||
)
|
||||
}
|
||||
this.sortable = true
|
||||
|
||||
//设置多个快捷查询字段
|
||||
this.queryFields = ['mername', 'name']
|
||||
//1、自定义按钮切换页面显示
|
||||
this.isList = true
|
||||
this.columns.forEach((x) => {
|
||||
if (x.field == 'mername') {
|
||||
x.tip = {
|
||||
text: '<a>标题长度不够时</br>可自定义标题或提示信息</a>',
|
||||
click: () => {
|
||||
this.$message.success('点击了表头')
|
||||
}
|
||||
}
|
||||
} else if (x.field == 'name') {
|
||||
x.tip = {
|
||||
text: '自定义标题提示',
|
||||
icon: 'bi-text-right',
|
||||
click: () => {
|
||||
this.$message.success('点击了表头')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
//示例:在按钮的最前面添加一个按钮
|
||||
// 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;
|
||||
},
|
||||
onInited() {
|
||||
this.testattr = '123131'
|
||||
console.log(this.testattr)
|
||||
this.height = this.height - 38
|
||||
|
||||
//如果是一对多明细,给二级明细表绑定下拉搜索:
|
||||
//二级表:this.details[0].columns.forEach
|
||||
//三级表:this.subDetails[0].columns.forEach
|
||||
//0表示第几张表,其他操作不变按下面的配置
|
||||
|
||||
//配置编辑表单下拉框table搜索选项
|
||||
this.columns.forEach((item) => {
|
||||
if (item.field == 'code') {
|
||||
item.readonly = false
|
||||
item.edit.type = 'selectTable'
|
||||
//配置请求的接口地址
|
||||
//可以使用生成的页面接口,注意接口权限问题,如果提示没有权限,参照后台后开发文档上的重写权限示例
|
||||
//item.url = 'api/Demo_Goods/getPageData';
|
||||
|
||||
//尽量自定义接口,见下面的文档描述,或者Demo_GoodsController类的方法Search
|
||||
item.url = 'api/Demo_Goods/search'
|
||||
|
||||
//输入框只读操作,需要将columns的search字段设置为true,否则无法过滤数据
|
||||
//item.inputReadonly=true;
|
||||
//设置显示的字段
|
||||
item.columns = [
|
||||
{ field: 'GoodsName', title: '商品名称', type: 'string', width: 120, search: false },
|
||||
{ field: 'GoodsCode', title: '商品编号', type: 'string', width: 100, search: false },
|
||||
{ field: 'Specs', title: '规格', type: 'string', width: 60, align: 'left' },
|
||||
{ field: 'Price', title: '单价', type: 'decimal', width: 60 },
|
||||
{ field: 'Remark', title: '备注', type: 'string', width: 100 }
|
||||
]
|
||||
|
||||
//选中table数据后,回写到表单
|
||||
//editRow:当前正在编辑的行
|
||||
//rows:选中的行
|
||||
item.onSelect = (editRow, rows) => {
|
||||
editRow.name = rows[0].GoodsName
|
||||
editRow.code = rows[0].GoodsCode
|
||||
}
|
||||
|
||||
/****下面的这些都是可以选配置,上面的是必填的******/
|
||||
|
||||
//(输入框搜索)表格数据加载前处理
|
||||
//editRow:当前正在编辑的行
|
||||
//param:请求的参数
|
||||
item.loadBefore = (editRow, param, callback) => {
|
||||
//loadType=1按回车调用的查询,loadType=1输入框变化调用的查询,loadType=undefined默认页面加载
|
||||
//这里可以实现只加载回车事件
|
||||
// if(params.loadType!=1){
|
||||
// return false;
|
||||
// }
|
||||
|
||||
//(上面如果设置了item.inputReaonly,这里就不能添加表单的值过滤,否则无法显示数据)
|
||||
//方式1、手动设置查询条件
|
||||
// param.wheres.push({
|
||||
// name:"GoodsName",
|
||||
// value:editRow.GoodsName,
|
||||
// displayType:"like"
|
||||
// })
|
||||
//方式2、给param.value设置值,后台手动处理查询条件
|
||||
//上面设置了inputReadonly后这里就不用设置了
|
||||
param.value = editRow.GoodsName
|
||||
callback(true)
|
||||
}
|
||||
|
||||
/****************下面这些配置不是必须的**************/
|
||||
//表格数据加载后处理
|
||||
//editRow:当前正在编辑的行
|
||||
//rows:后台返回的数据
|
||||
item.loadAfter = (editRow, rows, callback, result) => {
|
||||
callback(true)
|
||||
}
|
||||
|
||||
//监听输入框变动与回车事件
|
||||
item.onKeyPress = (val, $event, row) => {
|
||||
console.log(val)
|
||||
if ($event.keyCode == 13) {
|
||||
console.log('按了回车')
|
||||
}
|
||||
//清空值时给其他字段设置值
|
||||
// if(!val&&value+''!='0'){
|
||||
// row.xx=null;
|
||||
// }
|
||||
}
|
||||
//设置弹出框高度(默认200)
|
||||
item.height = 200
|
||||
//设置弹出框宽度(默认500)
|
||||
item.selectWidth = 500
|
||||
item.textInline = true //设置表格超出显示...
|
||||
//设置表格是否单选
|
||||
item.single = true
|
||||
//隐藏分页
|
||||
item.paginationHide = true
|
||||
}
|
||||
})
|
||||
},
|
||||
async searchBefore(param) {
|
||||
console.log('region', this.testattr)
|
||||
//界面查询前,可以给param.wheres添加查询参数
|
||||
//返回false,则不会执行查询
|
||||
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); //单击行时选中当前行;
|
||||
},
|
||||
rowChange(rows) {
|
||||
console.log(rows)
|
||||
},
|
||||
modelOpenAfter(row) {
|
||||
//点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
|
||||
//(1)判断是编辑还是新建操作: this.currentAction=='Add';
|
||||
//(2)给弹出框设置默认值
|
||||
//(3)this.editFormFields.字段='xxx';
|
||||
//如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
|
||||
//看不懂就把输出看:console.log(this.editFormOptions)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
export default extension
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
<template>
|
||||
<div v-show="showList" class="list-content">
|
||||
<el-scrollbar style="height: 100%;">
|
||||
<el-descriptions v-for="(row, index) in rows" :key="index" class="margin-top" :column="4" :border="true">
|
||||
<el-descriptions-item :width="120" label="编码"> {{ row.code }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="100" label="名称"> {{ row.name }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="100" label="上级编码"> {{ row.parentId }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="120" label="级别"> {{ row.level }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="120" label="经度"> {{ row.Lng}}</el-descriptions-item>
|
||||
<el-descriptions-item :width="120" label="纬度"> {{ row.Lat }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="120" label="拼音" > {{ row.pinyin }}</el-descriptions-item>
|
||||
<el-descriptions-item :width="120" label="完整地址" > {{ row.mername }}</el-descriptions-item>
|
||||
<!-- 如果带有数据源,调用下面convertData方法转换
|
||||
<el-descriptions-item :width="120" label="订单状态"> {{ convertData(row, '字段') }}</el-descriptions-item> -->
|
||||
</el-descriptions>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//这里使用的vue2语法,也可以写成vue3语法
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
methods: {},
|
||||
data() {
|
||||
return {
|
||||
showList: false,
|
||||
rows: [],
|
||||
columns: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//界面的查询方法,这里重新绑定数据
|
||||
loadList(rows, columns) {
|
||||
this.rows = rows;
|
||||
if (!this.columns.length) {
|
||||
this.columns = columns;
|
||||
}
|
||||
},
|
||||
show() { //界面的点击列表按钮切换
|
||||
this.showList = !this.showList;
|
||||
},
|
||||
convertData(row, field) {//转换数据源
|
||||
if (!this.columns.length) {
|
||||
return;
|
||||
}
|
||||
// 获取数据源
|
||||
let data = this.columns.find(x => { return x.field == field }).bind.data;
|
||||
let val = row[field] + '';
|
||||
return (data.find(x => { return x.key + '' == val })||{value:val}).value;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.list-content {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
height: calc(100vh - 244px);
|
||||
background: #ffff;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 59px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.margin-top {
|
||||
// margin-bottom: 15px;
|
||||
|
||||
::v-deep(.el-descriptions__label.el-descriptions__cell.is-bordered-label) {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,82 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
** Author:jxx 2023
|
||||
** QQ:283591387
|
||||
** 框架文档: http://v3.volcore.xyz/
|
||||
*****************************************************************************************/
|
||||
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
|
||||
import gridBody from './Sys_ReportOptionsGridBody.vue'
|
||||
let extension = {
|
||||
components: {
|
||||
//查询界面扩展组件
|
||||
gridHeader: '',
|
||||
gridBody: gridBody,
|
||||
gridFooter: '',
|
||||
//新建、编辑弹出框扩展组件
|
||||
modelHeader: '',
|
||||
modelBody: '',
|
||||
modelRight: '',
|
||||
modelFooter: ''
|
||||
},
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() {
|
||||
//示例:设置修改新建、编辑弹出框字段标签的长度
|
||||
// this.boxOptions.labelWidth = 150;
|
||||
this.columns.forEach((column) => {
|
||||
//修改颜色
|
||||
if (column.field == 'FilePath') {
|
||||
//格式化返回自定义单元格内容
|
||||
column.formatter = (row) => {
|
||||
let name = (row.FilePath || '').split('/').pop();
|
||||
return name;
|
||||
};
|
||||
}
|
||||
});
|
||||
let ops = this.getFormOption('Options');
|
||||
if (ops) {
|
||||
ops.minRows = 5;
|
||||
ops.maxRows = 20;
|
||||
}
|
||||
this.queryFields = ['ReportName', 'ReportCode'];
|
||||
},
|
||||
onInited() {
|
||||
|
||||
this.height=this.height-35;
|
||||
//框架初始化配置后
|
||||
//如果要配置明细表,在此方法操作
|
||||
//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;
|
||||
@@ -1,8 +0,0 @@
|
||||
<template>
|
||||
<div style="padding-bottom: 5px;">
|
||||
<el-alert type="success" :closable="false" title="报表默认只需在锐浪报表设计器设计模板与自定义数据源,具体见报表文档"></el-alert>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@@ -14,55 +14,7 @@ let extension = {
|
||||
buttons: [], //扩展的按钮
|
||||
tableAction: 'Sys_Role',
|
||||
methods: {
|
||||
//事件扩展
|
||||
onInited() {
|
||||
this.editFormOptions.forEach((x) => {
|
||||
x.forEach((item) => {
|
||||
if (item.field == 'ParentId') {
|
||||
item.title = '上级角色';
|
||||
//设置任意节点都能选中(默认只能选中最后一个节点)
|
||||
item.changeOnSelect = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onInit() {
|
||||
//设置treetable的唯一值字段(这个字段的值在表里面必须是唯一的)
|
||||
this.rowKey = 'Role_Id';
|
||||
this.columns.find((x) => {
|
||||
return x.field == 'ParentId';
|
||||
}).hidden = true;
|
||||
},
|
||||
/***加载后台数据见Sys_RoleController.cs文件***/
|
||||
loadTreeChildren(tree, treeNode, resolve) {
|
||||
//加载子节点
|
||||
let url = `api/role/getTreeTableChildrenData?roleId=${tree.Role_Id}`;
|
||||
this.http.post(url, {}).then((result) => {
|
||||
resolve(result.rows);
|
||||
});
|
||||
},
|
||||
/***加载后台数据见Sys_RoleController.cs文件***/
|
||||
searchBefore(params) {
|
||||
//判断加载根节点或子节点
|
||||
//没有查询条件,默认查询返回所有根节点数据
|
||||
if (!params.wheres.length) {
|
||||
params.value = 1;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
addAfter() {
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
updateAfter() {
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
},
|
||||
delAfter() {
|
||||
this.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
export default extension;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
export default [
|
||||
{ key: 1, value: '全部' },
|
||||
// { key: 10, value: "本组织+本角色以及下数据" },
|
||||
{ key: 20, value: '本组织(部门)及下数据' },
|
||||
{ key: 30, value: '本组织(部门)数据' },
|
||||
{ key: 40, value: '本角色以及以下数据' },
|
||||
{ key: 50, value: '本角色数据' },
|
||||
{ key: 60, value: '仅自己数据' }
|
||||
]
|
||||
@@ -1,75 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
** Author:jxx 2023
|
||||
** QQ:283591387
|
||||
** 框架文档: http://v3.volcore.xyz/
|
||||
*****************************************************************************************/
|
||||
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
|
||||
|
||||
let extension = {
|
||||
components: {
|
||||
//查询界面扩展组件
|
||||
gridHeader: '',
|
||||
gridBody: '',
|
||||
gridFooter: '',
|
||||
//新建、编辑弹出框扩展组件
|
||||
modelHeader: '',
|
||||
modelBody: '',
|
||||
modelRight: '',
|
||||
modelFooter: ''
|
||||
},
|
||||
tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
|
||||
buttons: { view: [], box: [], detail: [] }, //扩展的按钮
|
||||
methods: {
|
||||
//下面这些方法可以保留也可以删除
|
||||
onInit() { //框架初始化配置前,
|
||||
//示例:在按钮的最前面添加一个按钮
|
||||
// this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组
|
||||
// name: '按钮', //按钮名称
|
||||
// icon: 'el-icon-document', //按钮图标:https://element.eleme.cn/#/zh-CN/component/icon
|
||||
// type: 'primary', //按钮样式:https://element-plus.gitee.io/zh-CN/component/button.html
|
||||
// //color:"#eee",//自定义按钮颜色
|
||||
// onClick: function () {
|
||||
// this.$Message.success('点击了按钮');
|
||||
// }
|
||||
// });
|
||||
|
||||
//示例:设置修改新建、编辑弹出框字段标签的长度
|
||||
// this.boxOptions.labelWidth = 150;
|
||||
},
|
||||
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;
|
||||
@@ -29,11 +29,6 @@ let viewgird = [
|
||||
name: 'Sys_Role',
|
||||
component: () => import('@/views/sys/system/Sys_Role.vue')
|
||||
},
|
||||
{
|
||||
path: '/Sys_Language',
|
||||
name: 'Sys_Language',
|
||||
component: () => import('@/views/sys/lang/Sys_Language.vue')
|
||||
},
|
||||
{
|
||||
path: '/FormDesignOptions',
|
||||
name: 'FormDesignOptions',
|
||||
@@ -84,11 +79,6 @@ let viewgird = [
|
||||
name: 'Sys_Department',
|
||||
component: () => import('@/views/sys/system/Sys_Department.vue')
|
||||
},
|
||||
{
|
||||
path: '/Sys_Region',
|
||||
name: 'Sys_Region',
|
||||
component: () => import('@/views/sys/system/Sys_Region.vue')
|
||||
},
|
||||
{
|
||||
path: '/MES_WarehouseManagement',
|
||||
name: 'MES_WarehouseManagement',
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/system/group/Sys_Group.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/sys/group/Sys_Group.js";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'GroupId',
|
||||
footer: "Foots",
|
||||
cnName: '集团管理',
|
||||
name: 'group/Sys_Group',
|
||||
url: "/Sys_Group/",
|
||||
sortName: "CreateDate"
|
||||
});
|
||||
const editFormFields = ref({"GroupName":"","PhoneNo":"","Address":"","Remark":""});
|
||||
const editFormOptions = ref([[{"title":"集团名称","required":true,"field":"GroupName"}],
|
||||
[{"title":"电话","field":"PhoneNo"}],
|
||||
[{"title":"地址","field":"Address"}],
|
||||
[{"title":"备注","field":"Remark","type":"textarea"}]]);
|
||||
const searchFormFields = ref({});
|
||||
const searchFormOptions = ref([]);
|
||||
const columns = ref([{field:'GroupId',title:'GroupId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'GroupName',title:'集团名称',type:'string',link:true,width:150,require:true,align:'left',sort:true},
|
||||
{field:'PhoneNo',title:'电话',type:'string',width:140,align:'left'},
|
||||
{field:'Address',title:'地址',type:'string',width:120,align:'left'},
|
||||
{field:'Enable',title:'Enable',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'Remark',title:'备注',type:'string',width:100,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:150,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true}]);
|
||||
const detail = ref({
|
||||
cnName: "#detailCnName",
|
||||
table: "#detailTable",
|
||||
columns: [],
|
||||
sortName: "",
|
||||
key: ""
|
||||
});
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/system/lang/Sys_Language.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/sys/lang/Sys_Language.js";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'Id',
|
||||
footer: "Foots",
|
||||
cnName: '语言管理',
|
||||
name: 'lang/Sys_Language',
|
||||
url: "/Sys_Language/",
|
||||
sortName: "Id"
|
||||
});
|
||||
const editFormFields = ref({"ZHCN":"","ZHTW":"","English":"","Spanish":"","French":"","Russian":"","Arabic":""});
|
||||
const editFormOptions = ref([[{"title":"简体中文","required":true,"field":"ZHCN","type":"textarea"},
|
||||
{"title":"繁体中文","field":"ZHTW","type":"textarea"},
|
||||
{"title":"英语","field":"English","type":"textarea"},
|
||||
{"title":"西班牙语","field":"Spanish","type":"textarea"}],
|
||||
[{"title":"法语","field":"French","type":"textarea"},
|
||||
{"title":"俄语","field":"Russian","type":"textarea"},
|
||||
{"title":"阿拉伯语","field":"Arabic","type":"textarea"}]]);
|
||||
const searchFormFields = ref({"ZHCN":"","ZHTW":"","English":"","French":"","Spanish":"","Russian":"","Arabic":"","CreateDate":""});
|
||||
const searchFormOptions = ref([[{"title":"简体中文","field":"ZHCN","type":"like"},{"title":"繁体中文","field":"ZHTW","type":"like"},{"title":"英语","field":"English","type":"like"},{"title":"西班牙语","field":"Spanish","type":"like"}],[{"title":"法语","field":"French","type":"like"},{"title":"俄语","field":"Russian","type":"like"},{"title":"阿拉伯语","field":"Arabic","type":"like"},{"title":"创建时间","field":"CreateDate"}]]);
|
||||
const columns = ref([{field:'Id',title:'Id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'ZHCN',title:'简体中文',type:'string',link:true,width:140,require:true,align:'left',sort:true},
|
||||
{field:'ZHTW',title:'繁体中文',type:'string',width:140,align:'left'},
|
||||
{field:'English',title:'英语',type:'string',width:140,align:'left'},
|
||||
{field:'French',title:'法语',type:'string',width:120,align:'left'},
|
||||
{field:'Spanish',title:'西班牙语',type:'string',width:140,align:'left'},
|
||||
{field:'Russian',title:'俄语',type:'string',width:140,align:'left'},
|
||||
{field:'Arabic',title:'阿拉伯语',type:'string',width:140,align:'left'},
|
||||
{field:'Module',title:'Module',type:'string',width:110,hidden:true,align:'left'},
|
||||
{field:'IsPackageContent',title:'IsPackageContent',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'CreateId',title:'CreateId',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'Creator',type:'string',width:130,hidden:true,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:140,align:'left',sort:true},
|
||||
{field:'ModifyId',title:'ModifyId',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'ModifyDate',title:'ModifyDate',type:'datetime',width:110,hidden:true,align:'left',sort:true},
|
||||
{field:'Modifier',title:'Modifier',type:'string',width:130,hidden:true,align:'left'}]);
|
||||
const detail = ref({
|
||||
cnName: "#detailCnName",
|
||||
table: "#detailTable",
|
||||
columns: [],
|
||||
sortName: "",
|
||||
key: ""
|
||||
});
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,74 +1,198 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Author:jxx
|
||||
*Date:{Date}
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/sys/system/Sys_Department.js此处编写
|
||||
*业务请在@/extension/sys/system/Sys_Department.jsx或Sys_Department.vue文件编写
|
||||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://doc.volcore.xyz/docs/view-grid、https://doc.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
<view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
|
||||
:table="table" :extend="extend" :onInit="onInit" :onInited="onInited" :searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter" :addBefore="addBefore" :updateBefore="updateBefore" :rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore" :modelOpenAfter="modelOpenAfter" :loadTreeChildren="loadTreeChildren"
|
||||
:addAfter="addAfter" :updateAfter="updateAfter" :delAfter="delAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridHeader>
|
||||
</template>
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/sys/system/Sys_Department.jsx";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'DepartmentId',
|
||||
footer: "Foots",
|
||||
cnName: '组织架构',
|
||||
name: 'system/Sys_Department',
|
||||
url: "/Sys_Department/",
|
||||
sortName: "DepartmentName"
|
||||
});
|
||||
const editFormFields = ref({"DepartmentName":"","DepartmentCode":"","ParentId":[],"DepartmentType":"","Enable":"","Remark":""});
|
||||
const editFormOptions = ref([[{"title":"名称","required":true,"field":"DepartmentName"},
|
||||
{"title":"编号","field":"DepartmentCode"}],
|
||||
[{"dataKey":"部门级联","data":[],"title":"上级组织","field":"ParentId","type":"cascader"},
|
||||
{"dataKey":"组织类型","data":[],"title":"类型","field":"DepartmentType","type":"radio"}],
|
||||
[{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"select"},
|
||||
{"title":"备注","field":"Remark","type":"text"}]]);
|
||||
const searchFormFields = ref({"DepartmentName":"","DepartmentCode":"","Enable":"","CreateDate":""});
|
||||
const searchFormOptions = ref([[{"title":"名称","field":"DepartmentName","type":"like"},{"title":"编号","field":"DepartmentCode","type":"like"},{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"select"},{"title":"创建时间","field":"CreateDate","type":"datetime"}]]);
|
||||
const columns = ref([{field:'DepartmentId',title:'DepartmentId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'DepartmentName',title:'名称',type:'string',link:true,width:150,require:true,align:'left',sort:true},
|
||||
{field:'ParentId',title:'上级组织',type:'guid',bind:{ key:'部门级联',data:[]},width:110,hidden:true,align:'left'},
|
||||
{field:'DepartmentCode',title:'编号',type:'string',width:90,align:'left'},
|
||||
{field:'DepartmentType',title:'类型',type:'string',bind:{ key:'组织类型',data:[]},width:80,align:'left'},
|
||||
{field:'Enable',title:'是否可用',type:'int',bind:{ key:'enable',data:[]},width:80,align:'left'},
|
||||
{field:'Remark',title:'备注',type:'string',width:100,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
|
||||
{field:'DbServiceId',title:'所属数据库',type:'guid',width:110,hidden:true,align:'left'}]);
|
||||
const detail = ref({
|
||||
cnName: "#detailCnName",
|
||||
table: "#detailTable",
|
||||
columns: [],
|
||||
sortName: "",
|
||||
key: ""
|
||||
});
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
};
|
||||
},
|
||||
<script setup lang="jsx">
|
||||
import extend from "@/extension/sys/system/Sys_Department.jsx";
|
||||
import viewOptions from './Sys_Department/options.js'
|
||||
import { ref, reactive, getCurrentInstance, watch, onMounted } from "vue";
|
||||
const grid = ref(null);
|
||||
const { proxy } = getCurrentInstance()
|
||||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
gridRef.paginationHide = true;
|
||||
gridRef.lazy = false;
|
||||
|
||||
//树形结点的id字段
|
||||
gridRef.rowKey = 'DepartmentId';
|
||||
//父级id字段
|
||||
gridRef.rowParentField = "ParentId";
|
||||
//是否展开所有节点(默认会记录展开的节点)
|
||||
//gridRef.defaultExpandAll=true;
|
||||
|
||||
//默认展开的节点
|
||||
// gridRef.expandRowKeys=["id"]
|
||||
}
|
||||
const loadTreeChildren = (tree, treeNode, resolve) => {
|
||||
//加载子节点
|
||||
let url = `api/Sys_Department/getTreeTableChildrenData?departmentId=${tree.DepartmentId}`;
|
||||
proxy.http.post(url, {}).then((result) => {
|
||||
resolve(result.rows);
|
||||
});
|
||||
}
|
||||
|
||||
const addBtnClick = (row) => {
|
||||
//这里是动态addCurrnetRow属性记录当前点击的行数据,下面modelOpenAfter设置默认值
|
||||
addCurrnetRow = row;
|
||||
gridRef.add();
|
||||
}
|
||||
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
let hasUpdate, hasDel, hasAdd;
|
||||
gridRef.buttons.forEach((x) => {
|
||||
if (x.value == 'Update') {
|
||||
x.hidden = true;
|
||||
hasUpdate = true;
|
||||
} else if (x.value == 'Delete') {
|
||||
hasDel = true;
|
||||
x.hidden = true; //隐藏按钮
|
||||
} else if (x.value == 'Add') {
|
||||
x.type = 'primary';
|
||||
hasAdd = true;
|
||||
}
|
||||
});
|
||||
if (!(hasUpdate || hasDel || hasAdd)) {
|
||||
return;
|
||||
}
|
||||
columns.push({
|
||||
title: '操作',
|
||||
field: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
render: (h, { row, column, index }) => {
|
||||
return (
|
||||
<div>
|
||||
{hasAdd ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
addBtnClick(row);
|
||||
}}
|
||||
type="primary"
|
||||
link
|
||||
icon="Plus"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasUpdate ? (
|
||||
<el-button
|
||||
onClick={($e) => {
|
||||
gridRef.edit(row);
|
||||
}}
|
||||
type="success"
|
||||
link
|
||||
icon="Edit"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{hasDel ? (
|
||||
<el-button
|
||||
link
|
||||
onClick={($e) => {
|
||||
gridRef.del(row);
|
||||
}}
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
></el-button>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
const searchBefore = async (params) => {
|
||||
//判断加载根节点或子节点
|
||||
//没有查询条件,默认查询返回所有根节点数据
|
||||
if (!params.wheres.length) {
|
||||
params.value = 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const searchAfter = async (rows, result) => {
|
||||
return true;
|
||||
}
|
||||
const addBefore = async (formData) => {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
}
|
||||
const updateBefore = async (formData) => {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
}
|
||||
const rowClick = ({ row, column, event }) => {
|
||||
//查询界面点击行事件
|
||||
// grid.value.toggleRowSelection(row); //单击行时选中当前行;
|
||||
}
|
||||
const addAfter = () => {
|
||||
//添加后刷新字典
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
const updateAfter = () => {
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
const delAfter = (res) => {
|
||||
//查询界面的表删除后
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
};
|
||||
const modelOpenBefore = async (row, currentAction, isCopyClick) => {
|
||||
//弹出框打开前
|
||||
return true;//返回false,不会打开弹出框
|
||||
}
|
||||
let addCurrnetRow;
|
||||
const modelOpenAfter = (row, currentAction, isCopyClick) => {
|
||||
//点击行上的添加按钮事件
|
||||
if (addCurrnetRow) {
|
||||
//获取当前组织构架的所有父级id,用于设置新建时父级id的默认值
|
||||
|
||||
//获取数据数据源
|
||||
let data = [];
|
||||
editFormOptions.forEach((options) => {
|
||||
options.forEach((option) => {
|
||||
if (option.field == 'ParentId') {
|
||||
data = option.orginData;
|
||||
}
|
||||
});
|
||||
});
|
||||
let parentIds = proxy.base
|
||||
.getTreeAllParent(addCurrnetRow.DepartmentId, data)
|
||||
.map((x) => {
|
||||
return x.id;
|
||||
});
|
||||
//设置编辑表单上级组织的默认值
|
||||
editFormFields.ParentId = parentIds;
|
||||
addCurrnetRow = null;
|
||||
}
|
||||
}
|
||||
//监听表单输入,做实时计算
|
||||
//watch(() => editFormFields.字段,(newValue, oldValue) => { })
|
||||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
|
||||
58
vol.web/src/views/sys/system/Sys_Department/options.js
Normal file
58
vol.web/src/views/sys/system/Sys_Department/options.js
Normal file
@@ -0,0 +1,58 @@
|
||||
// *Author:jxx
|
||||
// *Contact:283591387@qq.com
|
||||
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
export default function(){
|
||||
const table = {
|
||||
key: 'DepartmentId',
|
||||
footer: "Foots",
|
||||
cnName: '组织架构',
|
||||
name: 'Sys_Department',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_Department/",
|
||||
sortName: "DepartmentName"
|
||||
};
|
||||
const tableName = table.name;
|
||||
const tableCNName = table.cnName;
|
||||
const newTabEdit = false;
|
||||
const key = table.key;
|
||||
const editFormFields = {"DepartmentName":"","DepartmentCode":"","ParentId":[],"DepartmentType":"","Enable":"","Remark":""};
|
||||
const editFormOptions = [[{"title":"名称","required":true,"field":"DepartmentName"},
|
||||
{"title":"编号","field":"DepartmentCode"}],
|
||||
[{"dataKey":"部门级联","data":[],"title":"上级组织","field":"ParentId","type":"cascader"},
|
||||
{"dataKey":"组织类型","data":[],"title":"类型","field":"DepartmentType","type":"radio"}],
|
||||
[{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"select"},
|
||||
{"title":"备注","field":"Remark","type":"text"}]];
|
||||
const searchFormFields = {"DepartmentName":"","DepartmentCode":"","Enable":"","CreateDate":""};
|
||||
const searchFormOptions = [[{"title":"名称","field":"DepartmentName","type":"like"},{"title":"编号","field":"DepartmentCode","type":"like"},{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"select"},{"title":"创建时间","field":"CreateDate","type":"datetime"}]];
|
||||
const columns = [{field:'DepartmentId',title:'DepartmentId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'DepartmentName',title:'名称',type:'string',link:true,width:150,require:true,align:'left'},
|
||||
{field:'ParentId',title:'上级组织',type:'guid',bind:{ key:'部门级联',data:[]},width:110,hidden:true,align:'left'},
|
||||
{field:'DepartmentCode',title:'编号',type:'string',width:90,align:'left'},
|
||||
{field:'DepartmentType',title:'类型',type:'string',bind:{ key:'组织类型',data:[]},width:80,align:'left'},
|
||||
{field:'Enable',title:'是否可用',type:'int',bind:{ key:'enable',data:[]},width:80,align:'left'},
|
||||
{field:'Remark',title:'备注',type:'string',width:100,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left'},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left'},
|
||||
{field:'DbServiceId',title:'所属数据库',type:'guid',width:110,hidden:true,align:'left'}];
|
||||
const detail ={columns:[]};
|
||||
const details = [];
|
||||
|
||||
return {
|
||||
table,
|
||||
key,
|
||||
tableName,
|
||||
tableCNName,
|
||||
newTabEdit,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
}
|
||||
@@ -1,186 +1,88 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Author:jxx
|
||||
*Date:{Date}
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/system/Sys_Log.js此处编写
|
||||
*业务请在@/extension/sys/system/Sys_Log.jsx或Sys_Log.vue文件编写
|
||||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://doc.volcore.xyz/docs/view-grid、https://doc.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid
|
||||
ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:delBefore="delBefore"
|
||||
>
|
||||
</view-grid>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:onInit="onInit"
|
||||
:onInited="onInited"
|
||||
:searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter"
|
||||
:addBefore="addBefore"
|
||||
:updateBefore="updateBefore"
|
||||
:rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore"
|
||||
:modelOpenAfter="modelOpenAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridHeader>
|
||||
</template>
|
||||
</view-grid>
|
||||
</template>
|
||||
<script setup>
|
||||
import extend from "@/extension/sys/system/Sys_Log.js";
|
||||
import { ref, defineComponent } from "vue";
|
||||
<script setup lang="jsx">
|
||||
import extend from "@/extension/sys/system/Sys_Log.jsx";
|
||||
import viewOptions from './Sys_Log/options.js'
|
||||
import { ref, reactive, getCurrentInstance, watch, onMounted } from "vue";
|
||||
const grid = ref(null);
|
||||
const { proxy } = getCurrentInstance()
|
||||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
const delBefore = (rows) => {
|
||||
console.log("删除前setup:", rows);
|
||||
return true;
|
||||
};
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
gridRef.setFixedSearchForm();
|
||||
|
||||
const table = ref({
|
||||
key: "Id",
|
||||
footer: "Foots",
|
||||
cnName: "系统日志",
|
||||
name: "Sys_Log",
|
||||
url: "/Sys_Log/",
|
||||
sortName: "Id",
|
||||
});
|
||||
const editFormFields = ref({});
|
||||
const editFormOptions = ref([]);
|
||||
const searchFormFields = ref({
|
||||
BeginDate: "",
|
||||
Url: "",
|
||||
LogType: [],
|
||||
Success: [],
|
||||
UserIP: "",
|
||||
ServiceIP: "",
|
||||
Role_Id: "",
|
||||
});
|
||||
const searchFormOptions = ref([
|
||||
[
|
||||
{ title: "请求地址", field: "Url", type: "text" },
|
||||
{ title: "用户IP", field: "UserIP", type: "text" },
|
||||
{ title: "服务器IP", field: "ServiceIP", type: "text" },
|
||||
],
|
||||
[
|
||||
{ title: "开始时间", field: "BeginDate", type: "datetime" },
|
||||
{
|
||||
dataKey: "restatus",
|
||||
data: [],
|
||||
title: "响应状态",
|
||||
field: "Success",
|
||||
type: "selectList",
|
||||
},
|
||||
{ dataKey: "roles", data: [], title: "角色ID", field: "Role_Id", type: "select" },
|
||||
],
|
||||
[
|
||||
{
|
||||
dataKey: "log",
|
||||
data: [],
|
||||
title: "日志类型",
|
||||
field: "LogType",
|
||||
colSize: 12,
|
||||
type: "checkbox",
|
||||
},
|
||||
],
|
||||
]);
|
||||
const columns = ref([
|
||||
{
|
||||
field: "Id",
|
||||
title: "Id",
|
||||
type: "int",
|
||||
width: 90,
|
||||
hidden: true,
|
||||
readonly: true,
|
||||
require: true,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "BeginDate",
|
||||
title: "开始时间",
|
||||
type: "datetime",
|
||||
width: 140,
|
||||
align: "left",
|
||||
sortable: true,
|
||||
},
|
||||
{ field: "UserName", title: "用户名称", type: "string", width: 90, align: "left" },
|
||||
{ field: "Url", title: "请求地址", type: "string", width: 110, align: "left" },
|
||||
{
|
||||
field: "LogType",
|
||||
title: "日志类型",
|
||||
type: "string",
|
||||
bind: { key: "log", data: [] },
|
||||
width: 80,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "Success",
|
||||
title: "响应状态",
|
||||
type: "int",
|
||||
bind: { key: "restatus", data: [] },
|
||||
width: 80,
|
||||
align: "left",
|
||||
},
|
||||
{ field: "ElapsedTime", title: "时长", type: "int", width: 60, align: "left" },
|
||||
{
|
||||
field: "RequestParameter",
|
||||
title: "请求参数",
|
||||
type: "string",
|
||||
width: 70,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "ResponseParameter",
|
||||
title: "响应参数",
|
||||
type: "string",
|
||||
width: 70,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "ExceptionInfo",
|
||||
title: "异常信息",
|
||||
type: "string",
|
||||
width: 70,
|
||||
align: "left",
|
||||
},
|
||||
{ field: "UserIP", title: "用户IP", type: "string", width: 90, align: "left" },
|
||||
{
|
||||
field: "ServiceIP",
|
||||
title: "服务器IP",
|
||||
type: "string",
|
||||
width: 90,
|
||||
hidden: true,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "BrowserType",
|
||||
title: "浏览器类型",
|
||||
type: "string",
|
||||
width: 90,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "User_Id",
|
||||
title: "用户ID",
|
||||
type: "int",
|
||||
width: 90,
|
||||
hidden: true,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "Role_Id",
|
||||
title: "角色ID",
|
||||
type: "int",
|
||||
bind: { key: "roles", data: [] },
|
||||
width: 90,
|
||||
hidden: true,
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
field: "EndDate",
|
||||
title: "结束时间",
|
||||
type: "datetime",
|
||||
width: 150,
|
||||
hidden: true,
|
||||
align: "left",
|
||||
sortable: true,
|
||||
},
|
||||
]);
|
||||
const detail = ref({
|
||||
cnName: "#detailCnName",
|
||||
columns: [],
|
||||
sortName: "",
|
||||
key: "",
|
||||
});
|
||||
searchFormOptions[1][0].width='100%'
|
||||
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://doc.volcore.xyz/docs/view-grid
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
gridRef.height=gridRef.height+30;
|
||||
}
|
||||
const searchBefore = async (param) => {
|
||||
//界面查询前,可以给param.wheres添加查询参数
|
||||
//返回false,则不会执行查询
|
||||
return true;
|
||||
}
|
||||
const searchAfter = async (rows, result) => {
|
||||
return true;
|
||||
}
|
||||
const addBefore = async (formData, isCopyClick) => {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
}
|
||||
const updateBefore = async (formData) => {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
}
|
||||
const rowClick = ({ row, column, event }) => {
|
||||
//查询界面点击行事件
|
||||
// grid.value.toggleRowSelection(row); //单击行时选中当前行;
|
||||
}
|
||||
const modelOpenBefore=async(row,currentAction,isCopyClick) => {
|
||||
//弹出框打开前
|
||||
return true;//返回false,不会打开弹出框
|
||||
}
|
||||
const modelOpenAfter=(row,currentAction,isCopyClick) => {
|
||||
//弹出框打开后方法,设置表单默认值,按钮操作等
|
||||
}
|
||||
//监听表单输入,做实时计算
|
||||
//watch(() => editFormFields.字段,(newValue, oldValue) => { })
|
||||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
|
||||
62
vol.web/src/views/sys/system/Sys_Log/options.js
Normal file
62
vol.web/src/views/sys/system/Sys_Log/options.js
Normal file
@@ -0,0 +1,62 @@
|
||||
// *Author:jxx
|
||||
// *Contact:283591387@qq.com
|
||||
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
export default function () {
|
||||
const table = {
|
||||
key: 'Id',
|
||||
footer: "Foots",
|
||||
cnName: '系统日志',
|
||||
name: 'Sys_Log',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_Log/",
|
||||
sortName: "Id",
|
||||
fixedSearch: true
|
||||
};
|
||||
const tableName = table.name;
|
||||
const tableCNName = table.cnName;
|
||||
const newTabEdit = false;
|
||||
const key = table.key;
|
||||
const editFormFields = {};
|
||||
const editFormOptions = [];
|
||||
const searchFormFields = { "BeginDate": "", "Url": "", "LogType": [], "Success": [], "RequestParameter": "", "ResponseParameter": "", "UserIP": "" };
|
||||
const searchFormOptions = [[{ "title": "请求地址", "field": "Url", "type": "text" },
|
||||
{ "title": "用户IP", "field": "UserIP", "type": "text" },
|
||||
{ "title": "开始时间", "field": "BeginDate", "type": "datetime" },
|
||||
{ "dataKey": "restatus", "data": [], "title": "响应状态", "field": "Success", "type": "selectList" },
|
||||
{ "title": "请求参数", "field": "RequestParameter", "type": "like" },
|
||||
{ "title": "响应参数", "field": "ResponseParameter", "type": "like" }],
|
||||
[{colSize:10, "dataKey": "log", "data": [], "title": "日志类型", "field": "LogType", "type": "checkbox" }]];
|
||||
const columns = [{ field: 'Id', title: 'Id', type: 'int', width: 90, hidden: true, require: true, align: 'left' },
|
||||
{ field: 'BeginDate', title: '开始时间', type: 'datetime', width: 140, align: 'left' },
|
||||
{ field: 'UserName', title: '用户名称', type: 'string', width: 90, align: 'left' },
|
||||
{ field: 'Url', title: '请求地址', type: 'string', width: 110, align: 'left' },
|
||||
{ field: 'LogType', title: '日志类型', type: 'string', bind: { key: 'log', data: [] }, width: 80, align: 'left' },
|
||||
{ field: 'Success', title: '响应状态', type: 'int', bind: { key: 'restatus', data: [] }, width: 80, align: 'left' },
|
||||
{ field: 'ElapsedTime', title: '时长', type: 'int', width: 60, align: 'left' },
|
||||
{ field: 'RequestParameter', title: '请求参数', type: 'string', width: 70, align: 'left' },
|
||||
{ field: 'ResponseParameter', title: '响应参数', type: 'string', width: 70, align: 'left' },
|
||||
{ field: 'ExceptionInfo', title: '异常信息', type: 'string', width: 70, align: 'left' },
|
||||
{ field: 'UserIP', title: '用户IP', type: 'string', width: 90, align: 'left' },
|
||||
{ field: 'ServiceIP', title: '服务器IP', type: 'string', width: 90, hidden: true, align: 'left' },
|
||||
{ field: 'BrowserType', title: '浏览器类型', type: 'string', width: 90, align: 'left' },
|
||||
{ field: 'User_Id', title: '用户ID', type: 'int', width: 90, hidden: true, align: 'left' },
|
||||
{ field: 'Role_Id', title: '角色ID', type: 'int', bind: { key: 'roles', data: [] }, width: 90, hidden: true, align: 'left' },
|
||||
{ field: 'EndDate', title: '结束时间', type: 'datetime', width: 150, hidden: true, align: 'left' }];
|
||||
const detail = { columns: [] };
|
||||
const details = [];
|
||||
|
||||
return {
|
||||
table,
|
||||
key,
|
||||
tableName,
|
||||
tableCNName,
|
||||
newTabEdit,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/sys/system/Sys_Post.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/sys/system/Sys_Post.jsx";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'PostId',
|
||||
footer: "Foots",
|
||||
cnName: '岗位管理',
|
||||
name: 'system/Sys_Post',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_Post/",
|
||||
sortName: "CreateDate"
|
||||
});
|
||||
const editFormFields = ref({"PostName":"","PostCode":"","ParentId":[],"Enable":"","Remark":""});
|
||||
const editFormOptions = ref([[{"title":"岗位名称","required":true,"field":"PostName"}],
|
||||
[{"title":"岗位编号","field":"PostCode"}],
|
||||
[{"dataKey":"岗位","data":[],"title":"上级岗位","field":"ParentId","type":"cascader"}],
|
||||
[{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"radio"}],
|
||||
[{"title":"备注","field":"Remark","type":"textarea"}]]);
|
||||
const searchFormFields = ref({"PostName":"","PostCode":"","Enable":"","CreateDate":""});
|
||||
const searchFormOptions = ref([[{"title":"岗位名称","field":"PostName","type":"like"},{"title":"岗位编号","field":"PostCode","type":"like"},{"dataKey":"enable","data":[],"title":"是否可用","field":"Enable","type":"select"},{"title":"创建时间","field":"CreateDate","type":"datetime"}]]);
|
||||
const columns = ref([{field:'PostId',title:'PostId',type:'string',width:120,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'PostName',title:'岗位名称',type:'string',link:true,width:130,require:true,align:'left'},
|
||||
{field:'PostCode',title:'岗位编号',type:'string',width:100,align:'left'},
|
||||
{field:'ParentId',title:'上级岗位',type:'string',bind:{ key:'岗位',data:[]},width:120,hidden:true,align:'left'},
|
||||
{field:'DbServiceId',title:'DbServiceId',type:'string',width:120,hidden:true,align:'left'},
|
||||
{field:'Enable',title:'是否可用',type:'int',bind:{ key:'enable',data:[]},width:60,align:'left'},
|
||||
{field:'Remark',title:'备注',type:'string',width:120,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:120,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:90,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:120,align:'left'},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:120,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:90,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:120,align:'left'}]);
|
||||
const detail = ref({columns:[]});
|
||||
const details = ref([]);
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,71 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/sys/system/Sys_PrintOptions.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/sys/system/Sys_PrintOptions.jsx";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'PrintOptionsId',
|
||||
footer: "Foots",
|
||||
cnName: '打印管理',
|
||||
name: 'system/Sys_PrintOptions',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_PrintOptions/",
|
||||
sortName: "TableName,CreateDate"
|
||||
});
|
||||
const editFormFields = ref({"TableName":"","CustomName":"",Html:""});
|
||||
const editFormOptions = ref([[{"title":"打印模块","required":true,"field":"TableName"}],
|
||||
[{"title":"模板名称","required":true,"field":"CustomName"}],
|
||||
[{"title":"回调地址",placeholder:"打印成功/失败后回调接口","required":false,"field":"Html"}]]);
|
||||
const searchFormFields = ref({"CustomName":"","TableName":"","CreateDate":"","Creator":""});
|
||||
const searchFormOptions = ref([[{"title":"打印模块","field":"TableName"},{"title":"模板名称","field":"CustomName"},{"title":"创建时间","field":"CreateDate","type":"datetime"},{"title":"创建人","field":"Creator","type":"like"}]]);
|
||||
const columns = ref([{field:'PrintOptionsId',title:'PrintOptionsId',type:'guid',width:110,hidden:true,require:true,align:'left'},
|
||||
{field:'CustomName',title:'模板名称',type:'string',link:true,width:150,require:true,align:'left',sort:true},
|
||||
{field:'TableName',title:'打印模块',type:'string',width:120,hidden:true,require:true,align:'left'},
|
||||
{field:'TableCNName',title:'打印模块名称',type:'string',width:120,align:'left'},
|
||||
{field:'Options',title:'参数',type:'string',width:110,hidden:true,align:'left'},
|
||||
{field:'Html',title:'Html',type:'string',width:110,hidden:true,align:'left'},
|
||||
{field:'Enable',title:'Enable',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'DbService',title:'DbService',type:'guid',width:110,hidden:true,align:'left'},
|
||||
{field:'UserId',title:'UserId',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'TenancyId',title:'TenancyId',type:'string',width:120,hidden:true,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:110,align:'left',sort:true},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:130,align:'left'},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:130,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true}]);
|
||||
const detail = ref({columns:[]});
|
||||
const details = ref([]);
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -1,85 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Date:{Date}
|
||||
*Contact:283591387@qq.com
|
||||
*业务请在@/extension/sys/system/Sys_Region.jsx或Sys_Region.vue文件编写
|
||||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://v3.volcore.xyz/docs/view-grid、https://v3.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:onInit="onInit"
|
||||
:onInited="onInited"
|
||||
:searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter"
|
||||
:addBefore="addBefore"
|
||||
:updateBefore="updateBefore"
|
||||
:rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore"
|
||||
:modelOpenAfter="modelOpenAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridBody>
|
||||
<el-alert type="success" :closable="false" style="margin-bottom: 5px;">
|
||||
代码生成器可配置编辑模式,直接在table上进行删除、修改操作,支持多个快捷查询字段,设置this.sortable=true可拖动行自动排序
|
||||
</el-alert>
|
||||
</template>
|
||||
</view-grid>
|
||||
</template>
|
||||
<script setup lang="jsx">
|
||||
import extend from "@/extension/sys/system/Sys_Region.jsx";
|
||||
import viewOptions from './Sys_Region/options.js'
|
||||
import { ref, reactive, getCurrentInstance, watch, onMounted } from "vue";
|
||||
const grid = ref(null);
|
||||
const { proxy } = getCurrentInstance()
|
||||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://v3.volcore.xyz/docs/view-grid
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
}
|
||||
const searchBefore = async (param) => {
|
||||
//界面查询前,可以给param.wheres添加查询参数
|
||||
//返回false,则不会执行查询
|
||||
return true;
|
||||
}
|
||||
const searchAfter = async (rows, result) => {
|
||||
return true;
|
||||
}
|
||||
const addBefore = async (formData) => {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
}
|
||||
const updateBefore = async (formData) => {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
}
|
||||
const rowClick = ({ row, column, event }) => {
|
||||
//查询界面点击行事件
|
||||
// grid.value.toggleRowSelection(row); //单击行时选中当前行;
|
||||
}
|
||||
const modelOpenBefore = async (row) => {//弹出框打开后方法
|
||||
return true;//返回false,不会打开弹出框
|
||||
}
|
||||
const modelOpenAfter = (row) => {
|
||||
//弹出框打开后方法,设置表单默认值,按钮操作等
|
||||
}
|
||||
//监听表单输入,做实时计算
|
||||
//watch(() => editFormFields.字段,(newValue, oldValue) => { })
|
||||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
@@ -1,56 +0,0 @@
|
||||
// *Author:jxx
|
||||
// *Contact:283591387@qq.com
|
||||
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
export default function(){
|
||||
const table = {
|
||||
key: 'id',
|
||||
editTable:true ,
|
||||
footer: "Foots",
|
||||
cnName: '省市区县',
|
||||
name: 'Sys_Region',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_Region/",
|
||||
sortName: "id"
|
||||
};
|
||||
const tableName = table.name;
|
||||
const tableCNName = table.cnName;
|
||||
const newTabEdit = false;
|
||||
const key = table.key;
|
||||
const editFormFields = {"code":"","name":"","parentId":"","level":"","mername":"","Lng":"","Lat":"","pinyin":""};
|
||||
const editFormOptions = [[{"title":"编码","field":"code"},
|
||||
{"title":"名称","field":"name"},
|
||||
{"title":"上级编码","field":"parentId","type":"number"},
|
||||
{"title":"级别","field":"level","type":"number"},
|
||||
{"title":"完整地址","field":"mername"},
|
||||
{"title":"经度","field":"Lng","type":"decimal"},
|
||||
{"title":"纬度","field":"Lat","type":"decimal"},
|
||||
{"title":"拼音","field":"pinyin"}]];
|
||||
const searchFormFields = {"name":"","level":"","mername":"","pinyin":""};
|
||||
const searchFormOptions = [[{"title":"名称","field":"name"},{"title":"级别","field":"level","type":"number"},{"title":"完整地址","field":"mername","type":"like"},{"title":"拼音","field":"pinyin","type":"like"}]];
|
||||
const columns = [{field:'id',title:'id',type:'int',width:110,hidden:true,require:true,align:'left'},
|
||||
{field:'code',title:'编码',type:'string',width:70,edit:{type:''},align:'left'},
|
||||
{field:'name',title:'名称',type:'string',width:100,edit:{type:''},align:'left'},
|
||||
{field:'parentId',title:'上级编码',type:'int',width:70,edit:{type:''},align:'left'},
|
||||
{field:'level',title:'级别',type:'int',width:60,edit:{type:''},align:'left'},
|
||||
{field:'mername',title:'完整地址',type:'string',width:170,edit:{type:''},align:'left'},
|
||||
{field:'Lng',title:'经度',type:'float',width:70,edit:{type:''},align:'left'},
|
||||
{field:'Lat',title:'纬度',type:'float',width:70,edit:{type:''},align:'left'},
|
||||
{field:'pinyin',title:'拼音',type:'string',width:120,edit:{type:''},align:'left'}];
|
||||
const detail ={columns:[]};
|
||||
const details = [];
|
||||
|
||||
return {
|
||||
table,
|
||||
key,
|
||||
tableName,
|
||||
tableCNName,
|
||||
newTabEdit,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/sys/system/Sys_ReportOptions.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/sys/system/Sys_ReportOptions.jsx";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'ReportOptionsId',
|
||||
footer: "Foots",
|
||||
cnName: '报表模板',
|
||||
name: 'system/Sys_ReportOptions',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_ReportOptions/",
|
||||
sortName: "CreateDate"
|
||||
});
|
||||
const editFormFields = ref({"ReportName":"","ReportCode":"","DbService":"","Options":"","FilePath":""});
|
||||
const editFormOptions = ref([[{"title":"报表名称","required":true,"field":"ReportName"}],
|
||||
[{"title":"报表编码","required":true,"field":"ReportCode","disabled":true}],
|
||||
[{"dataKey":"dbServer","data":[],"title":"所在数据库","field":"DbService","type":"select"}],
|
||||
[{"title":"数据源sql","field":"Options","type":"textarea"}],
|
||||
[{"title":"模板文件","required":true,"field":"FilePath","type":"file"}]]);
|
||||
const searchFormFields = ref({"ReportName":"","ReportCode":"","DbService":""});
|
||||
const searchFormOptions = ref([[{"title":"报表名称","field":"ReportName","type":"like"},{"title":"报表编码","field":"ReportCode"},{"dataKey":"dbServer","data":[],"title":"所在数据库","field":"DbService","type":"select"}]]);
|
||||
const columns = ref([{field:'ReportOptionsId',title:'ReportOptionsId',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'ReportName',title:'报表名称',type:'string',link:true,width:110,require:true,align:'left'},
|
||||
{field:'ReportCode',title:'报表编码',type:'string',width:140,readonly:true,require:true,align:'left'},
|
||||
{field:'DbService',title:'所在数据库',type:'string',bind:{ key:'dbServer',data:[]},width:130,align:'left'},
|
||||
{field:'ReportType',title:'报表类型',type:'string',width:120,hidden:true,align:'left'},
|
||||
{field:'ParentId',title:'父级id',type:'guid',width:110,hidden:true,align:'left'},
|
||||
{field:'FilePath',title:'模板文件',type:'string',width:100,require:true,align:'left'},
|
||||
{field:'Options',title:'数据源sql',type:'string',width:100,hidden:true,align:'left'},
|
||||
{field:'OptionsText',title:'OptionsText',type:'string',width:150,hidden:true,align:'left'},
|
||||
{field:'Enable',title:'发布状态',type:'int',width:100,hidden:true,align:'left'},
|
||||
{field:'DbServiceId',title:'DbServiceId',type:'guid',width:110,hidden:true,align:'left'},
|
||||
{field:'UserId',title:'UserId',type:'int',width:110,hidden:true,align:'left'},
|
||||
{field:'TenancyId',title:'租户id',type:'string',width:120,hidden:true,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
|
||||
{field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left'},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
|
||||
{field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left'}]);
|
||||
const detail = ref({columns:[]});
|
||||
const details = ref([]);
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -6,80 +6,104 @@
|
||||
*新版本支持vue或【表.jsx]文件编写业务,文档见:https://v3.volcore.xyz/docs/view-grid、https://v3.volcore.xyz/docs/web
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend"
|
||||
:onInit="onInit"
|
||||
:onInited="onInited"
|
||||
:searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter"
|
||||
:addBefore="addBefore"
|
||||
:updateBefore="updateBefore"
|
||||
:rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore"
|
||||
:modelOpenAfter="modelOpenAfter">
|
||||
<view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
|
||||
:table="table" :extend="extend" :onInit="onInit" :onInited="onInited" :searchBefore="searchBefore"
|
||||
:searchAfter="searchAfter" :addBefore="addBefore" :updateBefore="updateBefore" :rowClick="rowClick"
|
||||
:modelOpenBefore="modelOpenBefore" :modelOpenAfter="modelOpenAfter" :loadTreeChildren="loadTreeChildren"
|
||||
:addAfter="addAfter" :updateAfter="updateAfter" :delAfter="delAfter">
|
||||
<!-- 自定义组件数据槽扩展,更多数据槽slot见文档 -->
|
||||
<template #gridHeader>
|
||||
</template>
|
||||
</view-grid>
|
||||
</template>
|
||||
<script setup lang="jsx">
|
||||
import extend from "@/extension/sys/system/Sys_Role.jsx";
|
||||
import viewOptions from './Sys_Role/options.js'
|
||||
import { ref, reactive, getCurrentInstance, watch, onMounted } from "vue";
|
||||
const grid = ref(null);
|
||||
const { proxy } = getCurrentInstance()
|
||||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
import extend from "@/extension/sys/system/Sys_Role.jsx";
|
||||
import viewOptions from './Sys_Role/options.js'
|
||||
import { ref, reactive, getCurrentInstance, watch, onMounted } from "vue";
|
||||
const grid = ref(null);
|
||||
const { proxy } = getCurrentInstance()
|
||||
//http请求,proxy.http.post/get
|
||||
const { table, editFormFields, editFormOptions, searchFormFields, searchFormOptions, columns, detail, details } = reactive(viewOptions())
|
||||
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
gridRef.boxOptions.width=500;
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://v3.volcore.xyz/docs/view-grid
|
||||
let gridRef;//对应[表.jsx]文件中this.使用方式一样
|
||||
//生成对象属性初始化
|
||||
const onInit = async ($vm) => {
|
||||
gridRef = $vm;
|
||||
gridRef.boxOptions.width = 500;
|
||||
//与jsx中的this.xx使用一样,只需将this.xx改为gridRef.xx
|
||||
//更多属性见:https://v3.volcore.xyz/docs/view-grid
|
||||
|
||||
gridRef.rowKey = 'Role_Id';
|
||||
gridRef.columns.find((x) => {
|
||||
return x.field == 'ParentId';
|
||||
})?.hidden
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
editFormOptions.forEach((x) => {
|
||||
x.forEach((item) => {
|
||||
if (item.field == 'ParentId') {
|
||||
item.title = '上级角色';
|
||||
//设置任意节点都能选中(默认只能选中最后一个节点)
|
||||
item.changeOnSelect = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
const loadTreeChildren = (tree, treeNode, resolve) => {
|
||||
//加载子节点
|
||||
let url = `api/role/getTreeTableChildrenData?roleId=${tree.Role_Id}`;
|
||||
proxy.http.post(url, {}).then((result) => {
|
||||
resolve(result.rows);
|
||||
});
|
||||
}
|
||||
const searchBefore = async (param) => {
|
||||
//判断加载根节点或子节点
|
||||
//没有查询条件,默认查询返回所有根节点数据
|
||||
if (!param.wheres.length) {
|
||||
param.value = 1;
|
||||
}
|
||||
//生成对象属性初始化后,操作明细表配置用到
|
||||
const onInited = async () => {
|
||||
}
|
||||
const searchBefore = async (param) => {
|
||||
//界面查询前,可以给param.wheres添加查询参数
|
||||
//返回false,则不会执行查询
|
||||
return true;
|
||||
}
|
||||
const searchAfter = async (rows, result) => {
|
||||
return true;
|
||||
}
|
||||
const addBefore = async (formData) => {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
}
|
||||
const updateBefore = async (formData) => {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
}
|
||||
const rowClick = ({ row, column, event }) => {
|
||||
//查询界面点击行事件
|
||||
// grid.value.toggleRowSelection(row); //单击行时选中当前行;
|
||||
}
|
||||
const modelOpenBefore = async (row) => {//弹出框打开后方法
|
||||
return true;//返回false,不会打开弹出框
|
||||
}
|
||||
const modelOpenAfter = (row) => {
|
||||
//弹出框打开后方法,设置表单默认值,按钮操作等
|
||||
}
|
||||
//监听表单输入,做实时计算
|
||||
//watch(() => editFormFields.字段,(newValue, oldValue) => { })
|
||||
//对外暴露数据
|
||||
defineExpose({})
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
const searchAfter = async (rows, result) => {
|
||||
return true;
|
||||
}
|
||||
const addBefore = async (formData) => {
|
||||
//新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
|
||||
return true;
|
||||
}
|
||||
const updateBefore = async (formData) => {
|
||||
//编辑保存前formData为对象,包括明细表、删除行的Id
|
||||
return true;
|
||||
}
|
||||
|
||||
const addAfter = () => {
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
const updateAfter = () => {
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
const delAfter = () => {
|
||||
gridRef.initDicKeys();
|
||||
return true;
|
||||
}
|
||||
const rowClick = ({ row, column, event }) => {
|
||||
//查询界面点击行事件
|
||||
// grid.value.toggleRowSelection(row); //单击行时选中当前行;
|
||||
}
|
||||
const modelOpenBefore = async (row) => {//弹出框打开后方法
|
||||
return true;//返回false,不会打开弹出框
|
||||
}
|
||||
const modelOpenAfter = (row) => {
|
||||
//弹出框打开后方法,设置表单默认值,按钮操作等
|
||||
}
|
||||
//监听表单输入,做实时计算
|
||||
//watch(() => editFormFields.字段,(newValue, oldValue) => { })
|
||||
//对外暴露数据
|
||||
defineExpose({})
|
||||
</script>
|
||||
<style lang="less" scope>
|
||||
</style>
|
||||
<style lang="less" scope></style>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<!--
|
||||
*Author:jxx
|
||||
*Contact:283591387@qq.com
|
||||
*代码由框架生成,任何更改都可能导致被代码生成器覆盖
|
||||
*业务请在@/extension/sys/system/Sys_UserPost.js此处编写
|
||||
-->
|
||||
<template>
|
||||
<view-grid ref="grid"
|
||||
:columns="columns"
|
||||
:detail="detail"
|
||||
:details="details"
|
||||
:editFormFields="editFormFields"
|
||||
:editFormOptions="editFormOptions"
|
||||
:searchFormFields="searchFormFields"
|
||||
:searchFormOptions="searchFormOptions"
|
||||
:table="table"
|
||||
:extend="extend">
|
||||
</view-grid>
|
||||
</template>
|
||||
<script>
|
||||
import extend from "@/extension/sys/system/Sys_UserPost.js";
|
||||
import { ref, defineComponent } from "vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const table = ref({
|
||||
key: 'Id',
|
||||
footer: "Foots",
|
||||
cnName: '用户岗位',
|
||||
name: 'system/Sys_UserPost',
|
||||
newTabEdit: false,
|
||||
url: "/Sys_UserPost/",
|
||||
sortName: "CreateDate"
|
||||
});
|
||||
const editFormFields = ref({});
|
||||
const editFormOptions = ref([]);
|
||||
const searchFormFields = ref({});
|
||||
const searchFormOptions = ref([]);
|
||||
const columns = ref([{field:'Id',title:'Id',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
|
||||
{field:'UserId',title:'UserId',type:'int',width:110,require:true,align:'left'},
|
||||
{field:'PostId',title:'PostId',type:'string',width:110,require:true,align:'left'},
|
||||
{field:'Enable',title:'Enable',type:'int',width:110,require:true,align:'left'},
|
||||
{field:'CreateID',title:'CreateID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Creator',title:'Creator',type:'string',width:100,align:'left'},
|
||||
{field:'CreateDate',title:'CreateDate',type:'datetime',width:110,align:'left'},
|
||||
{field:'ModifyID',title:'ModifyID',type:'int',width:80,hidden:true,align:'left'},
|
||||
{field:'Modifier',title:'Modifier',type:'string',width:100,align:'left'},
|
||||
{field:'ModifyDate',title:'ModifyDate',type:'datetime',width:110,align:'left'}]);
|
||||
const detail = ref({columns:[]});
|
||||
const details = ref([]);
|
||||
return {
|
||||
table,
|
||||
extend,
|
||||
editFormFields,
|
||||
editFormOptions,
|
||||
searchFormFields,
|
||||
searchFormOptions,
|
||||
columns,
|
||||
detail,
|
||||
details
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user