|
1026 | 1026 | <script> |
1027 | 1027 | import { getDlinkJson } from '@/api/Dlink' |
1028 | 1028 | import { mapGetters, mapMutations } from 'vuex' |
1029 | | - import defaultLogo from '../../../../../public/assets/images/logo/logo.png' |
1030 | 1029 | import { getProtocol } from '@/api/Protocol' |
1031 | 1030 | import { getProduct } from '@/api/Product' |
1032 | 1031 |
|
|
1116 | 1115 | }, |
1117 | 1116 | value: '', |
1118 | 1117 | inputParams: {}, |
| 1118 | + Type: 'addThing', |
1119 | 1119 | dataList: [{}], |
1120 | 1120 | dataType: [], |
1121 | 1121 | options: [ |
|
1321 | 1321 | beforeMount() {}, //生命周期 - 挂载之前 |
1322 | 1322 | beforeUpdate() {}, //生命周期 - 更新之前 |
1323 | 1323 | updated() {}, //生命周期 - 更新之后 |
1324 | | - beforeDestroy() {}, //生命周期 - 销毁之前 |
| 1324 | + beforeDestroy() { |
| 1325 | + this.Type = 'addThing' |
| 1326 | + }, //生命周期 - 销毁之前 |
1325 | 1327 | activated() {}, |
1326 | 1328 | methods: { |
1327 | 1329 | async queryProtocol() { |
|
1561 | 1563 | setProtocol: 'product/setProtocol', |
1562 | 1564 | }), |
1563 | 1565 | changeThing(item) { |
| 1566 | + this.Type = 'showThing' |
1564 | 1567 | console.error(item) |
1565 | 1568 | let that = this |
1566 | 1569 | dgiotlog.log('this.sizeFormaaa', that.$refs.sizeForm.model.name) |
|
1614 | 1617 | isread: item.accessMode, |
1615 | 1618 | isshow: item.isshow, |
1616 | 1619 | isaccumulate: item.isaccumulate, |
| 1620 | + isstorage: item.isstorage, |
1617 | 1621 | identifier: item.identifier, |
1618 | 1622 | } |
1619 | 1623 | if (item.dataForm) { |
|
1623 | 1627 | } |
1624 | 1628 | } else if (item.dataType.type == 'image') { |
1625 | 1629 | obj = { |
| 1630 | + isstorage: item.isstorage, |
1626 | 1631 | name: item.name, |
1627 | 1632 | devicetype: item.devicetype, |
1628 | 1633 | ico: item.ico, |
|
1665 | 1670 | } |
1666 | 1671 | } else if (item.dataType.type == 'bool') { |
1667 | 1672 | obj = { |
| 1673 | + isstorage: item.isstorage, |
1668 | 1674 | name: item.name, |
1669 | 1675 | devicetype: item.devicetype, |
1670 | 1676 | ico: item.ico, |
|
1713 | 1719 | }) |
1714 | 1720 | } |
1715 | 1721 | obj = { |
| 1722 | + isstorage: item.isstorage, |
1716 | 1723 | name: item.name, |
1717 | 1724 | devicetype: item.devicetype, |
1718 | 1725 | ico: item.ico, |
|
1753 | 1760 | } |
1754 | 1761 | } else if (item.dataType.type == 'struct') { |
1755 | 1762 | obj = { |
| 1763 | + isstorage: item.isstorage, |
1756 | 1764 | name: item.name, |
1757 | 1765 | devicetype: item.devicetype, |
1758 | 1766 | ico: item.ico, |
|
1792 | 1800 | } |
1793 | 1801 | } else if (item.dataType.type == 'text') { |
1794 | 1802 | obj = { |
| 1803 | + isstorage: item.isstorage, |
1795 | 1804 | name: item.name, |
1796 | 1805 | devicetype: item.devicetype, |
1797 | 1806 | ico: item.ico, |
|
1831 | 1840 | } |
1832 | 1841 | } else if (item.dataType.type == 'date') { |
1833 | 1842 | obj = { |
| 1843 | + isstorage: item.isstorage, |
1834 | 1844 | name: item.name, |
1835 | 1845 | devicetype: item.devicetype, |
1836 | 1846 | ico: item.ico, |
|
1869 | 1879 | } |
1870 | 1880 | } else if (item.dataType.type == 'file') { |
1871 | 1881 | obj = { |
| 1882 | + isstorage: item.isstorage, |
1872 | 1883 | name: item.name, |
1873 | 1884 | devicetype: item.devicetype, |
1874 | 1885 | ico: item.ico, |
|
1907 | 1918 | } |
1908 | 1919 | } else if (item.dataType.type == 'url') { |
1909 | 1920 | obj = { |
| 1921 | + isstorage: item.isstorage, |
1910 | 1922 | name: item.name, |
1911 | 1923 | devicetype: item.devicetype, |
1912 | 1924 | ico: item.ico, |
|
1945 | 1957 | } |
1946 | 1958 | } else if (item.dataType.type == 'geopoint') { |
1947 | 1959 | obj = { |
| 1960 | + isstorage: item.isstorage, |
1948 | 1961 | name: item.name, |
1949 | 1962 | devicetype: item.devicetype, |
1950 | 1963 | ico: item.ico, |
|
1991 | 2004 | console.log('obj 1944', obj) |
1992 | 2005 | that.setSizeForm(obj) |
1993 | 2006 | this.$nextTick(async () => { |
1994 | | - this.queryResource() |
| 2007 | + await this.queryResource() |
1995 | 2008 | // 保证子组件已经挂载完成) |
1996 | 2009 | // if (this) |
1997 | 2010 | this.resource.value = item.dataForm.protocol |
1998 | 2011 | this.resource.disabled = item.dataForm.protocol.length ? true : false |
1999 | 2012 | // this.changeResource(this.resource.value) |
2000 | | -
|
2001 | | - this.resource.arrlist = _.sortBy(item.dataSource, function (item) { |
2002 | | - return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code |
2003 | | - }) |
| 2013 | + console.log(item.dataSource, 'item.dataSource') |
| 2014 | + this.resource.arrlist = |
| 2015 | + this.Type == 'showThing' |
| 2016 | + ? item.dataSource |
| 2017 | + : _.sortBy(item.dataSource, function (item) { |
| 2018 | + return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code |
| 2019 | + }) |
2004 | 2020 | console.log(this.resource.arrlist, 'arrlist') |
2005 | 2021 | this.$nextTick(() => { |
2006 | 2022 | this.resource.data.forEach((resource, index) => { |
|
0 commit comments