doomiwork 3.3.2 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/database/daoBase.js +37 -88
- package/package.json +1 -1
package/core/database/daoBase.js
CHANGED
|
@@ -246,84 +246,7 @@ class mysqlDao extends dao{
|
|
|
246
246
|
if (!this.hasPermissionControl || !permissionParam) {
|
|
247
247
|
return Promise.resolve({successed:true})
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
// replace into vmv3_data_permission(
|
|
251
|
-
// data_type,
|
|
252
|
-
// data_id,
|
|
253
|
-
// permission_type,
|
|
254
|
-
// data_department,
|
|
255
|
-
// data_department_text,
|
|
256
|
-
// data_role,
|
|
257
|
-
// data_role_text,
|
|
258
|
-
// data_level,
|
|
259
|
-
// data_level_text,
|
|
260
|
-
// data_user,
|
|
261
|
-
// data_user_text
|
|
262
|
-
// ) values
|
|
263
|
-
// `
|
|
264
|
-
// let subItem = [];
|
|
265
|
-
// if (permissionParam.managepermission){
|
|
266
|
-
// const mItem = permissionParam.managepermission;
|
|
267
|
-
// subItem.push(`(
|
|
268
|
-
// ${this.tableoption.permissiondatatype},
|
|
269
|
-
// '${id}',
|
|
270
|
-
// 1,
|
|
271
|
-
// '${mItem.department || ''}',
|
|
272
|
-
// '${mItem.departmenttext || ''}',
|
|
273
|
-
// '${mItem.role || ''}',
|
|
274
|
-
// '${mItem.roletext || ''}',
|
|
275
|
-
// '${mItem.level || ''}',
|
|
276
|
-
// '${mItem.leveltext || ''}',
|
|
277
|
-
// '${mItem.user || ''}',
|
|
278
|
-
// '${mItem.usertext || ''}'
|
|
279
|
-
// )`)
|
|
280
|
-
|
|
281
|
-
// }
|
|
282
|
-
|
|
283
|
-
// if (permissionParam.consumepermission) {
|
|
284
|
-
// const mItem = permissionParam.consumepermission;
|
|
285
|
-
// subItem.push(`(
|
|
286
|
-
// ${this.tableoption.permissiondatatype},
|
|
287
|
-
// '${id}',
|
|
288
|
-
// 2,
|
|
289
|
-
// '${mItem.department || ''}',
|
|
290
|
-
// '${mItem.departmenttext || ''}',
|
|
291
|
-
// '${mItem.role || ''}',
|
|
292
|
-
// '${mItem.roletext || ''}',
|
|
293
|
-
// '${mItem.level || ''}',
|
|
294
|
-
// '${mItem.leveltext || ''}',
|
|
295
|
-
// '${mItem.user || ''}',
|
|
296
|
-
// '${mItem.usertext || ''}'
|
|
297
|
-
// )`)
|
|
298
|
-
// }
|
|
299
|
-
//return this.executeSql(sqlCommand+subItem.join(','));
|
|
300
|
-
|
|
301
|
-
const sqlCommand = `
|
|
302
|
-
delete from framework_permission where data_id=? and data_type=?;
|
|
303
|
-
insert into framework_permission(
|
|
304
|
-
data_id,
|
|
305
|
-
data_type,
|
|
306
|
-
allow_type,
|
|
307
|
-
allow_id
|
|
308
|
-
) values ?;
|
|
309
|
-
|
|
310
|
-
update framework_permission op
|
|
311
|
-
inner join vm_org_department od on op.allow_id=od.department_id
|
|
312
|
-
set op.allow_name = od.department_name,
|
|
313
|
-
op.allow_path = od.parent_path
|
|
314
|
-
where data_id=? and data_type=? and allow_type=1;
|
|
315
|
-
|
|
316
|
-
update framework_permission op
|
|
317
|
-
inner join vm_org_role od on op.allow_id=od.role_id
|
|
318
|
-
set op.allow_name = od.role_name
|
|
319
|
-
where data_id=? and data_type=? and allow_type=2;
|
|
320
|
-
|
|
321
|
-
update framework_permission op
|
|
322
|
-
inner join vm_org_user od on op.allow_id=od.user_id
|
|
323
|
-
set op.allow_name = od.user_name
|
|
324
|
-
where data_id=? and data_type=? and allow_type=4;
|
|
325
|
-
|
|
326
|
-
`
|
|
249
|
+
let sqlCommand = `delete from framework_permission where data_id=? and data_type=?;`
|
|
327
250
|
let subItem = [];
|
|
328
251
|
|
|
329
252
|
|
|
@@ -342,16 +265,42 @@ class mysqlDao extends dao{
|
|
|
342
265
|
subItem.push([id, this.tableoption.permissiondatatype, 4, uid])
|
|
343
266
|
}
|
|
344
267
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
268
|
+
let sqlParam = [id, this.tableoption.permissiondatatype];
|
|
269
|
+
if (subItem.length){
|
|
270
|
+
sqlCommand = sqlCommand+`
|
|
271
|
+
insert into framework_permission(
|
|
272
|
+
data_id,
|
|
273
|
+
data_type,
|
|
274
|
+
allow_type,
|
|
275
|
+
allow_id
|
|
276
|
+
) values ?;
|
|
277
|
+
|
|
278
|
+
update framework_permission op
|
|
279
|
+
inner join vm_org_department od on op.allow_id=od.department_id
|
|
280
|
+
set op.allow_name = od.department_name,
|
|
281
|
+
op.allow_path = od.parent_path
|
|
282
|
+
where data_id=? and data_type=? and allow_type=1;
|
|
283
|
+
|
|
284
|
+
update framework_permission op
|
|
285
|
+
inner join vm_org_role od on op.allow_id=od.role_id
|
|
286
|
+
set op.allow_name = od.role_name
|
|
287
|
+
where data_id=? and data_type=? and allow_type=2;
|
|
288
|
+
|
|
289
|
+
update framework_permission op
|
|
290
|
+
inner join vm_org_user od on op.allow_id=od.user_id
|
|
291
|
+
set op.allow_name = od.user_name
|
|
292
|
+
where data_id=? and data_type=? and allow_type=4;
|
|
293
|
+
`
|
|
294
|
+
sqlParam.push(
|
|
295
|
+
subItem,
|
|
296
|
+
id,
|
|
297
|
+
this.tableoption.permissiondatatype,
|
|
298
|
+
id,
|
|
299
|
+
this.tableoption.permissiondatatype,
|
|
300
|
+
id,
|
|
301
|
+
this.tableoption.permissiondatatype);
|
|
302
|
+
}
|
|
303
|
+
return this.executeSql(sqlCommand, sqlParam);
|
|
355
304
|
}
|
|
356
305
|
/**
|
|
357
306
|
*
|