jiangping
2024-02-26 8f553085e1f5de85798d7027f8f56b29a1e7f6c1
admin/src/views/business/parks.vue
@@ -23,7 +23,7 @@
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar">
                <li><el-button type="primary">同步</el-button></li>
                <li><el-button type="primary"  v-permissions="['business:hksync:park']"  @click="syncParks()">同步</el-button></li>
            </ul>
            <el-table
                v-loading="isWorking.search"
@@ -49,7 +49,7 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { findList } from '@/api/business/parks'
import {findList, syncParks} from '@/api/business/parks'
export default {
  name: 'Parks',
  extends: BaseTable,
@@ -75,6 +75,24 @@
    this.getfindList()
  },
  methods: {
    syncParks(){
      this.$dialog.actionConfirm("操作确认提醒","您确认同步全部信息吗?")
          .then(() => {
            this.isWorking.delete = true
            this.api.syncParks({})
                .then(res => {
                  this.$tip.apiSuccess(res || '同步成功')
                  this.__afterDelete()
                })
                .catch(e => {
                  this.$tip.apiFailed(e)
                })
                .finally(() => {
                  this.isWorking.delete = false
                })
          })
          .catch(() => {})
    },
    getfindList () {
      findList({})
        .then(res => {