Built files from Bizgaze WebServer
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

documentmanager.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Unibase;
  11. (function (Unibase) {
  12. let Apps;
  13. (function (Apps) {
  14. let Collaboration;
  15. (function (Collaboration) {
  16. class DocumentManager extends Unibase.Platform.Core.BaseManager {
  17. getDocumentFileInfo(Id) {
  18. return __awaiter(this, void 0, void 0, function* () {
  19. const url = 'apis/v4/collaboration/unicloud/files/getdocumentfile/id/' + Id;
  20. return yield this.dataHelper().getAsync(url).then(function (response) {
  21. if (response.result !== null)
  22. response.result = JSON.parse(response.result);
  23. return response;
  24. });
  25. });
  26. }
  27. getJsonData(Id) {
  28. return __awaiter(this, void 0, void 0, function* () {
  29. const url = 'apis/v4/collaboration/unicloud/files/getjsondata/id/' + Id;
  30. return yield this.dataHelper().getAsync(url).then(function (response) {
  31. if (response.result !== null)
  32. response.result = JSON.parse(response.result);
  33. return response;
  34. });
  35. });
  36. }
  37. toJsonData(Id) {
  38. return __awaiter(this, void 0, void 0, function* () {
  39. const url = 'apis/v4/collaboration/unicloud/files/tojsondata/id/' + Id;
  40. return yield this.dataHelper().getAsync(url).then(function (response) {
  41. if (response.result !== null)
  42. response.result = JSON.parse(response.result);
  43. return response;
  44. });
  45. });
  46. }
  47. spreadSheetDownload(data) {
  48. return __awaiter(this, void 0, void 0, function* () {
  49. const url = 'apis/v4/collaboration/unicloud/files/downloadspreadsheet';
  50. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  51. if (response.result !== null)
  52. response.result = JSON.parse(response.result);
  53. return response;
  54. });
  55. });
  56. }
  57. saveWord(data) {
  58. return __awaiter(this, void 0, void 0, function* () {
  59. const url = '/apis/v4/collaboration/unicloud/files/saveword';
  60. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  61. if (response.result !== null)
  62. response.result = JSON.parse(response.result);
  63. return response;
  64. });
  65. });
  66. }
  67. saveSpreadSheet(data) {
  68. return __awaiter(this, void 0, void 0, function* () {
  69. const url = '/apis/v4/collaboration/unicloud/files/savespreadsheet';
  70. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  71. if (response.result !== null)
  72. response.result = JSON.parse(response.result);
  73. return response;
  74. });
  75. });
  76. }
  77. ConvertDocstoPdfDownload(id) {
  78. return __awaiter(this, void 0, void 0, function* () {
  79. const url = 'apis/v4/collaboration/unicloud/files/downloadpdffromword/id/' + id;
  80. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  81. if (response.result !== null)
  82. response.result = JSON.parse(response.result);
  83. return response;
  84. });
  85. });
  86. }
  87. getDocumentBase64FileDownload(Id) {
  88. return __awaiter(this, void 0, void 0, function* () {
  89. const url = 'apis/v4/unibase/platform/files/getebase64documentfile/id/' + Id;
  90. return yield this.dataHelper().getAsync(url).then(function (response) {
  91. if (response.result !== null)
  92. response.result = JSON.parse(response.result);
  93. return response;
  94. });
  95. });
  96. }
  97. importCreateSpreadSheet(data) {
  98. return __awaiter(this, void 0, void 0, function* () {
  99. const url = 'apis/v4/collaboration/unicloud/files/createnewspreadsheet';
  100. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  101. if (response.result !== null)
  102. response.result = JSON.parse(response.result);
  103. return response;
  104. });
  105. });
  106. }
  107. importReplaceSpreadSheet(data) {
  108. return __awaiter(this, void 0, void 0, function* () {
  109. const url = 'apis/v4/collaboration/unicloud/files/replacespreadsheet';
  110. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  111. if (response.result !== null)
  112. response.result = JSON.parse(response.result);
  113. return response;
  114. });
  115. });
  116. }
  117. insertNewSpreadsheet(data) {
  118. return __awaiter(this, void 0, void 0, function* () {
  119. const url = 'apis/v4/collaboration/unicloud/files/insertnewspreadsheet';
  120. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  121. if (response.result !== null)
  122. response.result = JSON.parse(response.result);
  123. return response;
  124. });
  125. });
  126. }
  127. copyOfCurrentDocument(data) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. const url = 'apis/v4/collaboration/unicloud/files/copyspreadsheet';
  130. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  131. if (response.result !== null)
  132. response.result = JSON.parse(response.result);
  133. return response;
  134. });
  135. });
  136. }
  137. renameFileTitle(data) {
  138. return __awaiter(this, void 0, void 0, function* () {
  139. const url = 'apis/v4/collaboration/unicloud/files/replacefiletitle';
  140. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  141. if (response.result !== null)
  142. response.result = JSON.parse(response.result);
  143. return response;
  144. });
  145. });
  146. }
  147. spellCheck(data) {
  148. return __awaiter(this, void 0, void 0, function* () {
  149. const url = 'https://plugins.spellcheck.bizgaze.com/api/documenteditor/SpellCheck';
  150. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  151. if (response !== null)
  152. response = JSON.parse(response);
  153. return response;
  154. });
  155. });
  156. }
  157. ssAutoSave(data) {
  158. return __awaiter(this, void 0, void 0, function* () {
  159. const url = '/apis/v4/collaboration/unicloud/files/spreadsheetautosave';
  160. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  161. if (response.result !== null)
  162. response.result = JSON.parse(response.result);
  163. return response;
  164. });
  165. });
  166. }
  167. CopySheetInToExistingWorkbook(data) {
  168. return __awaiter(this, void 0, void 0, function* () {
  169. const url = '/apis/v4/collaboration/unicloud/files/copysheetintoexistingworkbook/';
  170. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  171. if (response.result !== null)
  172. response.result = JSON.parse(response.result);
  173. return response;
  174. });
  175. });
  176. }
  177. CopySheetToNewSpreadsheet(data) {
  178. return __awaiter(this, void 0, void 0, function* () {
  179. const url = 'apis/v4/collaboration/unicloud/files/copysheettonewspreadsheet';
  180. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  181. if (response.result !== null)
  182. response.result = JSON.parse(response.result);
  183. return response;
  184. });
  185. });
  186. }
  187. lastEdit(Id) {
  188. return __awaiter(this, void 0, void 0, function* () {
  189. const url = 'apis/v4/collaboration/unicloud/files/getversiondetails/id/' + Id;
  190. return yield this.dataHelper().getAsync(url).then(function (response) {
  191. if (response.result !== null)
  192. response.result = JSON.parse(response.result);
  193. return response;
  194. });
  195. });
  196. }
  197. rollBackFileData(Id) {
  198. return __awaiter(this, void 0, void 0, function* () {
  199. const url = 'apis/v4/collaboration/unicloud/files/restorejsondatatofiledata/id/' + Id;
  200. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  201. if (response.result !== null)
  202. response.result = JSON.parse(response.result);
  203. return response;
  204. });
  205. });
  206. }
  207. ConvertSpreadsheettoOdsDownload(id) {
  208. return __awaiter(this, void 0, void 0, function* () {
  209. const url = 'apis/v4/collaboration/unicloud/files/downloadodsfromExcel/id/' + id;
  210. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  211. if (response.result !== null)
  212. response.result = JSON.parse(response.result);
  213. return response;
  214. });
  215. });
  216. }
  217. getPermissionLevel(fileId, uid) {
  218. return __awaiter(this, void 0, void 0, function* () {
  219. const url = 'apis/v4/collaboration/unicloud/files/getpermissionlevel/id/' + fileId + "/uid/" + uid;
  220. return yield this.dataHelper().getAsync(url).then(function (response) {
  221. if (response.result !== null)
  222. response.result = JSON.parse(response.result);
  223. return response;
  224. });
  225. });
  226. }
  227. getCustomJsonData(Id) {
  228. return __awaiter(this, void 0, void 0, function* () {
  229. const url = 'apis/v4/collaboration/unicloud/files/getcustomjsondata/id/' + Id;
  230. return yield this.dataHelper().getAsync(url).then(function (response) {
  231. if (response.result !== null)
  232. response.result = JSON.parse(response.result);
  233. return response;
  234. });
  235. });
  236. }
  237. saveSheetColor(data) {
  238. return __awaiter(this, void 0, void 0, function* () {
  239. const url = 'apis/v4/collaboration/unicloud/files/savesheetcolor';
  240. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  241. if (response.result !== null)
  242. response.result = JSON.parse(JSON.parse(response.result));
  243. return response;
  244. });
  245. });
  246. }
  247. updateSheetColorIndex(data) {
  248. return __awaiter(this, void 0, void 0, function* () {
  249. const url = 'apis/v4/collaboration/unicloud/files/updatesheetindex';
  250. return yield this.dataHelper().postAsync(url, data).then(function (response) {
  251. if (response.result !== null)
  252. response.result = JSON.parse(JSON.parse(response.result));
  253. return response;
  254. });
  255. });
  256. }
  257. getRecentViews(Id) {
  258. return __awaiter(this, void 0, void 0, function* () {
  259. const url = '/apis/v4/collaboration/unicloud/files/getrecentviews/id/' + Id;
  260. return yield this.dataHelper().getAsync(url).then(function (response) {
  261. if (response.result !== null)
  262. response.result = JSON.parse(response.result);
  263. return response;
  264. });
  265. });
  266. }
  267. getLinkInfo(fileid) {
  268. return __awaiter(this, void 0, void 0, function* () {
  269. const url = 'apis/v4/collaboration/unicloud/files/linkinfo/id/' + fileid;
  270. return yield this.dataHelper().getAsync(url).then(function (response) {
  271. if (response.result !== null)
  272. response.result = JSON.parse(response.result);
  273. return response;
  274. });
  275. });
  276. }
  277. static Instance() {
  278. if (this.instance === undefined) {
  279. this.instance = new DocumentManager();
  280. }
  281. return this.instance;
  282. }
  283. }
  284. Collaboration.DocumentManager = DocumentManager;
  285. })(Collaboration = Apps.Collaboration || (Apps.Collaboration = {}));
  286. })(Apps = Unibase.Apps || (Unibase.Apps = {}));
  287. })(Unibase || (Unibase = {}));