venus-design 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -0
  3. package/dist/CheckBoxInput/index.d.ts +3 -0
  4. package/dist/CheckBoxInput/index.js +77 -0
  5. package/dist/Config/api.d.ts +38 -0
  6. package/dist/Config/api.js +432 -0
  7. package/dist/Config/constants.d.ts +23 -0
  8. package/dist/Config/constants.js +29 -0
  9. package/dist/Config/proxy.d.ts +165 -0
  10. package/dist/Config/proxy.js +234 -0
  11. package/dist/Config/request.d.ts +5 -0
  12. package/dist/Config/request.js +261 -0
  13. package/dist/Config/storage.d.ts +18 -0
  14. package/dist/Config/storage.js +108 -0
  15. package/dist/Config/utils.d.ts +32 -0
  16. package/dist/Config/utils.js +245 -0
  17. package/dist/DownLoad/index.d.ts +48 -0
  18. package/dist/DownLoad/index.js +246 -0
  19. package/dist/DownLoadFile/index.d.ts +48 -0
  20. package/dist/DownLoadFile/index.js +232 -0
  21. package/dist/NotificationManager/index.d.ts +6 -0
  22. package/dist/NotificationManager/index.js +48 -0
  23. package/dist/NumberPercent/index.d.ts +11 -0
  24. package/dist/NumberPercent/index.js +49 -0
  25. package/dist/NumberPercent/styles.less +18 -0
  26. package/dist/NumberUnits/index.d.ts +5 -0
  27. package/dist/NumberUnits/index.js +55 -0
  28. package/dist/NumberUnits/styles.less +18 -0
  29. package/dist/ProForm/index.d.ts +122 -0
  30. package/dist/ProForm/index.js +868 -0
  31. package/dist/ProForm/styles.less +59 -0
  32. package/dist/RadioAndInput/index.d.ts +3 -0
  33. package/dist/RadioAndInput/index.js +95 -0
  34. package/dist/Search/index.d.ts +3 -0
  35. package/dist/Search/index.js +111 -0
  36. package/dist/TreeSelect/index.d.ts +17 -0
  37. package/dist/TreeSelect/index.js +117 -0
  38. package/dist/Upload/index.d.ts +3 -0
  39. package/dist/Upload/index.js +145 -0
  40. package/dist/Upload/styles.less +46 -0
  41. package/dist/UploadImage/index.d.ts +3 -0
  42. package/dist/UploadImage/index.js +99 -0
  43. package/dist/VenusUpload/index.d.ts +12 -0
  44. package/dist/VenusUpload/index.js +72 -0
  45. package/dist/VenusUpload/services.d.ts +1 -0
  46. package/dist/VenusUpload/services.js +10 -0
  47. package/dist/common.less +48 -0
  48. package/dist/index.d.ts +18 -0
  49. package/dist/index.js +18 -0
  50. package/package.json +97 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) j14208656797@163.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # venus-design
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/venus-design.svg?style=flat)](https://npmjs.org/package/venus-design)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/venus-design.svg?style=flat)](https://npmjs.org/package/venus-design)
5
+
6
+ venus all compoments
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ npm install
21
+
22
+ # develop library by docs demo
23
+ $ npm start
24
+
25
+ # build library source code
26
+ $ npm run build
27
+
28
+ # build library source code in watch mode
29
+ $ npm run build:watch
30
+
31
+ # build docs
32
+ $ npm run docs:build
33
+
34
+ # Locally preview the production build.
35
+ $ npm run docs:preview
36
+
37
+ # check your project for potential problems
38
+ $ npm run doctor
39
+ ```
40
+
41
+ ## LICENSE
42
+
43
+ MIT
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CheckBoxInput: (props: any) => React.JSX.Element;
3
+ export default CheckBoxInput;
@@ -0,0 +1,77 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ import "antd/es/input/style";
3
+ import _Input from "antd/es/input";
4
+ import "antd/es/checkbox/style";
5
+ import _Checkbox from "antd/es/checkbox";
6
+ var _excluded = ["comAttr", "radioAttr", "valueEnum", "options", "placeholder", "disabled"];
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+ import React, { useState, useEffect } from 'react';
21
+ var CheckBoxInput = function CheckBoxInput(props) {
22
+ var _props$comAttr = props.comAttr,
23
+ comAttr = _props$comAttr === void 0 ? {} : _props$comAttr,
24
+ _props$radioAttr = props.radioAttr,
25
+ radioAttr = _props$radioAttr === void 0 ? {} : _props$radioAttr,
26
+ _props$valueEnum = props.valueEnum,
27
+ valueEnum = _props$valueEnum === void 0 ? {} : _props$valueEnum,
28
+ options = props.options,
29
+ placeholder = props.placeholder,
30
+ disabled = props.disabled,
31
+ others = _objectWithoutProperties(props, _excluded);
32
+ var _useState = useState({}),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ inputValues = _useState2[0],
35
+ setInputValues = _useState2[1];
36
+ useEffect(function () {
37
+ props.onChange(inputValues);
38
+ }, [inputValues]);
39
+ var handleCheckboxChange = function handleCheckboxChange(checkboxValue) {
40
+ setInputValues(function (prevInputValues) {
41
+ return checkboxValue.reduce(function (result, value) {
42
+ return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, value, prevInputValues[value] || ''));
43
+ }, {});
44
+ });
45
+ };
46
+ var handleInputChange = function handleInputChange(e, checkboxValue) {
47
+ setInputValues(function (prevInputValues) {
48
+ return _objectSpread(_objectSpread({}, prevInputValues), {}, _defineProperty({}, checkboxValue, e.target.value));
49
+ });
50
+ };
51
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Checkbox.Group, {
52
+ disabled: disabled,
53
+ onChange: handleCheckboxChange
54
+ }, Object.keys(valueEnum).map(function (ls) {
55
+ return /*#__PURE__*/React.createElement("div", {
56
+ style: {
57
+ display: "flex"
58
+ },
59
+ key: ls
60
+ }, /*#__PURE__*/React.createElement(_Checkbox, {
61
+ style: {
62
+ flex: 2
63
+ },
64
+ value: ls
65
+ }, valueEnum[ls]), inputValues[ls] != undefined ? /*#__PURE__*/React.createElement(_Input, {
66
+ disabled: disabled,
67
+ style: {
68
+ flex: 1
69
+ },
70
+ value: inputValues[ls],
71
+ onChange: function onChange(e) {
72
+ return handleInputChange(e, ls);
73
+ }
74
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null));
75
+ })));
76
+ };
77
+ export default CheckBoxInput;
@@ -0,0 +1,38 @@
1
+ export declare function getUserInfo(): Promise<any>;
2
+ export declare function getLockScreenTime(): Promise<any>;
3
+ export declare function getMenuConfig(): Promise<any>;
4
+ export declare function addMenuConfig(data: any): Promise<any>;
5
+ export declare function editMenuConfig(data: any): Promise<any>;
6
+ export declare function getUserMenu(): Promise<any>;
7
+ export declare function getMenus(): Promise<any>;
8
+ export declare function getDifyConfigs(): Promise<any>;
9
+ export declare function deleteFile(fileName: string): Promise<any>;
10
+ export declare function validateLogin(username: string, password: string): Promise<any>;
11
+ export declare function deleteNewFile(fileName: string): Promise<any>;
12
+ export declare function downloadFile(fileName: string): string;
13
+ export declare function venusAi(): string;
14
+ export declare function uploadFile(): string;
15
+ export declare function updateSecLevelId(fileId: string, levelId: string): Promise<any>;
16
+ export declare function fileByAssId(assId: string): Promise<any>;
17
+ export declare function mnLoginDify(data: any): Promise<any>;
18
+ export declare function refreshTokenFn(refreshTokenStr: string): Promise<any>;
19
+ /**
20
+ * 查询文件
21
+ * @param val
22
+ */
23
+ export declare const getFileData: (assId: string) => Promise<{
24
+ id: any;
25
+ name: any;
26
+ fileUidName: any;
27
+ secId: {
28
+ label: any;
29
+ value: any;
30
+ };
31
+ uid: any;
32
+ response: {
33
+ code: number;
34
+ data: {
35
+ id: any;
36
+ };
37
+ };
38
+ }[]>;
@@ -0,0 +1,432 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
7
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
+ import { request, hostMap, storage } from "./..";
9
+
10
+ /*
11
+ * 获取 当前的登录用户信息
12
+ */
13
+ export function getUserInfo() {
14
+ return _getUserInfo.apply(this, arguments);
15
+ }
16
+ /*
17
+ * 获取锁屏时间
18
+ */
19
+ function _getUserInfo() {
20
+ _getUserInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
21
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
22
+ while (1) switch (_context2.prev = _context2.next) {
23
+ case 0:
24
+ return _context2.abrupt("return", request("/current_user", {
25
+ method: 'get'
26
+ }));
27
+ case 1:
28
+ case "end":
29
+ return _context2.stop();
30
+ }
31
+ }, _callee2);
32
+ }));
33
+ return _getUserInfo.apply(this, arguments);
34
+ }
35
+ export function getLockScreenTime() {
36
+ return _getLockScreenTime.apply(this, arguments);
37
+ }
38
+
39
+ /*
40
+ * 获取 当前的登录用户菜单配置信息
41
+ */
42
+ function _getLockScreenTime() {
43
+ _getLockScreenTime = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
44
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
45
+ while (1) switch (_context3.prev = _context3.next) {
46
+ case 0:
47
+ return _context3.abrupt("return", request("/sysconfig/get/config/login/001", {
48
+ method: 'get'
49
+ }));
50
+ case 1:
51
+ case "end":
52
+ return _context3.stop();
53
+ }
54
+ }, _callee3);
55
+ }));
56
+ return _getLockScreenTime.apply(this, arguments);
57
+ }
58
+ export function getMenuConfig() {
59
+ return _getMenuConfig.apply(this, arguments);
60
+ }
61
+
62
+ /*
63
+ * 新增 当前的登录用户菜单配置信息
64
+ */
65
+ function _getMenuConfig() {
66
+ _getMenuConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
67
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
68
+ while (1) switch (_context4.prev = _context4.next) {
69
+ case 0:
70
+ return _context4.abrupt("return", request("/menuConfig/getMenuConfig", {
71
+ method: 'get'
72
+ }));
73
+ case 1:
74
+ case "end":
75
+ return _context4.stop();
76
+ }
77
+ }, _callee4);
78
+ }));
79
+ return _getMenuConfig.apply(this, arguments);
80
+ }
81
+ export function addMenuConfig(_x) {
82
+ return _addMenuConfig.apply(this, arguments);
83
+ }
84
+
85
+ /*
86
+ * 修改 当前的登录用户菜单配置信息
87
+ */
88
+ function _addMenuConfig() {
89
+ _addMenuConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
90
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
91
+ while (1) switch (_context5.prev = _context5.next) {
92
+ case 0:
93
+ return _context5.abrupt("return", request("/menuConfig/save", {
94
+ method: 'post',
95
+ data: data
96
+ }));
97
+ case 1:
98
+ case "end":
99
+ return _context5.stop();
100
+ }
101
+ }, _callee5);
102
+ }));
103
+ return _addMenuConfig.apply(this, arguments);
104
+ }
105
+ export function editMenuConfig(_x2) {
106
+ return _editMenuConfig.apply(this, arguments);
107
+ }
108
+ /*
109
+ * 获取 当前的登录用户菜单信息信息
110
+ */
111
+ function _editMenuConfig() {
112
+ _editMenuConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
113
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
114
+ while (1) switch (_context6.prev = _context6.next) {
115
+ case 0:
116
+ return _context6.abrupt("return", request("/menuConfig/edit", {
117
+ method: 'put',
118
+ data: data
119
+ }));
120
+ case 1:
121
+ case "end":
122
+ return _context6.stop();
123
+ }
124
+ }, _callee6);
125
+ }));
126
+ return _editMenuConfig.apply(this, arguments);
127
+ }
128
+ export function getUserMenu() {
129
+ return _getUserMenu.apply(this, arguments);
130
+ }
131
+
132
+ /*
133
+ * 获取 当前的登录用户菜单信息信息
134
+ */
135
+ function _getUserMenu() {
136
+ _getUserMenu = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
137
+ var ownerApp, ownerId;
138
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
139
+ while (1) switch (_context7.prev = _context7.next) {
140
+ case 0:
141
+ ownerApp = storage.getSessionItem("OWNER_APP");
142
+ ownerId = ownerApp != null ? ownerApp.innerId : "9f245aa52fd8bbca0db0755d080c832e";
143
+ return _context7.abrupt("return", request("/menu?ownerId=".concat(ownerId), {
144
+ method: 'get'
145
+ }));
146
+ case 3:
147
+ case "end":
148
+ return _context7.stop();
149
+ }
150
+ }, _callee7);
151
+ }));
152
+ return _getUserMenu.apply(this, arguments);
153
+ }
154
+ export function getMenus() {
155
+ return _getMenus.apply(this, arguments);
156
+ }
157
+ /*
158
+ * 获取 dify配置信息
159
+ */
160
+ function _getMenus() {
161
+ _getMenus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
162
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
163
+ while (1) switch (_context8.prev = _context8.next) {
164
+ case 0:
165
+ return _context8.abrupt("return", request("/menu", {
166
+ method: 'get'
167
+ }));
168
+ case 1:
169
+ case "end":
170
+ return _context8.stop();
171
+ }
172
+ }, _callee8);
173
+ }));
174
+ return _getMenus.apply(this, arguments);
175
+ }
176
+ export function getDifyConfigs() {
177
+ return _getDifyConfigs.apply(this, arguments);
178
+ }
179
+ /*
180
+ * 删除附件
181
+ */
182
+ function _getDifyConfigs() {
183
+ _getDifyConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
184
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
185
+ while (1) switch (_context9.prev = _context9.next) {
186
+ case 0:
187
+ return _context9.abrupt("return", request("/venusocr/getDifyConfig", {
188
+ method: 'get',
189
+ prefix: "/tdm"
190
+ }));
191
+ case 1:
192
+ case "end":
193
+ return _context9.stop();
194
+ }
195
+ }, _callee9);
196
+ }));
197
+ return _getDifyConfigs.apply(this, arguments);
198
+ }
199
+ export function deleteFile(_x3) {
200
+ return _deleteFile.apply(this, arguments);
201
+ }
202
+
203
+ /*
204
+ * 锁屏登录
205
+ */
206
+ function _deleteFile() {
207
+ _deleteFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(fileName) {
208
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
209
+ while (1) switch (_context10.prev = _context10.next) {
210
+ case 0:
211
+ return _context10.abrupt("return", request("/file/delete?fileName=".concat(fileName), {
212
+ method: 'get',
213
+ prefix: '/fileApi'
214
+ }));
215
+ case 1:
216
+ case "end":
217
+ return _context10.stop();
218
+ }
219
+ }, _callee10);
220
+ }));
221
+ return _deleteFile.apply(this, arguments);
222
+ }
223
+ export function validateLogin(_x4, _x5) {
224
+ return _validateLogin.apply(this, arguments);
225
+ }
226
+ /*
227
+ * 删除附件
228
+ */
229
+ function _validateLogin() {
230
+ _validateLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(username, password) {
231
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
232
+ while (1) switch (_context11.prev = _context11.next) {
233
+ case 0:
234
+ return _context11.abrupt("return", request("/userOnline/validateLogin", {
235
+ data: {
236
+ username: username,
237
+ password: password
238
+ },
239
+ method: 'post'
240
+ }));
241
+ case 1:
242
+ case "end":
243
+ return _context11.stop();
244
+ }
245
+ }, _callee11);
246
+ }));
247
+ return _validateLogin.apply(this, arguments);
248
+ }
249
+ export function deleteNewFile(_x6) {
250
+ return _deleteNewFile.apply(this, arguments);
251
+ }
252
+ /*
253
+ * 下载附件
254
+ */
255
+ function _deleteNewFile() {
256
+ _deleteNewFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(fileName) {
257
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
258
+ while (1) switch (_context12.prev = _context12.next) {
259
+ case 0:
260
+ return _context12.abrupt("return", request("/file/".concat(fileName), {
261
+ method: 'delete',
262
+ prefix: '/fileApi'
263
+ }));
264
+ case 1:
265
+ case "end":
266
+ return _context12.stop();
267
+ }
268
+ }, _callee12);
269
+ }));
270
+ return _deleteNewFile.apply(this, arguments);
271
+ }
272
+ export function downloadFile(fileName) {
273
+ var host = hostMap['fileApi'][process.env.NODE_ENV || 'development'];
274
+ var prefix = process.env.NODE_ENV === 'production' ? host : '/fileApi';
275
+ return "".concat(prefix, "/file/download?fileId=").concat(fileName);
276
+ }
277
+
278
+ /*
279
+ *
280
+ */
281
+ export function venusAi() {
282
+ var host = hostMap['venusAi'][process.env.NODE_ENV || 'development'];
283
+ var prefix = process.env.NODE_ENV === 'production' ? host : '/apps';
284
+ return "".concat(prefix);
285
+ }
286
+ /*
287
+ * 上传附件
288
+ */
289
+ export function uploadFile() {
290
+ var host = hostMap['fileApi'][process.env.NODE_ENV || 'development'];
291
+ var prefix = process.env.NODE_ENV === 'production' ? host : '/fileApi';
292
+ return "".concat(prefix, "/file/upload");
293
+ }
294
+
295
+ /*
296
+ * 修改附件密级
297
+ */
298
+ export function updateSecLevelId(fileId, levelId) {
299
+ return request("/file/updateSecLevelId/".concat(fileId, "/").concat(levelId), {
300
+ method: 'get',
301
+ prefix: '/fileApi'
302
+ });
303
+ }
304
+
305
+ /*
306
+ * 编辑任务记录
307
+ */
308
+ export function fileByAssId(_x7) {
309
+ return _fileByAssId.apply(this, arguments);
310
+ }
311
+ /*
312
+ * 模拟登录到dify
313
+ */
314
+ function _fileByAssId() {
315
+ _fileByAssId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(assId) {
316
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
317
+ while (1) switch (_context13.prev = _context13.next) {
318
+ case 0:
319
+ return _context13.abrupt("return", request("/file/fileByAssId/".concat(assId), {
320
+ method: 'get',
321
+ prefix: '/fileApi'
322
+ }));
323
+ case 1:
324
+ case "end":
325
+ return _context13.stop();
326
+ }
327
+ }, _callee13);
328
+ }));
329
+ return _fileByAssId.apply(this, arguments);
330
+ }
331
+ export function mnLoginDify(_x8) {
332
+ return _mnLoginDify.apply(this, arguments);
333
+ }
334
+
335
+ /*
336
+ * 刷新token接口
337
+ */
338
+ function _mnLoginDify() {
339
+ _mnLoginDify = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(data) {
340
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
341
+ while (1) switch (_context14.prev = _context14.next) {
342
+ case 0:
343
+ return _context14.abrupt("return", request("/api/login", {
344
+ method: 'post',
345
+ data: data,
346
+ prefix: '/console'
347
+ }));
348
+ case 1:
349
+ case "end":
350
+ return _context14.stop();
351
+ }
352
+ }, _callee14);
353
+ }));
354
+ return _mnLoginDify.apply(this, arguments);
355
+ }
356
+ export function refreshTokenFn(_x9) {
357
+ return _refreshTokenFn.apply(this, arguments);
358
+ }
359
+ /**
360
+ * 查询文件
361
+ * @param val
362
+ */
363
+ function _refreshTokenFn() {
364
+ _refreshTokenFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(refreshTokenStr) {
365
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
366
+ while (1) switch (_context15.prev = _context15.next) {
367
+ case 0:
368
+ return _context15.abrupt("return", request("/user/refresh_token?refresh_token=".concat(refreshTokenStr), {
369
+ method: 'post',
370
+ prefix: '/loginApi',
371
+ noNeedToken: true
372
+ }));
373
+ case 1:
374
+ case "end":
375
+ return _context15.stop();
376
+ }
377
+ }, _callee15);
378
+ }));
379
+ return _refreshTokenFn.apply(this, arguments);
380
+ }
381
+ export var getFileData = /*#__PURE__*/function () {
382
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(assId) {
383
+ var res, data, _iterator, _step, file;
384
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
385
+ while (1) switch (_context.prev = _context.next) {
386
+ case 0:
387
+ _context.next = 2;
388
+ return fileByAssId(assId);
389
+ case 2:
390
+ res = _context.sent;
391
+ data = [];
392
+ if (res && res.success) {
393
+ if (res.data !== null && res.data.length > 0) {
394
+ _iterator = _createForOfIteratorHelper(res.data);
395
+ try {
396
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
397
+ file = _step.value;
398
+ data.push({
399
+ id: file.id,
400
+ name: file.name,
401
+ fileUidName: file.realName,
402
+ secId: {
403
+ label: file.secLevelName,
404
+ value: file.secLevelId
405
+ },
406
+ uid: file.id,
407
+ response: {
408
+ code: 200,
409
+ data: {
410
+ id: file.id
411
+ }
412
+ }
413
+ });
414
+ }
415
+ } catch (err) {
416
+ _iterator.e(err);
417
+ } finally {
418
+ _iterator.f();
419
+ }
420
+ }
421
+ }
422
+ return _context.abrupt("return", data);
423
+ case 6:
424
+ case "end":
425
+ return _context.stop();
426
+ }
427
+ }, _callee);
428
+ }));
429
+ return function getFileData(_x10) {
430
+ return _ref.apply(this, arguments);
431
+ };
432
+ }();
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 静态数据和全局配置
3
+ * */
4
+ export declare const LIVE_ACCESS_TOKEN = "venus_access_token";
5
+ export declare const LIVE_REFRESH_TOKEN = "venus_refresh_token";
6
+ export declare const VENUS_PROJECT_INFO = "venus_project_info";
7
+ export declare const LIVE_ACCESS_TOKEN_EXPIRES_TIME = 1;
8
+ export declare const LIVE_REFRESH_TOKEN_EXPIRES_TIME = 30;
9
+ export declare const HISTORY_PATHNAME = "history_pathname";
10
+ export declare const QUICK_ENTRY_OPEN = "quick_entry_open";
11
+ export declare const DATE_FORMAT = "YYYY-MM-DD";
12
+ export declare const DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
13
+ export declare const SPECIAL_DATETIME_FORMAT = "YYYY-MM-DD HH:mm";
14
+ export declare const SPECIAL_DATETIME_FORMAT_30 = "YYYY-MM-DD HH:30";
15
+ export declare const SPECIAL_DATETIME_FORMAT_00 = "YYYY-MM-DD HH:00";
16
+ export declare const ADMIN_APP_TOKEN = "admin_app_token";
17
+ export declare const BUCKET: {
18
+ development: string;
19
+ production: string;
20
+ };
21
+ export declare const chromeWin32 = "https://static.mttop.cn/83.0.4103.106_chrome32_stable_windows_installer.exe";
22
+ export declare const chromeWin64 = "https://static.mttop.cn/83.0.4103.106_chrome64_stable_windows_installer.exe";
23
+ export declare const chromeMac = "https://static.mttop.cn/googlechrome.dmg";