| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- export function filterTreeDatas(tree) {
- const accessedRouters = []
- let j = -1
- for (const i in tree) {
- j++
- accessedRouters.push({
- value: tree[i].id, //tree[i].id
- text: tree[i].text,
- hasChild: tree[i].children && tree[i].children.length > 0 ? 1 : 0,
- id: tree[i].id ,//treeValue
- })
- if (tree[i].children) {
- accessedRouters[j].children = filterTreeDatas(tree[i].children)
- }
- }
-
- return accessedRouters
- }
- export function filterGongDanTreeDatas(tree,zIndex,position) {
- const accessedRouters = []
- let j = -1
- zIndex++
- for (const i in tree) {
- j++
- accessedRouters.push({
- value: tree[i].id, //tree[i].id
- text: tree[i].text,
- id: tree[i].id ,//treeValue
- zIndex:zIndex,
- hasChild: tree[i].children && tree[i].children.length > 0 ? 1 : 0,
- sort:j,
- position:position+i+'-'
- })
- if (tree[i].children) {
- accessedRouters[j].children = filterGongDanTreeDatas(tree[i].children,zIndex,accessedRouters[j].position)
- }
-
- }
-
- return accessedRouters
- }
- export function filterTreeDatasNew(tree) {
- const accessedRouters = []
- let j = -1
- for (const i in tree) {
- j++
-
- accessedRouters.push({
- value: tree[i].id, //tree[i].id
- text: tree[i].text,
- hasChild: tree[i].children && tree[i].children.length > 0 ? 1 : 0,
- })
- if (tree[i].children) {
- accessedRouters[j].children = filterTreeDatasNew(tree[i].children)
- }
- }
- return accessedRouters
- }
- export function filterDepartTreeDatas(tree,tid,zIndex,position) {
- const accessedRouters = []
- let j = -1
- tid++
- zIndex++
- for (const i in tree) {
- j++
- accessedRouters.push({
- value: tid+ '_' +tree[i].id,
- text: tree[i].text,
- id: tree[i].id,
- zIndex:zIndex,
- sort:j,
- hasChild: tree[i].children && tree[i].children.length > 0 ? 1 : 0,
- position:position+i+'-'
- })
- if (tree[i].children) {
- accessedRouters[j].children = filterDepartTreeDatas(tree[i].children, tid,zIndex,accessedRouters[j].position)
- }
- }
- return accessedRouters
- }
- export function filterMuterDatas(tree){
- const accessedRouters = []
- let j = -1
- for (const i in tree) {
- j++
- accessedRouters.push({
- value: tree[i].id, //tree[i].id
- text: tree[i].text,
- id: tree[i].id ,//treeValue
- hasChild: tree[i].children && tree[i].children.length > 0 ? 1 : 0,
- })
- if (tree[i].children) {
- accessedRouters[j].children = filterMuterDatas(tree[i].children)
- }
- }
- return accessedRouters
- }
- export function filterTreatData(data){
- const treatData = []
- for (const i in data) {
- treatData.push({
- cityCode:data[i].F_UserId,
- cityName:data[i].F_UserName
- })
- }
- return treatData
- }
- export function filterSelectData(data,keyValue1,keyValue2){
- const treatData = []
- for (let data of data) {
- treatData.push({
- text:data[keyValue1],
- value:data[keyValue2]
- })
- }
- return treatData
- }
- export function filterSelectDataSX(data,keyValue1,keyValue2){
- const treatData = []
- for (let data of data) {
- treatData.push({
- text:data[keyValue1],
- value:data[keyValue2]
- })
- }
- return treatData
- }
|