【modify】使用ESLint格式化代码

This commit is contained in:
zer0Black
2023-03-01 09:33:58 +08:00
parent 694855ae8b
commit 63369b8b87
400 changed files with 42942 additions and 43132 deletions
+20
View File
@@ -0,0 +1,20 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = {
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'config': resolve('config'),
config: resolve('config'),
'@': resolve('src'),
'@views': resolve('src/views'),
'@comp': resolve('src/components'),
+6 -6
View File
@@ -2,11 +2,11 @@
* 防止打包部署时路径被写死
*/
window._CONFIG = {}
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer
window._CONFIG['domianWebSocketURL'] = 'http://localhost:8080'
window._CONFIG.domianURL = '/jero-boot' // 路由转发 devServer
window._CONFIG.domianWebSocketURL = 'http://localhost:8080'
// 单点登录地址
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download'
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe'
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas'
window._CONFIG.staticDomainURL = window._CONFIG.domianURL + '/sys/common/download'
window._CONFIG.pdfDomainURL = window._CONFIG.domianURL + '/sys/common/pdf/pdfPreviewIframe'
window._CONFIG.casPrefixUrl = 'http://cas.example.org:8443/cas'
// 预览文件地址
window._CONFIG['onlinePreviewDomainURL'] = 'http://127.0.0.1:8012/onlinePreview'
window._CONFIG.onlinePreviewDomainURL = 'http://127.0.0.1:8012/onlinePreview'
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+260 -260
View File
@@ -1,261 +1,261 @@
tinymce.addI18n('zh_CN', {
"Redo": "\u91cd\u590d",
"Undo": "\u64a4\u6d88",
"Cut": "\u526a\u5207",
"Copy": "\u590d\u5236",
"Paste": "\u7c98\u8d34",
"Select all": "\u5168\u9009",
"New document": "\u65b0\u6587\u6863",
"Ok": "\u786e\u5b9a",
"Cancel": "\u53d6\u6d88",
"Visual aids": "\u7f51\u683c\u7ebf",
"Bold": "\u7c97\u4f53",
"Italic": "\u659c\u4f53",
"Underline": "\u4e0b\u5212\u7ebf",
"Strikethrough": "\u5220\u9664\u7ebf",
"Superscript": "\u4e0a\u6807",
"Subscript": "\u4e0b\u6807",
"Clear formatting": "\u6e05\u9664\u683c\u5f0f",
"Align left": "\u5de6\u5bf9\u9f50",
"Align center": "\u5c45\u4e2d",
"Align right": "\u53f3\u5bf9\u9f50",
"Justify": "\u4e24\u7aef\u5bf9\u9f50",
"Bullet list": "\u9879\u76ee\u7b26\u53f7",
"Numbered list": "\u7f16\u53f7\u5217\u8868",
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb",
"Increase indent": "\u589e\u52a0\u7f29\u8fdb",
"Close": "\u5173\u95ed",
"Formats": "\u683c\u5f0f",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u5bf9\u526a\u8d34\u677f\u7684\u8bbf\u95ee\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u952e\u8fdb\u884c\u590d\u5236\u7c98\u8d34\u3002",
"Headers": "\u6807\u9898",
"Header 1": "\u6807\u98981",
"Header 2": "\u6807\u98982",
"Header 3": "\u6807\u98983",
"Header 4": "\u6807\u98984",
"Header 5": "\u6807\u98985",
"Header 6": "\u6807\u98986",
"Headings": "\u6807\u9898",
"Heading 1": "\u6807\u98981",
"Heading 2": "\u6807\u98982",
"Heading 3": "\u6807\u98983",
"Heading 4": "\u6807\u98984",
"Heading 5": "\u6807\u98985",
"Heading 6": "\u6807\u98986",
"Preformatted": "\u9884\u683c\u5f0f\u5316",
"Div": "Div\u533a\u5757",
"Pre": "\u9884\u683c\u5f0f\u6587\u672c",
"Code": "\u4ee3\u7801",
"Paragraph": "\u6bb5\u843d",
"Blockquote": "\u5f15\u7528",
"Inline": "\u6587\u672c",
"Blocks": "\u533a\u5757",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002",
"Font Family": "\u5b57\u4f53",
"Font Sizes": "\u5b57\u53f7",
"Class": "Class",
"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf",
"OR": "\u6216",
"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64",
"Upload": "\u4e0a\u4f20",
"Block": "\u5757",
"Align": "\u5bf9\u9f50",
"Default": "\u9ed8\u8ba4",
"Circle": "\u7a7a\u5fc3\u5706",
"Disc": "\u5b9e\u5fc3\u5706",
"Square": "\u65b9\u5757",
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd",
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd",
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd",
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd",
"Anchor": "\u951a\u70b9",
"Name": "\u540d\u79f0",
"Id": "\u6807\u8bc6\u7b26",
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002",
"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f",
"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f",
"Special character": "\u7279\u6b8a\u7b26\u53f7",
"Source code": "\u6e90\u4ee3\u7801",
"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b",
"Language": "\u8bed\u8a00",
"Code sample": "\u4ee3\u7801\u793a\u4f8b",
"Color": "\u989c\u8272",
"R": "R",
"G": "G",
"B": "B",
"Left to right": "\u4ece\u5de6\u5230\u53f3",
"Right to left": "\u4ece\u53f3\u5230\u5de6",
"Emoticons": "\u8868\u60c5",
"Document properties": "\u6587\u6863\u5c5e\u6027",
"Title": "\u6807\u9898",
"Keywords": "\u5173\u952e\u8bcd",
"Description": "\u63cf\u8ff0",
"Robots": "\u673a\u5668\u4eba",
"Author": "\u4f5c\u8005",
"Encoding": "\u7f16\u7801",
"Fullscreen": "\u5168\u5c4f",
"Action": "\u64cd\u4f5c",
"Shortcut": "\u5feb\u6377\u952e",
"Help": "\u5e2e\u52a9",
"Address": "\u5730\u5740",
"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f",
"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f",
"Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84",
"Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355",
"Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)",
"Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):",
"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a",
"Learn more...": "\u4e86\u89e3\u66f4\u591a...",
"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}",
"Plugins": "\u63d2\u4ef6",
"Handy Shortcuts": "\u5feb\u6377\u952e",
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf",
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247",
"Image description": "\u56fe\u7247\u63cf\u8ff0",
"Source": "\u5730\u5740",
"Dimensions": "\u5927\u5c0f",
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4",
"General": "\u666e\u901a",
"Advanced": "\u9ad8\u7ea7",
"Style": "\u6837\u5f0f",
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd",
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd",
"Border": "\u8fb9\u6846",
"Insert image": "\u63d2\u5165\u56fe\u7247",
"Image": "\u56fe\u7247",
"Image list": "\u56fe\u7247\u5217\u8868",
"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c",
"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c",
"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c",
"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c",
"Edit image": "\u7f16\u8f91\u56fe\u7247",
"Image options": "\u56fe\u7247\u9009\u9879",
"Zoom in": "\u653e\u5927",
"Zoom out": "\u7f29\u5c0f",
"Crop": "\u88c1\u526a",
"Resize": "\u8c03\u6574\u5927\u5c0f",
"Orientation": "\u65b9\u5411",
"Brightness": "\u4eae\u5ea6",
"Sharpen": "\u9510\u5316",
"Contrast": "\u5bf9\u6bd4\u5ea6",
"Color levels": "\u989c\u8272\u5c42\u6b21",
"Gamma": "\u4f3d\u9a6c\u503c",
"Invert": "\u53cd\u8f6c",
"Apply": "\u5e94\u7528",
"Back": "\u540e\u9000",
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4",
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4",
"Insert link": "\u63d2\u5165\u94fe\u63a5",
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5",
"Text to display": "\u663e\u793a\u6587\u5b57",
"Url": "\u5730\u5740",
"Target": "\u6253\u5f00\u65b9\u5f0f",
"None": "\u65e0",
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00",
"Remove link": "\u5220\u9664\u94fe\u63a5",
"Anchors": "\u951a\u70b9",
"Link": "\u94fe\u63a5",
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f",
"Link list": "\u94fe\u63a5\u5217\u8868",
"Insert video": "\u63d2\u5165\u89c6\u9891",
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891",
"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53",
"Alternative source": "\u955c\u50cf",
"Poster": "\u5c01\u9762",
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:",
"Embed": "\u5185\u5d4c",
"Media": "\u5a92\u4f53",
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c",
"Page break": "\u5206\u9875\u7b26",
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c",
"Preview": "\u9884\u89c8",
"Print": "\u6253\u5370",
"Save": "\u4fdd\u5b58",
"Find": "\u67e5\u627e",
"Replace with": "\u66ff\u6362\u4e3a",
"Replace": "\u66ff\u6362",
"Replace all": "\u5168\u90e8\u66ff\u6362",
"Prev": "\u4e0a\u4e00\u4e2a",
"Next": "\u4e0b\u4e00\u4e2a",
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362",
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.",
"Match case": "\u533a\u5206\u5927\u5c0f\u5199",
"Whole words": "\u5168\u5b57\u5339\u914d",
"Spellcheck": "\u62fc\u5199\u68c0\u67e5",
"Ignore": "\u5ffd\u7565",
"Ignore all": "\u5168\u90e8\u5ffd\u7565",
"Finish": "\u5b8c\u6210",
"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178",
"Insert table": "\u63d2\u5165\u8868\u683c",
"Table properties": "\u8868\u683c\u5c5e\u6027",
"Delete table": "\u5220\u9664\u8868\u683c",
"Cell": "\u5355\u5143\u683c",
"Row": "\u884c",
"Column": "\u5217",
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027",
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c",
"Split cell": "\u62c6\u5206\u5355\u5143\u683c",
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165",
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165",
"Delete row": "\u5220\u9664\u884c",
"Row properties": "\u884c\u5c5e\u6027",
"Cut row": "\u526a\u5207\u884c",
"Copy row": "\u590d\u5236\u884c",
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9",
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9",
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165",
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165",
"Delete column": "\u5220\u9664\u5217",
"Cols": "\u5217",
"Rows": "\u884c",
"Width": "\u5bbd",
"Height": "\u9ad8",
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd",
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd",
"Caption": "\u6807\u9898",
"Left": "\u5de6\u5bf9\u9f50",
"Center": "\u5c45\u4e2d",
"Right": "\u53f3\u5bf9\u9f50",
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b",
"Scope": "\u8303\u56f4",
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f",
"H Align": "\u6c34\u5e73\u5bf9\u9f50",
"V Align": "\u5782\u76f4\u5bf9\u9f50",
"Top": "\u9876\u90e8\u5bf9\u9f50",
"Middle": "\u5782\u76f4\u5c45\u4e2d",
"Bottom": "\u5e95\u90e8\u5bf9\u9f50",
"Header cell": "\u8868\u5934\u5355\u5143\u683c",
"Row group": "\u884c\u7ec4",
"Column group": "\u5217\u7ec4",
"Row type": "\u884c\u7c7b\u578b",
"Header": "\u8868\u5934",
"Body": "\u8868\u4f53",
"Footer": "\u8868\u5c3e",
"Border color": "\u8fb9\u6846\u989c\u8272",
"Insert template": "\u63d2\u5165\u6a21\u677f",
"Templates": "\u6a21\u677f",
"Template": "\u6a21\u677f",
"Text color": "\u6587\u5b57\u989c\u8272",
"Background color": "\u80cc\u666f\u8272",
"Custom...": "\u81ea\u5b9a\u4e49...",
"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272",
"No color": "\u65e0",
"Table of Contents": "\u5185\u5bb9\u5217\u8868",
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846",
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26",
"Words: {0}": "\u5b57\u6570\uff1a{0}",
"{0} words": "{0} \u5b57",
"File": "\u6587\u4ef6",
"Edit": "\u7f16\u8f91",
"Insert": "\u63d2\u5165",
"View": "\u89c6\u56fe",
"Format": "\u683c\u5f0f",
"Table": "\u8868\u683c",
"Tools": "\u5de5\u5177",
"Powered by {0}": "\u7531{0}\u9a71\u52a8",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9"
});
Redo: '\u91cd\u590d',
Undo: '\u64a4\u6d88',
Cut: '\u526a\u5207',
Copy: '\u590d\u5236',
Paste: '\u7c98\u8d34',
'Select all': '\u5168\u9009',
'New document': '\u65b0\u6587\u6863',
Ok: '\u786e\u5b9a',
Cancel: '\u53d6\u6d88',
'Visual aids': '\u7f51\u683c\u7ebf',
Bold: '\u7c97\u4f53',
Italic: '\u659c\u4f53',
Underline: '\u4e0b\u5212\u7ebf',
Strikethrough: '\u5220\u9664\u7ebf',
Superscript: '\u4e0a\u6807',
Subscript: '\u4e0b\u6807',
'Clear formatting': '\u6e05\u9664\u683c\u5f0f',
'Align left': '\u5de6\u5bf9\u9f50',
'Align center': '\u5c45\u4e2d',
'Align right': '\u53f3\u5bf9\u9f50',
Justify: '\u4e24\u7aef\u5bf9\u9f50',
'Bullet list': '\u9879\u76ee\u7b26\u53f7',
'Numbered list': '\u7f16\u53f7\u5217\u8868',
'Decrease indent': '\u51cf\u5c11\u7f29\u8fdb',
'Increase indent': '\u589e\u52a0\u7f29\u8fdb',
Close: '\u5173\u95ed',
Formats: '\u683c\u5f0f',
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": '\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u5bf9\u526a\u8d34\u677f\u7684\u8bbf\u95ee\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u952e\u8fdb\u884c\u590d\u5236\u7c98\u8d34\u3002',
Headers: '\u6807\u9898',
'Header 1': '\u6807\u98981',
'Header 2': '\u6807\u98982',
'Header 3': '\u6807\u98983',
'Header 4': '\u6807\u98984',
'Header 5': '\u6807\u98985',
'Header 6': '\u6807\u98986',
Headings: '\u6807\u9898',
'Heading 1': '\u6807\u98981',
'Heading 2': '\u6807\u98982',
'Heading 3': '\u6807\u98983',
'Heading 4': '\u6807\u98984',
'Heading 5': '\u6807\u98985',
'Heading 6': '\u6807\u98986',
Preformatted: '\u9884\u683c\u5f0f\u5316',
Div: 'Div\u533a\u5757',
Pre: '\u9884\u683c\u5f0f\u6587\u672c',
Code: '\u4ee3\u7801',
Paragraph: '\u6bb5\u843d',
Blockquote: '\u5f15\u7528',
Inline: '\u6587\u672c',
Blocks: '\u533a\u5757',
'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.': '\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002',
'Font Family': '\u5b57\u4f53',
'Font Sizes': '\u5b57\u53f7',
Class: 'Class',
'Browse for an image': '\u6d4f\u89c8\u56fe\u50cf',
OR: '\u6216',
'Drop an image here': '\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64',
Upload: '\u4e0a\u4f20',
Block: '\u5757',
Align: '\u5bf9\u9f50',
Default: '\u9ed8\u8ba4',
Circle: '\u7a7a\u5fc3\u5706',
Disc: '\u5b9e\u5fc3\u5706',
Square: '\u65b9\u5757',
'Lower Alpha': '\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd',
'Lower Greek': '\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd',
'Lower Roman': '\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd',
'Upper Alpha': '\u5927\u5199\u82f1\u6587\u5b57\u6bcd',
'Upper Roman': '\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd',
Anchor: '\u951a\u70b9',
Name: '\u540d\u79f0',
Id: '\u6807\u8bc6\u7b26',
'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.': '\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002',
'You have unsaved changes are you sure you want to navigate away?': '\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f',
'Restore last draft': '\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f',
'Special character': '\u7279\u6b8a\u7b26\u53f7',
'Source code': '\u6e90\u4ee3\u7801',
'Insert\/Edit code sample': '\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b',
Language: '\u8bed\u8a00',
'Code sample': '\u4ee3\u7801\u793a\u4f8b',
Color: '\u989c\u8272',
R: 'R',
G: 'G',
B: 'B',
'Left to right': '\u4ece\u5de6\u5230\u53f3',
'Right to left': '\u4ece\u53f3\u5230\u5de6',
Emoticons: '\u8868\u60c5',
'Document properties': '\u6587\u6863\u5c5e\u6027',
Title: '\u6807\u9898',
Keywords: '\u5173\u952e\u8bcd',
Description: '\u63cf\u8ff0',
Robots: '\u673a\u5668\u4eba',
Author: '\u4f5c\u8005',
Encoding: '\u7f16\u7801',
Fullscreen: '\u5168\u5c4f',
Action: '\u64cd\u4f5c',
Shortcut: '\u5feb\u6377\u952e',
Help: '\u5e2e\u52a9',
Address: '\u5730\u5740',
'Focus to menubar': '\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f',
'Focus to toolbar': '\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f',
'Focus to element path': '\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84',
'Focus to contextual toolbar': '\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355',
'Insert link (if link plugin activated)': '\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)',
'Save (if save plugin activated)': '\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)',
'Find (if searchreplace plugin activated)': '\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)',
'Plugins installed ({0}):': '\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):',
'Premium plugins:': '\u4f18\u79c0\u63d2\u4ef6\uff1a',
'Learn more...': '\u4e86\u89e3\u66f4\u591a...',
'You are using {0}': '\u4f60\u6b63\u5728\u4f7f\u7528 {0}',
Plugins: '\u63d2\u4ef6',
'Handy Shortcuts': '\u5feb\u6377\u952e',
'Horizontal line': '\u6c34\u5e73\u5206\u5272\u7ebf',
'Insert\/edit image': '\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247',
'Image description': '\u56fe\u7247\u63cf\u8ff0',
Source: '\u5730\u5740',
Dimensions: '\u5927\u5c0f',
'Constrain proportions': '\u4fdd\u6301\u7eb5\u6a2a\u6bd4',
General: '\u666e\u901a',
Advanced: '\u9ad8\u7ea7',
Style: '\u6837\u5f0f',
'Vertical space': '\u5782\u76f4\u8fb9\u8ddd',
'Horizontal space': '\u6c34\u5e73\u8fb9\u8ddd',
Border: '\u8fb9\u6846',
'Insert image': '\u63d2\u5165\u56fe\u7247',
Image: '\u56fe\u7247',
'Image list': '\u56fe\u7247\u5217\u8868',
'Rotate counterclockwise': '\u9006\u65f6\u9488\u65cb\u8f6c',
'Rotate clockwise': '\u987a\u65f6\u9488\u65cb\u8f6c',
'Flip vertically': '\u5782\u76f4\u7ffb\u8f6c',
'Flip horizontally': '\u6c34\u5e73\u7ffb\u8f6c',
'Edit image': '\u7f16\u8f91\u56fe\u7247',
'Image options': '\u56fe\u7247\u9009\u9879',
'Zoom in': '\u653e\u5927',
'Zoom out': '\u7f29\u5c0f',
Crop: '\u88c1\u526a',
Resize: '\u8c03\u6574\u5927\u5c0f',
Orientation: '\u65b9\u5411',
Brightness: '\u4eae\u5ea6',
Sharpen: '\u9510\u5316',
Contrast: '\u5bf9\u6bd4\u5ea6',
'Color levels': '\u989c\u8272\u5c42\u6b21',
Gamma: '\u4f3d\u9a6c\u503c',
Invert: '\u53cd\u8f6c',
Apply: '\u5e94\u7528',
Back: '\u540e\u9000',
'Insert date\/time': '\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4',
'Date\/time': '\u65e5\u671f\/\u65f6\u95f4',
'Insert link': '\u63d2\u5165\u94fe\u63a5',
'Insert\/edit link': '\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5',
'Text to display': '\u663e\u793a\u6587\u5b57',
Url: '\u5730\u5740',
Target: '\u6253\u5f00\u65b9\u5f0f',
None: '\u65e0',
'New window': '\u5728\u65b0\u7a97\u53e3\u6253\u5f00',
'Remove link': '\u5220\u9664\u94fe\u63a5',
Anchors: '\u951a\u70b9',
Link: '\u94fe\u63a5',
'Paste or type a link': '\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5',
'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?': '\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f',
'The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?': '\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f',
'Link list': '\u94fe\u63a5\u5217\u8868',
'Insert video': '\u63d2\u5165\u89c6\u9891',
'Insert\/edit video': '\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891',
'Insert\/edit media': '\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53',
'Alternative source': '\u955c\u50cf',
Poster: '\u5c01\u9762',
'Paste your embed code below:': '\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:',
Embed: '\u5185\u5d4c',
Media: '\u5a92\u4f53',
'Nonbreaking space': '\u4e0d\u95f4\u65ad\u7a7a\u683c',
'Page break': '\u5206\u9875\u7b26',
'Paste as text': '\u7c98\u8d34\u4e3a\u6587\u672c',
Preview: '\u9884\u89c8',
Print: '\u6253\u5370',
Save: '\u4fdd\u5b58',
Find: '\u67e5\u627e',
'Replace with': '\u66ff\u6362\u4e3a',
Replace: '\u66ff\u6362',
'Replace all': '\u5168\u90e8\u66ff\u6362',
Prev: '\u4e0a\u4e00\u4e2a',
Next: '\u4e0b\u4e00\u4e2a',
'Find and replace': '\u67e5\u627e\u548c\u66ff\u6362',
'Could not find the specified string.': '\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.',
'Match case': '\u533a\u5206\u5927\u5c0f\u5199',
'Whole words': '\u5168\u5b57\u5339\u914d',
Spellcheck: '\u62fc\u5199\u68c0\u67e5',
Ignore: '\u5ffd\u7565',
'Ignore all': '\u5168\u90e8\u5ffd\u7565',
Finish: '\u5b8c\u6210',
'Add to Dictionary': '\u6dfb\u52a0\u5230\u5b57\u5178',
'Insert table': '\u63d2\u5165\u8868\u683c',
'Table properties': '\u8868\u683c\u5c5e\u6027',
'Delete table': '\u5220\u9664\u8868\u683c',
Cell: '\u5355\u5143\u683c',
Row: '\u884c',
Column: '\u5217',
'Cell properties': '\u5355\u5143\u683c\u5c5e\u6027',
'Merge cells': '\u5408\u5e76\u5355\u5143\u683c',
'Split cell': '\u62c6\u5206\u5355\u5143\u683c',
'Insert row before': '\u5728\u4e0a\u65b9\u63d2\u5165',
'Insert row after': '\u5728\u4e0b\u65b9\u63d2\u5165',
'Delete row': '\u5220\u9664\u884c',
'Row properties': '\u884c\u5c5e\u6027',
'Cut row': '\u526a\u5207\u884c',
'Copy row': '\u590d\u5236\u884c',
'Paste row before': '\u7c98\u8d34\u5230\u4e0a\u65b9',
'Paste row after': '\u7c98\u8d34\u5230\u4e0b\u65b9',
'Insert column before': '\u5728\u5de6\u4fa7\u63d2\u5165',
'Insert column after': '\u5728\u53f3\u4fa7\u63d2\u5165',
'Delete column': '\u5220\u9664\u5217',
Cols: '\u5217',
Rows: '\u884c',
Width: '\u5bbd',
Height: '\u9ad8',
'Cell spacing': '\u5355\u5143\u683c\u5916\u95f4\u8ddd',
'Cell padding': '\u5355\u5143\u683c\u5185\u8fb9\u8ddd',
Caption: '\u6807\u9898',
Left: '\u5de6\u5bf9\u9f50',
Center: '\u5c45\u4e2d',
Right: '\u53f3\u5bf9\u9f50',
'Cell type': '\u5355\u5143\u683c\u7c7b\u578b',
Scope: '\u8303\u56f4',
Alignment: '\u5bf9\u9f50\u65b9\u5f0f',
'H Align': '\u6c34\u5e73\u5bf9\u9f50',
'V Align': '\u5782\u76f4\u5bf9\u9f50',
Top: '\u9876\u90e8\u5bf9\u9f50',
Middle: '\u5782\u76f4\u5c45\u4e2d',
Bottom: '\u5e95\u90e8\u5bf9\u9f50',
'Header cell': '\u8868\u5934\u5355\u5143\u683c',
'Row group': '\u884c\u7ec4',
'Column group': '\u5217\u7ec4',
'Row type': '\u884c\u7c7b\u578b',
Header: '\u8868\u5934',
Body: '\u8868\u4f53',
Footer: '\u8868\u5c3e',
'Border color': '\u8fb9\u6846\u989c\u8272',
'Insert template': '\u63d2\u5165\u6a21\u677f',
Templates: '\u6a21\u677f',
Template: '\u6a21\u677f',
'Text color': '\u6587\u5b57\u989c\u8272',
'Background color': '\u80cc\u666f\u8272',
'Custom...': '\u81ea\u5b9a\u4e49...',
'Custom color': '\u81ea\u5b9a\u4e49\u989c\u8272',
'No color': '\u65e0',
'Table of Contents': '\u5185\u5bb9\u5217\u8868',
'Show blocks': '\u663e\u793a\u533a\u5757\u8fb9\u6846',
'Show invisible characters': '\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26',
'Words: {0}': '\u5b57\u6570\uff1a{0}',
'{0} words': '{0} \u5b57',
File: '\u6587\u4ef6',
Edit: '\u7f16\u8f91',
Insert: '\u63d2\u5165',
View: '\u89c6\u56fe',
Format: '\u683c\u5f0f',
Table: '\u8868\u683c',
Tools: '\u5de5\u5177',
'Powered by {0}': '\u7531{0}\u9a71\u52a8',
'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help': '\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9'
})
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -5
View File
@@ -12,11 +12,11 @@
export default {
data () {
return {
locale: zhCN,
locale: zhCN
}
},
created () {
let that = this
const that = this
enquireScreen(deviceType => {
// tablet
if (deviceType === 0) {
@@ -27,12 +27,10 @@
else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
}
else {
} else {
that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.dispatch('setSidebar', true)
}
})
}
}
+6 -8
View File
@@ -9,22 +9,20 @@ import Vue from 'vue'
*/
export function httpGroupRequest (getPromise, groupId, expire = 1000 * 30) {
if (groupId == null || groupId === '') {
console.log("--------popup----------getFrom DB-------with---no--groupId ")
console.log('--------popup----------getFrom DB-------with---no--groupId ')
return getPromise()
}
if (Vue.ls.get(groupId)) {
console.log("---------popup--------getFrom Cache--------groupId = " + groupId)
return Promise.resolve(Vue.ls.get(groupId));
console.log('---------popup--------getFrom Cache--------groupId = ' + groupId)
return Promise.resolve(Vue.ls.get(groupId))
} else {
console.log("--------popup----------getFrom DB---------groupId = " + groupId)
console.log('--------popup----------getFrom DB---------groupId = ' + groupId)
}
// 还没有发出请求,就发出第一次的请求
return getPromise().then(res => {
Vue.ls.set(groupId, res, expire);
return Promise.resolve(res);
Vue.ls.set(groupId, res, expire)
return Promise.resolve(res)
})
}
+56 -59
View File
@@ -1,101 +1,101 @@
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue'
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
// 角色管理
const addRole = (params)=>postAction("/sys/role/add",params);
const editRole = (params)=>putAction("/sys/role/edit",params);
const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
const queryall = (params)=>getAction("/sys/role/queryall",params);
const addRole = (params) => postAction('/sys/role/add', params)
const editRole = (params) => putAction('/sys/role/edit', params)
const checkRoleCode = (params) => getAction('/sys/role/checkRoleCode', params)
const queryall = (params) => getAction('/sys/role/queryall', params)
// 用户管理
const addUser = (params)=>postAction("/sys/user/add",params);
const editUser = (params)=>putAction("/sys/user/edit",params);
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
const getUserList = (params)=>getAction("/sys/user/page",params);
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
const addUser = (params) => postAction('/sys/user/add', params)
const editUser = (params) => putAction('/sys/user/edit', params)
const queryUserRole = (params) => getAction('/sys/user/queryUserRole', params)
const getUserList = (params) => getAction('/sys/user/page', params)
const frozenBatch = (params) => putAction('/sys/user/frozenBatch', params)
// 验证用户是否存在
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
const checkOnlyUser = (params) => getAction('/sys/user/checkOnlyUser', params)
// 改变密码
const changePassword = (params)=>putAction("/sys/user/changePassword",params);
const changePassword = (params) => putAction('/sys/user/changePassword', params)
// 权限管理
const addPermission= (params)=>postAction("/sys/permission/add",params);
const editPermission= (params)=>putAction("/sys/permission/edit",params);
const getPermissionList = (params)=>getAction("/sys/permission/page",params);
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
const addPermission = (params) => postAction('/sys/permission/add', params)
const editPermission = (params) => putAction('/sys/permission/edit', params)
const getPermissionList = (params) => getAction('/sys/permission/page', params)
const getSystemMenuList = (params) => getAction('/sys/permission/getSystemMenuList', params)
const getSystemSubmenu = (params) => getAction('/sys/permission/getSystemSubmenu', params)
const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
const queryPermissionsByUser = ()=>getAction("/sys/permission/getUserPermissionByToken");
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermissionRule",params);
const queryTreeList = (params) => getAction('/sys/permission/queryTreeList', params)
const queryTreeListForRole = (params) => getAction('/sys/role/queryTreeList', params)
const queryListAsync = (params) => getAction('/sys/permission/queryListAsync', params)
const queryRolePermission = (params) => getAction('/sys/permission/queryRolePermission', params)
const saveRolePermission = (params) => postAction('/sys/permission/saveRolePermission', params)
const queryPermissionsByUser = () => getAction('/sys/permission/getUserPermissionByToken')
const loadAllRoleIds = (params) => getAction('/sys/permission/loadAllRoleIds', params)
const getPermissionRuleList = (params) => getAction('/sys/permission/getPermRuleListByPermId', params)
const queryPermissionRule = (params) => getAction('/sys/permission/queryPermissionRule', params)
// 部门管理
const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params);
const queryDepartTreeSync = (params)=>getAction("/sys/sysDepart/queryDepartTreeSync",params);
const queryIdTree = (params)=>getAction("/sys/sysDepart/queryIdTree",params);
const queryParentName = (params)=>getAction("/sys/sysDepart/queryParentName",params);
const searchByKeywords = (params)=>getAction("/sys/sysDepart/searchBy",params);
const deleteByDepartId = (params)=>deleteAction("/sys/sysDepart/delete",params);
const queryDepartTreeList = (params) => getAction('/sys/sysDepart/queryTreeList', params)
const queryDepartTreeSync = (params) => getAction('/sys/sysDepart/queryDepartTreeSync', params)
const queryIdTree = (params) => getAction('/sys/sysDepart/queryIdTree', params)
const queryParentName = (params) => getAction('/sys/sysDepart/queryParentName', params)
const searchByKeywords = (params) => getAction('/sys/sysDepart/searchBy', params)
const deleteByDepartId = (params) => deleteAction('/sys/sysDepart/delete', params)
// 二级部门管理
const queryDepartPermission = (params)=>getAction("/sys/permission/queryDepartPermission",params);
const saveDepartPermission = (params)=>postAction("/sys/permission/saveDepartPermission",params);
const queryTreeListForDeptRole = (params)=>getAction("/sys/sysDepartPermission/queryTreeListForDeptRole",params);
const queryDeptRolePermission = (params)=>getAction("/sys/sysDepartPermission/queryDeptRolePermission",params);
const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params);
const queryDepartPermission = (params) => getAction('/sys/permission/queryDepartPermission', params)
const saveDepartPermission = (params) => postAction('/sys/permission/saveDepartPermission', params)
const queryTreeListForDeptRole = (params) => getAction('/sys/sysDepartPermission/queryTreeListForDeptRole', params)
const queryDeptRolePermission = (params) => getAction('/sys/sysDepartPermission/queryDeptRolePermission', params)
const queryMyDepartTreeList = (params) => getAction('/sys/sysDepart/queryMyDeptTreeList', params)
// 日志管理
const deleteLog = (params)=>deleteAction("/sys/log/delete",params);
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);
const deleteLog = (params) => deleteAction('/sys/log/delete', params)
const deleteLogList = (params) => deleteAction('/sys/log/deleteBatch', params)
// 数据字典
const addDict = (params)=>postAction("/sys/dict/add",params);
const editDict = (params)=>putAction("/sys/dict/edit",params);
const treeList = (params)=>getAction("/sys/dict/treeList",params);
const addDictItem = (params)=>postAction("/sys/dictItem/add",params);
const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);
const addDict = (params) => postAction('/sys/dict/add', params)
const editDict = (params) => putAction('/sys/dict/edit', params)
const treeList = (params) => getAction('/sys/dict/treeList', params)
const addDictItem = (params) => postAction('/sys/dictItem/add', params)
const editDictItem = (params) => putAction('/sys/dictItem/edit', params)
// 字典标签专用(通过code获取字典数组)
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);
export const ajaxGetDictItems = (code, params) => getAction(`/sys/dict/getDictItems/${code}`, params)
// 从缓存中获取字典配置
function getDictItemsFromCache (dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) {
let dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode];
return dictItems;
const dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]
return dictItems
}
}
// 系统通告
const doReleaseData = (params)=>getAction("/sys/annountCement/doReleaseData",params);
const doReovkeData = (params)=>getAction("/sys/annountCement/doReovkeData",params);
const doReleaseData = (params) => getAction('/sys/annountCement/doReleaseData', params)
const doReovkeData = (params) => getAction('/sys/annountCement/doReovkeData', params)
// 获取系统访问量
const getLoginfo = (params)=>getAction("/sys/loginfo",params);
const getVisitInfo = (params)=>getAction("/sys/visitInfo",params);
const getLoginfo = (params) => getAction('/sys/loginfo', params)
const getVisitInfo = (params) => getAction('/sys/visitInfo', params)
// 根据部门主键查询用户信息
const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);
const queryUserByDepId = (params) => getAction('/sys/user/queryUserByDepId', params)
// 重复校验
const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
const duplicateCheck = (params) => getAction('/sys/duplicate/check', params)
// 加载分类字典
const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);
const loadCategoryData = (params) => getAction('/sys/category/loadAllData', params)
const checkRuleByCode = (params) => getAction('/sys/checkRule/checkByCode', params)
// 加载我的通告信息
const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
const getUserNoticeInfo = (params) => getAction('/sys/sysAnnouncementSend/getMyAnnouncementSend', params)
const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`
// 中转HTTP请求
export const transitRESTful = {
get: (url, parameter) => getAction(getTransitURL(url), parameter),
post: (url, parameter) => postAction(getTransitURL(url), parameter),
put: (url, parameter) => putAction(getTransitURL(url), parameter),
http: (url, parameter) => httpAction(getTransitURL(url), parameter),
http: (url, parameter) => httpAction(getTransitURL(url), parameter)
}
export {
@@ -154,6 +154,3 @@ export {
getUserNoticeInfo,
getDictItemsFromCache
}
+16 -16
View File
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { axios } from '@/utils/request'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { ACCESS_TOKEN } from '@/store/mutation-types'
import signMd5Utils from '@/utils/encryption/signMd5Utils'
const api = {
@@ -15,9 +15,9 @@ export default api
// post
export function postAction (url, parameter) {
let sign = signMd5Utils.getSign(url, parameter);
const sign = signMd5Utils.getSign(url, parameter)
// 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({
url: url,
@@ -29,9 +29,9 @@ export function postAction(url,parameter) {
// post method= {post | put}
export function httpAction (url, parameter, method) {
let sign = signMd5Utils.getSign(url, parameter);
const sign = signMd5Utils.getSign(url, parameter)
// 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({
url: url,
@@ -52,9 +52,9 @@ export function putAction(url,parameter) {
// get
export function getAction (url, parameter) {
let sign = signMd5Utils.getSign(url, parameter);
const sign = signMd5Utils.getSign(url, parameter)
// 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({
url: url,
@@ -140,14 +140,14 @@ export function downFile(url,parameter){
export function downloadFile (url, fileName, parameter) {
return downFile(url, parameter).then((data) => {
if (!data || data.size === 0) {
Vue.prototype['$message'].warning('文件下载失败')
Vue.prototype.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName)
} else {
let url = window.URL.createObjectURL(new Blob([data]))
let link = document.createElement('a')
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
@@ -171,8 +171,8 @@ export function uploadAction(url,parameter){
data: parameter,
method: 'post',
headers: {
'Content-Type': 'multipart/form-data', // 文件上传
},
'Content-Type': 'multipart/form-data' // 文件上传
}
})
}
@@ -186,14 +186,14 @@ export function getFileAccessHttpUrl(avatar,subStr) {
if (!subStr) subStr = 'http'
try {
if (avatar && avatar.startsWith(subStr)) {
return avatar;
return avatar
} else {
if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
let token = Vue.ls.get(ACCESS_TOKEN);
return window._CONFIG['staticDomainURL'] + "/" + avatar + "?token=" + token;
const token = Vue.ls.get(ACCESS_TOKEN)
return window._CONFIG.staticDomainURL + '/' + avatar + '?token=' + token
}
}
} catch (err) {
return;
}
}
+31 -32
View File
@@ -1,77 +1,76 @@
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { ACCESS_TOKEN } from '@/store/mutation-types'
import store from '@/store'
/**
* 单点登录
*/
const init = (callback) => {
if (process.env.VUE_APP_SSO == 'true') {
console.log("-------单点登录开始-------");
let token = Vue.ls.get(ACCESS_TOKEN);
let st = getUrlParam("ticket");
let sevice = "http://" + window.location.host + "/";
console.log('-------单点登录开始-------')
const token = Vue.ls.get(ACCESS_TOKEN)
const st = getUrlParam('ticket')
const sevice = 'http://' + window.location.host + '/'
if (token) {
loginSuccess(callback);
loginSuccess(callback)
} else {
if (st) {
validateSt(st, sevice, callback);
validateSt(st, sevice, callback)
} else {
let serviceUrl = encodeURIComponent(sevice);
window.location.href = window._CONFIG['casPrefixUrl'] + "/login?service=" + serviceUrl;
const serviceUrl = encodeURIComponent(sevice)
window.location.href = window._CONFIG.casPrefixUrl + '/login?service=' + serviceUrl
}
}
console.log("-------单点登录结束-------");
console.log('-------单点登录结束-------')
} else {
callback && callback()
}
};
}
const SSO = {
init: init
};
}
function getUrlParam (paraName) {
let url = document.location.toString();
let arrObj = url.split("?");
const url = document.location.toString()
const arrObj = url.split('?')
if (arrObj.length > 1) {
let arrPara = arrObj[1].split("&");
let arr;
const arrPara = arrObj[1].split('&')
let arr
for (let i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split("=");
arr = arrPara[i].split('=')
if (arr != null && arr[0] == paraName) {
return arr[1];
return arr[1]
}
}
return "";
}
else {
return "";
return ''
} else {
return ''
}
}
function validateSt (ticket, service, callback) {
let params = {
const params = {
ticket: ticket,
service: service
};
}
store.dispatch('ValidateLogin', params).then(res => {
// this.departConfirm(res)
if (res.success) {
loginSuccess(callback);
loginSuccess(callback)
} else {
let sevice = "http://"+window.location.host+"/";
let serviceUrl = encodeURIComponent(sevice);
window.location.href = window._CONFIG['casPrefixUrl']+"/login?service="+serviceUrl;
const sevice = 'http://' + window.location.host + '/'
const serviceUrl = encodeURIComponent(sevice)
window.location.href = window._CONFIG.casPrefixUrl + '/login?service=' + serviceUrl
}
}).catch((err) => {
console.log(err);
console.log(err)
// that.requestFailed(err);
});
})
}
function loginSuccess (callback) {
callback();
callback()
}
export default SSO;
export default SSO
+1 -2
View File
@@ -5,7 +5,6 @@
<slot></slot>
<template v-for="item in filterEmpty($slots.default).slice(0, 3)"></template>
<template v-if="maxLength > 0 && filterEmpty($slots.default).length > maxLength">
<avatar-item :size="size">
<avatar :size="size !== 'mini' && size || 20" :style="excessItemsStyle">{{ `+${maxLength}` }}</avatar>
@@ -85,7 +84,7 @@
const { prefixCls, size } = this.$props
const classString = {
[`${prefixCls}`]: true,
[`${size}`]: true,
[`${size}`]: true
}
const items = filterEmpty(this.$slots.default)
const itemsDom = items && items.length ? <ul class={`${prefixCls}-items`}>{ this.getItems(items) }</ul> : null
+12 -12
View File
@@ -7,11 +7,11 @@
<script>
function fixedZero (val) {
return val * 1 < 10 ? `0${val}` : val;
return val * 1 < 10 ? `0${val}` : val
}
export default {
name: "CountDown",
name: 'CountDown',
props: {
format: {
type: Function,
@@ -19,7 +19,7 @@
},
target: {
type: [Date, Number],
required: true,
required: true
},
onEnd: {
type: Function,
@@ -38,12 +38,12 @@
},
filters: {
format (time) {
const hours = 60 * 60 * 1000;
const minutes = 60 * 1000;
const hours = 60 * 60 * 1000
const minutes = 60 * 1000
const h = Math.floor(time / hours);
const m = Math.floor((time - h * hours) / minutes);
const s = Math.floor((time - h * hours - m * minutes) / 1000);
const h = Math.floor(time / hours)
const m = Math.floor((time - h * hours) / minutes)
const s = Math.floor((time - h * hours - m * minutes) / 1000)
return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
}
},
@@ -53,8 +53,8 @@
},
methods: {
initTime () {
let lastTime = 0;
let targetTime = 0;
let lastTime = 0
let targetTime = 0
this.originTargetTime = this.target
try {
if (Object.prototype.toString.call(this.target) === '[object Date]') {
@@ -66,7 +66,7 @@
throw new Error('invalid target prop')
}
lastTime = targetTime - new Date().getTime();
lastTime = targetTime - new Date().getTime()
this.lastTime = lastTime < 0 ? 0 : lastTime
},
@@ -78,7 +78,7 @@
clearTimeout(this.timer)
this.lastTime = 0
if (typeof onEnd === 'function') {
onEnd();
onEnd()
}
} else {
this.lastTime -= this.interval
@@ -10,11 +10,11 @@
},
tooltip: {
type: Boolean,
default: true,
default: true
},
length: {
type: Number,
default: 25,
default: 25
},
lines: {
type: Number,
@@ -75,14 +75,14 @@
data () {
return {
innerFile: null,
number:0,
number: 0
}
},
computed: {
/** upload headers */
uploadHeaders () {
let {originColumn: col} = this
let headers = {}
const { originColumn: col } = this
const headers = {}
if (col.token === true) {
headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN)
}
@@ -92,7 +92,7 @@
/** 上传请求地址 */
uploadAction () {
if (!this.originColumn.action) {
return window._CONFIG['domianURL'] + '/sys/common/upload'
return window._CONFIG.domianURL + '/sys/common/upload'
} else {
return this.originColumn.action
}
@@ -103,8 +103,8 @@
},
ellipsisFileName () {
let length = 5
let file = this.innerFile
const length = 5
const file = this.innerFile
if (!file || !file.name) {
return ''
}
@@ -120,7 +120,7 @@
} else {
return 'message'
}
},
}
},
watch: {
@@ -132,8 +132,8 @@
} else {
this.innerFile = null
}
},
},
}
}
},
methods: {
@@ -147,8 +147,8 @@
}
// update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件
if (originColumn && originColumn.fieldExtendJson) {
let json = JSON.parse(originColumn.fieldExtendJson);
this.number = json.uploadnum?json.uploadnum:0;
const json = JSON.parse(originColumn.fieldExtendJson)
this.number = json.uploadnum ? json.uploadnum : 0
}
let path = ''
if (this.innerFile) {
@@ -166,9 +166,9 @@
},
handleChangeUpload (info) {
let {originColumn: col} = this
let {file} = info
let value = {
const { originColumn: col } = this
const { file } = info
const value = {
name: file.name,
type: file.type,
size: file.size,
@@ -176,24 +176,24 @@
percent: file.percent
}
if (file.response) {
value['responseName'] = file.response[this.responseName]
value.responseName = file.response[this.responseName]
}
if (file.status === 'done') {
if (typeof file.response.success === 'boolean') {
if (file.response.success) {
value['path'] = file.response[this.responseName]
value.path = file.response[this.responseName]
this.handleChangeCommon(value)
} else {
value['status'] = 'error'
value['message'] = file.response.message || '未知错误'
value.status = 'error'
value.message = file.response.message || '未知错误'
}
} else {
// 考虑到如果设置action上传路径为非jeecg-boot后台,可能不会返回 success 属性的情况,就默认为成功
value['path'] = file.response[this.responseName]
value.path = file.response[this.responseName]
this.handleChangeCommon(value)
}
} else if (file.status === 'error') {
value['message'] = file.response.message || '未知错误'
value.message = file.response.message || '未知错误'
}
this.innerFile = value
},
@@ -212,14 +212,14 @@
handleClickDeleteFile () {
this.handleChangeCommon(null)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: { visible: true },
getValue: value => JVxeUploadCell.enhanced.getValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value)
}
}
</script>
@@ -78,8 +78,8 @@ export default {
computed: {
/** upload headers */
uploadHeaders () {
let {originColumn: col} = this
let headers = {}
const { originColumn: col } = this
const headers = {}
if (col.token === true) {
headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN)
}
@@ -89,7 +89,7 @@ export default {
/** 上传请求地址 */
uploadAction () {
if (!this.originColumn.action) {
return window._CONFIG['domianURL'] + '/sys/common/upload'
return window._CONFIG.domianURL + '/sys/common/upload'
} else {
return this.originColumn.action
}
@@ -102,10 +102,10 @@ export default {
/** 预览图片地址 */
imgSrc () {
if (this.innerFile) {
if (this.innerFile['url']) {
return this.innerFile['url']
} else if (this.innerFile['path']) {
let path = this.innerFile['path'].split(',')[0]
if (this.innerFile.url) {
return this.innerFile.url
} else if (this.innerFile.path) {
const path = this.innerFile.path.split(',')[0]
return getFileAccessHttpUrl(path)
}
}
@@ -118,7 +118,7 @@ export default {
} else {
return 'message'
}
},
}
},
watch: {
@@ -130,8 +130,8 @@ export default {
} else {
this.innerFile = null
}
},
},
}
}
},
methods: {
@@ -145,8 +145,8 @@ export default {
}
// update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件
if (originColumn && originColumn.fieldExtendJson) {
let json = JSON.parse(originColumn.fieldExtendJson);
this.number = json.uploadnum?json.uploadnum:0;
const json = JSON.parse(originColumn.fieldExtendJson)
this.number = json.uploadnum ? json.uploadnum : 0
}
let path = ''
if (this.innerFile) {
@@ -165,16 +165,16 @@ export default {
// 弹出上传出错详细信息
handleClickShowImageError () {
let file = this.innerFile || null
if (file && file['message']) {
this.$error({title: '上传出错', content: '错误信息:' + file['message'], maskClosable: true})
const file = this.innerFile || null
if (file && file.message) {
this.$error({ title: '上传出错', content: '错误信息:' + file.message, maskClosable: true })
}
},
handleChangeUpload (info) {
let {originColumn: col} = this
let {file} = info
let value = {
const { originColumn: col } = this
const { file } = info
const value = {
name: file.name,
type: file.type,
size: file.size,
@@ -182,24 +182,24 @@ export default {
percent: file.percent
}
if (file.response) {
value['responseName'] = file.response[this.responseName]
value.responseName = file.response[this.responseName]
}
if (file.status === 'done') {
if (typeof file.response.success === 'boolean') {
if (file.response.success) {
value['path'] = file.response[this.responseName]
value.path = file.response[this.responseName]
this.handleChangeCommon(value)
} else {
value['status'] = 'error'
value['message'] = file.response.message || '未知错误'
value.status = 'error'
value.message = file.response.message || '未知错误'
}
} else {
// 考虑到如果设置action上传路径为非jeecg-boot后台,可能不会返回 success 属性的情况,就默认为成功
value['path'] = file.response[this.responseName]
value.path = file.response[this.responseName]
this.handleChangeCommon(value)
}
} else if (file.status === 'error') {
value['message'] = file.response.message || '未知错误'
value.message = file.response.message || '未知错误'
}
this.innerFile = value
},
@@ -212,14 +212,14 @@ export default {
handleClickDeleteFile () {
this.handleChangeCommon(null)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: { visible: true },
getValue: value => JVxeUploadCell.enhanced.getValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value)
}
}
</script>
@@ -23,9 +23,9 @@
destFields: col.destFields,
groupId: caseId,
param: col.param,
sorter: col.sorter,
sorter: col.sorter
}
}
},
},
methods: {
/** popup回调 */
@@ -35,7 +35,7 @@
let popupValue = value
if (others && Object.keys(others).length > 0) {
Object.keys(others).forEach(key => {
let currentValue = others[key]
const currentValue = others[key]
// 当前列直接赋值,其他列通过vModel赋值
if (key === col.key) {
popupValue = currentValue
@@ -45,16 +45,16 @@
})
}
this.handleChangeCommon(popupValue)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
aopEvents: {
editActived (event) {
dispatchEvent.call(this, event, 'ant-input')
},
},
},
}
}
}
}
</script>
@@ -30,7 +30,7 @@
'j-vxe-radio': true,
'no-animation': this.scrolling
}
},
}
},
methods: {
handleRadioClick (item) {
@@ -40,11 +40,11 @@
this.handleChangeCommon(null)
}
}
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: {visible: true},
switches: { visible: true }
}
}
</script>
@@ -15,7 +15,7 @@ const common = {
return {
loading: false,
innerSelectValue: null,
innerOptions: [],
innerOptions: []
}
},
/** 公共计算属性 */
@@ -32,9 +32,9 @@ const common = {
},
// 是否是异步模式
isAsync () {
let isAsync = this.originColumn.async
const isAsync = this.originColumn.async
return (isAsync != null && isAsync !== '') ? !!isAsync : true
},
}
},
/** 公共属性监听 */
watch: {
@@ -62,7 +62,7 @@ const common = {
if (common.labelMap.has(value)) {
this.innerOptions = cloneObject(common.labelMap.get(value))
} else {
let {success, result} = await getAction(`/sys/dict/loadDictItem/${this.dict}`, {key: value})
const { success, result } = await getAction(`/sys/dict/loadDictItem/${this.dict}`, { key: value })
if (success && result && result.length > 0) {
this.innerOptions = [{ value: value, text: result[0] }]
common.labelMap.set(value, cloneObject(this.innerOptions))
@@ -81,31 +81,31 @@ const common = {
// 根据字典Code, 初始化字典数组
let dictStr = ''
if (this.dict) {
let arr = this.dict.split(',')
const arr = this.dict.split(',')
if (arr[0].indexOf('where') > 0) {
let tbInfo = arr[0].split('where')
const tbInfo = arr[0].split('where')
dictStr = tbInfo[0].trim() + ',' + arr[1] + ',' + arr[2] + ',' + encodeURIComponent(tbInfo[1])
} else {
dictStr = this.dict
}
if (this.dict.indexOf(',') === -1) {
// 优先从缓存中读取字典配置
let cache = getDictItemsFromCache(this.dict)
const cache = getDictItemsFromCache(this.dict)
if (cache) {
this.innerOptions = cache
return
}
}
let {success, result} = await ajaxGetDictItems(dictStr, null)
const { success, result } = await ajaxGetDictItems(dictStr, null)
if (success) {
this.innerOptions = result
}
}
}
}
},
}
},
}
}
@@ -115,23 +115,23 @@ export const DictSearchSpanCell = {
mixins: [JVxeCellMixins],
data () {
return {
...common.data.apply(this),
...common.data.apply(this)
}
},
computed: {
...common.computed,
...common.computed
},
watch: {
...common.watch,
...common.watch
},
methods: {
...common.methods,
...common.methods
},
render (h) {
return h('span', {}, [
filterDictText(this.innerOptions, this.innerSelectValue || this.innerValue)
])
},
}
}
// 请求id
@@ -169,10 +169,10 @@ export const DictSearchInputCell = {
return null
}
return (input, option) => option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
watch: {
...common.watch,
...common.watch
},
created () {
this.loadData = debounce(this.loadData, 300)// 消抖
@@ -195,7 +195,7 @@ export const DictSearchInputCell = {
if (currentRequestId !== requestId) {
return
}
let {success, result, message} = res
const { success, result, message } = res
if (success) {
this.innerOptions = result
result.forEach((item) => {
@@ -225,14 +225,14 @@ export const DictSearchInputCell = {
},
renderOptionItem () {
let options = []
const options = []
this.options.forEach(({ value, text, label, title, disabled }) => {
options.push(
<a-select-option key={value} value={value} disabled={disabled}>{text || label || title}</a-select-option>
)
})
return options
},
}
},
render () {
return (
@@ -256,7 +256,7 @@ export const DictSearchInputCell = {
aopEvents: {
editActived (event) {
dispatchEvent.call(this, event, 'ant-select')
},
},
}
}
}
}
+1 -1
View File
@@ -12,7 +12,7 @@
<script>
export default {
name: "Trend",
name: 'Trend',
props: {
prefixCls: {
type: String,
+18 -20
View File
@@ -9,37 +9,37 @@ export default class Area {
*/
constructor (pcaa) {
if (!pcaa) {
pcaa = Vue.prototype.$Jpcaa;
pcaa = Vue.prototype.$Jpcaa
}
let arr = []
const arr = []
const province = pcaa['86']
Object.keys(province).map(key => {
arr.push({id:key, text:province[key], pid:'86', index:1});
const city = pcaa[key];
arr.push({ id: key, text: province[key], pid: '86', index: 1 })
const city = pcaa[key]
Object.keys(city).map(key2 => {
arr.push({id:key2, text:city[key2], pid:key, index:2});
const qu = pcaa[key2];
arr.push({ id: key2, text: city[key2], pid: key, index: 2 })
const qu = pcaa[key2]
if (qu) {
Object.keys(qu).map(key3 => {
arr.push({id:key3, text:qu[key3], pid:key2, index:3});
arr.push({ id: key3, text: qu[key3], pid: key2, index: 3 })
})
}
})
})
this.all = arr;
this.all = arr
}
get pca () {
return this.all;
return this.all
}
getCode (text) {
if (!text || text.length == 0) {
return ''
}
for(let item of this.all){
for (const item of this.all) {
if (item.text === text) {
return item.id;
return item.id
}
}
}
@@ -48,19 +48,19 @@ export default class Area {
if (!code || code.length == 0) {
return ''
}
let arr = []
this.getAreaBycode(code, arr, 3);
const arr = []
this.getAreaBycode(code, arr, 3)
return arr.join('/')
}
getRealCode (code) {
let arr = []
const arr = []
this.getPcode(code, arr, 3)
return arr;
return arr
}
getPcode (id, arr, index) {
for(let item of this.all){
for (const item of this.all) {
if (item.id === id && item.index == index) {
arr.unshift(id)
if (item.pid != '86') {
@@ -71,15 +71,13 @@ export default class Area {
}
getAreaBycode (code, arr, index) {
for(let item of this.all){
for (const item of this.all) {
if (item.id === code && item.index == index) {
arr.unshift(item.text);
arr.unshift(item.text)
if (item.pid != '86') {
this.getAreaBycode(item.pid, arr, --index)
}
}
}
}
}
+3 -3
View File
@@ -37,10 +37,10 @@ export const cutStrByFullLength = (str = '', maxLength) => {
// 下划线转换驼峰
export function underLinetoHump (name) {
return name.replace(/\_(\w)/g, function (all, letter) {
return letter.toUpperCase();
});
return letter.toUpperCase()
})
}
// 驼峰转换下划线
export function humptoUnderLine (name) {
return name.replace(/([A-Z])/g,"_$1").toLowerCase();
return name.replace(/([A-Z])/g, '_$1').toLowerCase()
}
+4 -4
View File
@@ -25,8 +25,8 @@
dataSource: {
type: Array,
default: () => [
{ type: 'JeroOne', 'Jan.': 18.9, 'Feb.': 28.8, 'Mar.': 39.3, 'Apr.': 81.4, 'May': 47, 'Jun.': 20.3, 'Jul.': 24, 'Aug.': 35.6 },
{ type: 'JeroTwo', 'Jan.': 12.4, 'Feb.': 23.2, 'Mar.': 34.5, 'Apr.': 99.7, 'May': 52.6, 'Jun.': 35.5, 'Jul.': 37.4, 'Aug.': 42.4 }
{ type: 'JeroOne', 'Jan.': 18.9, 'Feb.': 28.8, 'Mar.': 39.3, 'Apr.': 81.4, May: 47, 'Jun.': 20.3, 'Jul.': 24, 'Aug.': 35.6 },
{ type: 'JeroTwo', 'Jan.': 12.4, 'Feb.': 23.2, 'Mar.': 34.5, 'Apr.': 99.7, May: 52.6, 'Jun.': 35.5, 'Jul.': 37.4, 'Aug.': 42.4 }
]
},
fields: {
@@ -62,7 +62,7 @@
})
// bar 使用不了 - 和 / 所以替换下
let rows = dv.rows.map(row => {
const rows = dv.rows.map(row => {
if (typeof row.x === 'string') {
row.x = row.x.replace(/[-/]/g, '_')
}
@@ -70,7 +70,7 @@
})
// 替换别名
rows.forEach(row => {
for (let item of this.aliases) {
for (const item of this.aliases) {
if (item.field === row.type) {
row.type = item.alias
break
+30 -30
View File
@@ -45,16 +45,16 @@
</template>
<script>
import { registerShape } from 'viser-vue';
import { registerShape } from 'viser-vue'
registerShape('point', 'pointer', {
draw (cfg, container) {
let point = cfg.points[0];
point = this.parsePoint(point);
let point = cfg.points[0]
point = this.parsePoint(point)
const center = this.parsePoint({
x: 0,
y: 0,
});
y: 0
})
container.addShape('line', {
attrs: {
x1: center.x,
@@ -63,9 +63,9 @@
y2: point.y + 15,
stroke: cfg.color,
lineWidth: 5,
lineCap: 'round',
lineCap: 'round'
}
});
})
return container.addShape('circle', {
attrs: {
x: center.x,
@@ -73,26 +73,26 @@
r: 9.75,
stroke: cfg.color,
lineWidth: 4.5,
fill: '#fff',
fill: '#fff'
}
});
})
}
});
})
const scale = [{
dataKey: 'value',
min: 0,
max: 9,
tickInterval: 1,
nice: false,
}];
nice: false
}]
const data = [
{ value: 7.0 },
];
{ value: 7.0 }
]
export default {
name:"DashChartDemo",
name: 'DashChartDemo',
props: {
datasource: {
type: Number,
@@ -105,20 +105,20 @@
},
created () {
if (!this.datasource) {
this.chartData = data;
this.chartData = data
} else {
this.chartData = [
{ value: this.datasource },
];
{ value: this.datasource }
]
}
this.getChartData()
},
watch: {
'datasource': function (val) {
datasource: function (val) {
this.chartData = [
{ value: val},
];
this.getChartData();
{ value: val }
]
this.getChartData()
}
},
methods: {
@@ -156,23 +156,23 @@
axisSubTickLine: {
length: -8,
stroke: '#fff',
strokeOpacity: 1,
strokeOpacity: 1
},
axisTickLine: {
length: -17,
stroke: '#fff',
strokeOpacity: 1,
strokeOpacity: 1
},
arcGuide1Start: [0, 0.945],
arcGuide1End: [9, 0.945],
arcGuide1Style: {
stroke: '#CBCBCB',
lineWidth: 18,
lineWidth: 18
},
arcGuide2Start: [0, 0.945],
arcGuide2Style: {
stroke: '#1890FF',
lineWidth: 18,
lineWidth: 18
},
htmlGuidePosition: ['50%', '100%'],
htmlGuideHtml: `
@@ -180,8 +180,8 @@
<p style="font-size: 14px;color: #545454;margin: 0;">${this.title}</p>
<p style="font-size: 36px;color: #545454;margin: 0;">${this.abcd}%</p>
</div>
`,
};
},
};
`
}
}
}
</script>
+1 -1
View File
@@ -40,7 +40,7 @@
}]
export default {
name: "Bar",
name: 'Bar',
props: {
title: {
type: String,
@@ -74,10 +74,10 @@
key: 'x',
value: 'y'
})
let rows = dv.rows
const rows = dv.rows
// 替换别名
rows.forEach(row => {
for (let item of this.aliases) {
for (const item of this.aliases) {
if (item.field === row.x) {
row.x = item.alias
break
+2 -2
View File
@@ -9,8 +9,8 @@
</template>
<script>
const DataSet = require('@antv/data-set')
import { ChartEventMixins } from './mixins/ChartMixins'
const DataSet = require('@antv/data-set')
export default {
name: 'Pie',
@@ -55,7 +55,7 @@
},
computed: {
data () {
let dv = new DataSet.View().source(this.dataSource)
const dv = new DataSet.View().source(this.dataSource)
// 计算数据百分比
dv.transform({
type: 'percent',
+1 -1
View File
@@ -13,7 +13,7 @@
<script>
export default {
name: "RankList",
name: 'RankList',
// ['title', 'list']
props: {
title: {
+9 -9
View File
@@ -12,7 +12,7 @@
</template>
<script>
const DataSet = require('@antv/data-set');
const DataSet = require('@antv/data-set')
export default {
name: 'StackBar',
@@ -21,10 +21,10 @@
type: Array,
required: true,
default: () => [
{ 'State': '请假', '流转中': 25, '已归档': 18 },
{ 'State': '出差', '流转中': 30, '已归档': 20 },
{ 'State': '加班', '流转中': 38, '已归档': 42},
{ 'State': '用车', '流转中': 51, '已归档': 67}
{ State: '请假', 流转中: 25, 已归档: 18 },
{ State: '出差', 流转中: 30, 已归档: 20 },
{ State: '加班', 流转中: 38, 已归档: 42 },
{ State: '用车', 流转中: 51, 已归档: 67 }
]
},
height: {
@@ -39,15 +39,15 @@
},
computed: {
data () {
const dv = new DataSet.View().source(this.dataSource);
const dv = new DataSet.View().source(this.dataSource)
dv.transform({
type: 'fold',
fields: ['流转中', '已归档'],
key: '流程状态',
value: '流程数量',
retains: ['State'],
});
return dv.rows;
retains: ['State']
})
return dv.rows
}
}
}
+3 -3
View File
@@ -8,7 +8,7 @@
<script>
export default {
name: "Trend",
name: 'Trend',
props: {
// 同title
term: {
@@ -45,8 +45,8 @@
}
},
created () {
let type = this.type === null ? this.value >= this.target : this.type
this.trend = type ? 'up' : 'down';
const type = this.type === null ? this.value >= this.target : this.type
this.trend = type ? 'up' : 'down'
this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
}
}
@@ -5,6 +5,6 @@ export const ChartEventMixins = {
},
handleEvent (eventName, event, chart) {
this.$emit(eventName, event, chart)
},
}
}
}
+13 -13
View File
@@ -21,7 +21,7 @@
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default {
name: "JDictSelectTag",
name: 'JDictSelectTag',
props: {
dictCode: String,
placeholder: String,
@@ -36,7 +36,7 @@
data () {
return {
dictOptions: [],
tagType:""
tagType: ''
}
},
watch: {
@@ -44,12 +44,12 @@
immediate: true,
handler () {
this.initDictData()
},
}
}
},
created () {
if(!this.type || this.type==="list"){
this.tagType = "select"
if (!this.type || this.type === 'list') {
this.tagType = 'select'
} else {
this.tagType = this.type
}
@@ -58,36 +58,36 @@
getValueSting () {
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
// 当有null或“” placeholder不显示
return this.value != null ? this.value.toString() : undefined;
return this.value != null ? this.value.toString() : undefined
// update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
},
}
},
methods: {
initDictData () {
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) {
this.dictOptions = getDictItemsFromCache(this.dictCode);
this.dictOptions = getDictItemsFromCache(this.dictCode)
return
}
// 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
this.dictOptions = res.result;
this.dictOptions = res.result
}
})
},
handleInput (e = '') {
let val;
let val
if (Object.keys(e).includes('target')) {
val = e.target.value
} else {
val = e
}
console.log(val);
this.$emit('change', val);
console.log(val)
this.$emit('change', val)
// 解决数据规则,选择自定义SQL 规则值无法输入空格
this.$emit('input', val);
this.$emit('input', val)
},
setCurrentDictOptions (dictOptions) {
this.dictOptions = dictOptions
+27 -27
View File
@@ -14,18 +14,18 @@ import {getAction} from '@/api/manage'
*/
export async function initDictOptions (dictCode) {
if (!dictCode) {
return '字典Code不能为空!';
return '字典Code不能为空!'
}
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(dictCode)) {
let res = {}
res.result = getDictItemsFromCache(dictCode);
res.success = true;
return res;
const res = {}
res.result = getDictItemsFromCache(dictCode)
res.success = true
return res
}
// 获取字典数组
let res = await ajaxGetDictItems(dictCode);
return res;
const res = await ajaxGetDictItems(dictCode)
return res
}
/**
@@ -37,7 +37,7 @@ export async function initDictOptions(dictCode) {
export function filterDictText (dictOptions, text) {
// --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---
if (text != null && Array.isArray(dictOptions)) {
let result = []
const result = []
// 允许多个逗号分隔,允许传数组对象
let splitText
if (Array.isArray(text)) {
@@ -45,9 +45,9 @@ export function filterDictText(dictOptions, text) {
} else {
splitText = text.toString().trim().split(',')
}
for (let txt of splitText) {
for (const txt of splitText) {
let dictText = txt
for (let dictItem of dictOptions) {
for (const dictItem of dictOptions) {
if (txt.toString() === dictItem.value.toString()) {
dictText = (dictItem.text || dictItem.title || dictItem.label)
break
@@ -71,7 +71,7 @@ export function filterMultiDictText(dictOptions, text) {
// js “!text” 认为0为空,所以做提前处理
if (text === 0 || text === '0') {
if (dictOptions) {
for (let dictItem of dictOptions) {
for (const dictItem of dictOptions) {
if (text == dictItem.value) {
return dictItem.text
}
@@ -80,25 +80,25 @@ export function filterMultiDictText(dictOptions, text) {
}
if (!text || text == 'null' || !dictOptions || dictOptions.length == 0) {
return ""
return ''
}
let re = "";
let re = ''
text = text.toString()
let arr = text.split(",")
const arr = text.split(',')
dictOptions.forEach(function (option) {
if (option) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] === option.value) {
re += option.text+",";
break;
re += option.text + ','
break
}
}
}
});
if(re==""){
return text;
})
if (re == '') {
return text
}
return re.substring(0,re.length-1);
return re.substring(0, re.length - 1)
}
/**
@@ -108,16 +108,16 @@ export function filterMultiDictText(dictOptions, text) {
*/
export function filterDictTextByCache (dictCode, key) {
if (key == null || key.length == 0) {
return;
return
}
if (!dictCode) {
return '字典Code不能为空!';
return '字典Code不能为空!'
}
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(dictCode)) {
let item = getDictItemsFromCache(dictCode).filter(t => t["value"] == key)
const item = getDictItemsFromCache(dictCode).filter(t => t.value == key)
if (item && item.length > 0) {
return item[0]["text"]
return item[0].text
}
}
}
@@ -126,14 +126,14 @@ export function filterDictTextByCache(dictCode, key) {
export async function getDictItems (dictCode, params) {
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(dictCode)) {
let desformDictItems = getDictItemsFromCache(dictCode).map(item => ({...item, label: item.text}))
return desformDictItems;
const desformDictItems = getDictItemsFromCache(dictCode).map(item => ({ ...item, label: item.text }))
return desformDictItems
}
// 缓存中没有,就请求后台
return await ajaxGetDictItems(dictCode, params).then(({ success, result }) => {
if (success) {
let res = result.map(item => ({...item, label: item.text}))
const res = result.map(item => ({ ...item, label: item.text }))
console.log('------- 从DB中获取到了字典-------dictCode : ', dictCode, res)
return Promise.resolve(res)
} else {
@@ -39,18 +39,18 @@
type: String,
default: '',
required: false
},
}
},
data () {
return {
dictOptions: [],
tagType:"",
tagType: '',
arrayValue: !this.value ? [] : this.value.split(this.spliter)
}
},
created () {
if(!this.type || this.type==="list_multi"){
this.tagType = "select"
if (!this.type || this.type === 'list_multi') {
this.tagType = 'select'
} else {
this.tagType = this.type
}
@@ -67,7 +67,7 @@
immediate: true,
handler () {
this.initDictData()
},
}
},
value (val) {
if (!val) {
@@ -83,7 +83,7 @@
this.dictOptions = [...this.options]
} else {
// 优先从缓存中读取字典配置
let cacheOption = getDictItemsFromCache(this.dictCode)
const cacheOption = getDictItemsFromCache(this.dictCode)
if (cacheOption && cacheOption.length > 0) {
this.dictOptions = cacheOption
return
@@ -91,15 +91,14 @@
// 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
this.dictOptions = res.result;
this.dictOptions = res.result
}
})
}
},
onChange (selectedValue) {
this.arrayValue = selectedValue;
this.$emit('change', selectedValue.join(this.spliter));
this.arrayValue = selectedValue
this.$emit('change', selectedValue.join(this.spliter))
},
getParentContainer (node) {
if (!this.popContainer) {
@@ -40,7 +40,7 @@
<script>
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
import debounce from 'lodash/debounce';
import debounce from 'lodash/debounce'
import { getAction } from '../../api/manage'
export default {
@@ -53,7 +53,7 @@
async: Boolean,
placeholder: {
type: String,
default:"请选择",
default: '请选择',
required: false
},
popContainer: {
@@ -69,23 +69,23 @@
getPopupContainer: {
type: Function,
default: null
},
}
},
data () {
this.loadData = debounce(this.loadData, 800);//消抖
this.lastLoad = 0;
this.loadData = debounce(this.loadData, 800)// 消抖
this.lastLoad = 0
return {
loading: false,
selectedValue: [],
selectedAsyncValue: [],
options: [],
options: []
}
},
created () {
this.initDictData();
this.initDictData()
},
watch: {
"value":{
value: {
immediate: true,
handler (val) {
if (!val) {
@@ -100,12 +100,12 @@
}
}
},
"dict":{
dict: {
handler () {
this.initDictData()
}
},
'dictOptions':{
dictOptions: {
deep: true,
handler (val) {
if (val && val.length > 0) {
@@ -118,10 +118,10 @@
initSelectValue () {
if (this.async) {
if (!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key != this.value) {
console.log("这才请求后台")
console.log('这才请求后台')
getAction(`/sys/dict/loadDictItem/${this.dict}`, { key: this.value }).then(res => {
if (res.success) {
let obj = {
const obj = {
key: this.value,
label: res.result
}
@@ -134,7 +134,7 @@
}
},
loadData (value) {
console.log("数据加载",value)
console.log('数据加载', value)
this.lastLoad += 1
const currentLoad = this.lastLoad
this.options = []
@@ -147,13 +147,11 @@
return
}
this.options = res.result
console.log("我是第一个",res)
console.log('我是第一个', res)
} else {
this.$message.warning(res.message)
}
})
},
initDictData () {
if (!this.async) {
@@ -164,23 +162,23 @@
// 根据字典Code, 初始化字典数组
let dictStr = ''
if (this.dict) {
let arr = this.dict.split(',')
const arr = this.dict.split(',')
if (arr[0].indexOf('where') > 0) {
let tbInfo = arr[0].split('where')
const tbInfo = arr[0].split('where')
dictStr = tbInfo[0].trim() + ',' + arr[1] + ',' + arr[2] + ',' + encodeURIComponent(tbInfo[1])
} else {
dictStr = this.dict
}
if (this.dict.indexOf(",") == -1) {
if (this.dict.indexOf(',') == -1) {
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) {
this.options = getDictItemsFromCache(this.dictCode);
this.options = getDictItemsFromCache(this.dictCode)
return
}
}
ajaxGetDictItems(dictStr, null).then((res) => {
if (res.success) {
this.options = res.result;
this.options = res.result
}
})
}
@@ -202,7 +200,7 @@
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
handleChange (selectedValue) {
console.log("selectedValue",selectedValue)
console.log('selectedValue', selectedValue)
this.selectedValue = selectedValue
this.callback()
},
@@ -215,13 +213,13 @@
this.selectedAsyncValue = null
this.selectedValue = null
this.options = null
this.loadData("")
this.loadData('')
}
this.callback()
// update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
},
callback () {
this.$emit('change', this.selectedValue);
this.$emit('change', this.selectedValue)
},
setCurrentDictOptions (dictOptions) {
this.options = dictOptions
@@ -237,7 +235,7 @@
} else {
return document.querySelector(this.popContainer)
}
},
}
},
model: {
+3 -3
View File
@@ -5,9 +5,9 @@ import { filterMultiDictText,filterDictText,initDictOptions,filterDictTextByCach
export default {
install: function (Vue) {
Vue.component('JDictSelectTag',JDictSelectTag);
Vue.component('JMultiSelectTag',JMultiSelectTag);
Vue.component('JSearchSelectTag',JSearchSelectTag);
Vue.component('JDictSelectTag', JDictSelectTag)
Vue.component('JMultiSelectTag', JMultiSelectTag)
Vue.component('JSearchSelectTag', JSearchSelectTag)
Vue.prototype.$initDictOptions = (dictCode) => initDictOptions(dictCode)
Vue.prototype.$filterMultiDictText = (dictOptions, text) => filterMultiDictText(dictOptions, text)
Vue.prototype.$filterDictText = (dictOptions, text) => filterDictText(dictOptions, text)
+14 -14
View File
@@ -64,7 +64,7 @@
},
computed: {
_listeners () {
let listeners = { ...this.$listeners }
const listeners = { ...this.$listeners }
// 去掉已使用的事件,防止冲突
this.usedListeners.forEach(key => {
delete listeners[key]
@@ -78,7 +78,7 @@
console.error(`JAreaLinkage的type属性只能接收指定的值(${this.enums.type.join('|')})`)
return this.enums.type[0]
}
},
}
},
watch: {
value: {
@@ -86,10 +86,10 @@
handler () {
this.loadDataByValue(this.value)
}
},
}
},
created () {
this.initAreaData();
this.initAreaData()
},
methods: {
@@ -105,19 +105,19 @@
this.innerValue = []
} else {
this.initAreaData()
let arr = this.areaData.getRealCode(value)
const arr = this.areaData.getRealCode(value)
this.innerValue = arr
}
this.reload()
},
/** 通过地区code获取子级 */
loadDataByCode (value) {
let options = []
let data = this.pcaa[value]
const options = []
const data = this.pcaa[value]
if (data) {
for (let key in data) {
for (const key in data) {
if (data.hasOwnProperty(key)) {
options.push({ value: key, label: data[key], })
options.push({ value: key, label: data[key] })
}
}
return options
@@ -128,22 +128,22 @@
/** 判断是否有子节点 */
hasChildren (options) {
options.forEach(option => {
let data = this.loadDataByCode(option.value)
const data = this.loadDataByCode(option.value)
option.isLeaf = data.length === 0
})
},
handleChange (values) {
let value = values[values.length - 1]
const value = values[values.length - 1]
this.$emit('change', value)
},
initAreaData () {
if (!this.areaData) {
this.areaData = new Area(this.$Jpcaa);
this.areaData = new Area(this.$Jpcaa)
}
}
},
},
model: { prop: 'value', event: 'change' },
model: { prop: 'value', event: 'change' }
}
</script>
@@ -44,7 +44,7 @@
// 是否支持多选
multiple: {
type: Boolean,
default: false,
default: false
},
loadTriggleChange: {
type: Boolean,
@@ -69,13 +69,13 @@
},
data () {
return {
treeValue:"",
treeValue: '',
treeData: [],
url:"/sys/category/loadTreeData",
url: '/sys/category/loadTreeData',
view: '/sys/category/loadDictItem/',
tableName:"",
text:"",
code:"",
tableName: '',
text: '',
code: ''
}
},
@@ -87,12 +87,12 @@
},
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
@@ -100,7 +100,7 @@
this.loadItemByCode()
},
pCode () {
this.loadRoot();
this.loadRoot()
}
},
created () {
@@ -112,14 +112,14 @@
methods: {
/** 加载一级节点 */
loadRoot () {
let param = {
const param = {
pid: this.pid,
pcode: !this.pCode ? '0' : this.pCode,
condition: this.condition
}
getAction(this.url, param).then(res => {
if (res.success && res.result) {
for(let i of res.result){
for (const i of res.result) {
i.value = i.key
if (i.leaf == false) {
i.isLeaf = false
@@ -129,26 +129,26 @@
}
this.treeData = [...res.result]
} else {
console.log("树一级节点查询结果-else",res)
console.log('树一级节点查询结果-else', res)
}
})
},
/** 数据回显 */
loadItemByCode () {
if(!this.value || this.value=="0"){
if (!this.value || this.value == '0') {
this.treeValue = []
} else {
getAction(this.view, { ids: this.value }).then(res => {
if (res.success) {
if (res.result && res.result.length > 0) {
let values = this.value.split(',')
const values = this.value.split(',')
this.treeValue = res.result.map((item, index) => ({
key: values[index],
value: values[index],
label: item
}))
this.onLoadTriggleChange(res.result[0]);
this.onLoadTriggleChange(res.result[0])
}
}
})
@@ -161,7 +161,7 @@
}
},
backValue (value, label) {
let obj = {}
const obj = {}
if (this.back) {
obj[this.back] = label
}
@@ -176,14 +176,14 @@
resolve()
return
}
let pid = treeNode.$vnode.key
let param = {
const pid = treeNode.$vnode.key
const param = {
pid: pid,
condition: this.condition
}
getAction(this.url, param).then(res => {
if (res.success) {
for(let i of res.result){
for (const i of res.result) {
i.value = i.key
if (i.leaf == false) {
i.isLeaf = false
@@ -200,7 +200,7 @@
},
addChildren (pid, children, treeArray) {
if (treeArray && treeArray.length > 0) {
for(let item of treeArray){
for (const item of treeArray) {
if (item.key == pid) {
if (!children || children.length == 0) {
item.isLeaf = true
@@ -220,11 +220,11 @@
/*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题:change事件会执行两遍
* 解决办法:改变选中时提交的事件名 */
this.$emit('change', '');
this.$emit('change', '')
this.treeValue = ''
} else if (Array.isArray(value)) {
let labels = []
let values = value.map(item => {
const labels = []
const values = value.map(item => {
labels.push(item.label)
return item.value
})
@@ -239,21 +239,21 @@
return this.treeData
},
validateProp () {
let myCondition = this.condition
const myCondition = this.condition
return new Promise((resolve, reject) => {
if (!myCondition) {
resolve();
}else{
try {
let test=JSON.parse(myCondition);
if(typeof test == 'object' && test){
resolve()
} else {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
try {
const test = JSON.parse(myCondition)
if (typeof test === 'object' && test) {
resolve()
} else {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
} catch (e) {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
}
+4 -4
View File
@@ -21,7 +21,7 @@
},
data () {
return {
checkboxArray:!this.value?[]:this.value.split(",")
checkboxArray: !this.value ? [] : this.value.split(',')
}
},
watch: {
@@ -29,14 +29,14 @@
if (!val) {
this.checkboxArray = []
} else {
this.checkboxArray = this.value.split(",")
this.checkboxArray = this.value.split(',')
}
}
},
methods: {
onChange (checkedValues) {
this.$emit('change', checkedValues.join(","));
},
this.$emit('change', checkedValues.join(','))
}
},
model: {
prop: 'value',
+9 -9
View File
@@ -196,7 +196,7 @@
// 尝试从父容器获取语法类型
if (language) {
// 获取具体的语法类型对象
let modeObj = this._getLanguage(language)
const modeObj = this._getLanguage(language)
// 判断父容器传入的语法是否被支持
if (modeObj) {
@@ -243,7 +243,7 @@
return autoHeight
},
fullScreenParentProps () {
let props = {
const props = {
class: {
'full-screen-parent': true,
'full-screen': this.fullCoder,
@@ -252,13 +252,13 @@
style: {}
}
if (isIE() || isIE11()) {
props.style['height'] = '240px'
props.style.height = '240px'
}
if (this.fullCoder) {
props.style['z-index'] = this.zIndex
}
if (!this.isAutoHeight) {
props.style['height'] = (typeof this.height === 'number' ? this.height + 'px' : this.height)
props.style.height = (typeof this.height === 'number' ? this.height + 'px' : this.height)
}
return props
}
@@ -325,16 +325,16 @@
// 在支持的语法类型列表中寻找传入的语法类型
return this.modes.find((mode) => {
// 所有的值都忽略大小写,方便比较
let currentLanguage = language.toLowerCase()
let currentLabel = mode.label.toLowerCase()
let currentValue = mode.value.toLowerCase()
const currentLanguage = language.toLowerCase()
const currentLabel = mode.label.toLowerCase()
const currentValue = mode.value.toLowerCase()
// 由于真实值可能不规范,例如 java 的真实值是 x-java ,所以讲 value 和 label 同时和传入语法进行比较
return currentLabel === currentLanguage || currentValue === currentLanguage
})
},
_getCoder () {
let _this = this
const _this = this
return new Promise((resolve) => {
(function get () {
if (_this.coder) {
@@ -351,7 +351,7 @@
this.coder.setOption('mode', `text/${val}`)
// 获取修改后的语法
let label = this._getLanguage(val).label.toLowerCase()
const label = this._getLanguage(val).label.toLowerCase()
// 允许父容器通过以下函数监听当前的语法值
this.$emit('language-change', label)
+6 -6
View File
@@ -8,7 +8,7 @@
</div>
</template>
<script>
import JCronModal from "./modal/JCronModal";
import JCronModal from './modal/JCronModal'
export default {
name: 'JCron',
components: {
@@ -17,12 +17,12 @@
props: {
value: {
required: false,
type: String,
type: String
}
},
data () {
return {
cron: this.value,
cron: this.value
}
},
watch: {
@@ -32,11 +32,11 @@
},
methods: {
openModal () {
this.$refs.innerVueCron.show();
this.$refs.innerVueCron.show()
},
handleOK (val) {
this.cron = val;
this.$emit("change", this.cron);
this.cron = val
this.$emit('change', this.cron)
// this.$emit("change", Object.assign({}, this.cron));
},
handleEmpty () {
+9 -9
View File
@@ -97,7 +97,7 @@
}
},
data () {
let dateStr = this.value;
const dateStr = this.value
return {
yearShowOne: false, // 控制年份模态框的显示与否
year: '', // mode==“year” 专用
@@ -107,17 +107,17 @@
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
value (val) {
let fm = this.dateFormat
const fm = this.dateFormat
moment.prototype.toJSON = function () {
return moment(this).format(fm)
}
@@ -131,7 +131,7 @@
methods: {
moment,
handleDateChange (mom, dateStr) {
this.$emit('change', dateStr);
this.$emit('change', dateStr)
},
handleMonthChange (mom, dateStr) {
this.$emit('change', dateStr)
@@ -146,7 +146,7 @@
// 得到年份选择器的值
panelChangeOne (value) {
this.yearShowOne = false
let year = moment(value,this.dateFormat).year().toString() // 处理成字符串
const year = moment(value, this.dateFormat).year().toString() // 处理成字符串
this.year = value // 组件显示的
this.$emit('change', year)
}
@@ -125,12 +125,12 @@ export default {
week: '?',
year: '*',
inputValues: { second: '', minute: '', hour: '', day: '', month: '', week: '', year: '', cron: '' },
preTimeList: '执行预览,会忽略年份参数',
preTimeList: '执行预览,会忽略年份参数'
}
},
computed: {
cronValue_c () {
let result = []
const result = []
if (!this.hideSecond) result.push(this.second ? this.second : '*')
result.push(this.minute ? this.minute : '*')
result.push(this.hour ? this.hour : '*')
@@ -149,7 +149,7 @@ export default {
vs[5] = this.convertQuartzWeekToCParser(vs[5])
}
return vs.slice(0, vs.length - 1).join(' ')
},
}
},
watch: {
cronValue (newVal, oldVal) {
@@ -195,7 +195,7 @@ export default {
if (this.month === '*') {
this.month = '1'
}
},
}
},
created () {
this.formatValue()
@@ -213,7 +213,7 @@ export default {
month: this.month,
week: this.week,
year: this.year,
cron: this.cronValue_c,
cron: this.cronValue_c
})
},
formatValue () {
@@ -263,12 +263,12 @@ export default {
},
onInputCronBlur (event) {
this.$emit('change', event.target.value)
},
}
},
model: {
prop: 'cronValue',
event: 'change'
},
}
}
</script>
@@ -66,7 +66,7 @@ export default {
data () {
return {
editCronValue: this.cronValue,
show: false,
show: false
}
},
watch: {
@@ -1,11 +1,11 @@
export const WEEK_MAP_EN = {
'SUN': '1',
'MON': '2',
'TUE': '3',
'WED': '4',
'THU': '5',
'FRI': '6',
'SAT': '7'
SUN: '1',
MON: '2',
TUE: '3',
WED: '4',
THU: '5',
FRI: '6',
SAT: '7'
}
export const replaceWeekName = (c) => {
@@ -68,7 +68,7 @@ export default {
},
computed: {
value_c () {
let result = []
const result = []
switch (this.type) {
case TYPE_NOT_SET:
result.push('?')
@@ -102,12 +102,12 @@ export default {
},
// 指定值范围区间,介于最小值和最大值之间
specifyRange () {
let range = []
const range = []
for (let i = this.minValue; i <= this.maxValue; i++) {
range.push(i)
}
return range
},
}
},
methods: {
parseProp (value) {
@@ -51,14 +51,14 @@ import mixin from './mixin'
import { replaceWeekName, WEEK_MAP_EN } from './const.js'
const WEEK_MAP = {
'周一': 2,
'周二': 3,
'周三': 4,
'周四': 5,
'周五': 6,
'周六': 7,
周一: 2,
周二: 3,
周三: 4,
周四: 5,
周五: 6,
周六: 7,
// 按照国人习惯,将周日放到每周的最后一天
'周日': 1,
周日: 1
}
export default {
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -69,17 +69,17 @@
menubar: false,
toolbar_drawer: false,
images_upload_handler: (blobInfo, success) => {
let formData = new FormData()
formData.append('file', blobInfo.blob(), blobInfo.filename());
formData.append('biz', "jeditor");
formData.append("jeditor","1");
uploadAction(window._CONFIG['domianURL']+"/sys/common/upload", formData).then((res) => {
const formData = new FormData()
formData.append('file', blobInfo.blob(), blobInfo.filename())
formData.append('biz', 'jeditor')
formData.append('jeditor', '1')
uploadAction(window._CONFIG.domianURL + '/sys/common/upload', formData).then((res) => {
if (res.success) {
if (res.message == 'local') {
const img = 'data:image/jpeg;base64,' + blobInfo.base64()
success(img)
} else {
let img = getFileAccessHttpUrl(res.message)
const img = getFileAccessHttpUrl(res.message)
success(img)
}
}
@@ -87,7 +87,7 @@
}
},
myValue: this.value,
reloading: false,
reloading: false
}
},
mounted () {
@@ -116,11 +116,11 @@
*/
initATabsChangeAutoReload () {
// 获取父级
let tabs = getVmParentByName(this, 'ATabs')
let tabPane = getVmParentByName(this, 'ATabPane')
const tabs = getVmParentByName(this, 'ATabs')
const tabPane = getVmParentByName(this, 'ATabPane')
if (tabs && tabPane) {
// 用户自定义的 key
let currentKey = tabPane.$vnode.key
const currentKey = tabPane.$vnode.key
// 添加事件监听
tabs.$on('change', (key) => {
// 切换到自己时执行reload
@@ -133,7 +133,7 @@
// update--end--autor:liusq-----date:20210316------for:富文本编辑器tab父组件可能导致的赋值问题------
} else {
// update--begin--autor:wangshuai-----date:20200724------for:富文本编辑器切换tab无法修改------
let tabLayout = getVmParentByName(this, 'TabLayout')
const tabLayout = getVmParentByName(this, 'TabLayout')
// update--begin--autor:liusq-----date:20210713------for:处理特殊情况excuteCallback不能使用------
try {
tabLayout.excuteCallback(() => {
@@ -147,7 +147,7 @@
// update--end--autor:liusq-----date:20210713------for:处理特殊情况excuteCallback不能使用------
// update--begin--autor:wangshuai-----date:20200724------for:文本编辑器切换tab无法修改------
}
},
}
},
watch: {
+2 -2
View File
@@ -16,12 +16,12 @@
props: {
value: {
type: String,
required: false,
required: false
},
length: {
type: Number,
required: false,
default: 25,
default: 25
}
}
}
@@ -30,7 +30,7 @@
}
},
mounted () {
console.log("我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用")
console.log('我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用')
}
}
</script>
+42 -42
View File
@@ -28,36 +28,36 @@
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage'
const Base64 = require('js-base64').Base64
const uidGenerator = () => {
return '-'+parseInt(Math.random()*10000+1,10);
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
export default {
name: 'JImageUpload',
data () {
return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
uploadAction: window._CONFIG.domianURL + '/sys/common/upload',
uploadLoading: false,
picUrl: false,
headers: {},
fileList: [],
previewImage:"",
previewImage: ''
}
},
props: {
text: {
type: String,
required: false,
default:"上传"
default: '上传'
},
/* 这个属性用于控制文件上传的业务路径 */
bizPath: {
type: String,
required: false,
default:"temp"
default: 'temp'
},
value: {
type: [String, Array],
@@ -84,12 +84,12 @@
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
@@ -101,7 +101,7 @@
this.initFileList(val)
}
if (!val || val.length == 0) {
this.picUrl = false;
this.picUrl = false
}
},
// 立刻执行handler
@@ -109,27 +109,27 @@
}
},
created () {
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token}
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
},
methods: {
initFileList (paths) {
if (!paths || paths.length == 0) {
this.fileList = [];
return;
this.fileList = []
return
}
this.picUrl = true;
let fileList = [];
let arr = paths.split(",")
this.picUrl = true
const fileList = []
const arr = paths.split(',')
for (var a = 0; a < arr.length; a++) {
let url = getFileAccessHttpUrl(arr[a]);
const url = getFileAccessHttpUrl(arr[a])
fileList.push({
uid: uidGenerator(),
name: arr[a],
status: 'done',
url: url,
response: {
status:"history",
status: 'history',
message: arr[a]
}
})
@@ -138,33 +138,33 @@
this.fileList = fileList
},
beforeUpload: function (file) {
var fileType = file.type;
var fileType = file.type
if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片');
return false;
this.$message.warning('请上传图片')
return false
}
},
handleChange (info) {
this.picUrl = false;
this.picUrl = false
let fileList = info.fileList
// update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
if (this.number > 0) {
fileList = fileList.slice(-this.number);
fileList = fileList.slice(-this.number)
}
// update-end-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
if (info.file.status === 'done') {
if (info.file.response.success) {
this.picUrl = true;
this.picUrl = true
fileList = fileList.map((file) => {
if (file.response) {
file.url = `${file.response.result.id}`;
file.url = `${file.response.result.id}`
}
return file;
});
return file
})
}
// this.$message.success(`${info.file.name} 上传成功!`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`);
this.$message.error(`${info.file.name} 上传失败.`)
} else if (info.file.status === 'removed') {
this.handleDelete(info.file)
}
@@ -176,24 +176,24 @@
// 预览
handlePreview (file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/${file.url}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
var fileFullUrl = `${window._CONFIG.domianWebSocketURL}/${file.url}`
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
},
getAvatarView () {
if (this.fileList.length > 0) {
let url = this.fileList[this.fileList.length-1].url
const url = this.fileList[this.fileList.length - 1].url
return getFileAccessHttpUrl(url)
}
},
handlePathChange () {
let uploadFiles = this.fileList
const uploadFiles = this.fileList
let path = ''
if (!uploadFiles || uploadFiles.length == 0) {
path = ''
}
let arr = [];
const arr = []
if (!this.isMultiple && uploadFiles && uploadFiles.length > 0) {
arr.push(uploadFiles[uploadFiles.length - 1].url)
} else {
@@ -202,26 +202,26 @@
if (uploadFiles[a].status === 'done') {
arr.push(uploadFiles[a].url)
} else {
return;
return
}
// update-end-author:taoyan date:20200819 for:【开源问题z】上传图片组件 LOWCOD-783
}
}
if (arr.length > 0) {
path = arr.join(",")
path = arr.join(',')
}
this.$emit('change', path);
this.$emit('change', path)
},
handleDelete (file) {
// 如有需要新增 删除逻辑
},
handleCancel () {
this.close();
this.previewVisible = false;
this.close()
this.previewVisible = false
},
close () {
},
}
},
model: {
prop: 'value',
+13 -13
View File
@@ -67,13 +67,13 @@
watch: {
url (val) {
if (val) {
this.uploadAction = window._CONFIG['domianURL']+val
this.uploadAction = window._CONFIG.domianURL + val
}
}
},
created () {
console.log(this.$attrs)
this.uploadAction = window._CONFIG['domianURL']+this.url
this.uploadAction = window._CONFIG.domianURL + this.url
},
methods: {
handleClose () {
@@ -83,30 +83,30 @@
this.fileList = []
this.uploading = false
this.visible = true
this.foreignKeys = arg;
this.foreignKeys = arg
},
handleRemove (file) {
const index = this.fileList.indexOf(file);
const newFileList = this.fileList.slice();
newFileList.splice(index, 1);
const index = this.fileList.indexOf(file)
const newFileList = this.fileList.slice()
newFileList.splice(index, 1)
this.fileList = newFileList
},
beforeUpload (file) {
this.fileList = [...this.fileList, file]
return false;
return false
},
handleImport () {
const { fileList } = this;
const formData = new FormData();
const { fileList } = this
const formData = new FormData()
if (this.biz) {
formData.append('isSingleTableImport',this.biz);
formData.append('isSingleTableImport', this.biz)
}
if (this.foreignKeys && this.foreignKeys.length > 0) {
formData.append('foreignKeys',this.foreignKeys);
formData.append('foreignKeys', this.foreignKeys)
}
fileList.forEach((file) => {
formData.append('files[]', file);
});
formData.append('files[]', file)
})
this.uploading = true
postAction(this.uploadAction, formData).then((res) => {
this.uploading = false
+30 -30
View File
@@ -11,10 +11,10 @@
import { Input } from 'ant-design-vue'
const JINPUT_QUERY_LIKE = 'like';
const JINPUT_QUERY_NE = 'ne';
const JINPUT_QUERY_GE = 'ge'; //大于等于
const JINPUT_QUERY_LE = 'le'; //小于等于
const JINPUT_QUERY_LIKE = 'like'
const JINPUT_QUERY_NE = 'ne'
const JINPUT_QUERY_GE = 'ge' // 大于等于
const JINPUT_QUERY_LE = 'le' // 小于等于
export default {
name: 'JInput',
@@ -38,7 +38,7 @@
type: Boolean,
required: false,
default: true
},
}
},
data () {
return {
@@ -48,25 +48,25 @@
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
value: {
immediate: true,
handler: function () {
this.initVal();
this.initVal()
}
},
// 当 type 变化的时候重新计算值
type () {
this.backValue({ target: { value: this.inputVal } })
},
}
},
methods: {
initVal () {
@@ -77,19 +77,19 @@
switch (this.type) {
case JINPUT_QUERY_LIKE:
// 修复路由传参的值传送到jinput框被前后各截取了一位 #1336
if(text.indexOf("*") != -1){
text = text.substring(1,text.length-1);
if (text.indexOf('*') != -1) {
text = text.substring(1, text.length - 1)
}
break;
break
case JINPUT_QUERY_NE:
text = text.substring(1);
break;
text = text.substring(1)
break
case JINPUT_QUERY_GE:
text = text.substring(2);
break;
text = text.substring(2)
break
case JINPUT_QUERY_LE:
text = text.substring(2);
break;
text = text.substring(2)
break
default:
}
this.inputVal = text
@@ -102,20 +102,20 @@
}
switch (this.type) {
case JINPUT_QUERY_LIKE:
text = "*"+text+"*";
break;
text = '*' + text + '*'
break
case JINPUT_QUERY_NE:
text = "!"+text;
break;
text = '!' + text
break
case JINPUT_QUERY_GE:
text = ">="+text;
break;
text = '>=' + text
break
case JINPUT_QUERY_LE:
text = "<="+text;
break;
text = '<=' + text
break
default:
}
this.$emit('change', text);
this.$emit('change', text)
}
},
model: {
@@ -27,10 +27,10 @@
<script>
import 'codemirror/lib/codemirror.css'
import '@toast-ui/editor/dist/toastui-editor.css';
import '@toast-ui/editor/dist/i18n/zh-cn';
import '@toast-ui/editor/dist/toastui-editor.css'
import '@toast-ui/editor/dist/i18n/zh-cn'
import Editor from '@toast-ui/editor';
import Editor from '@toast-ui/editor'
import defaultOptions from './default-options'
import JUpload from '@/components/jero/JUpload'
import { getFileAccessHttpUrl } from '@/api/manage'
@@ -38,7 +38,7 @@ import { getFileAccessHttpUrl } from '@/api/manage'
export default {
name: 'JMarkdownEditor',
components: {
JUpload,
JUpload
},
props: {
value: {
@@ -77,14 +77,14 @@ export default {
return {
editor: null,
isShow: false,
activeIndex:"1",
activeIndex: '1',
dialogVisible: false,
index:"1",
index: '1',
fileList: [],
remark:"",
imageName:"",
imageUrl:"",
networkPic:""
remark: '',
imageName: '',
imageUrl: '',
networkPic: ''
}
},
computed: {
@@ -136,14 +136,14 @@ export default {
* 添加自定义按钮
*/
// 获取编辑器上的功能条
let toolbar = this.editor.getUI().getToolbar();
let fileDom = this.$refs.files;
const toolbar = this.editor.getUI().getToolbar()
const fileDom = this.$refs.files
// 添加图片点击事件
this.editor.eventManager.addEventType('isShowClickEvent');
this.editor.eventManager.addEventType('isShowClickEvent')
this.editor.eventManager.listen('isShowClickEvent', () => {
this.isShow = true
this.dialogVisible = true
});
})
// addImageBlobHook图片上传、剪切、拖拽都会走此方法
// 删除默认监听事件
this.editor.eventManager.removeEventHandler('addImageBlobHook')
@@ -160,10 +160,10 @@ export default {
name: 'customize',
className: 'tui-image tui-toolbar-icons',
event: 'isShowClickEvent',
tooltip: '上传图片',
tooltip: '上传图片'
}
//
});
})
// --end 添加自定义上传按钮
},
destroyEditor () {
@@ -189,50 +189,50 @@ export default {
if (this.remark) {
this.addImgToMd(this.imageUrl, this.remark)
} else {
this.addImgToMd(this.imageUrl,"")
this.addImgToMd(this.imageUrl, '')
}
} else {
if (this.remark) {
this.addImgToMd(this.networkPic, this.remark)
} else {
this.addImgToMd(this.networkPic,"")
this.addImgToMd(this.networkPic, '')
}
}
this.index="1"
this.index = '1'
this.fileList = []
this.imageName="";
this.imageUrl="";
this.remark=""
this.networkPic=""
this.imageName = ''
this.imageUrl = ''
this.remark = ''
this.networkPic = ''
this.dialogVisible = false
this.isShow=false;
this.isShow = false
},
handleClose (done) {
done();
done()
},
handleChange (val) {
this.fileList = []
this.remark=""
this.imageName=""
this.imageUrl=""
this.networkPic=""
this.remark = ''
this.imageName = ''
this.imageUrl = ''
this.networkPic = ''
this.index = val
},
// 添加图片到markdown
addImgToMd (data, name) {
let editor = this.editor.getCodeMirror();
let editorHtml = this.editor.getCurrentModeEditor();
let isMarkdownMode = this.editor.isMarkdownMode();
const editor = this.editor.getCodeMirror()
const editorHtml = this.editor.getCurrentModeEditor()
const isMarkdownMode = this.editor.isMarkdownMode()
if (isMarkdownMode) {
editor.replaceSelection(`![${name}](${data})`);
editor.replaceSelection(`![${name}](${data})`)
} else {
let range = editorHtml.getRange();
let img = document.createElement('img');
img.src = `${data}`;
img.alt = name;
range.insertNode(img);
const range = editorHtml.getRange()
const img = document.createElement('img')
img.src = `${data}`
img.alt = name
range.insertNode(img)
}
}
},
},
model: {
prop: 'value',
+12 -12
View File
@@ -70,39 +70,39 @@ export default {
okClose: {
type: Boolean,
default: true
},
}
},
data () {
return {
// 内部使用的 slots ,不再处理
usedSlots: ['title'],
// 实际控制是否全屏的参数
innerFullscreen: this.fullscreen,
innerFullscreen: this.fullscreen
}
},
computed: {
// 一些未处理的参数或特殊处理的参数绑定到 a-modal 上
_attrs () {
let attrs = { ...this.$attrs }
const attrs = { ...this.$attrs }
// 如果全屏就将宽度设为 100%
if (this.innerFullscreen) {
attrs['width'] = '100%'
attrs.width = '100%'
}
return attrs
},
modalClass () {
return {
'j-modal-box': true,
'fullscreen': this.innerFullscreen,
fullscreen: this.innerFullscreen,
'no-title': this.isNoTitle,
'no-footer': this.isNoFooter,
'no-footer': this.isNoFooter
}
},
modalStyle () {
let style = {}
const style = {}
// 如果全屏就将top设为 0
if (this.innerFullscreen) {
style['top'] = '0'
style.top = '0'
}
return style
},
@@ -110,7 +110,7 @@ export default {
return !this.title && !this.allSlotsKeys.includes('title')
},
isNoFooter () {
return this._attrs['footer'] === null
return this._attrs.footer === null
},
slotsKeys () {
return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
@@ -124,7 +124,7 @@ export default {
// 切换全屏的按钮图标
fullscreenButtonIcon () {
return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
},
}
},
watch: {
visible () {
@@ -134,7 +134,7 @@ export default {
},
innerFullscreen (val) {
this.$emit('update:fullscreen', val)
},
}
},
methods: {
@@ -162,7 +162,7 @@ export default {
toggleFullscreen () {
this.innerFullscreen = !this.innerFullscreen
triggerWindowResizeEvent()
},
}
}
}
+10 -10
View File
@@ -23,19 +23,19 @@ export default {
content: '',
// 弹窗参数
modalProps: {
title: '',
title: ''
},
inputProps: {
placeholder: '',
placeholder: ''
},
// form model
model: {
input: '',
input: ''
},
// 校验
rule: [],
// 回调函数
callback: {},
callback: {}
}
},
computed: {
@@ -43,7 +43,7 @@ export default {
return {
input: this.rule
}
},
}
},
methods: {
show (options) {
@@ -55,10 +55,10 @@ export default {
this.model.input = options.defaultValue
}
// 取出常用的弹窗参数
let pickModalProps = pick(options, 'title', 'centered', 'cancelText', 'closable', 'mask', 'maskClosable', 'okText', 'okType', 'okButtonProps', 'cancelButtonProps', 'width', 'wrapClassName', 'zIndex', 'dialogStyle', 'dialogClass')
const pickModalProps = pick(options, 'title', 'centered', 'cancelText', 'closable', 'mask', 'maskClosable', 'okText', 'okType', 'okButtonProps', 'cancelButtonProps', 'width', 'wrapClassName', 'zIndex', 'dialogStyle', 'dialogClass')
this.modalProps = Object.assign({}, pickModalProps, options.modalProps)
// 取出常用的input参数
let pickInputProps = pick(options, 'placeholder', 'allowClear')
const pickInputProps = pick(options, 'placeholder', 'allowClear')
this.inputProps = Object.assign({}, pickInputProps, options.inputProps)
// 回调函数
this.callback = pick(options, 'onOk', 'onOkAsync', 'onCancel')
@@ -69,7 +69,7 @@ export default {
onOk () {
this.$refs.form.validate((ok, err) => {
if (ok) {
let event = {value: this.model.input, target: this}
const event = { value: this.model.input, target: this }
// 异步方法优先级高于同步方法
if (typeof this.callback.onOkAsync === 'function') {
this.callback.onOkAsync(event)
@@ -113,9 +113,9 @@ export default {
this.modalProps.afterClose(e)
}
this.$emit('after-close', e)
},
}
},
}
}
</script>
+1 -1
View File
@@ -14,5 +14,5 @@ export default {
vm.$on('after-close', () => vm.$destroy())
return vm
}
},
}
}
+12 -12
View File
@@ -70,39 +70,39 @@
okClose: {
type: Boolean,
default: true
},
}
},
data () {
return {
// 内部使用的 slots ,不再处理
usedSlots: ['title'],
// 实际控制是否全屏的参数
innerFullscreen: this.fullscreen,
innerFullscreen: this.fullscreen
}
},
computed: {
// 一些未处理的参数或特殊处理的参数绑定到 a-modal 上
_attrs () {
let attrs = { ...this.$attrs }
const attrs = { ...this.$attrs }
// 如果全屏就将宽度设为 100%
if (this.innerFullscreen) {
attrs['width'] = '100%'
attrs.width = '100%'
}
return attrs
},
modalClass () {
return {
'j-modal-box': true,
'fullscreen': this.innerFullscreen,
fullscreen: this.innerFullscreen,
'no-title': this.isNoTitle,
'no-footer': this.isNoFooter,
'no-footer': this.isNoFooter
}
},
modalStyle () {
let style = {}
const style = {}
// 如果全屏就将top设为 0
if (this.innerFullscreen) {
style['top'] = '0'
style.top = '0'
}
return style
},
@@ -110,7 +110,7 @@
return !this.title && !this.allSlotsKeys.includes('title')
},
isNoFooter () {
return this._attrs['footer'] === null
return this._attrs.footer === null
},
slotsKeys () {
return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
@@ -124,7 +124,7 @@
// 切换全屏的按钮图标
fullscreenButtonIcon () {
return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
},
}
},
watch: {
visible () {
@@ -134,7 +134,7 @@
},
innerFullscreen (val) {
this.$emit('update:fullscreen', val)
},
}
},
methods: {
@@ -162,7 +162,7 @@
toggleFullscreen () {
this.innerFullscreen = !this.innerFullscreen
triggerWindowResizeEvent()
},
}
}
}
+15 -15
View File
@@ -107,7 +107,7 @@
computed: {
uniqGroupId () {
if (this.groupId) {
let { groupId, code, field, orgFields, destFields } = this
const { groupId, code, field, orgFields, destFields } = this
return `${groupId}_${code}_${field}_${orgFields}_${destFields}`
}
}
@@ -144,11 +144,11 @@
},
handleEmpty () {
this.showText = ''
let destFieldsArr = this.destFields.split(',')
const destFieldsArr = this.destFields.split(',')
if (destFieldsArr.length === 0) {
return
}
let res = {}
const res = {}
for (let i = 0; i < destFieldsArr.length; i++) {
res[destFieldsArr[i]] = ''
}
@@ -160,38 +160,38 @@
},
callBack (rows) {
// update--begin--autor:lvdandan-----date:20200630------for:多选时未带回多个值------
let orgFieldsArr = this.orgFields.split(',')
let destFieldsArr = this.destFields.split(',')
const orgFieldsArr = this.orgFields.split(',')
const destFieldsArr = this.destFields.split(',')
let resetText = false
if (this.field && this.field.length > 0) {
this.showText = ''
resetText = true
}
let res = {}
const res = {}
if (orgFieldsArr.length > 0) {
for (let i = 0; i < orgFieldsArr.length; i++) {
let tempDestArr = []
for(let rw of rows){
const tempDestArr = []
for (const rw of rows) {
let val = rw[orgFieldsArr[i]]
// update--begin--autor:liusq-----date:20210713------for:处理val等于0的情况issues/I3ZL4T------
if(typeof val=='undefined'|| val==null || val.toString()==""){
val = ""
if (typeof val === 'undefined' || val == null || val.toString() == '') {
val = ''
}
// update--end--autor:liusq-----date:20210713------for:处理val等于0的情况issues/I3ZL4T------
tempDestArr.push(val)
}
res[destFieldsArr[i]] = tempDestArr.join(",")
res[destFieldsArr[i]] = tempDestArr.join(',')
}
if (resetText === true) {
let tempText = []
for(let rw of rows){
const tempText = []
for (const rw of rows) {
let val = rw[orgFieldsArr[destFieldsArr.indexOf(this.field)]]
if (!val) {
val = ""
val = ''
}
tempText.push(val)
}
this.showText = tempText.join(",")
this.showText = tempText.join(',')
}
// update--end--autor:lvdandan-----date:20200630------for:多选时未带回多个值------
}
@@ -53,7 +53,7 @@
type: String,
default: '',
required: false
},
}
},
data () {
return {
@@ -77,9 +77,9 @@
onChange (selectedValue) {
this.newOptions = this.options
if (this.triggerChange) {
this.$emit('change', selectedValue.join(this.spliter));
this.$emit('change', selectedValue.join(this.spliter))
} else {
this.$emit('input', selectedValue.join(this.spliter));
this.$emit('input', selectedValue.join(this.spliter))
}
},
getParentContainer (node) {
@@ -89,6 +89,6 @@
return document.querySelector(this.popContainer)
}
}
},
}
}
</script>
+20 -20
View File
@@ -8,7 +8,7 @@
<script>
export default {
name:"JSlider",
name: 'JSlider',
data () {
return {
beginClientX: 0, /* 距离屏幕左端距离 */
@@ -24,43 +24,43 @@
},
mousedownFn: function (e) {
if (!this.confirmSuccess) {
e.preventDefault && e.preventDefault(); //阻止文字选中等 浏览器默认事件
this.mouseMoveStata = true;
this.beginClientX = e.clientX;
e.preventDefault && e.preventDefault() // 阻止文字选中等 浏览器默认事件
this.mouseMoveStata = true
this.beginClientX = e.clientX
}
}, // mousedoen 事件
successFunction () {
this.confirmSuccess = true
this.confirmWords = '验证通过';
this.confirmWords = '验证通过'
if (window.addEventListener) {
document.getElementsByTagName('html')[0].removeEventListener('mousemove',this.mouseMoveFn);
document.getElementsByTagName('html')[0].removeEventListener('mouseup',this.moseUpFn);
document.getElementsByTagName('html')[0].removeEventListener('mousemove', this.mouseMoveFn)
document.getElementsByTagName('html')[0].removeEventListener('mouseup', this.moseUpFn)
} else {
document.getElementsByTagName('html')[0].removeEventListener('mouseup',()=>{});
document.getElementsByTagName('html')[0].removeEventListener('mouseup', () => {})
}
document.getElementsByClassName('drag_text')[0].style.color = '#fff'
document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px';
document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px';
document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px'
this.$emit("onSuccess",true)
this.$emit('onSuccess', true)
}, // 验证成功函数
mouseMoveFn (e) {
if (this.mouseMoveStata) {
let width = e.clientX - this.beginClientX;
const width = e.clientX - this.beginClientX
if (width > 0 && width <= this.maxwidth) {
document.getElementsByClassName('handler')[0].style.left = width + 'px';
document.getElementsByClassName('drag_bg')[0].style.width = width + 'px';
document.getElementsByClassName('handler')[0].style.left = width + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = width + 'px'
} else if (width > this.maxwidth) {
this.successFunction();
this.successFunction()
}
}
}, // mousemove事件
moseUpFn (e) {
this.mouseMoveStata = false;
var width = e.clientX - this.beginClientX;
this.mouseMoveStata = false
var width = e.clientX - this.beginClientX
if (width < this.maxwidth) {
// ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
let handler = document.getElementsByClassName('handler')[0]
const handler = document.getElementsByClassName('handler')[0]
if (handler) {
handler.style.left = 0 + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'
@@ -70,8 +70,8 @@
} // mouseup事件
},
mounted () {
this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth;
document.getElementsByTagName('html')[0].addEventListener('mousemove',this.mouseMoveFn);
this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth
document.getElementsByTagName('html')[0].addEventListener('mousemove', this.mouseMoveFn)
document.getElementsByTagName('html')[0].addEventListener('mouseup', this.moseUpFn)
}
}
+36 -38
View File
@@ -201,11 +201,9 @@
</a-tree>
</a-card>
</a-col>
</a-row>
</a-spin>
<a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk">
@@ -286,7 +284,7 @@
saveCodeBefore: 'JSuperQuerySaved_',
// 查询类型,过滤条件匹配(and、or)
matchType: 'and',
superQueryFlag: false,
superQueryFlag: false
}
},
computed: {
@@ -302,14 +300,14 @@
saveCode = this.$route.fullPath
}
return this.saveCodeBefore + saveCode
},
}
},
watch: {
// 当 saveCode 变化时,重新查询已保存的条件
fullSaveCode: {
immediate: true,
handler () {
let list = this.$ls.get(this.fullSaveCode)
const list = this.$ls.get(this.fullSaveCode)
if (list instanceof Array) {
this.saveTreeData = list.map(i => this.renderSaveTreeData(i))
}
@@ -319,16 +317,16 @@
deep: true,
immediate: true,
handler (val) {
let mainData = [], subData = []
const mainData = []; const subData = []
val.forEach(item => {
let data = { ...item }
const data = { ...item }
data.label = data.label || data.text
let hasChildren = (data.children instanceof Array)
const hasChildren = (data.children instanceof Array)
data.disabled = hasChildren
data.selectable = !hasChildren
if (hasChildren) {
data.children = data.children.map(item2 => {
let child = { ...item2 }
const child = { ...item2 }
child.label = child.label || child.text
child.label = data.label + '-' + child.label
child.value = data.value + ',' + child.value
@@ -366,7 +364,7 @@
},
handleOk () {
if (!this.isNullArray(this.queryParamsModel)) {
let event = {
const event = {
matchType: this.matchType,
params: this.removeEmptyObject(this.queryParamsModel)
}
@@ -376,13 +374,13 @@
}
this.emitCallback(event)
} else {
this.$message.warn("不能查询空条件")
this.$message.warn('不能查询空条件')
}
},
emitCallback (event = {}) {
let { params = [], matchType = this.matchType } = event
const { params = [], matchType = this.matchType } = event
this.superQueryFlag = (params && params.length > 0)
for (let param of params) {
for (const param of params) {
if (Array.isArray(param.val)) {
param.val = param.val.join(',')
}
@@ -412,16 +410,16 @@
this.queryParamsModel.splice(index, 1)
},
handleSelected (node, item) {
let { type, dbType, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef
item['type'] = type
item['dbType'] = dbType
item['options'] = options
item['dictCode'] = dictCode
item['dictTable'] = dictTable
item['dictText'] = dictText
item['customReturnField'] = customReturnField
const { type, dbType, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef
item.type = type
item.dbType = dbType
item.options = options
item.dictCode = dictCode
item.dictTable = dictTable
item.dictText = dictText
item.customReturnField = customReturnField
if (popup) {
item['popup'] = popup
item.popup = popup
}
this.$set(item, 'val', undefined)
},
@@ -433,7 +431,7 @@
this.emitCallback()
},
handleSave () {
let queryParams = this.removeEmptyObject(this.queryParamsModel)
const queryParams = this.removeEmptyObject(this.queryParamsModel)
if (this.isNullArray(queryParams)) {
this.$message.warning('空条件不能保存')
} else {
@@ -442,15 +440,15 @@
}
},
handlePromptOk () {
let { value } = this.prompt
const { value } = this.prompt
if (!value) {
this.$message.warning('保存名称不能为空')
return
}
// 取出查询条件
let records = this.removeEmptyObject(this.queryParamsModel)
const records = this.removeEmptyObject(this.queryParamsModel)
// 判断有没有重名的
let filterList = this.saveTreeData.filter(i => i.originTitle === value)
const filterList = this.saveTreeData.filter(i => i.originTitle === value)
if (filterList.length > 0) {
this.$confirm({
content: `${value} 已存在,是否覆盖?`,
@@ -477,7 +475,7 @@
},
handleTreeSelect (idx, event) {
if (event.selectedNodes[0]) {
let { matchType, records } = event.selectedNodes[0].data.props
const { matchType, records } = event.selectedNodes[0].data.props
// 将保存的matchType取出,兼容旧数据,如果没有保存就还是使用原来的
this.matchType = matchType || this.matchType
this.queryParamsModel = utils.cloneObject(records)
@@ -490,16 +488,16 @@
this.$confirm({
content: '是否删除当前查询?',
onOk: () => {
let { eventKey } = vNode
const { eventKey } = vNode
this.saveTreeData.splice(Number.parseInt(eventKey.substring(2)), 1)
this.saveToLocalStore()
},
}
})
},
// 将查询保存到 LocalStore 里
saveToLocalStore () {
let saveValue = this.saveTreeData.map(({ originTitle, matchType, records }) => ({ title: originTitle, matchType, records }))
const saveValue = this.saveTreeData.map(({ originTitle, matchType, records }) => ({ title: originTitle, matchType, records }))
this.$ls.set(this.fullSaveCode, saveValue)
},
@@ -509,7 +507,7 @@
return true
}
if (array.length === 1) {
let obj = array[0]
const obj = array[0]
if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) {
return true
}
@@ -518,9 +516,9 @@
},
// 去掉数组中的空对象
removeEmptyObject (arr) {
let array = utils.cloneObject(arr)
const array = utils.cloneObject(arr)
for (let i = 0; i < array.length; i++) {
let item = array[i]
const item = array[i]
if (item == null || Object.keys(item).length <= 0) {
array.splice(i--, 1)
} else {
@@ -538,7 +536,7 @@
/** 渲染保存查询条件的 title(加个删除按钮) */
renderSaveTreeData (item) {
item.icon = this.treeIcon
item.originTitle = item['title']
item.originTitle = item.title
item.title = (arg1, arg2) => {
let vNode
// 兼容旧版的Antdv
@@ -549,7 +547,7 @@
} else {
return <span style="color:red;">Antdv版本不支持</span>
}
let {originTitle} = vNode.dataRef
const { originTitle } = vNode.dataRef
return (
<div class="j-history-tree-title">
<span>{originTitle}</span>
@@ -569,7 +567,7 @@
},
handleRuleChange (item, newValue) {
let oldValue = item.rule
const oldValue = item.rule
this.$set(item, 'rule', newValue)
// 上一个规则是否是 in,且type是字典或下拉
if (oldValue === 'in') {
@@ -586,8 +584,8 @@
},
handleChangeJPopup (item, e, values) {
item.val = values[item.popup['destFields']]
},
item.val = values[item.popup.destFields]
}
}
}
+11 -12
View File
@@ -50,19 +50,19 @@
},
computed: {
queryOption () {
let arr = []
const arr = []
arr.push({ value: this.options[0], text: '是' })
arr.push({ value: this.options[1], text: '否' })
return arr;
return arr
},
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
@@ -72,7 +72,7 @@
if (!this.query) {
if (!val) {
this.checkStatus = false
this.$emit('change', this.options[1]);
this.$emit('change', this.options[1])
} else {
if (this.options[0] == val) {
this.checkStatus = true
@@ -81,17 +81,16 @@
}
}
}
}
}
},
methods: {
handleChange (checked) {
let flag = checked===false?this.options[1]:this.options[0];
this.$emit('change', flag);
const flag = checked === false ? this.options[1] : this.options[0]
this.$emit('change', flag)
},
handleSelectChange (value) {
this.$emit('change', value);
this.$emit('change', value)
}
},
model: {
+31 -30
View File
@@ -67,9 +67,9 @@
<script>
import get from 'lodash.get'
const LEFT_FROZEN = 1; // 1为左侧冻结
const RIGHT_FROZEN = 2; // 2为右侧冻结
const NO_FROZEN = 3; // 3为不冻结或解冻
const LEFT_FROZEN = 1 // 1为左侧冻结
const RIGHT_FROZEN = 2 // 2为右侧冻结
const NO_FROZEN = 3 // 3为不冻结或解冻
export default {
name: 'JTable',
@@ -91,27 +91,27 @@ export default {
type: Boolean,
default () {
return true
},
}
},
isCheck: {
type: Boolean,
default () {
return true
},
}
},
isShowDropdown: {
type: Boolean,
default () {
return true
},
}
},
rowSelection: {
type: Object,
default () {
return {
type: 'checkbox',
type: 'checkbox'
}
}
},
},
pagination: {
type: Object,
@@ -127,13 +127,13 @@ export default {
return range[0] + '-' + range[1] + ' 共' + total + '条'
}
}
},
},
}
}
},
data () {
return {
key: "customer_cloumns_" + this.$route.path, // 存储当前列表的用户存储信息
defaultOperationKey: "action", // 操作列dataIndex=action不作相关处理,默认去除
key: 'customer_cloumns_' + this.$route.path, // 存储当前列表的用户存储信息
defaultOperationKey: 'action', // 操作列dataIndex=action不作相关处理,默认去除
usedSlots: [], // 内部使用的 slots ,不再处理
needTotalList: [],
selectedRows: [],
@@ -144,8 +144,8 @@ export default {
radioStyle: {
display: 'block',
height: '30px',
lineHeight: '30px',
},
lineHeight: '30px'
}
}
},
computed: {
@@ -176,9 +176,9 @@ export default {
},
// 需要插槽处理的列的信息
columnsSlot () {
let a= this.curTableColumns.filter(
const a = this.curTableColumns.filter(
item => item.slots
);
)
console.log(a)
return a
}
@@ -187,10 +187,10 @@ export default {
// 遍历出筛选列头的所有选项
this.columns.forEach((item) => {
if (item.slots && item.slots.title) {
let colItem = {
const colItem = {
value: item.slots.title,
label: item.slots.title,
disabled: false,
disabled: false
}
this.plainOptions.push(colItem)
}
@@ -233,8 +233,8 @@ export default {
})
}
let trfList = [] //将中文转换为dataIndex
let initList = [] //最初始list
const trfList = [] // 将中文转换为dataIndex
const initList = [] // 最初始list
let diffList = [] // 两个数组不同
// 转换为dataIndex
for (let i = 0; i < e.length; i++) {
@@ -265,12 +265,12 @@ export default {
},
// 比较两个数组之间的不同,生成新数组
getArrDifference (arr1, arr2) {
let that = this;
const that = this
return arr1.concat(arr2).filter(function (v, i, arr) {
if (v !== that.defaultOperationKey) {
return arr.indexOf(v) === arr.lastIndexOf(v)
} else {
return false;
return false
}
})
},
@@ -319,9 +319,9 @@ export default {
},
// 列头重新排序
diffColunms () {
let newColumnsList = [] //没有fixed属性的List
let newFixedLeftList = [] //fixed=left的List
let newFixedRightList = [] //fixed=right的List
const newColumnsList = [] // 没有fixed属性的List
const newFixedLeftList = [] // fixed=left的List
const newFixedRightList = [] // fixed=right的List
this.curTableColumns.forEach((item) => {
if (!item.fixed) {
newColumnsList.push(item)
@@ -350,12 +350,12 @@ export default {
},
updateSelect (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
let list = this.needTotalList
const list = this.needTotalList
this.needTotalList = list.map(item => {
return {
...item,
total: selectedRows.reduce((sum, val) => {
let total = sum + get(val, item.dataIndex)
const total = sum + get(val, item.dataIndex)
return isNaN(total) ? 0 : total
}, 0)
}
@@ -365,14 +365,15 @@ export default {
const totalList = []
columns && columns instanceof Array && columns.forEach(column => {
if (column.needTotal) {
totalList.push({ ...column,
totalList.push({
...column,
total: 0
})
}
})
return totalList
},
},
}
}
}
</script>
+8 -8
View File
@@ -45,21 +45,21 @@
}
},
data () {
let timeStr = this.value;
const timeStr = this.value
return {
decorator:"",
decorator: '',
momVal: !timeStr ? null : moment(timeStr, this.dateFormat)
}
},
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
watch: {
@@ -74,7 +74,7 @@
methods: {
moment,
handleTimeChange (mom, timeStr) {
this.$emit('change', timeStr);
this.$emit('change', timeStr)
}
},
// 2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
+20 -20
View File
@@ -25,9 +25,9 @@
return {
treeData: [],
treeValue: null,
url_root:"/sys/category/loadTreeRoot",
url_children:"/sys/category/loadTreeChildren",
url_view:'/sys/category/loadOne',
url_root: '/sys/category/loadTreeRoot',
url_children: '/sys/category/loadTreeChildren',
url_view: '/sys/category/loadOne'
}
},
props: {
@@ -73,7 +73,7 @@
watch: {
root: {
handler (val) {
console.log("root-change",val)
console.log('root-change', val)
},
deep: true
},
@@ -96,12 +96,12 @@
},
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
created () {
@@ -114,10 +114,10 @@
},
methods: {
loadViewInfo () {
if(!this.value || this.value=="0"){
if (!this.value || this.value == '0') {
this.treeValue = null
} else {
let param = {
const param = {
field: this.field,
val: this.value
}
@@ -132,7 +132,7 @@
}
},
loadRoot () {
let param = {
const param = {
async: this.async,
pcode: this.parentCode
}
@@ -155,8 +155,8 @@
resolve()
return
}
let pid = treeNode.$vnode.key
let param = {
const pid = treeNode.$vnode.key
const param = {
pid: pid
}
getAction(this.url_children, param).then(res => {
@@ -171,7 +171,7 @@
},
addChildren (pid, children, treeArray) {
if (treeArray && treeArray.length > 0) {
for(let item of treeArray){
for (const item of treeArray) {
if (item.key == pid) {
if (!children || children.length == 0) {
item.leaf = true
@@ -186,10 +186,10 @@
}
},
handleTreeNodeValue (result) {
let storeField = this.field=='code'?'code':'key'
for(let i of result){
const storeField = this.field == 'code' ? 'code' : 'key'
for (const i of result) {
i.value = i[storeField]
i.isLeaf = (!i.leaf)?false:true
i.isLeaf = !(!i.leaf)
if (i.children && i.children.length > 0) {
this.handleTreeNodeValue(i.children)
}
@@ -200,9 +200,9 @@
/*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题:change事件会执行两遍
* 解决办法:改变选中时提交的事件名 */
this.$emit('change', '');
this.$emit('change', '')
} else {
this.$emit('change', value.value);
this.$emit('change', value.value)
}
this.treeValue = value
},
+32 -32
View File
@@ -95,7 +95,7 @@
// 是否支持多选
multiple: {
type: Boolean,
default: false,
default: false
},
loadTriggleChange: {
type: Boolean,
@@ -107,11 +107,11 @@
return {
treeValue: null, // 选中的数据
treeData: [], // 渲染树的数组
url:"/sys/dict/loadTreeData",
url: '/sys/dict/loadTreeData',
view: '/sys/dict/loadDictItem/',
tableName:"",
text:"",
code:"",
tableName: '',
text: '',
code: ''
}
},
watch: {
@@ -131,12 +131,12 @@
},
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
}
},
created () {
@@ -151,16 +151,16 @@
},
methods: {
loadItemByCode () {
if( !this.value || this.value == "0" ){
if (!this.value || this.value == '0') {
this.treeValue = null
} else {
getAction(`${this.view}${this.dict}`, { key: this.value }).then(res => {
if (res.success) {
let values = this.value.split(',')
const values = this.value.split(',')
this.treeValue = values // v-model接收的是string || string[]
// 将节点名称显示在选择框上
this.treeValue = res.result[0]
this.onLoadTriggleChange(res.result[0]);
this.onLoadTriggleChange(res.result[0])
}
})
}
@@ -172,7 +172,7 @@
}
},
initDictInfo () { // 取出父组件传过来的code,text,tableName
let arr = this.dict.split(",")
const arr = this.dict.split(',')
this.tableName = arr[0]
this.text = arr[1]
this.code = arr[2]
@@ -184,8 +184,8 @@
resolve()
return
}
let pid = treeNode.$vnode.key
let param = {
const pid = treeNode.$vnode.key
const param = {
pid: pid,
tableName: this.tableName,
text: this.text,
@@ -196,7 +196,7 @@
}
getAction(this.url, param).then(res => {
if (res.success) {
for(let i of res.result){
for (const i of res.result) {
i.value = i.key
if (i.leaf == false) {
i.isLeaf = false
@@ -213,7 +213,7 @@
},
addChildren (pid, children, treeArray) {
if (treeArray && treeArray.length > 0) {
for(let item of treeArray){
for (const item of treeArray) {
if (item.key == pid) { // 找到当前元素所在的父节点
if (!children || children.length == 0) {
item.isLeaf = true
@@ -232,7 +232,7 @@
* isAsync:true===异步获取 false===同步获取数据 默认异步 */
loadRoot () {
if (this.isAsync) {
let param = {
const param = {
pid: this.pidValue,
tableName: this.tableName,
text: this.text,
@@ -243,7 +243,7 @@
}
getAction(this.url, param).then(res => {
if (res.success && res.result) {
for(let i of res.result){
for (const i of res.result) {
i.value = i.key
if (i.leaf == false) {
i.isLeaf = false
@@ -253,12 +253,12 @@
}
this.treeData = [...res.result]
} else {
console.log("数根节点查询结果-else",res)
console.log('数根节点查询结果-else', res)
}
})
} else {
// 同步
let param = {
const param = {
code: this.code,
pidField: this.pidField,
tableName: this.tableName,
@@ -276,7 +276,7 @@
/*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题:change事件会执行两遍
* 解决办法:改变选中时提交的事件名 */
this.$emit('change', '');
this.$emit('change', '')
this.treeValue = null
} else if (value instanceof Array) {
// 多选
@@ -292,21 +292,21 @@
return this.treeData
},
validateProp () {
let myCondition = this.condition
const myCondition = this.condition
return new Promise((resolve, reject) => {
if (!myCondition) {
resolve();
}else{
try {
let test=JSON.parse(myCondition);
if(typeof test == 'object' && test){
resolve()
} else {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
try {
const test = JSON.parse(myCondition)
if (typeof test === 'object' && test) {
resolve()
} else {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
} catch (e) {
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
}
@@ -321,7 +321,7 @@
}
// 递归整个树,判断是否是叶子节点----同步获取数据时用到
function deepFor (source) {
for(let i of source){
for (const i of source) {
i.value = i.key
if (i.leaf == false) {
+7 -7
View File
@@ -82,8 +82,8 @@
}
},
slots () {
let slots = []
for (let column of this.columns) {
const slots = []
for (const column of this.columns) {
if (column.scopedSlots && column.scopedSlots.customRender) {
slots.push(column.scopedSlots.customRender)
}
@@ -115,10 +115,10 @@
this.expandedRowKeys = []
}
let params = Object.assign({}, this.queryParams || {})
const params = Object.assign({}, this.queryParams || {})
params[this.queryKey] = id
if (this.condition && this.condition.length > 0) {
params['condition'] = this.condition
params.condition = this.condition
}
return getAction(url, params).then(res => {
@@ -130,17 +130,17 @@
} else {
throw '返回数据类型不识别'
}
let dataSource = list.map(item => {
const dataSource = list.map(item => {
// 判断是否标记了带有子级
if (item.hasChildren === true) {
// 查找第一个带有dataIndex的值的列
let firstColumn
for (let column of this.columns) {
for (const column of this.columns) {
firstColumn = column.dataIndex
if (firstColumn) break
}
// 定义默认展开时显示的loading子级,实际子级数据只在展开时加载
let loadChild = { id: `${item.id}_loadChild`, [firstColumn]: 'loading...', isLoading: true }
const loadChild = { id: `${item.id}_loadChild`, [firstColumn]: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
+49 -49
View File
@@ -36,32 +36,32 @@
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getFileAccessHttpUrl } from '@/api/manage';
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage'
const Base64 = require('js-base64').Base64
const FILE_TYPE_ALL = "all"
const FILE_TYPE_IMG = "image"
const FILE_TYPE_TXT = "file"
const FILE_TYPE_ALL = 'all'
const FILE_TYPE_IMG = 'image'
const FILE_TYPE_TXT = 'file'
const uidGenerator = () => {
return '-'+parseInt(Math.random()*10000+1,10);
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
export default {
name: 'JUpload',
data () {
return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
uploadAction: window._CONFIG.domianURL + '/sys/common/upload',
headers: {},
fileList: [],
newFileList: [],
uploadGoOn:true,
uploadGoOn: true
}
},
props: {
text: {
type: String,
required: false,
default:"点击上传"
default: '点击上传'
},
fileType: {
type: String,
@@ -72,7 +72,7 @@
bizPath: {
type: String,
required: false,
default:"temp"
default: 'temp'
},
value: {
type: [String, Array],
@@ -127,12 +127,12 @@
value: {
immediate: true,
handler () {
let val = this.value
const val = this.value
if (val instanceof Array) {
if (this.returnUrl) {
this.initFileList(val.join(','))
} else {
this.initFileListArr(val);
this.initFileListArr(val)
}
} else {
this.initFileList(val)
@@ -143,32 +143,32 @@
computed: {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
const vm = this;
let result = Object.assign({},
this.$listeners,
const vm = this
const result = Object.assign({},
this.$listeners
)
delete result.change;
return result;
delete result.change
return result
},
isImageComp () {
return this.fileType === FILE_TYPE_IMG
},
complistType () {
return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text'
},
}
},
created () {
const token = Vue.ls.get(ACCESS_TOKEN);
const token = Vue.ls.get(ACCESS_TOKEN)
// ---------------------------- begin 图片左右换位置 -------------------------------------
this.headers = {"X-Access-Token":token};
this.containerId = 'container-ty-'+new Date().getTime();
this.headers = { 'X-Access-Token': token }
this.containerId = 'container-ty-' + new Date().getTime()
// ---------------------------- end 图片左右换位置 -------------------------------------
},
methods: {
initFileListArr (val) {
if (!val || val.length == 0) {
this.fileList = [];
return;
this.fileList = []
return
}
for (var a = 0; a < val.length; a++) {
this.fileList.forEach((item) => {
@@ -181,10 +181,10 @@
},
initFileList (paths) {
if (!paths || paths.length == 0) {
this.fileList = [];
return;
this.fileList = []
return
}
let arr = paths.split(",")
const arr = paths.split(',')
for (var a = 0; a < arr.length; a++) {
this.fileList.forEach((item) => {
if (item.url === arr[a]) {
@@ -195,33 +195,33 @@
}
},
handlePathChange () {
let uploadFiles = this.fileList
const uploadFiles = this.fileList
let path = ''
if (!uploadFiles || uploadFiles.length == 0) {
path = ''
}
let arr = [];
const arr = []
for (var a = 0; a < uploadFiles.length; a++) {
if (uploadFiles[a].status === 'done') {
arr.push(uploadFiles[a].url)
} else {
return;
return
}
}
if (arr.length > 0) {
path = arr.join(",")
path = arr.join(',')
}
this.$emit('change', path);
this.$emit('change', path)
},
doBeforeUpload (file) {
this.uploadGoOn = true
var fileType = file.type;
var fileType = file.type
if (this.fileType === FILE_TYPE_IMG) {
if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片');
this.$message.warning('请上传图片')
this.uploadGoOn = false
return false;
return false
}
}
// 扩展 beforeUpload 验证
@@ -232,25 +232,25 @@
},
handleChange (info) {
if (!info.file.status && this.uploadGoOn === false) {
info.fileList.pop();
info.fileList.pop()
}
let fileList = info.fileList
if (info.file.status === 'done') {
if (this.number > 0) {
fileList = fileList.slice(-this.number);
fileList = fileList.slice(-this.number)
}
if (info.file.response.success) {
fileList = fileList.map((file) => {
if (file.response) {
let reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`;
file.url = getFileAccessHttpUrl(reUrl);
const reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`
file.url = getFileAccessHttpUrl(reUrl)
}
return file;
});
return file
})
}
// this.$message.success(`${info.file.name} 上传成功!`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`);
this.$message.error(`${info.file.name} 上传失败.`)
} else if (info.file.status === 'removed') {
this.handleDelete(info.file)
}
@@ -261,7 +261,7 @@
this.handlePathChange()
} else {
// returnUrl为false时返回文件名称、文件路径及文件大小
this.newFileList = [];
this.newFileList = []
for (var a = 0; a < fileList.length; a++) {
// update-begin-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
if (fileList[a].status === 'done') {
@@ -269,14 +269,14 @@
fileName: fileList[a].name,
filePath: fileList[a].url,
fileSize: fileList[a].size
};
this.newFileList.push(fileJson);
}
this.newFileList.push(fileJson)
} else {
return;
return
}
// update-end-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
}
this.$emit('change', this.newFileList);
this.$emit('change', this.newFileList)
}
}
},
@@ -286,14 +286,14 @@
},
handlePreview (file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
var fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
},
handleDownload (file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
var fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
window.open(fileFullUrl)
}
}
@@ -30,7 +30,7 @@
visible: false,
fullscreen: false,
row: null,
column: null,
column: null
}
},
created () {
@@ -38,7 +38,7 @@
methods: {
open (event) {
let {row, column} = event
const { row, column } = event
this.row = cloneObject(row)
this.column = column
this.visible = true
@@ -54,11 +54,11 @@
column: this.column,
callback: (success) => {
this.visible = !success
},
}
})
},
}
},
}
}
</script>
<style lang="less">
@@ -17,7 +17,7 @@
props: {
size: String,
disabled: PropTypes.bool,
pagination: PropTypes.object.def({}),
pagination: PropTypes.object.def({})
},
data () {
return {
@@ -47,7 +47,7 @@
'j-vxe-pagination': true,
'show-quick-jumper': !!this.bindProps.showQuickJumper
}
},
}
},
methods: {
handleChange (current, pageSize) {
@@ -57,8 +57,8 @@
handleShowSizeChange (current, pageSize) {
this.$set(this.pagination, 'pageSize', pageSize)
this.$emit('change', { current, pageSize })
},
},
}
}
}
</script>
@@ -42,7 +42,6 @@
methods: {
toggle (event) {
// update-begin-author:taoyan date:20200921 for: 弹出子表时,子表会闪一下,类似重新计算子表的位置
if (document.body.clientHeight - event.$event.clientY > 350) {
this.placement = 'bottom'
@@ -64,7 +63,7 @@
return
}
let {row, column, $table, $event: {target}} = event
const { row, column, $table, $event: { target } } = event
this.row = cloneObject(row)
this.column = column
@@ -83,11 +82,11 @@
if (className.includes('vxe-radio--icon') || className.includes('vxe-cell--radio')) {
return
}
let table = $table.$el
let tr = getParentNodeByTagName(target, 'tr')
const table = $table.$el
const tr = getParentNodeByTagName(target, 'tr')
if (table && tr) {
let clientWidth = table.clientWidth
let clientHeight = tr.clientHeight
const clientWidth = table.clientWidth
const clientHeight = tr.clientHeight
this.$refs.div.style.width = clientWidth + 'px'
this.$refs.div.style.height = clientHeight + 'px'
this.overlayStyle.width = Number.parseInt((clientWidth - clientWidth * 0.04)) + 'px'
@@ -99,13 +98,13 @@
if (h) {
h = h - 140
}
let toolbar = this.$refs.div.nextSibling
const toolbar = this.$refs.div.nextSibling
domAlign(this.$refs.div, toolbar, {
points: ['tl', 'tl'],
offset: [0, h],
overflow: {
alwaysByViewport: true
},
}
})
// update-end-author:taoyan date:20200921 for: 子表弹出位置存在现实位置问题。
this.$nextTick(() => {
@@ -115,7 +114,7 @@
})
})
} else {
let num = ++level
const num = ++level
console.warn('【JVxeSubPopover】table or tr 获取失败,正在进行第 ' + num + '次重试', { event, table, tr })
window.setTimeout(() => this.open(event, num), 100)
}
@@ -129,8 +128,8 @@
reopen (event) {
this.close()
this.open(event)
},
},
}
}
}
</script>
<style scoped lang="less">
@@ -48,7 +48,7 @@ export default {
// prefix 前缀;suffix 后缀;
slots: ['prefix', 'suffix'],
// add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮;collapse 展开收起
btns: ['add', 'remove', 'clearSelection'],
btns: ['add', 'remove', 'clearSelection']
})),
// 是否显示行号
rowNumber: PropTypes.bool.def(false),
@@ -66,7 +66,7 @@ export default {
// 最大高度
maxHeight: {
type: Number,
default: () => null,
default: () => null
},
// 要禁用的行 TODO 未实现
disabledRows: PropTypes.object.def(() => ({})),
@@ -99,7 +99,7 @@ export default {
// 注:该参数不能动态修改;如果行、列字段多的情况下,会根据机器性能造成不同程度的卡顿。
alwaysEdit: PropTypes.bool.def(false),
// 联动配置,数组,详情配置见文档
linkageConfig: PropTypes.array.def(() => []),
linkageConfig: PropTypes.array.def(() => [])
},
data () {
return {
@@ -138,7 +138,7 @@ export default {
// gt: 15
// },
'radio-config': { highlight: true },
'checkbox-config': {highlight: true},
'checkbox-config': { highlight: true }
},
// 绑定左侧选择框
selectedRows: [],
@@ -148,7 +148,7 @@ export default {
statistics: {
has: false,
sum: [],
average: [],
average: []
},
// 允许执行刷新特效的行ID
reloadEffectRowKeysMap: {},
@@ -156,7 +156,7 @@ export default {
excludeCode: [],
// 联动下拉选项(用于隔离不同的下拉选项)
// 内部联动配置,map
_innerLinkageConfig: null,
_innerLinkageConfig: null
}
},
computed: {
@@ -164,14 +164,14 @@ export default {
// vxe 最终 columns
vxeColumns () {
this._innerColumns.forEach(column => {
let renderOptions = {
const renderOptions = {
caseId: this.caseId,
bordered: this.bordered,
disabled: this.disabled,
scrolling: this.scrolling,
reloadEffect: this.reloadEffect,
reloadEffectRowKeysMap: this.reloadEffectRowKeysMap,
listeners: this.cellListeners,
listeners: this.cellListeners
}
if (column.$type === JVXETypes.rowDragSort) {
renderOptions.dragSortKey = this.dragSortKey
@@ -191,7 +191,7 @@ export default {
config: this._innerLinkageConfig.get(column.key),
getLinkageOptionsSibling: this.getLinkageOptionsSibling,
getLinkageOptionsAsync: this.getLinkageOptionsAsync,
linkageSelectChange: this.linkageSelectChange,
linkageSelectChange: this.linkageSelectChange
}
}
}
@@ -204,20 +204,20 @@ export default {
// update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 【新行编辑】列表上带按钮的遮挡问题
if (column.$type === JVXETypes.file || column.$type === JVXETypes.image) {
if (column.width && column.width.endsWith('px')) {
column.width = Number.parseInt(column.width.substr(0,column.width.length-2))+Number.parseInt(1)+'px';
column.width = Number.parseInt(column.width.substr(0, column.width.length - 2)) + Number.parseInt(1) + 'px'
}
}
// update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 【新行编辑】列表上带按钮的遮挡问题
// update--begin--autor:lvdandan-----date:20201211------for:JT-118 【online】 日期、时间控件长度较小
if (column.$type === JVXETypes.datetime || column.$type === JVXETypes.userSelect || column.$type === JVXETypes.departSelect) {
let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
const width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
if (width <= 190) {
column.width = '190px'
}
}
if (column.$type === JVXETypes.date) {
let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
const width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
if (width <= 135) {
column.width = '135px'
}
@@ -232,10 +232,10 @@ export default {
},
// vxe 最终 props
vxeProps () {
let expandConfig = Object.assign({}, this.defaultVxeProps['expand-config'], this.expandConfig)
const expandConfig = Object.assign({}, this.defaultVxeProps['expand-config'], this.expandConfig)
return Object.assign({}, this.defaultVxeProps, {
showFooter: this.statistics.has,
showFooter: this.statistics.has
}, this.$attrs, {
loading: this.loading,
columns: this.vxeColumns,
@@ -245,21 +245,21 @@ export default {
maxHeight: this.maxHeight,
border: this.bordered,
expandConfig: expandConfig,
footerMethod: this.handleFooterMethod,
footerMethod: this.handleFooterMethod
// footerSpanMethod: this.handleFooterSpanMethod,
})
},
// vxe 最终 events
vxeEvents () {
// 内置事件
let events = {
'scroll': this.handleVxeScroll,
const events = {
scroll: this.handleVxeScroll,
'cell-click': this.handleCellClick,
'edit-closed': this.handleEditClosed,
'edit-actived': this.handleEditActived,
'radio-change': this.handleVxeRadioChange,
'checkbox-all': this.handleVxeCheckboxAll,
'checkbox-change': this.handleVxeCheckboxChange,
'checkbox-change': this.handleVxeCheckboxChange
}
// 用户传递的事件,进行合并操作
Object.keys(this.$listeners).forEach(key => {
@@ -285,16 +285,16 @@ export default {
/** 当前行向下移一位 */
rowMoveDown: rowIndex => this.rowResort(rowIndex, rowIndex + 1),
/** 在当前行下面插入一行 */
rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1),
rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1)
}
}
},
},
watch: {
dataSource: {
// deep: true,
immediate: true,
async handler () {
let vxe = await getRefPromise(this, 'vxe')
const vxe = await getRefPromise(this, 'vxe')
this.dataSource.forEach((data, idx) => {
// 开启了排序就自动计算排序值
@@ -303,7 +303,7 @@ export default {
}
// 处理联动回显数据
if (this._innerLinkageConfig != null) {
for (let configItem of this._innerLinkageConfig.values()) {
for (const configItem of this._innerLinkageConfig.values()) {
this.autoSetLinkageOptionsByData(data, '', configItem, 0)
}
}
@@ -334,16 +334,16 @@ export default {
// }
// }
// })
},
}
},
columns: {
immediate: true,
handler (columns) {
// 获取不需要显示列
this.loadExcludeCode()
let _innerColumns = []
let _innerEditRules = {}
let {rowNumber, rowSelection, rowExpand, dragSort} = this
const _innerColumns = []
const _innerEditRules = {}
const { rowNumber, rowSelection, rowExpand, dragSort } = this
let expandColumn, seqColumn, checkboxColumn, radioColumn, dragSortColumn
if (Array.isArray(columns)) {
this.statistics.has = false
@@ -355,8 +355,8 @@ export default {
if (this.excludeCode.indexOf(column.key) >= 0) {
return false
}
let col = {...column}
let {type} = col
const col = { ...column }
const { type } = col
const enhanced = getEnhancedMixins(type)
if (type === JVXETypes.rowNumber) {
seqColumn = col
@@ -373,7 +373,7 @@ export default {
// 防止和vxeTable自带的type起冲突
col.$type = col.type
delete col.type
let renderName = 'cellRender', renderOptions = {name: JVXETypes._prefix + type}
let renderName = 'cellRender'; const renderOptions = { name: JVXETypes._prefix + type }
if (type) {
// hidden 是特殊的组件
if (type === JVXETypes.hidden) {
@@ -392,10 +392,10 @@ export default {
}
// 处理校验
if (col.validateRules) {
let rules = []
const rules = []
if (Array.isArray(col.validateRules)) {
for (let rule of col.validateRules) {
let replace = {
for (const rule of col.validateRules) {
const replace = {
message: replaceProps(col, rule.message)
}
if (rule.unique || rule.pattern === 'only') {
@@ -408,7 +408,7 @@ export default {
delete rule.pattern
} else {
// 兼容Online表单的特殊规则
for (let foo of fooPatterns) {
for (const foo of fooPatterns) {
if (foo.value === rule.pattern) {
rule.pattern = foo.pattern
break
@@ -429,7 +429,7 @@ export default {
if (Array.isArray(col.statistics)) {
this.statistics.has = true
col.statistics.forEach(item => {
let arr = this.statistics[item.toLowerCase()]
const arr = this.statistics[item.toLowerCase()]
if (Array.isArray(arr)) {
pushIfNotExist(arr, col.key)
}
@@ -500,8 +500,8 @@ export default {
handler () {
if (Array.isArray(this.linkageConfig) && this.linkageConfig.length > 0) {
// 获取联动的key顺序
let getLcKeys = (key, arr) => {
let col = this._innerColumns.find(col => col.key === key)
const getLcKeys = (key, arr) => {
const col = this._innerColumns.find(col => col.key === key)
if (col) {
arr.push(col.key)
if (col.linkageKey) {
@@ -510,12 +510,13 @@ export default {
}
return arr
}
let configMap = new Map()
const configMap = new Map()
this.linkageConfig.forEach(lc => {
let keys = getLcKeys(lc.key, [])
const keys = getLcKeys(lc.key, [])
// 多个key共享一个,引用地址
let configItem = {
...lc, keys,
const configItem = {
...lc,
keys,
optionsMap: new Map()
}
keys.forEach(k => configMap.set(k, configItem))
@@ -525,7 +526,7 @@ export default {
this._innerLinkageConfig = null
}
}
},
}
},
created () {
},
@@ -559,7 +560,7 @@ export default {
},
handleVxeScroll (event) {
let {$refs, scroll} = this
const { $refs, scroll } = this
// 记录滚动条的位置
scroll.top = event.scrollTop
@@ -571,7 +572,7 @@ export default {
},
// 当手动勾选单选时触发的事件
handleVxeRadioChange (event) {
let row = event.$table.getRadioRecord()
const row = event.$table.getRadioRecord()
this.selectedRows = row ? [row] : []
this.handleSelectChange('radio', this.selectedRows, event)
},
@@ -609,8 +610,8 @@ export default {
// 点击单元格时触发的事件
handleCellClick (event) {
let {row, column, $event, $table} = event
let {$refs} = this
const { row, column, $event, $table } = event
const { $refs } = this
// 点击了可编辑的
if (column.editRender) {
@@ -665,7 +666,7 @@ export default {
/** 表尾数据处理方法,用于显示统计信息 */
handleFooterMethod ({ columns, data }) {
const { statistics } = this
let footers = []
const footers = []
if (statistics.has) {
if (statistics.sum.length > 0) {
footers.push(this.getFooterStatisticsMap({
@@ -723,7 +724,7 @@ export default {
*/
async loadNewData (dataSource) {
if (Array.isArray(dataSource)) {
let {xTable} = this.$refs.vxe.$refs
const { xTable } = this.$refs.vxe.$refs
// issues/2784
// 先清空所有数据
xTable.loadData([])
@@ -735,7 +736,7 @@ export default {
}
// 处理联动回显数据
if (this._innerLinkageConfig != null) {
for (let configItem of this._innerLinkageConfig.values()) {
for (const configItem of this._innerLinkageConfig.values()) {
this.autoSetLinkageOptionsByData(data, '', configItem, 0)
}
}
@@ -749,12 +750,12 @@ export default {
// 校验table,失败返回errMap,成功返回null
async validateTable () {
const errMap = await this.validate().catch(errMap => errMap)
return errMap ? errMap : null
return errMap || null
},
// 完整校验
async fullValidateTable () {
const errMap = await this.fullValidate().catch(errMap => errMap)
return errMap ? errMap : null
return errMap || null
},
/** 设置某行某列的值 */
@@ -764,16 +765,16 @@ export default {
return
}
values.forEach((item, idx) => {
let {rowKey, values: record} = item
let {row} = this.getIfRowById(rowKey)
const { rowKey, values: record } = item
const { row } = this.getIfRowById(rowKey)
if (!row) {
return
}
Object.keys(record).forEach(colKey => {
let column = this.getColumnByKey(colKey)
const column = this.getColumnByKey(colKey)
if (column) {
let oldValue = row[colKey]
let newValue = record[colKey]
const oldValue = row[colKey]
const newValue = record[colKey]
if (newValue !== oldValue) {
this.$set(row, colKey, newValue)
// 触发 valueChange 事件
@@ -783,7 +784,7 @@ export default {
oldValue: oldValue,
col: column.own,
column: column,
isSetValues: true,
isSetValues: true
})
}
} else {
@@ -802,18 +803,18 @@ export default {
},
/** 获取表格表单里的值 */
getValues (callback, rowIds) {
let tableData = this.getTableData({rowIds: rowIds})
const tableData = this.getTableData({ rowIds: rowIds })
callback('', tableData)
},
/** 获取表格数据 */
getTableData (options = {}) {
let {rowIds} = options
const { rowIds } = options
let tableData
// 仅查询指定id的行
if (Array.isArray(rowIds) && rowIds.length > 0) {
tableData = []
rowIds.forEach(rowId => {
let {row} = this.getIfRowById(rowId)
const { row } = this.getIfRowById(rowId)
if (row) {
tableData.push(row)
}
@@ -826,18 +827,18 @@ export default {
},
/** 仅获取新增的数据 */
getNewData () {
let newData = cloneObject(this.$refs.vxe.getInsertRecords())
const newData = cloneObject(this.$refs.vxe.getInsertRecords())
newData.forEach(row => delete row.id)
return newData
},
/** 仅获取新增的数据,带有id */
getNewDataWithId () {
let newData = cloneObject(this.$refs.vxe.getInsertRecords())
const newData = cloneObject(this.$refs.vxe.getInsertRecords())
return newData
},
/** 根据ID获取行,新增的行也能查出来 */
getIfRowById (id) {
let row = this.getRowById(id), isNew = false
let row = this.getRowById(id); let isNew = false
if (!row) {
row = this.getNewRowById(id)
if (!row) {
@@ -850,8 +851,8 @@ export default {
},
/** 通过临时ID获取新增的行 */
getNewRowById (id) {
let records = this.getInsertRecords()
for (let record of records) {
const records = this.getInsertRecords()
for (const record of records) {
if (record.id === id) {
return record
}
@@ -894,13 +895,13 @@ export default {
* @param options.setActive 是否激活最后一行的编辑模式
*/
async pushRows (rows = {}, options = {}) {
let {xTable} = this.$refs.vxe.$refs
const { xTable } = this.$refs.vxe.$refs
let { setActive, index } = options
setActive = setActive == null ? false : !!setActive
index = index == null ? -1 : index
index = index === -1 ? index : xTable.tableFullData[index]
// 插入行
let result = await xTable.insertAt(rows, index)
const result = await xTable.insertAt(rows, index)
if (setActive) {
// 激活最后一行的编辑模式
xTable.setActiveRow(result.rows[result.rows.length - 1])
@@ -911,7 +912,7 @@ export default {
/** 清空选择行 */
clearSelection () {
let event = {$table: this.$refs.vxe, target: this}
const event = { $table: this.$refs.vxe, target: this }
if (this.rowSelectionType === JVXETypes.rowRadio) {
this.$refs.vxe.clearRadioRow()
this.handleVxeRadioChange(event)
@@ -936,8 +937,8 @@ export default {
} else {
rowIds = [rowId]
}
let rows = rowIds.map((id) => {
let {row} = this.getIfRowById(id)
const rows = rowIds.map((id) => {
const { row } = this.getIfRowById(id)
if (!row) {
return
}
@@ -972,8 +973,8 @@ export default {
let key = ''
if (col.key !== config.key) {
// 就找出联动上级列
let idx = config.keys.findIndex(k => col.key === k)
let parentKey = config.keys[idx - 1]
const idx = config.keys.findIndex(k => col.key === k)
const parentKey = config.keys[idx - 1]
key = row[parentKey]
// 如果联动上级列没有选择数据,就直接返回空数组
if (key === '' || key == null) {
@@ -985,7 +986,7 @@ export default {
let options = config.optionsMap.get(key)
if (!Array.isArray(options)) {
if (request) {
let parent = key === 'root' ? '' : key
const parent = key === 'root' ? '' : key
return this.getLinkageOptionsAsync(config, parent)
} else {
options = []
@@ -996,7 +997,7 @@ export default {
/** 【多级联动】获取联动下拉选项(异步) */
getLinkageOptionsAsync (config, parent) {
return new Promise(resolve => {
let key = parent ? parent : 'root'
const key = parent || 'root'
let options
if (config.optionsMap.has(key)) {
options = config.optionsMap.get(key)
@@ -1010,7 +1011,7 @@ export default {
}
} else if (typeof config.requestData === 'function') {
// 调用requestData方法,通过传入parent来获取子级
let promise = config.requestData(parent)
const promise = config.requestData(parent)
config.optionsMap.set(key, promise)
promise.then(opt => {
config.optionsMap.set(key, opt)
@@ -1029,7 +1030,7 @@ export default {
this.getLinkageOptionsAsync(config, parent)
}
if (config.keys.length - 1 > level) {
let value = data[config.keys[level]]
const value = data[config.keys[level]]
if (value) {
this.autoSetLinkageOptionsByData(data, value, config, level + 1)
}
@@ -1039,8 +1040,8 @@ export default {
linkageSelectChange (row, col, config, value) {
if (col.linkageKey) {
this.getLinkageOptionsAsync(config, value)
let idx = config.keys.findIndex(k => k === col.key)
let values = {}
const idx = config.keys.findIndex(k => k === col.key)
const values = {}
for (let i = idx; i < config.keys.length; i++) {
values[config.keys[i]] = ''
}
@@ -1053,10 +1054,10 @@ export default {
_loadDictConcatToOptions (column) {
initDictOptions(column.dictCode).then((res) => {
if (res.success) {
let newOptions = (column.options || [])// .concat(res.result)
const newOptions = (column.options || [])// .concat(res.result)
res.result.forEach(item => {
// 过滤重复数据
for (let option of newOptions) if (option.value === item.value) return
for (const option of newOptions) if (option.value === item.value) return
newOptions.push(item)
})
this.$set(column, 'options', newOptions)
@@ -1084,10 +1085,10 @@ export default {
* @param handler function
*/
filterNewRows (rows, remove = true, handler) {
let insertRecords = this.$refs.vxe.getInsertRecords()
let records = []
for (let row of rows) {
let item = cloneObject(row)
const insertRecords = this.$refs.vxe.getInsertRecords()
const records = []
for (const row of rows) {
const item = cloneObject(row)
if (insertRecords.includes(row)) {
handler ? handler({ item, row, insertRecords }) : null
@@ -1103,7 +1104,7 @@ export default {
// 删除选中的数据
async removeSelection () {
let res = await this._remove(this.selectedRows)
const res = await this._remove(this.selectedRows)
this.clearSelection()
await this._recalcSortNumber()
return res
@@ -1152,7 +1153,7 @@ export default {
}
// 【从keepSource中删除】
if (xTable.keepSource) {
let rowIdSet = new Set(rows.map(row => row.id))
const rowIdSet = new Set(rows.map(row => row.id))
XEUtils.remove(tableSourceData, row => rowIdSet.has(row.id))
}
@@ -1181,7 +1182,7 @@ export default {
window.xTable = xTable
const sort = (array) => {
// 存储旧数据,并删除旧项目
let row = array.splice(oldIndex, 1)[0]
const row = array.splice(oldIndex, 1)[0]
// 向新项目里添加旧数据
array.splice(newIndex, 0, row)
}
@@ -1204,7 +1205,7 @@ export default {
},
async _addOrInsert (rows = {}, index, triggerName, isOnlJs) {
let {xTable} = this.$refs.vxe.$refs
const { xTable } = this.$refs.vxe.$refs
let records
if (Array.isArray(rows)) {
records = rows
@@ -1213,17 +1214,17 @@ export default {
}
// 遍历添加默认值
records.forEach(record => this._createRow(record))
let result = await this.pushRows(records, {index: index, setActive: true})
const result = await this.pushRows(records, { index: index, setActive: true })
// 遍历插入的行
// update--begin--autor:lvdandan-----date:20201117------for:LOWCOD-987 【新行编辑】js增强附表内置方法调用问题 #1819
// online js增强时以传过来值为准,不再赋默认值
if (isOnlJs != true) {
for (let i = 0; i < result.rows.length; i++) {
let row = result.rows[i]
const row = result.rows[i]
this.trigger(triggerName, {
row: row,
$table: xTable,
target: this,
target: this
})
}
}
@@ -1232,20 +1233,20 @@ export default {
},
// 创建新行,自动添加默认值
_createRow (record = {}) {
let {xTable} = this.$refs.vxe.$refs
const { xTable } = this.$refs.vxe.$refs
// 添加默认值
xTable.tableFullColumn.forEach(column => {
let col = column.own
const col = column.own
if (col.key && (record[col.key] == null || record[col.key] === '')) {
// 设置默认值
let createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
const createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
record[col.key] = createValue({ row: record, column, $table: xTable })
}
// update-begin--author:sunjianlei---date:20210819------for: 处理联动列,联动列只能作用于 select 组件
if (col.$type === JVXETypes.select && this._innerLinkageConfig != null) {
// 判断当前列是否是联动列
if (this._innerLinkageConfig.has(col.key)) {
let configItem = this._innerLinkageConfig.get(col.key)
const configItem = this._innerLinkageConfig.get(col.key)
this.getLinkageOptionsAsync(configItem, '')
}
}
@@ -1264,7 +1265,7 @@ export default {
props: this.vxeProps,
on: this.vxeEvents,
// 作用域插槽的格式为
scopedSlots: this.$scopedSlots,
scopedSlots: this.$scopedSlots
})
},
// 渲染工具栏
@@ -1277,7 +1278,7 @@ export default {
size: this.size,
disabled: this.disabled,
disabledRows: this.disabledRows,
selectedRowIds: this.selectedRowIds,
selectedRowIds: this.selectedRowIds
},
on: {
// 新增事件
@@ -1285,15 +1286,15 @@ export default {
// 保存事件
save: () => this.trigger('save', {
$table: this.$refs.vxe,
target: this,
target: this
}),
// 删除事件
remove: () => {
let $table = this.$refs.vxe
let deleteRows = this.filterNewRows(this.selectedRows)
const $table = this.$refs.vxe
const deleteRows = this.filterNewRows(this.selectedRows)
// 触发删除事件
if (deleteRows.length > 0) {
let removeEvent = {deleteRows, $table, target: this}
const removeEvent = { deleteRows, $table, target: this }
if (this.asyncRemove) {
// 确认删除,只有调用这个方法才会真删除
removeEvent.confirmRemove = () => this.removeSelection()
@@ -1310,16 +1311,16 @@ export default {
},
scopedSlots: {
toolbarPrefix: this.$scopedSlots.toolbarPrefix,
toolbarSuffix: this.$scopedSlots.toolbarSuffix,
},
toolbarSuffix: this.$scopedSlots.toolbarSuffix
}
})
}
return null
},
// 渲染 toolbarAfter 插槽
renderToolbarAfterSlot () {
if (this.$scopedSlots['toolbarAfter']) {
return this.$scopedSlots['toolbarAfter']()
if (this.$scopedSlots.toolbarAfter) {
return this.$scopedSlots.toolbarAfter()
}
return null
},
@@ -1329,7 +1330,7 @@ export default {
return h('j-vxe-sub-popover', {
ref: 'subPopover',
scopedSlots: {
subForm: this.$scopedSlots.subForm,
subForm: this.$scopedSlots.subForm
}
})
}
@@ -1358,7 +1359,7 @@ export default {
},
on: {
change: (e) => this.trigger('pageChange', e)
},
}
})
}
return null
@@ -1385,7 +1386,7 @@ export default {
this.renderToolbar(h),
this.renderToolbarAfterSlot(),
this.renderVxeGrid(h),
this.renderPagination(h),
this.renderPagination(h)
])
},
beforeDestroy () {
@@ -1406,7 +1407,7 @@ const fooPatterns = [
{ title: '字母', value: 's', pattern: /^[A-Z|a-z]+$/ },
{ title: '数字', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/ },
{ title: '整数', value: 'z', pattern: /^-?\d+$/ },
{title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/},
{ title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/ }
]
/** 旧版handler转为新版Validator */
@@ -1420,7 +1421,7 @@ function handlerConvertToValidator(event) {
}
if (flag == null) {
resolve(message)
} else if (!!flag) {
} else if (flag) {
resolve(message)
} else {
reject(new Error(message))
@@ -1432,9 +1433,9 @@ function handlerConvertToValidator(event) {
/** 唯一校验器 */
function uniqueValidator (event) {
const { cellValue, column, rule } = event
let tableData = this.getTableData()
const tableData = this.getTableData()
let findCount = 0
for (let rowData of tableData) {
for (const rowData of tableData) {
if (rowData[column.own.key] === cellValue) {
if (++findCount >= 2) {
return Promise.reject(new Error(rule.message))
@@ -37,25 +37,25 @@
size: String,
disabled: Boolean,
disabledRows: Object,
selectedRowIds: Array,
selectedRowIds: Array
},
data () {
return {
// 是否收起
collapsed: true,
collapsed: true
}
},
computed: {
boxClass () {
return {
'j-vxe-toolbar': true,
'j-vxe-toolbar-collapsed': this.collapsed,
'j-vxe-toolbar-collapsed': this.collapsed
}
},
btns () {
let arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection']
let exclude = [...this.excludeCode]
const arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection']
const exclude = [...this.excludeCode]
// TODO 需要将remove替换batch_delete
// 系统默认的批量删除编码配置为 batch_delete 此处需要转化一下
if (exclude.indexOf('batch_delete') >= 0) {
@@ -88,7 +88,7 @@
if (this.btns.includes('clearSelection')) {
// 有禁用行时才显示清空选择按钮
// 因为禁用行会阻止选择行,导致无法取消全选
let length = Object.keys(this.disabledRows).length
const length = Object.keys(this.disabledRows).length
return length > 0
}
return false
@@ -99,7 +99,7 @@
btnSize () {
return this.size === 'tiny' ? 'small' : null
},
}
},
methods: {
/** 触发事件 */
@@ -109,8 +109,8 @@
// 切换展开收起
toggleCollapse () {
this.collapsed = !this.collapsed
},
},
}
}
}
</script>
@@ -37,23 +37,23 @@
style['text-align'] = 'center'
}
return style
},
}
},
methods: {
handleChange (event) {
this.handleChangeCommon(event.target.checked)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: {
visible: true,
visible: true
},
getValue (value) {
let {own: col} = this.column
const { own: col } = this.column
// 处理 customValue
if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col)
const customValue = getCustomValue(col)
if (typeof value === 'boolean') {
return value ? customValue[0] : customValue[1]
} else {
@@ -64,30 +64,30 @@
}
},
setValue (value) {
let {own: col} = this.column
const { own: col } = this.column
// 判断是否设定了customValue(自定义值)
if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col)
const customValue = getCustomValue(col)
return neverNull(value).toString() === customValue[0].toString()
} else {
return !!value
}
},
createValue ({ column }) {
let {own: col} = column
const { own: col } = column
if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col)
const customValue = getCustomValue(col)
return col.defaultChecked ? customValue[0] : customValue[1]
} else {
return !!col.defaultChecked
}
},
}
}
}
function getCustomValue (col) {
let customTrue = neverNull(col.customValue[0], true)
let customFalse = neverNull(col.customValue[1], false)
const customTrue = neverNull(col.customValue[0], true)
const customFalse = neverNull(col.customValue[1], false)
return [customTrue, customFalse]
}
</script>
@@ -23,7 +23,7 @@
props: {},
data () {
return {
innerDateValue: null,
innerDateValue: null
}
},
computed: {
@@ -31,9 +31,9 @@
return this.$type === JVXETypes.datetime
},
dateFormat () {
let format = this.originColumn.format
return format ? format : (this.isDatetime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')
},
const format = this.originColumn.format
return format || (this.isDatetime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')
}
},
watch: {
innerValue: {
@@ -57,8 +57,8 @@
aopEvents: {
editActived (event) {
dispatchEvent.call(this, event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event))
},
},
}
}
}
}
</script>
@@ -108,7 +108,7 @@
this.departIds = ''
} else {
value = rows.map(row => row[this.customReturnField]).join(',')
this.departNames = rows.map(row => row['departName']).join(',')
this.departNames = rows.map(row => row.departName).join(',')
this.departIds = idstr
}
this.handleChangeCommon(this.departIds)
@@ -35,7 +35,7 @@
},
disabledMoveDown () {
return this.rowIndex === (this.fullDataLength - 1)
},
}
},
methods: {
/** 向上移 */
@@ -55,15 +55,15 @@
/** 插入一行 */
handleRowInsertDown () {
this.trigger('rowInsertDown', this.rowIndex)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
// 【功能开关】
switches: {
editRender: false
},
},
}
}
}
</script>
@@ -20,8 +20,8 @@
/** 处理change事件 */
handleChange (event) {
let {$type} = this
let {target} = event
const { $type } = this
const { target } = event
let { value, selectionStart } = target
let change = true
if ($type === JVXETypes.inputNumber) {
@@ -48,8 +48,8 @@
/** 处理blur失去焦点事件 */
handleBlur (event) {
let {$type} = this
let {target} = event
const { $type } = this
const { target } = event
// 判断输入的值是否匹配数字正则表达式,不匹配就置空
if ($type === JVXETypes.inputNumber) {
if (!NumberRegExp.test(target.value)) {
@@ -61,14 +61,14 @@
}
this.handleBlurCommon(target.value)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
installOptions: {
// 自动聚焦的 class 类名
autofocus: '.ant-input',
autofocus: '.ant-input'
},
getValue (value) {
if (this.$type === JVXETypes.inputNumber && typeof value === 'string') {
@@ -77,7 +77,7 @@
}
}
return value
},
}
}
}
</script>
@@ -20,19 +20,19 @@
},
reloadEffect () {
return (this.renderOptions.reloadEffect && this.reloadEffectRowKeysMap[this.row.id]) === true
},
}
},
methods: {
// 特效结束
handleEffectEnd () {
this.$delete(this.reloadEffectRowKeysMap, this.row.id)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: {
editRender: false,
},
editRender: false
}
}
}
</script>
@@ -26,13 +26,13 @@
},
scrolling () {
return !!this.renderOptions.scrolling
},
}
},
methods: {},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: {
editRender: false,
editRender: false
},
setValue (value) {
try {
@@ -44,7 +44,7 @@
} catch {
return 0
}
},
}
}
}
</script>
@@ -37,16 +37,16 @@
return {
loading: false,
// 异步加载的options(用于多级联动)
asyncOptions: null,
asyncOptions: null
}
},
computed: {
selectProps () {
let props = {...this.cellProps}
const props = { ...this.cellProps }
// 判断select是否允许输入
let {allowSearch, allowInput} = this.originColumn
const { allowSearch, allowInput } = this.originColumn
if (allowInput === true || allowSearch === true) {
props['showSearch'] = true
props.showSearch = true
}
return props
},
@@ -55,10 +55,10 @@
if (this.asyncOptions) {
return this.asyncOptions
}
let {linkage} = this.renderOptions
const { linkage } = this.renderOptions
if (linkage) {
let {getLinkageOptionsSibling, config} = linkage
let res = getLinkageOptionsSibling(this.row, this.originColumn, config, true)
const { getLinkageOptionsSibling, config } = linkage
const res = getLinkageOptionsSibling(this.row, this.originColumn, config, true)
// 当返回Promise时,说明是多级联动
if (res instanceof Promise) {
this.loading = true
@@ -75,16 +75,16 @@
}
}
return this.originColumn.options
},
}
},
created () {
let multiple = [JVXETypes.selectMultiple, JVXETypes.list_multi]
let search = [JVXETypes.selectSearch, JVXETypes.sel_search]
const multiple = [JVXETypes.selectMultiple, JVXETypes.list_multi]
const search = [JVXETypes.selectSearch, JVXETypes.sel_search]
if (multiple.includes(this.$type)) {
// 处理多选
let props = this.originColumn.props || {}
props['mode'] = 'multiple'
props['maxTagCount'] = 1
const props = this.originColumn.props || {}
props.mode = 'multiple'
props.maxTagCount = 1
this.$set(this.originColumn, 'props', props)
} else if (search.includes(this.$type)) {
// 处理搜索
@@ -94,7 +94,7 @@
methods: {
handleChange (value) {
// 处理下级联动
let linkage = this.renderOptions.linkage
const linkage = this.renderOptions.linkage
if (linkage) {
linkage.linkageSelectChange(this.row, this.originColumn, linkage.config, value)
}
@@ -102,12 +102,12 @@
},
/** 处理blur失去焦点事件 */
handleBlur (value) {
let {allowInput, options} = this.originColumn
const { allowInput, options } = this.originColumn
if (allowInput === true) {
// 删除无用的因搜索(用户输入)而创建的项
if (typeof value === 'string') {
let indexes = []
const indexes = []
options.forEach((option, index) => {
if (option.value.toLocaleString() === value.toLocaleString()) {
delete option.searchAdd
@@ -116,7 +116,7 @@
}
})
// 翻转删除数组中的项
for (let index of indexes.reverse()) {
for (const index of indexes.reverse()) {
options.splice(index, 1)
}
}
@@ -127,7 +127,7 @@
/** 用于搜索下拉框中的内容 */
handleSelectFilterOption (input, option) {
let {allowSearch, allowInput} = this.originColumn
const { allowSearch, allowInput } = this.originColumn
if (allowSearch === true || allowInput === true) {
// update-begin-author:taoyan date:20200820 for:【专项任务】大连项目反馈行编辑问题处理 下拉框搜索
return option.componentOptions.children[0].children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -138,12 +138,12 @@
/** select 搜索时的事件,用于动态添加options */
handleSearchSelect (value) {
let {allowSearch, allowInput, options} = this.originColumn
const { allowSearch, allowInput, options } = this.originColumn
if (allowSearch !== true && allowInput === true) {
// 是否找到了对应的项,找不到则添加这一项
let flag = false
for (let option of options) {
for (const option of options) {
if (option.value.toLocaleString() === value.toLocaleString()) {
flag = true
break
@@ -154,9 +154,8 @@
// searchAdd 是否是通过搜索添加的
options.push({ title: value, value: value, searchAdd: true })
}
}
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
@@ -164,16 +163,16 @@
aopEvents: {
editActived (event) {
dispatchEvent.call(this, event, 'ant-select')
},
}
},
translate: {
enabled: true,
async handler(value,) {
async handler (value) {
let options
let {linkage} = this.renderOptions
const { linkage } = this.renderOptions
// 判断是否是多级联动,如果是就通过接口异步翻译
if (linkage) {
let {getLinkageOptionsSibling, config} = linkage
const { getLinkageOptionsSibling, config } = linkage
options = getLinkageOptionsSibling(this.row, this.originColumn, config, true)
if (options instanceof Promise) {
return new Promise(resolve => {
@@ -186,7 +185,7 @@
options = this.column.own.options
}
return filterDictText(options, value)
},
}
},
getValue (value) {
if (Array.isArray(value)) {
@@ -196,9 +195,9 @@
}
},
setValue (value) {
let {column: {own: col}, params: {$table}} = this
const { column: { own: col }, params: { $table } } = this
// 判断是否是多选
if ((col.props || {})['mode'] === 'multiple') {
if ((col.props || {}).mode === 'multiple') {
$table.$set(col.props, 'maxTagCount', 1)
}
if (value != null && value !== '') {
@@ -23,12 +23,12 @@ export default {
scrolling: this.renderOptions.scrolling,
reloadEffect: this.renderOptions.reloadEffect,
triggerChange: (v) => this.handleChangeCommon(v),
triggerChange: (v) => this.handleChangeCommon(v)
}
}
},
},
render (h) {
let {slot} = this.renderOptions
const { slot } = this.renderOptions
if (slot) {
return h('div', {}, slot(this.slotProps))
} else {
@@ -39,7 +39,7 @@ export default {
enhanced: {
switches: {
editRender: false
},
}
}
}
@@ -6,7 +6,7 @@ export const TagsSpanCell = {
mixins: [JVxeCellMixins],
data () {
return {
innerTags: [],
innerTags: []
}
},
watch: {
@@ -14,21 +14,21 @@ export const TagsSpanCell = {
immediate: true,
handler (value) {
if (value !== this.innerTags.join(';')) {
let rv = replaceValue(value)
const rv = replaceValue(value)
this.innerTags = rv.split(';')
this.handleChangeCommon(rv)
}
},
},
}
}
},
methods: {
renderTags (h) {
let tags = []
for (let tag of this.innerTags) {
const tags = []
for (const tag of this.innerTags) {
if (tag) {
let tagProps = {}
let tagStyle = {}
let setTagColor = this.originColumn.setTagColor
const tagProps = {}
const tagStyle = {}
const setTagColor = this.originColumn.setTagColor
if (typeof setTagColor === 'function') {
/**
* 设置 tag 颜色
@@ -41,11 +41,11 @@ export const TagsSpanCell = {
* event.column.own 当前列的原始配置
* @return Array | String 可以返回一个数组,数据第一项是tag背景颜色,第二项是字体颜色。也可以返回一个字符串,即tag背景颜色
*/
let color = setTagColor({
const color = setTagColor({
tagValue: tag,
value: this.innerValue,
row: this.row,
column: this.column,
column: this.column
})
if (Array.isArray(color)) {
tagProps.color = color[0]
@@ -56,18 +56,18 @@ export const TagsSpanCell = {
}
tags.push(h('a-tag', {
props: tagProps,
style: tagStyle,
style: tagStyle
}, [tag]))
}
}
return tags
},
}
},
render (h) {
return h('div', {}, [
this.renderTags(h)
])
},
}
}
// tags 组件的输入框
@@ -76,7 +76,7 @@ export const TagsInputCell = {
mixins: [JVxeCellMixins],
data () {
return {
innerTagValue: '',
innerTagValue: ''
}
},
watch: {
@@ -86,8 +86,8 @@ export const TagsInputCell = {
if (value !== this.innerTagValue) {
this.handleInputChange(value)
}
},
},
}
}
},
methods: {
@@ -95,7 +95,7 @@ export const TagsInputCell = {
this.innerTagValue = replaceValue(value, event)
this.handleChangeCommon(this.innerTagValue)
return this.innerTagValue
},
}
},
render (h) {
@@ -106,15 +106,15 @@ export const TagsInputCell = {
},
on: {
change: (event) => {
let {target, target: {value}} = event
let newValue = this.handleInputChange(value, event)
const { target, target: { value } } = event
const newValue = this.handleInputChange(value, event)
if (newValue !== value) {
target.value = newValue
}
}
},
}
})
},
}
}
// 将值每隔两位加上一个分号
@@ -124,18 +124,18 @@ function replaceValue(value, event) {
value = value.replace(/;/g, '')
// 然后再遍历添加分号
let rv = ''
let splitArr = value.split('')
const splitArr = value.split('')
let count = 0
splitArr.forEach((val, index) => {
rv += val
let position = index + 1
const position = index + 1
if (position % 2 === 0 && position < splitArr.length) {
count++
rv += ';'
}
})
if (event && count > 0) {
let {target, target: {selectionStart}} = event
const { target, target: { selectionStart } } = event
target.selectionStart = selectionStart + count
target.selectionEnd = selectionStart + count
}
@@ -20,14 +20,14 @@
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
installOptions: {
autofocus: '.ant-input',
autofocus: '.ant-input'
},
aopEvents: {
editActived (event) {
dispatchEvent.call(this, event, 'anticon-fullscreen')
},
},
},
}
}
}
}
</script>
@@ -71,14 +71,14 @@
props: {},
data () {
return {
innerFile: null,
innerFile: null
}
},
computed: {
/** upload headers */
uploadHeaders () {
let {originColumn: col} = this
let headers = {}
const { originColumn: col } = this
const headers = {}
if (col.token === true) {
headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN)
}
@@ -87,7 +87,7 @@
hasFile () {
return this.innerFile != null
},
}
},
watch: {
@@ -99,15 +99,15 @@
} else {
this.innerFile = null
}
},
},
}
}
},
methods: {
handleChangeUpload (info) {
let {row, originColumn: col} = this
let {file} = info
let value = {
const { row, originColumn: col } = this
const { file } = info
const value = {
name: file.name,
type: file.type,
size: file.size,
@@ -115,22 +115,22 @@
percent: file.percent
}
if (col.responseName && file.response) {
value['responseName'] = file.response[col.responseName]
value.responseName = file.response[col.responseName]
}
if (file.status === 'done') {
if (typeof file.response.success === 'boolean') {
if (file.response.success) {
value['path'] = file.response[col.responseName]
value.path = file.response[col.responseName]
} else {
value['status'] = 'error'
value['message'] = file.response.message || '未知错误'
value.status = 'error'
value.message = file.response.message || '未知错误'
}
} else {
// 考虑到如果设置action上传路径为非jeecg-boot后台,可能不会返回 success 属性的情况,就默认为成功
value['path'] = file.response[col.responseName]
value.path = file.response[col.responseName]
}
} else if (file.status === 'error') {
value['message'] = file.response.message || '未知错误'
value.message = file.response.message || '未知错误'
}
this.innerFile = value
},
@@ -140,23 +140,23 @@
// },
handleClickDownloadFile (id) {
let {path} = this.value || {}
const { path } = this.value || {}
if (path) {
let url = getFileAccessHttpUrl(path)
const url = getFileAccessHttpUrl(path)
window.open(url)
}
},
handleClickDeleteFile () {
this.handleChangeCommon(null)
},
}
},
// 【组件增强】注释详见:JVxeCellMixins.js
enhanced: {
switches: { visible: true },
getValue: value => fileGetValue(value),
setValue: value => fileSetValue(value),
setValue: value => fileSetValue(value)
}
}
@@ -169,12 +169,12 @@
function fileSetValue (value) {
if (value) {
let first = value.split(',')[0]
let name = first.substring(first.lastIndexOf('/') + 1)
const first = value.split(',')[0]
const name = first.substring(first.lastIndexOf('/') + 1)
return {
name: name,
path: value,
status: 'done',
status: 'done'
}
}
return value
@@ -96,14 +96,14 @@
this.$refs.selectModal.showModal()
},
selectOK (rows, idstr) {
console.log("当前选中用户", rows)
console.log("当前选中用户ID", idstr)
console.log('当前选中用户', rows)
console.log('当前选中用户ID', idstr)
if (!rows) {
this.userNames = ''
this.userIds = ''
} else {
let temp = ''
for (let item of rows) {
for (const item of rows) {
temp += ',' + item.realname
}
this.userNames = temp.substring(1)
@@ -116,7 +116,7 @@
},
initComp (userNames) {
this.userNames = userNames
},
}
},
enhanced: {
switches: {
@@ -6,7 +6,7 @@ export default {
props: {
vNode: null,
// 是否启用特效
effect: Boolean,
effect: Boolean
},
data () {
return {
@@ -14,7 +14,7 @@ export default {
innerEffect: false,
// 应付同时多个特效
effectIdx: 0,
effectList: [],
effectList: []
}
},
watch: {
@@ -24,11 +24,11 @@ export default {
handler (vNode, old) {
this.innerEffect = this.effect
if (this.innerEffect && old != null) {
let topLayer = this.renderSpan(old, 'top')
const topLayer = this.renderSpan(old, 'top')
this.effectList.push(topLayer)
}
},
},
}
}
},
methods: {
@@ -37,13 +37,13 @@ export default {
if (this.vNode == null) {
return null
}
let bottom = this.renderSpan(this.vNode, 'bottom')
const bottom = this.renderSpan(this.vNode, 'bottom')
// 启用了特效,并且有旧数据,就渲染特效顶层
if (this.innerEffect && this.effectList.length > 0) {
this.$emit('effect-begin')
// 1.4s 以后关闭特效
window.setTimeout(() => {
let item = this.effectList[this.effectIdx]
const item = this.effectList[this.effectIdx]
if (item && item.elm) {
// 特效结束后,展示先把 display 设为 none,而不是直接删掉该元素,
// 目的是为了防止页面重新渲染,导致动画重置
@@ -64,21 +64,21 @@ export default {
},
// 渲染内容 span
renderSpan (vNode, layer) {
let options = {
const options = {
key: layer + this.effectIdx + randomString(6),
class: ['j-vxe-reload-effect-span', `layer-${layer}`],
style: {},
style: {}
}
if (layer === 'top') {
// 最新渲染的在下面
options.style['z-index'] = (9999 - this.effectIdx)
}
return this.$createElement('span', options, [vNode])
},
}
},
render (h) {
return h('div', {
class: ['j-vxe-reload-effect-box'],
class: ['j-vxe-reload-effect-box']
}, [this.renderVNode()])
},
}
}
@@ -43,16 +43,16 @@ installAllCell(VXETable)
// 比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
VXETable.interceptor.add('event.clearActived', function (params, event, target) {
// 获取组件增强
let col = params.column.own
const col = params.column.own
const interceptor = getEnhancedMixins(col.$type, 'interceptor')
// 执行增强
let flag = interceptor['event.clearActived'].apply(this, arguments)
const flag = interceptor['event.clearActived'].apply(this, arguments)
if (flag === false) {
return false
}
let path = getEventPath(event)
for (let p of path) {
const path = getEventPath(event)
for (const p of path) {
let className = p.className || ''
className = typeof className === 'string' ? className : className.toString()
@@ -67,7 +67,7 @@ VXETable.interceptor.add('event.clearActived', function (params, event, target)
return false
}
// 执行增强
let flag = interceptor['event.clearActived.className'].apply(this, [className, ...arguments])
const flag = interceptor['event.clearActived.className'].apply(this, [className, ...arguments])
if (flag === false) {
return false
}
@@ -81,7 +81,7 @@ VXETable.interceptor.add('event.clearActived', function (params, event, target)
* @param span 显示组件,可空,默认为 JVxeNormalCell 组件
*/
export function mapCell (type, cell, span) {
let cells = {[type]: cell}
const cells = { [type]: cell }
if (span) {
cells[type + ':span'] = span
}
@@ -96,7 +96,7 @@ export function mapCell(type, cell, span) {
* @param span 显示组件,可空,默认为 JVxeNormalCell 组件
*/
export function installCell (type, cell, span) {
let exclude = [JVXETypes.rowNumber, JVXETypes.rowCheckbox, JVXETypes.rowRadio, JVXETypes.rowExpand, JVXETypes.rowDragSort]
const exclude = [JVXETypes.rowNumber, JVXETypes.rowCheckbox, JVXETypes.rowRadio, JVXETypes.rowExpand, JVXETypes.rowDragSort]
if (exclude.includes(type)) {
throw new Error(`【installCell】不能使用"${type}"作为组件的type,因为这是关键字。`)
}
@@ -40,5 +40,5 @@ export const JVXETypes = {
slot: 'slot',
normal: 'normal',
hidden: 'hidden',
hidden: 'hidden'
}
@@ -5,7 +5,7 @@ import { getEnhancedMixins, JVXERenderType, replaceProps } from '@/components/je
// noinspection JSUnusedLocalSymbols
export default {
inject: {
getParentContainer: {default: () => ((node) => node.parentNode)},
getParentContainer: { default: () => (node) => node.parentNode }
},
props: {
value: PropTypes.any,
@@ -16,11 +16,11 @@ export default {
// 渲染选项
renderOptions: PropTypes.object,
// 渲染类型
renderType: PropTypes.string.def('default'),
renderType: PropTypes.string.def('default')
},
data () {
return {
innerValue: null,
innerValue: null
}
},
computed: {
@@ -46,12 +46,12 @@ export default {
return this.params.columnIndex
},
cellProps () {
let {originColumn: col, renderOptions} = this
const { originColumn: col, renderOptions } = this
let props = {}
const props = {}
// 输入占位符
props['placeholder'] = replaceProps(col, col.placeholder)
props.placeholder = replaceProps(col, col.placeholder)
// 解析props
if (typeof col.props === 'object') {
@@ -61,7 +61,7 @@ export default {
}
// 判断是否是禁用的列
props['disabled'] = (typeof col['disabled'] === 'boolean' ? col['disabled'] : props['disabled'])
props.disabled = (typeof col.disabled === 'boolean' ? col.disabled : props.disabled)
// TODO 判断是否是禁用的行
// if (props['disabled'] !== true) {
@@ -70,11 +70,11 @@ export default {
// 判断是否禁用所有组件
if (renderOptions.disabled === true) {
props['disabled'] = true
props.disabled = true
}
return props
},
}
},
watch: {
$type: {
@@ -82,7 +82,7 @@ export default {
handler ($type) {
this.enhanced = getEnhancedMixins($type)
this.listeners = getListeners.call(this)
},
}
},
value: {
immediate: true,
@@ -90,8 +90,8 @@ export default {
let value = val
// 验证值格式
let originValue = this.row[this.column.property]
let getValue = this.enhanced.getValue.call(this, originValue)
const originValue = this.row[this.column.property]
const getValue = this.enhanced.getValue.call(this, originValue)
if (originValue !== getValue) {
// 值格式不正确,重新赋值
value = getValue
@@ -102,7 +102,7 @@ export default {
// 判断是否启用翻译
if (this.renderType === JVXERenderType.spaner && this.enhanced.translate.enabled) {
let res = this.enhanced.translate.handler.call(this, value)
const res = this.enhanced.translate.handler.call(this, value)
// 异步翻译,目前仅【多级联动】使用
if (res instanceof Promise) {
res.then(value => this.innerValue = value)
@@ -110,8 +110,8 @@ export default {
this.innerValue = res
}
}
},
},
}
}
},
created () {
},
@@ -119,7 +119,7 @@ export default {
/** 通用处理change事件 */
handleChangeCommon (value) {
let handle = this.enhanced.getValue.call(this, value)
const handle = this.enhanced.getValue.call(this, value)
this.trigger('change', { value: handle })
// 触发valueChange事件
this.parentTrigger('valueChange', {
@@ -128,7 +128,7 @@ export default {
oldValue: this.value,
col: this.originColumn,
rowIndex: this.params.rowIndex,
columnIndex: this.params.columnIndex,
columnIndex: this.params.columnIndex
})
},
/** 通用处理blur事件 */
@@ -143,7 +143,7 @@ export default {
* @param args 其他附带参数
*/
trigger (name, event, args = []) {
let listener = this.listeners[name]
const listener = this.listeners[name]
if (typeof listener === 'function') {
if (typeof event === 'object') {
event = this.packageEvent(name, event)
@@ -159,7 +159,7 @@ export default {
event.row = this.row
event.column = this.column
// online增强参数兼容
event.column['key'] = this.column['property']
event.column.key = this.column.property
event.cellTarget = this
if (!event.type) {
event.type = name
@@ -172,7 +172,7 @@ export default {
event.validate = true
}
return event
},
}
},
model: {
@@ -190,20 +190,20 @@ export default {
// 注册参数(详见:https://xuliangzhan_admin.gitee.io/vxe-table/#/table/renderer/edit)
installOptions: {
// 自动聚焦的 class 类名
autofocus: '',
autofocus: ''
},
// 事件拦截器(用于兼容)
interceptor: {
// 已实现:event.clearActived
// 说明:比如点击了某个组件的弹出层面板之后,此时被激活单元格不应该被自动关闭,通过返回 false 可以阻止默认的行为。
['event.clearActived'](params, event, target) {
'event.clearActived' (params, event, target) {
return true
},
// 自定义:event.clearActived.className
// 说明:比原生的多了一个参数:className,用于判断点击的元素的样式名(递归到顶层)
['event.clearActived.className'](params, event, target) {
'event.clearActived.className' (params, event, target) {
return true
},
}
},
// 【功能开关】
switches: {
@@ -211,7 +211,7 @@ export default {
// 如果设为true,则表头上方会出现一个可编辑的图标
editRender: true,
// false = 组件触发后可视);true = 组件一直可视
visible: false,
visible: false
},
// 【切面增强】切面事件处理,一般在某些方法执行后同步执行
aopEvents: {
@@ -220,7 +220,7 @@ export default {
},
// 单元格编辑状态下被关闭时会触发该事件
editClosed () {
},
}
},
// 【翻译增强】可以实现例如select组件保存的value,但是span模式下需要显示成text
translate: {
@@ -233,10 +233,10 @@ export default {
* @param value 需要翻译的值
* @returns{*} 返回翻译后的数据
*/
handler(value,) {
handler (value) {
// 默认翻译方法
return filterDictText(this.column.own.options, value)
},
}
},
/**
* 【获取值增强】组件抛出的值
@@ -271,12 +271,12 @@ export default {
*/
createValue ({ row, column, $table, renderOptions, params }) {
return column.own.defaultValue
},
}
}
}
function getListeners () {
let listeners = Object.assign({}, (this.renderOptions.listeners || {}))
const listeners = Object.assign({}, (this.renderOptions.listeners || {}))
if (!listeners.change) {
listeners.change = async (event) => {
vModel.call(this, event.value)
@@ -305,7 +305,7 @@ export function dispatchEvent({cell, $event}, className, handler) {
return
}
window.setTimeout(() => {
let element = cell.getElementsByClassName(className)
const element = cell.getElementsByClassName(className)
if (element && element.length > 0) {
if (typeof handler === 'function') {
handler(element[0])
@@ -17,7 +17,7 @@ const vs = {
// 消息类型:通用数据传递
TYPE_CSD: 'common_send_date',
// 消息类型:更新vxe table数据
TYPE_UVT: 'update_vxe_table',
TYPE_UVT: 'update_vxe_table'
},
// 心跳检测
heartCheck: {
@@ -42,14 +42,14 @@ const vs = {
back () {
this.clear()
window.setTimeout(() => this.start(), this.interval)
},
}
},
/** 初始化 WebSocket */
initialWebSocket () {
if (this.ws === null) {
const userId = store.getters.userInfo.id
const domain = window._CONFIG['domianURL'].replace('https://', 'wss://').replace('http://', 'ws://')
const domain = window._CONFIG.domianURL.replace('https://', 'wss://').replace('http://', 'ws://')
const url = `${domain}/vxeSocket/${userId}/${this.pageId}`
this.ws = new WebSocket(url)
@@ -65,7 +65,7 @@ const vs = {
// 发送消息
sendMessage (type, message) {
try {
let ws = this.ws
const ws = this.ws
if (ws != null && ws.readyState === ws.OPEN) {
ws.send(JSON.stringify({
type: type,
@@ -82,7 +82,7 @@ const vs = {
CSDMap: new Map(),
/** 添加绑定 */
addBind (map, key, value) {
let binds = map.get(key)
const binds = map.get(key)
if (Array.isArray(binds)) {
binds.push(value)
} else {
@@ -91,10 +91,10 @@ const vs = {
},
/** 移除绑定 */
removeBind (map, key, value) {
let binds = map.get(key)
const binds = map.get(key)
if (Array.isArray(binds)) {
for (let i = 0; i < binds.length; i++) {
let bind = binds[i]
const bind = binds[i]
if (bind === value) {
binds.splice(i, 1)
break
@@ -109,7 +109,7 @@ const vs = {
},
// 呼叫绑定的表单
callBind (map, key, callback) {
let binds = map.get(key)
const binds = map.get(key)
if (Array.isArray(binds)) {
binds.forEach(callback)
}
@@ -149,8 +149,8 @@ const vs = {
console.warn('【VXEWebSocket】收到无法解析的消息:', e.data)
return
}
let type = json[this.constants.TYPE]
let data = json[this.constants.DATA]
const type = json[this.constants.TYPE]
const data = json[this.constants.DATA]
switch (type) {
// 心跳检测
case this.constants.TYPE_HB:
@@ -162,7 +162,7 @@ const vs = {
break
// 更新form数据
case this.constants.TYPE_UVT:
this.callBind(this.tableMap, data.socketKey, (vm) => this.onVM['onUpdateTable'].apply(vm, data.args))
this.callBind(this.tableMap, data.socketKey, (vm) => this.onVM.onUpdateTable.apply(vm, data.args))
break
default:
console.warn('【VXEWebSocket】收到不识别的消息类型:' + type)
@@ -172,7 +172,7 @@ const vs = {
close (e) {
console.log('【VXEWebSocket】连接被关闭:', e)
this.reconnect()
},
}
},
onVM: {
@@ -184,8 +184,8 @@ const vs = {
// 局部保更新数据
if (tableRow) {
// 特殊处理拖轮状态
if (row['tug_status'] && tableRow['tug_status']) {
row['tug_status'] = Object.assign({}, tableRow['tug_status'], row['tug_status'])
if (row.tug_status && tableRow.tug_status) {
row.tug_status = Object.assign({}, tableRow.tug_status, row.tug_status)
}
// 判断是否启用重载特效
if (this.reloadEffect) {
@@ -199,8 +199,8 @@ const vs = {
this.$refs.vxe.reloadRow(tableRow)
}
}
},
},
}
}
}
@@ -214,7 +214,7 @@ export default {
socketKey: {
type: String,
default: 'vxe-default'
},
}
},
data () {
return {}
@@ -231,14 +231,14 @@ export default {
socketSendUpdateRow (row) {
vs.sendMessage(vs.constants.TYPE_UVT, {
socketKey: this.socketKey,
args: [row, this.caseId],
args: [row, this.caseId]
})
},
}
},
beforeDestroy () {
vs.removeBind(vs.tableMap, this.socketKey, this)
},
}
}
/**
@@ -4,7 +4,7 @@ import JVxeCellMixins from '../mixins/JVxeCellMixins'
export const JVXERenderType = {
editer: 'editer',
spaner: 'spaner',
default: 'default',
default: 'default'
}
/** 安装所有vxe组件 */
@@ -40,7 +40,7 @@ export function installEditRender(VXETable, type, comp, spanComp) {
// 显示模板
renderCell: createRender(spanComp, enhanced, JVXERenderType.spaner),
// 增强注册
...enhanced.installOptions,
...enhanced.installOptions
})
}
@@ -52,7 +52,7 @@ export function installCellRender(VXETable, type, comp = AllCells[JVXETypes.norm
// 默认显示模板
renderDefault: createRender(comp, enhanced, JVXERenderType.default),
// 增强注册
...enhanced.installOptions,
...enhanced.installOptions
})
}
@@ -65,7 +65,7 @@ function createRender(comp, enhanced, renderType) {
column: params.column,
params: params,
renderOptions: renderOptions,
renderType: renderType,
renderType: renderType
}
})]
}
@@ -76,7 +76,7 @@ const AllCellsMixins = new Map()
/** 获取某个组件的增强 */
export function getEnhanced (type) {
let cell = AllCells[type]
const cell = AllCells[type]
if (cell && cell.enhanced) {
return cell.enhanced
}
@@ -94,11 +94,11 @@ export function getEnhancedMixins(type, name) {
if (AllCellsMixins.has(type)) {
return getByName(AllCellsMixins.get(type))
}
let defEnhanced = JVxeCellMixins.enhanced
let enhanced = getEnhanced(type)
const defEnhanced = JVxeCellMixins.enhanced
const enhanced = getEnhanced(type)
if (enhanced) {
Object.keys(defEnhanced).forEach(key => {
let def = defEnhanced[key]
const def = defEnhanced[key]
if (enhanced.hasOwnProperty(key)) {
// 方法如果存在就不覆盖
if (typeof def !== 'function' && typeof def !== 'string') {
@@ -115,7 +115,6 @@ export function getEnhancedMixins(type, name) {
return getByName(defEnhanced)
}
/** 辅助方法:替换${...}变量 */
export function replaceProps (col, value) {
if (value && typeof value === 'string') {
@@ -12,7 +12,7 @@ export const VALIDATE_FAILED = Symbol()
export function getRefPromise (vm, name) {
return new Promise((resolve) => {
(function next () {
let ref = vm.$refs[name]
const ref = vm.$refs[name]
if (ref) {
resolve(ref)
} else {
@@ -28,7 +28,7 @@ export function getRefPromise(vm, name) {
export function getInputNumberMaxValue (col, rowsValues) {
let maxNum = 0
Object.values(rowsValues).forEach((rowValue, index) => {
let val = rowValue[col.key], num
const val = rowValue[col.key]; let num
try {
num = Number.parseFloat(val)
} catch {
@@ -75,10 +75,10 @@ export function getParentNodeByTagName(dom, tagName = 'body') {
export function vxePackageToSuperQuery (columns, handler) {
if (Array.isArray(columns)) {
// 高级查询所需要的参数
let fieldList = []
const fieldList = []
// 遍历列
for (let i = 0; i < columns.length; i++) {
let col = columns[i]
const col = columns[i]
if (col.type === JVXETypes.rowCheckbox ||
col.type === JVXETypes.rowRadio ||
col.type === JVXETypes.rowExpand ||
@@ -86,11 +86,11 @@ export function vxePackageToSuperQuery(columns, handler) {
) {
continue
}
let field = {
const field = {
type: 'string',
value: col.key,
text: col.title,
dictCode: col.dictCode || col.dict,
dictCode: col.dictCode || col.dict
}
if (col.type === JVXETypes.date || col.type === JVXETypes.datetime) {
field.type = col.type
@@ -127,7 +127,7 @@ export async function validateFormAndTables(form, cases, autoJumpTab) {
throw `form 参数需要的是一个form对象,而传入的却是${typeof form}`
}
let dataMap = {}
let values = await new Promise((resolve, reject) => {
const values = await new Promise((resolve, reject) => {
// 验证主表表单
form.validateFields((err, values) => {
err ? reject({ error: VALIDATE_FAILED, originError: err }) : resolve(values)
@@ -135,7 +135,7 @@ export async function validateFormAndTables(form, cases, autoJumpTab) {
})
Object.assign(dataMap, { formValue: values })
// 验证所有子表的表单
let subData = await validateTables(cases, autoJumpTab)
const subData = await validateTables(cases, autoJumpTab)
// 合并最终数据
dataMap = Object.assign(dataMap, { tablesValue: subData })
return dataMap
@@ -154,7 +154,7 @@ export async function validateFormModelAndTables(form,formData, cases, autoJumpT
throw `form 参数需要的是一个form对象,而传入的却是${typeof form}`
}
let dataMap = {}
let values = await new Promise((resolve, reject) => {
const values = await new Promise((resolve, reject) => {
// 验证主表表单
form.validate((valid, obj) => {
valid ? resolve(formData) : reject({ error: VALIDATE_FAILED, originError: valid })
@@ -162,7 +162,7 @@ export async function validateFormModelAndTables(form,formData, cases, autoJumpT
})
Object.assign(dataMap, { formValue: values })
// 验证所有子表的表单
let subData = await validateTables(cases, autoJumpTab)
const subData = await validateTables(cases, autoJumpTab)
// 合并最终数据
dataMap = Object.assign(dataMap, { tablesValue: subData })
return dataMap
@@ -179,13 +179,13 @@ export function validateTables(cases, autoJumpTab = true) {
throw `'validateTables'函数的'cases'参数需要的是一个数组,而传入的却是${typeof cases}`
}
return new Promise((resolve, reject) => {
let tablesData = []
const tablesData = []
let index = 0
if (!cases || cases.length === 0) {
resolve()
}
(function next () {
let vm = cases[index]
const vm = cases[index]
vm.validateTable().then(errMap => {
// 校验通过
if (!errMap) {
@@ -193,18 +193,20 @@ export function validateTables(cases, autoJumpTab = true) {
// 判断校验是否全部完成,完成返回成功,否则继续进行下一步校验
if (++index === cases.length) {
resolve(tablesData)
} else (
} else {
(
next()
)
}
} else {
// 尝试获取tabKey,如果在ATab组件内即可获取
let paneKey
let tabPane = getVmParentByName(vm, 'ATabPane')
const tabPane = getVmParentByName(vm, 'ATabPane')
if (tabPane) {
paneKey = tabPane.$vnode.key
// 自动跳转到该表格
if (autoJumpTab) {
let tabs = getVmParentByName(tabPane, 'Tabs')
const tabs = getVmParentByName(tabPane, 'Tabs')
tabs && tabs.setActiveKey && tabs.setActiveKey(paneKey)
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ import JSlider from './JSlider.vue'
import JSwitch from './JSwitch.vue'
import JTime from './JTime.vue'
import JTreeTable from './JTreeTable.vue'
import JEasyCron from "@/components/jero/JEasyCron"
import JEasyCron from '@/components/jero/JEasyCron'
// jerobiz
import JSelectDepart from '../jerobiz/JSelectDepart.vue'
import JSelectMultiUser from '../jerobiz/JSelectMultiUser.vue'
@@ -14,14 +14,14 @@
</template>
<script>
import { getFileAccessHttpUrl } from '@/api/manage';
import { getFileAccessHttpUrl } from '@/api/manage'
const getFileName = (path) => {
if(path.lastIndexOf("\\")>=0){
let reg=new RegExp("\\\\","g");
path = path.replace(reg,"/");
if (path.lastIndexOf('\\') >= 0) {
const reg = new RegExp('\\\\', 'g')
path = path.replace(reg, '/')
}
return path.substring(path.lastIndexOf("/")+1);
return path.substring(path.lastIndexOf('/') + 1)
}
export default {
@@ -76,26 +76,25 @@
},
methods: {
handleChange (value) {
this.filePath = value;
this.filePath = value
},
show (id, value, flag) {
this.id = id;
this.filePath = value;
this.id = id
this.filePath = value
this.visible = true
if (flag === 'img') {
this.fileType = 'image'
} else {
this.fileType = 'file'
}
},
ok () {
if (!this.filePath) {
this.$message.error("未上传任何文件")
return false;
this.$message.error('未上传任何文件')
return false
}
let arr = this.filePath.split(",")
let obj = {
const arr = this.filePath.split(',')
const obj = {
name: getFileName(arr[0]),
url: getFileAccessHttpUrl(arr[0]),
path: this.filePath,
@@ -51,8 +51,8 @@
},
disabled: {
type: Boolean,
default: false,
},
default: false
}
},
data () {
@@ -68,10 +68,10 @@
immediate: true,
handler: function () {
if (this.value && this.value.length > 0) {
this.inputContent = this.value;
this.inputContent = this.value
}
}
}
},
},
model: {
prop: 'value',
@@ -94,7 +94,6 @@
} else {
return document.getElementById(this.popContainer)
}
}
}
}
+258 -261
View File
@@ -276,7 +276,7 @@
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 0,
specificSpecific:[],
specificSpecific: []
},
minute: {
cronEvery: '',
@@ -284,7 +284,7 @@
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: '0',
specificSpecific:[],
specificSpecific: []
},
hour: {
cronEvery: '',
@@ -292,7 +292,7 @@
incrementIncrement: 5,
rangeStart: '0',
rangeEnd: '0',
specificSpecific:[],
specificSpecific: []
},
day: {
cronEvery: '',
@@ -303,7 +303,7 @@
specificSpecific: [],
cronLastSpecificDomDay: 1,
cronDaysBeforeEomMinus: 1,
cronDaysNearestWeekday:1,
cronDaysNearestWeekday: 1
},
week: {
cronEvery: '',
@@ -311,7 +311,7 @@
incrementIncrement: 1,
specificSpecific: [],
cronNthDayDay: 1,
cronNthDayNth:1,
cronNthDayNth: 1
},
month: {
cronEvery: '',
@@ -319,7 +319,7 @@
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 1,
specificSpecific:[],
specificSpecific: []
},
year: {
cronEvery: '',
@@ -327,7 +327,7 @@
incrementIncrement: 1,
rangeStart: 2019,
rangeEnd: 2019,
specificSpecific:[],
specificSpecific: []
},
label: ''
}
@@ -335,188 +335,188 @@
},
computed: {
modalWidth () {
return 608;
return 608
},
secondsText () {
let seconds = '';
let cronEvery=this.result.second.cronEvery||'';
let seconds = ''
const cronEvery = this.result.second.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
seconds = '*';
break;
seconds = '*'
break
case '2':
seconds = this.result.second.incrementStart+'/'+this.result.second.incrementIncrement;
break;
seconds = this.result.second.incrementStart + '/' + this.result.second.incrementIncrement
break
case '3':
this.result.second.specificSpecific.map(val=> {seconds += val+','});
seconds = seconds.slice(0, -1);
break;
this.result.second.specificSpecific.map(val => { seconds += val + ',' })
seconds = seconds.slice(0, -1)
break
case '4':
seconds = this.result.second.rangeStart+'-'+this.result.second.rangeEnd;
break;
seconds = this.result.second.rangeStart + '-' + this.result.second.rangeEnd
break
}
return seconds;
return seconds
},
minutesText () {
let minutes = '';
let cronEvery=this.result.minute.cronEvery||'';
let minutes = ''
const cronEvery = this.result.minute.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
minutes = '*';
break;
minutes = '*'
break
case '2':
minutes = this.result.minute.incrementStart+'/'+this.result.minute.incrementIncrement;
break;
minutes = this.result.minute.incrementStart + '/' + this.result.minute.incrementIncrement
break
case '3':
this.result.minute.specificSpecific.map(val => {
minutes += val + ','
});
minutes = minutes.slice(0, -1);
break;
})
minutes = minutes.slice(0, -1)
break
case '4':
minutes = this.result.minute.rangeStart+'-'+this.result.minute.rangeEnd;
break;
minutes = this.result.minute.rangeStart + '-' + this.result.minute.rangeEnd
break
}
return minutes;
return minutes
},
hoursText () {
let hours = '';
let cronEvery=this.result.hour.cronEvery||'';
let hours = ''
const cronEvery = this.result.hour.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
hours = '*';
break;
hours = '*'
break
case '2':
hours = this.result.hour.incrementStart+'/'+this.result.hour.incrementIncrement;
break;
hours = this.result.hour.incrementStart + '/' + this.result.hour.incrementIncrement
break
case '3':
this.result.hour.specificSpecific.map(val => {
hours += val + ','
});
hours = hours.slice(0, -1);
break;
})
hours = hours.slice(0, -1)
break
case '4':
hours = this.result.hour.rangeStart+'-'+this.result.hour.rangeEnd;
break;
hours = this.result.hour.rangeStart + '-' + this.result.hour.rangeEnd
break
}
return hours;
return hours
},
daysText () {
let days='';
let cronEvery=this.result.day.cronEvery||'';
let days = ''
const cronEvery = this.result.day.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
break;
break
case '2':
case '4':
case '11':
days = '?';
break;
days = '?'
break
case '3':
days = this.result.day.incrementStart+'/'+this.result.day.incrementIncrement;
break;
days = this.result.day.incrementStart + '/' + this.result.day.incrementIncrement
break
case '5':
this.result.day.specificSpecific.map(val => {
days += val + ','
});
days = days.slice(0, -1);
break;
})
days = days.slice(0, -1)
break
case '6':
days = "L";
break;
days = 'L'
break
case '7':
days = "LW";
break;
days = 'LW'
break
case '8':
days = this.result.day.cronLastSpecificDomDay + 'L';
break;
days = this.result.day.cronLastSpecificDomDay + 'L'
break
case '9':
days = 'L-' + this.result.day.cronDaysBeforeEomMinus;
break;
days = 'L-' + this.result.day.cronDaysBeforeEomMinus
break
case '10':
days = this.result.day.cronDaysNearestWeekday+"W";
days = this.result.day.cronDaysNearestWeekday + 'W'
break
}
return days;
return days
},
weeksText () {
let weeks = '';
let cronEvery=this.result.day.cronEvery||'';
let weeks = ''
const cronEvery = this.result.day.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
case '3':
case '5':
weeks = '?';
break;
weeks = '?'
break
case '2':
weeks = this.result.week.incrementStart+'/'+this.result.week.incrementIncrement;
break;
weeks = this.result.week.incrementStart + '/' + this.result.week.incrementIncrement
break
case '4':
this.result.week.specificSpecific.map(val => {
weeks += val + ','
});
weeks = weeks.slice(0, -1);
break;
})
weeks = weeks.slice(0, -1)
break
case '6':
case '7':
case '8':
case '9':
case '10':
weeks = "?";
break;
weeks = '?'
break
case '11':
weeks = this.result.week.cronNthDayDay+"#"+this.result.week.cronNthDayNth;
break;
weeks = this.result.week.cronNthDayDay + '#' + this.result.week.cronNthDayNth
break
}
return weeks;
return weeks
},
monthsText () {
let months = '';
let cronEvery=this.result.month.cronEvery||'';
let months = ''
const cronEvery = this.result.month.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
months = '*';
break;
months = '*'
break
case '2':
months = this.result.month.incrementStart+'/'+this.result.month.incrementIncrement;
break;
months = this.result.month.incrementStart + '/' + this.result.month.incrementIncrement
break
case '3':
this.result.month.specificSpecific.map(val => {
months += val + ','
});
months = months.slice(0, -1);
break;
})
months = months.slice(0, -1)
break
case '4':
months = this.result.month.rangeStart+'-'+this.result.month.rangeEnd;
break;
months = this.result.month.rangeStart + '-' + this.result.month.rangeEnd
break
}
return months;
return months
},
yearsText () {
let years = '';
let cronEvery=this.result.year.cronEvery||'';
let years = ''
const cronEvery = this.result.year.cronEvery || ''
switch (cronEvery.toString()) {
case '1':
years = '*';
break;
years = '*'
break
case '2':
years = this.result.year.incrementStart+'/'+this.result.year.incrementIncrement;
break;
years = this.result.year.incrementStart + '/' + this.result.year.incrementIncrement
break
case '3':
this.result.year.specificSpecific.map(val => {
years += val + ','
});
years = years.slice(0, -1);
break;
})
years = years.slice(0, -1)
break
case '4':
years = this.result.year.rangeStart+'-'+this.result.year.rangeEnd;
break;
years = this.result.year.rangeStart + '-' + this.result.year.rangeEnd
break
}
return years;
return years
},
cron () {
return `${this.secondsText || '*'} ${this.minutesText || '*'} ${this.hoursText || '*'} ${this.daysText || '*'} ${this.monthsText || '*'} ${this.weeksText || '?'} ${this.yearsText || '*'}`
},
}
},
watch: {
visible: {
@@ -531,145 +531,144 @@
// //this.result = clone(this.defaultValue);
// this.result = JSON.parse(JSON.stringify(this.defaultValue));
// }
let label = this.data;
const label = this.data
if (label) {
this.secondsReverseExp(label)
this.minutesReverseExp(label);
this.hoursReverseExp(label);
this.daysReverseExp(label);
this.daysReverseExp(label);
this.monthsReverseExp(label);
this.yearReverseExp(label);
JSON.parse(JSON.stringify(label));
this.minutesReverseExp(label)
this.hoursReverseExp(label)
this.daysReverseExp(label)
this.daysReverseExp(label)
this.monthsReverseExp(label)
this.yearReverseExp(label)
JSON.parse(JSON.stringify(label))
} else {
this.result = JSON.parse(JSON.stringify(this.defaultValue));
this.result = JSON.parse(JSON.stringify(this.defaultValue))
}
}
}
},
methods: {
show () {
this.visible = true;
this.visible = true
// console.log('secondsReverseExp',this.secondsReverseExp(this.data));
// console.log('minutesReverseExp',this.minutesReverseExp(this.data));
// console.log('hoursReverseExp',this.hoursReverseExp(this.data));
// console.log('daysReverseExp',this.daysReverseExp(this.data));
// console.log('monthsReverseExp',this.monthsReverseExp(this.data));
// console.log('yearReverseExp',this.yearReverseExp(this.data));
},
handleSubmit () {
this.$emit('ok',this.cron);
this.close();
this.visible = false;
this.$emit('ok', this.cron)
this.close()
this.visible = false
},
close () {
this.visible = false;
this.visible = false
},
secondsReverseExp (seconds) {
let val = seconds.split(" ")[0];
const val = seconds.split(' ')[0]
// alert(val);
let second = {
const second = {
cronEvery: '',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 0,
specificSpecific: []
};
}
switch (true) {
case val.includes('*'):
second.cronEvery = '1';
break;
second.cronEvery = '1'
break
case val.includes('/'):
second.cronEvery = '2';
second.incrementStart = val.split('/')[0];
second.incrementIncrement = val.split('/')[1];
break;
second.cronEvery = '2'
second.incrementStart = val.split('/')[0]
second.incrementIncrement = val.split('/')[1]
break
case val.includes(','):
second.cronEvery = '3';
second.specificSpecific = val.split(',').map(Number).sort();
break;
second.cronEvery = '3'
second.specificSpecific = val.split(',').map(Number).sort()
break
case val.includes('-'):
second.cronEvery = '4';
second.rangeStart = val.split('-')[0];
second.rangeEnd = val.split('-')[1];
break;
second.cronEvery = '4'
second.rangeStart = val.split('-')[0]
second.rangeEnd = val.split('-')[1]
break
default:
second.cronEvery = '1';
second.cronEvery = '1'
}
this.result.second = second;
this.result.second = second
},
minutesReverseExp (minutes) {
let val = minutes.split(" ")[1];
let minute = {
const val = minutes.split(' ')[1]
const minute = {
cronEvery: '',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 0,
specificSpecific:[],
specificSpecific: []
}
switch (true) {
case val.includes('*'):
minute.cronEvery = '1';
break;
minute.cronEvery = '1'
break
case val.includes('/'):
minute.cronEvery = '2';
minute.incrementStart = val.split('/')[0];
minute.incrementIncrement = val.split('/')[1];
break;
minute.cronEvery = '2'
minute.incrementStart = val.split('/')[0]
minute.incrementIncrement = val.split('/')[1]
break
case val.includes(','):
minute.cronEvery = '3';
minute.specificSpecific = val.split(',').map(Number).sort();
break;
minute.cronEvery = '3'
minute.specificSpecific = val.split(',').map(Number).sort()
break
case val.includes('-'):
minute.cronEvery = '4';
minute.rangeStart = val.split('-')[0];
minute.rangeEnd = val.split('-')[1];
break;
minute.cronEvery = '4'
minute.rangeStart = val.split('-')[0]
minute.rangeEnd = val.split('-')[1]
break
default:
minute.cronEvery = '1';
minute.cronEvery = '1'
}
this.result.minute = minute;
this.result.minute = minute
},
hoursReverseExp (hours) {
let val = hours.split(" ")[2];
let hour ={
const val = hours.split(' ')[2]
const hour = {
cronEvery: '',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: '0',
specificSpecific:[],
};
specificSpecific: []
}
switch (true) {
case val.includes('*'):
hour.cronEvery = '1';
break;
hour.cronEvery = '1'
break
case val.includes('/'):
hour.cronEvery = '2';
hour.incrementStart = val.split('/')[0];
hour.incrementIncrement = val.split('/')[1];
break;
hour.cronEvery = '2'
hour.incrementStart = val.split('/')[0]
hour.incrementIncrement = val.split('/')[1]
break
case val.includes(','):
hour.cronEvery = '3';
hour.specificSpecific = val.split(',').map(Number).sort();
break;
hour.cronEvery = '3'
hour.specificSpecific = val.split(',').map(Number).sort()
break
case val.includes('-'):
hour.cronEvery = '4';
hour.rangeStart = val.split('-')[0];
hour.rangeEnd = val.split('-')[1];
break;
hour.cronEvery = '4'
hour.rangeStart = val.split('-')[0]
hour.rangeEnd = val.split('-')[1]
break
default:
hour.cronEvery = '1';
hour.cronEvery = '1'
}
this.result.hour = hour;
this.result.hour = hour
},
daysReverseExp (cron) {
let days = cron.split(" ")[3];
let weeks = cron.split(" ")[5];
let day ={
const days = cron.split(' ')[3]
const weeks = cron.split(' ')[5]
const day = {
cronEvery: '',
incrementStart: 1,
incrementIncrement: 1,
@@ -678,152 +677,150 @@
specificSpecific: [],
cronLastSpecificDomDay: 1,
cronDaysBeforeEomMinus: 1,
cronDaysNearestWeekday:1,
};
let week = {
cronDaysNearestWeekday: 1
}
const week = {
cronEvery: '',
incrementStart: 1,
incrementIncrement: 1,
specificSpecific: [],
cronNthDayDay: 1,
cronNthDayNth:'1',
};
cronNthDayNth: '1'
}
if (!days.includes('?')) {
switch (true) {
case days.includes('*'):
day.cronEvery = '1';
break;
day.cronEvery = '1'
break
case days.includes('?'):
// 2、4、11
break;
break
case days.includes('/'):
day.cronEvery = '3';
day.incrementStart = days.split('/')[0];
day.incrementIncrement = days.split('/')[1];
break;
day.cronEvery = '3'
day.incrementStart = days.split('/')[0]
day.incrementIncrement = days.split('/')[1]
break
case days.includes(','):
day.cronEvery = '5';
day.specificSpecific = days.split(',').map(Number).sort();
day.cronEvery = '5'
day.specificSpecific = days.split(',').map(Number).sort()
// day.specificSpecific.forEach(function (value, index) {
// day.specificSpecific[index] = value -1;
// });
break;
break
case days.includes('LW'):
day.cronEvery = '7';
break;
day.cronEvery = '7'
break
case days.includes('L-'):
day.cronEvery = '9';
day.cronDaysBeforeEomMinus = days.split('L-')[1];
break;
day.cronEvery = '9'
day.cronDaysBeforeEomMinus = days.split('L-')[1]
break
case days.includes('L'):
// alert(days);
if (days.len == 1) {
day.cronEvery = '6';
day.cronLastSpecificDomDay = '1';
day.cronEvery = '6'
day.cronLastSpecificDomDay = '1'
} else {
day.cronEvery = '8'
day.cronLastSpecificDomDay = Number(days.split('L')[0])
}
else
{
day.cronEvery = '8';
day.cronLastSpecificDomDay = Number(days.split('L')[0]);
}
break;
break
case days.includes('W'):
day.cronEvery = '10';
day.cronDaysNearestWeekday = days.split('W')[0];
break;
day.cronEvery = '10'
day.cronDaysNearestWeekday = days.split('W')[0]
break
default:
day.cronEvery = '1';
day.cronEvery = '1'
}
} else {
switch (true) {
case weeks.includes('/'):
day.cronEvery = '2';
week.incrementStart = weeks.split("/")[0];
week.incrementIncrement = weeks.split("/")[1];
break;
day.cronEvery = '2'
week.incrementStart = weeks.split('/')[0]
week.incrementIncrement = weeks.split('/')[1]
break
case weeks.includes(','):
day.cronEvery = '4';
week.specificSpecific = weeks.split(',').map(Number).sort();
break;
day.cronEvery = '4'
week.specificSpecific = weeks.split(',').map(Number).sort()
break
case '#':
day.cronEvery = '11';
week.cronNthDayDay = weeks.split("#")[0];
week.cronNthDayNth = weeks.split("#")[1];
break;
day.cronEvery = '11'
week.cronNthDayDay = weeks.split('#')[0]
week.cronNthDayNth = weeks.split('#')[1]
break
default:
day.cronEvery = '1';
week.cronEvery = '1';
day.cronEvery = '1'
week.cronEvery = '1'
}
}
this.result.day = day;
this.result.week = week;
this.result.day = day
this.result.week = week
},
monthsReverseExp (cron) {
let months = cron.split(" ")[4];
let month = {
const months = cron.split(' ')[4]
const month = {
cronEvery: '',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 1,
rangeEnd: 1,
specificSpecific:[],
};
specificSpecific: []
}
switch (true) {
case months.includes('*'):
month.cronEvery = '1';
break;
month.cronEvery = '1'
break
case months.includes('/'):
month.cronEvery = '2';
month.incrementStart = months.split('/')[0];
month.incrementIncrement = months.split('/')[1];
break;
month.cronEvery = '2'
month.incrementStart = months.split('/')[0]
month.incrementIncrement = months.split('/')[1]
break
case months.includes(','):
month.cronEvery = '3';
month.specificSpecific = months.split(',').map(Number).sort();
break;
month.cronEvery = '3'
month.specificSpecific = months.split(',').map(Number).sort()
break
case months.includes('-'):
month.cronEvery = '4';
month.rangeStart = months.split('-')[0];
month.rangeEnd = months.split('-')[1];
break;
month.cronEvery = '4'
month.rangeStart = months.split('-')[0]
month.rangeEnd = months.split('-')[1]
break
default:
month.cronEvery = '1';
month.cronEvery = '1'
}
this.result.month = month;
this.result.month = month
},
yearReverseExp (cron) {
let years = cron.split(" ")[6];
let year = {
const years = cron.split(' ')[6]
const year = {
cronEvery: '',
incrementStart: 3,
incrementIncrement: 5,
rangeStart: 2019,
rangeEnd: 2019,
specificSpecific:[],
};
specificSpecific: []
}
switch (true) {
case years.includes('*'):
year.cronEvery = '1';
break;
year.cronEvery = '1'
break
case years.includes('/'):
year.cronEvery = '2';
year.incrementStart = years.split('/')[0];
year.incrementIncrement = years.split('/')[1];
break;
year.cronEvery = '2'
year.incrementStart = years.split('/')[0]
year.incrementIncrement = years.split('/')[1]
break
case years.includes(','):
year.cronEvery = '3';
year.specificSpecific = years.split(',').map(Number).sort();
break;
year.cronEvery = '3'
year.specificSpecific = years.split(',').map(Number).sort()
break
case years.includes('-'):
year.cronEvery = '4';
year.rangeStart = years.split('-')[0];
year.rangeEnd = years.split('-')[1];
break;
year.cronEvery = '4'
year.rangeStart = years.split('-')[0]
year.rangeEnd = years.split('-')[1]
break
default:
year.cronEvery = '1';
year.cronEvery = '1'
}
this.result.year = year;
this.result.year = year
}
}
}

Some files were not shown because too many files have changed in this diff Show More