|
@@ -3,50 +3,40 @@
|
|
|
* SearchFrom.vue
|
|
* SearchFrom.vue
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
- <el-form ref="searchFormRef" :inline="true" :model="searchForm" class="form-inline">
|
|
|
|
|
- <el-form-item label-position="left" prop="queryType">
|
|
|
|
|
|
|
+ <el-form ref="searchFormRef" :inline="true" :model="searchForm" class="form-inline">
|
|
|
|
|
+ <el-form-item label-position="left" prop="queryType">
|
|
|
<el-select v-model="searchForm.queryType" placeholder="选择类型" class="type-select">
|
|
<el-select v-model="searchForm.queryType" placeholder="选择类型" class="type-select">
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in queryTypeSelect"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <el-input
|
|
|
|
|
- :style="{ width: '180px' }"
|
|
|
|
|
- v-model="searchForm.queryTypeContent"
|
|
|
|
|
- clearable
|
|
|
|
|
- placeholder="请输入查找内容"
|
|
|
|
|
- :disabled="!searchForm.queryType"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-option v-for="item in queryTypeSelect" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ :style="{ width: '180px' }"
|
|
|
|
|
+ v-model="searchForm.queryTypeContent"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ placeholder="请输入查找内容"
|
|
|
|
|
+ :disabled="!searchForm.queryType"
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="请选择角色:" label-position="left" prop="roleId">
|
|
|
|
|
|
|
+ <el-form-item label="请选择角色:" label-position="left" prop="roleId">
|
|
|
<el-select v-model="searchForm.roleId" placeholder="请选择角色" class="protocal-select">
|
|
<el-select v-model="searchForm.roleId" placeholder="请选择角色" class="protocal-select">
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in roleData"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-option v-for="item in roleData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="请选择组织:" label-position="left" prop="deptId">
|
|
<el-form-item label="请选择组织:" label-position="left" prop="deptId">
|
|
|
- <el-tree-select
|
|
|
|
|
- v-model="searchForm.deptId"
|
|
|
|
|
- :data="departmentList"
|
|
|
|
|
- :render-after-expand="false"
|
|
|
|
|
- :default-expand-all="true"
|
|
|
|
|
- check-strictly
|
|
|
|
|
- placeholder="请选择组织"
|
|
|
|
|
- class="protocal-select"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-tree-select
|
|
|
|
|
+ v-model="searchForm.deptId"
|
|
|
|
|
+ :data="departmentList"
|
|
|
|
|
+ :render-after-expand="false"
|
|
|
|
|
+ :default-expand-all="true"
|
|
|
|
|
+ check-strictly
|
|
|
|
|
+ placeholder="请选择组织"
|
|
|
|
|
+ class="protocal-select"
|
|
|
|
|
+ />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" :icon="Filter" @click="serachHandle">查询</el-button>
|
|
|
|
|
- <el-button :icon="Refresh" @click="resetFormHandle(searchFormRef)">重置</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="serachHandle">查询</el-button>
|
|
|
|
|
+ <el-button @click="resetFormHandle(searchFormRef)">重置</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
|
|
|
|
+ </el-form>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -55,14 +45,14 @@
|
|
|
import { FormInstance } from 'element-plus';
|
|
import { FormInstance } from 'element-plus';
|
|
|
import { queryTypeSelect } from '../constant';
|
|
import { queryTypeSelect } from '../constant';
|
|
|
import { OptionsProps } from '../types';
|
|
import { OptionsProps } from '../types';
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
interface Props {
|
|
interface Props {
|
|
|
- roleData: OptionsProps[],
|
|
|
|
|
- departmentList: OptionsProps[]
|
|
|
|
|
|
|
+ roleData: OptionsProps[];
|
|
|
|
|
+ departmentList: OptionsProps[];
|
|
|
}
|
|
}
|
|
|
const props = defineProps<Props>();
|
|
const props = defineProps<Props>();
|
|
|
console.log('props: ', props.roleData);
|
|
console.log('props: ', props.roleData);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
interface SearchFromProps {
|
|
interface SearchFromProps {
|
|
|
queryType: string;
|
|
queryType: string;
|
|
|
queryTypeContent: string;
|
|
queryTypeContent: string;
|
|
@@ -74,15 +64,15 @@
|
|
|
queryType: '',
|
|
queryType: '',
|
|
|
queryTypeContent: '',
|
|
queryTypeContent: '',
|
|
|
roleId: '',
|
|
roleId: '',
|
|
|
- deptId: ''
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ deptId: '',
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- // 重置表单
|
|
|
|
|
|
|
+ // 重置表单
|
|
|
const searchFormRef = ref<FormInstance>();
|
|
const searchFormRef = ref<FormInstance>();
|
|
|
const resetFormHandle = (formEl: FormInstance | undefined) => {
|
|
const resetFormHandle = (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
|
formEl?.resetFields();
|
|
formEl?.resetFields();
|
|
|
- searchForm.value.queryTypeContent = ''
|
|
|
|
|
|
|
+ searchForm.value.queryTypeContent = '';
|
|
|
emit('resetForm');
|
|
emit('resetForm');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -100,8 +90,7 @@
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
-
|
|
|
|
|
-.type-select {
|
|
|
|
|
|
|
+ .type-select {
|
|
|
width: 100px;
|
|
width: 100px;
|
|
|
}
|
|
}
|
|
|
|
|
|