@zgfe/modules-settings 2.0.0-zhongyuan.9 → 2.1.0-zhongyuan-set.2
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/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/constants/api.d.ts +30 -0
- package/es/constants/api.js +43 -1
- package/es/modules/appSettings/dataAccessFilter/index.js +2 -1
- 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 +32 -14
- package/es/modules/companySetting/index.js +37 -33
- package/es/modules/companySetting/operationLog/index.js +22 -5
- package/es/modules/companySetting/user/index.js +29 -24
- package/es/modules/companySetting/user/invite.js +30 -102
- 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 +127 -1
- package/es/modules/createDemand_bf/demo/index.js +0 -1
- package/es/modules/createDemand_bf/index.js +0 -1
- 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/demandManage/index.js +174 -178
- package/es/modules/demandManage/styles/index.less +155 -215
- package/es/modules/messageList/index.d.ts +1 -1
- package/es/modules/messageList/index.js +6 -6
- 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/pointMap/createMetaDrawer.d.ts +5 -0
- package/es/modules/pointMap/createMetaDrawer.js +827 -0
- 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 +127 -0
- package/es/modules/pointMap/styles/pageInfo.less +195 -0
- 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/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.js +16 -16
- package/es/types/personal.d.ts +1 -0
- package/package.json +74 -74
|
@@ -0,0 +1,827 @@
|
|
|
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: undefined
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
setEventAttrList(function () {
|
|
160
|
+
return _toConsumableArray(resultArr);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
//把参数传递给主页面
|
|
164
|
+
if (props.onSubmit) {
|
|
165
|
+
props.onSubmit({
|
|
166
|
+
eventName: values.eventName,
|
|
167
|
+
aliasName: values.aliasName,
|
|
168
|
+
triggeringOccasion: triTagInput,
|
|
169
|
+
businessLabelId: values.businessLabelId,
|
|
170
|
+
triggerLabelId: triTagId,
|
|
171
|
+
businessLabel: values.businessLabelId && bizTag.filter(function (res) {
|
|
172
|
+
return res.id == values.businessLabelId;
|
|
173
|
+
})[0],
|
|
174
|
+
triggerLabel: triTagId && triTag.filter(function (res) {
|
|
175
|
+
return res.id == triTagId;
|
|
176
|
+
})[0],
|
|
177
|
+
eventAttrList: eventAttrList
|
|
178
|
+
}, props.data ? 'update' : 'create');
|
|
179
|
+
}
|
|
180
|
+
_context.next = 25;
|
|
181
|
+
break;
|
|
182
|
+
case 22:
|
|
183
|
+
_context.prev = 22;
|
|
184
|
+
_context.t0 = _context["catch"](1);
|
|
185
|
+
console.log('表单验证失败:', _context.t0);
|
|
186
|
+
case 25:
|
|
187
|
+
case "end":
|
|
188
|
+
return _context.stop();
|
|
189
|
+
}
|
|
190
|
+
}, _callee, null, [[1, 22]]);
|
|
191
|
+
}));
|
|
192
|
+
return function submit() {
|
|
193
|
+
return _ref.apply(this, arguments);
|
|
194
|
+
};
|
|
195
|
+
}();
|
|
196
|
+
function findDuplicateObjects(arr) {
|
|
197
|
+
var map = new Map(); // key: name值, value: 对应的对象
|
|
198
|
+
var duplicates = [];
|
|
199
|
+
var _iterator = _createForOfIteratorHelper(arr),
|
|
200
|
+
_step;
|
|
201
|
+
try {
|
|
202
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
203
|
+
var obj = _step.value;
|
|
204
|
+
var name = obj.name || obj.attr_name;
|
|
205
|
+
if (map.has(name)) {
|
|
206
|
+
// 找到重复项,把已存的对象和当前对象加入结果
|
|
207
|
+
duplicates.push(map.get(name), obj);
|
|
208
|
+
break; // 只找第一组重复项,如需全部可去掉break
|
|
209
|
+
} else {
|
|
210
|
+
map.set(name, obj);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} catch (err) {
|
|
214
|
+
_iterator.e(err);
|
|
215
|
+
} finally {
|
|
216
|
+
_iterator.f();
|
|
217
|
+
}
|
|
218
|
+
return duplicates.map(function (o) {
|
|
219
|
+
return o.name;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
var dealEventAttr = function dealEventAttr(index) {
|
|
223
|
+
var dealData = _.clone(eventAttrList);
|
|
224
|
+
dealData.splice(index, 1);
|
|
225
|
+
setEventAttrList(dealData);
|
|
226
|
+
setIsChange(true);
|
|
227
|
+
};
|
|
228
|
+
// 表格列表筛选项
|
|
229
|
+
var _useState11 = useState(0),
|
|
230
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
231
|
+
type = _useState12[0],
|
|
232
|
+
setType = _useState12[1];
|
|
233
|
+
var _useState13 = useState(-1),
|
|
234
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
235
|
+
encryption_type = _useState14[0],
|
|
236
|
+
setEncryptionType = _useState14[1];
|
|
237
|
+
var columns = [{
|
|
238
|
+
title: '序号',
|
|
239
|
+
dataIndex: 'event_name',
|
|
240
|
+
key: 'event_name',
|
|
241
|
+
width: 64,
|
|
242
|
+
render: function render(text, record, index) {
|
|
243
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
title: (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
247
|
+
style: {
|
|
248
|
+
color: '#FB5547',
|
|
249
|
+
marginRight: 8
|
|
250
|
+
}
|
|
251
|
+
}, "*"), "\u4E8B\u4EF6\u5C5E\u6027\u540D\u79F0")),
|
|
252
|
+
dataIndex: 'name',
|
|
253
|
+
key: 'name',
|
|
254
|
+
width: 264,
|
|
255
|
+
render: function render(text, record, index) {
|
|
256
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
257
|
+
style: {
|
|
258
|
+
margin: '-10px 0'
|
|
259
|
+
}
|
|
260
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
261
|
+
disabled: homeType == 'get',
|
|
262
|
+
placeholder: '请输入事件属性名',
|
|
263
|
+
value: text,
|
|
264
|
+
showCount: true,
|
|
265
|
+
status: record === null || record === void 0 ? void 0 : record.status,
|
|
266
|
+
maxLength: 128,
|
|
267
|
+
onChange: function onChange(e) {
|
|
268
|
+
setIsChange(true);
|
|
269
|
+
changeItemInfo(index, 'name', e.target.value);
|
|
270
|
+
}
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
title: '属性别名',
|
|
275
|
+
dataIndex: 'aliasName',
|
|
276
|
+
key: 'aliasName',
|
|
277
|
+
width: 234,
|
|
278
|
+
render: function render(aliasName, record, index) {
|
|
279
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
280
|
+
style: {
|
|
281
|
+
margin: '-10px 0'
|
|
282
|
+
}
|
|
283
|
+
}, /*#__PURE__*/React.createElement(BizEditText, {
|
|
284
|
+
canEdit: homeType != 'get',
|
|
285
|
+
value: aliasName,
|
|
286
|
+
max: 128,
|
|
287
|
+
placeholder: '请输入属性别名',
|
|
288
|
+
onChange: function onChange(e) {
|
|
289
|
+
setIsChange(true);
|
|
290
|
+
changeItemInfo(index, 'aliasName', e);
|
|
291
|
+
}
|
|
292
|
+
}));
|
|
293
|
+
}
|
|
294
|
+
}, {
|
|
295
|
+
title: (/*#__PURE__*/React.createElement("div", {
|
|
296
|
+
className: "".concat(classPrefix, "-content-select")
|
|
297
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
298
|
+
style: {
|
|
299
|
+
color: '#FB5547',
|
|
300
|
+
marginRight: 8
|
|
301
|
+
}
|
|
302
|
+
}, "*"), /*#__PURE__*/React.createElement(Select, {
|
|
303
|
+
disabled: homeType == 'get',
|
|
304
|
+
defaultValue: 0,
|
|
305
|
+
style: {
|
|
306
|
+
width: 120,
|
|
307
|
+
margin: '-10px 0'
|
|
308
|
+
},
|
|
309
|
+
onChange: function onChange(e) {
|
|
310
|
+
return setType(e);
|
|
311
|
+
},
|
|
312
|
+
bordered: false,
|
|
313
|
+
className: "select-style",
|
|
314
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
315
|
+
type: "xiangxia",
|
|
316
|
+
style: {
|
|
317
|
+
color: '#5f6085'
|
|
318
|
+
}
|
|
319
|
+
}),
|
|
320
|
+
// onChange={(e) => props.eventActiveFilter(e, 'event_hidden')}
|
|
321
|
+
options: [{
|
|
322
|
+
value: 0,
|
|
323
|
+
label: '属性类型'
|
|
324
|
+
}, {
|
|
325
|
+
value: 1,
|
|
326
|
+
label: '字符串'
|
|
327
|
+
}, {
|
|
328
|
+
value: 2,
|
|
329
|
+
label: '数值'
|
|
330
|
+
}, {
|
|
331
|
+
value: 3,
|
|
332
|
+
label: '日期'
|
|
333
|
+
}]
|
|
334
|
+
}))),
|
|
335
|
+
dataIndex: 'prop_type',
|
|
336
|
+
key: 'prop_type',
|
|
337
|
+
width: 148,
|
|
338
|
+
render: function render(prop_type, record, index) {
|
|
339
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
340
|
+
className: "".concat(classPrefix, "-content-select")
|
|
341
|
+
}, /*#__PURE__*/React.createElement(Select
|
|
342
|
+
// defaultValue={record.event_hidden}
|
|
343
|
+
, {
|
|
344
|
+
// defaultValue={record.event_hidden}
|
|
345
|
+
style: {
|
|
346
|
+
width: 120,
|
|
347
|
+
margin: '-10px 0'
|
|
348
|
+
},
|
|
349
|
+
value: prop_type,
|
|
350
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
351
|
+
type: "xiangxia",
|
|
352
|
+
style: {
|
|
353
|
+
color: '#5f6085'
|
|
354
|
+
}
|
|
355
|
+
}),
|
|
356
|
+
disabled: homeType == 'get',
|
|
357
|
+
onChange: function onChange(e) {
|
|
358
|
+
setIsChange(true);
|
|
359
|
+
changeItemInfo(index, 'type', e);
|
|
360
|
+
},
|
|
361
|
+
options: [{
|
|
362
|
+
value: 1,
|
|
363
|
+
label: '字符串'
|
|
364
|
+
}, {
|
|
365
|
+
value: 2,
|
|
366
|
+
label: '数值'
|
|
367
|
+
}, {
|
|
368
|
+
value: 3,
|
|
369
|
+
label: '日期'
|
|
370
|
+
}]
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
}, {
|
|
374
|
+
title: (/*#__PURE__*/React.createElement("div", {
|
|
375
|
+
className: "".concat(classPrefix, "-content-select")
|
|
376
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
377
|
+
style: {
|
|
378
|
+
color: '#FB5547',
|
|
379
|
+
marginRight: 8
|
|
380
|
+
}
|
|
381
|
+
}, "*"), /*#__PURE__*/React.createElement(Select, {
|
|
382
|
+
defaultValue: -1,
|
|
383
|
+
bordered: false,
|
|
384
|
+
onChange: function onChange(e) {
|
|
385
|
+
return setEncryptionType(e);
|
|
386
|
+
},
|
|
387
|
+
style: {
|
|
388
|
+
width: 120,
|
|
389
|
+
margin: '-10px 0'
|
|
390
|
+
},
|
|
391
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
392
|
+
type: "xiangxia",
|
|
393
|
+
style: {
|
|
394
|
+
color: '#5f6085'
|
|
395
|
+
}
|
|
396
|
+
}),
|
|
397
|
+
// onChange={(e) => props.eventActiveFilter(e, 'is_stop')}
|
|
398
|
+
disabled: homeType == 'get',
|
|
399
|
+
options: [{
|
|
400
|
+
value: -1,
|
|
401
|
+
label: '加密方式'
|
|
402
|
+
}, {
|
|
403
|
+
value: 0,
|
|
404
|
+
label: '不加密'
|
|
405
|
+
}, {
|
|
406
|
+
value: 1,
|
|
407
|
+
label: '半加密'
|
|
408
|
+
}, {
|
|
409
|
+
value: 2,
|
|
410
|
+
label: '全加密'
|
|
411
|
+
}]
|
|
412
|
+
}))),
|
|
413
|
+
dataIndex: 'encryption_type',
|
|
414
|
+
key: 'encryption_type',
|
|
415
|
+
width: 148,
|
|
416
|
+
render: function render(encryption_type, record, index) {
|
|
417
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
418
|
+
className: "".concat(classPrefix, "-content-select")
|
|
419
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
420
|
+
value: encryption_type,
|
|
421
|
+
style: {
|
|
422
|
+
width: 120,
|
|
423
|
+
margin: '-10px 0'
|
|
424
|
+
},
|
|
425
|
+
suffixIcon: /*#__PURE__*/React.createElement(IconFont, {
|
|
426
|
+
type: "xiangxia",
|
|
427
|
+
style: {
|
|
428
|
+
color: '#5f6085'
|
|
429
|
+
}
|
|
430
|
+
}),
|
|
431
|
+
disabled: homeType == 'get',
|
|
432
|
+
onChange: function onChange(e) {
|
|
433
|
+
setIsChange(true);
|
|
434
|
+
changeItemInfo(index, 'encryptionType', e);
|
|
435
|
+
},
|
|
436
|
+
options: [{
|
|
437
|
+
value: 0,
|
|
438
|
+
label: '不加密'
|
|
439
|
+
}, {
|
|
440
|
+
value: 1,
|
|
441
|
+
label: '半加密'
|
|
442
|
+
}, {
|
|
443
|
+
value: 2,
|
|
444
|
+
label: '全加密'
|
|
445
|
+
}]
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
}];
|
|
449
|
+
homeType != 'get' && columns.push({
|
|
450
|
+
title: '操作',
|
|
451
|
+
dataIndex: 'set',
|
|
452
|
+
key: 'set',
|
|
453
|
+
width: 64,
|
|
454
|
+
render: function render(_, record, index) {
|
|
455
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
456
|
+
className: "set ".concat(record.owner == 'zg_abp' ? 'set-error' : ''),
|
|
457
|
+
onClick: function onClick() {
|
|
458
|
+
return dealEventAttr(index);
|
|
459
|
+
}
|
|
460
|
+
}, "\u5220\u9664");
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
var _useState15 = useState(''),
|
|
464
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
465
|
+
scrollY = _useState16[0],
|
|
466
|
+
setScrollY = _useState16[1];
|
|
467
|
+
var getTableScroll = function getTableScroll(extraHeight, id) {
|
|
468
|
+
if (typeof extraHeight == 'undefined') {
|
|
469
|
+
// 默认底部分页64 + 边距10
|
|
470
|
+
extraHeight = 74;
|
|
471
|
+
}
|
|
472
|
+
var tHeader = null;
|
|
473
|
+
if (id) {
|
|
474
|
+
var _document$getElementB;
|
|
475
|
+
tHeader = document.getElementById(id) ? (_document$getElementB = document.getElementById(id)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.getElementsByClassName('ant-table-thead')[0] : null;
|
|
476
|
+
} else {
|
|
477
|
+
tHeader = document.getElementsByClassName('ant-table-thead')[0];
|
|
478
|
+
}
|
|
479
|
+
//表格内容距离顶部的距离
|
|
480
|
+
var tHeaderBottom = 0;
|
|
481
|
+
if (tHeader) {
|
|
482
|
+
tHeaderBottom = tHeader.getBoundingClientRect().bottom;
|
|
483
|
+
}
|
|
484
|
+
//窗体高度-表格内容顶部的高度-表格内容底部的高度
|
|
485
|
+
// let height = document.body.clientHeight - tHeaderBottom - extraHeight
|
|
486
|
+
var height = "calc(100vh - ".concat(tHeaderBottom + extraHeight, "px)");
|
|
487
|
+
return height;
|
|
488
|
+
};
|
|
489
|
+
//页面加载完成后才能获取到对应的元素及其位置
|
|
490
|
+
useEffect(function () {
|
|
491
|
+
var _Y = getTableScroll(545, 'dataManageCreateMetaTable');
|
|
492
|
+
setScrollY(_Y);
|
|
493
|
+
getTagList(2);
|
|
494
|
+
getTagList(3);
|
|
495
|
+
}, []);
|
|
496
|
+
var onClose = function onClose() {
|
|
497
|
+
if (isChange) {
|
|
498
|
+
setIsShowBack(true);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
props.onClose();
|
|
502
|
+
};
|
|
503
|
+
// 是否复制的开关
|
|
504
|
+
var changeSwitch = function changeSwitch(event) {
|
|
505
|
+
// 清空其他数据
|
|
506
|
+
form.resetFields(); // 重置表单数据
|
|
507
|
+
setEventAttrList([]);
|
|
508
|
+
setTriTagInput(undefined);
|
|
509
|
+
setTriTagId(undefined);
|
|
510
|
+
setInputText('');
|
|
511
|
+
setIsCopy(event);
|
|
512
|
+
};
|
|
513
|
+
// 根据事件id获取属性列表
|
|
514
|
+
function getEventIdAttrList(id) {
|
|
515
|
+
request(apis.getEventAttributes, {
|
|
516
|
+
method: 'post',
|
|
517
|
+
data: {
|
|
518
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
519
|
+
eventId: id
|
|
520
|
+
}
|
|
521
|
+
}).then(function (res) {
|
|
522
|
+
setEventAttrList(_toConsumableArray(res.data.map(function (item) {
|
|
523
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
524
|
+
aliasName: item.alias_name,
|
|
525
|
+
name: item.attr_name,
|
|
526
|
+
type: item.prop_type,
|
|
527
|
+
encryptionType: item.encryption_type
|
|
528
|
+
});
|
|
529
|
+
})));
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
var onChangeEvent = function onChangeEvent(_ref2) {
|
|
533
|
+
var event = _ref2.event;
|
|
534
|
+
form.setFieldsValue({
|
|
535
|
+
aliasName: event.alias,
|
|
536
|
+
eventName: event.name
|
|
537
|
+
});
|
|
538
|
+
setInputText(event.name);
|
|
539
|
+
getEventIdAttrList(event.id);
|
|
540
|
+
};
|
|
541
|
+
//标签列表数据 2:业务标签 3:触发标签
|
|
542
|
+
var _useState17 = useState([]),
|
|
543
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
544
|
+
bizTag = _useState18[0],
|
|
545
|
+
setBizTag = _useState18[1];
|
|
546
|
+
var _useState19 = useState(),
|
|
547
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
548
|
+
triTagInput = _useState20[0],
|
|
549
|
+
setTriTagInput = _useState20[1]; // 触发时机
|
|
550
|
+
var _useState21 = useState([]),
|
|
551
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
552
|
+
triTag = _useState22[0],
|
|
553
|
+
setTriTag = _useState22[1];
|
|
554
|
+
var _useState23 = useState(),
|
|
555
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
556
|
+
triTagId = _useState24[0],
|
|
557
|
+
setTriTagId = _useState24[1];
|
|
558
|
+
var getTagList = function getTagList(type) {
|
|
559
|
+
request(apis.dict.getTagList, {
|
|
560
|
+
method: 'post',
|
|
561
|
+
data: {
|
|
562
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
563
|
+
labelType: type
|
|
564
|
+
}
|
|
565
|
+
}).then(function (res) {
|
|
566
|
+
if (res && res.code == '100000') {
|
|
567
|
+
switch (type) {
|
|
568
|
+
case 2:
|
|
569
|
+
setBizTag(res.data.map(function (res) {
|
|
570
|
+
return {
|
|
571
|
+
labelName: res.labelName,
|
|
572
|
+
id: res.id
|
|
573
|
+
};
|
|
574
|
+
}));
|
|
575
|
+
break;
|
|
576
|
+
case 3:
|
|
577
|
+
setTriTag(res.data.map(function (res) {
|
|
578
|
+
return {
|
|
579
|
+
labelName: res.labelName,
|
|
580
|
+
id: res.id
|
|
581
|
+
};
|
|
582
|
+
}));
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
// 自定义验证规则
|
|
589
|
+
var _useState25 = useState(''),
|
|
590
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
591
|
+
inputText = _useState26[0],
|
|
592
|
+
setInputText = _useState26[1];
|
|
593
|
+
// true 验证通过
|
|
594
|
+
var validateContainsUnderscore = function validateContainsUnderscore(value) {
|
|
595
|
+
if (!isChange) {
|
|
596
|
+
// 第一次进来不报错
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
if (value == '' || props.selectTreeName && !value.includes('_')) {
|
|
600
|
+
return false;
|
|
601
|
+
}
|
|
602
|
+
return true;
|
|
603
|
+
};
|
|
604
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
605
|
+
className: classPrefix,
|
|
606
|
+
width: 1000,
|
|
607
|
+
title: /*#__PURE__*/React.createElement("div", null, homeType == 'get' ? '查看' : homeType == 'update' ? '编辑' : '创建', "\u5143\u4E8B\u4EF6"),
|
|
608
|
+
placement: "right",
|
|
609
|
+
onClose: onClose,
|
|
610
|
+
destroyOnClose: true,
|
|
611
|
+
open: props.isShow,
|
|
612
|
+
extra: /*#__PURE__*/React.createElement(IconFont, {
|
|
613
|
+
type: "qingchu",
|
|
614
|
+
onClick: onClose
|
|
615
|
+
})
|
|
616
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
617
|
+
className: "".concat(classPrefix, "-content")
|
|
618
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
619
|
+
form: form,
|
|
620
|
+
labelCol: {
|
|
621
|
+
span: 2
|
|
622
|
+
},
|
|
623
|
+
wrapperCol: {
|
|
624
|
+
span: 22
|
|
625
|
+
},
|
|
626
|
+
initialValues: {
|
|
627
|
+
eventName: '',
|
|
628
|
+
aliasName: '',
|
|
629
|
+
businessLabelId: triTagId || undefined,
|
|
630
|
+
maidianID: []
|
|
631
|
+
}
|
|
632
|
+
}, homeType == 'create' && (/*#__PURE__*/React.createElement(Form.Item, {
|
|
633
|
+
label: "\u4ECE\u73B0\u6709\u7684\u5143\u4E8B\u4EF6\u590D\u5236",
|
|
634
|
+
labelCol: {
|
|
635
|
+
span: 4
|
|
636
|
+
}
|
|
637
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
638
|
+
style: {
|
|
639
|
+
marginLeft: '20px'
|
|
640
|
+
},
|
|
641
|
+
defaultChecked: false,
|
|
642
|
+
checked: isCopy,
|
|
643
|
+
onChange: changeSwitch
|
|
644
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
645
|
+
name: "eventName",
|
|
646
|
+
label: "\u4E8B\u4EF6\u540D\u79F0",
|
|
647
|
+
rules: [{
|
|
648
|
+
required: true,
|
|
649
|
+
message: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u540D\u79F0"
|
|
650
|
+
}],
|
|
651
|
+
validateStatus: validateContainsUnderscore(inputText) ? '' : 'error',
|
|
652
|
+
help: validateContainsUnderscore(inputText) ? '' : inputText == '' ? '请输入事件名称' : "\u8BF7\u6839\u636E\u9875\u9762\u5C42\u7EA7\u547D\u540D\uFF0C\u5982\uFF1A".concat(props.selectTreeName)
|
|
653
|
+
}, isCopy ? (/*#__PURE__*/React.createElement("div", {
|
|
654
|
+
style: {
|
|
655
|
+
width: '100%'
|
|
656
|
+
}
|
|
657
|
+
}, /*#__PURE__*/React.createElement(BizEventSelector, {
|
|
658
|
+
showAllEvent: false,
|
|
659
|
+
multiple: false,
|
|
660
|
+
key: "eventProp",
|
|
661
|
+
showBuiltInTarget: false,
|
|
662
|
+
popupContainer: false,
|
|
663
|
+
defaultSelectAble: false,
|
|
664
|
+
onChange: onChangeEvent,
|
|
665
|
+
placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
|
|
666
|
+
}))) : (/*#__PURE__*/React.createElement(Input, {
|
|
667
|
+
disabled: homeType == 'update' || homeType == 'get',
|
|
668
|
+
placeholder: "".concat(props.selectTreeName ? "\u8BF7\u6839\u636E\u9875\u9762\u5C42\u7EA7\u547D\u540D\uFF0C\u5982\uFF1A".concat(props.selectTreeName) : '请输入事件名称'),
|
|
669
|
+
showCount: true,
|
|
670
|
+
maxLength: 128,
|
|
671
|
+
onChange: function onChange(e) {
|
|
672
|
+
setInputText(e.target.value);
|
|
673
|
+
setIsChange(true);
|
|
674
|
+
}
|
|
675
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
676
|
+
name: "aliasName",
|
|
677
|
+
label: "\u4E8B\u4EF6\u522B\u540D"
|
|
678
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
679
|
+
disabled: homeType == 'get',
|
|
680
|
+
placeholder: "\u8BF7\u8F93\u5165\u4E8B\u4EF6\u522B\u540D",
|
|
681
|
+
showCount: true,
|
|
682
|
+
maxLength: 128,
|
|
683
|
+
onChange: function onChange() {
|
|
684
|
+
return setIsChange(true);
|
|
685
|
+
}
|
|
686
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
687
|
+
name: "triggeringOccasion",
|
|
688
|
+
label: "\u89E6\u53D1\u65F6\u673A"
|
|
689
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
690
|
+
allowClear: true,
|
|
691
|
+
style: {
|
|
692
|
+
border: 0,
|
|
693
|
+
width: '160px',
|
|
694
|
+
marginRight: '10px'
|
|
695
|
+
},
|
|
696
|
+
disabled: homeType == 'get',
|
|
697
|
+
placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u6807\u7B7E",
|
|
698
|
+
// defaultValue={triTagId}
|
|
699
|
+
value: triTagId,
|
|
700
|
+
options: triTag,
|
|
701
|
+
fieldNames: {
|
|
702
|
+
label: 'labelName',
|
|
703
|
+
value: 'id'
|
|
704
|
+
},
|
|
705
|
+
onChange: function onChange(value) {
|
|
706
|
+
setTriTagId(value);
|
|
707
|
+
setIsChange(true);
|
|
708
|
+
}
|
|
709
|
+
}), "\u6216", /*#__PURE__*/React.createElement(Input, {
|
|
710
|
+
disabled: homeType == 'get',
|
|
711
|
+
style: {
|
|
712
|
+
border: 0,
|
|
713
|
+
width: 'calc(100% - 195px)',
|
|
714
|
+
marginLeft: '10px'
|
|
715
|
+
},
|
|
716
|
+
placeholder: "\u8BF7\u8F93\u5165\u89E6\u53D1\u65F6\u673A\uFF0C\u4F8B\u5982\uFF1A\u7528\u6237\u70B9\u51FB\u786E\u8BA4\u6309\u94AE",
|
|
717
|
+
// defaultValue={triTagInput}
|
|
718
|
+
value: triTagInput,
|
|
719
|
+
showCount: true,
|
|
720
|
+
maxLength: 128,
|
|
721
|
+
onChange: function onChange(e) {
|
|
722
|
+
setTriTagInput(e.target.value);
|
|
723
|
+
setIsChange(true);
|
|
724
|
+
}
|
|
725
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
726
|
+
name: "businessLabelId",
|
|
727
|
+
label: "\u4E1A\u52A1\u6807\u7B7E"
|
|
728
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
729
|
+
allowClear: true,
|
|
730
|
+
disabled: homeType == 'get',
|
|
731
|
+
placeholder: "\u8BF7\u8F93\u5165\u4E1A\u52A1\u6807\u7B7E",
|
|
732
|
+
options: bizTag,
|
|
733
|
+
fieldNames: {
|
|
734
|
+
label: 'labelName',
|
|
735
|
+
value: 'id'
|
|
736
|
+
},
|
|
737
|
+
onChange: function onChange() {
|
|
738
|
+
setIsChange(true);
|
|
739
|
+
}
|
|
740
|
+
}))), homeType != 'get' && (/*#__PURE__*/React.createElement("div", {
|
|
741
|
+
className: "".concat(classPrefix, "-info"),
|
|
742
|
+
style: {
|
|
743
|
+
marginBottom: -12
|
|
744
|
+
}
|
|
745
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
746
|
+
className: "".concat(classPrefix, "-info-title")
|
|
747
|
+
}, "\u4E8B\u4EF6\u5C5E\u6027"), /*#__PURE__*/React.createElement("div", {
|
|
748
|
+
className: "".concat(classPrefix, "-info-input")
|
|
749
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
750
|
+
shape: "round",
|
|
751
|
+
className: "button",
|
|
752
|
+
onClick: function onClick() {
|
|
753
|
+
// setIsChange(true);
|
|
754
|
+
setEventAttrList([{
|
|
755
|
+
name: '',
|
|
756
|
+
aliasName: '',
|
|
757
|
+
prop_type: 1,
|
|
758
|
+
encryptionType: 0,
|
|
759
|
+
encryption_type: 0,
|
|
760
|
+
type: 1,
|
|
761
|
+
status: '',
|
|
762
|
+
key: eventAttrList.length + 1
|
|
763
|
+
}].concat(_toConsumableArray(eventAttrList)));
|
|
764
|
+
}
|
|
765
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
766
|
+
type: "tianjia1",
|
|
767
|
+
style: {
|
|
768
|
+
marginRight: 8
|
|
769
|
+
}
|
|
770
|
+
}), "\u6DFB\u52A0\u4E8B\u4EF6\u5C5E\u6027")))), /*#__PURE__*/React.createElement(Table, {
|
|
771
|
+
className: "".concat(classPrefix, "-table"),
|
|
772
|
+
id: "dataManageCreateMetaTable",
|
|
773
|
+
columns: columns,
|
|
774
|
+
rowKey: "key",
|
|
775
|
+
dataSource: eventAttrList.filter(function (item) {
|
|
776
|
+
return type < 1 || item.type === type;
|
|
777
|
+
}).filter(function (item) {
|
|
778
|
+
return encryption_type < 0 || item.encryption_type === encryption_type;
|
|
779
|
+
}),
|
|
780
|
+
scroll: {
|
|
781
|
+
y: scrollY
|
|
782
|
+
},
|
|
783
|
+
pagination: false,
|
|
784
|
+
sticky: true
|
|
785
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
786
|
+
className: "".concat(classPrefix, "-footer")
|
|
787
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
788
|
+
onClick: onClose
|
|
789
|
+
}, "\u53D6\u6D88"), homeType != 'get' && (/*#__PURE__*/React.createElement(Button, {
|
|
790
|
+
type: 'primary',
|
|
791
|
+
onClick: submit
|
|
792
|
+
}, "\u786E\u5B9A"))), /*#__PURE__*/React.createElement(BizDialog, {
|
|
793
|
+
closable: true,
|
|
794
|
+
title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconFont, {
|
|
795
|
+
style: {
|
|
796
|
+
color: '#FD9F41',
|
|
797
|
+
marginRight: '8px',
|
|
798
|
+
verticalAlign: 'top',
|
|
799
|
+
fontSize: '24px'
|
|
800
|
+
},
|
|
801
|
+
type: "tishi1"
|
|
802
|
+
}), "\u63D0\u793A"),
|
|
803
|
+
open: isShowBack,
|
|
804
|
+
onOk: function onOk() {
|
|
805
|
+
setIsShowBack(false);
|
|
806
|
+
setInputText('');
|
|
807
|
+
setIsChange(false);
|
|
808
|
+
props.onClose();
|
|
809
|
+
},
|
|
810
|
+
okButtonProps: {
|
|
811
|
+
size: 'middle'
|
|
812
|
+
},
|
|
813
|
+
onCancel: function onCancel() {
|
|
814
|
+
setIsShowBack(false);
|
|
815
|
+
}
|
|
816
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
817
|
+
style: {
|
|
818
|
+
margin: '-16px 0px 0px 30px'
|
|
819
|
+
}
|
|
820
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
821
|
+
style: {
|
|
822
|
+
color: '#021429',
|
|
823
|
+
fontSize: 14
|
|
824
|
+
}
|
|
825
|
+
}, "\u5F53\u524D\u4FE1\u606F\u5C1A\u672A\u4FDD\u5B58\uFF0C\u786E\u5B9A\u9000\u51FA\u9875\u9762\uFF1F"))));
|
|
826
|
+
};
|
|
827
|
+
export default CreateMeta;
|