Browse Source

后台新增询盘,开放给管理员和渠道管理员

chenlei1231 4 weeks ago
parent
commit
264287e2fe

+ 15 - 9
src/views/adweb/enquiry/AdwebEnquiryList.vue

@@ -21,7 +21,8 @@
           <a-button :class="queryParam.dateType == 'yesterday' ? 'active' : ''" @click="setTime('yesterday')">昨日 </a-button>
           <a-button :class="queryParam.dateType == 'today' ? 'active' : ''" @click="setTime('today')"> 今日 </a-button>
         </a-col>
-        <a-col :xl="3" :xxl="4">
+
+        <a-col :xl="3" :xxl="4" v-if="isSuperAdmin">
           <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd">新增询盘</a-button>
         </a-col>
       </a-row>
@@ -251,7 +252,7 @@
   import toTotal from '/@/assets/enquiry/enquiryListTop4.svg';
 
   import selectSite from '/@/components/Adweb/selectSite.vue';
-  import { nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
+  import { computed, nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { columns, superQuerySchema } from './AdwebEnquiry.data';
@@ -261,20 +262,25 @@
   import { getAction, postAction } from '@/api/manage/manage';
 
   import { useMessage } from '@/hooks/web/useMessage';
-
-  import dayjs, { Dayjs } from 'dayjs';
-  const dateFormat = 'YYYY-MM-DD';
-  type RangeValue = [Dayjs, Dayjs];
-  // 过滤日期范围
-  let rangeDate = ref<RangeValue>();
-
   import { filterOption } from 'ant-design-vue/es/vc-mentions/src/util';
   import enquiryDetail from '@/views/adweb/enquiry/modules/enquiryDetail.vue';
   import XpRecycleBinModal from '@/views/adweb/system/modules/XpRecycleBinModal.vue';
   import blackList from '@/views/adweb/enquiry/modules/blackList.vue';
   import enquiryTrackRecord from '@/views/adweb/enquiry/modules/enquiryTrackRecord.vue';
+  import { RoleEnum } from '@/enums/roleEnum';
+  import dayjs, { Dayjs } from 'dayjs';
 
+  const dateFormat = 'YYYY-MM-DD';
+  type RangeValue = [Dayjs, Dayjs];
+  // 过滤日期范围
+  let rangeDate = ref<RangeValue>();
+  const userStore = useUserStore();
   const queryParam = reactive<any>({});
+  console.log(userStore.getRoleList, '当前用户所属角色');
+
+  const isSuperAdmin = computed(() => {
+    return userStore.getRoleList.includes(RoleEnum.ADMIN) || userStore.getRoleList.includes(RoleEnum.ADWEB_CHANNEL_ADMIN);
+  });
 
   const registerModal = ref();
   const selectSiteRef = ref(null);

+ 3 - 3
src/views/adweb/site/AdwebSiteList.vue

@@ -173,12 +173,12 @@
 
 <script lang="ts" name="adweb-adwebSite" setup>
   import { computed, onBeforeMount, reactive, ref } from 'vue';
-  import { BasicTable, TableAction } from '/src/components/Table';
-  import { useListPage } from '/src/hooks/system/useListPage';
+  import { BasicTable, TableAction } from '/@/components/Table';
+  import { useListPage } from '/@/hooks/system/useListPage';
   import { columns, superQuerySchema } from './AdwebSite.data';
   import { batchDelete, deleteOne, getExportUrl, getImportUrl, list, saveOrUpdate } from './AdwebSite.api';
   import AdwebSiteModal from './components/AdwebSiteModal.vue';
-  import { useUserStore } from '/src/store/modules/user';
+  import { useUserStore } from '/@/store/modules/user';
   import SeoProcess from '@/views/adweb/site/components/SeoProcess.vue';
   import JInput from '@/components/Form/src/jeecg/components/JInput.vue';
   import JSearchSelect from '@/components/Form/src/jeecg/components/JSearchSelect.vue';