ソースを参照

Merge branch 'feature/mockApi' of http://face3d.4dage.com:7005/zhangyupeng/zfb_mp into feature/mockApi

tangning 3 年 前
コミット
51e5fde66a

+ 4 - 4
src/api/system/system.ts

@@ -77,11 +77,11 @@ export const setRoleStatus = (id: number, status: string) =>
   defHttp.post({ url: Api.setRoleStatus, params: { id, status } });
 
 export const saveRoleApi = (params: SaveRoleParams) =>
-  //TODO 临时deptId调试
-  defHttp.post({ url: Api.saveRole, params: { ...params, deptIdList: [], deptId: 1 } });
-//TODO 临时deptId调试
+  //TODO 临时deptId调试
+  defHttp.post({ url: Api.saveRole, params: params });
+//TODO 临时deptId调试
 export const updateRoleApi = (params: SaveRoleParams) =>
-  defHttp.post({ url: Api.updateRole, params: { ...params, deptIdList: [], deptId: 1 } });
+  defHttp.post({ url: Api.updateRole, params: params });
 
 export const deleteRoleApi = (params: (string | number)[]) =>
   defHttp.post({ url: Api.deleteRole, params: params });

+ 3 - 3
src/components/Form/src/BasicForm.vue

@@ -240,10 +240,10 @@
 
       function setFormModel(key: string, value: any) {
         formModel[key] = value;
-        const { validateTrigger } = unref(getBindValue);
-        // console.log(' unref(getBindValue)', unref(getBindValue));
+        // const { validateTrigger } = unref(getBindValue);
+        // console.log('key', key, schemas[3]);
 
-        console.log('validateTrigger', validateTrigger, formModel);
+        // console.log('validateTrigger', validateTrigger, formModel);
         // if (!validateTrigger || validateTrigger === 'change') {
         //   validateFields([key]).catch((_) => {});
         // }

+ 1 - 6
src/views/dashboard/system/account/account.data.ts

@@ -142,18 +142,13 @@ export const accountFormSchema: FormSchema[] = [
           return new Promise(async (resolve, reject) => {
             try {
               const res = await checkUserApi({
-                phone: value,
+                phone: value || '',
               });
 
               isBoolean(res) && res ? resolve() : reject('用户不存在');
             } catch (error) {
               reject(error.message || '用户不存在');
             }
-
-            //   .then(() => resolve())
-            //   .catch((err) => {
-            //     reject(err.message || '验证失败');
-            //   });
           });
         },
       },

+ 3 - 6
src/views/sys/lock/useNow.ts

@@ -1,11 +1,8 @@
 import { dateUtil } from '/@/utils/dateUtil';
 import { reactive, toRefs } from 'vue';
-import { useLocaleStore } from '/@/store/modules/locale';
 import { tryOnMounted, tryOnUnmounted } from '@vueuse/core';
 
 export function useNow(immediate = true) {
-  const localeStore = useLocaleStore();
-  const localData = dateUtil.localeData(localeStore.getLocale);
   let timer: IntervalHandle;
 
   const state = reactive({
@@ -28,13 +25,13 @@ export function useNow(immediate = true) {
 
     state.year = now.get('y');
     state.month = now.get('M') + 1;
-    state.week = localData.weekdays()[now.day()];
-    state.day = now.get('D');
+    state.week = '星期' + ['日', '一', '二', '三', '四', '五', '六'][now.day()];
+    state.day = now.get('date');
     state.hour = h;
     state.minute = m;
     state.second = s;
 
-    state.meridiem = localData.meridiem(Number(h), Number(h), true);
+    state.meridiem = now.format('A');
   };
 
   function start() {