rev 区域筛选
This commit is contained in:
@@ -26,9 +26,29 @@
|
||||
>
|
||||
<el-option v-for="item in device_types" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.region"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
placeholder="区域名称"
|
||||
class="filter-item"
|
||||
style="width: 190px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in regions" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="crud.doExport"
|
||||
>导出模型</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -174,6 +194,8 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { get } from '@/api/system/dictDetail'
|
||||
import UploadDialog from '@/views/acs/device/UploadDialog'
|
||||
import {download} from '@/api/data'
|
||||
import {downloadFile} from '@/utils'
|
||||
|
||||
const defaultForm = {
|
||||
manufacturer: null,
|
||||
@@ -192,7 +214,8 @@ const defaultForm = {
|
||||
device_type: null,
|
||||
region: null,
|
||||
is_config: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
region: null
|
||||
}
|
||||
export default {
|
||||
name: 'Device',
|
||||
@@ -215,7 +238,9 @@ export default {
|
||||
del: ['admin', 'device:del']
|
||||
},
|
||||
device_types: [],
|
||||
regions: [],
|
||||
uploadShow: false,
|
||||
|
||||
regions: [],
|
||||
rules: {
|
||||
device_code: [
|
||||
@@ -226,8 +251,10 @@ export default {
|
||||
],
|
||||
device_type: [
|
||||
{ required: true, message: '设备类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
region: [
|
||||
{ required: true, message: '所属区域不能为空', trigger: 'blur' }
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -238,7 +265,7 @@ export default {
|
||||
this.device_types = data.content
|
||||
})
|
||||
// 获取区域类型
|
||||
get('region_type').then(data => {
|
||||
get('region').then(data => {
|
||||
this.regions = data.content
|
||||
})
|
||||
})
|
||||
@@ -257,6 +284,16 @@ export default {
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
downloadMethod() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
download(this.url + 'api/device/download', this.params).then(result => {
|
||||
downloadFile(result, this.title + '数据', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user