@zgfe/modules-settings 1.0.1-a.14 → 1.0.1-a.15

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.
@@ -5,14 +5,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5
5
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
6
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
- import React, { useEffect, useRef, useState } from 'react';
8
+ import React, { useContext, useEffect, useRef, useState } from 'react';
9
9
  import "./index.less";
10
10
  import util from "./../../../utils/util";
11
11
  import { Button, Form, Input, notification } from 'antd';
12
12
  import request, { selfRequest } from "./../../../utils/ajax";
13
13
  // import urlRequest from 'umi-request';
14
14
  import api from "./../../../constants/api";
15
- import { BizTable, BizDialog } from '@zgfe/business-lib';
15
+ import { BizTable, BizDialog, BizGlobalDataContext } from '@zgfe/business-lib';
16
16
  var reworkAppName = function reworkAppName(name) {
17
17
  return name.length > 15 ? "".concat(name.substring(0, 15), "...") : name;
18
18
  };
@@ -42,6 +42,8 @@ var appList = function appList(props) {
42
42
  gotoAppSetting = props.gotoAppSetting,
43
43
  gotoAppPanel = props.gotoAppPanel,
44
44
  createAppCallback = props.createAppCallback;
45
+ var _useContext = useContext(BizGlobalDataContext),
46
+ system = _useContext.system;
45
47
  var _useState = useState(false),
46
48
  _useState2 = _slicedToArray(_useState, 2),
47
49
  createdAppPanel = _useState2[0],
@@ -62,7 +64,22 @@ var appList = function appList(props) {
62
64
  _useState10 = _slicedToArray(_useState9, 2),
63
65
  appNameVal = _useState10[0],
64
66
  setAppNameVal = _useState10[1];
67
+ var _useState11 = useState([]),
68
+ _useState12 = _slicedToArray(_useState11, 2),
69
+ cepAppList = _useState12[0],
70
+ setCepAppList = _useState12[1];
65
71
  var formRef = useRef();
72
+ useEffect(function () {
73
+ if (system === 'CEP') {
74
+ request(api.setting.queryAppList, {
75
+ method: 'post'
76
+ }).then(function (res) {
77
+ if (res && res.code + '' === '200') {
78
+ setCepAppList(res.data || []);
79
+ }
80
+ });
81
+ }
82
+ }, []);
66
83
 
67
84
  // #todo isAdmin 需要添加
68
85
 
@@ -83,7 +100,7 @@ var appList = function appList(props) {
83
100
  dataIndex: 'apps',
84
101
  render: function render(apps) {
85
102
  // const data = res[1];
86
- return /*#__PURE__*/React.createElement("div", null, apps.length ? /*#__PURE__*/React.createElement("div", {
103
+ return /*#__PURE__*/React.createElement("div", null, (apps || []).length ? /*#__PURE__*/React.createElement("div", {
87
104
  className: "platform-icons"
88
105
  }, apps.map(function (item) {
89
106
  return /*#__PURE__*/React.createElement("span", {
@@ -377,7 +394,7 @@ var appList = function appList(props) {
377
394
  }, "\u786E\u8BA4\u5220\u9664\u6B64\u5E94\u7528\u5417\uFF1F\u5220\u9664\u540E\u5E94\u7528\u7684\u6570\u636E\u5C06\u4E0D\u518D\u53EF\u7528"), /*#__PURE__*/React.createElement("div", {
378
395
  className: "app-list-content"
379
396
  }, /*#__PURE__*/React.createElement(BizTable, {
380
- dataSource: companyRealAppList,
397
+ dataSource: system === 'CEP' ? cepAppList : companyRealAppList,
381
398
  columns: columns,
382
399
  pagination: false
383
400
  })));
@@ -1,3 +1,7 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ 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); } }
4
+ 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); }); }; }
1
5
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
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."); }
@@ -265,7 +269,7 @@ var CompanySetting = function CompanySetting(props) {
265
269
  });
266
270
  };
267
271
  var updateUserAuth = function updateUserAuth(params) {
268
- request(api.setting.updateUserAuth, {
272
+ return request(api.setting.updateUserAuth, {
269
273
  method: 'post',
270
274
  params: params
271
275
  }).then(function (res) {
@@ -287,54 +291,74 @@ var CompanySetting = function CompanySetting(props) {
287
291
  // this.$store.dispatch(actions.user.getCurrentUser)
288
292
  };
289
293
 
290
- var delAppCallback = function delAppCallback(formData, id) {
291
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,删除应用功能,成功删除时调用
292
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
293
- // settingDelAppCallback && settingDelAppCallback({formData, id});
294
- settingCallback && settingCallback('settingDelAppCallback', {
295
- formData: formData,
296
- id: id
297
- });
298
- // 刷新setting模块内的数据
299
- updateUserAuth(formData);
300
- getSettingData();
301
-
302
- // 与主应用同步信息 下面为老代码逻辑
303
- // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
304
- // await this.$store.dispatch(actions.user.getCurrentUser)
305
- // if (appId) {
306
- // this.$router.push({ params: { appId: appId } })
307
- // }
308
- // await this.$store.dispatch(actions.app.queryAppList)
309
- // if (callback) {
310
- // callback()
311
- // }
312
- };
313
-
314
- var createAppCallback = function createAppCallback(formData, id) {
315
- // 对外提供的api, 在设置模块-》公司设置-》应用页面,创建应用功能,成功创建时调用
316
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
317
- // settingCreateAppCallback && settingCreateAppCallback({formData, id});
318
- settingCallback && settingCallback('settingCreateAppCallback', {
319
- formData: formData,
320
- id: id
321
- });
322
- // 刷新setting模块内的数据
323
- updateUserAuth(formData);
324
- getSettingData();
325
-
326
- // 与主应用同步信息 下面为老代码逻辑
327
- // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
328
- // await this.$store.dispatch(actions.user.getCurrentUser)
329
- // if (appId) {
330
- // this.$router.push({ params: { appId: appId } })
331
- // }
332
- // await this.$store.dispatch(actions.app.queryAppList)
333
- // if (callback) {
334
- // callback()
335
- // }
336
- };
337
-
294
+ var delAppCallback = /*#__PURE__*/function () {
295
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formData, id) {
296
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
297
+ while (1) switch (_context.prev = _context.next) {
298
+ case 0:
299
+ _context.next = 2;
300
+ return updateUserAuth(formData);
301
+ case 2:
302
+ getSettingData();
303
+ settingCallback && settingCallback('settingDelAppCallback', {
304
+ formData: formData,
305
+ id: id
306
+ });
307
+ // 刷新setting模块内的数据
308
+ // 与主应用同步信息 下面为老代码逻辑
309
+ // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
310
+ // await this.$store.dispatch(actions.user.getCurrentUser)
311
+ // if (appId) {
312
+ // this.$router.push({ params: { appId: appId } })
313
+ // }
314
+ // await this.$store.dispatch(actions.app.queryAppList)
315
+ // if (callback) {
316
+ // callback()
317
+ // }
318
+ case 4:
319
+ case "end":
320
+ return _context.stop();
321
+ }
322
+ }, _callee);
323
+ }));
324
+ return function delAppCallback(_x2, _x3) {
325
+ return _ref2.apply(this, arguments);
326
+ };
327
+ }();
328
+ var createAppCallback = /*#__PURE__*/function () {
329
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(formData, id) {
330
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
331
+ while (1) switch (_context2.prev = _context2.next) {
332
+ case 0:
333
+ _context2.next = 2;
334
+ return updateUserAuth(formData);
335
+ case 2:
336
+ getSettingData();
337
+ settingCallback && settingCallback('settingCreateAppCallback', {
338
+ formData: formData,
339
+ id: id
340
+ });
341
+ // 刷新setting模块内的数据
342
+ // 与主应用同步信息 下面为老代码逻辑
343
+ // await this.$store.dispatch(actions.setting.updateUserAuth, formData)
344
+ // await this.$store.dispatch(actions.user.getCurrentUser)
345
+ // if (appId) {
346
+ // this.$router.push({ params: { appId: appId } })
347
+ // }
348
+ // await this.$store.dispatch(actions.app.queryAppList)
349
+ // if (callback) {
350
+ // callback()
351
+ // }
352
+ case 4:
353
+ case "end":
354
+ return _context2.stop();
355
+ }
356
+ }, _callee2);
357
+ }));
358
+ return function createAppCallback(_x4, _x5) {
359
+ return _ref3.apply(this, arguments);
360
+ };
361
+ }();
338
362
  var gotoAppSetting = function gotoAppSetting(id) {
339
363
  // 对外提供的api, 在设置模块-》公司设置-》应用页面,应用设置,点击时调用
340
364
  // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
@@ -477,90 +501,114 @@ var CompanySetting = function CompanySetting(props) {
477
501
  // }
478
502
  };
479
503
 
480
- var createVirtualAppCallback = function createVirtualAppCallback(res, formData) {
481
- // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 创建成功时调用
482
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
483
- settingCallback && settingCallback('settingCreateVirtualAppCallback', {
484
- res: res,
485
- formData: formData
486
- });
487
- updateUserAuth(formData);
488
- getSettingData();
489
-
490
- // 与主应用同步信息 下面为老代码逻辑
491
- // this.$store.commit(mutations.virtualApp.addVirtualApp, res)
492
- // // 添加数据权限
493
- // let authConfig = util.clone(this.currentUser.authConfig)
494
- // if (
495
- // !(
496
- // authConfig.dataAuth.length === 1 &&
497
- // authConfig.dataAuth[0].appId === 0
498
- // )
499
- // ) {
500
- // authConfig.dataAuth.unshift({
501
- // appId: res.app_info.id,
502
- // plats: [0]
503
- // })
504
- // }
505
- // let formData = {
506
- // userId: this.currentUser.id,
507
- // authConfig: JSON.stringify(authConfig),
508
- // groupIds: this.userOfGroups.join(',')
509
- // }
510
- // this.$store.dispatch(actions.setting.updateUserAuth, formData)
511
- // this.$store.dispatch(actions.user.getCurrentUser)
512
- // // 更新应用列表数据
513
- // this.$store.dispatch(actions.app.queryAppList)
514
- };
515
-
516
- var delVirtualAppCallback = function delVirtualAppCallback(res, formData) {
517
- console.log('delVirtualAppCallback', res, formData);
518
-
519
- // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
520
- // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
521
- settingCallback && settingCallback('settingDelVirtualAppCallback', res);
522
- updateUserAuth(formData);
523
- getSettingData();
524
-
525
- // 与主应用同步信息 下面为老代码逻辑
526
- // this.$store.commit(mutations.virtualApp.delVirtualApp, appId)
527
- // // 更新数据权限
528
- // let authConfig = util.clone(this.currentUser.authConfig)
529
- // if (
530
- // !(
531
- // authConfig.dataAuth.length === 1 &&
532
- // authConfig.dataAuth[0].appId === 0
533
- // )
534
- // ) {
535
- // let index = authConfig.dataAuth.findIndex(
536
- // item => item.appId === appId
537
- // )
538
- // if (index > -1) {
539
- // authConfig.dataAuth.splice(index, 1)
540
- // }
541
- // }
542
- // if (this.currentApp.id === appId) {
543
- // let hasAuthApplistToDelAfter = this.hasAuthApplist.filter(
544
- // item => item.id !== appId
545
- // )
546
- // let id = hasAuthApplistToDelAfter.length ? hasAuthApplistToDelAfter[0].id : 0
547
- // this.$router.push({
548
- // params: {
549
- // appId: id
550
- // }
551
- // })
552
- // }
553
- // let formData = {
554
- // userId: this.currentUser.userId,
555
- // authConfig: JSON.stringify(authConfig),
556
- // groupIds: this.userOfGroups.join(',')
557
- // }
558
- // this.$store.dispatch(actions.setting.updateUserAuth, formData)
559
- // this.$store.dispatch(actions.user.getCurrentUser)
560
- // // 更新应用列表数据
561
- // this.$store.dispatch(actions.app.queryAppList)
562
- };
504
+ var createVirtualAppCallback = /*#__PURE__*/function () {
505
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(res, formData) {
506
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
507
+ while (1) switch (_context3.prev = _context3.next) {
508
+ case 0:
509
+ _context3.next = 2;
510
+ return updateUserAuth(formData);
511
+ case 2:
512
+ getSettingData();
513
+ settingCallback && settingCallback('settingCreateVirtualAppCallback', {
514
+ res: res,
515
+ formData: formData
516
+ });
517
+ // 与主应用同步信息 下面为老代码逻辑
518
+ // this.$store.commit(mutations.virtualApp.addVirtualApp, res)
519
+ // // 添加数据权限
520
+ // let authConfig = util.clone(this.currentUser.authConfig)
521
+ // if (
522
+ // !(
523
+ // authConfig.dataAuth.length === 1 &&
524
+ // authConfig.dataAuth[0].appId === 0
525
+ // )
526
+ // ) {
527
+ // authConfig.dataAuth.unshift({
528
+ // appId: res.app_info.id,
529
+ // plats: [0]
530
+ // })
531
+ // }
532
+ // let formData = {
533
+ // userId: this.currentUser.id,
534
+ // authConfig: JSON.stringify(authConfig),
535
+ // groupIds: this.userOfGroups.join(',')
536
+ // }
537
+ // this.$store.dispatch(actions.setting.updateUserAuth, formData)
538
+ // this.$store.dispatch(actions.user.getCurrentUser)
539
+ // // 更新应用列表数据
540
+ // this.$store.dispatch(actions.app.queryAppList)
541
+ case 4:
542
+ case "end":
543
+ return _context3.stop();
544
+ }
545
+ }, _callee3);
546
+ }));
547
+ return function createVirtualAppCallback(_x6, _x7) {
548
+ return _ref4.apply(this, arguments);
549
+ };
550
+ }();
551
+ var delVirtualAppCallback = /*#__PURE__*/function () {
552
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(res, formData) {
553
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
554
+ while (1) switch (_context4.prev = _context4.next) {
555
+ case 0:
556
+ console.log('delVirtualAppCallback', res, formData);
563
557
 
558
+ // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
559
+ // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
560
+ _context4.next = 3;
561
+ return updateUserAuth(formData);
562
+ case 3:
563
+ getSettingData();
564
+ settingCallback && settingCallback('settingDelVirtualAppCallback', res);
565
+ // 与主应用同步信息 下面为老代码逻辑
566
+ // this.$store.commit(mutations.virtualApp.delVirtualApp, appId)
567
+ // // 更新数据权限
568
+ // let authConfig = util.clone(this.currentUser.authConfig)
569
+ // if (
570
+ // !(
571
+ // authConfig.dataAuth.length === 1 &&
572
+ // authConfig.dataAuth[0].appId === 0
573
+ // )
574
+ // ) {
575
+ // let index = authConfig.dataAuth.findIndex(
576
+ // item => item.appId === appId
577
+ // )
578
+ // if (index > -1) {
579
+ // authConfig.dataAuth.splice(index, 1)
580
+ // }
581
+ // }
582
+ // if (this.currentApp.id === appId) {
583
+ // let hasAuthApplistToDelAfter = this.hasAuthApplist.filter(
584
+ // item => item.id !== appId
585
+ // )
586
+ // let id = hasAuthApplistToDelAfter.length ? hasAuthApplistToDelAfter[0].id : 0
587
+ // this.$router.push({
588
+ // params: {
589
+ // appId: id
590
+ // }
591
+ // })
592
+ // }
593
+ // let formData = {
594
+ // userId: this.currentUser.userId,
595
+ // authConfig: JSON.stringify(authConfig),
596
+ // groupIds: this.userOfGroups.join(',')
597
+ // }
598
+ // this.$store.dispatch(actions.setting.updateUserAuth, formData)
599
+ // this.$store.dispatch(actions.user.getCurrentUser)
600
+ // // 更新应用列表数据
601
+ // this.$store.dispatch(actions.app.queryAppList)
602
+ case 5:
603
+ case "end":
604
+ return _context4.stop();
605
+ }
606
+ }, _callee4);
607
+ }));
608
+ return function delVirtualAppCallback(_x8, _x9) {
609
+ return _ref5.apply(this, arguments);
610
+ };
611
+ }();
564
612
  var editVirtualAppCallback = function editVirtualAppCallback(id) {
565
613
  // 对外提供的api, 在设置模块-》虚拟应用-》虚拟应用列表页面 删除成功时调用
566
614
  // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.0.1-a.14",
3
+ "version": "1.0.1-a.15",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [