diff --git a/.vscode/settings.json b/.vscode/settings.json index 7f2af8d..83027dc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -86,13 +86,13 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, - "[vue]": { - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit", - "source.fixAll.stylelint": "explicit" - }, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, + // "[vue]": { + // "editor.codeActionsOnSave": { + // "source.fixAll.eslint": "explicit", + // "source.fixAll.stylelint": "explicit" + // }, + // "editor.defaultFormatter": "esbenp.prettier-vscode" + // }, "i18n-ally.localesPaths": ["src/locales/lang"], "i18n-ally.keystyle": "nested", "i18n-ally.sortKeys": true, @@ -137,6 +137,8 @@ "pnpm", "antd" ], + // "files.autoSave": "onFocusChange", + // "editor.formatOnSave": true, "eslint.codeActionsOnSave.rules": null, "vue3snippets.enable-compile-vue-file-on-did-save-code": false } diff --git a/src/api/editProVar/procVarManage/index.ts b/src/api/editProVar/procVarManage/index.ts new file mode 100644 index 0000000..3996d33 --- /dev/null +++ b/src/api/editProVar/procVarManage/index.ts @@ -0,0 +1,116 @@ +import {ActRuVariablePageModel, ActRuVariablePageParams, ActRuVariablePageResult} from './model/ProcVarManageModel'; +import {defHttp} from '/@/utils/http/axios'; +import {ErrorMessageMode} from '/#/axios'; + +enum Api { + Page = '/editProVar/procVarManage/page', + List = '/editProVar/procVarManage/list', + Info = '/editProVar/procVarManage/info', + ActRuVariable = '/editProVar/procVarManage', + GetSerializedVal = '/editProVar/procVarManage/getSerializedVal', + UpdateFormVariable = '/editProVar/procVarManage/updateFormVariable', +} + +/** + * @description: 查询ActRuVariable分页列表 + */ +export async function getActRuVariablePage(params: ActRuVariablePageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Page, + params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 获取ActRuVariable信息 + */ +export async function getActRuVariable(params: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Info, + params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增ActRuVariable + */ +export async function addActRuVariable(actRuVariable: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.ActRuVariable, + params: actRuVariable, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 更新ActRuVariable + */ +export async function updateActRuVariable(actRuVariable: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.put( + { + url: Api.ActRuVariable, + params: actRuVariable, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 删除ActRuVariable(批量删除) + */ +export async function deleteActRuVariable(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.delete( + { + url: Api.ActRuVariable, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * 获取表单变量 + */ +export async function getSerializedVal(params, mode: ErrorMessageMode = 'modal') { + return defHttp.get({ + url: Api.GetSerializedVal, + params + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * 修改表单变量 + */ +export async function updateFormVariable(params, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.UpdateFormVariable, + params: params, + }, + { + errorMessageMode: mode, + }, + ); +} diff --git a/src/api/editProVar/procVarManage/model/procVarManageModel.ts b/src/api/editProVar/procVarManage/model/procVarManageModel.ts new file mode 100644 index 0000000..026f8f0 --- /dev/null +++ b/src/api/editProVar/procVarManage/model/procVarManageModel.ts @@ -0,0 +1,79 @@ +import {BasicPageParams, BasicFetchResult} from '/@/api/model/baseModel'; + +/** + * @description: ActRuVariable分页参数 模型 + */ +export interface ActRuVariablePageParams extends BasicPageParams { + name: string; + + type: string; + + value: string; + + varScope: string; +} + +/** + * @description: ActRuVariable分页返回值模型 + */ +export interface ActRuVariablePageModel { + id: string; + + name: string; + + type: string; + + value: string; + + varScope: string; +} + +/** + * @description: ActRuVariable表类型 + */ +export interface ActRuVariableModel { + id: string; + + rev: number; + + type: string; + + value: string; + + executionId: string; + + procInstId: string; + + procDefId: string; + + caseExecutionId: string; + + caseInstId: string; + + taskId: string; + + batchId: string; + + bytearrayId: string; + + doubleVal: number; + + longVal: number; + + text: string; + + text2: string; + + varScope: string; + + sequenceCounter: number; + + isConcurrentLocal: string; + + tenantId: string; +} + +/** + * @description: ActRuVariable分页返回值结构 + */ +export type ActRuVariablePageResult = BasicFetchResult; diff --git a/src/api/system/file/index.ts b/src/api/system/file/index.ts index 32c8a0e..e6fa105 100644 --- a/src/api/system/file/index.ts +++ b/src/api/system/file/index.ts @@ -72,3 +72,15 @@ export async function getFileList(params: FilePageListParams, mode: ErrorMessage }, ); } + +export async function getAppToken(params, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: '/v1/3rd/weboffice/url', + params + }, + { + errorMessageMode: mode, + }, + ); +} diff --git a/src/assets/libs/open-jssdk-v0.1.3.es.js b/src/assets/libs/open-jssdk-v0.1.3.es.js new file mode 100644 index 0000000..93ef4e9 --- /dev/null +++ b/src/assets/libs/open-jssdk-v0.1.3.es.js @@ -0,0 +1 @@ +var e={658:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(){i=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new L(r||[]);return o(a,"_invoke",{value:_(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function v(){}function h(){}function E(){}var T={};l(T,s,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(D([])));m&&m!==t&&n.call(m,s)&&(T=m);var b=E.prototype=v.prototype=Object.create(T);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(o,a,s,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==r(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function I(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function D(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function o(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)}))}}function s(e,t){for(var n=0;n0&&void 0!==r[0]?r[0]:{},t.printTimer||t.printResolve){e.next=5;break}return e.abrupt("return",new Promise((function(e,r){t.postMessage("print.request",n),clearTimeout(t.printTimer),t.printTimer=setTimeout((function(){delete t.printResolve,delete t.printTimer,r("ERROR:导出接口超时")}),6e5),t.printResolve=e})));case 5:console.error("WARN:已存在未完成的导出任务,请稍后重试");case 6:case"end":return e.stop()}}),e)}))))})));window.litePreviewSDK={config:l.init};var d={config:l.init}},123:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.r(t),n.d(t,{config:function(){return be}});var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&e.HANDLE_LIST.splice(n,1),window.removeEventListener("message",t,!1)},e.empty=function(){for(;e.HANDLE_LIST.length;)window.removeEventListener("message",e.HANDLE_LIST.shift(),!1)},e.parse=function(e){try{if(e&&"string"==typeof e){var t=e.indexOf('"__objName":')>=0,n=JSON.parse(e);return t&&(n.hasInnerObj=!0),n}return e}catch(e){console.log("Message.parse Error:",e)}},e.HANDLE_LIST=[],e}();function c(e){if(!e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e){return"[object Function]"==={}.toString.call(e)}var l,d,f,p,v,h={origin:""};function E(e,t){h[e]=t}function T(e){return h[e]}function g(e){var t=T("whiteList")||[],n=T("origin");return!!function(e,t,n){return!n.includes(t)&&e!==t&&(e.replace(/www\./i,"").toLowerCase()!==t.replace(/www\./i,"").toLowerCase()||(e.match("www.")?void 0:(E("origin",t),!1)))}(n,e.origin,t)&&(console.warn("postMessage 域名检查不通过",{safeOrigin:n,eventOrigin:e.origin}),!0)}(v=l||(l={})).unknown="unknown",v.spreadsheet="s",v.writer="w",v.presentation="p",v.pdf="f",function(e){e.wps="w",e.et="s",e.presentation="p",e.pdf="f"}(d||(d={})),function(e){e.nomal="nomal",e.simple="simple"}(f||(f={})),function(e){e[e.requestFullscreen=1]="requestFullscreen",e[e.exitFullscreen=0]="exitFullscreen"}(p||(p={}));var m,b,w,y=(m=0,function(){return m+=1}),_=function(e,t,n){void 0===n&&(n=!0);var r=t;if(!b){var i=function e(t){var n=t.clientHeight,r=t.clientWidth;0!==n||0!==r||w?0===n&&0===r||!w||(w.disconnect(),w=null):window.ResizeObserver&&(w=new ResizeObserver((function(n){e(t)}))).observe(t),b.style.cssText+="height: "+n+"px; width: "+r+"px"}.bind(null,r);(b=document.createElement("iframe")).classList.add("web-office-iframe");var o={id:"office-iframe",src:e,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",allow:"clipboard-read; clipboard-write"};for(var a in r?(o.style="width: "+r.clientWidth+"px; height: "+r.clientHeight+"px;",n&&window.addEventListener("resize",i)):((r=document.createElement("div")).classList.add("web-office-default-container"),function(e){var t=document.createElement("style");document.head.appendChild(t);var n=t.sheet;n.insertRule(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100%; height: 100%; left: 0; top: 0;}",n.cssRules.length)}(),document.body.appendChild(r),o.style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"),H&&window.visualViewport&&window.visualViewport.addEventListener("resize",I),o)b.setAttribute(a,o[a]);r.appendChild(b),b.destroy=function(){b.parentNode.removeChild(b),b=null,window.removeEventListener("resize",i),w&&(w.disconnect(),w=null)}}return b};function I(){var e=window.visualViewport,t=e.width,n=e.height,r=document.body.clientHeight-b.clientHeight;N({eventName:"visualViewportResize",data:{width:t,height:n-r}})}var N=function(e){_().contentWindow&&_().contentWindow.postMessage(JSON.stringify(e),T("realOrigin"))};function S(e,t,n){return new Promise((function(r){var i=y();s.add((function e(t){if(!g(t)){var o=s.parse(t.data);o.eventName===n&&o.msgId===i&&(r(o.data),s.remove(e))}})),N({data:e,msgId:i,eventName:t})}))}var L=function(e){return S(e,"wps.jssdk.api","wps.api.reply")},D=function(e){return S(e,"api.basic","api.basic.reply")},A={idMap:{}},O={};function k(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return"api.callback"===e.eventName&&e.callbackId&&O[e.callbackId]?(n=e.data.args,e.hasInnerObj?[4,W(n,t)]:[3,2]):[3,5];case 1:return i=a.sent(),[3,3];case 2:i=n,a.label=3;case 3:return r=i,[4,O[e.callbackId].apply(O,r)];case 4:o=a.sent(),N({result:o,eventName:"api.callback.reply",callbackId:e.callbackId}),a.label=5;case 5:return[2]}}))}))}function W(e,t){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,d,f,p,v;return a(this,(function(a){switch(a.label){case 0:if(!Array.isArray(e))return[3,5];s=[],n=0,a.label=1;case 1:return n=0?"&":"?")+w.join("&")),d&&(d.isParentFullscreen||d.isBrowserViewFullscreen)&&(document.addEventListener("fullscreenchange",F),document.addEventListener("webkitfullscreenchange",F),document.addEventListener("mozfullscreenchange",F)),n.wordOptions&&(n.wpsOptions=n.wordOptions),n.excelOptions&&(n.etOptions=n.excelOptions),n.pptOptions&&(n.wppOptions=n.pptOptions),"object"==r(c.print)){var y="wpsconfig_print";"function"==typeof c.print.subscribe&&(c[y]=c.print.subscribe,n.print={callback:y},void 0!==c.print.custom&&(n.print.custom=c.print.custom)),delete c.print}return"function"==typeof c.exportPdf&&(c[y="wpsconfig_export_pdf"]=c.exportPdf,n.exportPdf={callback:y},delete c.exportPdf),n.commandBars&&j(n.commandBars,!1),i(i({},n),{subscriptions:c})},U=function(e){void 0===e&&(e="");var t="";if(!t&&e){var n=e.toLowerCase();-1!==n.indexOf("/office/s/")&&(t=l.spreadsheet),-1!==n.indexOf("/office/w/")&&(t=l.writer),-1!==n.indexOf("/office/p/")&&(t=l.presentation),-1!==n.indexOf("/office/f/")&&(t=l.pdf)}if(!t){var r=e.match(/[\?&]type=([a-z]+)/)||[];t=d[r[1]]||""}return t};function j(e,t){void 0===t&&(t=!0);var n=e.map((function(e){var t=e.attributes;if(!Array.isArray(t)){var n=[];for(var r in t)if(t.hasOwnProperty(r)){var i={name:r,value:t[r]};n.push(i)}e.attributes=n}return e}));return t&&N({data:n,eventName:"setCommandBars"}),n}var R=window.navigator.userAgent.toLowerCase(),B=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(R),H=/iPhone|iPod|iPad/i.test(R),Y=function(){try{return-1!==window._parent.location.search.indexOf("from=wxminiprogram")}catch(e){return!1}}();function F(){var e={status:p.requestFullscreen},t=document,n=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement;e.status=n?p.requestFullscreen:p.exitFullscreen,N({data:e,eventName:"fullscreenchange"})}var X=function(){A.idMap={}};function V(){console.group("JSSDK 事件机制调整说明"),console.warn("jssdk.on、jssdk.off 和 jssdk.Application.Sub 将在后续版本中被弃用,建议使用改进后的 ApiEvent"),console.warn("具体请参考:https://wwo.wps.cn/docs/front-end/basic-usage/events/intro/"),console.groupEnd()}var z=0,J=new Set;function K(e){return z+=1,!e&&function(e){J.forEach((function(t){return t(e)}))}(z),z}function q(){var e=new Error("");return(e.stack||e.message||"").split("\n").slice(2).join("\n")}var $={};function Z(e,t){for(var n=$.otherProps,r=$.names,i=Object.keys(r),o=-1,a=0;a=0){var c={objId:e},u=n[o];return u&&ne(c,u,n),c}}function Q(e,t){var n=this,r=t.Events,i=t.Enum,c=t.Props,u=c[0],d=c[1],f=c[2];Object.assign($,{appProps:u,otherProps:d,names:f});var p,v={objId:z};switch(ne(v,u,d),v.Events=r,v.Enum=i,e.Enum=v.Enum,e.Events=v.Events,e.Props=c,U(e.url)){case l.writer:e.WordApplication=e.WpsApplication=function(){return v};break;case l.spreadsheet:e.ExcelApplication=e.EtApplication=function(){return v};break;case l.presentation:e.PPTApplication=e.WppApplication=function(){return v};break;case l.pdf:e.PDFApplication=function(){return v}}e.Application=v,e.Free=function(e){return M("api.free",{objId:e},"")},e.Stack=v.Stack=(p=function(t){e&&e.Free(t)},function(){var e=[],t=function(t){e.push(t)};return J.add(t),{End:function(){p(e),J.delete(t)}}});var h={};s.add((function(e){return o(n,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return g(e)?[2]:"api.event"===(t=s.parse(e.data)).eventName&&t.data?(n=t.data,r=n.eventName,i=n.data,(o=h[r])?[4,o(i)]:[3,2]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,k(t,(function(e,t){return Z(e,t)}))];case 3:return a.sent(),[2]}}))}))})),v.Sub={};var E=function(e){var t=r[e];Object.defineProperty(v.Sub,t,{set:function(e){V(),h[t]=e,N({eventName:"api.event.register",data:{eventName:t,register:!!e,objId:z+=1}})}})};for(var T in r)E(T)}var ee=window.FinalizationRegistry&&new FinalizationRegistry((function(e){M("api.free",{objId:e},"")})),te=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"];function ne(e,t,n){var r=t.slice(0),o=e.objId;r.includes("Destroy")||(e.Destroy=function(){return M("api.free",{objId:o},"")}),ee&&ee.register(e,o);for(var a=function(){var t=r.shift();!t.alias&&~te.indexOf(t.prop)&&r.push(i(i({},t),{alias:t.prop+"Async"}));var o=t.alias||t.prop;Object.defineProperty(e,o,{get:function(){var r=this,i=1===t.cache,o=i&&this["__"+t.prop+"CacheValue"];if(!o){var a=q(),s=K(i),c=function r(){for(var i,o=[],s=0;s=0?(t.done=null,t.then=null,e(t)):e(i.result),a.label=4;case 4:return[3,6];case 5:return s=a.sent(),n(s),[3,6];case 6:return[2]}}))}))},t.catch=function(e){return u.catch(e)}}var ie={},oe=null,ae="fileOpen",se="fileSaved",ce="fileStatus",ue="fullscreenChange",le="error",de="stage",fe="api.getToken",pe="event.toast",ve="event.hyperLinkOpen",he="api.getClipboardData";function Ee(e,t,n,r,c,u,l){var d=this;void 0===n&&(n={}),s.add((function(f){return o(d,void 0,void 0,(function(){var o,d,p,v,h,E,T,m,b,w,y,_,I,S,L,D,A,O,k;return a(this,(function(a){switch(a.label){case 0:return g(f)?[2]:(o=s.parse(f.data),d=o.eventName,p=void 0===d?"":d,v=o.data,h=void 0===v?null:v,E=o.url,T=void 0===E?null:E,-1!==["wps.jssdk.api"].indexOf(p)?[2]:"ready"!==p?[3,1]:(c.apiReadySended&&function(e){var t=[];Object.keys(ie).forEach((function(n){ie[n].forEach((function(r){var i=n;e.off(i,r),t.push({handle:r,eventName:i})})),delete ie[n]})),t.forEach((function(e){var t=e.eventName,n=e.handle;null==oe||oe.ApiEvent.AddApiEventListener(t,n)}))}(t),N({eventName:"setConfig",data:i(i({},n),{version:e.version})}),e.tokenData&&e.setToken(i(i({},e.tokenData),{hasRefreshTokenConfig:!!n.refreshToken})),e.iframeReady=!0,[3,15]));case 1:return"error"!==p?[3,2]:(t.emit(le,h),[3,15]);case 2:return"open.result"!==p?[3,3]:(void 0!==(null===(A=null==h?void 0:h.fileInfo)||void 0===A?void 0:A.officeVersion)&&(e.mainVersion=h.fileInfo.officeVersion,console.log("WebOfficeSDK Main Version: V"+e.mainVersion)),t.emit(ae,h),[3,15]);case 3:return"api.scroll"!==p?[3,4]:(window.scrollTo(h.x,h.y),[3,15]);case 4:if(p!==fe)return[3,9];m={token:!1},a.label=5;case 5:return a.trys.push([5,7,,8]),[4,c.refreshToken()];case 6:return m=a.sent(),[3,8];case 7:return b=a.sent(),console.error("refreshToken: "+(b||"fail to get")),[3,8];case 8:return N({eventName:fe+".reply",data:m}),[3,15];case 9:if(p!==he)return[3,14];w={text:"",html:""},a.label=10;case 10:return a.trys.push([10,12,,13]),[4,c.getClipboardData()];case 11:return w=a.sent(),[3,13];case 12:return y=a.sent(),console.error("getClipboardData: "+(y||"fail to get")),[3,13];case 13:return N({eventName:he+".reply",data:w}),[3,15];case 14:p===pe?c.onToast(h):p===ve?c.onHyperLinkOpen(h):"stage"===p?t.emit(de,h):"event.callback"===p?(_=h.eventName,I=h.data,S=_,_===ue&&(S="fullscreenchange"),"file.saved"===_&&(S=ce),((null===(O=n.commonOptions)||void 0===O?void 0:O.isBrowserViewFullscreen)||(null===(k=n.commonOptions)||void 0===k?void 0:k.isParentFullscreen))&&"fullscreenchange"===S&&(L=I.status,D=I.isDispatchEvent,n.commonOptions.isBrowserViewFullscreen?function(e,t,n,r){0===e?t.style="position: static; width: "+n.width+"; height: "+n.height:1===e&&(t.style="position: absolute; width: 100%; height: 100%"),r&&function(e){["fullscreen","fullscreenElement"].forEach((function(t){Object.defineProperty(document,t,{get:function(){return!!e.status},configurable:!0})}));var t=new CustomEvent("fullscreenchange");document.dispatchEvent(t)}({status:e})}(L,u,l,D):n.commonOptions.isParentFullscreen&&function(e,t,n){var r=document.querySelector(n),i=r&&1===r.nodeType?r:t;if(0===e){var o=document;(o.exitFullscreen||o.mozCancelFullScreen||o.msExitFullscreen||o.webkitCancelFullScreen||o.webkitExitFullscreen).call(document)}else if(1===e){(i.requestFullscreen||i.mozRequestFullScreen||i.msRequestFullscreen||i.webkitRequestFullscreen).call(i)}}(L,u,n.commonOptions.isParentFullscreen)),t.emit(S,I)):"api.ready"===p&&Q(e,h),a.label=15;case 15:return"function"==typeof r[p]&&r[p](e,T||h),[2]}}))}))}))}function Te(e){return new Promise((function(t){s.add((function n(r){E("realOrigin",r.origin),g(r)||s.parse(r.data).eventName===e&&(t(null),s.remove(n))}))}))}function ge(e){var t,n=this;void 0===e&&(e={}),oe&&oe.destroy();try{var r=C(e),i=r.subscriptions,c=void 0===i?{}:i,l=r.mount,d=void 0===l?null:l,f=r.url,p=r.refreshToken,v=r.onToast,h=r.onHyperLinkOpen,T=r.getClipboardData;E("whiteList",r.originWhiteList),E("origin",(f.match(/https*:\/\/[^\/]+/g)||[])[0]);var g=_(f,d),m=Te("open.result"),b=Te("api.ready"),w=d?{width:d.clientWidth+"px",height:d.clientHeight+"px"}:{width:"100vw",height:"100vh"};delete r.mount,f&&delete r.url,delete r.subscriptions;var y=(t=t||Object.create(null),{on:function(e,n){(t[e]||(t[e]=[])).push(n)},off:function(e,n){t[e]&&t[e].splice(t[e].indexOf(n)>>>0,1)},emit:function(e,n){(t[e]||[]).slice().map((function(e){e(n)})),(t["*"]||[]).slice().map((function(t){t(e,n)}))}}),I={apiReadySended:!1,apiReadySendedOnce:!1},S=function(e,t,r){return o(n,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return function(e,t,n){if(ie[e]){var r=!!ie[e].find((function(e){return e===t}));return r&&"off"===n?(y.off(e,t),ie[e]=ie[e].filter((function(e){return e!==t})),!!ie[e].length||(ie[e]=void 0,!1)):(r||"on"!==n||(ie[e].push(t),y.on(e,t)),!0)}return"on"===n?(ie[e]=[],ie[e].push(t),!1):"off"===n||void 0}(e,t,r)?[3,2]:[4,A];case 1:n.sent(),function(e,t){var n=e.eventName,r=e.type,i=e.handle;"on"===t?y.on(n,i):y.off(n,i),"base.event"===r&&N({eventName:"basic.event",data:{eventName:n,action:t}}),V()}(function(e,t){var n=e,r="base.event";switch(n){case se:console.warn("fileSaved事件监听即将弃用, 推荐使用fileStatus进行文件状态的监听"),n="fileStatus";break;case ue:n="fullscreenchange";break;case"error":case"fileOpen":r="callback.event"}return{eventName:n,type:r,handle:t}}(e,t),r),n.label=2;case 2:return[2]}}))}))};oe={url:f,iframe:g,version:"1.1.20",iframeReady:!1,tokenData:null,commandBars:null,tabs:{getTabs:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A];case 1:return e.sent(),[2,D({api:"tab.getTabs"})]}}))}))},switchTab:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),[2,D({api:"tab.switchTab",args:{tabKey:e}})]}}))}))}},setCooperUserColor:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),[2,D({api:"setCooperUserColor",args:e})]}}))}))},setToken:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),oe.tokenData=e,N({eventName:"setToken",data:e}),[2]}}))}))},ready:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return I.apiReadySendedOnce?[3,2]:(I.apiReadySendedOnce=!0,[4,m]);case 1:e.sent(),I.apiReadySended=!0,N({eventName:"api.ready"}),e.label=2;case 2:return[4,b];case 3:return e.sent(),[2,new Promise((function(e){return setTimeout((function(){return e(null==oe?void 0:oe.Application)}),0)}))]}}))}))},destroy:function(){ie={},g.destroy(),s.empty(),oe=null,J=new Set,z=0,document.removeEventListener("fullscreenchange",F),X()},save:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A];case 1:return e.sent(),[2,L({api:"save"})]}}))}))},setCommandBars:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),j(e),[2]}}))}))},updateConfig:function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),e.commandBars?(console.warn("Deprecated: `updateConfig()` 方法即将废弃,请使用`setCommandBars()`代替`updateConfig()`更新`commandBars`配置。"),[4,j(e.commandBars)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},executeCommandBar:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A];case 1:return t.sent(),j([{cmbId:e,attributes:[{name:"click",value:!0}]}]),[2]}}))}))},on:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this.ApiEvent.AddApiEventListener(e,t)]}))}))},off:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this.ApiEvent.RemoveApiEventListener(e,t)]}))}))},ApiEvent:{AddApiEventListener:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,S(e,t,"on")];case 1:return[2,n.sent()]}}))}))},RemoveApiEventListener:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,S(e,t,"off")];case 1:return[2,n.sent()]}}))}))}}},function(e,t,n,r,i,o){t&&u(t)&&(i.refreshToken=t,e.refreshToken={eventName:fe}),o&&u(o)&&(i.getClipboardData=o,e.getClipboardData={eventName:he}),n&&u(n)&&(i.onToast=n,e.onToast={eventName:pe}),r&&u(r)&&(i.onHyperLinkOpen=r,e.onHyperLinkOpen={eventName:ve})}(r,p,v,h,I,T),Ee(oe,y,r,c,I,g,w);var A=Te("ready");return oe}catch(e){console.error(e)}}console.log("WebOfficeSDK JS-SDK V1.1.20");var me=Object.freeze({__proto__:null,listener:Ee,config:ge});window.WPS=me;var be=ge;t.default={config:ge}},606:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(328),i=function(){function e(){this.events={},this.eventsArr=Object.values(r.AddApiListenerType),this.events={},this.handler=this.handler.bind(this),window.addEventListener("message",this.handler)}return e.prototype.handler=function(e){this.eventsArr.includes(e.data.eventName)&&this.trigger({eventName:e.data.eventName,params:e.data.data})},e.prototype.add=function(e,t){this.events[e]||(this.events[e]=[]),console.log("添加【".concat(e,"】事件成功")),this.events[e].push(t)},e.prototype.remove=function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter((function(e){return e!==t})),console.log("移除【".concat(e,"】事件成功")))},e.prototype.trigger=function(e){var t=e.eventName,n=e.params;this.events[t]&&this.events[t].forEach((function(e){console.log("触发【".concat(t,"】事件,参数为:"),n),e(n)}))},e}();t.default=i},620:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1e3*e},e.prototype.renderOpendoc=function(){var e,t=document.createElement("iframe");t.allow="clipboard-read;clipboard-write",t.allowFullscreen=!0,t.src=this.config.url,t.allowFullscreen=!0,t.frameBorder="none",t.style.width="100%",t.style.height="100%",t.id="third-iframe",null===(e=this.config.mount)||void 0===e||e.appendChild(t),s=t,this.events=new v.default,this.instance={setToken:this.setToken.bind(this),print:this.openDocPrint.bind(this),download:this.openDocDownload.bind(this),ApiEvent:{AddApiEventListener:this.addApiEventListener.bind(this),RemoveApiEventListener:this.removeApiEventListener.bind(this)},ready:this.ready.bind(this),tabs:{getTabs:this.getTabs.bind(this),switchTab:this.switchTab.bind(this)},save:this.save.bind(this),destroy:this.destroy.bind(this),iframe:t}},e.prototype.setToken=function(e){console.log("this.config",this.config),this.config.setToken=e,(0,f.setToken)(this.config,s)},e.prototype.openDocPrint=function(){if(s.src.split("/").includes("micsweb"))(0,p.openDocFunc)(p.EVENT_TYPE.PRINT,s);else{this.invoke(p.EVENT_TYPE.PRINT);var e=function(t){var n,r,i;t.data.eventName===p.EVENT_TYPE.PRINT&&(console.log(null===(i=null===(r=null===(n=t.data)||void 0===n?void 0:n.data)||void 0===r?void 0:r.result)||void 0===i?void 0:i.message),window.removeEventListener("message",e))};window.addEventListener("message",e)}},e.prototype.openDocDownload=function(e){e&&e.type?(console.log("openDocDownload: ".concat(p.EVENT_TYPE.DOWNLOAD,"-type:").concat(e.type)),this.invoke(p.EVENT_TYPE.DOWNLOAD,e.type)):(0,p.openDocFunc)(p.EVENT_TYPE.DOWNLOAD,s)},e.prototype.ready=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,new Promise((function(e,t){s.onload=function(){e(!0)}}))]}))}))},e.prototype.save=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.invoke(p.EVENT_TYPE.SAVE),[2,new Promise((function(e,t){var n=function(t){t.data.eventName===p.EVENT_TYPE.SAVE&&(e(t.data.data),window.removeEventListener("message",n))};window.addEventListener("message",n)}))]}))}))},e.prototype.getTabs=function(){return console.log("触发getTabs方法"),this.invoke(p.EVENT_TYPE.GET_TABS),new Promise((function(e,t){var n=function(t){t.data.eventName===p.EVENT_TYPE.GET_TABS&&(e(t.data.data),window.removeEventListener("message",n))};window.addEventListener("message",n)}))},e.prototype.switchTab=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=e.tabKey,[2,new Promise((function(e,n){(0,p.openDocFunc)("action-".concat(p.EVENT_TYPE.SWITCH_TAB),s,{tabKey:t}),e("已切换到".concat(t))}))]}))}))},e.prototype.addApiEventListener=function(e,t){this.events.add(e,t)},e.prototype.removeApiEventListener=function(e,t){this.events.remove(e,t)},e.prototype.destroy=function(){var e=document.getElementById("third-iframe");e.parentNode.removeChild(e),this.instance=null},e.prototype.invoke=function(e,t){(0,p.openDocFunc)("action-".concat(e),s,t)},e.prototype.printExecute=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.instance.print()];case 1:return e=n.sent(),(t=document.createElement("iframe")).setAttribute("style","display:none"),fetch(e).then((function(e){return e.blob()})).then((function(e){var n=URL.createObjectURL(e);t.src=n,document.body.appendChild(t),t.onload=function(){t.contentWindow.print()}})),[2]}}))}))},e}();t.CTX=h},328:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.openDocFunc=t.AddApiListenerType=t.EVENT_TYPE=void 0,function(e){e.PRINT="print",e.DOWNLOAD="download",e.GET_TABS="getTabs",e.SWITCH_TAB="switchTab",e.SAVE="save"}(t.EVENT_TYPE||(t.EVENT_TYPE={})),function(e){e.FILE_OPEN="fileOpen",e.FILE_STATUS="fileStatus",e.ON_USER_LIST_INIT="OnUserListInit",e.ON_USER_JOIN="OnUserJoin",e.ON_USER_QUIT="OnUserQuit"}(t.AddApiListenerType||(t.AddApiListenerType={}));var n=null;t.openDocFunc=function(e,t,r){n=t,function(e){console.log("发送事件:",e);var t=n.contentWindow;t&&t.postMessage(e,"*")}({eventName:e,data:r})}},853:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isPromiseLike=t.setToken=t.setCookie=t.getWappId=void 0;var n,r=null,i=null,o=!0,a=null;function s(e){var t,n;t={eventName:o?"setToken":"setTokenRefresh",data:e},(n=a.contentWindow)&&n.postMessage(t,"*"),o=!1,r=e,i=(new Date).getTime()}function c(e){return e instanceof Promise||"function"==typeof(null==e?void 0:e.then)}t.getWappId=function(e){if(!e.includes("/weboffice/office/d"))return null;var t=e.match(/_w_appid=([^&]+)/);return t?t[1]:null},t.setCookie=function(e){var t=e.name,n=e.value,r=e.expires,i=new Date;i.setTime(i.getTime()+r||6e5),document.cookie="".concat(t,"=").concat(n,";expires=").concat(i.toUTCString(),";path=/")},t.setToken=function(e,t){if(!e.setToken||!e.setToken.token)return console.error("请按照文档规范设置token格式");n=e,window.addEventListener("message",(function(u){"wpsPreviewDidMount"===u.data&&(r=null,i=null,o=!0,a=t,s(e.setToken),"function"==typeof e.refreshToken&&function(e){window.document.addEventListener("visibilitychange",(function(){if("hidden"!==document.visibilityState){var e=(new Date).getTime();if(r&&e-i>r.timeout){var t=n.refreshToken();c(t)?t.then((function(e){s(e)})):s(t)}}}));var t=function(e){s(e),e.timeout&&o(e.timeout)},o=function(e){var r,i=e-3e5;setTimeout((function(){var o=(new Date).getTime(),a=n.refreshToken();if(c(a))a.then((function(n){r=n;var a=(new Date).getTime();setTimeout((function(){t(r)}),i>0?3e5-(a-o):e-(a-o))}));else{r=a;var s=(new Date).getTime();setTimeout((function(){t(r)}),i>0?3e5-(s-o):e-(s-o))}}),i)};o(e)}(e.setToken.timeout))}))},t.isPromiseLike=c},737:function(e,t){function n(e){return new RegExp(/\/weboffice\/office\//).test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptTag=t.encryptTag=t.querystring=t.isLitePreviewUrl=t.isWebofficeUrl=t.isOpenDocUrl=t.parseWebpath=t.parseUrl=t.isJSON=void 0,t.isJSON=function(e){if("string"!=typeof e)return!1;try{var t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(t){return console.log("error:"+e+"!!!"+t),!1}},t.parseUrl=function(e){var t=document.createElement("a");t.href=e;var n=t.hostname,r="80"===t.port||"443"===t.port?"":t.port,i=n+(r?":".concat(r):"");return{href:e,protocol:t.protocol||"",host:i,hostname:n,port:r,search:t.search.replace(t.hash,"")||"",hash:t.hash||"",pathname:0===(t.pathname||"").indexOf("/")?t.pathname||"":"/"+(t.pathname||""),relative:(e.match(/tps?:\/\/[^\/]+(.+)/)||[,""])[1]||"",segments:t.pathname.replace(/^\//,"").split("/")||[],origin:t.protocol+"//"+i||""}},t.parseWebpath=function(e){var t=e||window.location.pathname||"";return t.substring(0,t.lastIndexOf("/docs/viewweb/"))||""},t.isOpenDocUrl=function(e){return new RegExp(/\/micsweb\/viewweb\/reader\//).test(e)},t.isWebofficeUrl=n,t.isLitePreviewUrl=function(e){return n(e)&&e.includes("wpsCachePreview")},t.querystring=function(e){var t=(e||window.location.search).replace(/^(\S*)\?/,"").split("&"),n={};return t.forEach((function(e){var t=e.split("=");n[t[0]]=t[1]})),n};t.encryptTag=function(e,t){if(!e)return"";try{var n=encodeURIComponent(e),r=encodeURIComponent(t),i=btoa(n);return btoa(r)+"_"+i}catch(e){return""}};t.decryptTag=function(e,t){if(!e)return"";var n=e.split("_");if(n.length<2)return"";try{var r=decodeURIComponent(atob(n[1]));return decodeURIComponent(atob(n[0]))!==t?"":r}catch(e){return""}}},882:function(e,t,n){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PLACEHOLDER_TEXT=void 0;var i=n(153);t.DEFAULT_PLACEHOLDER_TEXT=((r={})[i.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT]="请输入文本",r[i.BASE_WIDGET_TYPE.MULTILINE_TEXT]="请输入文本",r[i.BASE_WIDGET_TYPE.HTML]="请输入HTML",r[i.BASE_WIDGET_TYPE.IMAGE]="",r)},210:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0)throw new Error("控件".concat(null==t?void 0:t.id,"不支持修改下列属性:").concat(null===(a=e.get(null==t?void 0:t.id))||void 0===a?void 0:a.join(),",设置失败"));n()}catch(e){n()}},t?[3,2]:[4,this.getWidgetList()]):[2];case 1:if(c=o.sent(),u=null==c?void 0:c.filter((function(e){return(null==e?void 0:e.tag)===n})),!((null==u?void 0:u.length)>0))throw new Error('未检索到和tag = "'.concat(n,'"匹配的控件'));l=function(e){i(e,(function(){var t=r(r({},e),s);m.setWidgetInfo(null==e?void 0:e.id,t)}))};try{for(f=a(u),p=f.next();!p.done;p=f.next())v=p.value,l(v)}catch(e){T={error:e}}finally{try{p&&!p.done&&(g=f.return)&&g.call(f)}finally{if(T)throw T.error}}return[3,5];case 2:return[4,this.getWpsWidgetItem(t)];case 3:return v=o.sent(),[4,this.getWidgetInfo(v)];case 4:if(h=o.sent(),E=r(r({},h),s),n&&(null==h?void 0:h.tag)!==n)throw new Error("未检索到id:".concat(t,'和tag:"').concat(n,'"匹配的控件'));i(E,(function(){m.setWidgetInfo(t,E)})),o.label=5;case 5:return[2]}}))}))},e.prototype.setLocate=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.getWpsWidgetItem(e)];case 1:return[4,t.sent().Locate()];case 2:return t.sent(),[2]}}))}))},e.prototype.hasBasePropertyExist=function(e){var t=[];return["tag","widgetId","widgetName"].forEach((function(n){t.push(!!e[n])})),t.some((function(e){return e}))},e.prototype.deleteWidgetItem=function(e){return i(this,void 0,void 0,(function(){var t,n;return o(this,(function(r){switch(r.label){case 0:return[4,this.getWpsWidgetItem(e)];case 1:return t=r.sent(),[4,this.getWidgetInfo(t)];case 2:return n=r.sent(),[4,t.Delete()];case 3:return r.sent(),[2,n]}}))}))},e.prototype.getWidgetItem=function(e,t){return i(this,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:return t?[4,this.getWpsWidgetItemByIndex(e)]:[3,2];case 1:return r=i.sent(),[3,4];case 2:return[4,this.getWpsWidgetItem(e)];case 3:r=i.sent(),i.label=4;case 4:return n=r,[4,this.getWidgetInfo(n)];case 5:return[2,i.sent()]}}))}))},e.prototype.getWpsWidgetItem=function(e){var t;return i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.wpsInstance.ready()];case 1:return n.sent(),[4,null===(t=this.wpsInstance.Application)||void 0===t?void 0:t.ActiveDocument.ContentControls({ID:e})];case 2:return[2,n.sent()]}}))}))},e.prototype.getWpsWidgetItemByIndex=function(e){var t;return i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.wpsInstance.ready()];case 1:return n.sent(),[2,null===(t=this.wpsInstance)||void 0===t?void 0:t.Application.ActiveDocument.ContentControls.Item(e)]}}))}))},e.prototype.typeIsWidgetType=function(e){var t=[];for(var n in d.WIDGET_TYPE_ENUM)isNaN(Number(n))||t.push(Number(n));return t.includes(e)},e.prototype.initWidgetInfo=function(e){var t,n=e.baseWidgetType,r=e.widgetItem,a=e.range;return i(this,void 0,void 0,(function(){var e,f,p,v,h=this;return o(this,(function(E){switch(E.label){case 0:if(!n)throw new Error("请输入要插入的基础控件类型!");if(isNaN(d.BASE_WIDGET_CONTROL_MAP[n]))throw new Error("基础控件类型不存在!");if(a&&(null==a?void 0:a.end)<=(null==a?void 0:a.start))throw new Error("控件插入的结束位置需要大于起始位置: ".concat(null==a?void 0:a.start,"-").concat(null==a?void 0:a.end));if(n===d.BASE_WIDGET_TYPE.HTML&&!/<(\w+)[^>]*>(.*?<\/\1>)?/i.test(null==r?void 0:r.html))throw new Error("输入HTML内容不合法");f=null!==(t=d.BASE_WIDGET_CONTROL_MAP[n])&&void 0!==t?t:0,E.label=1;case 1:return E.trys.push([1,3,,4]),[4,this.wpsInstance.Application.ActiveDocument.ContentControls.Add(f,{Start:null==a?void 0:a.start,End:null==a?void 0:a.end})];case 2:return e=E.sent(),[3,4];case 3:return[2,E.sent()];case 4:switch(p=function(t){return i(h,void 0,void 0,(function(){var a,s,c=this;return o(this,(function(f){return(s={})[d.WIDGET_SETTING_ENUM.NAME]=function(){return i(c,void 0,void 0,(function(){return o(this,(function(t){return[2,e.Title=(null==r?void 0:r.widgetName)||""]}))}))},s[d.WIDGET_SETTING_ENUM.TAG]=function(){return i(c,void 0,void 0,(function(){var t,i,a,s,c,l,f;return o(this,(function(o){try{t=new URL(null===(f=this.wpsInstance)||void 0===f?void 0:f.url),i=null==t?void 0:t.searchParams,a=null==i?void 0:i.get("_w_appid"),s={tag:(null==r?void 0:r.tag)||"",appId:a,widgetId:d.BASE_WIDGET_IDS[n],dataImportWay:{dataImportType:"hand_write"},baseWidgetType:n||"",widgetType:"base_widget",originType:"base_widget"},c="".concat(JSON.stringify(s)),l=(0,u.encryptTag)(c,a),e.Tag=l}catch(e){throw new Error(e)}return[2]}))}))},s[d.WIDGET_SETTING_ENUM.PLACEHOLDER]=function(){return i(c,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,e.SetPlaceholderText({Text:(null==r?void 0:r.placeholderText)||l.DEFAULT_PLACEHOLDER_TEXT[n]})];case 1:return t.sent(),[2]}}))}))},s[d.WIDGET_SETTING_ENUM.CONTENT]=function(){return i(c,void 0,void 0,(function(){return o(this,(function(t){if(!(null==r?void 0:r.content))return[2];switch(n){case d.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT:case d.BASE_WIDGET_TYPE.MULTILINE_TEXT:e.Content=null==r?void 0:r.content}return[2]}))}))},s[d.WIDGET_SETTING_ENUM.ALLOW_MULTILINE]=function(){return i(c,void 0,void 0,(function(){var t;return o(this,(function(r){return t=n===d.BASE_WIDGET_TYPE.MULTILINE_TEXT,e.MultiLine=t,[2]}))}))},s[d.WIDGET_SETTING_ENUM.IMAGE_SOURCE]=function(){return i(c,void 0,void 0,(function(){var t,i,a,s,c,u,l,f,p,v,h;return o(this,(function(o){switch(o.label){case 0:if(n!==d.BASE_WIDGET_TYPE.IMAGE||!(null==r?void 0:r.imageSource))return[3,2];if(!(null===(i=null==r?void 0:r.imageSource)||void 0===i?void 0:i.imageUrl)&&!(null===(a=null==r?void 0:r.imageSource)||void 0===a?void 0:a.imageData))throw new Error("图片控件数据源缺失!");return[4,e.Shape.Reset()];case 1:if(o.sent(),t=/^(https?:\/\/).*\.(png|jpg|jpeg|gif|webp|svg)$/i,/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i.test(null===(s=null==r?void 0:r.imageSource)||void 0===s?void 0:s.imageData))e.Shape.Data=null===(c=null==r?void 0:r.imageSource)||void 0===c?void 0:c.imageData;else{if(!t.test(null===(u=null==r?void 0:r.imageSource)||void 0===u?void 0:u.imageUrl))throw new Error("图片数据源格式非法!");e.Shape.Url=null===(l=null==r?void 0:r.imageSource)||void 0===l?void 0:l.imageUrl}(null===(f=null==r?void 0:r.imageSource)||void 0===f?void 0:f.width)&&(e.Shape.Width=null===(p=null==r?void 0:r.imageSource)||void 0===p?void 0:p.width),(null===(v=null==r?void 0:r.imageSource)||void 0===v?void 0:v.height)&&(e.Shape.Height=null===(h=null==r?void 0:r.imageSource)||void 0===h?void 0:h.height),o.label=2;case 2:return[2]}}))}))},s[d.WIDGET_SETTING_ENUM.EXTENSION_DATA]=function(){return i(c,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return!0,!0==(n===d.BASE_WIDGET_TYPE.HTML)?[3,1]:[3,4];case 1:return t=null==r?void 0:r.html,t?[4,e.AddOrEditExtensionData([{key:d.EXTENSION_DATA.WIDGET_HTML_FIGMENT,value:t}])]:[3,3];case 2:i.sent(),i.label=3;case 3:case 4:return[3,5];case 5:return[2]}}))}))},s[d.WIDGET_SETTING_ENUM.HTML_PASTE]=function(){return i(c,void 0,void 0,(function(){var t,n,i,a;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),[4,this.wpsInstance.ready()];case 1:return o.sent(),[4,e.LockContents];case 2:return o.sent()&&(e.LockContents=!1),[4,e.Range];case 3:return[4,(t=o.sent()).Start];case 4:return n=o.sent(),[4,t.End];case 5:return i=o.sent(),[4,this.wpsInstance.Application.ActiveDocument.Range(n,i).PasteHtml({HTML:null==r?void 0:r.html}).then((function(){e.LockContents=!0}))];case 6:return o.sent(),[3,8];case 7:throw a=o.sent(),new Error(a);case 8:return[2]}}))}))},s[d.WIDGET_SETTING_ENUM.LOCK_EDIT]=function(){return i(c,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.wpsInstance.ready()];case 1:if(t.sent(),n===d.BASE_WIDGET_TYPE.HTML)e.SetPlaceholderText({Text:(null==r?void 0:r.placeholderText)||l.DEFAULT_PLACEHOLDER_TEXT[n]}),e.LockContents=!0;return[2]}}))}))},a=s,t.forEach((function(e){var t;null===(t=a[e])||void 0===t||t.call(a)})),[2]}))}))},v=[d.WIDGET_SETTING_ENUM.NAME,d.WIDGET_SETTING_ENUM.TAG],n){case d.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT:p(c(c([],s(v),!1),[d.WIDGET_SETTING_ENUM.ALLOW_MULTILINE,d.WIDGET_SETTING_ENUM.CONTENT,d.WIDGET_SETTING_ENUM.PLACEHOLDER],!1));case d.BASE_WIDGET_TYPE.MULTILINE_TEXT:p(c(c([],s(v),!1),[d.WIDGET_SETTING_ENUM.CONTENT,d.WIDGET_SETTING_ENUM.ALLOW_MULTILINE,d.WIDGET_SETTING_ENUM.PLACEHOLDER],!1));break;case d.BASE_WIDGET_TYPE.IMAGE:p(c(c([],s(v),!1),[d.WIDGET_SETTING_ENUM.IMAGE_SOURCE],!1));break;case d.BASE_WIDGET_TYPE.HTML:p(c(c([],s(v),!1),[d.WIDGET_SETTING_ENUM.EXTENSION_DATA,d.WIDGET_SETTING_ENUM.LOCK_EDIT,d.WIDGET_SETTING_ENUM.HTML_PASTE,d.WIDGET_SETTING_ENUM.PLACEHOLDER],!1))}return[2,e]}}))}))},e.prototype.getWidgetInfo=function(e){var t,n,a,s,c,l,p;return i(this,void 0,void 0,(function(){var i,v,h,E,T,g,m,b,w,y,_,I,N,S,L,D,A,O,k,W,G,P;return o(this,(function(o){switch(o.label){case 0:return[4,e.Title];case 1:return i=o.sent()||"",[4,e.Tag];case 2:v=o.sent(),h=new URL(null===(t=this.wpsInstance)||void 0===t?void 0:t.url),E=null==h?void 0:h.searchParams,T=null==E?void 0:E.get("_w_appid"),g=(0,u.decryptTag)(v,T),m="","",b="",w={},y={},_="";try{w=JSON.parse(g),m=(null==w?void 0:w.widgetId)||"",(null==w?void 0:w.widgetName)||""}catch(e){}return[4,e.ID];case 3:return I=o.sent(),[4,e.Type];case 4:return N=o.sent(),[4,e.PlaceholderText];case 5:return S=o.sent(),L=null==w?void 0:w.baseWidgetType,[d.WIDGET_TYPE_ENUM.TEXT,d.WIDGET_TYPE_ENUM.RTF_CONTENT].includes(N)&&[d.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT,d.BASE_WIDGET_TYPE.MULTILINE_TEXT,d.BASE_WIDGET_TYPE.HTML].includes(L)?[4,e.Content]:[3,7];case 6:b=o.sent()||"",o.label=7;case 7:if(N!==d.WIDGET_TYPE_ENUM.IMAGE||L!==d.BASE_WIDGET_TYPE.IMAGE)return[3,16];o.label=8;case 8:return o.trys.push([8,15,,16]),D=y,[4,null===(n=null==e?void 0:e.Shape)||void 0===n?void 0:n.Width];case 9:return D.width=o.sent(),A=y,[4,null===(a=null==e?void 0:e.Shape)||void 0===a?void 0:a.Height];case 10:return A.height=o.sent(),(null===(s=null==e?void 0:e.Shape)||void 0===s?void 0:s.Url)?(O=y,[4,null===(c=null==e?void 0:e.Shape)||void 0===c?void 0:c.Url]):[3,12];case 11:O.imageUrl=o.sent(),o.label=12;case 12:return(null===(l=null==e?void 0:e.Shape)||void 0===l?void 0:l.Data)?(k=y,[4,null===(p=null==e?void 0:e.Shape)||void 0===p?void 0:p.Data]):[3,14];case 13:k.imageData=o.sent(),o.label=14;case 14:return[3,16];case 15:return W=o.sent(),console.error("Error","该控件没有对应的属性",W),[3,16];case 16:return N!==d.WIDGET_TYPE_ENUM.RTF_CONTENT||L!==d.BASE_WIDGET_TYPE.HTML?[3,18]:[4,(0,f.getExtensionData)(this.wpsInstance,I,d.EXTENSION_DATA.WIDGET_HTML_FIGMENT)];case 17:(G=o.sent())&&(_=G.value),o.label=18;case 18:switch(P={widgetId:m,widgetName:i||"",tag:(null==w?void 0:w.tag)||"",id:I,widgetType:null==w?void 0:w.widgetType,baseWidgetType:null==w?void 0:w.baseWidgetType},L){case d.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT:case d.BASE_WIDGET_TYPE.MULTILINE_TEXT:return[2,r(r({},P),{content:b,placeholderText:S})];case d.BASE_WIDGET_TYPE.IMAGE:return[2,r(r({},P),{imageSource:y})];case d.BASE_WIDGET_TYPE.HTML:return[2,r(r({},P),{content:b,placeholderText:S,html:_})]}return[2]}}))}))},e.prototype.setWidgetInfo=function(e,t){return i(this,void 0,void 0,(function(){var n,a,s,c,l,f=this;return o(this,(function(p){switch(p.label){case 0:return[4,this.getWpsWidgetItem(e)];case 1:return[4,(n=p.sent()).LockContents];case 2:return p.sent()&&(n.LockContents=!1),[4,null==n?void 0:n.Tag];case 3:return a=p.sent(),[4,this.getWidgetInfo(n)];case 4:return s=p.sent(),c=null==s?void 0:s.baseWidgetType,[4,null==n?void 0:n.Type];case 5:switch(p.sent(),l=function(e){return i(f,void 0,void 0,(function(){var l,f,p=this;return o(this,(function(v){return(f={})[d.WIDGET_SETTING_ENUM.NAME]=function(){return i(p,void 0,void 0,(function(){return o(this,(function(e){return t.widgetName&&(n.Title=t.widgetName),[2]}))}))},f[d.WIDGET_SETTING_ENUM.TAG]=function(){return i(p,void 0,void 0,(function(){var e,i,s,c,l,d,f;return o(this,(function(o){try{e=new URL(null===(f=this.wpsInstance)||void 0===f?void 0:f.url),i=null==e?void 0:e.searchParams,s=null==i?void 0:i.get("_w_appid"),c=JSON.parse((0,u.decryptTag)(a,s)),l=JSON.stringify(r(r({},c),{tag:null==t?void 0:t.tag})),d=(0,u.encryptTag)(l,s),n.Tag=d}catch(e){console.error("Error",e)}return[2]}))}))},f[d.WIDGET_SETTING_ENUM.PLACEHOLDER]=function(){return i(p,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return(null==t?void 0:t.placeholderText)?(!0,!0==(c===d.BASE_WIDGET_TYPE.HTML)?[3,1]:[3,3]):[3,5];case 1:case 3:return[4,n.SetPlaceholderText({Text:t.placeholderText})];case 2:case 4:return e.sent(),[3,5];case 5:return[2]}}))}))},f[d.WIDGET_SETTING_ENUM.CONTENT]=function(){return i(p,void 0,void 0,(function(){return o(this,(function(e){return(null==t?void 0:t.content)&&c!==d.BASE_WIDGET_TYPE.HTML&&(n.Content=t.content),[2]}))}))},f[d.WIDGET_SETTING_ENUM.ALLOW_MULTILINE]=function(){return i(p,void 0,void 0,(function(){var e;return o(this,(function(r){return e=(null==t?void 0:t.baseWidgetType)===d.BASE_WIDGET_TYPE.MULTILINE_TEXT,(null==s?void 0:s.baseWidgetType)!==d.BASE_WIDGET_TYPE.IMAGE&&(n.MultiLine=e),[2]}))}))},f[d.WIDGET_SETTING_ENUM.IMAGE_SOURCE]=function(){return i(p,void 0,void 0,(function(){var e,r,i,a,s,c,u,l,d,f,p;return o(this,(function(o){switch(o.label){case 0:if(!(null===(r=null==t?void 0:t.imageSource)||void 0===r?void 0:r.imageUrl)&&!(null===(i=null==t?void 0:t.imageSource)||void 0===i?void 0:i.imageData))throw new Error("图片控件数据源缺失!");return[4,n.Shape.Reset()];case 1:if(o.sent(),e=/^(https?:\/\/).*\.(png|jpg|jpeg|gif|webp|svg)$/i,/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i.test(null===(a=null==t?void 0:t.imageSource)||void 0===a?void 0:a.imageData))n.Shape.Data=null===(s=null==t?void 0:t.imageSource)||void 0===s?void 0:s.imageData;else{if(!e.test(null===(c=null==t?void 0:t.imageSource)||void 0===c?void 0:c.imageUrl))throw new Error("图片数据源格式非法!");n.Shape.Url=null===(u=null==t?void 0:t.imageSource)||void 0===u?void 0:u.imageUrl}return(null===(l=null==t?void 0:t.imageSource)||void 0===l?void 0:l.width)&&(n.Shape.Width=null===(d=null==t?void 0:t.imageSource)||void 0===d?void 0:d.width),(null===(f=null==t?void 0:t.imageSource)||void 0===f?void 0:f.height)&&(n.Shape.Height=null===(p=null==t?void 0:t.imageSource)||void 0===p?void 0:p.height),[2]}}))}))},f[d.WIDGET_SETTING_ENUM.EXTENSION_DATA]=function(){return i(p,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return[4,n.LockContents];case 1:return r.sent(),!0,!0==(c===d.BASE_WIDGET_TYPE.HTML)?[3,2]:[3,5];case 2:return e=null==t?void 0:t.html,e?[4,n.AddOrEditExtensionData([{key:d.EXTENSION_DATA.WIDGET_HTML_FIGMENT,value:e}])]:[3,4];case 3:r.sent(),r.label=4;case 4:case 5:return[3,6];case 6:return[2]}}))}))},f[d.WIDGET_SETTING_ENUM.HTML_PASTE]=function(){return i(p,void 0,void 0,(function(){var e,r,i,a;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),(null==t?void 0:t.html)?[4,this.wpsInstance.ready()]:[3,6];case 1:return o.sent(),[4,n.Range];case 2:return[4,(e=o.sent()).Start];case 3:return r=o.sent(),[4,e.End];case 4:return i=o.sent(),[4,this.wpsInstance.Application.ActiveDocument.Range(r,i).PasteHtml({HTML:null==t?void 0:t.html}).then((function(){n.LockContents=!0}))];case 5:o.sent(),o.label=6;case 6:return[3,8];case 7:return a=o.sent(),n.LockContents=!0,console.error(a),[3,8];case 8:return[2]}}))}))},f[d.WIDGET_SETTING_ENUM.LOCK_EDIT]=function(){return i(p,void 0,void 0,(function(){return o(this,(function(e){return[2]}))}))},l=f,e.forEach((function(e){var t;null===(t=l[e])||void 0===t||t.call(l)})),[2]}))}))},c){case d.BASE_WIDGET_TYPE.SINGLE_LINE_TEXT:case d.BASE_WIDGET_TYPE.MULTILINE_TEXT:l([d.WIDGET_SETTING_ENUM.NAME,d.WIDGET_SETTING_ENUM.TAG,d.WIDGET_SETTING_ENUM.PLACEHOLDER,d.WIDGET_SETTING_ENUM.CONTENT,d.WIDGET_SETTING_ENUM.ALLOW_MULTILINE]);break;case d.BASE_WIDGET_TYPE.IMAGE:l([d.WIDGET_SETTING_ENUM.NAME,d.WIDGET_SETTING_ENUM.TAG,d.WIDGET_SETTING_ENUM.IMAGE_SOURCE]);break;case d.BASE_WIDGET_TYPE.HTML:l([d.WIDGET_SETTING_ENUM.NAME,d.WIDGET_SETTING_ENUM.TAG,d.WIDGET_SETTING_ENUM.PLACEHOLDER,d.WIDGET_SETTING_ENUM.EXTENSION_DATA,d.WIDGET_SETTING_ENUM.HTML_PASTE])}return[2]}}))}))},e}();t.Widget=p},153:function(e,t){var n,r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENSION_DATA=t.BASE_WIDGET_IDS=t.BASE_WIDGET_CONTROL_MAP=t.WIDGET_SETTING_ENUM=t.CONTROL_ELEMENT_ENUM=t.BASE_WIDGET_TYPE=t.WIDGET_TYPE=t.WIDGET_TYPE_ENUM=void 0,function(e){e[e.RTF_CONTENT=0]="RTF_CONTENT",e[e.TEXT=1]="TEXT",e[e.IMAGE=2]="IMAGE",e[e.COMBINATION=3]="COMBINATION",e[e.DROP_DOWN=4]="DROP_DOWN",e[e.DATE=6]="DATE",e[e.CHECKBOX=8]="CHECKBOX",e[e.REPEAT=9]="REPEAT"}(i=t.WIDGET_TYPE_ENUM||(t.WIDGET_TYPE_ENUM={})),function(e){e.BASE_WIDGET="base_widget",e.BUSINESS_WIDGET="business_widget"}(t.WIDGET_TYPE||(t.WIDGET_TYPE={})),function(e){e.SINGLE_LINE_TEXT="single_line_text",e.MULTILINE_TEXT="multiline_text",e.IMAGE="image",e.HTML="html"}(o=t.BASE_WIDGET_TYPE||(t.BASE_WIDGET_TYPE={})),function(e){e.BASE_WIDGET="base_widget",e.BUSINESS_WIDGET="business_widget",e.BUSINESS_COMPONENTS="business_components",e.GROUP="group",e.REPEAT_GROUP="repeat_group"}(t.CONTROL_ELEMENT_ENUM||(t.CONTROL_ELEMENT_ENUM={})),function(e){e.NAME="标题",e.TAG="标识符",e.PLACEHOLDER="占位符",e.CONTENT="内容",e.EXTENSION_DATA="拓展属性",e.ALLOW_MULTILINE="设置是否允许换行",e.HTML_PASTE="HTML内容",e.LOCK_EDIT="限制编辑",e.IMAGE_SOURCE="图片数据源"}(t.WIDGET_SETTING_ENUM||(t.WIDGET_SETTING_ENUM={})),t.BASE_WIDGET_CONTROL_MAP=((n={})[o.SINGLE_LINE_TEXT]=i.TEXT,n[o.MULTILINE_TEXT]=i.TEXT,n[o.IMAGE]=i.IMAGE,n[o.HTML]=i.RTF_CONTENT,n),t.BASE_WIDGET_IDS=((r={})[o.SINGLE_LINE_TEXT]="baseSingleLineTextWidgetId",r[o.MULTILINE_TEXT]="baseMultiLineTextWidgetId",r[o.IMAGE]="baseImageWidgetId",r[o.HTML]="baseHTMLWidgetId",r),function(e){e.WIDGET_HTML_FIGMENT="widget_html_figment"}(t.EXTENSION_DATA||(t.EXTENSION_DATA={}))},532:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i
+
+ 全选 +
+ +
+
@@ -75,6 +81,7 @@ import { camelCaseString } from '/@/utils/stringUtil'; import { useUserStore } from '/@/store/modules/user'; import { Icon } from '/@/components/Icon'; + import { CheckOutlined } from '@ant-design/icons-vue'; const emits = defineEmits(['update:value', 'selectedId', 'change']); const { t } = useI18n(); @@ -128,6 +135,7 @@ let resetMemberList = []; const searchPlaceholder = '请输入姓名或工号搜索'; const defaultDepts = ref('') + const departAllSelected = ref(false) if(props.onlyUserCompany) { const userStore = useUserStore(); const userInfo = userStore.getUserInfo; @@ -223,7 +231,22 @@ }); const searchAllMemberTotal = ref(0); const searchAllMemberList = ref([]); - + + watch(searchDepartMemberList, (val) => { + let allSelected = true + searchDepartMemberList.value.forEach(item => { + if(!item.selected) { + allSelected = false + } + }) + if(!searchDepartMemberList.value.length) { + allSelected = false + } + departAllSelected.value = allSelected + }, + { + deep: true + }) async function departChange(e) { searchDepartMemberParams.value.departmentId = e.id; let res = await getUserList(searchDepartMemberParams.value); @@ -260,6 +283,25 @@ return await getUserPageListNew(params); } + function selectAll() { + departAllSelected.value = !departAllSelected.value + if(departAllSelected.value) { + searchDepartMemberList.value.forEach(item => { + if(!item.selected) { + selectedMemberList.value.push(item) + } + item.selected = true + }) + } else { + searchDepartMemberList.value.forEach(item => { + if(item.selected) { + selectedMemberList.value = selectedMemberList.value.filter(m => m.id !== item.id) + } + item.selected = false + }) + } + } + function departCompleted() { treeLoading.value = false; } @@ -441,6 +483,34 @@ height: 100%; display: flex; flex-direction: column; + .select-depart-all { + height: 30px; + padding-left: 14px; + padding-right: 21px; + padding-bottom: 5px; + display: flex; + justify-content: space-between; + align-items: center; + border-radius: 2px; + margin-top: 5px; + border-bottom: 1px solid #eaeaea; + color: #111111; + .select-circle { + width: 16px; + height: 16px; + border: 1px solid rgba(144, 147, 153, 0.7); + border-radius: 50%; + } + .selected { + border: none; + background-color: #5d9cec; + display: flex; + justify-content: center; + align-items: center; + color: white; + font-size: 10px + } + } .user-select-title { } diff --git a/src/components/Form/src/components/Upload.vue b/src/components/Form/src/components/Upload.vue index 2aca9d5..28d53b4 100644 --- a/src/components/Form/src/components/Upload.vue +++ b/src/components/Form/src/components/Upload.vue @@ -70,6 +70,19 @@ 点击上传
+ + + ; + +
+
diff --git a/src/views/editProVar/procVarManage/components/VarModal.vue b/src/views/editProVar/procVarManage/components/VarModal.vue new file mode 100644 index 0000000..4cd9494 --- /dev/null +++ b/src/views/editProVar/procVarManage/components/VarModal.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/views/editProVar/procVarManage/components/config.ts b/src/views/editProVar/procVarManage/components/config.ts new file mode 100644 index 0000000..cbd0c04 --- /dev/null +++ b/src/views/editProVar/procVarManage/components/config.ts @@ -0,0 +1,225 @@ +import {FormProps, FormSchema} from '/@/components/Form'; +import {BasicColumn} from '/@/components/Table'; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '名称', + component: 'Input', + }, + { + field: 'type', + label: '类型', + component: 'Input', + }, + { + field: 'value', + label: '值', + component: 'Input', + }, +]; + +export const columns: BasicColumn[] = [ + { + dataIndex: 'name', + title: '名称', + componentType: 'input', + align: 'left', + sorter: false, + }, + { + dataIndex: 'type', + title: '类型', + componentType: 'input', + align: 'left', + sorter: false, + }, + { + dataIndex: 'value', + title: '值', + componentType: 'input', + align: 'left', + sorter: false + }, +]; + +//表单事件 +export const formEventConfigs = { + 0: [ + { + type: 'circle', + color: '#2774ff', + text: '开始节点', + icon: '#icon-kaishi', + bgcColor: '#D8E5FF', + isUserDefined: false, + }, + { + color: '#F6AB01', + icon: '#icon-chushihua', + text: '初始化表单', + bgcColor: '#f9f5ea', + isUserDefined: false, + nodeInfo: {processEvent: []}, + }, + ], + 1: [ + { + color: '#B36EDB', + icon: '#icon-shujufenxi', + text: '获取表单数据', + detail: '(新增无此操作)', + bgcColor: '#F8F2FC', + isUserDefined: false, + nodeInfo: {processEvent: []}, + }, + ], + 2: [ + { + color: '#F8625C', + icon: '#icon-jiazai', + text: '加载表单', + bgcColor: '#FFF1F1', + isUserDefined: false, + nodeInfo: {processEvent: []}, + }, + ], + 3: [ + { + color: '#6C6AE0', + icon: '#icon-jsontijiao', + text: '提交表单', + bgcColor: '#F5F4FF', + isUserDefined: false, + nodeInfo: {processEvent: []}, + }, + ], + 4: [ + { + type: 'circle', + color: '#F8625C', + text: '结束节点', + icon: '#icon-jieshuzhiliao', + bgcColor: '#FFD6D6', + isLast: true, + isUserDefined: false, + }, + ], +}; + +export const formProps: FormProps = { + labelCol: {span: 3, offset: 0}, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: 'f3a754603cf54ea98d8a05eee8fbb1ea', + field: 'name', + label: '名称', + type: 'input', + component: 'Input', + colProps: {span: 24}, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + placeholder: '请输入名称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: true, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: {width: '100%'}, + }, + }, + { + key: 'fb6f3446078f47468407d8514614f5f0', + field: 'type', + label: '类型', + type: 'input', + component: 'Input', + colProps: {span: 24}, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + placeholder: '请输入类型', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: {width: '100%'}, + }, + }, + { + key: 'd1d2c89ec84b4f039be9debce7bdaa88', + field: 'value', + label: '值', + type: 'input', + component: 'Input', + colProps: {span: 24}, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + placeholder: '请输入值', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: false, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: {width: '100%'}, + }, + }, + ], + showActionButtonGroup: false, + buttonLocation: 'center', + actionColOptions: {span: 24}, + showResetButton: false, + showSubmitButton: false, + hiddenComponent: [], +}; diff --git a/src/views/editProVar/procVarManage/components/procVarManageModal.vue b/src/views/editProVar/procVarManage/components/procVarManageModal.vue new file mode 100644 index 0000000..8e7eb47 --- /dev/null +++ b/src/views/editProVar/procVarManage/components/procVarManageModal.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/views/editProVar/procVarManage/components/workflowPermission.ts b/src/views/editProVar/procVarManage/components/workflowPermission.ts new file mode 100644 index 0000000..dc72571 --- /dev/null +++ b/src/views/editProVar/procVarManage/components/workflowPermission.ts @@ -0,0 +1,47 @@ +export const permissionList = [ + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '名称', + fieldId: 'name', + isSubTable: false, + showChildren: true, + type: 'input', + key: 'f3a754603cf54ea98d8a05eee8fbb1ea', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '类型', + fieldId: 'type', + isSubTable: false, + showChildren: true, + type: 'input', + key: 'fb6f3446078f47468407d8514614f5f0', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '值', + fieldId: 'value', + isSubTable: false, + showChildren: true, + type: 'input', + key: 'd1d2c89ec84b4f039be9debce7bdaa88', + children: [], + }, +]; diff --git a/src/views/editProVar/procVarManage/index.vue b/src/views/editProVar/procVarManage/index.vue new file mode 100644 index 0000000..affc5da --- /dev/null +++ b/src/views/editProVar/procVarManage/index.vue @@ -0,0 +1,339 @@ + + + + + diff --git a/src/views/generator/desktop/index.vue b/src/views/generator/desktop/index.vue index fda2aff..a52e7ae 100644 --- a/src/views/generator/desktop/index.vue +++ b/src/views/generator/desktop/index.vue @@ -21,7 +21,7 @@ :key="data.renderKey" >
-
+
{{ t('设计') }}
{ return h(Image, { - src: record.fileUrl, + src: record.fileUrlFixed, width: '60px', height: '22px', }); diff --git a/src/views/workflow/task/components/flow/FlowPanel.vue b/src/views/workflow/task/components/flow/FlowPanel.vue index 051ccdb..59f0ee0 100644 --- a/src/views/workflow/task/components/flow/FlowPanel.vue +++ b/src/views/workflow/task/components/flow/FlowPanel.vue @@ -18,9 +18,12 @@ - + + + + { if (props.id) { - data.info = { ...defaultInfo, ...cloneDeep(props.info) }; - if (data.info.fileType === StampFileTypeAttributes.UPLOAD_PICTURES) { - data.photoUrl = data.info.fileUrl; - } else { - data.signUrl = data.info.fileUrl; - } + data.info = { ...defaultInfo, ...cloneDeep(props.info) }; + // 回显时使用fileUrlFixed(如果有),否则使用fileUrl(改了) + const displayUrl = props.info.fileUrlFixed || props.info.fileUrl; + + if (data.info.fileType === StampFileTypeAttributes.UPLOAD_PICTURES) { + data.photoUrl = displayUrl; // 显示用 + } else { + data.signUrl = displayUrl; // 显示用 + } } else { data.info = defaultInfo; } @@ -221,9 +224,13 @@ data.info.fileUrl = base64; const blob = dataURLtoBlob(base64); - const fileUrl = await uploadBlobApi(blob, t('手写签名.png')); - if (fileUrl) { - data.signUrl = fileUrl; + const response = await uploadBlobApi(blob, t('手写签名.png')); + if (response) { + // 存储原始URL到info.fileUrl(用于提交)(改了) + data.info.fileUrl = response.fileUrl; + + // 显示使用fileUrlFixed(如果有),否则使用fileUrl(改了) + data.signUrl = response.fileUrlFixed || response.fileUrl; message.success(t('手写签章上传成功')); } else { message.error(t('手写签章上传失败')); @@ -283,7 +290,11 @@ if (info.file && info.file.response && info.file.response.code == 0) { message.success(t(`{name}上传成功!`, { name: info.file.name })); console.log(info, t('上传成功')); - data.photoUrl = info.file.response.data.fileUrl; + // 存储原始URL到info.fileUrl(用于提交)(改了) + data.info.fileUrl = info.file.response.data.fileUrl; + + // 显示使用fileUrlFixed(如果有),否则使用fileUrl (改了) + data.photoUrl = info.file.response.data.fileUrlFixed || info.file.response.data.fileUrl; } else { message.error(t('上传照片失败')); } diff --git a/types/config.d.ts b/types/config.d.ts index 5cc77f3..9968e29 100644 --- a/types/config.d.ts +++ b/types/config.d.ts @@ -140,7 +140,7 @@ export interface GlobConfig { urlPrefix?: string; // Project abbreviation shortName: string; - tenantEnabled: boolean; + tenantEnabled: boolean; // outlink outLink?: string; //print url @@ -163,8 +163,10 @@ export interface GlobEnvConfig { //file preview VITE_GLOB_UPLOAD_PREVIEW?: string; VITE_GLOB_REPORT_URL: string; - VITE_GLOB_TENANT_ENABLED: boolean; + VITE_GLOB_TENANT_ENABLED: boolean; + VITE_GLOB_DISABLE_NEWS: boolean; VITE_GLOB_CLOSE_ALERT_DISABLED: boolean; + VITE_GLOB_TENANT_INPUT_REQUIRED: boolean; } export interface LogoConfig {