From f60473bc01862ba1e289e7764f9478b9675e9c68 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期五, 05 八月 2022 09:23:56 +0800 Subject: [PATCH] 对接 --- src/views/goalManagement/performanceAppraisal/component/DailogSearch.vue | 75 ++++++++++++++++++++----------------- 1 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/views/goalManagement/performanceAppraisal/component/DailogSearch.vue b/src/views/goalManagement/performanceAppraisal/component/DailogSearch.vue index 55e13b5..bb63dd6 100644 --- a/src/views/goalManagement/performanceAppraisal/component/DailogSearch.vue +++ b/src/views/goalManagement/performanceAppraisal/component/DailogSearch.vue @@ -7,7 +7,7 @@ <el-row> <el-col :span="12"> <el-form-item size="default"> - <el-input v-model="ruleForm.pass" placeholder="标准标题" /> + <el-input v-model="ruleForm.searchParams.title" placeholder="标准标题" /> </el-form-item> </el-col> <!-- <el-col :span="6" :offset="1"> @@ -17,7 +17,7 @@ </el-col> --> <el-col :span="6" :offset="1"> <el-form-item> - <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button> + <el-button size="default" type="primary" @click="listApi()">查询</el-button> <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button> </el-form-item> </el-col> @@ -35,12 +35,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]" - :small="small" - :disabled="disabled" - :background="background" + :page-sizes="[10, 20, 30, 40]" layout="total, sizes, prev, pager, next, jumper" - :total="400" + :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> @@ -70,46 +67,51 @@ <script lang="ts"> import { defineComponent, reactive, ref } from 'vue'; import { Delete, FullScreen } from '@element-plus/icons-vue'; +import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; +import { goalManagementApi } from '/@/api/goalManagement'; export default defineComponent({ setup() { const dialogVisible = ref<boolean>(false); const openDailog = () => { dialogVisible.value = true; + listApi() }; // 搜索条件 const ruleForm = reactive({ - pass: '', - checkPass: '', + pageSize: 10, + pageIndex: 1, + searchParams: { + title: '', //标准标题 + }, }); - // 表格 - const tableData = [ - { - date: '2016-05-03', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', - }, - { - date: '2016-05-02', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', - }, - { - date: '2016-05-04', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', - }, - { - date: '2016-05-01', - name: 'Tom', - address: 'No. 189, Grove St, Los Angeles', - }, - ]; - const pageSize4 = ref(100); + const listApi = () => { + goalManagementApi() + .getexamineTemplateList(ruleForm) + .then((res) => { + if (res.data.code == 200) { + tableData.value = res.data.data; + currentPage4.value = res.data.pageIndex; + pageSize4.value = res.data.pageSize; + total.value = res.data.total; + } else { + ElMessage.error(res.data.msg); + } + }); + }; + + const tableData = ref(); + const currentPage4 = ref(); + const pageSize4 = ref(); + const total = ref(); const handleSizeChange = (val: number) => { - console.log(`${val} items per page`); + // console.log(`${val} items per page`); + ruleForm.pageSize = val; + listApi(); }; const handleCurrentChange = (val: number) => { - console.log(`current page: ${val}`); + // console.log(`current page: ${val}`); + ruleForm.pageIndex = val; + listApi(); }; // 右方点击添加后显示标签 const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']); @@ -127,10 +129,13 @@ }; return { dialogVisible, + listApi, openDailog, ruleForm, tableData, + currentPage4, pageSize4, + total, handleSizeChange, handleCurrentChange, dynamicTags, -- Gitblit v1.9.2