Commit 488e6a488583d4f2238bc5daad2907058e76cd87

Authored by 张红振
1 parent 55e05791

新增下载模板

src/views/community/houses/index.vue
@@ -5,7 +5,7 @@ import { parseTime } from "@/utils/tool.ts"; @@ -5,7 +5,7 @@ import { parseTime } from "@/utils/tool.ts";
5 import Detail from "./detail.vue"; 5 import Detail from "./detail.vue";
6 import BuildOwner from "./buildOwner.vue"; 6 import BuildOwner from "./buildOwner.vue";
7 import Relieve from "./relieve.vue"; 7 import Relieve from "./relieve.vue";
8 -import File from "@/components/FileUpload/index.vue" 8 +import File from "@/components/FileUpload/index.vue";
9 import Pagination from "@/components/Pagination/index.vue"; 9 import Pagination from "@/components/Pagination/index.vue";
10 import { useRoute } from "vue-router"; 10 import { useRoute } from "vue-router";
11 11
@@ -107,6 +107,12 @@ const relieveSuccess = () => { @@ -107,6 +107,12 @@ const relieveSuccess = () => {
107 instance?.proxy?.$message.success("操作成功"); 107 instance?.proxy?.$message.success("操作成功");
108 }; 108 };
109 /** 109 /**
  110 + * 下载模板
  111 + */
  112 +const down = () => {
  113 + window.open(`${import.meta.env.VITE_BASE_URL}house.xlsx`);
  114 +};
  115 +/**
110 * 监听路由参数变换 116 * 监听路由参数变换
111 */ 117 */
112 watchEffect(() => { 118 watchEffect(() => {
@@ -135,10 +141,11 @@ watchEffect(() => { @@ -135,10 +141,11 @@ watchEffect(() => {
135 > 141 >
136 <el-row> 142 <el-row>
137 <el-form-item> 143 <el-form-item>
138 - <!-- <el-button type="primary">导入</el-button>  
139 - <el-button type="primary">导出</el-button> -->  
140 <File url="house/importExcel" method="put" @success="search"></File> 144 <File url="house/importExcel" method="put" @success="search"></File>
141 </el-form-item> 145 </el-form-item>
  146 + <el-form-item>
  147 + <el-button type="success" @click="down">下载模板</el-button>
  148 + </el-form-item>
142 </el-row> 149 </el-row>
143 </el-form> 150 </el-form>
144 151
@@ -173,7 +180,11 @@ watchEffect(() =&gt; { @@ -173,7 +180,11 @@ watchEffect(() =&gt; {
173 >取消绑定</el-button 180 >取消绑定</el-button
174 > 181 >
175 182
176 - <el-button type="text" size="mini" @click="check(scope.row.id)" style="margin-left:10px" 183 + <el-button
  184 + type="text"
  185 + size="mini"
  186 + @click="check(scope.row.id)"
  187 + style="margin-left: 10px"
177 >查看房屋</el-button 188 >查看房屋</el-button
178 > 189 >
179 <router-link 190 <router-link
@@ -182,10 +193,16 @@ watchEffect(() =&gt; { @@ -182,10 +193,16 @@ watchEffect(() =&gt; {
182 query: { houseId: scope.row.id }, 193 query: { houseId: scope.row.id },
183 }" 194 }"
184 > 195 >
185 - <el-button type="text" size="mini" style="margin-left:10px">查看业主</el-button> 196 + <el-button type="text" size="mini" style="margin-left: 10px"
  197 + >查看业主</el-button
  198 + >
186 </router-link> 199 </router-link>
187 200
188 - <el-button type="text" size="mini" @click="remove(scope.row.id)" style="margin-left:10px" 201 + <el-button
  202 + type="text"
  203 + size="mini"
  204 + @click="remove(scope.row.id)"
  205 + style="margin-left: 10px"
189 >删除</el-button 206 >删除</el-button
190 > 207 >
191 </template> 208 </template>
@@ -197,7 +214,7 @@ watchEffect(() =&gt; { @@ -197,7 +214,7 @@ watchEffect(() =&gt; {
197 v-if="data.total > 0" 214 v-if="data.total > 0"
198 :total="data.total" 215 :total="data.total"
199 v-model:currentPage="searchData.page" 216 v-model:currentPage="searchData.page"
200 - v-model:pageSize="searchData.pageSize" 217 + v-model:pageSize="searchData.pageSize"
201 @pageChange="search" 218 @pageChange="search"
202 ></Pagination> 219 ></Pagination>
203 220
src/views/ownerManagement/owner/index.vue
@@ -133,7 +133,12 @@ const changeData: void = () =&gt; { @@ -133,7 +133,12 @@ const changeData: void = () =&gt; {
133 const dialogClose: void = () => { 133 const dialogClose: void = () => {
134 data.currId=null 134 data.currId=null
135 }; 135 };
136 - 136 +/**
  137 + * 下载模板
  138 + */
  139 +const down = () => {
  140 + window.open(`${import.meta.env.VITE_BASE_URL}resident.xls`);
  141 +};
137 /** 142 /**
138 * 监听路由参数变换 143 * 监听路由参数变换
139 */ 144 */
@@ -192,13 +197,11 @@ watchEffect(() =&gt; { @@ -192,13 +197,11 @@ watchEffect(() =&gt; {
192 > 197 >
193 <el-row> 198 <el-row>
194 <el-form-item> 199 <el-form-item>
195 - <!-- <el-button type="primary">导入</el-button>  
196 - <el-button type="primary">导出</el-button>  
197 - <el-button type="primary" @click="data.dialogVisible = true"  
198 - >新增</el-button  
199 - > -->  
200 <File url="resident/poiInsert" method="post" @success="search"></File> 200 <File url="resident/poiInsert" method="post" @success="search"></File>
201 </el-form-item> 201 </el-form-item>
  202 + <el-form-item>
  203 + <el-button type="success" @click="down">下载模板</el-button>
  204 + </el-form-item>
202 </el-row> 205 </el-row>
203 </el-form> 206 </el-form>
204 207