Skip to content

Commit

Permalink
增加快速获取表单配置方法getFormOption
Browse files Browse the repository at this point in the history
  • Loading branch information
283591387@qq.com committed Apr 27, 2024
1 parent 59fc4de commit 4c9297f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Vol.Vue3.Vite/src/components/basic/ViewGrid/methods.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,20 @@ let methods = {
//查询页面表格合并行或列,见https://element-plus.gitee.io/zh-CN/component/table.html#%E5%90%88%E5%B9%B6%E8%A1%8C%E6%88%96%E5%88%97
detailSpanMethod({row,column,rowIndex, columnIndex}){

},
getFormOption(field) {
if (!field) {
return null
}
for (let index = 0; index < this.editFormOptions.length; index++) {
const _options = this.editFormOptions[index]
const obj = _options.find((c) => {
return c.field == field
})
if (obj) {
return obj
}
}
}
};
import customColumns from './ViewGridCustomColumn.js';
Expand Down
13 changes: 11 additions & 2 deletions Vol.Vue3版本/src/components/basic/ViewGrid/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,7 @@ let methods = {
},
getUrl(action, ingorPrefix) {
//是否忽略前缀/ 获取操作的url
return 'api' + this.table.url + action;
// return (!ingorPrefix ? '/' : '') + 'api' + this.table.url + action;
return (!ingorPrefix ? '/' : '') + 'api' + this.table.url + action;
},
initDicKeys() {
//初始化字典数据
Expand Down Expand Up @@ -1718,6 +1717,16 @@ let methods = {
//查询页面表格合并行或列,见https://element-plus.gitee.io/zh-CN/component/table.html#%E5%90%88%E5%B9%B6%E8%A1%8C%E6%88%96%E5%88%97
detailSpanMethod({row,column,rowIndex, columnIndex}){

},
getFormOption(field) {//2024.04.27获取表单配置
for (let index = 0; index < this.editFormOptions.length; index++) {
const obj = this.editFormOptions[index].find((c) => {
return c.field == field
})
if (obj) {
return obj
}
}
}
};
import customColumns from './ViewGridCustomColumn.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,16 @@ let methods = {
//查询页面表格合并行或列,见https://element-plus.gitee.io/zh-CN/component/table.html#%E5%90%88%E5%B9%B6%E8%A1%8C%E6%88%96%E5%88%97
detailSpanMethod({row,column,rowIndex, columnIndex}){

},
getFormOption(field) {//2024.04.27获取表单配置
for (let index = 0; index < this.editFormOptions.length; index++) {
const obj = this.editFormOptions[index].find((c) => {
return c.field == field
})
if (obj) {
return obj
}
}
}
};
import customColumns from './ViewGridCustomColumn.js';
Expand Down

0 comments on commit 4c9297f

Please sign in to comment.