Browse Source

8-质控界面const修改

8-bindBtn
aBin 4 years ago
parent
commit
9df9a42c28
  1. 36
      index.html

36
index.html

@ -58,7 +58,7 @@
</div>
<script>
const p100 = {
var p100 = {
name: 'hello tall plugin',
show() {
alert(this.name)
@ -68,10 +68,10 @@
var dom = document.querySelector("div[data-root=p1419895529168707584]");
var domBox = dom.parentNode;
var domChild = document.querySelectorAll('div[data-root=p1419895529168707584]>button');
const uid = domBox.getAttribute('data-uid');
const pid = domBox.getAttribute('data-pid');
const token = await getToken(uid);
const carInfo = await getBindCar(pid,token);
var uid = domBox.getAttribute('data-uid');
var pid = domBox.getAttribute('data-pid');
var token = await getToken(uid);
var carInfo = await getBindCar(pid,token);
if(carInfo && carInfo.carId) {
domChild[0].innerHTML = `平车${carInfo.carSerial}`
domChild[0].style.display = 'block'
@ -91,8 +91,8 @@
return token
}
async function getBindCar(projectId,token) {
const params = { param: { projectId } }
const response = await fetch('https://www.tall.wiki/gateway/qcp/v3.0/car/queryBind', {
var params = { param: { projectId } }
var response = await fetch('https://www.tall.wiki/gateway/qcp/v3.0/car/queryBind', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8',
@ -100,23 +100,23 @@
},
body: JSON.stringify(params)
});
const json = await response.json();
var json = await response.json();
console.log('data', json.data)
return json.data;
}
const p1419895529168707584 = {
var p1419895529168707584 = {
bindOne(that) {
const pId = that.parentNode.parentNode.getAttribute('data-pid');
const rId = that.parentNode.parentNode.getAttribute('data-rid');
const uId = that.parentNode.parentNode.getAttribute('data-uid');
const tId = that.parentNode.parentNode.getAttribute('data-tid');
var pId = that.parentNode.parentNode.getAttribute('data-pid');
var rId = that.parentNode.parentNode.getAttribute('data-rid');
var uId = that.parentNode.parentNode.getAttribute('data-uid');
var tId = that.parentNode.parentNode.getAttribute('data-tid');
location.href = `https://www.tall.wiki/qc/choice?projectId=${pId}&roleId=${rId}&userId=${uId}&id=${tId}`;
},
jumpDetail(that) {
const pId = that.parentNode.parentNode.getAttribute('data-pid');
const rId = that.parentNode.parentNode.getAttribute('data-rid');
const uId = that.parentNode.parentNode.getAttribute('data-uid');
const tId = that.parentNode.parentNode.getAttribute('data-tid');
var pId = that.parentNode.parentNode.getAttribute('data-pid');
var rId = that.parentNode.parentNode.getAttribute('data-rid');
var uId = that.parentNode.parentNode.getAttribute('data-uid');
var tId = that.parentNode.parentNode.getAttribute('data-tid');
location.href = `https://www.tall.wiki/qc/control?projectId=${pId}&roleId=${rId}&userId=${uId}&id=${tId}`;
}
};
@ -142,7 +142,7 @@
<!-- 示例插件2 id=100-->
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button>
<script>
const p100 = {
var p100 = {
name: 'hello tall plugin',
show() {
alert(this.name)

Loading…
Cancel
Save