def zrdwsearch_qhauth(self, *args, **kwargs): """ 责任单位搜索弹窗的权限: 只能显示同一级别的和下属的责任单位 直接从Cqh需要在 qh_ceiling和其下属里面 配合jb完成筛选 """ qh_ceiling = g.get("level_auth_name") if qh_ceiling: from utils.qh_processor import get_qh_include_sub qh_list = get_qh_include_sub(qh_ceiling) self.apis_copy["IN-Cqh"] = ",".join(list(set(qh_list))) return self
def qh_include_sub(self, *args, **kwargs): # full的问题 qh = self.apis_copy.get("Cqh", "") table = self.apis_copy.get("table", "") if qh and "qh" in table: from utils.qh_processor import get_qh_include_sub from utils.get_unilist import get_unilist qh_include_sub = get_unilist(get_qh_include_sub(qh)) update_dict = {"IN-Cqh": ",".join(qh_include_sub)} self.apis_copy.update(update_dict) return self
def djjg_qhauth(self, *args, **kwargs): """ 登记机构的饼图的权限控制: 国家: 只有省级的能看 省级:只有省级的能看 市级:省级/市级的能看 省级看所有的市 市级看自己的 县级:省级/市级/县级能看 省级看所有县 市级看自己的县 县级看自己 """ from utils.qh_processor import get_qh_include_sub from utils.get_unilist import get_unilist if g.get("level_auth_name"): qh_list = get_unilist(get_qh_include_sub(g.get("level_auth_name"))) qh_list = [f"'{i}'" for i in qh_list] self.apis_copy["sql_qhauth_other"] = { "djjg_qh": f"qh in ({','.join(qh_list)})" } table = self.apis_copy.get("table", "") qh = self.apis_copy.get("Cqh", "") if "djjg" in table and "qh" in table: self.apis_copy["djjg"] = args[0] self.apis_copy["IN-Cqh"] = ",".join( get_unilist(get_qh_include_sub(qh))) return self
def xfbmsearch_qhauth(self, *args, **kwargs): """ 信访部门搜索弹窗的权限: 只能显示同一级别的这个局和下属的局 根据 g.get("level_auth_name") 获取名字 配合jb参数完成过滤 """ qh_ceiling = g.get("level_auth_name") if qh_ceiling: from utils.qh_processor import get_qh_include_sub from libs.devdebug import DevDubug code, msg, xfbm_search = DevDubug.get_specific_table( table="search_xfbm_jb") qh_list = get_qh_include_sub(qh_ceiling) qh_re_list = [f".*{i}.*" for i in qh_list] xfbm_list = xfbm_search["xfbm"][xfbm_search["xfbm"].str.match( "|".join(qh_re_list))].tolist() self.apis_copy["IN-xfbm"] = ",".join(list(set(xfbm_list))) return self