doum
15 小时以前 af2a56b525dd3b015b34446a2af3e3af3467cd75
admin/src/views/business/deviceBroadcastChannel.vue
@@ -28,6 +28,16 @@
                <el-table-column prop="channelNo" label="通道号"></el-table-column>
                <el-table-column prop="regionName" label="区域名称"></el-table-column>
                <el-table-column prop="hkDate" label="同步时间"></el-table-column>
              <el-table-column
                  label="操作"
                  align="center"
                  min-width="120"
                  fixed="right"
              >
                <template slot-scope="{row}">
                  <el-button type="text" @click="send(row)" icon="el-icon-edit" >发送播报</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
@@ -37,7 +47,24 @@
            </pagination>
        </template>
        <!-- 新建/修改 -->
<!--        <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>-->
      <el-dialog
          :visible.sync="visibleSend"
          style="z-index: 100000"
          append-to-body
          width="50%"
          height="50%"
          :title="'发送播报-'+ form.name"
      >
        <el-form :model="form" ref="form" >
          <el-form-item label="播报内容" prop="name" required>
            <el-input v-model="form.sendInfo" type="textarea" placeholder="请输入播报内容" v-trim/>
          </el-form-item>
        </el-form>
        <template  v-slot:footer  >
          <el-button @click="sendBobao()" type="primary" :loading="isWorkSending">确认</el-button>
          <el-button @click="sendClose()">返回</el-button>
        </template>
      </el-dialog>
    </TableLayout>
</template>
@@ -45,12 +72,11 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaDeviceWindow from '@/components/business/OperaDeviceWindow'
import { syncDevices, updateEntranceById } from '@/api/business/device'
export default {
  name: 'Device',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaDeviceWindow },
  components: { TableLayout, Pagination },
  data () {
    return {
      // 搜索
@@ -61,6 +87,14 @@
        online: '',
        type: 3
      },
      isWorkSending: false,
      form: {
        sendInfo: '',
        id: '',
        hkId: '',
        name: ''
      },
      visibleSend: false,
      options: []
    }
  },
@@ -74,7 +108,36 @@
    this.search()
  },
  methods: {
    changeManufature(e, row) {
    sendBobao () {
      if (!this.form.sendInfo) {
        return
      }
      this.$dialog.actionConfirm('确认进行广播播报吗?', '操作确认提醒')
        .then(() => {
          this.isWorkSending = true
          this.api.sendBobao(this.form)
            .then(res => {
              this.$tip.apiSuccess(res || '播报请求成功')
              this.sendClose()
            })
            .catch(e => {
            })
            .finally(() => {
              this.isWorkSending = false
            })
        })
        .catch(() => {})
    },
    send (row) {
      this.visibleSend = true
      this.form = { sendInfo: '', id: row.id, hkId: row.hkId, name: row.name }
    },
    sendClose () {
      this.visibleSend = false
      this.isWorkSending = false
      this.form = { sendInfo: '', id: '', hkId: '', name: '' }
    },
    changeManufature (e, row) {
      updateEntranceById({
        id: row.id,
        isEntrance: e
@@ -84,13 +147,13 @@
      this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?')
        .then(() => {
          this.isWorking.delete = true
          syncDevices({type: 3})
          syncDevices({ type: 3 })
            .then(res => {
              this.$tip.apiSuccess(res || '同步成功')
              this.search()
            })
            .catch(e => {
             //  this.$tip.apiFailed(e)
              //  this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.isWorking.delete = false