|
|
@@ -47,9 +47,9 @@ namespace CallCenterApi.Interface.Controllers
|
|
47
|
47
|
{
|
|
48
|
48
|
DataTable dt = new DataTable();
|
|
49
|
49
|
string where = " ";
|
|
50
|
|
- where = "isnull(F_ParentId, 1) = '" + pId + "' and F_State = 1 and F_Layer = " + F_Layer;
|
|
|
50
|
+ where = " isnull(F_DeptId,0) = '" + 1 + "' and F_State = 1" ;
|
|
51
|
51
|
dt = new BLL.T_Sys_Department().GetList(0, where, " F_Sort asc").Tables[0];
|
|
52
|
|
- List<Model.TreeModel> modelList = BindAreaTree(dt, "0");
|
|
|
52
|
+ List<Model.TreeModel> modelList = BindAreaTree(dt, "0", 1);
|
|
53
|
53
|
return Success("加载成功", modelList);
|
|
54
|
54
|
}
|
|
55
|
55
|
return NoToken("未知错误,请重新登录");
|
|
|
@@ -201,7 +201,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
201
|
201
|
/// <param name="tab"></param>
|
|
202
|
202
|
/// <param name="parentid"></param>
|
|
203
|
203
|
/// <returns></returns>
|
|
204
|
|
- private List<Model.TreeModel> BindAreaTree(DataTable tab, string parentid)
|
|
|
204
|
+ private List<Model.TreeModel> BindAreaTree(DataTable tab, string parentid,int pid=0)
|
|
205
|
205
|
{
|
|
206
|
206
|
DataTable tab2 = new DataTable();
|
|
207
|
207
|
|
|
|
@@ -216,10 +216,18 @@ namespace CallCenterApi.Interface.Controllers
|
|
216
|
216
|
model.id = currentID;
|
|
217
|
217
|
model.IconCls = "";//图标
|
|
218
|
218
|
model.text = categorylist[i].F_DeptName;
|
|
219
|
|
- tab2 = new BLL.T_Sys_Department().GetList("F_ParentId=" + currentID + " and F_State=1 order by f_sort").Tables[0];
|
|
|
219
|
+ if (pid==1)
|
|
|
220
|
+ {
|
|
|
221
|
+ tab2 = new BLL.T_Sys_Department().GetList("F_ParentId=" + currentID + " and F_State=1 and F_Layer = 1 order by f_sort").Tables[0];
|
|
|
222
|
+ }
|
|
|
223
|
+ else
|
|
|
224
|
+ {
|
|
|
225
|
+ tab2 = new BLL.T_Sys_Department().GetList("F_ParentId=" + currentID + " and F_State=1 order by f_sort").Tables[0];
|
|
|
226
|
+ }
|
|
|
227
|
+
|
|
220
|
228
|
if (tab2 != null && tab2.Rows.Count > 0)
|
|
221
|
229
|
{
|
|
222
|
|
- model.children = BindBreaTree(tab2, currentID);
|
|
|
230
|
+ model.children = BindBreaTree(tab2, currentID, pid);
|
|
223
|
231
|
}
|
|
224
|
232
|
modelList.Add(model);
|
|
225
|
233
|
}
|
|
|
@@ -238,7 +246,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
238
|
246
|
/// <param name="tab"></param>
|
|
239
|
247
|
/// <param name="parentid"></param>
|
|
240
|
248
|
/// <returns></returns>
|
|
241
|
|
- private List<Model.TreeModel> BindBreaTree(DataTable tab, string parentid)
|
|
|
249
|
+ private List<Model.TreeModel> BindBreaTree(DataTable tab, string parentid,int pid=0)
|
|
242
|
250
|
{
|
|
243
|
251
|
DataTable tab2 = new DataTable();
|
|
244
|
252
|
|
|
|
@@ -254,7 +262,13 @@ namespace CallCenterApi.Interface.Controllers
|
|
254
|
262
|
model.IconCls = "";//图标
|
|
255
|
263
|
model.text = categorylist[i].F_DeptName;
|
|
256
|
264
|
tab2 = new BLL.T_Sys_Department().GetList("F_ParentId=" + currentID + " and F_State=1 order by f_sort").Tables[0];
|
|
257
|
|
-
|
|
|
265
|
+ if (pid >0)
|
|
|
266
|
+ {
|
|
|
267
|
+ if (tab2 != null && tab2.Rows.Count > 0)
|
|
|
268
|
+ {
|
|
|
269
|
+ model.children = BindBreaTree(tab2, currentID, 0);
|
|
|
270
|
+ }
|
|
|
271
|
+ }
|
|
258
|
272
|
modelList.Add(model);
|
|
259
|
273
|
}
|
|
260
|
274
|
return modelList;
|