|
@@ -1,3 +1,4 @@
|
|
|
|
+import { queenApi } from "queenjs";
|
|
import { BusController } from "./natsController";
|
|
import { BusController } from "./natsController";
|
|
|
|
|
|
export class TreeController {
|
|
export class TreeController {
|
|
@@ -8,12 +9,99 @@ export class TreeController {
|
|
|
|
|
|
async selectOneMat() {
|
|
async selectOneMat() {
|
|
const bus = this._bus;
|
|
const bus = this._bus;
|
|
- const route = await bus.requestApi("queentree.local.router", {name:"selmat"})
|
|
|
|
|
|
+ const route = await bus.requestApi("queentree.local.router", {name:"selmatblack"})
|
|
if (!route || !route.Url ) return;
|
|
if (!route || !route.Url ) return;
|
|
const url = route.Url;
|
|
const url = route.Url;
|
|
const payload = {}
|
|
const payload = {}
|
|
- const ret:any = await bus.RequestWebView("selmat", {dev:true, height: 600, width: 900, payload, url, alwaysOnTop:true,})
|
|
|
|
|
|
+ const ret:any = await bus.RequestWebView("selmatblack", {height: 600, width: 900, payload, url, alwaysOnTop:true,})
|
|
console.log("selmat=>", ret);
|
|
console.log("selmat=>", ret);
|
|
return ret.payload;
|
|
return ret.payload;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ async SelectedPackComp(pack:any, prodId:string, compId:string) {
|
|
|
|
+ queenApi.showLoading("数据发送中")
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+
|
|
|
|
+ const sid = bus.getQuery("sid")
|
|
|
|
+
|
|
|
|
+ const ok = await bus.Public("packcomp.update." + sid, {pack, prodId, compId})
|
|
|
|
+ queenApi.hideLoading();
|
|
|
|
+
|
|
|
|
+ if (!ok) {
|
|
|
|
+ queenApi.messageError("数据接收方已关闭");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ queenApi.messageSuccess("数据发送成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async CloseWindow() {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ const sid = bus.getQuery("sid")
|
|
|
|
+ const ok = await bus.Public("tree.selector.close", {sid})
|
|
|
|
+ queenApi.hideLoading();
|
|
|
|
+ if (!ok) {
|
|
|
|
+ queenApi.messageError("窗口关闭失败,请点击右上角关闭按钮");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async CloseTreeOpen(name:string, payload?:any) {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ await bus.Public("webview.close." + name, {name: name, payload})
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async subscribeData(callback:any){
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ return await bus.subscribe('tree.savaas.update.mat',callback)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async subscribeTreeOpenFor(name:string, callback:any){
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ return await bus.subscribe('webview.opened.'+name,callback)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async GetSaveMatData() {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ const sid = bus.getQuery("sid")
|
|
|
|
+ return await this.GetSessionData(sid);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async GetPackListQueryData() {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+ const sid = bus.getQuery("sid")
|
|
|
|
+ return await this.GetSessionData(sid);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async GetSessionData(sid:string) {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+
|
|
|
|
+ const matgroup = await bus.requestApi("tree.session.data", {sid})
|
|
|
|
+ queenApi.hideLoading();
|
|
|
|
+ if (!matgroup) {
|
|
|
|
+ queenApi.messageError("获取数据失败");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ return matgroup;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async SelectedPackList(list :any) {
|
|
|
|
+ const bus = this._bus;
|
|
|
|
+
|
|
|
|
+ queenApi.showLoading("数据发送中")
|
|
|
|
+
|
|
|
|
+ const sid = bus.getQuery("sid")
|
|
|
|
+
|
|
|
|
+ const ok = await bus.Public("packlist.update." + sid, list)
|
|
|
|
+ queenApi.hideLoading();
|
|
|
|
+
|
|
|
|
+ if (!ok) {
|
|
|
|
+ queenApi.messageError("数据接收方已关闭");
|
|
|
|
+ } else {
|
|
|
|
+ queenApi.messageSuccess("数据发送成功");
|
|
|
|
+ }
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.CloseWindow();
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
}
|
|
}
|