Bläddra i källkod

fix(bugs): 修改token

tangning 3 år sedan
förälder
incheckning
d83f238db9

+ 10 - 2
src/components/Form/src/components/ApiSelect.vue

@@ -2,7 +2,9 @@
   <Select
     @dropdown-visible-change="handleFetch"
     v-bind="$attrs"
+    show-search
     @change="handleChange"
+    :filter-option="filterOption"
     :options="getOptions"
     v-model:value="state"
   >
@@ -67,7 +69,13 @@
       const emitData = ref<any[]>([]);
       const attrs = useAttrs();
       const { t } = useI18n();
-
+      const filterOption = (input, option) => {
+        try {
+          return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+        } catch (error) {
+          return false;
+        }
+      };
       // Embedded in the form, just use the hook binding to perform form verification
       const [state] = useRuleFormItem(props, 'value', 'change', emitData);
 
@@ -140,7 +148,7 @@
         emitData.value = args;
       }
 
-      return { state, attrs, getOptions, loading, t, handleFetch, handleChange };
+      return { state, attrs, getOptions, loading, t, handleFetch, handleChange, filterOption };
     },
   });
 </script>

+ 1 - 0
src/store/modules/user.ts

@@ -64,6 +64,7 @@ export const useUserStore = defineStore({
   actions: {
     setToken(info: string | undefined) {
       this.token = info ? info : ''; // for null or undefined value
+      localStorage.setItem('token', this.token);
       setAuthCache(TOKEN_KEY, info);
     },
     setRoleList(roleList: RoleEnum[]) {

+ 15 - 6
src/views/scenes/bindModal.vue

@@ -23,7 +23,8 @@
           <div>
             <Switch
               :disabled="!SelectRowsList.includes(record.id)"
-              v-model:checked="record.canShow"
+              v-model:checked="checkedObj[record.id]"
+              @change="onchange(record)"
               :checkedChildren="t('layout.setting.on')"
               :unCheckedChildren="t('layout.setting.off')"
             />
@@ -123,6 +124,7 @@
         return key === 1 ? true : false;
       });
       const checked = ref<boolean>(false);
+      const checkedObj = ref({});
       const headerInfo = reactive<Recordable>({});
       const searchInfo = reactive<Recordable>({});
 
@@ -143,10 +145,11 @@
         useSearchForm: false,
         // formConfig: searchForm,
         showTableSetting: false,
+        maxHeight: 600,
         tableSetting: { fullScreen: true },
         showIndexColumn: false,
-        immediate: true,
-        isCanResizeParent: true,
+        // immediate: true,
+        // isCanResizeParent: true,
         rowKey: 'id',
         pagination: false,
         clickToRowSelect: false,
@@ -154,7 +157,8 @@
         afterFetch: (data) => {
           let bindIds = [];
           data.map((i) => {
-            i.canShow = i.canShow === 1 ? true : false;
+            i.canShow = i.canShow == 1 ? true : false;
+            checkedObj.value[i.id] = i.canShow;
             if (i.isBind === 1) {
               bindIds.push(i.id);
             }
@@ -184,7 +188,7 @@
           const rows = getSelectRows();
           // const rawData = getRawDataSource();
           let paramsRow: bindAnchorListParam[];
-          console.log('rawData', 'rows', rows, rows?.length);
+          console.log('rawData', 'rows', rows, checkedObj.value);
           // if (rows?.length > 0) {
           //   paramsRow = rows.map((row) => {
           //     return {
@@ -199,7 +203,7 @@
           // } else {
           paramsRow = rows.map((item) => {
             let param: bindAnchorListParam = {};
-            param.canShow = item.canShow ? 1 : 0;
+            param.canShow = checkedObj.value[item.id] ? 1 : 0;
             param.type = 1;
             param.brandId = searchInfo.brandId;
             param.userId = String(item.id);
@@ -228,6 +232,9 @@
         // updateTableDataRecord('canShow', values);
         // updateTableDataRecord
       };
+      const onchange = (val, row) => {
+        console.log('val,row', val, row, checkedObj.value);
+      };
       return {
         register,
         schemas,
@@ -243,6 +250,8 @@
         checked,
         SelectRowsList,
         mapCheckedValue,
+        checkedObj,
+        onchange,
       };
     },
   });

+ 2 - 2
src/views/staff/delListModal.vue

@@ -9,7 +9,7 @@
     <div class="pt-3px pr-3px">
       <BasicForm @register="registerForm">
         <template #tips>
-          <div>请将当前员工的直播间进行迁移后,在删除员工</div>
+          <div>请将当前员工的直播间数据进行迁移后,再删除员工</div>
         </template>
       </BasicForm>
     </div>
@@ -41,7 +41,7 @@
         {
           field: 'toUserPhone',
           component: 'Select',
-          label: '员工名称',
+          label: '选择迁移的员工',
           required: true,
           itemProps: {
             validateTrigger: 'blur',

+ 1 - 0
src/views/staff/detailsModal.vue

@@ -116,6 +116,7 @@
           ifShow: getCheckRole('plat_admin'),
           componentProps: {
             api: ListAllCompanyApi,
+            showSearch: true,
             resultField: 'list',
             labelField: 'name',
             valueField: 'id',