Quellcode durchsuchen

增加租户角色相关过滤

chenlei1231 vor 3 Monaten
Ursprung
Commit
56d723097d

+ 4 - 1
src/enums/roleEnum.ts

@@ -2,7 +2,10 @@ export enum RoleEnum {
   // super admin
   SUPER = 'super',
   ADMIN = 'admin',
-
+  ADWEB_ADMIN = 'adweb_admin',
+  SEO_ADMIN = 'seo_admin',
+  ADWEB_SITE_MANAGER = 'adweb_site_manager',
+  ADWEB_SEO_MANAGER = 'adweb_seo_manager',
   // tester
   TEST = 'test',
 }

+ 1 - 1
src/views/adweb/site/AdwebSite.data.ts

@@ -17,7 +17,7 @@ export const columns: BasicColumn[] = [
     resizable: true,
   },
   {
-    title: '渠道商',
+    title: '租户',
     align: 'left',
     dataIndex: 'channelProviderName',
     resizable: true,

+ 25 - 26
src/views/adweb/site/AdwebSiteList.vue

@@ -22,17 +22,17 @@
             </a-form-item>
           </a-col>
 
-          <template v-if="toggleSearchStatus">
-            <a-col :xxl="6" :xl="7">
-              <a-form-item label="渠道商">
-                <a-select placeholder="请选择渠道商" v-model:value="queryParam.channelProviderId" showSearch allowClear :filterOption="filterOption">
-                  <a-select-option v-for="data in channelProviderList" :key="data.username" :value="data.workNo">
-                    {{ data.username }}
-                  </a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
+          <a-col v-if="isAdmin" :xxl="6" :xl="7">
+            <a-form-item label="租户">
+              <j-search-select
+                placeholder="请选择租户"
+                v-model:value="queryParam.channelProviderId"
+                dict="sys_tenant,name,id,del_flag=0 AND status=1"
+              />
+            </a-form-item>
+          </a-col>
 
+          <template v-if="toggleSearchStatus">
             <!--            <a-col :xxl="12" :xl="10">-->
             <!--              <a-form-item label="创建时间">-->
             <!--                <j-range-date placeholder="请选择开始日期" class="query-group-cust" v-model:value="queryParam.ctime" />-->
@@ -193,10 +193,23 @@
   const siteSetEnquiryRef = ref();
   const googleAdsModalRef = ref();
 
-  const isAdmin = computed(() => userStore.getRoleList.includes(RoleEnum.ADMIN));
+  // admin 判断和后端保持一致
+  // src/main/java/org/jeecg/modules/adweb/system/service/impl/SysAdwebApiImpl.java L60
+  // TODO 将此判断加入store,方便所有组件全局调用
+
+  console.log(userStore.getRoleList, '当前用户所属角色');
+  const isAdmin = computed(() => {
+    return (
+      userStore.getRoleList.includes(RoleEnum.ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.SEO_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SITE_MANAGER) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SEO_MANAGER)
+    );
+  });
+
   const { createMessage } = useMessage();
 
-  let channelProviderList = reactive([{ username: '', workNo: '' }]);
   //注册table数据
   const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
     tableProps: {
@@ -239,21 +252,7 @@
 
   // 高级查询配置
   const superQueryConfig = reactive(superQuerySchema);
-  //渠道商搜索
-  const filterOption = (input: string, option: any) => {
-    console.log(option, 'optionoption');
-    return option.key.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-  };
-
-  onBeforeMount(() => {
-    getChannelProvider();
-  });
 
-  function getChannelProvider() {
-    getAction('/adweb/system/getChannelProvider', null).then((res) => {
-      channelProviderList = res.result;
-    });
-  }
   /**
    * 高级查询事件
    */

+ 6 - 11
src/views/adweb/theme/components/AdwebCreateSite.vue

@@ -21,14 +21,9 @@
             您可在“站群管理”中查看建站进度和CNAME
           </a-form-item>
           <a-form-item name="uid" label="用户名称">
-            <a-select
-              v-model:value="createSiteForm.uid"
-              show-search
-              :options="userList"
-              :filter-option="filterOption"
-              :field-names="{ label: 'realname', value: 'id' }"
-              placeholder="请选择用户名称"
-            />
+            <a-select v-model:value="createSiteForm.uid" show-search :filter-option="filterOption" placeholder="请选择用户名称">
+              <a-select-option v-for="item in userList" :key="item.id">{{ item.realname }} => {{ item.username }}</a-select-option>
+            </a-select>
           </a-form-item>
           <a-form-item name="name" label="站点名称">
             <a-input v-model:value="createSiteForm.name" placeholder="请输入站点名称" />
@@ -115,7 +110,7 @@
     getAdwebVipUrl: '/adweb/adwebSiteManage/getAdwebVip',
   });
   const newCreateSiteInfo = ref('');
-  let userList = reactive([{ id: '', realname: '' }]);
+  let userList = reactive([{ id: '', realname: '', username: '' }]);
   let cancelBtnStatus = reactive({});
 
   const ins = ref(0);
@@ -185,7 +180,7 @@
 
   //wp站点创建成功预览
   function toMyWPSite() {
-    return;
+    return (location.href = '/system/adwebSiteList');
   }
 
   //wp站点创建
@@ -212,7 +207,7 @@
           showCreateSite.value = false;
           showResult.value = true;
           modalTitle.value = '系统提示';
-          okText.value = '预览站点';
+          okText.value = '查看站点';
           cancelText.value = '关闭';
           showCreateSite.value = false;
           okBtnStatus = {};

+ 26 - 5
src/views/system/user/user.data.ts

@@ -40,15 +40,25 @@ export const columns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: '部门',
+    title: '所属租户',
     width: 150,
-    dataIndex: 'orgCodeTxt',
+    dataIndex: 'relTenantNames',
   },
   {
-    title: '负责部门',
+    title: '角色',
     width: 150,
-    dataIndex: 'departIds_dictText',
-  },
+    dataIndex: 'roleNames',
+  },
+  // {
+  //   title: '部门',
+  //   width: 150,
+  //   dataIndex: 'orgCodeTxt',
+  // },
+  // {
+  //   title: '负责部门',
+  //   width: 150,
+  //   dataIndex: 'departIds_dictText',
+  // },
   {
     title: '状态',
     dataIndex: 'status_dictText',
@@ -125,6 +135,17 @@ export const searchFormSchema: FormSchema[] = [
     },
     //colProps: { span: 6 },
   },
+  {
+    label: '用户角色',
+    field: 'role',
+    component: 'JDictSelectTag',
+    componentProps: {
+      mode: 'multiple',
+      dictCode: 'sys_role,role_name,id',
+      placeholder: '请选择状态',
+    },
+    //colProps: { span: 6 },
+  },
 ];
 
 export const formSchema: FormSchema[] = [