index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. var _dialog = _interopRequireDefault(require("../../dist/dialog/dialog"));
  4. var _notify = _interopRequireDefault(require("../../dist/notify/notify"));
  5. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6. (0, _page["default"])({
  7. onClose: function onClose(event) {
  8. var _event$detail = event.detail,
  9. position = _event$detail.position,
  10. instance = _event$detail.instance;
  11. switch (position) {
  12. case "left":
  13. case "cell":
  14. instance.close();
  15. break;
  16. case "right":
  17. _dialog["default"].confirm({
  18. message: "确定删除吗?"
  19. }).then(function () {
  20. instance.close();
  21. });
  22. break;
  23. }
  24. },
  25. onOpen: function onOpen(event) {
  26. var _event$detail2 = event.detail,
  27. position = _event$detail2.position,
  28. name = _event$detail2.name;
  29. switch (position) {
  30. case "left":
  31. (0, _notify["default"])({
  32. type: "primary",
  33. message: "".concat(name).concat(position, "\u90E8\u5206\u5C55\u793Aopen\u4E8B\u4EF6\u88AB\u89E6\u53D1")
  34. });
  35. break;
  36. case "right":
  37. (0, _notify["default"])({
  38. type: "primary",
  39. message: "".concat(name).concat(position, "\u90E8\u5206\u5C55\u793Aopen\u4E8B\u4EF6\u88AB\u89E6\u53D1")
  40. });
  41. break;
  42. }
  43. }
  44. });