提交 5c5a4bc3 authored 作者: 吴强's avatar 吴强

更新图标,更新基地选择

上级 09f0a8af
<resources> <resources>
<string moduleConfig="true" name="reactNativeCodePush_androidDeploymentKey"></string> <string moduleConfig="true" name="reactNativeCodePush_androidDeploymentKey"></string>
<string name="app_name">bolanManagerApp</string> <string name="app_name">深圳棚改云</string>
</resources> </resources>
...@@ -16,7 +16,6 @@ const findTarget = (list, dmpath) => { ...@@ -16,7 +16,6 @@ const findTarget = (list, dmpath) => {
return list[i]; return list[i];
} else { } else {
const data = findTarget(list[i].children, dmpath); const data = findTarget(list[i].children, dmpath);
// console.log(data);
if (data) { if (data) {
return data; return data;
} }
...@@ -28,22 +27,21 @@ const createData = async (list, dmpath, payload) => { ...@@ -28,22 +27,21 @@ const createData = async (list, dmpath, payload) => {
// 根据path用fetchDomains 查出children // 根据path用fetchDomains 查出children
let childrens = []; let childrens = [];
let pathArray; let pathArray;
if (dmpath !== '/' || dmpath.split('/').length === 3) { if (dmpath !== '/' && dmpath.split('/').length !== 4) {
childrens = await fetchDomains(dmpath); childrens = await fetchDomains(dmpath);
console.info('ChildRen-------------------------');
console.info(childrens);
console.info('ChildRen------------------------');
if (childrens.length !== 0) { if (childrens.length !== 0) {
const childrenPath = childrens[0].path; pathArray = [...payload, ''];
pathArray = [...payload, childrenPath]; } else {
console.info(pathArray); pathArray = [...payload];
} }
} else { } else {
pathArray = [...payload]; pathArray = [...payload];
} }
const cols = pathArray.length;
const childrenData = []; const childrenData = [];
if (childrens.length !== 0) { if (childrens.length !== 0) {
childrenData.push({ label: '请选择', value: '', children: [] });
childrens.map(({ name, path }) => { childrens.map(({ name, path }) => {
childrenData.push({ label: name, value: path, children: [] }); childrenData.push({ label: name, value: path, children: [] });
return childrenData; return childrenData;
...@@ -52,9 +50,13 @@ const createData = async (list, dmpath, payload) => { ...@@ -52,9 +50,13 @@ const createData = async (list, dmpath, payload) => {
// 根据path在list查出需要添加children的对象target // 根据path在list查出需要添加children的对象target
const findData = findTarget(list, dmpath); const findData = findTarget(list, dmpath);
findData.children = childrenData; findData.children = childrenData;
const data = list; // if (childrens.length !== 0) {
console.log(list); // await createData(list, pathArray[pathArray.length - 1], pathArray);
return { data, pathArray, cols }; // return { data, pathArray, cols: pathArray.length };
// } else {
// console.info('xxxxx');
return { data: list, pathArray, cols: pathArray.length };
// }
}; };
export default { export default {
...@@ -123,6 +125,10 @@ export default { ...@@ -123,6 +125,10 @@ export default {
}, },
*getUserInfo(ignored, { put, call }) { *getUserInfo(ignored, { put, call }) {
const userInfo = yield call(getUser); const userInfo = yield call(getUser);
const domain = yield call(getDomain);
console.info(domain.path);
const list = yield call(fetchDomains, domain.path, true);
console.info(list[0].name);
yield put({ type: 'queryUserInfo', payload: userInfo }); yield put({ type: 'queryUserInfo', payload: userInfo });
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论