Commit fe15f2f2 authored by XieXiaohan's avatar XieXiaohan

add CustomView

parent 1d742ca8
......@@ -14,6 +14,263 @@
"turntable-camera-controller": "^3.0.0"
}
},
"@antv/adjust": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/@antv/adjust/-/adjust-0.2.2.tgz",
"integrity": "sha512-b5cABT0WWgKU8pfhW2ssID4FBXDBnHPuxU/HAV3nOMq1lso2BI2/r1hHnrVMZId5Dntb7YrVTOsokiD9DFZ2+w==",
"requires": {
"@antv/util": "~2.0.0",
"tslib": "^1.10.0"
}
},
"@antv/attr": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@antv/attr/-/attr-0.3.2.tgz",
"integrity": "sha512-31PfcVKeQdPBmr/QD+IC0NB/FbdtVKOXBCNMepFc5/dEs7jphmgG1V4tfAJmcXIHubCTHOjpscTrDIvoKSGvMQ==",
"requires": {
"@antv/color-util": "^2.0.1",
"@antv/util": "~2.0.0",
"tslib": "^1.10.0"
}
},
"@antv/color-util": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@antv/color-util/-/color-util-2.0.5.tgz",
"integrity": "sha512-eQktA9YDnWCj03rfjpg0ajvCfRkHXzBzsZa9z94pY6Jb7e3XtPUp7vDpB8KhaKm9GjPtGzQDneh+gnqkEK8mtQ==",
"requires": {
"@antv/util": "^2.0.9",
"tslib": "^1.10.0"
}
},
"@antv/component": {
"version": "0.7.4",
"resolved": "https://registry.npmjs.org/@antv/component/-/component-0.7.4.tgz",
"integrity": "sha512-8uSa4BKrS2zjBEurtQkI0Z1mTkGxKohLKSBsUvkFZrYpZ1Zp1ypPObzSzx6mZp3sE3iiG0EGj589MDrD1mCiUA==",
"requires": {
"@antv/dom-util": "~2.0.1",
"@antv/g-base": "~0.5.0",
"@antv/matrix-util": "^3.1.0-beta.1",
"@antv/path-util": "~2.0.7",
"@antv/scale": "~0.3.1",
"@antv/util": "~2.0.0",
"fecha": "~4.2.0",
"tslib": "^1.10.0"
}
},
"@antv/coord": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@antv/coord/-/coord-0.3.0.tgz",
"integrity": "sha512-lm5Ct+r62mFVqhziKoDFN3PQjnkNBMOoOG+kBsPq3M3GqlQt5Jc7euOHMFcYSZM9HJmsKkGcih6EWDVVliMEZg==",
"requires": {
"@antv/matrix-util": "^3.1.0-beta.2",
"@antv/util": "~2.0.3",
"tslib": "^1.10.0"
}
},
"@antv/data-set": {
"version": "0.11.7",
"resolved": "https://registry.npmjs.org/@antv/data-set/-/data-set-0.11.7.tgz",
"integrity": "sha512-TP62M4ZGda/6dhz+XvmsghMSpkrmRLsLiRFfPfYQVM9+QZAzvGisVayj9x0xMSBBwDwjKE69LeDTFFMQJlTnog==",
"requires": {
"@antv/hierarchy": "^0.6.0",
"@antv/util": "^2.0.0",
"d3-composite-projections": "^1.2.0",
"d3-dsv": "^1.0.5",
"d3-geo": "~1.6.4",
"d3-geo-projection": "~2.1.2",
"d3-hexjson": "^1.0.1",
"d3-hierarchy": "^1.1.5",
"d3-sankey": "^0.9.1",
"d3-voronoi": "^1.1.2",
"dagre": "^0.8.2",
"point-at-length": "^1.0.2",
"regression": "^2.0.0",
"simple-statistics": "^6.1.0",
"topojson-client": "^3.0.0",
"wolfy87-eventemitter": "^5.1.0"
},
"dependencies": {
"topojson-client": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz",
"integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==",
"requires": {
"commander": "2"
}
}
}
},
"@antv/dom-util": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@antv/dom-util/-/dom-util-2.0.2.tgz",
"integrity": "sha512-i/rh385casRd6OA4rbpbA2jyiwY/w7PtkA+74mH43PiBzOcLpDg1jEWR9dMO0tIqUzHQWWqKNNjmXVubl4GS6g==",
"requires": {
"tslib": "^1.10.0"
}
},
"@antv/event-emitter": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@antv/event-emitter/-/event-emitter-0.1.2.tgz",
"integrity": "sha512-6C6NJOdoNVptCr5y9BVOhKkCgW7LFs/SpcRyAExUeSjAm0zJqcqNkSIRGsXYhj4PJI+CZICHzGwwiSnIsE68Ug=="
},
"@antv/g-base": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@antv/g-base/-/g-base-0.5.1.tgz",
"integrity": "sha512-gbv+uz/SvzM4/p3PLjAiEZUp6kdzKkCbVWTCdBXB1cvNMttlEzWEB8MOFbEkcIAy7TtjQJJRv8ThI/ngFzU+fg==",
"requires": {
"@antv/event-emitter": "^0.1.1",
"@antv/g-math": "^0.1.5",
"@antv/matrix-util": "^3.1.0-beta.1",
"@antv/path-util": "~2.0.5",
"@antv/util": "~2.0.0",
"@types/d3-timer": "^1.0.9",
"d3-ease": "^1.0.5",
"d3-interpolate": "^1.3.2",
"d3-timer": "^1.0.9",
"detect-browser": "^5.1.0"
}
},
"@antv/g-canvas": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@antv/g-canvas/-/g-canvas-0.5.1.tgz",
"integrity": "sha512-m132AyMrILm0wYTbXSlmDaz8M7OoEIvSZuW59apDS+F3jHAxsJrBvKXJjJJ26CItdIbTmeLLMcfoGIj9IzXvDw==",
"requires": {
"@antv/g-base": "^0.5.1",
"@antv/g-math": "^0.1.5",
"@antv/matrix-util": "^3.1.0-beta.1",
"@antv/path-util": "~2.0.5",
"@antv/util": "~2.0.0",
"gl-matrix": "^3.0.0"
}
},
"@antv/g-math": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/@antv/g-math/-/g-math-0.1.5.tgz",
"integrity": "sha512-29B3p33jzUPIyx1xYfNCexbp7jvahD6bD8FKKyWqfYZHQbvrFfV8ZNUu66RJLfDrl0KaKT6C5whfKs/WrVaflQ==",
"requires": {
"@antv/util": "~2.0.0",
"gl-matrix": "^3.0.0"
}
},
"@antv/g-svg": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@antv/g-svg/-/g-svg-0.5.1.tgz",
"integrity": "sha512-UALLDneKlpOaAZXMIRsUjDrmuceXGR0shXwj4gv+UzIgYe/4hNxTll+1RsA+R+tYmQKAhsilhzsm3eMmPzwbtA==",
"requires": {
"@antv/g-base": "^0.5.1",
"@antv/g-math": "^0.1.5",
"@antv/util": "~2.0.0",
"detect-browser": "^5.0.0"
}
},
"@antv/g2": {
"version": "4.1.0-beta.10",
"resolved": "https://registry.npmjs.org/@antv/g2/-/g2-4.1.0-beta.10.tgz",
"integrity": "sha512-baa9ysFNj/Wms81UVrpE4ETKGQnJ6yxly5tKn43D952Y1XAZRlE5hXuN5+NUBu1vvskOx5ifiqZqRf46Mp+Apg==",
"requires": {
"@antv/adjust": "^0.2.1",
"@antv/attr": "^0.3.1",
"@antv/color-util": "^2.0.2",
"@antv/component": "^0.7.0",
"@antv/coord": "^0.3.0",
"@antv/dom-util": "^2.0.2",
"@antv/event-emitter": "~0.1.0",
"@antv/g-base": "^0.5.0",
"@antv/g-canvas": "^0.5.0",
"@antv/g-svg": "^0.5.0",
"@antv/matrix-util": "^3.1.0-beta.1",
"@antv/path-util": "^2.0.3",
"@antv/scale": "^0.3.1",
"@antv/util": "~2.0.5",
"tslib": "^2.0.0"
},
"dependencies": {
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
}
}
},
"@antv/g2plot": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@antv/g2plot/-/g2plot-2.0.1.tgz",
"integrity": "sha512-RAaIFz3dlY+vN3GxhazWnT1EhMIoNws2HN7+6REvyU56ovi2JLY585bqJCUkK1T99hc7P7BqsXlo9lzFCu4Y5Q==",
"requires": {
"@antv/data-set": "^0.11.5",
"@antv/event-emitter": "^0.1.2",
"@antv/g2": "^4.1.0-beta.10",
"dayjs": "^1.8.36",
"size-sensor": "^1.0.1",
"tslib": "^1.13.0"
},
"dependencies": {
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
}
}
},
"@antv/hierarchy": {
"version": "0.6.6",
"resolved": "https://registry.npmjs.org/@antv/hierarchy/-/hierarchy-0.6.6.tgz",
"integrity": "sha512-ivb9j5aJOogjjU9k7WZXWznevMyqgBbP/Xq2rfXsQFLk4ArABt2ewU6a6jndPOiycGDxppZ8kaYjli70i4HluA==",
"requires": {
"@antv/util": "^2.0.7"
}
},
"@antv/matrix-util": {
"version": "3.1.0-beta.2",
"resolved": "https://registry.npmjs.org/@antv/matrix-util/-/matrix-util-3.1.0-beta.2.tgz",
"integrity": "sha512-Efwp0ZHxVDK/8RUa/RRWN7HKFHJmjn7Oq5HaNBbCmsxd7JTla3Zsoq1AZrjWMDlq0lplo77urclwI+XIW8NEHw==",
"requires": {
"@antv/util": "^2.0.9",
"gl-matrix": "^3.3.0",
"tslib": "^1.10.0"
},
"dependencies": {
"gl-matrix": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.3.0.tgz",
"integrity": "sha512-COb7LDz+SXaHtl/h4LeaFcNdJdAQSDeVqjiIihSXNrkWObZLhDI4hIkZC11Aeqp7bcE72clzB0BnDXr2SmslRA=="
}
}
},
"@antv/path-util": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@antv/path-util/-/path-util-2.0.8.tgz",
"integrity": "sha512-g5gt12MY1oEzh/j5XfLNRCfJU7E+Us+2yM5Hqc0y8xeWhb5l013XG5BPV37KmOf6WAys9KNxklNniHCZ6SqCKw==",
"requires": {
"@antv/util": "^2.0.9",
"tslib": "^1.10.0"
}
},
"@antv/scale": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@antv/scale/-/scale-0.3.3.tgz",
"integrity": "sha512-D6fuS4IlqkpJ9Cm963sumroOxhqZL6S6bsFQPRMxypaqebXW2pWcmbzF5Hw1jKucl1M4nZ0nGCB3cE2SdLxrcA==",
"requires": {
"@antv/util": "~2.0.3",
"fecha": "~4.2.0",
"tslib": "^2.0.0"
},
"dependencies": {
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
}
}
},
"@antv/util": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/@antv/util/-/util-2.0.9.tgz",
"integrity": "sha512-JblWzne7msAPDdxkUhEk8zAz0Wd6igKwqymGbvIeyOydGrhBhGjA3nEayFj4IlG+XixCvGFKsCB4yuFS4glRIA==",
"requires": {
"tslib": "^1.10.0"
}
},
"@babel/code-frame": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
......@@ -1241,12 +1498,51 @@
"resolved": "https://registry.npmjs.org/@types/d3/-/d3-3.5.43.tgz",
"integrity": "sha512-t9ZmXOcpVxywRw86YtIC54g7M9puRh8hFedRvVfHKf5YyOP6pSxA0TvpXpfseXSCInoW4P7bggTrSDiUOs4g5w=="
},
"@types/d3-geo": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-1.12.0.tgz",
"integrity": "sha512-x0x3kckNms8ftJicAcDNPj2xOHFw9hGzkrMcWD1pHM/vPvXZo6g9nh9AVUeQRu59Mpuhlf1EcdNH08KWPQ9mWw==",
"requires": {
"@types/geojson": "*"
}
},
"@types/d3-path": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.9.tgz",
"integrity": "sha512-NaIeSIBiFgSC6IGUBjZWcscUJEq7vpVu7KthHN8eieTV9d9MqkSOZLH4chq1PmcKy06PNe3axLeKmRIyxJ+PZQ=="
},
"@types/d3-sankey": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@types/d3-sankey/-/d3-sankey-0.11.0.tgz",
"integrity": "sha512-qRSxb23bebIudr4+ewdkG6T+vlvBdzWMjB4X915LD4bplq8FxrGTakCZ0OolSZKJjym8WrnIeHRVuoPOw+Nq+g==",
"requires": {
"@types/d3-shape": "*"
}
},
"@types/d3-shape": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.3.tgz",
"integrity": "sha512-kuIftW9veM/8iNY1SvrZOfyJ2+6fFlPhVH7ShKrO3lXCSpe97xor6q89w23Jwir5Gn3xHHR1qS2jF35DstE2Dg==",
"requires": {
"@types/d3-path": "^1"
}
},
"@types/d3-timer": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-1.0.10.tgz",
"integrity": "sha512-ZnAbquVqy+4ZjdW0cY6URp+qF/AzTVNda2jYyOzpR2cPT35FTXl78s15Bomph9+ckOiI1TtkljnWkwbIGAb6rg=="
},
"@types/events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==",
"dev": true
},
"@types/geojson": {
"version": "7946.0.7",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz",
"integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ=="
},
"@types/glob": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz",
......@@ -4475,11 +4771,45 @@
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.0.tgz",
"integrity": "sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg=="
},
"d3-composite-projections": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/d3-composite-projections/-/d3-composite-projections-1.3.2.tgz",
"integrity": "sha512-dao+Dd/EEYBX+FqNYwe/4putAsMXWewSgDj5sETRFsj1z4X/CVI6ctmZhqvpa/MVYCFHoWV9Issu+20OU5VmbA==",
"requires": {
"d3-geo": "^1.11.9",
"d3-path": "^1.0.9"
},
"dependencies": {
"d3-geo": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz",
"integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==",
"requires": {
"d3-array": "1"
}
}
}
},
"d3-dispatch": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz",
"integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA=="
},
"d3-dsv": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.2.0.tgz",
"integrity": "sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g==",
"requires": {
"commander": "2",
"iconv-lite": "0.4",
"rw": "1"
}
},
"d3-ease": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz",
"integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ=="
},
"d3-force": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz",
......@@ -4491,6 +4821,32 @@
"d3-timer": "1"
}
},
"d3-geo": {
"version": "1.6.4",
"resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.6.4.tgz",
"integrity": "sha1-8g4eRhyxhF9ai+Vatvh2VCp+MZk=",
"requires": {
"d3-array": "1"
}
},
"d3-geo-projection": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.1.2.tgz",
"integrity": "sha1-ffjh6dBG1jHGUJ9+UxNX1K3CSqM=",
"requires": {
"commander": "2",
"d3-array": "1",
"d3-geo": "^1.1.0"
}
},
"d3-hexjson": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/d3-hexjson/-/d3-hexjson-1.1.0.tgz",
"integrity": "sha512-fHXGMnA1iYBg0Kw5jqSm9kZDRyw4Mq74AzJzUM/FiCDy9a47xM5qj2+ofTaZbeku9tHsRtoujolHiqmD3s3EHA==",
"requires": {
"d3-array": "1"
}
},
"d3-hierarchy": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz",
......@@ -4514,6 +4870,16 @@
"resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz",
"integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA=="
},
"d3-sankey": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.9.1.tgz",
"integrity": "sha512-nnRkDaUMjBdeuGg+kWGdA+tjG1AVTnJ+Ykw7ff7CZHVI17Hm5sy8n0UXykVffn13aNHwK5wPOdOt1gS1ZEaF+A==",
"requires": {
"d3-array": "1",
"d3-collection": "1",
"d3-shape": "^1.2.0"
}
},
"d3-shape": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",
......@@ -4527,6 +4893,20 @@
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz",
"integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw=="
},
"d3-voronoi": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.4.tgz",
"integrity": "sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg=="
},
"dagre": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz",
"integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==",
"requires": {
"graphlib": "^2.1.8",
"lodash": "^4.17.15"
}
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
......@@ -4535,6 +4915,11 @@
"assert-plus": "^1.0.0"
}
},
"dayjs": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.9.1.tgz",
"integrity": "sha512-01NCTBg8cuMJG1OQc6PR7T66+AFYiPwgDvdJmvJBn29NGzIG+DIFxPLNjHzwz3cpFIvG+NcwIjP9hSaPVoOaDg=="
},
"de-indent": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/de-indent/download/de-indent-1.0.2.tgz",
......@@ -4842,6 +5227,11 @@
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=",
"dev": true
},
"detect-browser": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.1.1.tgz",
"integrity": "sha512-5n2aWI57qC3kZaK4j2zYsG6L1LrxgLptGCNhMQgdKhVn6cSdcq43pp6xHPfTHG3TYM6myF4tIPWiZtfdVDgb9w=="
},
"detect-kerning": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/detect-kerning/-/detect-kerning-2.1.2.tgz",
......@@ -5732,6 +6122,11 @@
"websocket-driver": ">=0.5.1"
}
},
"fecha": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.0.tgz",
"integrity": "sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg=="
},
"fetch-jsonp": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/fetch-jsonp/-/fetch-jsonp-1.1.3.tgz",
......@@ -7463,6 +7858,14 @@
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
},
"graphlib": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
"integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
"requires": {
"lodash": "^4.17.15"
}
},
"grid-index": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz",
......@@ -7924,7 +8327,6 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
......@@ -10604,6 +11006,23 @@
"resolved": "https://registry.npmjs.org/plotly.js-dist/-/plotly.js-dist-1.52.2.tgz",
"integrity": "sha512-32yU9/Fhfi9YZlQBojAajw2SZozXIgNyMn3oIGWWLvxl/BLI6DaqcqHgkw/LP373Kp+844m7FeGGZ7EgOs1N1Q=="
},
"point-at-length": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/point-at-length/-/point-at-length-1.1.0.tgz",
"integrity": "sha1-CtcuvQmA1/WhqxIpbAVfnrazDlc=",
"requires": {
"abs-svg-path": "~0.1.1",
"isarray": "~0.0.1",
"parse-svg-path": "~0.1.1"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
}
}
},
"point-cluster": {
"version": "3.1.8",
"resolved": "https://registry.npmjs.org/point-cluster/-/point-cluster-3.1.8.tgz",
......@@ -11847,6 +12266,11 @@
"regl-scatter2d": "^3.1.2"
}
},
"regression": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/regression/-/regression-2.0.1.tgz",
"integrity": "sha1-jSnD6CJKEIUMNeM36FqLL6w7DIc="
},
"relateurl": {
"version": "0.2.7",
"resolved": "https://registry.npm.taobao.org/relateurl/download/relateurl-0.2.7.tgz",
......@@ -12729,6 +13153,11 @@
"resolved": "https://registry.npm.taobao.org/signum/download/signum-0.0.0.tgz",
"integrity": "sha1-q1UbEAM1EHCnBHg/GgnF52kfnPY="
},
"simple-statistics": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/simple-statistics/-/simple-statistics-6.1.1.tgz",
"integrity": "sha512-zGwn0DDRa9Zel4H4n2pjTFIyGoAGpnpjrGIctreCxj5XWrcx9v7Xy7270FkC967WMmcvuc8ZU7m0ZG+hGN7gAA=="
},
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npm.taobao.org/simple-swizzle/download/simple-swizzle-0.2.2.tgz",
......@@ -12805,6 +13234,11 @@
}
}
},
"size-sensor": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/size-sensor/-/size-sensor-1.0.1.tgz",
"integrity": "sha512-QTy7MnuugCFXIedXRpUSk9gUnyNiaxIdxGfUjr8xxXOqIB3QvBUYP9+b51oCg2C4dnhaeNk/h57TxjbvoJrJUA=="
},
"slab-decomposition": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/slab-decomposition/download/slab-decomposition-1.0.2.tgz",
......@@ -14776,6 +15210,11 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
"vue-js-toggle-button": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/vue-js-toggle-button/-/vue-js-toggle-button-1.3.3.tgz",
"integrity": "sha512-0b920oztgK+1SqlYF26MPiT28hAieL5aAQE7u21XEym5ryfzD4EMer4hLkgDC/1sWsCHb22GvV+t1Kb4AI6QFw=="
},
"vue-loader": {
"version": "15.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.8.3.tgz",
......@@ -14862,6 +15301,11 @@
"resolved": "https://registry.npmjs.org/vue-wechat-title/-/vue-wechat-title-2.0.5.tgz",
"integrity": "sha512-bCfKnJpbquqNY5ygNN7nRgNHGhyinWd277ecVh0Z15Tk8nS69catrvQSJIuRxXUOxoO/4Y32c6IfNbQUA8oh0g=="
},
"vuejs-progress-bar": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/vuejs-progress-bar/-/vuejs-progress-bar-1.2.2.tgz",
"integrity": "sha512-RTkbj56Hj4nykkc9BZxTxbaulov2oRAHSRuW7BlyYAkz4a9ZjhF0t7X+imEK1F5eNC94AywXlfLbIohGnGq83w=="
},
"vuex": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.2.tgz",
......@@ -15327,6 +15771,11 @@
"resolved": "https://registry.npm.taobao.org/window-size/download/window-size-0.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwindow-size%2Fdownload%2Fwindow-size-0.1.0.tgz",
"integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0="
},
"wolfy87-eventemitter": {
"version": "5.2.9",
"resolved": "https://registry.npmjs.org/wolfy87-eventemitter/-/wolfy87-eventemitter-5.2.9.tgz",
"integrity": "sha512-P+6vtWyuDw+MB01X7UeF8TaHBvbCovf4HPEMF/SV7BdDc1SMTiBy13SRD71lQh4ExFTG1d/WNzDGDCyOKSMblw=="
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
......
......@@ -77,7 +77,8 @@
</nav>
<div id="appLeftClick">
<div id="appLeftClick" style="min-height: 100vh;">
......@@ -150,11 +151,14 @@ import { indexOf } from "typescript-collections/dist/lib/arrays";
//when add more available widgets add ref to the widgets
import Status from "./components/Status/Status.vue";
import Navigation from "./components/Navigation/Navigation.vue";
import WaveView from "./components/WaveView/WaveView.vue";
import Method from "./components/Method/Method.vue";
import Config from "./components/Config/Config.vue";
import BoolConfig from "./components/Config/BoolConfig.vue";
import Thing from "./components/Thing/Thing.vue";
import State from "./components/State/State.vue";
import BoolState from "./components/State/BoolState.vue";
import VarBroadcast from "./components/VarBroadcast/VarBroadcast.vue";
import AutoBroadcast from "./components/AutoBroadcast/AutoBroadcast.vue";
import SlideShow from "./components/SlideShow/SlideShow.vue";
......@@ -172,15 +176,18 @@ import Windows from "./components/Common/Windows.vue";
WaveView,
Method,
Config,
BoolConfig,
Thing,
GridLayout,
GridItem,
State,
BoolState,
VarBroadcast,
AutoBroadcast,
SlideShow,
CardReader,
Windows,
Navigation,
}
})
......@@ -206,14 +213,17 @@ export default class App extends Vue {
availableWidgets = [
"Status",
"Config",
"BoolConfig",
"WaveView",
"Method",
"Thing",
"State",
"BoolState",
"VarBroadcast",
"AutoBroadcast",
"SlideShow",
"CardReader"
"CardReader",
"Navigation"
];
......@@ -310,7 +320,9 @@ export default class App extends Vue {
};
var fragment = window.location.hash;
console.log("costum"+fragment);
if (fragment != "#blank" && fragment != "#Blank" && fragment != "#") {
fragment = fragment.substring(1, fragment.length);
var customViewURL = "/customView/template" + fragment;
......@@ -339,18 +351,34 @@ export default class App extends Vue {
);
this.widgetList = widgets.widgetList;
this.lastWidgetIndex = Number(widgets.currentRef);
this.$forceUpdate();
//替换startpath
//this.$forceUpdate();
//todo:替换startpath;判断是否存在$startpath$
/*for (var wid of this.widgetList) {
if((wid.widgetConfig[1].edit.url).search("startpath") != -1 ){
console.log("in"+(wid.widgetConfig[1].edit.url));
((this.$refs[wid.ref] as Array<Widget>)[0] as Widget).replaceStartPath( fragment as string);
}
}*/
//Defer the callback to be executed after the next DOM update cycle.
Vue.nextTick(() => {
// fragment = fragment.substring(1,fragment.length);
// for (var wid of this.widgetList) {
// ((this.$refs[wid.ref] as Array<Widget>)[0] as Widget).replaceStartPath( fragment as string);
// }
/*fragment = fragment.substring(1,fragment.length);
for (var wid of this.widgetList) {
((this.$refs[wid.ref] as Array<Widget>)[0] as Widget).replaceStartPath( fragment as string);
}*/
//刷新值
this.importActiveWidgetList();
//this.importActiveWidgetList();
// for (var wid of this.widgetList) {
// ((this.$refs[wid.ref] as Array<Widget>)[0] as Widget).refresh();
// }
fragment = fragment.substring(1,fragment.length);
console.log(fragment);
this.importActiveWidgetList(fragment);
});
}
else{
......@@ -360,6 +388,7 @@ export default class App extends Vue {
}).catch(err=>{
var dataURL = fragment;
this.dataAccess(dataURL);
console.log(dataURL);
});
}
......@@ -383,9 +412,9 @@ export default class App extends Vue {
exportActiveWidgetList(): AllWidgetConfig {
for (var widget of this.widgetList) {
widget.widgetConfig = ((this.$refs[widget.ref] as Array<
Widget
>)[0] as Widget).getConfig();
console.log("innn");
widget.widgetConfig = ((this.$refs[widget.ref] as Array<Widget>)[0] as Widget).getConfig();
console.log(widget.widgetConfig);
}
var widgetConfigList = new AllWidgetConfig();
widgetConfigList.widgetList = this.widgetList;
......@@ -393,10 +422,12 @@ export default class App extends Vue {
return widgetConfigList;
}
importActiveWidgetList() {
importActiveWidgetList(fragment:string) {
console.log(this.widgetList);
for (var wid of this.widgetList) {
console.log('in');
((this.$refs[wid.ref] as Array<Widget>)[0] as Widget).setConfig(
wid.widgetConfig as WidgetConfig
wid.widgetConfig as WidgetConfig,fragment
);
}
}
......@@ -419,13 +450,14 @@ export default class App extends Vue {
this.importActiveWidgetList();
});
};
}
saveWidgetList(): void {
var data = JSON.stringify(this.exportActiveWidgetList());
const blob = new Blob([data]);
/*
if (window.navigator.msSaveOrOpenBlob) {
// 兼容IE10
navigator.msSaveBlob(blob, this.fileName);
......@@ -436,7 +468,7 @@ export default class App extends Vue {
aTag.href = URL.createObjectURL(blob);
aTag.click();
URL.revokeObjectURL(aTag.href);
}*/
}
}
addWidget(widgetName: string): void {
......
......@@ -20,16 +20,58 @@
</tr>
<tr v-if="EditData.edit.type != 'config'">
<tr v-if="EditData.edit.type == 'Navigation'">
<td><button class="button has-text-primary" style="margin-left: 15px;" @click="addInput">Add Input</button></td>
<td><table class="table">
<tbody v-for="(data,index) in EditData.edit.url">
<tr>
<input class="input has-text-primary" v-model="data.url"></tr>
<tr>
<button @click="deleteRow(index)">删除</button>
</tr>
</tbody>
</table></td>
</tr>
<tr v-if="EditData.edit.type != 'Navigation'">
<th>url:</th>
<td> <input class="input has-text-primary" v-model="EditData.edit.url" type="text"></td>
<td><button class="button has-text-primary" style="margin-left: 15px;" @click="pathPoke">POKE</button></td>
</tr>
<tr v-for="(prop,key) in EditData.props">
<tr v-for="(prop,key) in EditData.props" v-if="key != 'StateIndicatorFile'">
<th>{{key}}</th>
<td> <input class="input has-text-primary" v-model="EditData.props[key]" type="text">{{prop}}</td>
<td v-if="key == 'setPathPoke' || key == 'getPathPoke'"><button class="button has-text-primary" style="margin-left: 15px;" @click="pathPoke(key)">POKE</button></td>
<td><input v-if="key != 'titleSize'" class="input has-text-primary" v-model="EditData.props[key]" type="text">
<div class="select" v-if="key == 'titleSize'">
<select v-model="EditData.props.titleSize">
<option>is-small</option>
<option>is-medium</option>
<option>is-large</option>
</select>
</div>
</td>
<!--<td v-if="key == 'setPathPoke' || key == 'getPathPoke'"><button class="button has-text-primary" style="margin-left: 15px;" @click="pathPoke(key)">POKE</button></td>-->
</tr>
<tr v-for="(prop,key) in EditData.props.StateIndicatorFile">
<th>{{key}}</th>
<td>
<input class="input has-text-primary" v-model="EditData.props.StateIndicatorFile[key]" type="text">
</td>
</tr>
<tr v-if="EditData.edit.type == 'state'">
<th>ShowStateValue</th>
<td>
<toggle-button v-model="EditData.edit.isShowStateVlaue"
width="80"
height="30"
switch-color="{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}"
:labels="{checked: 'show', unchecked: 'hide'}"/>
</td>
</tr>
......@@ -45,7 +87,7 @@
<div class="field-body">
<div class="field">
<div class="control">
<input class="input" type="text" v-model="tempUserInputData[label]">
<input class="input" type="text" v-model="EditData.params.tempUserInputData[label]">
</div>
</div>
</div>
......@@ -65,6 +107,7 @@
</table>
</div>
......@@ -128,10 +171,6 @@ export default class WindowsApp extends Vue {
this.EditData = data;
}
if(this.EditData.props.StateFile != null){
this.EditData.props.StateFile = JSON.stringify(this.EditData.props.StateFile);
this.EditData.props.StateIndicatorFile = JSON.stringify(this.EditData.props.StateIndicatorFile);
}
}
mounted(){
......@@ -144,15 +183,15 @@ export default class WindowsApp extends Vue {
this.setVariableList(
this.pathProcessor.extractVarFromPath(this.EditData.params.PokedPath)
);
if(this.EditData.edit.type == 'config'){
this.setVariableList(
this.pathProcessor.extractVarFromPath(this.EditData.params.GetPokedPath)
);
this.setVariableList(
this.pathProcessor.extractVarFromPath(this.EditData.params.SetPokedPath)
);
}
addInput(){
this.EditData.edit.url.push({});
}
deleteRow(index) {
this.EditData.edit.url.splice(index, 1);
}
/*loadTextFromStateFile(ev: any){
......@@ -188,7 +227,7 @@ export default class WindowsApp extends Vue {
target: ["self"]
};
this.EditData.params.Args = Args;
this.EditData.params.tempUserInputData = this.tempUserInputData;
//this.EditData.params.tempUserInputData = this.tempUserInputData;
window.opener.UpdateWidget(this.EditData);
}
......@@ -196,13 +235,8 @@ export default class WindowsApp extends Vue {
pathPoke(key:string) {
pathPoke() {
this.isShowParams = true;
if(key == 'setPathPoke'){
this.EditData.params.action = 'set';
}else if(key == 'getPathPoke'){
this.EditData.params.action = 'get';
}
window.opener.UpdateWidget(this.EditData);
}
......@@ -211,12 +245,10 @@ export default class WindowsApp extends Vue {
setVariableList(path: string[]) {
console.log(path);
this.userInputData.clear();
path.forEach(element => {
this.userInputData.set(element, '');
});
console.log(this.userInputData);
this.$forceUpdate();
}
......@@ -225,7 +257,7 @@ export default class WindowsApp extends Vue {
getVariableValues(): Map<string, string> {
for(var key of this.userInputData.keys()) {
this.userInputData.set(key, this.tempUserInputData[key]);
this.userInputData.set(key, this.EditData.params.tempUserInputData[key]);
}
return this.userInputData;
......
......@@ -5,6 +5,8 @@ import 'buefy/dist/buefy.css'
import 'font-awesome/css/font-awesome.min.css'
//import hscmap from '@hscmap/vue-window'
import * as VueWindow from '@hscmap/vue-window'
import ToggleButton from 'vue-js-toggle-button'
Vue.use(ToggleButton)
import router from 'vue-router'
......
......@@ -5,6 +5,7 @@ export default class PathProcessor {
let str = '';
//取出path中的$ $,数组
const result = path.match(urlRegExp);
console.log(result);
if (result != null) {
//遍历map和数组
variables.forEach((value: string, key: string) => {
......@@ -14,6 +15,7 @@ export default class PathProcessor {
str = '\$' + label + '\$';
//将$xxx$替换成参数值 path为/card0/length/0
path = path.replace(str, value);
console.log(path);
}
});
});
......
<template>
<div class="container">
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
</div>
<div class="columns" style="padding: 5px;margin-top: 5px;">
<toggle-button v-model="switchValue"
:sync="true"
@change="viewSetLoad(EditData.params.Args,false)"
width="70"
height="34"
:disabled="checkActiveSample"
switch-color="{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}"
:labels="{checked: 'open', unchecked: 'close'}"/>
</div>
<div class="colmumns">
<WidgetParams
class="column"
style="padding-top: 0px;padding-bottom: 5px;"
ref="WidgetGetParams"
action="get"
@updataVariables="viewGetLoad"
></WidgetParams>
</div>
<div class="colmumns">
<WidgetParams
class="column"
ref="WidgetSetParams"
action="set"
@updataVariables="viewSetLoad"
></WidgetParams>
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { WidgetRef } from "@/models/WidgetRef";
import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview";
import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios";
import Plotly from "plotly.js";
import PathProcessor from "@/models/PathProcessor";
import StrMapObjChange from "@/models/StrMapObjChange";
import { forEach } from "typescript-collections/dist/lib/arrays";
import { map } from "d3";
import Navigation from "@/components/Common/Navigation.vue";
import Windows from "@/components/Common/Windows.vue";
@Component({
components: {
WidgetParams,
Navigation,
Windows,
}
})
export default class BoolConfig extends Widget {
@Prop() index!:number;
@Prop() refIndex!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange();
timer?: number;
WidgetComponentName: string = "BoolConfig";
getConfigValue: string = "undefined";
setConfigValue: string = "";
pathId: string = "";
userGetInputData = new Map<string, string>();
userSetInputData = new Map<string, string>();
getPathwithVar: string = "";
setPathwithVar: string = "";
isShowGetPath: boolean = false;
isShowSetPath: boolean = false;
isOpen: boolean = true;
fontSize:number = 25;
activeColor:string = '';
EditPathPoke:string = '';
isSetPoke: boolean = false;
isGetPoke: boolean = false;
pokedPath:string = '';
isShowParams:boolean = false;
setLabel:string = '';
switchValue:boolean = false;
checkActiveSample:boolean = true;
EditPathPoke : string = "";
config: WidgetConfig = {
WidgetComponentName: "BoolConfig",
data: {
displayname:"",
url:"",
get: { url: "", userInputData: "" },
set: { url: "", userInputData: "" }
}
};
EditData = {
edit:{
url:this.config.data.url,
type:'Boolconfig',
index:this.refIndex,
},
props:{
fontSize:this.fontSize,
title:'',
titleSize:'',
},
params:{
PokedPath:this.EditPathPoke,
action:'get',
Args : {},
tempUserInputData:{},
setLabel:'',
},
};
created() {
// this.config.data.userInputData = this.userInputData;
this.config.data.get.userInputData = this.strMapObjChange.strMapToObj(
this.userGetInputData
);
this.config.data.set.userInputData = this.strMapObjChange.strMapToObj(
this.userSetInputData
);
}
mounted(){
this.timer = setInterval(this.getrefresh, 1000);
let containerlist = document.getElementsByClassName('container');
//CreateContainerId
var self = this;
let RightClickField = containerlist[this.index];
RightClickField.oncontextmenu = function (e) {
e.preventDefault();//demo区域停止原鼠标右击菜单
//this.popMenu('itemMenu',100,"100");
let menu = document.querySelector('.menu');//获取盒子menu。
if(menu) menu.remove();//判断清除初始盒子
menu = document.createElement('div');//创建盒子。
menu.classList.add('menu');//添加类
let menu1 = document.createElement('BUTTON');//创建盒子menu1。
menu1.innerHTML = 'del';//盒子menu1添加文本XXXX
menu1.onclick = self.del;
menu.appendChild(menu1);//menu末尾添加新的节点menu1
let menu2 = document.createElement('BUTTON');//创建盒子menu1。
menu2.innerHTML = 'edit';//盒子menu1添加文本XXXX
menu2.onclick = self.openWindows;
//menu2.setAttribute("onclick", this.openWindows);
menu.appendChild(menu2);//menu末尾添加新的节点menu1
RightClickField.appendChild(menu);//body末尾添加新的节点menu
//盒子跟随鼠标光标。
//menu.style.top = $('#RightClick').offset().top;
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
};
//全局点击时消失。
RightClickField.onclick = e => {
let menu = document.querySelector('.menu')
if (menu && !menu.contains(e.target))
menu.remove()
}
}
destroyed() {
clearInterval(this.timer);
}
openWindows(){
var JsonData = JSON.stringify(this.EditData);
var url ="http://localhost:8080/WindowsAppIndex.html/?";
window.open(url+JsonData, "WidgetWindow",'height=100, width=100, top=10, left=10, toolbar=no');
}
del(){
this.$emit('del', this.index);
}
updateSwitchValue(){
if(this.getConfigValue == true|| this.getConfigValue == false){
this.checkActiveSample = false;
this.switchValue = Boolean(this.getConfigValue);
}
}
updateUI() {
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
this.openWindows();
}
showPathConfig() {
if (this.isShowGetPath == this.isShowSetPath) {
this.isShowGetPath = !this.isShowGetPath;
this.isShowSetPath = !this.isShowSetPath;
} else {
this.isShowGetPath = true;
this.isShowSetPath = true;
}
}
getConfig(): [WidgetConfig,object] {
return [this.config,this.EditData];
}
//app
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
//this.EditData.params.tempUserInputData = temp;
this.setLabel = this.EditData.params.setLabel;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.EditData.params.Args = Args;
this.viewLoad(Args);
}
samplePoke(sample: any) {
var samplePath = sample.CFET2CORE_SAMPLE_PATH;
var setpokedPath: string;
var getpokedPath: string;
//set
setpokedPath = samplePath;
getpokedPath = samplePath;
var settemp = sample.Actions.set.Parameters;
settemp = JSON.parse(JSON.stringify(settemp));
settemp = this.strMapObjChange.objToStrMap(settemp);
var SetParameters: Map<string, string>;
SetParameters = settemp;
var temp = sample.Actions.get.Parameters;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
var Parameters: Map<string, string>;
Parameters = temp;
var count: number = 0;
Parameters.forEach((value, key) => {
count++;
if (count == 1) {
getpokedPath = getpokedPath + "?";
}
getpokedPath = getpokedPath + key + "=$" + key + "$&";
});
if (count != 0) {
getpokedPath = getpokedPath.substring(0, getpokedPath.length - 1);
}
this.config.data.get.url = getpokedPath;
count =0;
SetParameters.forEach((value, key) => {
count++;
///dummyTest/ReturnDictConfig?
if (count == 1) {
setpokedPath = setpokedPath + "?";
this.pokedPath = setpokedPath;
}
///dummyTest/ReturnDictConfig?key=$key$&
///dummyTest/ReturnDictConfig?key=$key$&value=$value$&
if(count< SetParameters.size){
setpokedPath = setpokedPath + key + "=$" + key + "$&";
}
if(count == SetParameters.size){
this.isShowParams = true;
this.setLabel = key;
this.EditData.params.setLabel = key;
this.config.data.set.url = setpokedPath+ key + "=$" + key + "$";
}
});
///dummyTest/ReturnDictConfig?key=$key$&value=$value$
if (count != 0) {
setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1);
}
count = 0;
Parameters.forEach((value,key) => {
SetParameters.forEach((setValue, setKey) => {
count++;
if(setKey != key){
setpokedPath = setpokedPath + key + "=$" + key + "$&";
}
})
});
///dummyTest/ReturnDictConfig?key=$key$&value=$value$
if (count != 0) {
setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1);
}
this.config.data.url = setpokedPath;
}
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.config.data.url;
//axios.defaults.timeout = 1000;
axios.get(pokepath).then(response => {
this.isGetPoke = true;
this.samplePoke(response.data);
this.updateUI();
}).catch(err => {
this.openWindows();
});
}
replaceStartPath(startPath: string): void {
this.config.data.get.url = this.config.data.get.url.replace("$startpath$", startPath);
this.config.data.set.url = this.config.data.set.url.replace("$startpath$", startPath);
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
parentUpdate(payload: UpdatePayload): void {
var shouldUpdate:boolean = false;
this.userGetInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetGetParams as WidgetParams).getVariableValues());
var temp = this.userGetInputData;
temp = this.strMapObjChange.objToStrMap(temp);
this.userGetInputData = temp;
this.userGetInputData.forEach((value , key) =>{
payload.variables.forEach((valueofpayload,keyofpayload)=>{
if(key == keyofpayload && ((this.userGetInputData.get(key) as string) != (payload.variables.get(keyofpayload) as string)))
{
this.userGetInputData.set(key,payload.variables.get(keyofpayload) as string);
shouldUpdate = true;
}
});
});
this.userSetInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetSetParams as WidgetParams).getVariableValues());
temp = this.userSetInputData;
temp = this.strMapObjChange.objToStrMap(temp);
this.userSetInputData = temp;
this.userSetInputData.forEach((value , key) =>{
payload.variables.forEach((valueofpayload,keyofpayload)=>{
if(key == keyofpayload && ((this.userSetInputData.get(key) as string) != (payload.variables.get(keyofpayload) as string)))
{
this.userSetInputData.set(key,payload.variables.get(keyofpayload) as string);
}
});
});
if(shouldUpdate)
{
(this.$refs.WidgetGetParams as WidgetParams).setVariableInput(this.userGetInputData);
(this.$refs.WidgetSetParams as WidgetParams).setVariableInput(this.userSetInputData);
this.updateUI();
}
}
async getData(url: string) {
var apiLoad = url;
await axios.get(apiLoad, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.getConfigValue = response.data.CFET2CORE_SAMPLE_VAL;
if(this.getConfigValue == undefined)
{
this.getConfigValue = "undefined";
}
});
this.updateSwitchValue();
}
async setData(url: string) {
var apiLoad = url;
await axios.post(apiLoad, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.setConfigValue = response.data.CFET2CORE_SAMPLE_VAL;
});
}
viewLoad(Args: UpdatePayload){
var checkParent = true;
this.viewSetLoad(Args,checkParent);
}
//called when widgetParams action clicked
async viewGetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
this.userGetInputData = Args.variables;
this.getPathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData,
this.userGetInputData,
this.config.data.get.url
);
await this.getData(this.getPathwithVar);
}
async viewSetLoad(Args: UpdatePayload,checkParent:boolean) {
if(checkParent == false){
// this.config.data.userInputData = Args.variables;
if(Object.prototype.toString.call( Args.variables) == '[object Undefined]' ){
this.userSetInputData.set(this.setLabel,this.switchValue);
}else{
this.userSetInputData = Args.variables;
this.userSetInputData.set(this.setLabel,this.switchValue);
}
this.setPathwithVar = this.pathProcessor.FillPathWithVar(this.userSetInputData, this.config.data.set.url);
await this.setData(this.setPathwithVar);
this.getrefresh();
}else if(checkParent == true){
this.getrefresh();
}
}
getrefresh() {
this.viewGetLoad(this.EditData.params.Args);
}
}
</script>
<style scoped>
.waveView {
width: 100%;
height: auto;
}
.bluetag{
background: url("../../assets/bluetag.png");
width: 26px;
height: 26px;
}
</style>
......@@ -2,23 +2,28 @@
<div class="container">
<div class="columns" style="margin-top:0px">
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.get.url }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.set.url }}</span>
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
</div>
<div class="columns" style="margin-top:5px;padding: 5px;">
<div class="columns" style="margin-top:5px">
<div class="column is-10" style="margin-left:3%;overflow:auto;border-style: solid; border-width: 1px; padding: 5px">
<p style="float:left;margin:0px;">{{ getConfigValue }}</p>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input" type="text" v-model="setUserData">
</div>
</div>
</div>
<!--<input class="column is-8 input has-text-info" type="text">-->
<button class="button has-text-info is-light" style="margin-left: 15px;" @click="viewSetLoad(EditData.params.Args)">set</button>
<button class="button has-text-info is-light" style="margin-left: 15px;" @click="viewLoad(EditData.params.Args)">get</button>
</div>
<!--<div class="columns" style="margin-top:5px">
<toggle-button v-model="myDataVariable"
width="100"
......@@ -26,8 +31,7 @@
switch-color="{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}"
:labels="{checked: 'open', unchecked: 'close'}"/>
</div>
</div>-->
<div class="colmumns">
<WidgetParams
......@@ -50,7 +54,6 @@
</div>
</div>
......@@ -94,7 +97,7 @@ export default class Config extends Widget {
pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Config";
getConfigValue: string = "";
getConfigValue: string = "undefined";
setConfigValue: string = "";
pathId: string = "";
userGetInputData = new Map<string, string>();
......@@ -109,12 +112,18 @@ export default class Config extends Widget {
EditPathPoke:string = '';
isSetPoke: boolean = false;
isGetPoke: boolean = false;
pokedPath:string = '';
setLabel:string = '';
setUserData:string = 'undefined';
EditPathPoke : string = "";
config: WidgetConfig = {
WidgetComponentName: "Status",
WidgetComponentName: "Config",
data: {
displayname:"",
url:"",
get: { url: "", userInputData: "" },
set: { url: "", userInputData: "" }
}
......@@ -122,19 +131,21 @@ export default class Config extends Widget {
EditData = {
edit:{
url:this.config.data.url,
type:'config',
index:this.refIndex,
},
props:{
title:'',
titleSize:'',
fontSize:this.fontSize,
getPathPoke:this.config.data.get.url,
setPathPoke:this.config.data.set.url,
},
params:{
PokedPath:this.EditPathPoke,
action:'get&set',
action:'get',
Args : {},
tempUserInputData:{},
setLabel:'',
},
};
......@@ -177,10 +188,6 @@ export default class Config extends Widget {
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
//menu.style.top = '${e.clientY}px';
//menu.style.left = '${e.clientX}px';
console.log(menu.style.top);
console.log(menu);
};
......@@ -192,8 +199,10 @@ export default class Config extends Widget {
}
}
openWindows(){
var JsonData = JSON.stringify(this.EditData);
var url ="http://localhost:8080/WindowsAppIndex.html/?";
window.open(url+JsonData, "WidgetWindow",'height=100, width=100, top=10, left=10, toolbar=no');
}
......@@ -203,22 +212,11 @@ export default class Config extends Widget {
}
updateUI() {
this.updateGetUI();
this.updateSetUI();
}
updateGetUI() {
console.log('updateGet')
this.EditData.params.PokedPath = this.config.data.get.url;
this.EditData.props.getPathPoke = this.config.data.get.url;
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
this.openWindows();
}
updateSetUI() {
this.EditData.params.PokedPath = this.config.data.set.url;
this.EditData.props.setPathPoke = this.config.data.set.url;
this.openWindows();
}
showPathConfig() {
if (this.isShowGetPath == this.isShowSetPath) {
......@@ -230,133 +228,138 @@ export default class Config extends Widget {
}
}
getConfig(): WidgetConfig {
this.config.data.get.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetGetParams as WidgetParams).getVariableValues()
);
this.config.data.set.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetSetParams as WidgetParams).getVariableValues()
);
return this.config;
getConfig(): [WidgetConfig,object] {
return [this.config,this.EditData];
}
setConfig(widgetConfig: WidgetConfig): void {
this.config = widgetConfig;
this.updateUI();
var temp = this.config.data.get.userInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.userGetInputData = temp;
(this.$refs.WidgetGetParams as WidgetParams).setVariableInput(
this.userGetInputData
);
temp = this.config.data.set.userInputData;
//app
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.userSetInputData = temp;
(this.$refs.WidgetSetParams as WidgetParams).setVariableInput(
this.userSetInputData
);
//this.EditData.params.tempUserInputData = temp;
//console.log(this.EditData.params.tempUserInputData);
this.setLabel = this.EditData.params.setLabel;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.EditData.params.Args = Args;
this.viewLoad(Args);
//this.pathPoke();
}
samplePoke(sample: any) {
var samplePath = sample.CFET2CORE_SAMPLE_PATH;
var pokedPath: string;
pokedPath = samplePath;
var count: number = 0;
var setpokedPath: string;
var getpokedPath: string;
//set
setpokedPath = samplePath;
getpokedPath = samplePath;
var settemp = sample.Actions.set.Parameters;
settemp = JSON.parse(JSON.stringify(settemp));
settemp = this.strMapObjChange.objToStrMap(settemp);
var SetParameters: Map<string, string>;
SetParameters = settemp;
if (this.isSetPoke == false || this.isGetPoke == true) {
var temp = sample.Actions.get.Parameters;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
var Parameters: Map<string, string>;
Parameters = temp;
var count: number = 0;
Parameters.forEach((value, key) => {
count++;
if (count == 1) {
pokedPath = pokedPath + "?";
getpokedPath = getpokedPath + "?";
}
pokedPath = pokedPath + key + "=$" + key + "$&";
getpokedPath = getpokedPath + key + "=$" + key + "$&";
});
if (count != 0) {
pokedPath = pokedPath.substring(0, pokedPath.length - 1);
}
this.config.data.get.url = pokedPath;
getpokedPath = getpokedPath.substring(0, getpokedPath.length - 1);
}
this.config.data.get.url = getpokedPath;
if (this.isGetPoke == false || this.isSetPoke == true) {
pokedPath = samplePath;
count = 0;
var settemp = sample.Actions.set.Parameters;
settemp = JSON.parse(JSON.stringify(settemp));
settemp = this.strMapObjChange.objToStrMap(settemp);
var SetParameters: Map<string, string>;
SetParameters = settemp;
count =0;
SetParameters.forEach((value, key) => {
count++;
///dummyTest/ReturnDictConfig?
if (count == 1) {
pokedPath = pokedPath + "?";
setpokedPath = setpokedPath + "?";
this.pokedPath = setpokedPath;
}
///dummyTest/ReturnDictConfig?key=$key$&
///dummyTest/ReturnDictConfig?key=$key$&value=$value$&
if(count< SetParameters.size){
setpokedPath = setpokedPath + key + "=$" + key + "$&";
}
if(count == SetParameters.size){
this.setLabel = key;
this.EditData.params.setLabel = key;
this.config.data.set.url = setpokedPath+ key + "=$" + key + "$";
}
pokedPath = pokedPath + key + "=$" + key + "$&";
});
///dummyTest/ReturnDictConfig?key=$key$&value=$value$
if (count != 0) {
pokedPath = pokedPath.substring(0, pokedPath.length - 1);
}
this.config.data.set.url = pokedPath;
setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1);
}
this.isSetPoke = false;
this.isGetPoke = false;
count = 0;
Parameters.forEach((value,key) => {
SetParameters.forEach((setValue, setKey) => {
count++;
if(setKey != key){
setpokedPath = setpokedPath + key + "=$" + key + "$&";
}
getPathPoke(url:string) {
console.log(url);
this.config.data.get.url = url;
var pokepath = url;
axios.defaults.timeout = 1000;
axios.get(pokepath).then(response => {
this.isGetPoke = true;
this.samplePoke(response.data);
this.updateGetUI();
}).catch(err => {
console.log('catch');
this.EditData.params.PokedPath = this.config.data.get.url;
this.openWindows();
})
});
///dummyTest/ReturnDictConfig?key=$key$&value=$value$
if (count != 0) {
setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1);
}
this.config.data.url = setpokedPath;
}
setPathPoke(url:string) {
this.config.data.set.url = url;
var pokepath = url;
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.config.data.url;
axios.defaults.timeout = 1000;
axios.get(pokepath).then(response => {
this.isSetPoke = true;
this.isGetPoke = true;
this.samplePoke(response.data);
this.updateSetUI();
this.updateUI();
}).catch(err => {
console.log('catch');
this.EditData.params.PokedPath = this.config.data.set.url;
this.openWindows();
});
}
pathPoke() {
if(this.EditData.params.action == 'get'){
this.EditPathPoke = this.EditData.props.getPathPoke;
this.getPathPoke(this.EditData.props.getPathPoke);
}else if(this.EditData.params.action == 'set'){
this.EditPathPoke = this.EditData.props.setPathPoke;
this.setPathPoke(this.EditData.props.setPathPoke);
}
}
replaceStartPath(startPath: string): void {
this.config.data.get.url.replace("$startPath$", startPath);
this.config.data.set.url.replace("$startPath$", startPath);
this.config.data.get.url = this.config.data.get.url.replace("$startpath$", startPath);
this.config.data.set.url = this.config.data.set.url.replace("$startpath$", startPath);
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
parentUpdate(payload: UpdatePayload): void {
......@@ -401,19 +404,17 @@ export default class Config extends Widget {
async getData(url: string) {
var apiLoad = url;
console.log(url);
await axios.get(apiLoad, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.getConfigValue = response.data.CFET2CORE_SAMPLE_VAL;
if(this.getConfigValue == undefined)
this.setUserData = response.data.CFET2CORE_SAMPLE_VAL;
if(this.setUserData == undefined)
{
this.getConfigValue = "undefined";
this.setUserData = "undefined";
}
console.log(this.getConfigValue);
});
}
......@@ -425,25 +426,25 @@ export default class Config extends Widget {
'Cache-Control': 'no-cache'
}
}).then(response => {
this.setConfigValue = response.data.CFET2CORE_SAMPLE_VAL;
this.setUserData = response.data.CFET2CORE_SAMPLE_VAL;
if(response.data.CFET2CORE_SAMPLE_ISVALID == true){
alert('success');
}
});
console.log(url);
console.log(this.setConfigValue);
}
viewLoad(Args: UpdatePayload){
if(this.EditData.params.action == 'get'){
this.viewGetLoad(Args);
}else{
this.viewSetLoad(Args);
}
}
//called when widgetParams action clicked
async viewGetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
console.log("inn");
this.userGetInputData = Args.variables;
if(this.config.data.get.url == ''){
this.config.data.get.url = this.EditData.edit.url;
}
this.getPathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData,
this.userGetInputData,
......@@ -455,22 +456,22 @@ export default class Config extends Widget {
async viewSetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
if(Object.prototype.toString.call( Args.variables) == '[object Undefined]' ){
this.userSetInputData.set(this.setLabel,this.setUserData);
}else{
this.userSetInputData = Args.variables;
this.setPathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData,
this.userSetInputData,
this.config.data.set.url
);
this.userSetInputData.set(this.setLabel,this.setUserData);
}
this.setPathwithVar = this.pathProcessor.FillPathWithVar(this.userSetInputData, this.config.data.set.url);
await this.setData(this.setPathwithVar);
this.getrefresh();
//this.getrefresh();
}
getrefresh() {
var GetArgs: UpdatePayload = {
action: "get",
variables: (this.$refs
.WidgetGetParams as WidgetParams).getVariableValues(),
variables: (this.$refs.WidgetGetParams as WidgetParams).getVariableValues(),
target: ["self"]
};
this.viewGetLoad(GetArgs);
......
<template>
<div class="container">
<!--<b-row style="margin-top:10px">
<b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span>
</b-button>
</b-col>
</b-row>
<br />-->
<div class="columns" style="margin-top:10px" >
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<input class="input colmumn is-8" type="text" v-show="isShowPath" v-model="config.data.displayname">
<div class="column is-offset-11-desktop">
<a class="delete is-medium" @click="del"></a>
</div>
<div class="container" style="padding-bottom: 30px;padding-right: 30px;" >
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
<div class="columns">
<WidgetParams
class="column"
ref="WidgetParams"
v-show="isShowParams"
action="invoke"
@updataVariables="viewLoad"
></WidgetParams>
</div>
<p class="column buttons is-1" style="margin-left: 3%;padding: 0px;margin-right: 10%;margin-top: 5%">
<button @click="openWindows" class="button" style="background-color: #64a6e1">
<span class="icon is-small has-text" style="margin-right: 1px;">
<i class="fa fa-cog" aria-hidden="true"></i>
</span>
EDIT</button>
</p>
<!--<hsc-window-style-metal >
<hsc-window title="invoke Method" :closeButton="true" :isOpen.sync="isOpen" positionHint="5 / 5">
<fieldset style="padding: 20px;">
<div class="columns">
<div class="column is-2" style="color: #206dec;font-size: 18px;font-style: oblique;font-weight: 900;padding: 0px;">Method</div>
<i class="fa fa-question-circle-o" aria-hidden="true" style="margin-top: 5px;margin-left: 3px;"></i>
</div>
<div class="columns">Enter the Thing in the input box below,</div>
<div class="columns">
click 'OK' to invoke method from cfet,click 'POKE' to get the parameters</div>
<div class="columns">
<div class="field column is-7" style="padding-right: 0px;" >
<div class="control">
<input class="input is-info" type="text" v-model="config.data.url">
</div>
</div>
<div class="column" style="position: relative;right: 25px;">
<button class="button is-light " @click="updateUI">OK</button>
</div>
<div class="column" style="position: relative;right: 50px;">
<button class="button is-info" @click="pathPoke">POKE</button>
</div>
</div>
<div class="columns">
<WidgetParams
class="column"
ref="WidgetParams"
v-show="isShowParams"
action="invoke"
@updataVariables="viewLoad"
></WidgetParams>
</div>
</fieldset>
<fieldset>
<hr>
<div class="columns" style="margin-top: 5px;margin-bottom: 5px;margin-right: 20px;">
<button class="button column is-offset-9 is-3" style="background-color: #8fb9f7;padding-top: 6px;">
<i class="fa fa-flag" aria-hidden="true" style="margin-right: 4px;"></i>Navigation</button>
</div>
</fieldset>
</hsc-window>
<div class="columns" style="margin-top:10px">
<p class="column buttons is-offset-11-desktop" >
<button @click="isOpen = ! isOpen" class="button" >
<span class="icon is-small has-text-info">
<i class="fa fa-cog" aria-hidden="true"></i>
</span>
</button>
</p>
<button class="column button has-text-info is-light is-10 is-offset-1" style="padding: 4px;margin-top: 5px;" @click="viewInvokeLoad(EditData.params.Args)">invoke</button>
</div>
</hsc-window-style-metal>-->
<!--<div class="columns" style="margin-top:10px">
<p class="column buttons is-offset-11-desktop" >
<button @click="showPathConfig" class="button" >
<span class="icon is-small has-text-info">
<i class="fa fa-cog" aria-hidden="true"></i>
</span>
</button>
</p>
</div>
<div class="columns" v-show="isShowPath">
<div class="field column is-10" style="padding-right: 0px;" >
<div class="control">
<input class="input is-info" type="text" v-model="config.data.url">
</div>
</div>
<div class="column" style="padding-left: 0px; padding-right: 0px">
<button class="button is-light " @click="updateUI">OK</button>
</div>
<div class="column" style="padding-left: 0px">
<button class="button is-info" @click="pathPoke">POKE</button>
</div>
</div>
<div class="columns">
<WidgetParams
class="column"
......@@ -147,8 +21,6 @@
></WidgetParams>
</div>
<Navigation ref="FamilyLink" :url="config.data.url"></Navigation>-->
</div>
</template>
......@@ -178,6 +50,7 @@ import Navigation from "@/components/Common/Navigation.vue";
})
export default class Method extends Widget {
@Prop() index!:number;
@Prop() refIndex!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange();
......@@ -188,7 +61,8 @@ export default class Method extends Widget {
pathwithVar: string = "";
isShowPath: boolean = false;
isShowParams: boolean = false;
isOpen: boolean = true;
fontSize:number = 25;
EditPathPoke : string = "";
config: WidgetConfig = {
WidgetComponentName: "Method",
......@@ -199,13 +73,24 @@ export default class Method extends Widget {
}
};
schemas : any[]= [{
label:'method',
key:'method-config',
EditData = {
edit:{
type:'method',
index:this.index,
url:this.config.data.url,
index:this.refIndex,
},
props:{
fontSize:this.fontSize,
title:'',
titleSize:'',
},
params:{
PokedPath:this.EditPathPoke,
action:'invoke',
Args : {},
tempUserInputData:{},
},
];
};
created() {
// this.config.data.userInputData = this.userInputData;
......@@ -214,54 +99,95 @@ export default class Method extends Widget {
);
}
openWindows(){
this.isOpen = ! this.isOpen;
mounted(){
let containerlist = document.getElementsByClassName('container');
//CreateContainerId
var self = this;
let RightClickField = containerlist[this.index];
RightClickField.oncontextmenu = function (e) {
e.preventDefault();//demo区域停止原鼠标右击菜单
//this.popMenu('itemMenu',100,"100");
let menu = document.querySelector('.menu');//获取盒子menu。
if(menu) menu.remove();//判断清除初始盒子
menu = document.createElement('div');//创建盒子。
menu.classList.add('menu');//添加类
let menu1 = document.createElement('BUTTON');//创建盒子menu1。
menu1.innerHTML = 'del';//盒子menu1添加文本XXXX
menu1.onclick = self.del;
menu.appendChild(menu1);//menu末尾添加新的节点menu1
let menu2 = document.createElement('BUTTON');//创建盒子menu1。
menu2.innerHTML = 'edit';//盒子menu1添加文本XXXX
menu2.onclick = self.openWindows;
//menu2.setAttribute("onclick", this.openWindows);
menu.appendChild(menu2);//menu末尾添加新的节点menu1
RightClickField.appendChild(menu);//body末尾添加新的节点menu
//盒子跟随鼠标光标。
//menu.style.top = $('#RightClick').offset().top;
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
};
this.$parent.$parent.$root.$children[0].OpenWindows(this.isOpen);
this.$emit('schemas', this.schemas);
//全局点击时消失。
RightClickField.onclick = e => {
let menu = document.querySelector('.menu')
if (menu && !menu.contains(e.target))
menu.remove()
}
}
openWindows(){
var JsonData = JSON.stringify(this.EditData);
var url ="http://localhost:8080/WindowsAppIndex.html/?";
window.open(url+JsonData, "WidgetWindow",'height=100, width=100, top=10, left=10, toolbar=no');
}
updateUI(isShowPath:boolean,isShowParams:boolean,url:string) {
this.isShowPath = isShowPath;
this.isShowParams = isShowParams;
this.config.data.url = url;
console.log("111");
console.log(this.config.data.url);
updateUI() {
this.isShowPath = false;
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
this.openWindows();
}
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
showPathConfig() {
this.isShowPath = !this.isShowPath;
}
getConfig(): WidgetConfig {
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this.config.data.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetParams as WidgetParams).getVariableValues()
);
return this.config;
getConfig(): [WidgetConfig,object] {
return [this.config,this.EditData];
}
setConfig(widgetConfig: WidgetConfig): void {
this.config = widgetConfig;
//this.updateUI();
(this.$refs.WidgetParams as WidgetParams).setVariableList(
this.pathProcessor.extractVarFromPath(this.config.data.url)
);
//map不能序列化,必须要单独处理,这里的处理方法仅限map<string,string>类型
var temp = this.config.data.userInputData;
//app
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.userInputData = temp;
(this.$refs.WidgetParams as WidgetParams).setVariableInput(
this.userInputData
);
//this.EditData.params.tempUserInputData = temp;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.EditData.params.Args = Args;
//this.viewInvokeLoad(Args);
}
samplePoke(sample: any) {
......@@ -288,13 +214,36 @@ export default class Method extends Widget {
pokedPath = pokedPath.substring(0, pokedPath.length - 1);
}
this.config.data.url = pokedPath;
this.$parent.$root.$children[0].$children[0].$children[0].config.data.url = pokedPath;
}
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.EditData.edit.url;
//todo:config文件
axios.get(pokepath, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.samplePoke(response.data);
this.updateUI();
}).catch(err => {
alert(err);
this.EditData.params.PokedPath = this.config.data.url;
this.openWindows();
});
//var url = this.config.data.url;
}
replaceStartPath(startPath: string): void {
this.config.data.url.replace("$startPath$", startPath);
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
parentUpdate(payload: UpdatePayload): void {
......@@ -325,12 +274,7 @@ export default class Method extends Widget {
}
refresh() {
var Args: UpdatePayload = {
action: "invoke",
variables: (this.$refs.WidgetParams as WidgetParams).getVariableValues(),
target: ["self"]
};
this.viewLoad(Args);
}
async getData(url: string) {
......@@ -346,12 +290,18 @@ export default class Method extends Widget {
{
this.StatusValue = "undefined";
}
if(response.data.CFET2CORE_SAMPLE_ISVALID == false){
alert("invoke failed");
}
}).catch(err => {
alert(err);
});
}
//called when widgetParams action clicked
async viewLoad(Args: UpdatePayload) {
console.log('called when widgetParams action clicked');
async viewInvokeLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
this.userInputData = Args.variables;
this.pathwithVar = this.pathProcessor.FillPathWithVar(
......
<template>
<div class="container" id="RightClick">
<div class="columns">
<button class="column button has-text-info is-light is-10 is-offset-1" style="padding: 4px;margin-top: 25px;" @click="isShowParams = true">Navigation</button>
</div>
<div v-for="url in EditData.edit.url" v-if="isShowParams">
<a v-bind:href="url.url" target="_blank">{{url.url}}</a>
</div>
</div>
</template>
<script lang="ts">
import Component from "vue-class-component";
import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview";
import { WidgetRef } from "@/models/WidgetRef";
import PathProcessor from "@/models/PathProcessor";
import StrMapObjChange from "@/models/StrMapObjChange";
@Component({
components: {
}
})
export default class Navigation extends Widget {
@Prop() index!:number;
@Prop() refIndex!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Navigation";
pathId: string = "";
userInputData = new Map<string, string>();
isShowParams: boolean = false;
config: WidgetConfig = {
WidgetComponentName: "Navigation",
data: {
url: "",
displayname:"",
userInputData: ""
}
};
EditData = {
edit:{
url:[],
type:'Navigation',
index:this.refIndex,
},
props:{
},
params:{
action:'get',
Args : {},
tempUserInputData:{},
},
};
created() {
this.config.data.userInputData = this.strMapObjChange.strMapToObj(
this.userInputData
);
}
mounted() {
let containerlist = document.getElementsByClassName('container');
//CreateContainerId
var self = this;
let RightClickField = containerlist[this.index];
RightClickField.oncontextmenu = function (e) {
e.preventDefault();//demo区域停止原鼠标右击菜单
//this.popMenu('itemMenu',100,"100");
let menu = document.querySelector('.menu');//获取盒子menu。
if(menu) menu.remove();//判断清除初始盒子
menu = document.createElement('div');//创建盒子。
menu.classList.add('menu');//添加类
let menu1 = document.createElement('BUTTON');//创建盒子menu1。
menu1.innerHTML = 'del';//盒子menu1添加文本XXXX
menu1.onclick = self.del;
menu.appendChild(menu1);//menu末尾添加新的节点menu1
let menu2 = document.createElement('BUTTON');//创建盒子menu1。
menu2.innerHTML = 'edit';//盒子menu1添加文本XXXX
menu2.onclick = self.openWindows;
//menu2.setAttribute("onclick", this.openWindows);
menu.appendChild(menu2);//menu末尾添加新的节点menu1
RightClickField.appendChild(menu);//body末尾添加新的节点menu
//盒子跟随鼠标光标。
//menu.style.top = $('#RightClick').offset().top;
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
//menu.style.top = '${e.clientY}px';
//menu.style.left = '${e.clientX}px';
console.log(menu.style.top);
console.log(menu);
};
//全局点击时消失。
RightClickField.onclick = e => {
let menu = document.querySelector('.menu')
if (menu && !menu.contains(e.target))
menu.remove()
}
}
del(){
this.$emit('del', this.index);
}
openWindows(){
//windows.open -> another single page application
var JsonData = JSON.stringify(this.EditData);
var url ="http://localhost:8080/WindowsAppIndex.html/?";
window.open(url+JsonData, "WidgetWindow",'height=100, width=100, top=10, left=10, toolbar=no');
}
//app
updateUI() {
this.openWindows();
}
//app
getConfig(): [WidgetConfig,object] {
return [this.config,this.EditData];
}
//app
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
console.log(setConfigData);
this.config = setConfigData[0];
console.log(this.config);
this.EditData = setConfigData[1];
}
}
</script>
<style scoped>
.waveView {
width: 100%;
height: auto;
}
.hflex{
display: flex;
flex-direction: row-reverse;
align-items: center;
}
</style>
<template>
<div class="container">
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
</div>
<div class="columns" style="margin-top: 5px;padding: 5px;">
<span style="background-color: #bbb;border-radius: 50%;display: inline-block;"
v-bind:style="{ backgroundColor: activeColor, height: EditData.props.fontSize + 'px' ,width: EditData.props.fontSize + 'px'}"></span>
<div v-bind:style="{ fontColor: activeColor}" v-if="EditData.edit.isShowStateVlaue">{{stateKey}}</div>
</div>
<div class="columns">
<WidgetParams
class="column"
ref="WidgetParams"
v-show="isShowParams"
action="get"
@updataVariables="viewLoad"
></WidgetParams>
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { VueSvgGauge } from "vue-svg-gauge";
import Component from "vue-class-component";
import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview";
import { WidgetRef } from "@/models/WidgetRef";
import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios";
import PathProcessor from "@/models/PathProcessor";
import StrMapObjChange from "@/models/StrMapObjChange";
import { forEach } from "typescript-collections/dist/lib/arrays";
import { map } from "d3";
import Navigation from "@/components/Common/Navigation.vue";
@Component({
components: {
WidgetParams,
Navigation
}
})
export default class BoolState extends Widget {
@Prop() index!:number;
@Prop() refIndex!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "BoolState";
StatusValue: string = "";
pathId: string = "";
userInputData = new Map<string, string>();
pathwithVar: string = "";
timer?: number;
isShowPath: boolean = false;
isShowParams: boolean = false;
EditPathPoke : string = "";
fontSize:number = 60;
activeColor:string = '#bbb';
stateKey:string = '';
StateIndicator = {
true:'green',
false:'red',
};
config: WidgetConfig = {
WidgetComponentName: "BoolState",
data: {
url: "",
displayname:"",
userInputData: ""
}
};
EditData = {
edit:{
type:'Boolstate',
url:this.config.data.url,
index:this.refIndex,
isShowStateVlaue:false,
},
props:{
fontSize:this.fontSize,
title:'',
titleSize:'',
},
params:{
PokedPath:this.EditPathPoke,
action:'get',
Args : {},
tempUserInputData:{},
//userInputData:this.userInputData,
},
};
created() {
// this.config.data.userInputData = this.userInputData;
this.config.data.userInputData = this.strMapObjChange.strMapToObj(
this.userInputData
);
}
mounted() {
this.timer = setInterval(this.refresh, 1000);
let containerlist = document.getElementsByClassName('container');
//CreateContainerId
var self = this;
let RightClickField = containerlist[this.index];
RightClickField.oncontextmenu = function (e) {
e.preventDefault();//demo区域停止原鼠标右击菜单
//this.popMenu('itemMenu',100,"100");
let menu = document.querySelector('.menu');//获取盒子menu。
if(menu) menu.remove();//判断清除初始盒子
menu = document.createElement('div');//创建盒子。
menu.classList.add('menu');//添加类
let menu1 = document.createElement('BUTTON');//创建盒子menu1。
menu1.innerHTML = 'del';//盒子menu1添加文本XXXX
menu1.onclick = self.del;
menu.appendChild(menu1);//menu末尾添加新的节点menu1
let menu2 = document.createElement('BUTTON');//创建盒子menu1。
menu2.innerHTML = 'edit';//盒子menu1添加文本XXXX
menu2.onclick = self.openWindows;
//menu2.setAttribute("onclick", this.openWindows);
menu.appendChild(menu2);//menu末尾添加新的节点menu1
RightClickField.appendChild(menu);//body末尾添加新的节点menu
//盒子跟随鼠标光标。
//menu.style.top = $('#RightClick').offset().top;
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
};
//全局点击时消失。
RightClickField.onclick = e => {
let menu = document.querySelector('.menu')
if (menu && !menu.contains(e.target))
menu.remove()
}
}
destroyed() {
clearInterval(this.timer);
}
openWindows(){
var JsonData = JSON.stringify(this.EditData);
var url ="http://localhost:8080/WindowsAppIndex.html/?";
window.open(url+JsonData, "WidgetWindow",'height=100, width=100, top=10, left=10, toolbar=no');
}
del()
{
this.$emit('del', this.index);
}
updateUI() {
this.isShowPath = false;
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
this.openWindows();
}
showPathConfig() {
this.isShowPath = !this.isShowPath;
}
getConfig():[WidgetConfig,object] {
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
return [this.config,this.EditData];
}
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
//this.EditData.params.tempUserInputData = temp;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.EditData.params.Args = Args;
this.viewLoad(Args);
}
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.EditData.edit.url;
//todo:config文件
axios.defaults.timeout = 1000;
axios.get(pokepath, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.samplePoke(response.data);
this.updateUI();
//test
//this.colourViewLoad();
}).catch(err => {
//test
this.colourViewLoad();
this.EditData.params.PokedPath = this.config.data.url;
//this.openWindows();
});
//var url = this.config.data.url;
}
samplePoke(sample: any) {
var samplePath = sample.CFET2CORE_SAMPLE_PATH;
var pokedPath: string;
pokedPath = samplePath;
var count: number = 0;
var temp = sample.Actions.get.Parameters;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
var Parameters: Map<string, string>;
Parameters = temp;
Parameters.forEach((value, key) => {
count++;
if (count == 1) {
pokedPath = pokedPath + "?";
}
pokedPath = pokedPath + key + "=$" + key + "$&";
});
if (count != 0) {
pokedPath = pokedPath.substring(0, pokedPath.length - 1);
}
this.config.data.url = pokedPath;
}
replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
parentUpdate(payload: UpdatePayload): void {
var shouldUpdate:boolean = false;
this.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetParams as WidgetParams).getVariableValues());
var temp = this.userInputData;
temp = this.strMapObjChange.objToStrMap(temp);
this.userInputData = temp;
this.userInputData.forEach((value , key) =>{
payload.variables.forEach((valueofpayload,keyofpayload)=>{
if(key == keyofpayload && ((this.userInputData.get(key) as string) != (payload.variables.get(keyofpayload) as string)))
{
this.userInputData.set(key,payload.variables.get(keyofpayload) as string);
shouldUpdate = true;
}
});
});
if(shouldUpdate)
{
(this.$refs.WidgetParams as WidgetParams).setVariableInput(this.userInputData);
//this.updateUI();
(this.$refs.WidgetParams as WidgetParams).setVariableList(
this.pathProcessor.extractVarFromPath(this.config.data.url)
);
}
}
refresh() {
this.viewLoad(this.EditData.params.Args);
}
async getData(url: string) {
var apiLoad = url;
await axios.get(apiLoad, {
headers: {
'Pragma': 'no-cache',
'Cache-Control': 'no-cache'
}
}).then(response => {
this.StatusValue = response.data.CFET2CORE_SAMPLE_VAL;
//this.colourViewLoad();
});
}
colourViewLoad(){
this.activeColor = this.StateIndicator[this.StatusValue];
if(this.activeColor == undefined){
this.activeColor = '#bbb';
}
}
//called when widgetParams action clicked
async viewLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
this.userInputData = Args.variables;
this.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData,
this.userInputData,
this.config.data.url
);
await this.getData(this.pathwithVar);
this.colourViewLoad();
}
}
</script>
<style scoped>
.waveView {
width: 100%;
height: auto;
}
.bluetag{
background: url("../../assets/bluetag.png");
width: 26px;
height: 26px;
}
</style>
<template>
<div class="container">
<div class="columns" style="margin-top:10px">
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<input class="input colmumn is-8" type="text" v-show="isShowPath" v-model="config.data.displayname">
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
</div>
<div class="columns" style="margin-top:5px">
<div class="columns" style="padding: 5px;margin-top: 5px;">
<span style="background-color: #bbb;border-radius: 50%;display: inline-block;"
v-bind:style="{ backgroundColor: activeColor, height: fontSize + 'px' ,width: fontSize + 'px'}"></span>
v-bind:style="{ backgroundColor: activeColor, height: EditData.props.fontSize + 'px' ,width: EditData.props.fontSize + 'px'}"></span>
<div class="column is-2" v-bind:style="{ fontColor: activeColor}" v-if="EditData.edit.isShowStateVlaue">{{stateKey}}</div>
</div>
......@@ -71,8 +70,9 @@ export default class State extends Widget {
isShowPath: boolean = false;
isShowParams: boolean = false;
EditPathPoke : string = "";
fontSize:number = 40;
fontSize:number = 60;
activeColor:string = '#bbb';
stateKey:string = '';
config: WidgetConfig = {
WidgetComponentName: "State",
......@@ -84,18 +84,18 @@ export default class State extends Widget {
};
EditData = {
props:{
edit:{
type:'state',
url:this.config.data.url,
index:this.refIndex,
fontSize:this.fontSize,
StateFile:{
"0":"yellow",
"1":"orange",
"2":"green",
"255":"red"
isShowStateVlaue:false,
},
StateIndicatorFile:null,
props:{
fontSize:this.fontSize,
title:'',
titleSize:'',
StateFile:'{"Idle":"yellow","prepare":"orange","run":"green","error":"red" }' ,
StateIndicator:'{"0":"Idle","1":"prepare","2":"run","255":"error"}',
},
params:{
PokedPath:this.EditPathPoke,
......@@ -145,10 +145,6 @@ export default class State extends Widget {
menu.style.left = e.offsetX +"px";
menu.style.top = e.offsetY +"px";
menu.style.position = 'absolute';
//menu.style.top = '${e.clientY}px';
//menu.style.left = '${e.clientX}px';
console.log(menu.style.top);
console.log(menu);
};
......@@ -176,14 +172,13 @@ export default class State extends Widget {
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() {
this.isShowPath = false;
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.props.url = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
this.openWindows();
}
......@@ -191,35 +186,39 @@ export default class State extends Widget {
this.isShowPath = !this.isShowPath;
}
getConfig(): WidgetConfig {
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this.config.data.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetParams as WidgetParams).getVariableValues()
);
return this.config;
getConfig(): [WidgetConfig,object] {
return [this.config,this.EditData];
}
setConfig(widgetConfig: WidgetConfig): void {
this.config = widgetConfig;
//this.updateUI();
(this.$refs.WidgetParams as WidgetParams).setVariableList(
this.pathProcessor.extractVarFromPath(this.config.data.url)
);
//map不能序列化,必须要单独处理,这里的处理方法仅限map<string,string>类型
var temp = this.config.data.userInputData;
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.userInputData = temp;
(this.$refs.WidgetParams as WidgetParams).setVariableInput(
this.userInputData
);
//this.EditData.params.tempUserInputData = temp;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.EditData.params.Args = Args;
this.viewLoad(Args);
}
pathPoke(url:string) {
this.config.data.url = url;
this.EditPathPoke = url;
console.log("dddd");
var pokepath = url;
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.EditData.edit.url;
//todo:config文件
axios.defaults.timeout = 1000;
axios.get(pokepath, {
......@@ -228,13 +227,14 @@ export default class State extends Widget {
'Cache-Control': 'no-cache'
}
}).then(response => {
console.log("update");
this.samplePoke(response.data);
this.updateUI();
//test
//this.colourViewLoad();
}).catch(err => {
console.log('catch');
this.colourViewLoad();
this.EditData.params.PokedPath = this.config.data.url;
this.openWindows();
//this.openWindows();
});
//var url = this.config.data.url;
......@@ -269,7 +269,8 @@ export default class State extends Widget {
replaceStartPath(startPath: string): void {
this.config.data.url.replace("$startPath$", startPath);
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
parentUpdate(payload: UpdatePayload): void {
......@@ -312,25 +313,20 @@ export default class State extends Widget {
}
}).then(response => {
this.StatusValue = response.data.CFET2CORE_SAMPLE_VAL;
switch (this.StatusValue.toString()) {
case "0": {
this.activeColor = this.EditData.props.StateFile['0'];
break;
}
case "1": {
this.activeColor = this.EditData.props.StateFile['1'];
break;
}
case "2": {
this.activeColor = this.EditData.props.StateFile['2'];
break;
}
case "255": {
this.activeColor = this.EditData.props.StateFile['255'];
break;
//this.colourViewLoad();
});
}
colourViewLoad(){
var stateFile = JSON.parse(this.EditData.props.StateFile);
var stateIndicator = JSON.parse(this.EditData.props.StateIndicator);
this.stateKey = stateIndicator[this.StatusValue];
this.activeColor = stateFile[this.stateKey];
if(this.activeColor == undefined){
this.activeColor = '#bbb';
}
});
}
//called when widgetParams action clicked
......@@ -343,6 +339,7 @@ export default class State extends Widget {
this.config.data.url
);
await this.getData(this.pathwithVar);
this.colourViewLoad();
}
}
</script>
......
......@@ -3,19 +3,22 @@
<div class="container" id="RightClick">
<div class="columns" style="margin-top:5px;">
<!--<progress-bar
:options="BarOptions"
:value="value"
/>-->
<div class="column is-11 gauge" style="height: 300px"></div>
<div class="columns content " v-bind:class="EditData.props.titleSize" style="margin-bottom: 0px;">
<div class="column content-table-cell-heading-color is-narrow" style="margin: 0px;">
<h3>{{EditData.props.title}}</h3>
</div>
</div>
<div class="columns" style="margin-top:5px;margin-bottom: 0px;">
<div class="column is-four-sixths is-offset-one-sixth gauge" ref="gauge" style="height: 250px;overflow:auto;"></div>
</div>
<div class="columns">
<div class="column is-10 is-offset-1" style="margin-left:7%;overflow:auto;">
<div style="float:left;margin:0px;" v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }" >{{ StatusValue }}</div>
<div class="column is-four-sixths is-offset-one-sixth" style="overflow:auto;">
<div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }" >{{ StatusValue }}</div>
</div>
<WidgetParams
......@@ -85,9 +88,10 @@ export default class Status extends Widget {
isShowPath: boolean = false;
isShowParams: boolean = false;
EditPathPoke : string = "";
fontSize:number = 25;
fontSize:number = 35;
activeColor:string = '';
value:number = 0;
tempValue:number = 0;
gaugeTicks:number[]=[0, 0.2, 0.4, 0.75, 1];
gaugeColor:string[] = ['red', 'yellow', 'green'];
......@@ -109,20 +113,15 @@ export default class Status extends Widget {
},
props:{
fontSize:this.fontSize,
StateFile:{
"hh":"red",
"h":"orange",
"l":"orange",
"ll":"red",
"normal":"green"
},
title:'',
titleSize:'',
StateIndicatorFile:{
"hh":"0.85",
"h":"0.7",
"l":"0.2",
"ll":"0.1",
"max":"1",
"min":"0",
hh:85,
h:70,
l:20,
ll:10,
max:100,
min:0,
},
},
params:{
......@@ -176,8 +175,7 @@ export default class Status extends Widget {
menu.style.position = 'absolute';
//menu.style.top = '${e.clientY}px';
//menu.style.left = '${e.clientX}px';
console.log(menu.style.top);
console.log(menu);
};
......@@ -188,19 +186,19 @@ export default class Status extends Widget {
menu.remove()
}
let gaugeList = document.getElementsByClassName('gauge');
console.log(gaugeList[this.index]);
gauge = new Gauge(gaugeList[this.index],{
percent: this.value,
gauge = new Gauge(this.$refs.gauge,{
percent:0,
range: {
ticks: this.gaugeTicks,
color: this.gaugeColor,
ticks: [0, 0.2, 0.4, 0.75, 0.8, 1],
color: ['red', 'yellow', 'green','yellow','red'],
},
statistic: {
content: {
formatter: ({ percent }) => ``,
},
},
});
console.log(gauge);
gauge.render();
......@@ -220,42 +218,34 @@ export default class Status extends Widget {
}
ParsingStateNum(){
var StatusNum = new Number(this.StatusValue);
this.value = Math.round((StatusNum - this.EditData.props.StateIndicatorFile.ll)/(this.EditData.props.StateIndicatorFile.hh-this.EditData.props.StateIndicatorFile.ll));
this.gaugeTicks[0] = parseFloat(this.EditData.props.StateIndicatorFile.min);
this.gaugeTicks[1] = parseFloat(this.EditData.props.StateIndicatorFile.ll);
this.gaugeTicks[2] = parseFloat(this.EditData.props.StateIndicatorFile.l);
this.gaugeTicks[3] = parseFloat(this.EditData.props.StateIndicatorFile.h);
this.gaugeTicks[4] = parseFloat(this.EditData.props.StateIndicatorFile.hh);
this.gaugeTicks[5] = parseFloat(this.EditData.props.StateIndicatorFile.max);
this.gaugeColor[0] = this.EditData.props.StateFile.ll;
this.gaugeColor[1] = this.EditData.props.StateFile.l;
this.gaugeColor[2] = this.EditData.props.StateFile.normal;
this.gaugeColor[3] = this.EditData.props.StateFile.h;
this.gaugeColor[4] = this.EditData.props.StateFile.hh;
console.log(gauge);
var StatusNum = parseFloat(this.StatusValue);
this.value = parseFloat((StatusNum - this.EditData.props.StateIndicatorFile.min)/(this.EditData.props.StateIndicatorFile.max-this.EditData.props.StateIndicatorFile.min));
this.gaugeTicks[0] = 0;
this.gaugeTicks[1] = parseFloat((this.EditData.props.StateIndicatorFile.ll - this.EditData.props.StateIndicatorFile.min)/(this.EditData.props.StateIndicatorFile.max-this.EditData.props.StateIndicatorFile.min));
this.gaugeTicks[2] = parseFloat((this.EditData.props.StateIndicatorFile.l - this.EditData.props.StateIndicatorFile.min)/(this.EditData.props.StateIndicatorFile.max-this.EditData.props.StateIndicatorFile.min));
this.gaugeTicks[3] = parseFloat((this.EditData.props.StateIndicatorFile.h - this.EditData.props.StateIndicatorFile.min)/(this.EditData.props.StateIndicatorFile.max-this.EditData.props.StateIndicatorFile.min));
this.gaugeTicks[4] = parseFloat((this.EditData.props.StateIndicatorFile.hh - this.EditData.props.StateIndicatorFile.min)/(this.EditData.props.StateIndicatorFile.max-this.EditData.props.StateIndicatorFile.min));
this.gaugeTicks[5] = 1;
gauge.options.percent = this.value;
gauge.options.range = {
ticks: this.gaugeTicks,
color: this.gaugeColor,
color: ['red', 'yellow', 'green','yellow','red'],
};
gauge.render();
if(this.StatusValue >= this.EditData.props.StateIndicatorFile.hh){
this.activeColor = this.EditData.props.StateFile.hh;
}
if(this.StatusValue >= this.EditData.props.StateIndicatorFile.h && this.StatusValue<this.EditData.props.StateIndicatorFile.hh){
this.activeColor = this.EditData.props.StateFile.h;
}
if(this.StatusValue >= this.EditData.props.StateIndicatorFile.l && this.StatusValue<this.EditData.props.StateIndicatorFile.h){
this.activeColor = this.EditData.props.StateFile.normal;
}
if(this.StatusValue >= this.EditData.props.StateIndicatorFile.ll && this.StatusValue<this.EditData.props.StateIndicatorFile.l){
this.activeColor = this.EditData.props.StateFile.l;
}
if(this.StatusValue <= this.EditData.props.StateIndicatorFile.ll){
this.activeColor = this.EditData.props.StateFile.ll;
if(this.StatusValue >= parseFloat(this.EditData.props.StateIndicatorFile.hh)){
this.activeColor = 'red';
}else if(this.StatusValue >= parseFloat(this.EditData.props.StateIndicatorFile.h) && this.StatusValue < parseFloat(this.EditData.props.StateIndicatorFile.hh)){
this.activeColor = 'yellow';
}else if(this.StatusValue >= parseFloat(this.EditData.props.StateIndicatorFile.l) && this.StatusValue < parseFloat(this.EditData.props.StateIndicatorFile.h)){
this.activeColor = 'green';
}else if(this.StatusValue >= parseFloat(this.EditData.props.StateIndicatorFile.ll) && this.StatusValue < parseFloat(this.EditData.props.StateIndicatorFile.l)){
this.activeColor = 'yellow';
}else if(this.StatusValue <= parseFloat(this.EditData.props.StateIndicatorFile.ll)){
this.activeColor = 'red';
}else{
this.activeColor = 'black';
}
......@@ -272,7 +262,6 @@ export default class Status extends Widget {
//app
updateUI() {
console.log("dd22");
this.isShowPath = false;
this.EditData.params.PokedPath = this.config.data.url;
this.EditData.edit.url = this.config.data.url;
......@@ -282,36 +271,63 @@ export default class Status extends Widget {
//app
getConfig(): WidgetConfig {
getConfig(): [WidgetConfig,object] {
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this.config.data.userInputData = this.strMapObjChange.strMapToObj(
/*this.config.data.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetParams as WidgetParams).getVariableValues()
);
return this.config;
);*/
return [this.config,this.EditData];
}
//app
setConfig(widgetConfig: WidgetConfig): void {
this.config = widgetConfig;
setConfig(setConfigData: [WidgetConfig,object],fragment:string): void {
this.config = setConfigData[0];
this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)}
var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
//this.EditData.params.tempUserInputData = temp;
var Args: UpdatePayload = {
action: this.EditData.params.action,
variables: temp,
target: ["self"]
};
this.viewLoad(Args);
//this.updateUI();
(this.$refs.WidgetParams as WidgetParams).setVariableList(
/*(this.$refs.WidgetParams as WidgetParams).setVariableList(
this.pathProcessor.extractVarFromPath(this.config.data.url)
);
);*/
//map不能序列化,必须要单独处理,这里的处理方法仅限map<string,string>类型
var temp = this.config.data.userInputData;
/* var temp = this.EditData.params.Args.variables;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.userInputData = temp;
(this.$refs.WidgetParams as WidgetParams).setVariableInput(
this.EditData.params.Args.variables = temp;
console.log(temp);*/
/* temp = this.EditData;
temp = JSON.parse(JSON.stringify(temp));
temp = this.strMapObjChange.objToStrMap(temp);
this.EditData = temp;
console.log(temp);*/
/*(this.$refs.WidgetParams as WidgetParams).setVariableInput(
this.userInputData
);
);*/
}
pathPoke() {
this.config.data.url = this.EditData.edit.url;
this.EditPathPoke = this.EditData.edit.url;
console.log("dddd");
var pokepath = this.EditData.edit.url;
//todo:config文件
axios.defaults.timeout = 1000;
......@@ -321,22 +337,21 @@ export default class Status extends Widget {
'Cache-Control': 'no-cache'
}
}).then(response => {
console.log("update");
this.samplePoke(response.data);
this.updateUI();
}).catch(err => {
console.log('catch');
this.EditData.params.PokedPath = this.config.data.url;
this.openWindows();
});
//var url = this.config.data.url;
}
//app
samplePoke(sample: any) {
console.log("samplePOke");
var samplePath = sample.CFET2CORE_SAMPLE_PATH;
var pokedPath: string;
pokedPath = samplePath;
......@@ -366,7 +381,6 @@ export default class Status extends Widget {
//app
parentUpdate(payload: UpdatePayload): void {
console.log("parentUpdate");
var shouldUpdate:boolean = false
this.userInputData = this.strMapObjChange.strMapToObj(
(this.$refs.WidgetParams as WidgetParams).getVariableValues());
......@@ -395,18 +409,28 @@ export default class Status extends Widget {
//app
refresh() {
//this.viewLoad(this.EditData.params.Args);
gauge.options.percent = this.value;
if(typeof this.StatusValue == 'number'){
gauge.render();
}
//this.getData(this.pathwithVar);
this.getData(this.pathwithVar);
//this.tempValue = this.value;
}
replaceStartPath(startPath: string): void {
this.config.data.url.replace("$startPath$", startPath);
this.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.url.replace("$startpath$", startPath);
}
async getData(url: string) {
var apiLoad = url;
console.log(url);
await axios
.get(apiLoad, {
headers: {
......@@ -416,7 +440,7 @@ export default class Status extends Widget {
})
.then(response => {
this.StatusValue = response.data.CFET2CORE_SAMPLE_VAL;
if(this.StatusValue == undefined)
if(this.StatusValue == undefined || typeof this.StatusValue != 'number')
{
this.StatusValue = "undefined";
}
......@@ -428,7 +452,8 @@ export default class Status extends Widget {
//called when widgetParams action clicked
async viewLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables;
this.userInputData = Args.variables;
//this.userInputData = Args.variables;
this.userInputData =Args.variables;
this.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData,
this.userInputData,
......@@ -440,8 +465,6 @@ export default class Status extends Widget {
this.ParsingStateNum();
}
}
}
</script>
......
......@@ -5,7 +5,7 @@ export class WidgetRef {
// the parameters of a resource should be probed by the widget itself
public widgetComponentName: string = '';
public ref: string = '';
public widgetConfig?: WidgetConfig;
public widgetConfig?: [WidgetConfig,object];
//below is for grid layout
public x:number=0;
public y:number=0;
......
......@@ -11,7 +11,7 @@ export interface PokePath {
export abstract class Widget extends Vue {
public WidgetComponentName?: string;
public abstract setConfig(wid: WidgetConfig): void;
public abstract setConfig(wid: WidgetConfig,fragment:string): void;
public abstract getConfig(): WidgetConfig;
public abstract parentUpdate(payload: UpdatePayload): void;
public abstract refresh(): void;
......
{
"compilerOptions": {
//"declaration": true, //// xjl add
//"resolveJsonModule": true,
//"declarationDir": "src/types",
"target": "esnext",
//"target": "es5",
"module": "esnext",
//"module": "commonjs",
......@@ -14,9 +19,10 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"noEmit": true,
"typeRoots": ["./src/types"],
"types": [
"webpack-env"
"webpack-env",
],
"paths": {
"@/*": [
......@@ -30,12 +36,18 @@
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx", "node_modules/vue-grid-layout/dist/vue-grid-item.d.ts"
"tests/**/*.tsx",
"node_modules/vue-grid-layout/dist/vue-grid-item.d.ts",
"/node_modules/@antv/g2plot/lib/index.d.ts",
"src/types/g2plot/g2plot.d.ts",
"src/types/g2plot/global.d.ts"
],
"exclude": [
"node_modules"
......
......@@ -3,7 +3,7 @@
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
//"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
// "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
//"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
......@@ -15,8 +15,8 @@
// "outDir": "./js", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
//"tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
//"removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
......
......@@ -16,7 +16,7 @@ module.exports = {
devServer: {
proxy: {
"/": {
target: "http://192.168.0.195:8001",
target: "http://192.168.0.197:8001",
secure: false,
changeOrigin: true
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment