|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
<a-card style="margin-top: 20px;">
|
|
|
<a-row justify="space-between" >
|
|
|
- <a-col :span="20" >
|
|
|
+ <a-col :span="18" >
|
|
|
<a-form layout="inline" >
|
|
|
<a-form-item >
|
|
|
<a-select allowClear style="width: 176px;" v-model:value="searchState.deviceStatus" placeholder="请输入设备状态">
|
|
|
@@ -43,8 +43,11 @@
|
|
|
<a-form-item><a-button type="primary" @click="getDevicePage">搜索</a-button> </a-form-item>
|
|
|
</a-form>
|
|
|
</a-col>
|
|
|
- <a-col :span="2" >
|
|
|
- <a-button type="primary" @click="openModal('add', {})"> + 新增设备</a-button>
|
|
|
+ <a-col :span="4" >
|
|
|
+ <a-space>
|
|
|
+ <a-button type="primary" @click="openModal('add', {})"> + 新增设备</a-button>
|
|
|
+ <a-button @click="exportExcel"> 导出</a-button>
|
|
|
+ </a-space>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
|
|
|
@@ -140,6 +143,7 @@ import { Form, message } from 'ant-design-vue'
|
|
|
import { DeviceAuthTypeEnum } from '@/enum/common'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { DownOutlined } from '@ant-design/icons-vue'
|
|
|
+import { useExportExcel } from '@/hooks'
|
|
|
|
|
|
const useForm = Form.useForm
|
|
|
|
|
|
@@ -265,6 +269,11 @@ const { resetFields: resetFieldsDevice, validate: validateDevice, validateInfos:
|
|
|
deviceCode: [{ required: true, message: '请填写设备码' }]
|
|
|
}))
|
|
|
|
|
|
+const exportExcel = async () => {
|
|
|
+ const { data } = await DeviceContriller.exportDeviceExcel(searchState)
|
|
|
+ useExportExcel(data, '测试')
|
|
|
+}
|
|
|
+
|
|
|
const changePage = ({ current }) => {
|
|
|
searchState.page = current
|
|
|
getDevicePage()
|