shj
2022-09-20 7df64634d3d7b292713eebfa008c40b3f5f9f65f
src/components/DailogSearchUser/index.vue
@@ -13,24 +13,25 @@
         <el-col :span="14" style="padding: 20px">
            <el-form ref="ruleFormRef" :model="ruleForm" status-icon>
               <el-row>
                  <el-col :span="10" :offset="1">
                  <!-- <el-col :span="10" :offset="1">
                     <el-form-item size="default">
                        <el-input v-model="ruleForm.pass" placeholder="登录名" />
                     </el-form-item>
                  </el-col>
                  </el-col> -->
                  <el-col :span="8" :offset="1">
                     <el-form-item>
                        <el-button size="default" type="primary" >查询</el-button>
                        <el-button size="default">重置</el-button>
                        <!-- <el-button size="default" type="primary" >查询</el-button> -->
                        <el-button size="default" @click="clear">清除选择</el-button>
                     </el-form-item>
                  </el-col>
               </el-row>
            </el-form>
            <el-table :data="tableData" style="width: 100%; margin-top: 20px" @cell-click="radio">
               <el-table-column align="center">
            <el-table :data="tableData" style="width: 100%; margin-top: 20px" ref="clearAll"  @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" v-if="types==0"/>
               <el-table-column align="center"  v-if="types!=0">
                  <template #default="scope">
                     <el-radio-group v-model="radio1">
                        <el-radio :label="scope.row.uid" size="large">{{ null }}</el-radio>
                        <el-radio :label="scope.row.uid" @click="radio(scope.row)" size="large">{{ null }}</el-radio>
                     </el-radio-group>
                  </template>
               </el-table-column>
@@ -44,9 +45,9 @@
               style="padding: 20px 0; border-bottom: 1px solid #dedede"
               v-model:currentPage="currentPage4"
               v-model:page-size="pageSize4"
               :page-sizes="[100, 200, 300, 400]"
               :page-sizes="[10, 20, 30, 40]"
               layout="total, sizes, prev, pager, next, jumper"
               :total="400"
               :total="total"
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
            />
@@ -124,6 +125,7 @@
            .then((res) => {
               if (res.data.code == 200) {
                  tableData.value=res.data.data
                  total.value=tableData.value.length
               }else{
                  ElMessage.error(res.data.msg);
               }
@@ -139,13 +141,16 @@
      });
      // 表格
      const tableData = ref();
      const currentPage4 = ref();
      const pageSize4 = ref();
      const currentPage4 = ref(1);
      const pageSize4 = ref(10);
      const total=ref()
      const handleSizeChange = (val: number) => {
         console.log(`${val} items per page`);
         // console.log(`${val} items per page`);
         pageSize4.value=val
      };
      const handleCurrentChange = (val: number) => {
         console.log(`current page: ${val}`);
         // console.log(`current page: ${val}`);
         currentPage4.value=val
      };
      // 右方点击添加后显示标签
      const dynamicTags = ref(['']);
@@ -154,14 +159,16 @@
         radio1.value = '';
      };
      const radio1 = ref('');
      const radio = (event: any) => {
         dynamicTags.value[0] = event;
      const radio = (data: any) => {
         dynamicTags.value[0] = data;
      };
      const handleSelectionChange = (val:any) => {
             dynamicTags.value=val
        }
      const types=ref()
      // 开启弹窗
      const dialogVisible = ref(false);
      const openDailog = (type:any) => {
         console.log(type)
         types.value=type
         dialogVisible.value = true;
      };
@@ -175,10 +182,25 @@
         }
      };
      const submitForm = () => {
         emit('SearchUser', dynamicTags.value);
         if(types.value==0){
            emit('SearchUser', dynamicTags.value,types.value);
         }else {
            emit('SearchUser', dynamicTags.value[0],types.value);
         }
         dialogVisible.value = false;
         clear()
      };
      const clearAll=ref()
      const clear=()=>{
           dynamicTags.value=[]
         radio1.value=""
        clearAll.value.clearSelection()
      }
      return {
         clear,
         clearAll,
         total,
         types,
         filterText,
         treeRef,
@@ -195,6 +217,7 @@
         pageSize4,
         handleSizeChange,
         handleCurrentChange,
         handleSelectionChange,
         radio1,
         dynamicTags,
         handleClose,