Browse Source

getCheckRole权限修改

tangning 2 years ago
parent
commit
920231c927

+ 9 - 0
src/App.vue

@@ -18,3 +18,12 @@
   // Listening to page changes and dynamically changing site titles
   useTitle();
 </script>
+
+<style lang="less">
+.desc-wrap-BasicTable {
+  background-color: #f0f2f5;
+  .vben-basic-table-form-container {
+    padding: 0;
+  }
+}
+</style>

+ 6 - 1
src/views/anchor/index.vue

@@ -5,6 +5,7 @@
         <a-button
           type="primary"
           @click="handleCreate"
+          v-if="getCheckPerm('application-add')"
           >新增</a-button
         >
       </template>
@@ -14,6 +15,7 @@
           :actions="[
             {
               label: '删除',
+              ifShow: getCheckPerm('application-delete'),
               color: 'error',
               onClick:handDelconfirm.bind(null, record),
             },
@@ -38,6 +40,7 @@
   import { useGo } from '/@/hooks/web/usePage';
   import { Time } from '/@/components/Time';
   import { useUserStore } from '/@/store/modules/user';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -55,6 +58,8 @@
       const [registerDetail, { openModal: openDetaileModal }] = useModal();
       const [registerDelList, { openModal: openDelListeModal }] = useModal();
       const { createConfirm, createMessage } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const userStore = useUserStore();
       // const { getCheckRole } = userStore;
       const roleList = computed(() => userStore.getRoleList);
@@ -201,7 +206,7 @@
         uploadApi: uploadApi as any,
         RoleEnum,
         surplusSubNum,
-        // getCheckRole,
+        getCheckPerm,
       };
     },
   });

+ 4 - 2
src/views/customer/index.vue

@@ -22,21 +22,23 @@
             :actions="[
               {
                 label: '设备',
+                ifShow: getCheckPerm('customer-device'),
                 onClick: handleRouter.bind(null, { type: 'device', id: record.id }),
               },
               {
                 label: '场景',
+                ifShow: getCheckPerm('customer-scenes'),
                 onClick: handleRouter.bind(null, { type: 'scene', id: record.id }),
               },
               {
                 label: '编辑',
-                ifShow: getCheckPerm('company-update'),
+                ifShow: getCheckPerm('customer-update'),
                 onClick: handleEdit.bind(null, record),
               },
               {
                 label: '删除',
                 color: 'error',
-                ifShow: getCheckPerm('company-delete'),
+                ifShow: getCheckPerm('customer-delete'),
                 popConfirm: {
                   title: '是否删除?',
                   confirm: handleDelete.bind(null, record),

+ 1 - 0
src/views/dashboard/analysis/components/lineEcharts.vue

@@ -79,6 +79,7 @@ function handleExport(){
 watch(
   () => props.propsData,
   (propsData) => {
+    console.log('watch',propsData)
     setOptions({
       tooltip: {
         trigger: 'axis',

+ 1 - 5
src/views/dashboard/analysis/index.vue

@@ -5,14 +5,13 @@
       <lineEcharts
         class="md:w-1/2 w-full !md:mt-0 !mt-4 !md:mr-4"
         name="chartRef1"
-        :loading="loading"
         @change="Search"
         :propsData="echartData"
         @export="handleExport"
       />
       <lineEcharts2 name="chartRef2" class="md:w-1/2 mx-4 w-full" @export="handleExport"  @change="Search" :echartData="orderData"  />
     </div>
-    <sceneEchart title="近半年场景新增趋势" class="!my-4 enter-y" @export="handleExport" @change="Search" :echartData="scenetData" :loading="loading" />
+    <sceneEchart title="近半年场景新增趋势" class="!my-4 enter-y" @export="handleExport" @change="Search" :echartData="scenetData" />
     <!-- <SiteAnalysis class="!my-4 enter-y" :loading="loading" /> -->
     <!-- <div class="md:flex enter-y">
       <VisitRadar class="md:w-1/3 w-full" :loading="loading" />
@@ -143,7 +142,6 @@ async function getData() {
 }
 async function getAddUser() {
   let xdata = [], yData=[]
-    loading.value = true;
     const data = await userTrend({...SearchData,type:SearchData.userType});
     data.map(ele => {
       xdata.push(ele.groupKey)
@@ -151,7 +149,6 @@ async function getAddUser() {
     })
     echartData.xData = xdata
     echartData.yData = yData
-    loading.value = false;
 }
 
 
@@ -167,7 +164,6 @@ async function getOrder() {
     orderData.downOrder = downlist
     orderData.incrementOrder = incrementOrder.map(ele => ele.count)
     orderData.partOrder = partOrder &&partOrder.map(ele => ele.count)|| []
-    console.log('getList',orderData)
     loading.value = false;
   }
   async function getSceneList() {

+ 7 - 7
src/views/device/index.vue

@@ -3,9 +3,9 @@
     <div class="desc-wrap-BasicTable">
       <BasicTable @register="registerTable">
         <template #toolbar>
-          <a-button type="primary" @click="put" v-if="getCheckPerm('camera-in')"> 入库</a-button>
-          <a-button type="primary" @click="batchPut" v-if="getCheckPerm('camera-insAndOuts')"> 批量入库</a-button>
-          <a-button type="primary" @click="batchOutflow">批量出库</a-button>
+          <a-button type="primary" @click="put" v-if="getCheckPerm('device-in')"> 入库</a-button>
+          <a-button type="primary" @click="batchPut" v-if="getCheckPerm('device-all-in')"> 批量入库</a-button>
+          <a-button type="primary" @click="batchOutflow" v-if="getCheckPerm('device-all-out')">批量出库</a-button>
         </template>
         <template #action="{ record }">
           <TableAction
@@ -14,19 +14,19 @@
               {
                 label: '删除',
                 color: 'error',
-                ifShow: getCheckPerm('camera-delete') && !Boolean(record.outType),
+                ifShow: getCheckPerm('device-delete') && !Boolean(record.outType),
                 onClick: handleDelete.bind(null, record),
               },{
                 label: '出库',
-                ifShow: getCheckPerm('camera-out') && !Boolean(record.companyName),
+                ifShow: getCheckPerm('device-out') && !Boolean(record.companyName),
                 onClick: handleCheckout.bind(null, record),
               },{
                 label: '编辑',
-                ifShow: getCheckPerm('camera-update') && Boolean(record.companyName),
+                ifShow: getCheckPerm('device-update') && Boolean(record.companyName),
                 onClick: handleEdit.bind(null, record),
               },{
                 label: '解绑',
-                ifShow: getCheckPerm('camera-unbind') && Boolean(record.userName),
+                ifShow: getCheckPerm('device-unbind') && Boolean(record.userName),
                 color: 'error',
                 onClick: handleUnbind.bind(null, record),
               },

+ 6 - 2
src/views/invoice/index.vue

@@ -2,7 +2,7 @@
   <div>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" @click="exportExcel"> 导出</a-button>
+        <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('invoice-export')"> 导出</a-button>
       </template>
       <template #action="{ record }">
           <TableAction
@@ -11,7 +11,7 @@
               {
                 label: '开票登记',
                 icon: 'la:file-invoice-dollar',
-                ifShow:record.invoiced==0,
+                ifShow:getCheckPerm('invoice-checkin') && record.invoiced==0,
                 onClick: handleInvoice.bind(null, record),
               },
               {
@@ -47,6 +47,7 @@
   import { searchForm, columns } from './data'
   import AddModal from './InvoiceModal.vue';
   import EditModal from './EditModal.vue';
+  import { usePermissionStore } from '/@/store/modules/permission';
   interface apiDataParam {
     orderSn?: string;
     payTimeStart?: string;
@@ -69,6 +70,8 @@
     },
     setup() {
       const { t } = useI18n();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const apiData = reactive<apiDataParam>({
         orderSn: '',
         payTimeStart: '',
@@ -162,6 +165,7 @@
         handleEdit,
         headleDetails,
         reload,
+        getCheckPerm,
       };
     },
   });

+ 14 - 3
src/views/operate/agent.vue

@@ -7,9 +7,12 @@
       </a-tabs>
     </template>
 
-    <div class="pt-4 m-4 desc-wrap">
+    <div class="desc-wrap-BasicTable">
       <BasicTable @register="registerTimeTable" >
 
+        <template #toolbar>
+          <a-button type="primary" @click="emailTemplate" v-if="getCheckPerm('agent-set')"> 邮件模板</a-button>
+        </template>
         <template #action="{ record }">
           <TableAction
             stopButtonPropagation
@@ -17,7 +20,7 @@
               {
                 label: '处理',
                 icon: 'icon-park-outline:door-handle',
-                ifShow:record.state == 0,
+                ifShow: getCheckPerm('agent-deal') && record.state == 0,
                 onClick: handleWithdraw.bind(null, record),
               },
             ]"
@@ -38,6 +41,7 @@
   import addMessgeModal from './components/message/addModal.vue'
   import { useModal } from '/@/components/Modal';
   import { agentSchema, refundTimeTableData } from './data';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -57,6 +61,8 @@
     setup() {
       const { t } = useI18n();
       const [register, { openModal }] = useModal();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const state = ref<number>(0); //未处理,0已处理(默认1)
       const searchForm: Partial<FormProps> = {
         labelWidth: 100,
@@ -115,7 +121,7 @@
         actionColumn: {
           width: 100,
           title: '操作',
-          ifShow:state.value == 1,
+          // ifShow:state.value == 1,
           dataIndex: 'action',
           slots: { customRender: 'action' },
         },
@@ -124,6 +130,9 @@
         state.value = val;
         reload();
       }
+      function emailTemplate(){
+        console.log('emailTemplate',val)
+      }
       async function handleWithdraw(record: Recordable) {
         openModal(true,record)
       }
@@ -133,8 +142,10 @@
         changeTable,
         state,
         reload,
+        emailTemplate,
         register,
         openModal,
+        getCheckPerm,
       };
     },
   });

+ 7 - 3
src/views/operate/messageList.vue

@@ -7,7 +7,7 @@
       </a-tabs>
     </template>
 
-    <div class="pt-4 m-4 desc-wrap">
+    <div class="desc-wrap-BasicTable">
       <BasicTable @register="registerTimeTable" >
         
         <template #action="{ record }">
@@ -17,7 +17,7 @@
               {
                 label: '处理',
                 icon: 'icon-park-outline:door-handle',
-                ifShow:record.state == 1,
+                ifShow: getCheckPerm('message-deal') && record.state == 1,
                 onClick: handleWithdraw.bind(null, record),
               },
             ]"
@@ -38,6 +38,7 @@
   import addMessgeModal from './components/message/addModal.vue'
   import { useModal } from '/@/components/Modal';
   import { refundTimeTableSchema, refundTimeTableData } from './data';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -58,6 +59,8 @@
       const { t } = useI18n();
       const [register, { openModal }] = useModal();
       const state = ref<number>(1); //未处理,0已处理(默认1)
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const searchForm: Partial<FormProps> = {
         labelWidth: 100,
         schemas: [
@@ -88,7 +91,7 @@
       };
       const [registerTimeTable,{reload}] = useTable({
         api: intercomMessageList,
-        // title: '',
+        title: '留言列表',
         rowKey: 'id',
         fetchSetting: {
           pageField: 'pageNum',
@@ -127,6 +130,7 @@
         reload,
         register,
         openModal,
+        getCheckPerm,
       };
     },
   });

+ 9 - 4
src/views/operate/newsList.vue

@@ -2,7 +2,7 @@
   <div>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" @click="openModal(true)"> 新增新闻</a-button>
+        <a-button type="primary" @click="openModal(true)" v-if="getCheckPerm('news-add')"> 新增新闻</a-button>
       </template>
         <template #action="{ record }">
           <TableAction
@@ -11,21 +11,22 @@
               {
                 label: '撤回',
                 icon: 'icon-park-outline:folder-withdrawal-one',
-                ifShow:record.isPublic == 1,
+                ifShow:getCheckPerm('news-withdraw') && record.isPublic == 1,
                 onClick: handleWithdraw.bind(null, record),
               },{
                 label: '发布',
                 icon: 'arcticons:efa-publish',
-                ifShow:record.isPublic == 0,
+                ifShow:getCheckPerm('news-publish') && record.isPublic == 0,
                 onClick: handlePublish.bind(null, record),
               },{
                 label: '编辑',
                 icon: 'ep:edit',
-                ifShow:record.isPublic == 0,
+                ifShow:getCheckPerm('news-edit') && record.isPublic == 0,
                 onClick: handleEdit.bind(null, record),
               },{
                 label: '删除',
                 icon: 'ic:outline-delete-outline',
+                ifShow:getCheckPerm('news-delete'),
                 popConfirm: {
                   title: '是否确认删除',
                   confirm: handleDelete.bind(null, record),
@@ -51,6 +52,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { Switch } from 'ant-design-vue';
   import addNewModal from './components/new/addModal.vue'
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: { 
       BasicTable, 
@@ -64,6 +66,8 @@
     setup() {
       const { t } = useI18n();
       const { createMessage } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const [register, { openModal }] = useModal();
       const columns: BasicColumn[] = [
         
@@ -255,6 +259,7 @@
         reload,
         register,
         openModal,
+        getCheckPerm,
       };
     },
   });

+ 3 - 3
src/views/operate/recruitList.vue

@@ -59,14 +59,14 @@
         {
           title: '职位名称',
           dataIndex: 'workName',
-          ellipsis: false,
+          ellipsis: true,
           width: 250,
         },
         {
           title: '工作地点',
           dataIndex: 'workAddress',
-          ellipsis: false,
-          width: 80,
+          ellipsis: true,
+          width: 150,
         },
         {
           title: '薪资待遇',

+ 8 - 3
src/views/operate/sceneList.vue

@@ -7,7 +7,7 @@
       </a-tabs>
     </template>
 
-    <div class="pt-4 m-4 desc-wrap">
+    <div class="desc-wrap-BasicTable">
       <BasicTable @register="registerTimeTable" >
         <template #action="{ record }">
           <TableAction
@@ -16,7 +16,7 @@
               {
                 label: '发送',
                 icon: 'icon-park-outline:door-handle',
-                ifShow:record.state == 0,
+                ifShow: getCheckPerm('apply-send') && record.state == 0,
                 onClick: handleWithdraw.bind(null, record),
               },
             ]"
@@ -39,6 +39,7 @@
   import { useModal } from '/@/components/Modal';
   import { DMegaSchema, refundTimeTableData } from './data';
   import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -59,6 +60,8 @@
       const { t } = useI18n();
       const { createConfirm, createMessage } = useMessage();
       const [register, { openModal }] = useModal();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const state = ref<number>(0); //未处理,0已处理(默认1)
       const searchForm: Partial<FormProps> = {
         labelWidth: 100,
@@ -90,7 +93,7 @@
       };
       const [registerTimeTable,{reload}] = useTable({
         api: sceneApplyList,
-        // title: '',
+        title: '申请列表',
         rowKey: 'id',
         fetchSetting: {
           pageField: 'pageNum',
@@ -147,7 +150,9 @@
         reload,
         register,
         openModal,
+        getCheckPerm,
       };
     },
   });
 </script>
+

+ 5 - 1
src/views/order/cameraList.vue

@@ -1,7 +1,7 @@
 <template>
     <BasicTable @register="registerTable" @row-click="handlerowClick" @expand="handleExpanded">
       <template #toolbar>
-        <a-button type="primary" @click="exportExcel"> 导出</a-button>
+        <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('camera-order-export')"> 导出</a-button>
       </template>
       <template #expandedRowRender="{ record }">
         <div>
@@ -60,6 +60,7 @@
   import { Switch } from 'ant-design-vue';
   import {  downloadByData, } from '/@/utils/file/download';
   import { CameraList,CameraItem, CameraExport } from '/@/api/order'
+  import { usePermissionStore } from '/@/store/modules/permission';
 
   export default defineComponent({
     components: { 
@@ -73,6 +74,8 @@
     setup() {
       const { t } = useI18n();
       const { createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const expandedItem = reactive({
 
       })
@@ -247,6 +250,7 @@
         handlerowClick,
         expandedItem,
         handleExpanded,
+        getCheckPerm,
       };
     },
   });

+ 5 - 1
src/views/order/downloadList.vue

@@ -1,7 +1,7 @@
 <template>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" @click="exportExcel"> 导出</a-button>
+        <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('download-order-export')"> 导出</a-button>
       </template>
       <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'action'">
@@ -38,6 +38,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import { DownList,DownExport } from '/@/api/order'
   import {  downloadByData, } from '/@/utils/file/download';
+  import { usePermissionStore } from '/@/store/modules/permission';
 
   export default defineComponent({
     components: { 
@@ -51,6 +52,8 @@
     setup() {
       const { t } = useI18n();
       const { createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const columns: BasicColumn[] = [
         {
           title: '下单时间',
@@ -199,6 +202,7 @@
         handleDelete,
         handleOpen,
         exportExcel,
+        getCheckPerm,
       };
     },
   });

+ 5 - 1
src/views/order/equityList.vue

@@ -1,7 +1,7 @@
 <template>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" @click="exportExcel"> 导出</a-button>
+        <a-button type="primary" @click="exportExcel" v-if="getCheckPerm('rights-order-export')"> 导出</a-button>
       </template>
       <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'action'">
@@ -38,6 +38,7 @@
   import { useMessage } from '/@/hooks/web/useMessage';
   import {  downloadByData, } from '/@/utils/file/download';
   import { IncrementList,IncrementExport } from '/@/api/order'
+  import { usePermissionStore } from '/@/store/modules/permission';
 
   export default defineComponent({
     components: { 
@@ -51,6 +52,8 @@
     setup() {
       const { t } = useI18n();
       const { createMessage,createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const columns: BasicColumn[] = [
         {
           title: '下单时间',
@@ -196,6 +199,7 @@
         handleDelete,
         handleOpen,
         exportExcel,
+        getCheckPerm,
       };
     },
   });

+ 2 - 2
src/views/product/app/index.vue

@@ -1,7 +1,7 @@
 <template>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" v-if="getCheckPerm('app-add')" @click="()=>{openAddModal(true)}"> 新建</a-button>
+        <a-button type="primary" v-if="getCheckPerm('App-add')" @click="()=>{openAddModal(true)}"> 新建</a-button>
       </template>
         <template #action="{ record }">
           <TableAction
@@ -9,7 +9,7 @@
               {
                 label: '删除',
                 icon: 'ic:outline-delete-outline',
-                ifShow: getCheckPerm('app-delete'),
+                ifShow: getCheckPerm('App-delete'),
                 onClick: handleDelete.bind(null, record),
               },
             ]"

+ 4 - 4
src/views/product/firmware/index.vue

@@ -12,7 +12,7 @@
         <template #toolbar>
           <a-button
             type="primary"
-            v-if="getCheckPerm('version-add')"
+            v-if="getCheckPerm('firmware-add')"
             @click="
               () => {
                 openAddModal(true, searchInfo.type);
@@ -27,13 +27,13 @@
               {
                 label: '编辑',
                 icon: 'ep:edit',
-                ifShow: getCheckPerm('version-update'),
+                ifShow: getCheckPerm('firmware-update'),
                 onClick: handleEdit.bind(null, record),
               },
               {
                 label: '删除',
                 icon: 'ic:outline-delete-outline',
-                ifShow: getCheckPerm('version-delete'),
+                ifShow: getCheckPerm('firmware-delete'),
                 popConfirm: {
                   title: '是否确认删除',
                   confirm: handleDelete.bind(null, record),
@@ -129,7 +129,7 @@ export default defineComponent({
         title: '状态',
         dataIndex: 'status',
         width: 80,
-        ifShow: getCheckPerm('version-enable'),
+        ifShow: getCheckPerm('firmware-enable'),
         customRender: ({ record }) => {
           if (!Reflect.has(record, 'pendingStatus')) {
             record.pendingStatus = false;

+ 10 - 5
src/views/product/sdk/index.vue

@@ -11,7 +11,7 @@
         <template #toolbar>
           <a-button
             type="primary"
-            v-if="getCheckPerm('sdk-add')"
+            v-if="getTypeCheckPerm('sdk-add')"
             @click="
               () => {
                 openAddModal(true, searchInfo.type);
@@ -26,18 +26,18 @@
               {
                 label: '编辑',
                 icon: 'ep:edit',
-                ifShow: getCheckPerm('sdk-update'),
+                ifShow: getTypeCheckPerm('sdk-update'),
                 onClick: handleEdit.bind(null, record),
               },
               {
                 label: '下架',
-                ifShow: getCheckPerm('sdk-update') && record.status == 1,
+                ifShow: getTypeCheckPerm('sdk-update') && record.status == 1,
                 icon: 'akar-icons:statistic-down',
                 onClick: handleOff.bind(null, record),
               },
               {
                 label: '删除',
-                ifShow: getCheckPerm('sdk-delete'),
+                ifShow: getTypeCheckPerm('sdk-delete'),
                 icon: 'ic:outline-delete-outline',
                 popConfirm: {
                   title: '是否确认删除',
@@ -249,6 +249,11 @@ export default defineComponent({
         ...record,
       });
     }
+    
+    function getTypeCheckPerm(val){
+        let myType = searchInfo.type
+        return getCheckPerm(val) || getCheckPerm(`${val}-${myType}`)
+      }
     return {
       registerTimeTable,
       handleDelete,
@@ -260,7 +265,7 @@ export default defineComponent({
       registerEditModal,
       openAddModal,
       handleEdit,
-      getCheckPerm,
+      getTypeCheckPerm,
       t,
       searchInfo,
     };

+ 15 - 8
src/views/productOperation/cameraScene.vue

@@ -23,22 +23,22 @@
             :actions="[
               {
                 label: '迁移',
-                //icon: 'bx:move-horizontal',
-
+                ifShow:getTypeCheckPerm('scenes-move'),
                 onClick: handleMove.bind(null, record),
               },
               {
                 label: '下载',
+                ifShow:getTypeCheckPerm('scenes-download'),
                 disabled:
-                  (record.payStatus - 0 != 1 && record.status - 0 == 0) ||
-                  (record.payStatus - 0 != 1 && record.status - 0 == -1),
+                  (record.payStatus - 0 != 1 && record.status - 0 == 0 ) ||
+                  (record.payStatus - 0 != 1 && record.status - 0 == -1 ),
                 //icon: 'carbon:download',
                 onClick: handleDownload.bind(null, record),
               },
               {
                 label: '重算',
                 disabled: record.payStatus != 1 && record.status - 0 == 0,
-                //icon: 'bx:reset',
+                ifShow:getTypeCheckPerm('scenes-recalculate'),
                 popConfirm: {
                   title: '是否重算?',
                   confirm: handleReset.bind(null, record),
@@ -49,8 +49,7 @@
                 disabled:
                   (record.payStatus != 1 && record.status - 0 == 0) ||
                   (record.payStatus != 1 && record.status - 0 == -1),
-                //icon: 'akar-icons:copy',
-                //onClick: handleCopy.bind(null, record),
+                ifShow:getTypeCheckPerm('scenes-copy'),
                 popConfirm: {
                   title: '是否复制?',
                   confirm: handleCopy.bind(null, record),
@@ -60,6 +59,7 @@
                 label: '删除',
                 //icon: 'ic:outline-delete-outline',
                 color: 'error',
+                ifShow:getTypeCheckPerm('scenes-delete'),
                 //onClick: handleDelete.bind(null, record),
                 popConfirm: {
                   title: '是否删除?',
@@ -115,6 +115,7 @@
     rebuildScene,
   } from '/@/api/operate';
   import { message } from 'ant-design-vue';
+  import { usePermissionStore } from '/@/store/modules/permission';
   import { func } from 'vue-types';
   export default defineComponent({
     components: {
@@ -132,6 +133,8 @@
     setup() {
       const { t } = useI18n();
       const { createMessage, createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const tableType = ref<Recordable>(0); //0看看 、1看见、2深时
       const tabList = ref<Array>(['四维看看', '四维看见', '四维深时', '四维双目Lite']);
       const columns: BasicColumn[] = [
@@ -432,7 +435,10 @@
           })
           .catch(() => {});
       }
-
+      function getTypeCheckPerm(val){
+        let myType = tableType.value
+        return getCheckPerm(val) || getCheckPerm(`${val}-${myType}`)
+      }
       return {
         registerTable,
         handleDelete,
@@ -451,6 +457,7 @@
         canDownload,
         downloadOption,
         cancelDownload,
+        getTypeCheckPerm,
       };
     },
   });

+ 6 - 1
src/views/productOperation/sxz.vue

@@ -13,11 +13,13 @@
         :actions="[
           {
             label: '同屏',
+            ifShow:getCheckPerm('scheme-view'),
             // icon: 'akar-icons:double-check',
           },
           {
             label: '删除',
             // icon: 'ic:outline-delete-outline',
+            ifShow:getCheckPerm('scheme-delete'),
             color: 'error',
             popConfirm: {
               title: '是否删除?',
@@ -55,6 +57,7 @@
     sceneCopy,
   } from '/@/api/operate';
   import { message } from 'ant-design-vue';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -67,7 +70,8 @@
     setup() {
       const { t } = useI18n();
       const { createMessage, createConfirm } = useMessage();
-
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const columns: BasicColumn[] = [
         {
           title: '场景标题',
@@ -257,6 +261,7 @@
         handleMove,
         handleDownload,
         handleReset,
+        getCheckPerm,
       };
     },
   });

+ 5 - 1
src/views/productOperation/viewKankan.vue

@@ -14,6 +14,7 @@
           {
             label: '删除',
             color: 'error',
+            ifShow:getCheckPerm('projects-delete'),
             popConfirm: {
               title: '是否删除?',
               confirm: handleDelete.bind(null, record),
@@ -43,6 +44,7 @@
   import { Switch } from 'ant-design-vue';
   import { overallList, overallDelete } from '/@/api/operate';
   import { message } from 'ant-design-vue';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -55,7 +57,8 @@
     setup() {
       const { t } = useI18n();
       const { createMessage, createConfirm } = useMessage();
-
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const columns: BasicColumn[] = [
         {
           title: '作品标题',
@@ -227,6 +230,7 @@
         handleMove,
         handleDownload,
         handleReset,
+        getCheckPerm,
       };
     },
   });

+ 8 - 2
src/views/staff/list.vue

@@ -5,6 +5,7 @@
         <a-button
           type="primary"
           @click="handleCreate"
+           v-if="getCheckPerm('sysuser-add')"
           >新增</a-button
         >
       </template>
@@ -23,6 +24,7 @@
           :actions="[
             {
               label: '编辑',
+              ifShow:getCheckPerm('sysuser-update'),
               onClick: handleEdit.bind(null, record),
             },
             {
@@ -33,6 +35,7 @@
             {
               label: '删除',
               color: 'error',
+              ifShow:getCheckPerm('sysuser-delete	'),
               popConfirm: {
                 title: '是否确认删除',
                 confirm: handleDelete.bind(null, record),
@@ -66,6 +69,7 @@ import { Switch } from 'ant-design-vue';
   import { useGo } from '/@/hooks/web/usePage';
   import { Time } from '/@/components/Time';
   import { useUserStore } from '/@/store/modules/user';
+  import { usePermissionStore } from '/@/store/modules/permission';
   export default defineComponent({
     components: {
       BasicTable,
@@ -86,7 +90,8 @@ import { Switch } from 'ant-design-vue';
       const [registerDelList, { openModal: openDelListeModal }] = useModal();
       const { createConfirm, createMessage } = useMessage();
       const userStore = useUserStore();
-      // const { getCheckRole } = userStore;
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       const roleList = computed(() => userStore.getRoleList);
       console.log('getRoleList', roleList);
       const go = useGo();
@@ -147,6 +152,7 @@ import { Switch } from 'ant-design-vue';
         },{
         title: '状态',
         dataIndex: 'status',
+        ifShow:getCheckPerm('sysuser-enable'),
         width: 80,
         customRender: ({ record }) => {
           if (!Reflect.has(record, 'status')) {
@@ -323,7 +329,7 @@ import { Switch } from 'ant-design-vue';
         uploadApi: uploadApi as any,
         RoleEnum,
         surplusSubNum,
-        // getCheckRole,
+        getCheckPerm,
         getNumByStaffData,
       };
     },

+ 0 - 2
src/views/statistics/order/index.vue

@@ -30,7 +30,6 @@
   });
   async function getList() {
     let downlist = [],xdata = []
-    loading.value = true;
     const {downOrder,incrementOrder,partOrder} = await orderTrend(SearchData);
     downOrder.map(ele => {
       xdata.push(ele.groupKey)
@@ -40,7 +39,6 @@
     echartData.downOrder = downlist
     echartData.incrementOrder = incrementOrder.map(ele => ele.count)
     echartData.partOrder = partOrder &&partOrder.map(ele => ele.count)|| []
-    loading.value = false;
   }
   function Search(val){
     const {startTime,endTime,dataType,type} = val

+ 0 - 3
src/views/statistics/scene/index.vue

@@ -6,7 +6,6 @@
       class="!my-4 enter-y"
       @change="Search"
       :echartData="echartData"
-      :loading="loading"
     />
   </div>
 </template>
@@ -38,7 +37,6 @@ onMounted(() => {
 async function getList() {
   let downlist = [],
     xdata = [];
-  loading.value = true;
   const {kjList,kkList,ssList,ssobjList} = await sceneTrend({...SearchData,type:SearchData.sceneType});
   kjList.map((ele) => {
     xdata.push(ele.groupKey);
@@ -49,7 +47,6 @@ async function getList() {
   echartData.kkList = kkList.map(ele => ele.count)
   echartData.ssList = ssList &&ssList.map(ele => ele.count)|| []
   echartData.ssobjList = ssobjList.map(ele => ele.count)|| []
-  loading.value = false;
 }
 function Search(val) {
   const { startTime, endTime, dataType, type } = val;

+ 8 - 3
src/views/system/role/index.vue

@@ -2,20 +2,23 @@
   <div>
     <BasicTable @register="registerTable">
       <template #toolbar>
-        <a-button type="primary" @click="handleCreate"> 新增角色 </a-button>
+        <a-button type="primary" @click="handleCreate" v-if="getCheckPerm('role-add')"> 新增角色 </a-button>
       </template>
       <template #action="{ record }">
         <TableAction
           :actions="[
             {
               label: t('common.edit'),
+              ifShow:getCheckPerm('role-update'),
               onClick: handleEdit.bind(null, record),
             },{
               label: t('routes.system.roleBut'),
+              ifShow:getCheckPerm('role-giveMenu'),
               onClick: handleRole.bind(null, record),
             },{
               label: t('common.delText'),
               color: 'error',
+              ifShow:getCheckPerm('role-delete'),
               popConfirm: {
                 title: t('common.delConfirm'),
                 confirm: handleDelete.bind(null, record),
@@ -38,7 +41,7 @@
   import RoleDrawer from './RoleDrawer.vue';
   import TreeModal from './treeModal.vue';
   import { useModal } from '/@/components/Modal';
-
+  import { usePermissionStore } from '/@/store/modules/permission';
   // import { useUserStore } from '/@/store/modules/user';
 
   import { columns, searchFormSchema } from './role.data';
@@ -50,6 +53,8 @@
       const { t } = useI18n();
       const [registerDrawer, { openDrawer }] = useDrawer();
       const [register, { openModal }] = useModal();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
       // const userStore = useUserStore();
       // const { getCheckRole } = userStore;
       const [registerTable, { reload }] = useTable({
@@ -122,7 +127,7 @@
         handleRole,
         register,
         reload,
-        // getCheckRole,
+        getCheckPerm,
         t,
       };
     },

+ 1 - 1
src/views/system/role/role.data.ts

@@ -6,7 +6,7 @@ import { Time } from '/@/components/Time';
 import { getAllRoleList } from '/@/api/sys/system'
 // import { ListAllCompanyApi } from '/@/api/corporation/list';
 import { useI18n } from '/@/hooks/web/useI18n';
-const { t } = useI18n();
+  const { t } = useI18n();
 
 export const columns: BasicColumn[] = [
   {