DESKTOP-SVI9JE1\muzen 1 yıl önce
ebeveyn
işleme
2e4699a6b8
1 değiştirilmiş dosya ile 94 ekleme ve 18 silme
  1. 94 18
      src/mixin/index.js

+ 94 - 18
src/mixin/index.js

@@ -1,19 +1,14 @@
-import {
-  getClientTypeList
-} from '@/api/device/version'
+import { getClientTypeList } from '@/api/device/version'
 
-import {
-  platform,
-  audioType
-} from '@/api/music/platform'
+import { platform, audioType } from '@/api/music/platform'
 
-import {
-  options
-} from '@/api/music/radio'
+import { options } from '@/api/music/radio'
 
-import {
-  channelTemplate
-} from '@/api/operation/channel'
+import { channelTemplate } from '@/api/operation/channel'
+
+import { list as categoryList } from '@/api/device/category'
+
+import { list as functionList } from '@/api/device/function'
 
 // 设备列表
 const devMixin = {
@@ -40,18 +35,95 @@ const devMixin = {
 const devModeMixin = {
   data() {
     return {
-      modeOptions: [{
+      devModeOptions: [{
         value: 1,
-        label: '蓝牙'
+        label: '蓝牙',
+        disabled: false
       }, {
         value: 2,
-        label: 'WIFI'
+        label: 'WIFI',
+        disabled: false
       }, {
         value: 3,
-        label: '传统蓝牙'
+        label: '传统蓝牙',
+        disabled: false
       }, {
         value: 4,
-        label: '4G'
+        label: '4G',
+        disabled: false
+      }]
+    }
+  }
+}
+
+// 设备分类
+const devCategoryMixin = {
+  data() {
+    return {
+      categoryOptions: []
+    }
+  },
+  mounted() {
+    categoryList().then(res => {
+      res.data.map(i => {
+        this.categoryOptions.push({
+          value: i.id,
+          label: i.name
+        })
+      })
+    })
+  }
+}
+
+// 设备类型
+const devTypeMixin = {
+  data() {
+    return {
+      devTypeOptions: [{
+        value: 0,
+        label: '音响'
+      }, {
+        value: 1,
+        label: '耳机'
+      }, {
+        value: 2,
+        label: '穿戴'
+      }]
+    }
+  }
+}
+
+// 功能权限
+const devFucMixin = {
+  data() {
+    return {
+      devFucOptions: []
+    }
+  },
+  mounted() {
+    functionList().then(res => {
+      if (res.code === 0) {
+        res.data.map(i => {
+          this.devFucOptions.push({
+            value: i.id,
+            label: i.name
+          })
+        })
+      }
+    })
+  }
+}
+
+// 是否
+const yesOrNoMixin = {
+  data() {
+    return {
+      yesOrNoOptions: [{
+        value: 0,
+        label: '否'
+      }, {
+        value: 1,
+        label: '是'
       }]
     }
   }
@@ -550,6 +622,10 @@ const systemMixin = {
 export {
   devMixin,
   devModeMixin,
+  devCategoryMixin,
+  devTypeMixin,
+  devFucMixin,
+  yesOrNoMixin,
   serviceTimeMixin,
   serviceTypeMixin,
   isFreeMixin,