@titaui/pc 1.15.51 → 1.15.54

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.
@@ -49,9 +49,10 @@ var DemoMenus = function DemoMenus(props) {
49
49
  var _props$onSelect = props.onSelect,
50
50
  onSelect = _props$onSelect === void 0 ? function () {} : _props$onSelect,
51
51
  history = props.history,
52
- isManager = props.isManager;
52
+ roleList = props.roleList,
53
+ showCompeteCustomer = props.showCompeteCustomer;
53
54
  var menuRef = (0, _react.useRef)();
54
- var okrMenusData = (0, _react.useRef)(_menus.defaultRefObject);
55
+ var demoMenusData = (0, _react.useRef)(_menus.defaultRefObject);
55
56
 
56
57
  var _useState = (0, _react.useState)([]),
57
58
  _useState2 = _slicedToArray(_useState, 2),
@@ -64,18 +65,18 @@ var DemoMenus = function DemoMenus(props) {
64
65
  setExpandedKeys = _useState4[1];
65
66
 
66
67
  var _useState5 = (0, _react.useState)(function () {
67
- okrMenusData.current = new _menus["default"](isManager);
68
- return okrMenusData.current.getMenus();
68
+ demoMenusData.current = new _menus["default"](roleList, showCompeteCustomer);
69
+ return demoMenusData.current.getMenus();
69
70
  }),
70
71
  _useState6 = _slicedToArray(_useState5, 2),
71
72
  menus = _useState6[0],
72
73
  setMenus = _useState6[1];
73
74
 
74
75
  (0, _react.useEffect)(function () {
75
- okrMenusData.current = new _menus["default"](isManager);
76
- setMenus(okrMenusData.current.getMenus());
76
+ demoMenusData.current = new _menus["default"](roleList, showCompeteCustomer);
77
+ setMenus(demoMenusData.current.getMenus());
77
78
  setExpandedKeys(["demofree"]);
78
- }, [isManager]);
79
+ }, [roleList, showCompeteCustomer]);
79
80
  var flipRef = (0, _react.useRef)({
80
81
  next: function next() {},
81
82
  goback: function goback() {}
@@ -95,11 +96,11 @@ var DemoMenus = function DemoMenus(props) {
95
96
 
96
97
 
97
98
  (0, _react.useEffect)(function () {
98
- var menuHighlight = new _menuHighlight["default"](history, isManager);
99
+ var menuHighlight = new _menuHighlight["default"](history, roleList.includes(_menus.ERoleType.Manager));
99
100
  menuHighlight.highlight(function (menu) {
100
101
  return setSelectedMenuKeys([menu]);
101
102
  });
102
- }, [history.location.pathname, history.location.search, isManager]);
103
+ }, [history.location.pathname, history.location.search, roleList]);
103
104
 
104
105
  var onSelectHandler = function onSelectHandler(selectedKyes, _ref) {
105
106
  var node = _ref.node;
@@ -25,7 +25,7 @@ var _default = /*#__PURE__*/function () {
25
25
  _createClass(_default, [{
26
26
  key: "highlight",
27
27
  value: function highlight(cb) {
28
- if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);else if (this.isDueDateOrder()) cb(_menus.PAGE_DUEDATE_ORDER);else if (this.isAllCustomer()) cb(_menus.PAGE_ALL_CUSTOMER);else if (this.isPublicCustomer()) cb(_menus.PAGE_PUBLIC_CUSTOMER);else if (this.isMyCustomer()) cb(_menus.PAGE_MY_CUSTOMER);
28
+ if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);else if (this.isDueDateOrder()) cb(_menus.PAGE_DUEDATE_ORDER);else if (this.isAllCustomer()) cb(_menus.PAGE_ALL_CUSTOMER);else if (this.isPublicCustomer()) cb(_menus.PAGE_PUBLIC_CUSTOMER);else if (this.isMyCustomer()) cb(_menus.PAGE_MY_CUSTOMER);else if (this.isLimitCustomer()) cb(_menus.PAGE_LIMIT_CUSTOMER);
29
29
  }
30
30
  }, {
31
31
  key: "isChart",
@@ -64,7 +64,7 @@ var _default = /*#__PURE__*/function () {
64
64
  pathname = _this$history$locatio.pathname,
65
65
  search = _this$history$locatio.search;
66
66
 
67
- if (this.isManager === 1) {
67
+ if (this.isManager) {
68
68
  return pathname.match(/demofree\/list/) && (!search || search.match(/selected[\s]*?=[\s]*?unassigned/));
69
69
  }
70
70
 
@@ -120,6 +120,12 @@ var _default = /*#__PURE__*/function () {
120
120
  var pathname = this.history.location.pathname;
121
121
  return pathname.match(/demofree\/customer\/all/);
122
122
  }
123
+ }, {
124
+ key: "isLimitCustomer",
125
+ value: function isLimitCustomer() {
126
+ var pathname = this.history.location.pathname;
127
+ return pathname.match(/demofree\/customer\/limit/);
128
+ }
123
129
  }]);
124
130
 
125
131
  return _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_PUBLIC_CUSTOMER = exports.PAGE_MY_CUSTOMER = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DUEDATE_ORDER = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_CHARTS = exports.PAGE_ASSIGNED_DEMOFREE = exports.PAGE_ALL_CUSTOMER = void 0;
6
+ exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_PUBLIC_CUSTOMER = exports.PAGE_MY_CUSTOMER = exports.PAGE_LIMIT_CUSTOMER = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DUEDATE_ORDER = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_CHARTS = exports.PAGE_ASSIGNED_DEMOFREE = exports.PAGE_ALL_CUSTOMER = exports.ERoleType = void 0;
7
7
 
8
8
  var _index = require("../../components/menu-tree/tree-node/index");
9
9
 
@@ -13,17 +13,20 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
13
13
 
14
14
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
15
 
16
- var EManagerType;
16
+ var ERoleType;
17
+ exports.ERoleType = ERoleType;
17
18
 
18
- (function (EManagerType) {
19
- EManagerType[EManagerType["Sales"] = 0] = "Sales";
20
- EManagerType[EManagerType["Manager"] = 1] = "Manager";
21
- EManagerType[EManagerType["Supervisor"] = 2] = "Supervisor";
22
- EManagerType[EManagerType["ReCharge"] = 3] = "ReCharge";
23
- EManagerType[EManagerType["DemoFreeReadOnly"] = 4] = "DemoFreeReadOnly";
24
- EManagerType[EManagerType["ReadOnlyAll"] = 5] = "ReadOnlyAll";
25
- })(EManagerType || (EManagerType = {}));
19
+ (function (ERoleType) {
20
+ ERoleType["Sales"] = "sales";
21
+ ERoleType["Manager"] = "manager";
22
+ ERoleType["Supervisor"] = "supervisor";
23
+ ERoleType["SalesOperation"] = "salesOperation";
24
+ ERoleType["CRM"] = "CRM";
25
+ ERoleType["PublicCustomer"] = "publicCustomer";
26
+ ERoleType["DemoReadOnly"] = "demoReadOnly";
27
+ })(ERoleType || (exports.ERoleType = ERoleType = {}));
26
28
 
29
+ var demoRole = [ERoleType.Sales, ERoleType.Manager, ERoleType.Supervisor, ERoleType.SalesOperation, ERoleType.DemoReadOnly];
27
30
  var defaultRefObject = {
28
31
  menus: [],
29
32
  getMenus: function getMenus() {}
@@ -45,6 +48,8 @@ var PAGE_ALL_CUSTOMER = "allCustomer";
45
48
  exports.PAGE_ALL_CUSTOMER = PAGE_ALL_CUSTOMER;
46
49
  var PAGE_PUBLIC_CUSTOMER = "publicCustomer";
47
50
  exports.PAGE_PUBLIC_CUSTOMER = PAGE_PUBLIC_CUSTOMER;
51
+ var PAGE_LIMIT_CUSTOMER = 'limitCustomer';
52
+ exports.PAGE_LIMIT_CUSTOMER = PAGE_LIMIT_CUSTOMER;
48
53
  var PAGE_MY_CUSTOMER = "myCustomer";
49
54
  exports.PAGE_MY_CUSTOMER = PAGE_MY_CUSTOMER;
50
55
  var PAGE_CHARTS = "charts";
@@ -59,90 +64,117 @@ var PAGE_RECHARGE_STATUS = "rechargeStatus";
59
64
  exports.PAGE_RECHARGE_STATUS = PAGE_RECHARGE_STATUS;
60
65
 
61
66
  var DemoMenuData = /*#__PURE__*/function () {
62
- function DemoMenuData(isManager) {
67
+ function DemoMenuData(roleList, showCompeteCustomer) {
63
68
  _classCallCheck(this, DemoMenuData);
64
69
 
65
- this.isManager = isManager;
70
+ this.roleList = roleList;
71
+ this.showDemo = this.roleList.some(function (role) {
72
+ return demoRole.includes(role);
73
+ });
74
+ this.isManager = this.roleList.includes(ERoleType.Manager);
75
+ this.showCompeteCustomer = showCompeteCustomer;
66
76
  this.menus = [{
67
77
  icon: "kaohe",
68
78
  label: "任务状态",
69
79
  key: "demofree",
70
80
  href: this.isManager ? "#/demofree/list?selected=unassigned" : "#/demofree/list?selected=assigned",
71
- isShow: this.isManager !== EManagerType.ReCharge,
81
+ isShow: this.showDemo,
72
82
  children: [{
73
83
  icon: "",
74
84
  label: "未分配",
75
85
  key: "unassigned",
76
86
  href: "#/demofree/list?selected=unassigned",
77
- isShow: this.isManager === EManagerType.Manager
87
+ isShow: this.isManager
78
88
  }, {
79
89
  icon: "",
80
90
  label: "已分配",
81
91
  key: "assigned",
82
92
  href: "#/demofree/list?selected=assigned",
83
- isShow: this.isManager !== EManagerType.ReCharge
93
+ isShow: this.showDemo
84
94
  }, {
85
95
  icon: "",
86
96
  label: "已预约",
87
97
  key: "reserved",
88
98
  href: "#/demofree/list?selected=reserved",
89
- isShow: this.isManager !== EManagerType.ReCharge
99
+ isShow: this.showDemo
90
100
  }, {
91
101
  icon: "",
92
102
  label: "已完成",
93
103
  key: "done",
94
104
  href: "#/demofree/list?selected=done",
95
- isShow: this.isManager !== EManagerType.ReCharge
105
+ isShow: this.showDemo
96
106
  }, {
97
107
  icon: "",
98
108
  label: "已忽略",
99
109
  key: "ignore",
100
110
  href: "#/demofree/list?selected=ignore",
101
- isShow: this.isManager === EManagerType.Manager
111
+ isShow: this.isManager
102
112
  }]
103
113
  }, {
104
114
  icon: "KH-help",
105
115
  label: "公海资源",
106
116
  key: "customer",
107
117
  href: "#/demofree/customer/public",
108
- isShow: true,
118
+ isShow: this.roleList.some(function (role) {
119
+ return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
120
+ }),
109
121
  children: [{
110
122
  icon: "",
111
123
  label: "全部客户",
112
124
  key: PAGE_ALL_CUSTOMER,
113
125
  href: "#/demofree/customer/all",
114
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
126
+ isShow: this.roleList.some(function (role) {
127
+ return [ERoleType.SalesOperation, ERoleType.Manager].includes(role);
128
+ })
115
129
  }, {
116
130
  icon: "",
117
131
  label: "公海资源",
118
132
  key: PAGE_PUBLIC_CUSTOMER,
119
133
  href: "#/demofree/customer/public",
120
- isShow: this.isManager !== EManagerType.ReCharge
134
+ isShow: this.roleList.some(function (role) {
135
+ return [ERoleType.SalesOperation, ERoleType.Manager].includes(role);
136
+ })
137
+ }, {
138
+ icon: "",
139
+ label: "限时资源",
140
+ key: PAGE_LIMIT_CUSTOMER,
141
+ href: "#/demofree/customer/limit",
142
+ isShow: this.roleList.some(function (role) {
143
+ return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
144
+ }) && this.showCompeteCustomer
121
145
  }, {
122
146
  icon: "",
123
147
  label: "我的资源",
124
148
  key: PAGE_MY_CUSTOMER,
125
149
  href: "#/demofree/customer/my",
126
- isShow: this.isManager !== EManagerType.ReCharge
150
+ isShow: this.roleList.some(function (role) {
151
+ return [ERoleType.SalesOperation, ERoleType.Manager, ERoleType.PublicCustomer].includes(role);
152
+ })
127
153
  }]
128
154
  }, {
129
155
  icon: "KH-help",
130
156
  label: "客户续费",
131
157
  key: "recharge",
132
158
  href: "#/demofree/recharge",
133
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll,
159
+ isShow: this.roleList.some(function (role) {
160
+ return [ERoleType.CRM, ERoleType.Manager].includes(role);
161
+ }),
134
162
  children: [{
135
163
  icon: "",
136
164
  label: "客户",
137
165
  key: PAGE_RECHARGE_LIST,
138
166
  href: "#/demofree/recharge/list",
139
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll
167
+ isShow: this.roleList.some(function (role) {
168
+ return [ERoleType.CRM, ERoleType.Manager].includes(role);
169
+ })
140
170
  }, {
141
171
  icon: "",
142
172
  label: "到期订单",
143
173
  key: PAGE_DUEDATE_ORDER,
144
174
  href: "#/demofree/recharge/order",
145
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll
175
+ isShow: this.roleList.some(function (role) {
176
+ return [ERoleType.CRM, ERoleType.Manager].includes(role);
177
+ })
146
178
  }]
147
179
  }];
148
180
  }
@@ -21,8 +21,6 @@ var _getLocale = require("../../../../utils/getLocale");
21
21
 
22
22
  var _i18nFrontTranslate = require("../../../../utils/i18n-front-translate");
23
23
 
24
- var _bsGlobal = require("../../../../utils/bs-global");
25
-
26
24
  require("./index.css");
27
25
 
28
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -53,6 +51,8 @@ var Fields = _form["default"].Fields;
53
51
  var prefix = "titaui-edit-personal-info";
54
52
 
55
53
  var EditBaseInfo = function EditBaseInfo(props) {
54
+ var _window$BSGlobal$tena;
55
+
56
56
  var visible = props.visible,
57
57
  _onCancel = props.onCancel,
58
58
  handleSuccessEditBaseInfo = props.handleSuccessEditBaseInfo,
@@ -187,7 +187,7 @@ var EditBaseInfo = function EditBaseInfo(props) {
187
187
  tip: (0, _i18nFrontTranslate.i18nLimitCharacters)(50),
188
188
  test: /^[\s\S]{0,50}$/
189
189
  }],
190
- disabled: (0, _bsGlobal.isWx)(),
190
+ disabled: (_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.isTranslate,
191
191
  value: userInfo.name,
192
192
  onChange: handleNameChange
193
193
  }), /*#__PURE__*/_react["default"].createElement(Fields.Input, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.15.51",
3
+ "version": "1.15.54",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",