Compare commits

...

4 Commits

Author SHA1 Message Date
xiaomeng 8261f38e9a Merge pull request 'pc-master' (#176) from pc-master into portal
Reviewed-on: #176
2024-09-28 00:41:22 +00:00
sunmeng 33d3afe964 1 2024-09-27 17:20:50 +08:00
sunmeng c2fb01610f 1 2024-09-27 17:00:48 +08:00
sunmeng 82b23d3247 1 2024-09-27 15:59:51 +08:00
2 changed files with 12 additions and 7 deletions

View File

@ -222,6 +222,7 @@ export default {
dataSel: '', dataSel: '',
store: this.$store.state, store: this.$store.state,
loading:null, loading:null,
numlist:[],
} }
}, },
watch: { watch: {
@ -309,14 +310,17 @@ export default {
}, 100); }, 100);
}, },
getSeldata3(num) { getSeldata3(num) {
var number = this.padString(num.toString(2), 9) var number = this.padString(num.toString(2), 16)
this.numlist = number.split('') this.numlist = number.split('')
this.numlist.forEach((el, index) => { this.numlist.forEach((el, index) => {
if (Number(el)) { if(index<this.tableData.length){
this.tableData[this.tableData.length - 1 - index].open = true if (Number(this.numlist[this.numlist.length - 1 - index])) {
this.tableData[index].open = true
} else { } else {
this.tableData[this.tableData.length - 1 - index].open = false this.tableData[index].open = false
} }
}
}) })
}, },
padString(str, length) { padString(str, length) {

View File

@ -253,19 +253,21 @@ return num
var list1 = this.padString(inputData['272'].toString(2), 6) var list1 = this.padString(inputData['272'].toString(2), 6)
var listData = list1.split('') var listData = list1.split('')
if (Number(listData[listData.length - 1 - this.active])) { if (Number(listData[listData.length - 1 - this.active])==1) {
listData[listData.length - 1 - this.active] = '0' listData[listData.length - 1 - this.active] = '0'
this.openList.splice(this.openList.indexOf(this.active), 1) this.openList.splice(this.openList.indexOf(this.active), 1)
} else { } else {
listData[listData.length - 1 - this.active] = '1' listData[listData.length - 1 - this.active] = '1'
this.openList.push(this.active) this.openList.push(this.active)
} }
var listNew = listData.join(""); var listNew = listData.join("");
var dataNum = { var dataNum = {
target: { target: {
value: parseInt(listNew, 2), value: parseInt(listNew, 2),
}, },
}; };
this.inputData['272']=parseInt(listNew, 2)
this.changeBtn('272', dataNum); this.changeBtn('272', dataNum);
}, },
getData272() { getData272() {
@ -275,7 +277,6 @@ return num
this.openList = [] this.openList = []
for (var i = 0; i < number; i++) { for (var i = 0; i < number; i++) {
console.log(Number(list1[list1.length - 1 - i]));
if (Number(list1[list1.length - 1 - i])) { if (Number(list1[list1.length - 1 - i])) {
this.openList.push(i) this.openList.push(i)
} }