@chaoswise/business 0.0.1 → 0.0.3

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.
@@ -0,0 +1,30 @@
1
+ import _Icon from "@chaoswise/ui/lib/Antd/Icon";
2
+ var _excluded = ["type"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+ import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ var MyIcon = _Icon.createFromIconfontCN({
9
+ scriptUrl: require('./iconfont') // 在 iconfont.cn 上生成, 下载到本地icon.js中
10
+ // scriptUrl: "//at.alicdn.com/t/font_1250764_yitbrirt9ds.js", // 在 iconfont.cn 上生成, 下载到本地icon.js中
11
+ });
12
+
13
+ /**
14
+ * 自定义icon
15
+ */
16
+ var CustomIcon = function CustomIcon(_ref) {
17
+ var type = _ref.type,
18
+ rest = _objectWithoutProperties(_ref, _excluded);
19
+ return /*#__PURE__*/React.createElement(MyIcon, _extends({
20
+ type: "dosm-".concat(type)
21
+ }, rest));
22
+ };
23
+ CustomIcon.propTypes = {
24
+ type: PropTypes.string.isRequired // icon类型
25
+ };
26
+
27
+ CustomIcon.defaultProps = {
28
+ theme: "filled"
29
+ };
30
+ export default CustomIcon;
@@ -0,0 +1,41 @@
1
+ var _excluded = ["iconType", "type"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React from 'react';
6
+ import PropTypes from 'prop-types';
7
+ import CustomIcon from "./CustomIcon";
8
+
9
+ /**
10
+ * 应用icon
11
+ * 说明:
12
+ * appType="antd" 是加载的antd中的icon
13
+ * appType="custom" 是加载的自定义icon
14
+ * iconType 是指icon的标识
15
+ */
16
+ var DoAppIcon = function DoAppIcon(_ref) {
17
+ var iconType = _ref.iconType,
18
+ type = _ref.type,
19
+ rest = _objectWithoutProperties(_ref, _excluded);
20
+ switch (iconType) {
21
+ case "antd":
22
+ var RealCom = type;
23
+ return /*#__PURE__*/React.createElement(RealCom, rest);
24
+ case "custom":
25
+ return /*#__PURE__*/React.createElement(CustomIcon, _extends({
26
+ type: type
27
+ }, rest));
28
+ default:
29
+ return function () {
30
+ return null;
31
+ };
32
+ }
33
+ };
34
+ DoAppIcon.propTypes = {
35
+ iconType: PropTypes.oneOf(["antd", "custom"]).isRequired,
36
+ type: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
37
+ };
38
+ DoAppIcon.defaultProps = {
39
+ iconType: "custom"
40
+ };
41
+ export default DoAppIcon;
@@ -0,0 +1,51 @@
1
+ import _Popover from "@chaoswise/ui/lib/Antd/Popover";
2
+ 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); }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ import React, { useMemo, useState, useEffect, Fragment } from 'react';
7
+ import classnames from 'classnames';
8
+ import DoAppIcon from './DoAppIcon';
9
+ import '../assets/index.less';
10
+ var DoUnitBitmap = function DoUnitBitmap(_ref) {
11
+ var data = _ref.data;
12
+ var list = data.list,
13
+ handleClickChange = data.handleClickChange;
14
+ var clickTitle = function clickTitle(item) {
15
+ handleClickChange(item);
16
+ };
17
+ var content = function content(item) {
18
+ var detail = item.detail;
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: "ciunitbitmap-content-box"
21
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
22
+ className: "ciunitbitmap-modal-icon-box"
23
+ }, /*#__PURE__*/React.createElement(DoAppIcon, {
24
+ className: "ciunitbitmap-modal-icon",
25
+ type: detail.iconPath || 'icon-1'
26
+ }))), /*#__PURE__*/React.createElement("div", {
27
+ className: "ciunitbitmap-content-text"
28
+ }, /*#__PURE__*/React.createElement("a", {
29
+ onClick: function onClick() {
30
+ return clickTitle(detail);
31
+ }
32
+ }, detail.ciName)));
33
+ };
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ className: 'unit-bitmap-box'
36
+ }, (list === null || list === void 0 ? void 0 : list.length) > 0 ? /*#__PURE__*/React.createElement(Fragment, null, list === null || list === void 0 ? void 0 : list.map(function (item) {
37
+ var _classnames, _classnames2;
38
+ return /*#__PURE__*/React.createElement(Fragment, {
39
+ key: item.index
40
+ }, item.status == 2 ? /*#__PURE__*/React.createElement(_Popover, {
41
+ content: content(item)
42
+ }, /*#__PURE__*/React.createElement("div", {
43
+ key: item.index,
44
+ className: classnames('lattice', (_classnames = {}, _defineProperty(_classnames, 'locked_lattice', item.status === 1), _defineProperty(_classnames, 'usaged_lattice', item.status === 2), _classnames))
45
+ }, item.index)) : /*#__PURE__*/React.createElement("div", {
46
+ key: item.index,
47
+ className: classnames('lattice', (_classnames2 = {}, _defineProperty(_classnames2, 'locked_lattice', item.status === 1), _defineProperty(_classnames2, 'usaged_lattice', item.status === 2), _classnames2))
48
+ }, item.index));
49
+ })) : '--');
50
+ };
51
+ export default DoUnitBitmap;
@@ -0,0 +1,22 @@
1
+ import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
+ import _Typography from "@chaoswise/ui/lib/Antd/Typography";
3
+ import React, { Fragment } from "react";
4
+ var Paragraph = _Typography.Paragraph;
5
+ var DoCommon = function DoCommon(_ref) {
6
+ var data = _ref.data;
7
+ var paragraphEllipsis = data.paragraphEllipsis,
8
+ list = data.list;
9
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
10
+ style: {
11
+ wordBreak: "break-all"
12
+ }
13
+ }, (list || []).map(function (item, index) {
14
+ return /*#__PURE__*/React.createElement(_Tooltip, {
15
+ title: item.value,
16
+ key: index
17
+ }, paragraphEllipsis ? /*#__PURE__*/React.createElement(Paragraph, {
18
+ ellipsis: paragraphEllipsis
19
+ }, item.value) : /*#__PURE__*/React.createElement("span", null, item.value));
20
+ })));
21
+ };
22
+ export default DoCommon;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ var DoDefaultPlaceholder = function DoDefaultPlaceholder() {
3
+ return /*#__PURE__*/React.createElement("div", {
4
+ style: {
5
+ marginLeft: "2px"
6
+ }
7
+ }, "--");
8
+ };
9
+ export default DoDefaultPlaceholder;
@@ -0,0 +1,97 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ import "antd/es/modal/style";
3
+ import _Modal from "antd/es/modal";
4
+ import "antd/es/upload/style";
5
+ import _Upload from "antd/es/upload";
6
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
8
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ 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."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ 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; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ import React, { Fragment, useState } from 'react';
16
+ import { downloadEvtFunc, getBase64 } from '../config/utils';
17
+ import '../assets/index.less';
18
+ var DoImage = function DoImage(_ref) {
19
+ var data = _ref.data;
20
+ var list = data.list,
21
+ type = data.type;
22
+ var _useState = useState(false),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ previewVisible = _useState2[0],
25
+ setPreviewVisible = _useState2[1];
26
+ var _useState3 = useState(''),
27
+ _useState4 = _slicedToArray(_useState3, 2),
28
+ previewImage = _useState4[0],
29
+ setPreviewImage = _useState4[1];
30
+
31
+ //预览
32
+ var handlePreview = /*#__PURE__*/function () {
33
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
34
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ if (!(!file.url && !file.preview)) {
38
+ _context.next = 4;
39
+ break;
40
+ }
41
+ _context.next = 3;
42
+ return getBase64(file.originFileObj);
43
+ case 3:
44
+ file.preview = _context.sent;
45
+ case 4:
46
+ setPreviewImage(file.url || file.preview);
47
+ setPreviewVisible(true);
48
+ case 6:
49
+ case "end":
50
+ return _context.stop();
51
+ }
52
+ }, _callee);
53
+ }));
54
+ return function handlePreview(_x) {
55
+ return _ref2.apply(this, arguments);
56
+ };
57
+ }();
58
+ //关闭
59
+ var handleCancel = function handleCancel() {
60
+ setPreviewVisible(false);
61
+ };
62
+ //点击下载文件
63
+ var onDownload = function onDownload(file) {
64
+ downloadEvtFunc(file.url);
65
+ };
66
+ return /*#__PURE__*/React.createElement(Fragment, null, type === "image" ? /*#__PURE__*/React.createElement("div", {
67
+ className: "ci-detail-image"
68
+ }, /*#__PURE__*/React.createElement(_Upload, {
69
+ listType: "picture-card",
70
+ fileList: list || [],
71
+ onPreview: handlePreview,
72
+ showUploadList: {
73
+ showRemoveIcon: false,
74
+ showDownloadIcon: true
75
+ },
76
+ onDownload: onDownload
77
+ }), /*#__PURE__*/React.createElement(_Modal, {
78
+ visible: previewVisible,
79
+ footer: null,
80
+ onCancel: handleCancel
81
+ }, /*#__PURE__*/React.createElement("img", {
82
+ alt: "example",
83
+ style: {
84
+ width: '100%'
85
+ },
86
+ src: previewImage
87
+ }))) : /*#__PURE__*/React.createElement("div", {
88
+ className: "ci-detail-file"
89
+ }, /*#__PURE__*/React.createElement(_Upload, {
90
+ fileList: list,
91
+ onPreview: onDownload,
92
+ showUploadList: {
93
+ showRemoveIcon: false
94
+ }
95
+ })));
96
+ };
97
+ export default DoImage;
@@ -0,0 +1,63 @@
1
+ import _List from "@chaoswise/ui/lib/Antd/List";
2
+ import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
+ import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
4
+ import _Card from "@chaoswise/ui/lib/Antd/Card";
5
+ import React from 'react';
6
+ import DoAppIcon from '../../DoAppIcon';
7
+ import '../../../assets/index.less';
8
+ var Meta = _Card.Meta;
9
+ var QuoteView = function QuoteView(_ref) {
10
+ var fieldWidth = _ref.fieldWidth,
11
+ list = _ref.list,
12
+ handleClickChange = _ref.handleClickChange;
13
+ var gridShare = fieldWidth == "WHOLE_LINE" ? 3 : 1;
14
+ var ciTagClick = function ciTagClick(item) {
15
+ handleClickChange(item);
16
+ };
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ className: "ci-detail-quote-list"
19
+ }, (list === null || list === void 0 ? void 0 : list.length) > 0 && /*#__PURE__*/React.createElement(_List, {
20
+ grid: {
21
+ gutter: 16,
22
+ xs: gridShare,
23
+ sm: gridShare,
24
+ md: gridShare,
25
+ lg: gridShare,
26
+ xl: gridShare,
27
+ xxl: gridShare
28
+ },
29
+ dataSource: list,
30
+ renderItem: function renderItem(v, i) {
31
+ return /*#__PURE__*/React.createElement(_List.Item, {
32
+ key: v.ciId,
33
+ onClick: function onClick() {
34
+ return ciTagClick(v);
35
+ }
36
+ }, /*#__PURE__*/React.createElement(_Card, {
37
+ hoverable: true,
38
+ className: 'ci-detail-quote-card'
39
+ }, /*#__PURE__*/React.createElement(Meta, {
40
+ avatar: /*#__PURE__*/React.createElement(_Avatar, {
41
+ size: 24,
42
+ style: {
43
+ backgroundColor: "rgb(228,246,255)"
44
+ },
45
+ icon: /*#__PURE__*/React.createElement(DoAppIcon, {
46
+ style: {
47
+ color: "rgb(25,133,255)"
48
+ },
49
+ type: v.iconPath || 'icon-1'
50
+ })
51
+ }),
52
+ title: /*#__PURE__*/React.createElement("div", {
53
+ className: 'ci-detail-quote-card-title'
54
+ }, /*#__PURE__*/React.createElement(_Tooltip, {
55
+ title: v.ciName || ''
56
+ }, /*#__PURE__*/React.createElement("span", {
57
+ className: 'ci-detail-quote-card-title-span'
58
+ }, v.ciName)))
59
+ })));
60
+ }
61
+ }));
62
+ };
63
+ export default QuoteView;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import '../../../assets/index.less';
3
+ import TagShowMoreList from '../../TagShowMoreList';
4
+ var TableQuoteView = function TableQuoteView(_ref) {
5
+ var list = _ref.list,
6
+ handleClickChange = _ref.handleClickChange;
7
+ var ciTagClick = function ciTagClick(item) {
8
+ handleClickChange(item);
9
+ };
10
+ return /*#__PURE__*/React.createElement("div", {
11
+ className: "ci-detail-quote-list"
12
+ }, /*#__PURE__*/React.createElement(TagShowMoreList, {
13
+ text: list,
14
+ tagCount: 1,
15
+ tagClickFuc: ciTagClick
16
+ }));
17
+ };
18
+ export default TableQuoteView;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { useMemo } from "react";
3
+ import QuoteView from './components/QuoteView';
4
+ import TableQuoteView from './components/TableQuoteView';
5
+ var comp = {
6
+ attr_table: TableQuoteView,
7
+ "default": QuoteView
8
+ };
9
+ var DoQuote = function DoQuote(_ref) {
10
+ var data = _ref.data;
11
+ var QuoteComp = useMemo(function () {
12
+ return comp[data.attrSource || 'default'];
13
+ }, [data.attrSource]);
14
+ return /*#__PURE__*/React.createElement(QuoteComp, data);
15
+ };
16
+ export default DoQuote;
@@ -0,0 +1,80 @@
1
+ import _Popover from "@chaoswise/ui/lib/Antd/Popover";
2
+ import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
+ 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); }
4
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
+ 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."); }
6
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
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(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ import React from 'react';
16
+ import '../assets/doSelect.less';
17
+ import { isLightColorFunc } from '../config/utils';
18
+ var DoSelect = function DoSelect(_ref) {
19
+ var data = _ref.data;
20
+ var tagCount = data.tagCount,
21
+ list = data.list,
22
+ _data$_style = data._style,
23
+ _style = _data$_style === void 0 ? null : _data$_style;
24
+ var getColorStyle = function getColorStyle(item) {
25
+ if (item.color) {
26
+ return {
27
+ background: item.color,
28
+ color: isLightColorFunc(item.color) ? "#000" : "#fff",
29
+ borderColor: 'transparent',
30
+ padding: item.color === "#fff" ? "" : "0 5px"
31
+ };
32
+ }
33
+ return {};
34
+ };
35
+ var generateItem = function generateItem(tags, _className) {
36
+ _className = _className || 'wrapper-inner';
37
+ return tags.map(function (item, index) {
38
+ return /*#__PURE__*/React.createElement(_Tooltip, {
39
+ title: item.value || item.id || '',
40
+ key: index,
41
+ overlayStyle: {
42
+ width: 'auto'
43
+ }
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: _className,
46
+ style: _objectSpread(_objectSpread({}, _style), getColorStyle(item))
47
+ }, item.value || item.id || ''));
48
+ });
49
+ };
50
+ var renderItem = function renderItem() {
51
+ var tagsLength = list.length;
52
+ if (tagsLength == 0) {
53
+ return null;
54
+ } else if (tagsLength <= tagCount) {
55
+ return generateItem(list);
56
+ } else {
57
+ var frontArray = list.slice(0, tagCount);
58
+ var afterArray = list.slice(tagCount, tagsLength);
59
+ var _data = /*#__PURE__*/React.createElement("div", {
60
+ className: 'inner'
61
+ }, generateItem(afterArray, 'ant-popover-inner-content'));
62
+ var frontTags = generateItem(frontArray);
63
+ var fixedTags = [/*#__PURE__*/React.createElement(_Popover, {
64
+ content: _data,
65
+ key: 10000000,
66
+ overlayStyle: {
67
+ width: 'auto'
68
+ },
69
+ overlayClassName: 'tag-wrapper-inner'
70
+ }, /*#__PURE__*/React.createElement("div", {
71
+ className: 'wrapper-inner-fixed'
72
+ }, "+ ", afterArray.length))];
73
+ return [].concat(_toConsumableArray(frontTags), fixedTags);
74
+ }
75
+ };
76
+ return /*#__PURE__*/React.createElement("div", {
77
+ className: 'wrapper'
78
+ }, renderItem());
79
+ };
80
+ export default DoSelect;
@@ -0,0 +1,44 @@
1
+ import _CWTable from "@chaoswise/ui/lib/CWTable";
2
+ import React from 'react';
3
+ import { getDescriptionComp, getDataFunc } from "../config/utils";
4
+ var DoTable = function DoTable(_ref) {
5
+ var data = _ref.data;
6
+ var list = data.list,
7
+ properties = data.properties,
8
+ handleClickChange = data.handleClickChange;
9
+ var getColumns = function getColumns() {
10
+ return properties.map(function (item) {
11
+ return {
12
+ title: item.attrName,
13
+ dataIndex: item.attrID,
14
+ width: 160,
15
+ isResize: true,
16
+ render: function render(text) {
17
+ var componentType = item.componentType;
18
+ var DescriptionComp = getDescriptionComp(componentType);
19
+ var rest = {
20
+ handleClickChange: handleClickChange,
21
+ attrSource: "attr_table"
22
+ };
23
+ var newData = getDataFunc(text, item, rest);
24
+ return /*#__PURE__*/React.createElement(DescriptionComp, {
25
+ data: newData
26
+ });
27
+ }
28
+ };
29
+ });
30
+ };
31
+ return /*#__PURE__*/React.createElement(_CWTable, {
32
+ dataSource: list,
33
+ columns: getColumns(),
34
+ scroll: {
35
+ x: getColumns().length * 160,
36
+ y: 485
37
+ },
38
+ pagination: false,
39
+ rowKey: function rowKey(v) {
40
+ return v.id;
41
+ }
42
+ });
43
+ };
44
+ export default DoTable;
@@ -0,0 +1,44 @@
1
+ import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
+ import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
+ import React, { Fragment } from 'react';
4
+ import '../assets/index.less';
5
+ import TagShowMoreList from './TagShowMoreList';
6
+ var DoUser = function DoUser(_ref) {
7
+ var data = _ref.data;
8
+ var belongComponentType = data.belongComponentType,
9
+ fieldWidth = data.fieldWidth,
10
+ tooltipContent = data.tooltipContent,
11
+ list = data.list;
12
+ var gridShare = belongComponentType === "TABLE" ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
13
+ var tooltipContentFuc = function tooltipContentFuc(item) {
14
+ return Object.keys(tooltipContent).map(function (key) {
15
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || "", " "), /*#__PURE__*/React.createElement("br", null));
16
+ });
17
+ };
18
+ return /*#__PURE__*/React.createElement(Fragment, null, belongComponentType === "TABLE" ? /*#__PURE__*/React.createElement(TagShowMoreList, {
19
+ text: list,
20
+ tagCount: 1,
21
+ flag: "user",
22
+ nameKey: "userName",
23
+ tooltipContentFuc: tooltipContentFuc
24
+ }) : /*#__PURE__*/React.createElement("div", {
25
+ className: 'ci-detail-user'
26
+ }, (list || []).map(function (item) {
27
+ var _item$name;
28
+ return /*#__PURE__*/React.createElement(_Tooltip, {
29
+ title: tooltipContentFuc(item),
30
+ key: item.id
31
+ }, /*#__PURE__*/React.createElement("div", {
32
+ className: 'ci-detail-user-item',
33
+ style: {
34
+ width: gridShare
35
+ }
36
+ }, /*#__PURE__*/React.createElement(_Avatar, {
37
+ className: 'ci-detail-avatar',
38
+ size: "small"
39
+ }, (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.substring(0, 1)), /*#__PURE__*/React.createElement("div", {
40
+ className: 'ci-detail-user-name'
41
+ }, item.name)));
42
+ })));
43
+ };
44
+ export default DoUser;
@@ -14,7 +14,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
14
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import React from 'react';
17
- import style from './index.less';
17
+ import './index.less';
18
18
  import classnames from 'classnames';
19
19
  import DoAppIcon from '../DoAppIcon';
20
20
  import { isLightColorFunc } from '../../config/utils';
@@ -64,19 +64,19 @@ var TagShowMoreList = function TagShowMoreList(props) {
64
64
  },
65
65
  placement: "topLeft"
66
66
  }, /*#__PURE__*/React.createElement("div", {
67
- className: style[classNameDiv],
67
+ className: classNameDiv,
68
68
  style: _objectSpread(_objectSpread({}, _style), getColorStyle(item)),
69
69
  onClick: tagClickFuc ? function () {
70
70
  return tagClickFuc(item);
71
71
  } : function () {}
72
72
  }, /*#__PURE__*/React.createElement("div", {
73
- className: style['ellipsis-box'],
73
+ className: 'ellipsis-box',
74
74
  style: {
75
75
  maxWidth: text.length === 1 && option === 'view' || _className ? '100%' : option === 'view' ? 84 : 64
76
76
  }
77
77
  }, flag === "user" ? /*#__PURE__*/React.createElement(_Avatar, {
78
78
  size: 20,
79
- className: style["tag-ci-detail-avatar"]
79
+ className: "tag-ci-detail-avatar"
80
80
  }, (_String = String(_name)) === null || _String === void 0 ? void 0 : _String.substring(0, 1)) : /*#__PURE__*/React.createElement(_Avatar, {
81
81
  size: 20,
82
82
  style: {
@@ -103,7 +103,7 @@ var TagShowMoreList = function TagShowMoreList(props) {
103
103
  var frontTags = generateItem(text.slice(0, tagCount));
104
104
  var afterArray = text.slice(tagCount, tagsLength);
105
105
  var contentData = /*#__PURE__*/React.createElement("div", {
106
- className: style['inner']
106
+ className: 'inner'
107
107
  }, generateItem(afterArray, _style, 'ant-popover-inner-content'));
108
108
  var fixedTags = [/*#__PURE__*/React.createElement(_Popover, {
109
109
  content: contentData,
@@ -114,14 +114,14 @@ var TagShowMoreList = function TagShowMoreList(props) {
114
114
  width: 'auto'
115
115
  }
116
116
  }, /*#__PURE__*/React.createElement("div", {
117
- className: style['wrapper-inner-fixed'],
117
+ className: 'wrapper-inner-fixed',
118
118
  style: _style
119
119
  }, "+ ", afterArray.length))];
120
120
  return [].concat(_toConsumableArray(frontTags), fixedTags);
121
121
  }
122
122
  };
123
123
  return /*#__PURE__*/React.createElement("div", {
124
- className: classnames(style['wrapper'])
124
+ className: classnames('wrapper')
125
125
  }, renderItem());
126
126
  };
127
127
  export default TagShowMoreList;
@@ -0,0 +1,126 @@
1
+ import _Form from "@chaoswise/ui/lib/Form";
2
+ import _Collapse from "@chaoswise/ui/lib/Collapse";
3
+ var _excluded = ["schemaData", "detailContent"],
4
+ _excluded2 = ["item", "detailContent"];
5
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ 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."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
+ 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; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
+ import { intl } from '@chaoswise/intl';
15
+ import React, { useState, useEffect } from 'react';
16
+ import { getDescriptionComp, getDataFunc, judgmentTypeFunc } from "./config/utils";
17
+ import './index.less';
18
+ var Panel = _Collapse.Panel;
19
+ var compositeAttr = ["UNIT_RANGE", "UNIT_SELECT"];
20
+ var setWidthClassName = ["TABLE"];
21
+ var PropertyControlViewer = function PropertyControlViewer(_ref) {
22
+ var schemaData = _ref.schemaData,
23
+ detailContent = _ref.detailContent,
24
+ rest = _objectWithoutProperties(_ref, _excluded);
25
+ var _useState = useState([]),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ activeKey = _useState2[0],
28
+ setActiveKey = _useState2[1]; //展开分组的key
29
+ //分组展开
30
+ var onChange = function onChange(keys) {
31
+ setActiveKey(keys);
32
+ };
33
+ useEffect(function () {
34
+ var groupIds = schemaData.map(function (item) {
35
+ return item.attrID;
36
+ });
37
+ setActiveKey(groupIds);
38
+ }, [schemaData]);
39
+ return /*#__PURE__*/React.createElement(_Form, {
40
+ style: {
41
+ minHeight: '100%'
42
+ },
43
+ layout: 'horizontal'
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: "form-properties-box form-properties-view-box"
46
+ }, schemaData.map(function (i) {
47
+ if (i.componentType == "ATTRIBUTE_GROUP") {
48
+ return /*#__PURE__*/React.createElement(_Collapse, {
49
+ key: i.attrID,
50
+ activeKey: activeKey,
51
+ onChange: onChange,
52
+ style: {
53
+ width: '100%'
54
+ }
55
+ }, /*#__PURE__*/React.createElement(Panel, {
56
+ header: i.attrName || intl.get('324f8bc5-e6dc-46b5-a18b-8c4e55c7352e').d('分组'),
57
+ key: i.attrID,
58
+ style: {
59
+ border: 0,
60
+ display: i.hidden == true && 'none'
61
+ }
62
+ }, /*#__PURE__*/React.createElement("div", {
63
+ className: 'form-properties-box'
64
+ }, i.properties.map(function (item) {
65
+ var componentType = item.componentType,
66
+ properties = item.properties;
67
+ if (compositeAttr.includes(componentType)) {
68
+ {
69
+ return properties.map(function (item) {
70
+ return /*#__PURE__*/React.createElement(AttrFormItem, _extends({
71
+ key: item.attrID,
72
+ item: item,
73
+ detailContent: detailContent
74
+ }, rest));
75
+ });
76
+ }
77
+ }
78
+ return /*#__PURE__*/React.createElement(AttrFormItem, _extends({
79
+ key: item.attrID,
80
+ item: item,
81
+ detailContent: detailContent
82
+ }, rest));
83
+ }))));
84
+ }
85
+ return /*#__PURE__*/React.createElement(AttrFormItem, _extends({
86
+ key: i.attrID,
87
+ item: i,
88
+ detailContent: detailContent
89
+ }, rest));
90
+ })));
91
+ };
92
+ var AttrFormItem = function AttrFormItem(_ref2) {
93
+ var _detailContent$conten;
94
+ var item = _ref2.item,
95
+ detailContent = _ref2.detailContent,
96
+ rest = _objectWithoutProperties(_ref2, _excluded2);
97
+ var attrID = item.attrID,
98
+ attrName = item.attrName,
99
+ componentType = item.componentType,
100
+ attrInfo = item.attrInfo;
101
+ var fieldWidth = attrInfo.fieldWidth;
102
+ var _value = detailContent === null || detailContent === void 0 || (_detailContent$conten = detailContent.content) === null || _detailContent$conten === void 0 ? void 0 : _detailContent$conten[attrID];
103
+ var judgmentType = judgmentTypeFunc(componentType, _value); // 判断值类型是否规范
104
+ var data = {};
105
+ if (judgmentType) {
106
+ data = getDataFunc(_value, item, rest);
107
+ }
108
+ var comType = judgmentType ? componentType : 'default_placeholder';
109
+ var DescriptionComp = getDescriptionComp(comType);
110
+ return /*#__PURE__*/React.createElement("div", {
111
+ key: attrID,
112
+ className: 'CM-DB-form-item-box',
113
+ style: {
114
+ width: fieldWidth == 'WHOLE_LINE' ? '100%' : '50%'
115
+ }
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ className: 'form_box'
118
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
119
+ name: attrID,
120
+ label: attrName,
121
+ className: setWidthClassName.includes(componentType) ? 'view_table' : ''
122
+ }, /*#__PURE__*/React.createElement(DescriptionComp, {
123
+ data: data
124
+ }))));
125
+ };
126
+ export default PropertyControlViewer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/business",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "业务组件库",
5
5
  "keywords": [
6
6
  "ui",
@@ -102,5 +102,5 @@
102
102
  "access": "public"
103
103
  },
104
104
  "license": "MIT",
105
- "gitHead": "d8b93bbdb31c854961b673363633be6f8a02dbdc"
105
+ "gitHead": "fd7b0e5e1af7181e10ad12f1b686d47487ef626b"
106
106
  }