| xqd
@@ -2,6 +2,7 @@
|
|
|
import http from '../../utils/http'
|
|
|
import util from '../../utils/util'
|
|
|
import api from '../../utils/api'
|
|
|
+import { baseUrl } from '../../utils/env'
|
|
|
|
|
|
Page({
|
|
|
|
| xqd
@@ -30,13 +31,23 @@ Page({
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
var that = this
|
|
|
- api.getByName(this, 'devices/getThreeLevel', 'device_types', {
|
|
|
- type: 'drop_menu'
|
|
|
- }, function () {
|
|
|
- that.updateNameSpec()
|
|
|
- });
|
|
|
+ // api.getByName(this, 'devices/getThreeLevel', 'device_types', {
|
|
|
+ // type: 'drop_menu'
|
|
|
+ // }, function () {
|
|
|
+ // that.updateNameSpec()
|
|
|
+ // });
|
|
|
// api.getByName(this, 'inner-devices/get', 'names', {type: 'drop_menu'});
|
|
|
// api.getByName(this, 'specs/get', 'specs', {type: 'drop_menu'});
|
|
|
+ http({
|
|
|
+ url: "inner-devices/getDeviceName",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.setData({
|
|
|
+ names: res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.getList()
|
|
|
},
|
|
|
|
| xqd
@@ -118,27 +129,37 @@ Page({
|
|
|
},
|
|
|
|
|
|
onChange: function (e) {
|
|
|
- var name = e.currentTarget.dataset.name
|
|
|
this.setData({
|
|
|
- [name]: e.detail
|
|
|
+ spec: e.detail,
|
|
|
+ list: [],
|
|
|
+ page: 1,
|
|
|
+ touchBottom: false
|
|
|
+ })
|
|
|
+ // if (['type', 'name'].indexOf(name) != -1) {
|
|
|
+ // if (name == 'type') {
|
|
|
+ // this.setData({
|
|
|
+ // name: '',
|
|
|
+ // spec: ''
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // if (name == 'name') {
|
|
|
+ // this.setData({
|
|
|
+ // spec: ''
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // this.updateNameSpec()
|
|
|
+ // }
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ onsearch(e){
|
|
|
+ this.setData({
|
|
|
+ number: e.detail,
|
|
|
+ list: [],
|
|
|
+ page: 1,
|
|
|
+ touchBottom: false
|
|
|
})
|
|
|
- if (['type', 'name'].indexOf(name) != -1) {
|
|
|
- if (name == 'type') {
|
|
|
- this.setData({
|
|
|
- name: '',
|
|
|
- spec: ''
|
|
|
- })
|
|
|
- }
|
|
|
- if (name == 'name') {
|
|
|
- this.setData({
|
|
|
- spec: ''
|
|
|
- })
|
|
|
- }
|
|
|
- this.updateNameSpec()
|
|
|
- }
|
|
|
this.search()
|
|
|
},
|
|
|
-
|
|
|
resetList: function () {
|
|
|
this.setData({
|
|
|
list: [],
|
| xqd
@@ -158,9 +179,9 @@ Page({
|
|
|
url: 'inner-devices/search',
|
|
|
data: {
|
|
|
number: this.data.number,
|
|
|
- device_id: this.data.type,
|
|
|
- device_name_id: this.data.name,
|
|
|
- spec_id: this.data.spec,
|
|
|
+ // device_id: this.data.type,
|
|
|
+ // device_name_id: this.data.name,
|
|
|
+ device_name_id: this.data.spec,
|
|
|
page: this.data.page,
|
|
|
status: 'free'
|
|
|
},
|