index.vue 23 KB

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