Commit 488e6a488583d4f2238bc5daad2907058e76cd87

Authored by 张红振
1 parent 55e05791

新增下载模板

src/views/community/houses/index.vue
... ... @@ -5,7 +5,7 @@ import { parseTime } from "@/utils/tool.ts";
5 5 import Detail from "./detail.vue";
6 6 import BuildOwner from "./buildOwner.vue";
7 7 import Relieve from "./relieve.vue";
8   -import File from "@/components/FileUpload/index.vue"
  8 +import File from "@/components/FileUpload/index.vue";
9 9 import Pagination from "@/components/Pagination/index.vue";
10 10 import { useRoute } from "vue-router";
11 11  
... ... @@ -107,6 +107,12 @@ const relieveSuccess = () => {
107 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 118 watchEffect(() => {
... ... @@ -135,10 +141,11 @@ watchEffect(() => {
135 141 >
136 142 <el-row>
137 143 <el-form-item>
138   - <!-- <el-button type="primary">导入</el-button>
139   - <el-button type="primary">导出</el-button> -->
140 144 <File url="house/importExcel" method="put" @success="search"></File>
141 145 </el-form-item>
  146 + <el-form-item>
  147 + <el-button type="success" @click="down">下载模板</el-button>
  148 + </el-form-item>
142 149 </el-row>
143 150 </el-form>
144 151  
... ... @@ -173,7 +180,11 @@ watchEffect(() =&gt; {
173 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 188 >查看房屋</el-button
178 189 >
179 190 <router-link
... ... @@ -182,10 +193,16 @@ watchEffect(() =&gt; {
182 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 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 206 >删除</el-button
190 207 >
191 208 </template>
... ... @@ -197,7 +214,7 @@ watchEffect(() =&gt; {
197 214 v-if="data.total > 0"
198 215 :total="data.total"
199 216 v-model:currentPage="searchData.page"
200   - v-model:pageSize="searchData.pageSize"
  217 + v-model:pageSize="searchData.pageSize"
201 218 @pageChange="search"
202 219 ></Pagination>
203 220  
... ...
src/views/ownerManagement/owner/index.vue
... ... @@ -133,7 +133,12 @@ const changeData: void = () =&gt; {
133 133 const dialogClose: void = () => {
134 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 197 >
193 198 <el-row>
194 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 200 <File url="resident/poiInsert" method="post" @success="search"></File>
201 201 </el-form-item>
  202 + <el-form-item>
  203 + <el-button type="success" @click="down">下载模板</el-button>
  204 + </el-form-item>
202 205 </el-row>
203 206 </el-form>
204 207  
... ...