tangning 1 year ago
parent
commit
fd668e1c59

+ 13 - 4
src/views/productOperation/modal/PowersModal.vue

@@ -43,7 +43,7 @@
   </BasicModal>
   </BasicModal>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
-  import { defineComponent, ref, nextTick, onMounted, reactive } from 'vue';
+  import { defineComponent, ref, computed, onMounted, reactive } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useMessage } from '/@/hooks/web/useMessage';
@@ -54,6 +54,7 @@
   import { usePermissionStore } from '/@/store/modules/permission';
   import { usePermissionStore } from '/@/store/modules/permission';
   import { getAuthList, setAuthType, delAuth } from '/@/api/operate';
   import { getAuthList, setAuthType, delAuth } from '/@/api/operate';
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
   import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
+  import { useUserStore } from '/@/store/modules/user';
   import dayjs from 'dayjs';
   import dayjs from 'dayjs';
   const { t } = useI18n();
   const { t } = useI18n();
   export default defineComponent({
   export default defineComponent({
@@ -115,6 +116,8 @@
         },
         },
       ];
       ];
       const permissionStore = usePermissionStore();
       const permissionStore = usePermissionStore();
+      const userStore = useUserStore();
+      const userName = computed(() => userStore.getUserInfo?.userName);
       const { getCheckPerm } = permissionStore;
       const { getCheckPerm } = permissionStore;
       const { createMessage, createConfirm } = useMessage();
       const { createMessage, createConfirm } = useMessage();
       const [registerTable, { reload, getRawDataSource }] = useTable({
       const [registerTable, { reload, getRawDataSource }] = useTable({
@@ -167,7 +170,7 @@
           },
           },
         },
         },
       ];
       ];
-      const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
+      const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
         labelWidth: 80,
         labelWidth: 80,
         schemas,
         schemas,
         showActionButtonGroup: false,
         showActionButtonGroup: false,
@@ -189,7 +192,12 @@
         resetFields();
         resetFields();
         setFieldsValue({
         setFieldsValue({
           type: data.sceneName,
           type: data.sceneName,
-
+        });
+        updateSchema({
+          field: 'authType',
+          componentProps: {
+            disabled: userName.value != data.userName,
+          },
         });
         });
       }
       }
       const handleSubmit = async () => {
       const handleSubmit = async () => {
@@ -200,7 +208,7 @@
           console.log('res', res);
           console.log('res', res);
           closeModal();
           closeModal();
           resetFields();
           resetFields();
-          createMessage.success('操作成功');
+          createMessage.success('权限设置成功');
           emit('update');
           emit('update');
         } catch (error) {
         } catch (error) {
           console.log('not passing', error);
           console.log('not passing', error);
@@ -241,6 +249,7 @@
         openDetaileModal,
         openDetaileModal,
         addPowes,
         addPowes,
         reload,
         reload,
+        userName,
       };
       };
     },
     },
   });
   });

+ 28 - 28
src/views/statistics/components/sceneEchart.vue

@@ -24,7 +24,7 @@
   const ssobjList = ref<number[]>([]);
   const ssobjList = ref<number[]>([]);
   const yixStringData = ref<string[]>([]);
   const yixStringData = ref<string[]>([]);
   const echartTypr = ref('line')
   const echartTypr = ref('line')
-  const nameList = ref<string[]>(['看见场景',]);//'看看场景','深时场景','深时obj']);
+  const nameList = ref<string[]>(['看见场景','看看场景','深时场景','深时obj']);
   const maxSize = ref(0);
   const maxSize = ref(0);
   const chartRef = ref<HTMLDivElement | null>(null);
   const chartRef = ref<HTMLDivElement | null>(null);
   const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>)
   const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>)
@@ -37,9 +37,9 @@
     let fields  = {
     let fields  = {
     'time':'日期',
     'time':'日期',
     'kj':'看见场景',
     'kj':'看见场景',
-    // 'kk':'看看场景',
-    // 'ss':'深时场景',
-    // 'dy':'深时obj',
+    'kk':'看看场景',
+    'ss':'深时场景',
+    'dy':'深时obj',
     }
     }
     if('场景趋势分析' == fileTile){
     if('场景趋势分析' == fileTile){
       fileTile = `${val && val.value == 0?'新增':'累计'}`+fileTile
       fileTile = `${val && val.value == 0?'新增':'累计'}`+fileTile
@@ -48,9 +48,9 @@
       return {
       return {
         'time':ele,
         'time':ele,
         'kj':kjList.value && kjList.value[index] || 0,
         'kj':kjList.value && kjList.value[index] || 0,
-        // 'kk':kkList.value && kkList.value[index] || 0,
-        // 'ss':ssList.value && ssList.value[index] || 0,
-        // 'dy':ssobjList.value && ssobjList.value[index] || 0,
+        'kk':kkList.value && kkList.value[index] || 0,
+        'ss':ssList.value && ssList.value[index] || 0,
+        'dy':ssobjList.value && ssobjList.value[index] || 0,
       }
       }
     })
     })
     exportElsxFile(data,fields,fileTile)
     exportElsxFile(data,fields,fileTile)
@@ -89,27 +89,27 @@
           barMaxWidth: 80,
           barMaxWidth: 80,
           name: nameList.value[0],
           name: nameList.value[0],
         },
         },
-        // {
-        //   data: kkList.value,
-        //   type: echartTypr.value,
-        //   itemStyle: { color: '#4cca73' },
-        //   barMaxWidth: 80,
-        //   name: nameList.value[1],
-        // },
-        // {
-        //   data: ssList.value,
-        //   type: echartTypr.value,
-        //   itemStyle: { color: '#FDD56A' },
-        //   barMaxWidth: 80,
-        //   name: nameList.value[2],
-        // },
-        // {
-        //   data: ssobjList.value,
-        //   type: echartTypr.value,
-        //   itemStyle: { color: '#d58b55' },
-        //   barMaxWidth: 80,
-        //   name: nameList.value[3],
-        // },
+        {
+          data: kkList.value,
+          type: echartTypr.value,
+          itemStyle: { color: '#4cca73' },
+          barMaxWidth: 80,
+          name: nameList.value[1],
+        },
+        {
+          data: ssList.value,
+          type: echartTypr.value,
+          itemStyle: { color: '#FDD56A' },
+          barMaxWidth: 80,
+          name: nameList.value[2],
+        },
+        {
+          data: ssobjList.value,
+          type: echartTypr.value,
+          itemStyle: { color: '#d58b55' },
+          barMaxWidth: 80,
+          name: nameList.value[3],
+        },
       ],
       ],
     });
     });
   }
   }

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

@@ -44,9 +44,9 @@ async function getList() {
   });
   });
   echartData.xdata = xdata;
   echartData.xdata = xdata;
   echartData.kjList = downlist
   echartData.kjList = downlist
-  // echartData.kkList = kkList.map(ele => ele.count)
-  // echartData.ssList = ssList &&ssList.map(ele => ele.count)|| []
-  // echartData.ssobjList = ssobjList.map(ele => ele.count)|| []
+  echartData.kkList = kkList.map(ele => ele.count)
+  echartData.ssList = ssList &&ssList.map(ele => ele.count)|| []
+  echartData.ssobjList = ssobjList.map(ele => ele.count)|| []
 }
 }
 function Search(val) {
 function Search(val) {
   const { startTime, endTime, dataType, type } = val;
   const { startTime, endTime, dataType, type } = val;

+ 5 - 0
src/views/sys/login/useLogin.ts

@@ -53,6 +53,11 @@ export function useFormRules(formData?: Recordable) {
       if (!value) {
       if (!value) {
         return Promise.reject(t('sys.login.passwordPlaceholder'));
         return Promise.reject(t('sys.login.passwordPlaceholder'));
       }
       }
+      const regPos = /^[^\u4e00-\u9fa5]+$/; // 非中文
+      if (!regPos.test(value)) {
+        /* eslint-disable-next-line */
+        return Promise.reject('请输入正确的密码');
+      }
       // const regPos = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/; // 非中文
       // const regPos = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/; // 非中文
       // if (!regPos.test(value)) {
       // if (!regPos.test(value)) {
       //   /* eslint-disable-next-line */
       //   /* eslint-disable-next-line */