cms backend management

cms内部管理

目前为 2022-04-06 提交的版本。查看 最新版本

  1. /*
  2. * @Description: File Description
  3. * @FilePath: /study/temperMonkey/backend_cms_mangement/index.js
  4. * @LastEditors: zzz
  5. * @LastEditTime: 2022-04-06 11:49:09
  6. */
  7. // ==UserScript==
  8. // @name cms backend management
  9. // @name:zh-CN cms内部管理
  10. // @namespace http://tampermonkey.net/
  11. // @version 0.4
  12. // @description cms内部管理
  13. // @author zzailianlian
  14. // @match http://backend.meitun-test.com/index
  15. // @icon https://www.google.com/s2/favicons?sz=64&domain=meitun-test.com
  16. // @license MIT
  17. // @run-at document-idle
  18. // @grant GM_setValue
  19. // @grant GM_getValue
  20. // ==/UserScript==
  21.  
  22. (function () {
  23. 'use strict';
  24. window.onload=function(){
  25. const wrapperToolsContainer = $('<div id="wrapperToolsContainer"></div>')
  26. wrapperToolsContainer.css({
  27. position: 'fixed',
  28. top: 50,
  29. right: 100,
  30. padding: '12px',
  31. background: '#3498db',
  32. borderRadius: '4px',
  33. fontSize: '14px',
  34. zIndex: 999,
  35. opacity: 0.1,
  36. });
  37. wrapperToolsContainer.hover(function () { $(this).css({ opacity: 1 }); }, function () { $(this).css({ opacity: .1 }); })
  38. const initCMSModule = $('<div>初始化cms页面</div>')
  39. initCMSModule.css({
  40. padding: '12px',
  41. color: 'white',
  42. background: '#2ecc71',
  43. borderRadius: '4px',
  44. fontSize: '14px',
  45. border: '1px solid #27ae60',
  46. zIndex: 999,
  47. marginBottom: '24px',
  48. cursor:'pointer'
  49. });
  50. const syncConfig = $('<div>同步配置到页面</div>')
  51. syncConfig.css({
  52. padding: '12px',
  53. color: 'white',
  54. background: '#2ecc71',
  55. borderRadius: '4px',
  56. fontSize: '14px',
  57. border: '1px solid #27ae60',
  58. zIndex: 999,
  59. cursor:'pointer'
  60. });
  61. $('body').append(wrapperToolsContainer)
  62. wrapperToolsContainer.append(initCMSModule).append(syncConfig)
  63. const CMS_PAGE = 'CMS_PAGE'
  64. initCMSModule.on('click', () => {
  65. // 初始化cms管理tab
  66. $("a:contains('v2.0CMS页面管理')").click()
  67. // GM_setValue(CMS_PAGE, $('#menubar_tabs').find('h3').last().find('a').attr('id'));
  68. console.log('---',$("a:contains('v2.0CMS页面管理')").attr('id'),$("a:contains('v2.0CMS页面管理')"),$("a:contains('v2.0CMS系统模板')").click)
  69. $("a:contains('v2.0CMS系统模板')").click()
  70. })
  71. syncConfig.on('click', () => {
  72. // 同步配置模板到页面
  73. console.log('我是同步',$("input[value='保 存']"))
  74. // $("input[value='保 存']").click()
  75. // $('#menubar_tabs').find('a:contains("v2.0CMS页面管理")').click()
  76. // $(document.getElementById('mainIframe_tabli_780').contentWindow.document.body).find('tr').find('td:contains("783")').parent().find('button:contains("编辑")').click()
  77. // setTimeout(function () {
  78. // $(document.getElementById('mainIframe_modifyPage783').contentWindow.document.body).find('input[value="下一步"]').last().click()
  79. // setTimeout(function () {
  80. // $(document.getElementById('mainIframe_modifyPage783').contentWindow.document.body).find('input[value="保存"]').last().click()
  81. // setTimeout(function () {
  82. // $(document.getElementById('mainIframe_tabli_780').contentWindow.document.body).find('tr').find('td:contains("783")').parent().find('button:contains("同步线上")').click()
  83. // }, 2000)
  84. // }, 2000);
  85. // }, 2000)
  86. })
  87. }
  88.  
  89.  
  90.  
  91. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址