|
@@ -84,9 +84,9 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { List, Delete, upDown } from '@/api/device/list'
|
|
|
|
|
|
+import { list, remove, change } from '@/api/device/list'
|
|
import { devMixin, onOrOffMixin } from '@/mixin/index'
|
|
import { devMixin, onOrOffMixin } from '@/mixin/index'
|
|
-import { categoryList } from "@/api/device/category";
|
|
|
|
|
|
+import { list as classList } from "@/api/device/class";
|
|
export default {
|
|
export default {
|
|
mixins: [devMixin, onOrOffMixin],
|
|
mixins: [devMixin, onOrOffMixin],
|
|
data() {
|
|
data() {
|
|
@@ -131,13 +131,13 @@ export default {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getList()
|
|
this.getList()
|
|
- this.getCategory()
|
|
|
|
|
|
+ this.getClass()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 列表
|
|
// 列表
|
|
getList() {
|
|
getList() {
|
|
this.loading = true
|
|
this.loading = true
|
|
- List(this.form).then(res => {
|
|
|
|
|
|
+ list(this.form).then(res => {
|
|
this.tableData = res.data.records
|
|
this.tableData = res.data.records
|
|
this.total = res.data.total
|
|
this.total = res.data.total
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -167,8 +167,8 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
// 设备分类
|
|
// 设备分类
|
|
- getCategory() {
|
|
|
|
- categoryList().then(res => {
|
|
|
|
|
|
+ getClass() {
|
|
|
|
+ classList().then(res => {
|
|
this.categoryOptions = res.data
|
|
this.categoryOptions = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -180,7 +180,7 @@ export default {
|
|
}
|
|
}
|
|
let title = key === 1 ? '上架' : '下架'
|
|
let title = key === 1 ? '上架' : '下架'
|
|
this.changeForm.type = key
|
|
this.changeForm.type = key
|
|
- upDown(this.changeForm).then(res => {
|
|
|
|
|
|
+ change(this.changeForm).then(res => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success(`${title}成功!`)
|
|
this.$message.success(`${title}成功!`)
|
|
this.getList()
|
|
this.getList()
|
|
@@ -217,7 +217,7 @@ export default {
|
|
this.$confirm('确定要删除?', {
|
|
this.$confirm('确定要删除?', {
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- Delete(id).then(res => {
|
|
|
|
|
|
+ remove(id).then(res => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.getList()
|
|
this.getList()
|
|
this.$message.success('删除成功!')
|
|
this.$message.success('删除成功!')
|