@zgfe/modules-settings 2.0.0-zhongyuan.9 → 2.1.0-zhongyuan-set.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.
- package/README.md +33 -33
- package/es/components/card/index.less +87 -87
- package/es/components/importMetaDialog/index.d.ts +13 -0
- package/es/components/importMetaDialog/index.js +217 -0
- package/es/components/importMetaDialog/styles/index.less +115 -0
- package/es/components/pageLoading/index.less +7 -7
- package/es/components/picCircleSelect/bak/index copy 2.tsx.bak +92 -92
- package/es/components/picCircleSelect/bak/index copy 3.tsx.bak +58 -58
- package/es/components/picCircleSelect/bak/index copy 4.tsx.bak +66 -66
- package/es/components/picCircleSelect/bak/index copy 5.tsx.bak +116 -116
- package/es/components/picCircleSelect/bak/index copy 6.tsx.bak +116 -116
- package/es/components/picCircleSelect/bak/index copy.tsx.bak +41 -41
- package/es/components/picCircleSelect/bak/index.tsx.bak +48 -48
- package/es/components/picCircleSelect/bak/index1.tsx.bak +46 -46
- package/es/components/picCircleSelect/bak/index2.tsx.bak +104 -104
- package/es/components/picCircleSelect/index.less +37 -37
- package/es/components/processCanvas/styles/customNode.less +149 -149
- package/es/components/processCanvas/styles/index.less +34 -34
- package/es/components/settingTabs/index.less +51 -51
- package/es/constants/api.d.ts +30 -0
- package/es/constants/api.js +43 -1
- package/es/constants/icons/demo.css +539 -539
- package/es/constants/icons/demo_index.html +9871 -9871
- package/es/constants/icons/iconfont.css +1699 -1699
- package/es/constants/icons/iconfont.json +2956 -2956
- package/es/global.d.ts +4 -4
- package/es/modules/appSettings/dataAccessFilter/index.js +2 -1
- package/es/modules/appSettings/dataAccessFilter/index.less +5 -5
- package/es/modules/appSettings/virtualSource/styles/index.less +28 -28
- package/es/modules/appSettings/virtualSource/styles/table.less +51 -51
- package/es/modules/companySetting/appList/index.less +126 -126
- package/es/modules/companySetting/application/applicationForm.d.ts +1 -0
- package/es/modules/companySetting/application/applicationForm.js +34 -4
- package/es/modules/companySetting/application/index.d.ts +13 -0
- package/es/modules/companySetting/application/index.js +276 -104
- package/es/modules/companySetting/application/index.less +144 -126
- package/es/modules/companySetting/business/index.less +92 -92
- package/es/modules/companySetting/cost/index.less +38 -38
- package/es/modules/companySetting/department/index.less +157 -157
- package/es/modules/companySetting/edit/styles/authConfig.less +3 -3
- package/es/modules/companySetting/edit/styles/authGroup.less +10 -10
- package/es/modules/companySetting/edit/styles/authModule.less +82 -82
- package/es/modules/companySetting/edit/styles/user.less +54 -54
- package/es/modules/companySetting/edit/styles/userGroup.less +44 -44
- package/es/modules/companySetting/index.js +37 -33
- package/es/modules/companySetting/index.less +90 -90
- package/es/modules/companySetting/info/index.less +42 -42
- package/es/modules/companySetting/mainPart/images/img2.svg +12 -12
- package/es/modules/companySetting/mainPart/index.less +239 -239
- package/es/modules/companySetting/operationLog/index.js +22 -5
- package/es/modules/companySetting/operationLog/index.less +33 -33
- package/es/modules/companySetting/role/index.less +296 -296
- package/es/modules/companySetting/role/setDataRangeDialog/index.less +37 -37
- package/es/modules/companySetting/style/common.less +79 -79
- package/es/modules/companySetting/style/reset.less +117 -117
- package/es/modules/companySetting/user/index.js +29 -24
- package/es/modules/companySetting/user/index.less +363 -363
- package/es/modules/companySetting/user/invite.js +30 -102
- package/es/modules/companySetting/virtualApp/styles/config.less +37 -37
- package/es/modules/companySetting/virtualApp/styles/index.less +21 -21
- package/es/modules/companySetting/virtualApp/styles/list.less +28 -28
- package/es/modules/companySetting/virtualApp/styles/sourceItem.less +33 -33
- package/es/modules/companySetting/virtualApp/styles/table.less +44 -44
- package/es/modules/companySetting/wechatBinding/index.less +58 -58
- package/es/modules/createDemand/constants.d.ts +15 -2
- package/es/modules/createDemand/constants.js +57 -4
- package/es/modules/createDemand/demo/selectPoint.js +1 -2
- package/es/modules/createDemand/index.d.ts +0 -1
- package/es/modules/createDemand/index.js +793 -179
- package/es/modules/createDemand/styles/index.less +403 -277
- package/es/modules/createDemand_bf/demo/index.js +0 -1
- package/es/modules/createDemand_bf/index.js +0 -1
- package/es/modules/createDemand_bf/styles/index.less +222 -222
- package/es/modules/createProcess/components/index.less +52 -52
- package/es/modules/createProcess/index.less +114 -114
- package/es/modules/createProcess/title/index.less +53 -53
- package/es/modules/dealDemand/demo/index.js +0 -1
- package/es/modules/dealDemand/demo/selectPoint.js +1 -1
- package/es/modules/dealDemand/index.js +0 -2
- package/es/modules/dealDemand/styles/index.less +265 -265
- package/es/modules/demandManage/index.js +174 -178
- package/es/modules/demandManage/styles/index.less +8 -68
- package/es/modules/getPassword/index.less +122 -122
- package/es/modules/messageList/index.d.ts +1 -1
- package/es/modules/messageList/index.js +6 -6
- package/es/modules/messageList/index.less +81 -81
- package/es/modules/personalSetting/demo/index.d.ts +3 -0
- package/es/modules/personalSetting/demo/index.js +12 -0
- package/es/modules/personalSetting/index.js +11 -1
- package/es/modules/personalSetting/info/index.js +23 -5
- package/es/modules/personalSetting/securityLog/index.less +11 -11
- package/es/modules/personalSetting/styles/unbinding.less +73 -73
- package/es/modules/pointMap/ImportModal/styles/index.less +91 -91
- package/es/modules/pointMap/createMetaDrawer.d.ts +5 -0
- package/es/modules/pointMap/createMetaDrawer.js +825 -0
- package/es/modules/pointMap/editTxt/index.less +55 -55
- package/es/modules/pointMap/pageInfo.js +401 -179
- package/es/modules/pointMap/record.d.ts +7 -0
- package/es/modules/pointMap/record.js +521 -0
- package/es/modules/pointMap/styles/index.less +165 -38
- package/es/modules/pointMap/styles/pageInfo.less +439 -244
- package/es/modules/pointMap/styles/tree.css +164 -145
- package/es/modules/pointMap/styles/tree.less +174 -149
- package/es/modules/pointMap/tree.js +232 -88
- package/es/modules/pointMap/types.d.ts +88 -0
- package/es/modules/pointMap/types.js +1 -0
- package/es/modules/systemSetting/Dictionary.d.ts +5 -2
- package/es/modules/systemSetting/Dictionary.js +54 -370
- package/es/modules/systemSetting/approvalmanage/approvalStrategy/index.less +14 -14
- package/es/modules/systemSetting/approvalmanage/index.less +5 -5
- package/es/modules/systemSetting/approvalmanage/processManage/index.less +39 -39
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/create.d.ts +9 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/create.js +245 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/css/index.less +48 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/index.d.ts +4 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/index.js +207 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/type/index.d.ts +10 -0
- package/es/modules/systemSetting/dictionaryItem/dictionaryManagement/type/index.js +1 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/create.d.ts +10 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/create.js +124 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/css/index.less +32 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/index.d.ts +7 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/index.js +264 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/type/index.d.ts +9 -0
- package/es/modules/systemSetting/dictionaryItem/eventTagManagement/type/index.js +1 -0
- package/es/modules/systemSetting/document-setting/index.js +7 -6
- package/es/modules/systemSetting/index.css +161 -161
- package/es/modules/systemSetting/index.js +16 -16
- package/es/modules/systemSetting/index.less +169 -169
- package/es/modules/systemSetting/notice/configItem/index.less +21 -21
- package/es/modules/systemSetting/notice/edit/index.less +26 -26
- package/es/types/personal.d.ts +1 -0
- package/package.json +74 -74
|
@@ -0,0 +1,825 @@
|
|
|
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
|
+
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 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 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 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; }
|
|
4
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
5
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
6
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
|
+
import { BizGlobalDataContext, IconFont, BizDialog, BizEventSelector } from '@zgfe/business-lib';
|
|
22
|
+
import { Input, message, Drawer, Select, Button, Table, notification, Form, Switch } from 'antd';
|
|
23
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
24
|
+
import _ from 'lodash';
|
|
25
|
+
import BizEditText from './editTxt';
|
|
26
|
+
import './styles/index.less';
|
|
27
|
+
import request from '../../utils/ajax';
|
|
28
|
+
import apis from '../../constants/api';
|
|
29
|
+
var CreateMeta = function CreateMeta(props) {
|
|
30
|
+
var classPrefix = 'setting-create-meta-drawer';
|
|
31
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
32
|
+
currentApp = _useContext.currentApp,
|
|
33
|
+
isDemo = _useContext.isDemo;
|
|
34
|
+
var _useState = useState([]),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
eventAttrList = _useState2[0],
|
|
37
|
+
setEventAttrList = _useState2[1];
|
|
38
|
+
var _useState3 = useState(false),
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
+
isShowBack = _useState4[0],
|
|
41
|
+
setIsShowBack = _useState4[1];
|
|
42
|
+
var _useState5 = useState(false),
|
|
43
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
+
isChange = _useState6[0],
|
|
45
|
+
setIsChange = _useState6[1];
|
|
46
|
+
var _Form$useForm = Form.useForm(),
|
|
47
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
48
|
+
form = _Form$useForm2[0];
|
|
49
|
+
var _useState7 = useState(false),
|
|
50
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
51
|
+
isCopy = _useState8[0],
|
|
52
|
+
setIsCopy = _useState8[1];
|
|
53
|
+
var _useState9 = useState('create'),
|
|
54
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
55
|
+
homeType = _useState10[0],
|
|
56
|
+
setHomeType = _useState10[1];
|
|
57
|
+
var changeItemInfo = function changeItemInfo(i, key, v) {
|
|
58
|
+
var dealData = _.clone(eventAttrList);
|
|
59
|
+
dealData[i][key] = v;
|
|
60
|
+
setEventAttrList(dealData);
|
|
61
|
+
};
|
|
62
|
+
useEffect(function () {
|
|
63
|
+
if (props.isShow) {
|
|
64
|
+
form.resetFields(); // 重置表单数据
|
|
65
|
+
setEventAttrList([]);
|
|
66
|
+
setIsChange(false);
|
|
67
|
+
setIsCopy(false);
|
|
68
|
+
if (props.data) {
|
|
69
|
+
setHomeType(props.isEdit ? 'update' : 'get');
|
|
70
|
+
initData(props.data);
|
|
71
|
+
} else {
|
|
72
|
+
form.resetFields(); // 重置表单数据
|
|
73
|
+
setEventAttrList([]);
|
|
74
|
+
setTriTagInput(undefined);
|
|
75
|
+
setTriTagId(undefined);
|
|
76
|
+
setInputText('');
|
|
77
|
+
setHomeType('create');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [props.isShow]);
|
|
81
|
+
var initData = function initData(data) {
|
|
82
|
+
form.setFieldsValue({
|
|
83
|
+
aliasName: data.aliasName,
|
|
84
|
+
eventName: data.eventName,
|
|
85
|
+
businessLabelId: data.businessLabelId
|
|
86
|
+
});
|
|
87
|
+
setTriTagInput(data.triggeringOccasion);
|
|
88
|
+
setTriTagId(data.triggerLabelId);
|
|
89
|
+
setInputText(data.eventName);
|
|
90
|
+
if (data.eventAttrList) {
|
|
91
|
+
var arr = data.eventAttrList.map(function (o) {
|
|
92
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
93
|
+
prop_type: o.type,
|
|
94
|
+
encryption_type: o.encryptionType
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
setEventAttrList(_toConsumableArray(arr));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var submit = /*#__PURE__*/function () {
|
|
101
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
102
|
+
var values, resultArr, newArr;
|
|
103
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
104
|
+
while (1) switch (_context.prev = _context.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
setIsChange(true);
|
|
107
|
+
_context.prev = 1;
|
|
108
|
+
_context.next = 4;
|
|
109
|
+
return form.validateFields();
|
|
110
|
+
case 4:
|
|
111
|
+
values = _context.sent;
|
|
112
|
+
if (!isDemo) {
|
|
113
|
+
_context.next = 8;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
message.error('demo环境,无法创建');
|
|
117
|
+
return _context.abrupt("return");
|
|
118
|
+
case 8:
|
|
119
|
+
if (!eventAttrList.filter(function (item) {
|
|
120
|
+
return !item.name;
|
|
121
|
+
}).length) {
|
|
122
|
+
_context.next = 11;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
notification.warning({
|
|
126
|
+
message: '请输入事件属性名称'
|
|
127
|
+
});
|
|
128
|
+
return _context.abrupt("return");
|
|
129
|
+
case 11:
|
|
130
|
+
// 先初始没有错误
|
|
131
|
+
resultArr = [];
|
|
132
|
+
newArr = findDuplicateObjects(eventAttrList);
|
|
133
|
+
if (!(newArr.length >= 1)) {
|
|
134
|
+
_context.next = 18;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
notification.warning({
|
|
138
|
+
message: '有事件属性名称相同'
|
|
139
|
+
});
|
|
140
|
+
resultArr = eventAttrList.map(function (j) {
|
|
141
|
+
if (newArr.find(function (k) {
|
|
142
|
+
return j.name || j.attr_name == k;
|
|
143
|
+
})) {
|
|
144
|
+
return _objectSpread(_objectSpread({}, j), {}, {
|
|
145
|
+
status: 'error'
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return j;
|
|
149
|
+
});
|
|
150
|
+
setEventAttrList(resultArr);
|
|
151
|
+
return _context.abrupt("return");
|
|
152
|
+
case 18:
|
|
153
|
+
if (newArr.length == 0) {
|
|
154
|
+
resultArr = eventAttrList.map(function (o) {
|
|
155
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
156
|
+
status: ''
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
setEventAttrList(resultArr);
|
|
161
|
+
//把参数传递给主页面
|
|
162
|
+
if (props.onSubmit) {
|
|
163
|
+
props.onSubmit({
|
|
164
|
+
eventName: values.eventName,
|
|
165
|
+
aliasName: values.aliasName,
|
|
166
|
+
triggeringOccasion: triTagInput,
|
|
167
|
+
businessLabelId: values.businessLabelId,
|
|
168
|
+
triggerLabelId: triTagId,
|
|
169
|
+
businessLabel: values.businessLabelId && bizTag.filter(function (res) {
|
|
170
|
+
return res.id == values.businessLabelId;
|
|
171
|
+
})[0],
|
|
172
|
+
triggerLabel: triTagId && triTag.filter(function (res) {
|
|
173
|
+
return res.id == triTagId;
|
|
174
|
+
})[0],
|
|
175
|
+
eventAttrList: eventAttrList
|
|
176
|
+
}, props.data ? 'update' : 'create');
|
|
177
|
+
}
|
|
178
|
+
_context.next = 26;
|
|
179
|
+
break;
|
|
180
|
+
case 23:
|
|
181
|
+
_context.prev = 23;
|
|
182
|
+
_context.t0 = _context["catch"](1);
|
|
183
|
+
console.log('表单验证失败:', _context.t0);
|
|
184
|
+
case 26:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context.stop();
|
|
187
|
+
}
|
|
188
|
+
}, _callee, null, [[1, 23]]);
|
|
189
|
+
}));
|
|
190
|
+
return function submit() {
|
|
191
|
+
return _ref.apply(this, arguments);
|
|
192
|
+
};
|
|
193
|
+
}();
|
|
194
|
+
function findDuplicateObjects(arr) {
|
|
195
|
+
var map = new Map(); // key: name值, value: 对应的对象
|
|
196
|
+
var duplicates = [];
|
|
197
|
+
var _iterator = _createForOfIteratorHelper(arr),
|
|
198
|
+
_step;
|
|
199
|
+
try {
|
|
200
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
201
|
+
var obj = _step.value;
|
|
202
|
+
var name = obj.name || obj.attr_name;
|
|
203
|
+
if (map.has(name)) {
|
|
204
|
+
// 找到重复项,把已存的对象和当前对象加入结果
|
|
205
|
+
duplicates.push(map.get(name), obj);
|
|
206
|
+
break; // 只找第一组重复项,如需全部可去掉break
|
|
207
|
+
} else {
|
|
208
|
+
map.set(name, obj);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
} catch (err) {
|
|
212
|
+
_iterator.e(err);
|
|
213
|
+
} finally {
|
|
214
|
+
_iterator.f();
|
|
215
|
+
}
|
|
216
|
+
return duplicates.map(function (o) {
|
|
217
|
+
return o.name;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
var dealEventAttr = function dealEventAttr(index) {
|
|
221
|
+
var dealData = _.clone(eventAttrList);
|
|
222
|
+
dealData.splice(index, 1);
|
|
223
|
+
setEventAttrList(dealData);
|
|
224
|
+
setIsChange(true);
|
|
225
|
+
};
|
|
226
|
+
// 表格列表筛选项
|
|
227
|
+
var _useState11 = useState(0),
|
|
228
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
229
|
+
type = _useState12[0],
|
|
230
|
+
setType = _useState12[1];
|
|
231
|
+
var _useState13 = useState(-1),
|
|
232
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
233
|
+
encryption_type = _useState14[0],
|
|
234
|
+
setEncryptionType = _useState14[1];
|
|
235
|
+
var columns = [{
|
|
236
|
+
title: '序号',
|
|
237
|
+
dataIndex: 'event_name',
|
|
238
|
+
key: 'event_name',
|
|
239
|
+
width: 64,
|
|
240
|
+
render: function render(text, record, index) {
|
|
241
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
242
|
+
}
|
|
243
|
+
}, {
|
|
244
|
+
title: (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
245
|
+
style: {
|
|
246
|
+
color: '#FB5547',
|
|
247
|
+
marginRight: 8
|
|
248
|
+
}
|
|
249
|
+
}, "*"), "\u4E8B\u4EF6\u5C5E\u6027\u540D\u79F0")),
|
|
250
|
+
dataIndex: 'name',
|
|
251
|
+
key: 'name',
|
|
252
|
+
width: 264,
|
|
253
|
+
render: function render(text, record, index) {
|
|
254
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
255
|
+
style: {
|
|
256
|
+
margin: '-10px 0'
|
|
257
|
+
}
|
|
258
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
259
|
+
disabled: homeType == 'get',
|
|
260
|
+
placeholder: '请输入事件属性名',
|
|
261
|
+
value: text,
|
|
262
|
+
showCount: true,
|
|
263
|
+
status: record === null || record === void 0 ? void 0 : record.status,
|
|
264
|
+
maxLength: 128,
|
|
265
|
+
onChange: function onChange(e) {
|
|
266
|
+
setIsChange(true);
|
|
267
|
+
changeItemInfo(index, 'name', e.target.value);
|
|
268
|
+
}
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
title: '属性别名',
|
|
273
|
+
dataIndex: 'aliasName',
|
|
274
|
+
key: 'aliasName',
|
|
275
|
+
width: 234,
|
|
276
|
+
render: function render(aliasName, record, index) {
|
|
277
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
278
|
+
style: {
|
|
279
|
+
margin: '-10px 0'
|
|
280
|
+
}
|
|
281
|
+
}, /*#__PURE__*/React.createElement(BizEditText, {
|
|
282
|
+
canEdit: homeType != 'get',
|
|
283
|
+
value: aliasName,
|
|
284
|
+
max: 128,
|
|
285
|
+
placeholder: '请输入属性别名',
|
|
286
|
+
onChange: function onChange(e) {
|
|
287
|
+
setIsChange(true);
|
|
288
|
+
changeItemInfo(index, 'aliasName', e);
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
}
|
|
292
|
+
}, {
|
|
293
|
+
title: (/*#__PURE__*/React.createElement("div", {
|
|
294
|
+
className: "".concat(classPrefix, "-content-select")
|
|
295
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
296
|
+
style: {
|
|
297
|
+
color: '#FB5547',
|
|
298
|
+
marginRight: 8
|
|
299
|
+
}
|
|
300
|
+
}, "*"), /*#__PURE__*/React.createElement(Select, {
|
|
301
|
+
disabled: homeType == 'get',
|
|
302
|
+
defaultValue: 0,
|
|
303
|
+
style: {
|
|
304
|
+
width: 120,
|
|
305
|
+
margin: '-10px 0'
|
|
306
|
+
},
|
|
307
|
+
onChange: function onChange(e) {
|
|
308
|
+
return setType(e);
|
|
309
|
+
},
|
|
310
|
+
bordered: false,
|
|
311
|
+
className: "select-style",
|
|
312
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
313
|
+
type: "xiangxia",
|
|
314
|
+
style: {
|
|
315
|
+
color: '#5f6085'
|
|
316
|
+
}
|
|
317
|
+
}),
|
|
318
|
+
// onChange={(e) => props.eventActiveFilter(e, 'event_hidden')}
|
|
319
|
+
options: [{
|
|
320
|
+
value: 0,
|
|
321
|
+
label: '属性类型'
|
|
322
|
+
}, {
|
|
323
|
+
value: 1,
|
|
324
|
+
label: '字符串'
|
|
325
|
+
}, {
|
|
326
|
+
value: 2,
|
|
327
|
+
label: '数值'
|
|
328
|
+
}, {
|
|
329
|
+
value: 3,
|
|
330
|
+
label: '日期'
|
|
331
|
+
}]
|
|
332
|
+
}))),
|
|
333
|
+
dataIndex: 'prop_type',
|
|
334
|
+
key: 'prop_type',
|
|
335
|
+
width: 148,
|
|
336
|
+
render: function render(prop_type, record, index) {
|
|
337
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
338
|
+
className: "".concat(classPrefix, "-content-select")
|
|
339
|
+
}, /*#__PURE__*/React.createElement(Select
|
|
340
|
+
// defaultValue={record.event_hidden}
|
|
341
|
+
, {
|
|
342
|
+
// defaultValue={record.event_hidden}
|
|
343
|
+
style: {
|
|
344
|
+
width: 120,
|
|
345
|
+
margin: '-10px 0'
|
|
346
|
+
},
|
|
347
|
+
value: prop_type,
|
|
348
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
349
|
+
type: "xiangxia",
|
|
350
|
+
style: {
|
|
351
|
+
color: '#5f6085'
|
|
352
|
+
}
|
|
353
|
+
}),
|
|
354
|
+
disabled: homeType == 'get',
|
|
355
|
+
onChange: function onChange(e) {
|
|
356
|
+
setIsChange(true);
|
|
357
|
+
changeItemInfo(index, 'type', e);
|
|
358
|
+
},
|
|
359
|
+
options: [{
|
|
360
|
+
value: 1,
|
|
361
|
+
label: '字符串'
|
|
362
|
+
}, {
|
|
363
|
+
value: 2,
|
|
364
|
+
label: '数值'
|
|
365
|
+
}, {
|
|
366
|
+
value: 3,
|
|
367
|
+
label: '日期'
|
|
368
|
+
}]
|
|
369
|
+
}));
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
title: (/*#__PURE__*/React.createElement("div", {
|
|
373
|
+
className: "".concat(classPrefix, "-content-select")
|
|
374
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
375
|
+
style: {
|
|
376
|
+
color: '#FB5547',
|
|
377
|
+
marginRight: 8
|
|
378
|
+
}
|
|
379
|
+
}, "*"), /*#__PURE__*/React.createElement(Select, {
|
|
380
|
+
defaultValue: -1,
|
|
381
|
+
bordered: false,
|
|
382
|
+
onChange: function onChange(e) {
|
|
383
|
+
return setEncryptionType(e);
|
|
384
|
+
},
|
|
385
|
+
style: {
|
|
386
|
+
width: 120,
|
|
387
|
+
margin: '-10px 0'
|
|
388
|
+
},
|
|
389
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
390
|
+
type: "xiangxia",
|
|
391
|
+
style: {
|
|
392
|
+
color: '#5f6085'
|
|
393
|
+
}
|
|
394
|
+
}),
|
|
395
|
+
// onChange={(e) => props.eventActiveFilter(e, 'is_stop')}
|
|
396
|
+
disabled: homeType == 'get',
|
|
397
|
+
options: [{
|
|
398
|
+
value: -1,
|
|
399
|
+
label: '加密方式'
|
|
400
|
+
}, {
|
|
401
|
+
value: 0,
|
|
402
|
+
label: '不加密'
|
|
403
|
+
}, {
|
|
404
|
+
value: 1,
|
|
405
|
+
label: '半加密'
|
|
406
|
+
}, {
|
|
407
|
+
value: 2,
|
|
408
|
+
label: '全加密'
|
|
409
|
+
}]
|
|
410
|
+
}))),
|
|
411
|
+
dataIndex: 'encryption_type',
|
|
412
|
+
key: 'encryption_type',
|
|
413
|
+
width: 148,
|
|
414
|
+
render: function render(encryption_type, record, index) {
|
|
415
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
416
|
+
className: "".concat(classPrefix, "-content-select")
|
|
417
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
418
|
+
value: encryption_type,
|
|
419
|
+
style: {
|
|
420
|
+
width: 120,
|
|
421
|
+
margin: '-10px 0'
|
|
422
|
+
},
|
|
423
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
424
|
+
type: "xiangxia",
|
|
425
|
+
style: {
|
|
426
|
+
color: '#5f6085'
|
|
427
|
+
}
|
|
428
|
+
}),
|
|
429
|
+
disabled: homeType == 'get',
|
|
430
|
+
onChange: function onChange(e) {
|
|
431
|
+
setIsChange(true);
|
|
432
|
+
changeItemInfo(index, 'encryptionType', e);
|
|
433
|
+
},
|
|
434
|
+
options: [{
|
|
435
|
+
value: 0,
|
|
436
|
+
label: '不加密'
|
|
437
|
+
}, {
|
|
438
|
+
value: 1,
|
|
439
|
+
label: '半加密'
|
|
440
|
+
}, {
|
|
441
|
+
value: 2,
|
|
442
|
+
label: '全加密'
|
|
443
|
+
}]
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
}];
|
|
447
|
+
homeType != 'get' && columns.push({
|
|
448
|
+
title: '操作',
|
|
449
|
+
dataIndex: 'set',
|
|
450
|
+
key: 'set',
|
|
451
|
+
width: 64,
|
|
452
|
+
render: function render(_, record, index) {
|
|
453
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
454
|
+
className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
|
|
455
|
+
onClick: function onClick() {
|
|
456
|
+
return dealEventAttr(index);
|
|
457
|
+
}
|
|
458
|
+
}, "\u5220\u9664");
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
var _useState15 = useState(''),
|
|
462
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
463
|
+
scrollY = _useState16[0],
|
|
464
|
+
setScrollY = _useState16[1];
|
|
465
|
+
var getTableScroll = function getTableScroll(extraHeight, id) {
|
|
466
|
+
if (typeof extraHeight == 'undefined') {
|
|
467
|
+
// 默认底部分页64 + 边距10
|
|
468
|
+
extraHeight = 74;
|
|
469
|
+
}
|
|
470
|
+
var tHeader = null;
|
|
471
|
+
if (id) {
|
|
472
|
+
var _document$getElementB;
|
|
473
|
+
tHeader = document.getElementById(id) ? (_document$getElementB = document.getElementById(id)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.getElementsByClassName('ant-table-thead')[0] : null;
|
|
474
|
+
} else {
|
|
475
|
+
tHeader = document.getElementsByClassName('ant-table-thead')[0];
|
|
476
|
+
}
|
|
477
|
+
//表格内容距离顶部的距离
|
|
478
|
+
var tHeaderBottom = 0;
|
|
479
|
+
if (tHeader) {
|
|
480
|
+
tHeaderBottom = tHeader.getBoundingClientRect().bottom;
|
|
481
|
+
}
|
|
482
|
+
//窗体高度-表格内容顶部的高度-表格内容底部的高度
|
|
483
|
+
// let height = document.body.clientHeight - tHeaderBottom - extraHeight
|
|
484
|
+
var height = "calc(100vh - ".concat(tHeaderBottom + extraHeight, "px)");
|
|
485
|
+
return height;
|
|
486
|
+
};
|
|
487
|
+
//页面加载完成后才能获取到对应的元素及其位置
|
|
488
|
+
useEffect(function () {
|
|
489
|
+
var _Y = getTableScroll(545, 'dataManageCreateMetaTable');
|
|
490
|
+
setScrollY(_Y);
|
|
491
|
+
getTagList(2);
|
|
492
|
+
getTagList(3);
|
|
493
|
+
}, []);
|
|
494
|
+
var onClose = function onClose() {
|
|
495
|
+
if (isChange) {
|
|
496
|
+
setIsShowBack(true);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
props.onClose();
|
|
500
|
+
};
|
|
501
|
+
// 是否复制的开关
|
|
502
|
+
var changeSwitch = function changeSwitch(event) {
|
|
503
|
+
// 清空其他数据
|
|
504
|
+
form.resetFields(); // 重置表单数据
|
|
505
|
+
setEventAttrList([]);
|
|
506
|
+
setTriTagInput(undefined);
|
|
507
|
+
setTriTagId(undefined);
|
|
508
|
+
setInputText('');
|
|
509
|
+
setIsCopy(event);
|
|
510
|
+
};
|
|
511
|
+
// 根据事件id获取属性列表
|
|
512
|
+
function getEventIdAttrList(id) {
|
|
513
|
+
request(apis.getEventAttributes, {
|
|
514
|
+
method: 'post',
|
|
515
|
+
data: {
|
|
516
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
517
|
+
eventId: id
|
|
518
|
+
}
|
|
519
|
+
}).then(function (res) {
|
|
520
|
+
setEventAttrList(_toConsumableArray(res.data.map(function (item) {
|
|
521
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
522
|
+
aliasName: item.alias_name,
|
|
523
|
+
name: item.attr_name,
|
|
524
|
+
type: item.prop_type,
|
|
525
|
+
encryptionType: item.encryption_type
|
|
526
|
+
});
|
|
527
|
+
})));
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
var onChangeEvent = function onChangeEvent(_ref2) {
|
|
531
|
+
var event = _ref2.event;
|
|
532
|
+
form.setFieldsValue({
|
|
533
|
+
aliasName: event.alias,
|
|
534
|
+
eventName: event.name
|
|
535
|
+
});
|
|
536
|
+
setInputText(event.name);
|
|
537
|
+
getEventIdAttrList(event.id);
|
|
538
|
+
};
|
|
539
|
+
//标签列表数据 2:业务标签 3:触发标签
|
|
540
|
+
var _useState17 = useState([]),
|
|
541
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
542
|
+
bizTag = _useState18[0],
|
|
543
|
+
setBizTag = _useState18[1];
|
|
544
|
+
var _useState19 = useState(),
|
|
545
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
546
|
+
triTagInput = _useState20[0],
|
|
547
|
+
setTriTagInput = _useState20[1]; // 触发时机
|
|
548
|
+
var _useState21 = useState([]),
|
|
549
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
550
|
+
triTag = _useState22[0],
|
|
551
|
+
setTriTag = _useState22[1];
|
|
552
|
+
var _useState23 = useState(),
|
|
553
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
554
|
+
triTagId = _useState24[0],
|
|
555
|
+
setTriTagId = _useState24[1];
|
|
556
|
+
var getTagList = function getTagList(type) {
|
|
557
|
+
request(apis.dict.getTagList, {
|
|
558
|
+
method: 'post',
|
|
559
|
+
data: {
|
|
560
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
561
|
+
labelType: type
|
|
562
|
+
}
|
|
563
|
+
}).then(function (res) {
|
|
564
|
+
if (res && res.code == '100000') {
|
|
565
|
+
switch (type) {
|
|
566
|
+
case 2:
|
|
567
|
+
setBizTag(res.data.map(function (res) {
|
|
568
|
+
return {
|
|
569
|
+
labelName: res.labelName,
|
|
570
|
+
id: res.id
|
|
571
|
+
};
|
|
572
|
+
}));
|
|
573
|
+
break;
|
|
574
|
+
case 3:
|
|
575
|
+
setTriTag(res.data.map(function (res) {
|
|
576
|
+
return {
|
|
577
|
+
labelName: res.labelName,
|
|
578
|
+
id: res.id
|
|
579
|
+
};
|
|
580
|
+
}));
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
// 自定义验证规则
|
|
587
|
+
var _useState25 = useState(''),
|
|
588
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
589
|
+
inputText = _useState26[0],
|
|
590
|
+
setInputText = _useState26[1];
|
|
591
|
+
// true 验证通过
|
|
592
|
+
var validateContainsUnderscore = function validateContainsUnderscore(value) {
|
|
593
|
+
if (!isChange) {
|
|
594
|
+
// 第一次进来不报错
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
if (value == '' || props.selectTreeName && !value.includes('_')) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
return true;
|
|
601
|
+
};
|
|
602
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
603
|
+
className: classPrefix,
|
|
604
|
+
width: 1000,
|
|
605
|
+
title: /*#__PURE__*/React.createElement("div", null, homeType == 'get' ? '查看' : homeType == 'update' ? '编辑' : '创建', "\u5143\u4E8B\u4EF6"),
|
|
606
|
+
placement: "right",
|
|
607
|
+
onClose: onClose,
|
|
608
|
+
destroyOnClose: true,
|
|
609
|
+
open: props.isShow,
|
|
610
|
+
extra: /*#__PURE__*/React.createElement(IconFont, {
|
|
611
|
+
type: "qingchu",
|
|
612
|
+
onClick: onClose
|
|
613
|
+
})
|
|
614
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
615
|
+
className: "".concat(classPrefix, "-content")
|
|
616
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
617
|
+
form: form,
|
|
618
|
+
labelCol: {
|
|
619
|
+
span: 2
|
|
620
|
+
},
|
|
621
|
+
wrapperCol: {
|
|
622
|
+
span: 22
|
|
623
|
+
},
|
|
624
|
+
initialValues: {
|
|
625
|
+
eventName: '',
|
|
626
|
+
aliasName: '',
|
|
627
|
+
businessLabelId: triTagId || undefined,
|
|
628
|
+
maidianID: []
|
|
629
|
+
}
|
|
630
|
+
}, homeType == 'create' && (/*#__PURE__*/React.createElement(Form.Item, {
|
|
631
|
+
label: "\u4ECE\u73B0\u6709\u7684\u5143\u4E8B\u4EF6\u590D\u5236",
|
|
632
|
+
labelCol: {
|
|
633
|
+
span: 4
|
|
634
|
+
}
|
|
635
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
636
|
+
style: {
|
|
637
|
+
marginLeft: '20px'
|
|
638
|
+
},
|
|
639
|
+
defaultChecked: false,
|
|
640
|
+
checked: isCopy,
|
|
641
|
+
onChange: changeSwitch
|
|
642
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
643
|
+
name: "eventName",
|
|
644
|
+
label: "\u4E8B\u4EF6\u540D\u79F0",
|
|
645
|
+
rules: [{
|
|
646
|
+
required: true,
|
|
647
|
+
message: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u540D\u79F0"
|
|
648
|
+
}],
|
|
649
|
+
validateStatus: validateContainsUnderscore(inputText) ? '' : 'error',
|
|
650
|
+
help: validateContainsUnderscore(inputText) ? '' : inputText == '' ? '请输入事件名称' : "\u8BF7\u6839\u636E\u9875\u9762\u5C42\u7EA7\u547D\u540D\uFF0C\u5982\uFF1A".concat(props.selectTreeName)
|
|
651
|
+
}, isCopy ? (/*#__PURE__*/React.createElement("div", {
|
|
652
|
+
style: {
|
|
653
|
+
width: '100%'
|
|
654
|
+
}
|
|
655
|
+
}, /*#__PURE__*/React.createElement(BizEventSelector, {
|
|
656
|
+
showAllEvent: false,
|
|
657
|
+
multiple: false,
|
|
658
|
+
key: "eventProp",
|
|
659
|
+
showBuiltInTarget: false,
|
|
660
|
+
popupContainer: false,
|
|
661
|
+
defaultSelectAble: false,
|
|
662
|
+
onChange: onChangeEvent,
|
|
663
|
+
placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
|
|
664
|
+
}))) : (/*#__PURE__*/React.createElement(Input, {
|
|
665
|
+
disabled: homeType == 'update' || homeType == 'get',
|
|
666
|
+
placeholder: "".concat(props.selectTreeName ? "\u8BF7\u6839\u636E\u9875\u9762\u5C42\u7EA7\u547D\u540D\uFF0C\u5982\uFF1A".concat(props.selectTreeName) : '请输入事件名称'),
|
|
667
|
+
showCount: true,
|
|
668
|
+
maxLength: 128,
|
|
669
|
+
onChange: function onChange(e) {
|
|
670
|
+
setInputText(e.target.value);
|
|
671
|
+
setIsChange(true);
|
|
672
|
+
}
|
|
673
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
674
|
+
name: "aliasName",
|
|
675
|
+
label: "\u4E8B\u4EF6\u522B\u540D"
|
|
676
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
677
|
+
disabled: homeType == 'get',
|
|
678
|
+
placeholder: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u522B\u540D",
|
|
679
|
+
showCount: true,
|
|
680
|
+
maxLength: 128,
|
|
681
|
+
onChange: function onChange() {
|
|
682
|
+
return setIsChange(true);
|
|
683
|
+
}
|
|
684
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
685
|
+
name: "triggeringOccasion",
|
|
686
|
+
label: "\u89E6\u53D1\u65F6\u673A"
|
|
687
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
688
|
+
allowClear: true,
|
|
689
|
+
style: {
|
|
690
|
+
border: 0,
|
|
691
|
+
width: '160px',
|
|
692
|
+
marginRight: '10px'
|
|
693
|
+
},
|
|
694
|
+
disabled: homeType == 'get',
|
|
695
|
+
placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u6807\u7B7E",
|
|
696
|
+
// defaultValue={triTagId}
|
|
697
|
+
value: triTagId,
|
|
698
|
+
options: triTag,
|
|
699
|
+
fieldNames: {
|
|
700
|
+
label: 'labelName',
|
|
701
|
+
value: 'id'
|
|
702
|
+
},
|
|
703
|
+
onChange: function onChange(value) {
|
|
704
|
+
setTriTagId(value);
|
|
705
|
+
setIsChange(true);
|
|
706
|
+
}
|
|
707
|
+
}), "\u6216", /*#__PURE__*/React.createElement(Input, {
|
|
708
|
+
disabled: homeType == 'get',
|
|
709
|
+
style: {
|
|
710
|
+
border: 0,
|
|
711
|
+
width: 'calc(100% - 195px)',
|
|
712
|
+
marginLeft: '10px'
|
|
713
|
+
},
|
|
714
|
+
placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u65F6\u673A\uFF0C\u4F8B\u5982\uFF1A\u7528\u6237\u70B9\u51FB\u786E\u8BA4\u6309\u94AE",
|
|
715
|
+
// defaultValue={triTagInput}
|
|
716
|
+
value: triTagInput,
|
|
717
|
+
showCount: true,
|
|
718
|
+
maxLength: 128,
|
|
719
|
+
onChange: function onChange(e) {
|
|
720
|
+
setTriTagInput(e.target.value);
|
|
721
|
+
setIsChange(true);
|
|
722
|
+
}
|
|
723
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
724
|
+
name: "businessLabelId",
|
|
725
|
+
label: "\u4E1A\u52A1\u6807\u7B7E"
|
|
726
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
727
|
+
allowClear: true,
|
|
728
|
+
disabled: homeType == 'get',
|
|
729
|
+
placeholder: "\u8BF7\u8F93\u5165\u4E1A\u52A1\u6807\u7B7E",
|
|
730
|
+
options: bizTag,
|
|
731
|
+
fieldNames: {
|
|
732
|
+
label: 'labelName',
|
|
733
|
+
value: 'id'
|
|
734
|
+
},
|
|
735
|
+
onChange: function onChange() {
|
|
736
|
+
setIsChange(true);
|
|
737
|
+
}
|
|
738
|
+
}))), homeType != 'get' && (/*#__PURE__*/React.createElement("div", {
|
|
739
|
+
className: "".concat(classPrefix, "-info"),
|
|
740
|
+
style: {
|
|
741
|
+
marginBottom: -12
|
|
742
|
+
}
|
|
743
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
744
|
+
className: "".concat(classPrefix, "-info-title")
|
|
745
|
+
}, "\u4E8B\u4EF6\u5C5E\u6027"), /*#__PURE__*/React.createElement("div", {
|
|
746
|
+
className: "".concat(classPrefix, "-info-input")
|
|
747
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
748
|
+
shape: "round",
|
|
749
|
+
className: "button",
|
|
750
|
+
onClick: function onClick() {
|
|
751
|
+
// setIsChange(true);
|
|
752
|
+
setEventAttrList([{
|
|
753
|
+
name: '',
|
|
754
|
+
aliasName: '',
|
|
755
|
+
prop_type: 1,
|
|
756
|
+
encryptionType: 0,
|
|
757
|
+
encryption_type: 0,
|
|
758
|
+
type: 1,
|
|
759
|
+
status: '',
|
|
760
|
+
key: eventAttrList.length + 1
|
|
761
|
+
}].concat(_toConsumableArray(eventAttrList)));
|
|
762
|
+
}
|
|
763
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
764
|
+
type: "tianjia1",
|
|
765
|
+
style: {
|
|
766
|
+
marginRight: 8
|
|
767
|
+
}
|
|
768
|
+
}), "\u6DFB\u52A0\u4E8B\u4EF6\u5C5E\u6027")))), /*#__PURE__*/React.createElement(Table, {
|
|
769
|
+
className: "".concat(classPrefix, "-table"),
|
|
770
|
+
id: "dataManageCreateMetaTable",
|
|
771
|
+
columns: columns,
|
|
772
|
+
rowKey: "key",
|
|
773
|
+
dataSource: eventAttrList.filter(function (item) {
|
|
774
|
+
return type < 1 || item.type === type;
|
|
775
|
+
}).filter(function (item) {
|
|
776
|
+
return encryption_type < 0 || item.encryption_type === encryption_type;
|
|
777
|
+
}),
|
|
778
|
+
scroll: {
|
|
779
|
+
y: scrollY
|
|
780
|
+
},
|
|
781
|
+
pagination: false,
|
|
782
|
+
sticky: true
|
|
783
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
784
|
+
className: "".concat(classPrefix, "-footer")
|
|
785
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
786
|
+
onClick: onClose
|
|
787
|
+
}, "\u53D6\u6D88"), homeType != 'get' && (/*#__PURE__*/React.createElement(Button, {
|
|
788
|
+
type: 'primary',
|
|
789
|
+
onClick: submit
|
|
790
|
+
}, "\u786E\u5B9A"))), /*#__PURE__*/React.createElement(BizDialog, {
|
|
791
|
+
closable: true,
|
|
792
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconFont, {
|
|
793
|
+
style: {
|
|
794
|
+
color: '#FD9F41',
|
|
795
|
+
marginRight: '8px',
|
|
796
|
+
verticalAlign: 'top',
|
|
797
|
+
fontSize: '24px'
|
|
798
|
+
},
|
|
799
|
+
type: "tishi1"
|
|
800
|
+
}), "\u63D0\u793A"),
|
|
801
|
+
open: isShowBack,
|
|
802
|
+
onOk: function onOk() {
|
|
803
|
+
setIsShowBack(false);
|
|
804
|
+
setInputText('');
|
|
805
|
+
setIsChange(false);
|
|
806
|
+
props.onClose();
|
|
807
|
+
},
|
|
808
|
+
okButtonProps: {
|
|
809
|
+
size: 'middle'
|
|
810
|
+
},
|
|
811
|
+
onCancel: function onCancel() {
|
|
812
|
+
setIsShowBack(false);
|
|
813
|
+
}
|
|
814
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
815
|
+
style: {
|
|
816
|
+
margin: '-16px 0px 0px 30px'
|
|
817
|
+
}
|
|
818
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
819
|
+
style: {
|
|
820
|
+
color: '#021429',
|
|
821
|
+
fontSize: 14
|
|
822
|
+
}
|
|
823
|
+
}, "\u5F53\u524D\u4FE1\u606F\u5C1A\u672A\u4FDD\u5B58\uFF0C\u786E\u5B9A\u9000\u51FA\u9875\u9762\uFF1F"))));
|
|
824
|
+
};
|
|
825
|
+
export default CreateMeta;
|