|
|
@@ -1,3 +1,7 @@
|
|
|
+/*!
|
|
|
+ * 待确认是否废弃------------------------------------------------------
|
|
|
+ */
|
|
|
+
|
|
|
import { BtnClassName, BtnListType } from '@/common/components/btnList/interface';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
import { ModalName } from '@/common/constants/modalName';
|
|
|
@@ -47,18 +51,19 @@ export function handleBtnList(list: OperationTabMenu | undefined, menuType: keyo
|
|
|
const commonBtn = ref<BtnListType[]>([]); // 通用按钮列表,不用选中数据才显示
|
|
|
const forDataBtn = ref<BtnListType[]>([]); // 针对数据按钮列表,选中某条数据才显示
|
|
|
if (list && list.children) {
|
|
|
- list.children.forEach(e => {
|
|
|
- const { code, type, title, isshow } = e;
|
|
|
- if (type === 2 && isshow) { // 按钮类型
|
|
|
- const { openAction } = openModal(code as keyof ModalName);
|
|
|
- const item = { lable: title, callback: openAction, className: getClassName(code), code: code }
|
|
|
- if (commonName.includes(title)) { //
|
|
|
- commonBtn.value.push(item)
|
|
|
- } else {
|
|
|
- forDataBtn.value.push(item)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ // list.children.forEach(e => {
|
|
|
+ // const { code, type, title, isshow } = e;
|
|
|
+ // if (type === 2 && isshow) { // 按钮类型
|
|
|
+ // const { openAction } = openModal(code as keyof ModalName);
|
|
|
+ // const item = { lable: title, callback: openAction, className: getClassName(code), code: code }
|
|
|
+ // if (commonName.includes(title)) { //
|
|
|
+ // commonBtn.value.push(item)
|
|
|
+ // } else {
|
|
|
+ // forDataBtn.value.push(item)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ debugger
|
|
|
} else {
|
|
|
console.warn(`menuType: ${menuType}未找到`)
|
|
|
}
|
|
|
@@ -76,17 +81,18 @@ export function _handleBtnList_(list: OperationTabMenu | undefined, hasDetail: b
|
|
|
const temp: [number, OperationTabMenu[] | undefined] = [0, list?.children]
|
|
|
while (temp[1] && temp[1].length) {
|
|
|
temp[1].forEach((e) => {
|
|
|
- const { code, type, title, isshow } = e;
|
|
|
- const index = temp[0]
|
|
|
- if (!Array.isArray(result.value[index])) {
|
|
|
- result.value[index] = []
|
|
|
- }
|
|
|
- if (type === 2 && isshow && code !== 'none_btn') {
|
|
|
- // 按钮类型 并且显示
|
|
|
- // 当code为 none_btn, 是空按钮,(返回按钮确保数据结构统一)
|
|
|
- const item = { lable: title, code, className: getClassName(code) }
|
|
|
- result.value[index].push(item)
|
|
|
- }
|
|
|
+ // const { code, type, title, isshow } = e;
|
|
|
+ // const index = temp[0]
|
|
|
+ // if (!Array.isArray(result.value[index])) {
|
|
|
+ // result.value[index] = []
|
|
|
+ // }
|
|
|
+ // if (type === 2 && isshow && code !== 'none_btn') {
|
|
|
+ // // 按钮类型 并且显示
|
|
|
+ // // 当code为 none_btn, 是空按钮,(返回按钮确保数据结构统一)
|
|
|
+ // const item = { lable: title, code, className: getClassName(code) }
|
|
|
+ // result.value[index].push(item)
|
|
|
+ // }
|
|
|
+ debugger
|
|
|
})
|
|
|
const children = temp[1][0].children
|
|
|
if (children && children.length) {
|
|
|
@@ -121,16 +127,17 @@ export function _handleBtnList(list: OperationTabMenu | undefined, hasDetail: bo
|
|
|
const temp: [number, OperationTabMenu[] | undefined] = [0, list?.children]
|
|
|
while (temp[1] && temp[1].length) {
|
|
|
temp[1].forEach((e) => {
|
|
|
- const { code, type, title, isshow } = e;
|
|
|
- const index = temp[0]
|
|
|
- if (!Array.isArray(result.value[index])) {
|
|
|
- result.value[index] = []
|
|
|
- }
|
|
|
- if (type === 2 && isshow) { // 按钮类型 并且显示
|
|
|
- const { openAction } = openModal(code as keyof ModalName);
|
|
|
- const item = { lable: title, callback: openAction, className: getClassName(code), code: code }
|
|
|
- result.value[index].push(item)
|
|
|
- }
|
|
|
+ // const { code, type, title, isshow } = e;
|
|
|
+ // const index = temp[0]
|
|
|
+ // if (!Array.isArray(result.value[index])) {
|
|
|
+ // result.value[index] = []
|
|
|
+ // }
|
|
|
+ // if (type === 2 && isshow) { // 按钮类型 并且显示
|
|
|
+ // const { openAction } = openModal(code as keyof ModalName);
|
|
|
+ // const item = { lable: title, callback: openAction, className: getClassName(code), code: code }
|
|
|
+ // result.value[index].push(item)
|
|
|
+ // }
|
|
|
+ debugger
|
|
|
})
|
|
|
const children = temp[1][0].children
|
|
|
if (children && children.length) {
|
|
|
@@ -160,11 +167,12 @@ export function _handleBtnList(list: OperationTabMenu | undefined, hasDetail: bo
|
|
|
export function getOrderBtnList(list: OperationTabMenu[], hasDetail = false) {
|
|
|
const result = ref<BtnListType[]>([])
|
|
|
list.forEach(el => {
|
|
|
- const { code, type, title, isshow } = el;
|
|
|
- if (type === 2 && isshow) {
|
|
|
- const item = { lable: title, code, className: getClassName(code) }
|
|
|
- result.value.push(item)
|
|
|
- }
|
|
|
+ // const { code, type, title, isshow } = el;
|
|
|
+ // if (type === 2 && isshow) {
|
|
|
+ // const item = { lable: title, code, className: getClassName(code) }
|
|
|
+ // result.value.push(item)
|
|
|
+ // }
|
|
|
+ debugger
|
|
|
});
|
|
|
// 详情
|
|
|
if (hasDetail) {
|
|
|
@@ -214,13 +222,14 @@ export function findChildList(menuType: EnumRouterName): OperationTabMenu | unde
|
|
|
}
|
|
|
return null
|
|
|
}
|
|
|
- findFn(data)
|
|
|
+ //findFn(data)
|
|
|
return list
|
|
|
}
|
|
|
// 处理有三级路由的特殊情况,例如仓单贸易
|
|
|
export function getBtnList_(menuType: EnumRouterName, hasDetail: boolean) {
|
|
|
const list = findChildList(menuType)
|
|
|
- return _handleBtnList_(list, hasDetail)
|
|
|
+ const res = _handleBtnList_(list, hasDetail);
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
/****************************** ======================================= *************************/
|
|
|
@@ -232,13 +241,14 @@ export function getButtonList(menuType: EnumRouterName, hasDetail: boolean) {
|
|
|
const result = [] // 操作按钮列表
|
|
|
if (list && list.children) {
|
|
|
list.children.forEach(el => {
|
|
|
- const { code, type, title, isshow } = el;
|
|
|
- if (isshow) {
|
|
|
- if (type === 2) {
|
|
|
- const item = { lable: title, className: getClassName(code), code: code }
|
|
|
- result.push(item)
|
|
|
- }
|
|
|
- }
|
|
|
+ // const { code, type, title, isshow } = el;
|
|
|
+ // if (isshow) {
|
|
|
+ // if (type === 2) {
|
|
|
+ // const item = { lable: title, className: getClassName(code), code: code }
|
|
|
+ // result.push(item)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ debugger
|
|
|
})
|
|
|
}
|
|
|
// 详情
|