Compare commits

...

25 Commits

  1. 46
      index.html
  2. 12
      package-lock.json
  3. 24
      route.js

46
index.html

@ -47,20 +47,51 @@
<!-- 示例插件2 id=100-->
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button>
<div data-tname="静脉溶栓" data-param='{"url":"http://www.baidu.com", "type":0,"code":"SZK"}' data-pid="1420652719055839232" data-uid="1323567842540523520" data-rid="rid333" data-tid="tid444" data-did="did555" data-pstart="1627560659000" data-rstart="1627564259000" style="height:50px;width:100%">
<!-- 详情页插件 -->
<div data-root="p1432643387798069249" class="flex flex-row items-center" style="height:100%;width:100%;">
<div class="flex-1 title" onclick="p1432643387798069249.jumpDetails(this)"></div>
<div class="flex flex-row-reverse items-center" onclick="p1432643387798069249.jumpDetails(this)">
<img style="height:16px" src="https://www.tall.wiki/staticrec/photos/right.png">
</div>
</div>
</div>
<script>
const p100 = {
name: 'hello tall plugin',
show() {
alert(this.name)
}
var p1432643387798069249 = {
init() {
this.dom = document.querySelector("div[data-root=p1432643387798069249]");
var domBox = this.dom.parentNode;
var title = this.dom.querySelector('.title');
title.innerHTML = domBox.getAttribute('data-tname')
},
// 开始到场
jumpDetails(that) {
var param = that.parentNode.parentNode.getAttribute('data-param');
var paramData = JSON.parse(param)
let url = paramData.url
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');
let jumpUrl = `${url}?projectId=${pId}&roleId=${rId}&userId=${uId}&id=${tId}`;
for(let key in paramData) {
if(key !== 'url'){
jumpUrl += `&${key}=${paramData[key]}`
}
}
location.href = jumpUrl
},
}
p1432643387798069249.init()
</script>
</div>
</div>
</div>
<div class="flex mb-3">
<!-- 序号-->
<!--序号-->
<div class="flex flex-col items-center">
<div class="rounded-full h-8 w-8 mb-1 bg-gray-100 border-2 border-blue-500"></div>
<div class="w-8 flex-1 flex flex-col items-center">
@ -75,9 +106,8 @@
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="alert('hello')">测试组建1</button>
<!-- 示例插件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)

12
package-lock.json

@ -0,0 +1,12 @@
{
"name": "plugin-templete",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"license": "ISC"
}
}
}

24
route.js

@ -5,3 +5,27 @@ get('/blog').to.json({
title: 'Hello world'
}
})
post('/getDate').to.json({
code: 200,
msg: 'ok',
data: {
status: 0,
startTime: '1627396856605',
disparity: 0,
planStartTime: '1627360856000'
},
success: true
})
post('/chooseTime').to.json({
code: 200,
msg: 'ok',
data: {
status: 1,
startTime: '1627360856000',
disparity: 0,
planStartTime: '1627396856605'
},
success: true
})

Loading…
Cancel
Save