| | |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="部门名称" prop="deptName"> |
| | | <el-input |
| | | v-model="queryParams.deptName" |
| | | v-model.trim="queryParams.deptName" |
| | | placeholder="请输入部门名称" |
| | | clearable |
| | | style="width: 200px" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:dept:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Sort" |
| | | @click="toggleExpandAll" |
| | | >展开/折叠</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <!-- <el-row :gutter="10" class="mb8">--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="primary"--> |
| | | <!-- plain--> |
| | | <!-- icon="Plus"--> |
| | | <!-- @click="handleAdd"--> |
| | | <!-- v-hasPermi="['system:dept:add']"--> |
| | | <!-- >新增</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="info"--> |
| | | <!-- plain--> |
| | | <!-- icon="Sort"--> |
| | | <!-- @click="toggleExpandAll"--> |
| | | <!-- >展开/折叠</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>--> |
| | | <!-- </el-row>--> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部门名称" prop="deptName"> |
| | | <el-input v-model="form.deptName" placeholder="请输入部门名称" /> |
| | | <el-input v-model.trim="form.deptName" placeholder="请输入部门名称" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="显示排序" prop="orderNum"> |
| | | <el-input-number v-model="form.orderNum" controls-position="right" :min="0" /> |
| | | <el-input-number v-model.trim="form.orderNum" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人" prop="leader"> |
| | | <el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" /> |
| | | <el-input v-model.trim="form.leader" placeholder="请输入负责人" maxlength="20" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话" prop="phone"> |
| | | <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" /> |
| | | <el-input v-model.trim="form.phone" placeholder="请输入联系电话" maxlength="11" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="邮箱" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" /> |
| | | <el-input v-model.trim="form.email" placeholder="请输入邮箱" maxlength="50" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | |
| | | <script setup name="Dept"> |
| | | import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"; |
| | | |
| | | import {onMounted,ref} from "vue"; |
| | | import {parseTime} from "@/utils/ruoyi"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); |
| | | |
| | | const deptList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const loading = ref(false); |
| | | const showSearch = ref(true); |
| | | const title = ref(""); |
| | | const deptOptions = ref([]); |
| | |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | onMounted(()=>{ |
| | | getList() |
| | | }) |
| | | |
| | | /** 查询部门列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listDept(queryParams.value).then(response => { |
| | | deptList.value = proxy.handleTree(response.data, "deptId"); |
| | | deptList.value = proxy.handleTree(response.data, "deptId",'parentId','children'); |
| | | loading.value = false; |
| | | }); |
| | | } |
| | |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |