index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" v-if="['2','1','3'].includes(routeParams.wildlifeType)" :inline="true"
  4. v-show="showSearch" @submit.native.prevent>
  5. <el-form-item label="动物种类" prop="type">
  6. <treeselect v-model="queryParams.type" :noOptionsText="'空'"
  7. :noResultsText="'空'" :options="cityOptions" placeholder="请选择动物种类" @select="hc"
  8. :disable-branch-nodes="true" style="width: 240px"/>
  9. </el-form-item>
  10. <el-form-item prop="deptId">
  11. <template slot="label">
  12. <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
  13. <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
  14. </template>
  15. <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
  16. placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
  17. <el-input v-model="queryParams.deptName" v-if="false"/>
  18. </el-form-item>
  19. <!-- <el-form-item label="上报设备" prop="deviceList" v-if="['2'].includes(routeParams.wildlifeType)" clearable label-width="120px">
  20. <el-select v-model="queryParams.deviceList" filterable placeholder="请选择上报设备">
  21. <el-option
  22. v-for="dict in monitorList"
  23. :key="dict.id"
  24. :label="dict.cameraName"
  25. :value="dict.id"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>-->
  29. <el-form-item label="出现时间" prop="appearTime" v-if="['2'].includes(routeParams.wildlifeType)"
  30. label-width="120px">
  31. <el-date-picker clearable
  32. v-model="queryParams.appearTime"
  33. type="date"
  34. value-format="yyyy-MM-dd"
  35. placeholder="请选择出现时间">
  36. </el-date-picker>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  40. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-row :gutter="10" class="mb8">
  44. <el-col :span="1.5" v-if="['1'].includes(routeParams.wildlifeType)">
  45. <el-button
  46. type="primary"
  47. plain
  48. icon="el-icon-plus"
  49. size="mini"
  50. @click="handleAdd"
  51. v-hasPermi="['forest:animal:add']"
  52. >新增
  53. </el-button>
  54. </el-col>
  55. <el-col :span="1.5" v-if="['1'].includes(routeParams.wildlifeType)">
  56. <el-button
  57. type="success"
  58. plain
  59. icon="el-icon-edit"
  60. size="mini"
  61. :disabled="single"
  62. @click="handleUpdate"
  63. v-hasPermi="['forest:animal:edit']"
  64. >修改
  65. </el-button>
  66. </el-col>
  67. <el-col :span="1.5" v-if="['1'].includes(routeParams.wildlifeType)">
  68. <el-button
  69. type="danger"
  70. plain
  71. icon="el-icon-delete"
  72. size="mini"
  73. :disabled="multiple"
  74. @click="handleDelete"
  75. v-hasPermi="['forest:animal:remove']"
  76. >删除
  77. </el-button>
  78. </el-col>
  79. <el-col :span="1.5" v-if="[ '2', '3']">
  80. <el-button
  81. type="warning"
  82. plain
  83. icon="el-icon-download"
  84. size="mini"
  85. @click="handleExport"
  86. v-hasPermi="['forest:animal:export']"
  87. >导出
  88. </el-button>
  89. </el-col>
  90. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  91. </el-row>
  92. <el-table v-loading="loading" :data="animalList" @selection-change="handleSelectionChange">
  93. <el-table-column type="selection" width="55" align="center"/>
  94. <el-table-column label="动物种类" align="center" prop="typeLabel"/>
  95. <el-table-column label="所属部门" align="center" prop="deptName"/>
  96. <!-- <el-table-column label="上报设备" align="center" prop="cameraName"-->
  97. <!-- v-if="['2'].includes(routeParams.wildlifeType)"/>-->
  98. <el-table-column label="出现时间" align="center" prop="appearTime"
  99. v-if="['1','2'].includes(routeParams.wildlifeType)"/>
  100. <el-table-column label="出现频次" align="center" prop="frequency"
  101. v-if="['3'].includes(routeParams.wildlifeType)"/>
  102. <el-table-column label="创建人" align="center" prop="createName"
  103. v-if="['1'].includes(routeParams.wildlifeType)"/>
  104. <el-table-column label="创建时间" align="center" prop="createTime"
  105. v-if="['1'].includes(routeParams.wildlifeType)"/>
  106. <el-table-column label="修改人" align="center" prop="updateName"
  107. v-if="['1'].includes(routeParams.wildlifeType)"/>
  108. <el-table-column label="修改时间" align="center" prop="updateTime"
  109. v-if="['1'].includes(routeParams.wildlifeType)"/>
  110. <el-table-column label="操作" align="center" class-name="small-padding fixed-width"
  111. v-if="['1','2'].includes(routeParams.wildlifeType)">
  112. <template slot-scope="scope">
  113. <el-button v-if="['2'].includes(routeParams.wildlifeType)"
  114. size="mini"
  115. type="text"
  116. icon="el-icon-view"
  117. @click="handleDetail(scope.row)"
  118. v-hasPermi="['forest:animal:edit']"
  119. >详情
  120. </el-button>
  121. <el-button v-if="['1'].includes(routeParams.wildlifeType)"
  122. size="mini"
  123. type="text"
  124. icon="el-icon-edit"
  125. @click="handleUpdate(scope.row)"
  126. v-hasPermi="['forest:animal:edit']"
  127. >修改
  128. </el-button>
  129. <el-button v-if="['1'].includes(routeParams.wildlifeType)"
  130. size="mini"
  131. type="text"
  132. icon="el-icon-delete"
  133. @click="handleDelete(scope.row)"
  134. v-hasPermi="['forest:animal:remove']"
  135. >删除
  136. </el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryParams.pageNum"
  144. :limit.sync="queryParams.pageSize"
  145. @pagination="getList"
  146. />
  147. <!-- 添加或修改野生动物监测对话框 -->
  148. <el-dialog :title="title" :visible.sync="open" width="800px" class="form-style">
  149. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  150. <el-row>
  151. <el-col :span="12">
  152. <el-form-item label="动物类型" prop="type">
  153. <treeselect v-model="form.type" :noOptionsText="'空'"
  154. :noResultsText="'空'" :options="cityOptions" placeholder="请选择动物类型" @select="hc"
  155. :disable-branch-nodes="true"/>
  156. </el-form-item>
  157. </el-col>
  158. <el-col :span="12">
  159. <el-form-item label="所属部门" prop="deptId">
  160. <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
  161. placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
  162. </el-form-item>
  163. </el-col>
  164. </el-row>
  165. <el-row>
  166. <el-col :span="12">
  167. <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
  168. <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" :disabled="disabled"/>
  169. </el-form-item>
  170. </el-col>
  171. <el-col :span="12">
  172. <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
  173. <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" :disabled="disabled"/>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. <el-row>
  178. <el-col :span="12">
  179. <el-form-item label="出现时间" prop="appearTime">
  180. <el-date-picker clearable
  181. v-model="form.appearTime"
  182. type="date"
  183. value-format="yyyy-MM-dd"
  184. placeholder="选择出现时间">
  185. </el-date-picker>
  186. </el-form-item>
  187. </el-col>
  188. </el-row>
  189. <el-row>
  190. <el-col :span="24">
  191. <el-form-item label="上报设备" prop="deviceList">
  192. <el-select v-model="form.deviceList" filterable placeholder="请选择上报设备" multiple>
  193. <el-option
  194. v-for="dict in monitorList"
  195. :key="dict.id"
  196. :label="dict.cameraName"
  197. :value="dict.id"
  198. ></el-option>
  199. </el-select>
  200. </el-form-item>
  201. </el-col>
  202. </el-row>
  203. <el-row>
  204. <el-col :span="12">
  205. <el-form-item label="图片" prop="attachId">
  206. <ImageUpload ref="ImageUpload" :limit="1" :fileType="['png', 'jpg', 'jpeg']"
  207. :value="form.attachId"
  208. @input="getUrl"></ImageUpload>
  209. </el-form-item>
  210. </el-col>
  211. </el-row>
  212. </el-form>
  213. <div slot="footer" class="dialog-footer">
  214. <el-button type="primary" @click="submitForm">确 定</el-button>
  215. <el-button @click="cancel">取 消</el-button>
  216. </div>
  217. </el-dialog>
  218. <!-- 野生动物详情对话框 -->
  219. <el-dialog :title="title" :visible.sync="openSee" width="800px" class="form-style">
  220. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  221. <el-row>
  222. <el-col :span="12">
  223. <el-form-item label="动物类型" prop="type">
  224. <treeselect v-model="form.type" :noOptionsText="'空'"
  225. :noResultsText="'空'" :options="cityOptions" placeholder="请选择动物类型" @select="hc"
  226. :disable-branch-nodes="true" :disabled="findView"/>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="12">
  230. <el-form-item label="所属部门" prop="deptName">
  231. <el-input v-model="form.deptName" :disabled="findView"></el-input>
  232. </el-form-item>
  233. </el-col>
  234. </el-row>
  235. <el-row>
  236. <el-col :span="12">
  237. <el-form-item label="经度" prop="longitude" @dblclick.native="showMap" >
  238. <el-input v-model="form.longitude" placeholder="双击选取经度" :disabled="findView"/>
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="12">
  242. <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap" >
  243. <el-input v-model="form.latitude" placeholder="双击选取纬度" :disabled="findView"/>
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. <el-row>
  248. <el-col :span="12">
  249. <el-form-item label="出现时间" prop="appearTime" >
  250. <el-date-picker clearable size="small"
  251. :disabled="findView"
  252. v-model="form.appearTime"
  253. type="date"
  254. value-format="yyyy-MM-dd"
  255. placeholder="选择出现时间">
  256. </el-date-picker>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. <el-row>
  261. <el-col :span="24">
  262. <el-form-item label="上报设备" prop="deviceList">
  263. <el-select v-model="form.deviceList" filterable placeholder="" :disabled="findView" multiple>
  264. <el-option
  265. v-for="dict in monitorList"
  266. :key="dict.id"
  267. :label="dict.cameraName"
  268. :value="dict.id"
  269. ></el-option>
  270. </el-select>
  271. </el-form-item>
  272. </el-col>
  273. </el-row>
  274. <el-row>
  275. <el-col :span="12">
  276. <!-- <el-form-item label="图片" prop="attachId">
  277. <ImageUpload ref="ImageUpload" :limit="1" :fileType="['png', 'jpg', 'jpeg']"
  278. :value="form.attachId"
  279. @input="getUrl"></ImageUpload>
  280. </el-form-item>-->
  281. <el-form-item label="图片" prop="attachId">
  282. <!-- <img-->
  283. <!-- :src="form.picture"-->
  284. <!-- style="display: block; max-width: 100%; margin: 0 auto"-->
  285. <!-- />-->
  286. <img :src="form.attachId" style="width:150px;height:150px;"/>
  287. </el-form-item>
  288. </el-col>
  289. </el-row>
  290. </el-form>
  291. <div slot="footer" class="dialog-footer">
  292. <el-button @click="cancel">取 消</el-button>
  293. </div>
  294. </el-dialog>
  295. <el-dialog :title="titleLongitude" :visible.sync="showLongitude" append-to-body>
  296. <el-input v-show="false" v-model="form.longitude"></el-input>
  297. <el-input v-show="false" v-model="form.latitude"></el-input>
  298. <supermap style="width: 100%;height: 500px;" :mapDiv="'farmMapanimal'" :mapSite="{doubleClickZoom:false}"
  299. :codes="['9fa5']" :isSideBySide="false" :showLatLng="showLatLng"></supermap>
  300. <el-button type="primary" @click="showLongitude=false">确定</el-button>
  301. </el-dialog>
  302. <ISuperMap ref="ISuperMap" v-if="ISuperMapvisible" @send="send"/>
  303. </div>
  304. </template>
  305. <script>
  306. import {
  307. listAnimal,
  308. getAnimal,
  309. delAnimal,
  310. addAnimal,
  311. updateAnimal,
  312. selectCenterMonitorlList,
  313. DictOptions
  314. } from "@/api/data/digitalforest/animal/animal";
  315. import supermap from '@/views/components/supermap'
  316. import deptselector from '@/views/components/deptselector'
  317. import Treeselect from "@riophae/vue-treeselect";
  318. import {treeselect} from '@/api/system/dept'
  319. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  320. import {checkLat, checkLon} from "@/api/rules/rules";
  321. import ISuperMap from "@/views/data/common/ISuperMap";
  322. export default {
  323. components: {
  324. ISuperMap,
  325. deptselector,
  326. supermap,
  327. Treeselect,
  328. },
  329. name: "Animal",
  330. dicts: ['forest_animal'],
  331. data() {
  332. return {
  333. sign: 1,
  334. ISuperMapvisible: false,
  335. disabled: false,
  336. showLongitude: false,
  337. cityOptions:[],
  338. // 部门树选项
  339. deptOptions: undefined,
  340. titleLongitude: '经纬度',
  341. // 遮罩层
  342. loading: true,
  343. // 选中数组
  344. ids: [],
  345. // 非单个禁用
  346. single: true,
  347. // 是否显示提交按钮
  348. submit: false,
  349. // 非多个禁用
  350. multiple: true,
  351. // 显示搜索条件
  352. showSearch: true,
  353. // 总条数
  354. total: 0,
  355. monitorList: [],
  356. // 野生动物监测表格数据
  357. animalList: [],
  358. // 弹出层标题
  359. title: "",
  360. // 是否显示弹出层
  361. open: false,
  362. openSee: false,
  363. // 路由参数
  364. routeParams: {
  365. wildlifeType: null
  366. },
  367. // 查询参数
  368. queryParams: {
  369. pageNum: 1,
  370. pageSize: 10,
  371. dataStatus: null,
  372. type: null,
  373. longitude: null,
  374. latitude: null,
  375. attachId: null,
  376. deptId: null,
  377. deptName: 0,
  378. appearTime: null,
  379. wildlifeType: null,
  380. },
  381. // 表单参数
  382. form: {
  383. dialogImageUrl: '',
  384. imageUrl: ''
  385. },
  386. // 是否禁用弹出层表单
  387. findView: false,
  388. defaultProps: {
  389. children: 'children',
  390. label: 'label'
  391. },
  392. // 表单校验
  393. rules: {
  394. type: [
  395. {required: true, message: '动物类型不能为空', trigger: 'change'}
  396. ],
  397. deptId: [
  398. {required: true, message: '所属部门不能为空', trigger: 'change'}
  399. ],
  400. appearTime: [
  401. {required: true, message: '出现时间不能为空', trigger: 'change'}
  402. ],
  403. longitude: [
  404. {required: true, message: '经度不能为空', trigger: 'change'},
  405. {validator: checkLon, trigger: 'blur'}
  406. ],
  407. latitude: [
  408. {required: true, message: '纬度不能为空', trigger: 'change'},
  409. {validator: checkLat, trigger: 'blur'}
  410. ],
  411. createBy: [
  412. {required: true, message: '上报设备不能为空', trigger: 'change'}
  413. ],
  414. attachId: [
  415. {required: true, message: '图片不能为空', trigger: 'change'}
  416. ]
  417. }
  418. };
  419. },
  420. watch: {
  421. // 根据名称筛选部门树
  422. deptName(val) {
  423. this.$refs.tree.filter(val)
  424. }
  425. },
  426. created() {
  427. // 路由参数 秸秆还田类型
  428. // alert(this.$route.params.wildlifeType)
  429. this.routeParams.wildlifeType = this.$route.query.wildlifeType;
  430. this.getList();
  431. this.getDictselect();
  432. this.getTreeselect();
  433. selectCenterMonitorlList(this.queryParams).then(response => {
  434. this.monitorList = response.data;
  435. });
  436. },
  437. methods: {
  438. hx(node) {
  439. this.form.dataDeptId = node.id
  440. this.form.deptId = node.id
  441. this.form.deptName = node.label
  442. this.$refs.form.validateField("deptId")
  443. },
  444. getDictselect(){
  445. DictOptions().then(response => {
  446. this.cityOptions =response;
  447. });
  448. },
  449. hc(node){
  450. // this.form.occurPlace = node.id
  451. this.form.placeId = node.id
  452. this.form.place = node.label
  453. this.$refs.form.validateField("placeId")
  454. },
  455. showMap() {
  456. this.ISuperMapvisible = true;
  457. this.$nextTick(() => {
  458. this.$refs.ISuperMap.init(this.sign, {
  459. id: this.form.id,
  460. longitude: this.form.longitude,
  461. latitude: this.form.latitude,
  462. xiantude: this.form.longitude//this.form.longitude换成每个页面对应线或者面对应的字段
  463. })
  464. })
  465. },
  466. send(val) {
  467. if (val===true){
  468. this.ISuperMapvisible = false;
  469. return;
  470. }
  471. if (this.sign === 1) {
  472. this.form.longitude = val.longitude;
  473. this.form.latitude = val.latitude;
  474. }
  475. if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;//this.form.longitude 换成对应的线或区域的字段
  476. this.ISuperMapvisible = false
  477. },
  478. setDeptId(deptId) {
  479. this.form.deptId = deptId
  480. },
  481. getUrl(url) {
  482. this.form.dialogImageUrl = url;
  483. this.form.attachId = url;
  484. },
  485. setDataDeptId(e) {
  486. this.form.deptId = e.deptId
  487. this.form.deptName = e.deptName
  488. },
  489. /*hx(node) {
  490. // this.form.deptId = node.id
  491. this.form.deptName = node.label
  492. },
  493. showMap() {
  494. this.showLongitude = true
  495. },*/
  496. showLatLng: function (lat, lng) {
  497. this.form.latitude = lat
  498. this.form.longitude = lng
  499. },
  500. /** 查询部门下拉树结构 */
  501. getTreeselect() {
  502. treeselect().then(response => {
  503. this.deptOptions = response.data;
  504. });
  505. },
  506. /** 查询野生动物监测列表 */
  507. getList() {
  508. this.loading = true;
  509. this.queryParams.wildlifeType = this.$route.query.wildlifeType;// 查询野生动物监测类型
  510. listAnimal(this.queryParams).then(response => {
  511. this.animalList = response.rows;
  512. this.total = response.total;
  513. this.loading = false;
  514. });
  515. },
  516. // 取消按钮
  517. cancel() {
  518. this.open = false;
  519. this.openSee = false;
  520. this.reset();
  521. },
  522. // 表单重置
  523. reset() {
  524. this.form = {
  525. id: null,
  526. createBy: null,
  527. createTime: null,
  528. updateBy: null,
  529. updateTime: null,
  530. dataStatus: "0",
  531. type: null,
  532. longitude: null,
  533. latitude: null,
  534. attachId: null,
  535. deptId: null,
  536. deptName: null,
  537. appearTime: null,
  538. wildlifeType: this.routeParams.wildlifeType
  539. };
  540. this.resetForm("form");
  541. },
  542. /** 搜索按钮操作 */
  543. handleQuery() {
  544. this.queryParams.pageNum = 1;
  545. this.getList();
  546. },
  547. /** 重置按钮操作 */
  548. resetQuery() {
  549. this.queryParams.deptName = 0;
  550. this.resetForm("queryForm");
  551. this.handleQuery();
  552. },
  553. // 多选框选中数据
  554. handleSelectionChange(selection) {
  555. this.ids = selection.map(item => item.id)
  556. this.single = selection.length !== 1
  557. this.multiple = !selection.length
  558. },
  559. /** 新增按钮操作 */
  560. handleAdd() {
  561. selectCenterMonitorlList(this.queryParams).then(response => {
  562. this.monitorList = response.data;
  563. });
  564. this.reset();
  565. this.open = true;
  566. this.submit = true;
  567. this.title = "添加野生动物监测";
  568. },
  569. /** 修改按钮操作 */
  570. handleUpdate(row) {
  571. selectCenterMonitorlList(this.queryParams).then(response => {
  572. this.monitorList = response.data;
  573. });
  574. this.reset();
  575. const id = row.id || this.ids
  576. getAnimal(id).then(response => {
  577. this.form = response.data;
  578. this.open = true;
  579. this.submit = true;
  580. this.title = "修改野生动物监测";
  581. });
  582. },
  583. /** 详情按钮操作 */
  584. handleDetail(row) {
  585. this.reset();
  586. this.findView = true;
  587. selectCenterMonitorlList(this.queryParams).then(response => {
  588. this.monitorList = response.data;
  589. });
  590. const id = row.id || this.ids
  591. getAnimal(id).then(response => {
  592. this.form = response.data;
  593. this.openSee = true;
  594. this.submit = false;
  595. this.title = "野生动物监测详情";
  596. });
  597. },
  598. /** 提交按钮 */
  599. submitForm() {
  600. this.$refs["form"].validate(valid => {
  601. if (valid) {
  602. if (this.form.id != null) {
  603. updateAnimal(this.form).then(response => {
  604. this.$modal.msgSuccess("修改成功");
  605. this.open = false;
  606. this.getList();
  607. });
  608. } else {
  609. addAnimal(this.form).then(response => {
  610. this.$modal.msgSuccess("新增成功");
  611. this.open = false;
  612. this.getList();
  613. });
  614. }
  615. }
  616. });
  617. },
  618. /** 删除按钮操作 */
  619. handleDelete(row) {
  620. const ids = row.id || this.ids;
  621. this.$modal.confirm('是否确认删除选中的数据项?').then(function () {
  622. return delAnimal(ids);
  623. }).then(() => {
  624. this.getList();
  625. this.$modal.msgSuccess("删除成功");
  626. }).catch(() => {
  627. });
  628. },
  629. /** 导出按钮操作 */
  630. handleExport() {
  631. if (this.routeParams.wildlifeType === "1"){
  632. this.title = "野生动物监测";
  633. }
  634. if (this.routeParams.wildlifeType === "2"){
  635. this.title = "监测台账";
  636. }
  637. if (this.routeParams.wildlifeType === "3"){
  638. this.title = "野生动物统计";
  639. }
  640. this.download('center-data/animal/export', {
  641. ...this.queryParams
  642. }, `${this.title}_${new Date().getTime()}.xlsx`)
  643. },
  644. // 点击按钮修改是否只查询本级部门用户
  645. changeQueryType() {
  646. this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
  647. }
  648. }
  649. };
  650. </script>