【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: { resolve: {
extensions: ['.js', '.vue', '.json'], extensions: ['.js', '.vue', '.json'],
alias: { alias: {
'config': resolve('config'), config: resolve('config'),
'@': resolve('src'), '@': resolve('src'),
'@views': resolve('src/views'), '@views': resolve('src/views'),
'@comp': resolve('src/components'), '@comp': resolve('src/components'),
+6 -6
View File
@@ -2,11 +2,11 @@
* 防止打包部署时路径被写死 * 防止打包部署时路径被写死
*/ */
window._CONFIG = {} window._CONFIG = {}
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer window._CONFIG.domianURL = '/jero-boot' // 路由转发 devServer
window._CONFIG['domianWebSocketURL'] = 'http://localhost:8080' window._CONFIG.domianWebSocketURL = 'http://localhost:8080'
// 单点登录地址 // 单点登录地址
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download' window._CONFIG.staticDomainURL = window._CONFIG.domianURL + '/sys/common/download'
window._CONFIG['pdfDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe' window._CONFIG.pdfDomainURL = window._CONFIG.domianURL + '/sys/common/pdf/pdfPreviewIframe'
window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas' 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
+261 -261
View File
@@ -1,261 +1,261 @@
tinymce.addI18n('zh_CN',{ tinymce.addI18n('zh_CN', {
"Redo": "\u91cd\u590d", Redo: '\u91cd\u590d',
"Undo": "\u64a4\u6d88", Undo: '\u64a4\u6d88',
"Cut": "\u526a\u5207", Cut: '\u526a\u5207',
"Copy": "\u590d\u5236", Copy: '\u590d\u5236',
"Paste": "\u7c98\u8d34", Paste: '\u7c98\u8d34',
"Select all": "\u5168\u9009", 'Select all': '\u5168\u9009',
"New document": "\u65b0\u6587\u6863", 'New document': '\u65b0\u6587\u6863',
"Ok": "\u786e\u5b9a", Ok: '\u786e\u5b9a',
"Cancel": "\u53d6\u6d88", Cancel: '\u53d6\u6d88',
"Visual aids": "\u7f51\u683c\u7ebf", 'Visual aids': '\u7f51\u683c\u7ebf',
"Bold": "\u7c97\u4f53", Bold: '\u7c97\u4f53',
"Italic": "\u659c\u4f53", Italic: '\u659c\u4f53',
"Underline": "\u4e0b\u5212\u7ebf", Underline: '\u4e0b\u5212\u7ebf',
"Strikethrough": "\u5220\u9664\u7ebf", Strikethrough: '\u5220\u9664\u7ebf',
"Superscript": "\u4e0a\u6807", Superscript: '\u4e0a\u6807',
"Subscript": "\u4e0b\u6807", Subscript: '\u4e0b\u6807',
"Clear formatting": "\u6e05\u9664\u683c\u5f0f", 'Clear formatting': '\u6e05\u9664\u683c\u5f0f',
"Align left": "\u5de6\u5bf9\u9f50", 'Align left': '\u5de6\u5bf9\u9f50',
"Align center": "\u5c45\u4e2d", 'Align center': '\u5c45\u4e2d',
"Align right": "\u53f3\u5bf9\u9f50", 'Align right': '\u53f3\u5bf9\u9f50',
"Justify": "\u4e24\u7aef\u5bf9\u9f50", Justify: '\u4e24\u7aef\u5bf9\u9f50',
"Bullet list": "\u9879\u76ee\u7b26\u53f7", 'Bullet list': '\u9879\u76ee\u7b26\u53f7',
"Numbered list": "\u7f16\u53f7\u5217\u8868", 'Numbered list': '\u7f16\u53f7\u5217\u8868',
"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb", 'Decrease indent': '\u51cf\u5c11\u7f29\u8fdb',
"Increase indent": "\u589e\u52a0\u7f29\u8fdb", 'Increase indent': '\u589e\u52a0\u7f29\u8fdb',
"Close": "\u5173\u95ed", Close: '\u5173\u95ed',
"Formats": "\u683c\u5f0f", 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", "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", Headers: '\u6807\u9898',
"Header 1": "\u6807\u98981", 'Header 1': '\u6807\u98981',
"Header 2": "\u6807\u98982", 'Header 2': '\u6807\u98982',
"Header 3": "\u6807\u98983", 'Header 3': '\u6807\u98983',
"Header 4": "\u6807\u98984", 'Header 4': '\u6807\u98984',
"Header 5": "\u6807\u98985", 'Header 5': '\u6807\u98985',
"Header 6": "\u6807\u98986", 'Header 6': '\u6807\u98986',
"Headings": "\u6807\u9898", Headings: '\u6807\u9898',
"Heading 1": "\u6807\u98981", 'Heading 1': '\u6807\u98981',
"Heading 2": "\u6807\u98982", 'Heading 2': '\u6807\u98982',
"Heading 3": "\u6807\u98983", 'Heading 3': '\u6807\u98983',
"Heading 4": "\u6807\u98984", 'Heading 4': '\u6807\u98984',
"Heading 5": "\u6807\u98985", 'Heading 5': '\u6807\u98985',
"Heading 6": "\u6807\u98986", 'Heading 6': '\u6807\u98986',
"Preformatted": "\u9884\u683c\u5f0f\u5316", Preformatted: '\u9884\u683c\u5f0f\u5316',
"Div": "Div\u533a\u5757", Div: 'Div\u533a\u5757',
"Pre": "\u9884\u683c\u5f0f\u6587\u672c", Pre: '\u9884\u683c\u5f0f\u6587\u672c',
"Code": "\u4ee3\u7801", Code: '\u4ee3\u7801',
"Paragraph": "\u6bb5\u843d", Paragraph: '\u6bb5\u843d',
"Blockquote": "\u5f15\u7528", Blockquote: '\u5f15\u7528',
"Inline": "\u6587\u672c", Inline: '\u6587\u672c',
"Blocks": "\u533a\u5757", 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", '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 Family': '\u5b57\u4f53',
"Font Sizes": "\u5b57\u53f7", 'Font Sizes': '\u5b57\u53f7',
"Class": "Class", Class: 'Class',
"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf", 'Browse for an image': '\u6d4f\u89c8\u56fe\u50cf',
"OR": "\u6216", OR: '\u6216',
"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64", 'Drop an image here': '\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64',
"Upload": "\u4e0a\u4f20", Upload: '\u4e0a\u4f20',
"Block": "\u5757", Block: '\u5757',
"Align": "\u5bf9\u9f50", Align: '\u5bf9\u9f50',
"Default": "\u9ed8\u8ba4", Default: '\u9ed8\u8ba4',
"Circle": "\u7a7a\u5fc3\u5706", Circle: '\u7a7a\u5fc3\u5706',
"Disc": "\u5b9e\u5fc3\u5706", Disc: '\u5b9e\u5fc3\u5706',
"Square": "\u65b9\u5757", Square: '\u65b9\u5757',
"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd", 'Lower Alpha': '\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd',
"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd", 'Lower Greek': '\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd',
"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd", 'Lower Roman': '\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd',
"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd", 'Upper Alpha': '\u5927\u5199\u82f1\u6587\u5b57\u6bcd',
"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd", 'Upper Roman': '\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd',
"Anchor": "\u951a\u70b9", Anchor: '\u951a\u70b9',
"Name": "\u540d\u79f0", Name: '\u540d\u79f0',
"Id": "\u6807\u8bc6\u7b26", 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", '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", '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", 'Restore last draft': '\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f',
"Special character": "\u7279\u6b8a\u7b26\u53f7", 'Special character': '\u7279\u6b8a\u7b26\u53f7',
"Source code": "\u6e90\u4ee3\u7801", 'Source code': '\u6e90\u4ee3\u7801',
"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b", 'Insert\/Edit code sample': '\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b',
"Language": "\u8bed\u8a00", Language: '\u8bed\u8a00',
"Code sample": "\u4ee3\u7801\u793a\u4f8b", 'Code sample': '\u4ee3\u7801\u793a\u4f8b',
"Color": "\u989c\u8272", Color: '\u989c\u8272',
"R": "R", R: 'R',
"G": "G", G: 'G',
"B": "B", B: 'B',
"Left to right": "\u4ece\u5de6\u5230\u53f3", 'Left to right': '\u4ece\u5de6\u5230\u53f3',
"Right to left": "\u4ece\u53f3\u5230\u5de6", 'Right to left': '\u4ece\u53f3\u5230\u5de6',
"Emoticons": "\u8868\u60c5", Emoticons: '\u8868\u60c5',
"Document properties": "\u6587\u6863\u5c5e\u6027", 'Document properties': '\u6587\u6863\u5c5e\u6027',
"Title": "\u6807\u9898", Title: '\u6807\u9898',
"Keywords": "\u5173\u952e\u8bcd", Keywords: '\u5173\u952e\u8bcd',
"Description": "\u63cf\u8ff0", Description: '\u63cf\u8ff0',
"Robots": "\u673a\u5668\u4eba", Robots: '\u673a\u5668\u4eba',
"Author": "\u4f5c\u8005", Author: '\u4f5c\u8005',
"Encoding": "\u7f16\u7801", Encoding: '\u7f16\u7801',
"Fullscreen": "\u5168\u5c4f", Fullscreen: '\u5168\u5c4f',
"Action": "\u64cd\u4f5c", Action: '\u64cd\u4f5c',
"Shortcut": "\u5feb\u6377\u952e", Shortcut: '\u5feb\u6377\u952e',
"Help": "\u5e2e\u52a9", Help: '\u5e2e\u52a9',
"Address": "\u5730\u5740", Address: '\u5730\u5740',
"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f", 'Focus to menubar': '\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f',
"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\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 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", '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)", '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)", '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)", '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}):", 'Plugins installed ({0}):': '\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):',
"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a", 'Premium plugins:': '\u4f18\u79c0\u63d2\u4ef6\uff1a',
"Learn more...": "\u4e86\u89e3\u66f4\u591a...", 'Learn more...': '\u4e86\u89e3\u66f4\u591a...',
"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}", 'You are using {0}': '\u4f60\u6b63\u5728\u4f7f\u7528 {0}',
"Plugins": "\u63d2\u4ef6", Plugins: '\u63d2\u4ef6',
"Handy Shortcuts": "\u5feb\u6377\u952e", 'Handy Shortcuts': '\u5feb\u6377\u952e',
"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf", 'Horizontal line': '\u6c34\u5e73\u5206\u5272\u7ebf',
"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247", 'Insert\/edit image': '\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247',
"Image description": "\u56fe\u7247\u63cf\u8ff0", 'Image description': '\u56fe\u7247\u63cf\u8ff0',
"Source": "\u5730\u5740", Source: '\u5730\u5740',
"Dimensions": "\u5927\u5c0f", Dimensions: '\u5927\u5c0f',
"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4", 'Constrain proportions': '\u4fdd\u6301\u7eb5\u6a2a\u6bd4',
"General": "\u666e\u901a", General: '\u666e\u901a',
"Advanced": "\u9ad8\u7ea7", Advanced: '\u9ad8\u7ea7',
"Style": "\u6837\u5f0f", Style: '\u6837\u5f0f',
"Vertical space": "\u5782\u76f4\u8fb9\u8ddd", 'Vertical space': '\u5782\u76f4\u8fb9\u8ddd',
"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd", 'Horizontal space': '\u6c34\u5e73\u8fb9\u8ddd',
"Border": "\u8fb9\u6846", Border: '\u8fb9\u6846',
"Insert image": "\u63d2\u5165\u56fe\u7247", 'Insert image': '\u63d2\u5165\u56fe\u7247',
"Image": "\u56fe\u7247", Image: '\u56fe\u7247',
"Image list": "\u56fe\u7247\u5217\u8868", 'Image list': '\u56fe\u7247\u5217\u8868',
"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c", 'Rotate counterclockwise': '\u9006\u65f6\u9488\u65cb\u8f6c',
"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c", 'Rotate clockwise': '\u987a\u65f6\u9488\u65cb\u8f6c',
"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c", 'Flip vertically': '\u5782\u76f4\u7ffb\u8f6c',
"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c", 'Flip horizontally': '\u6c34\u5e73\u7ffb\u8f6c',
"Edit image": "\u7f16\u8f91\u56fe\u7247", 'Edit image': '\u7f16\u8f91\u56fe\u7247',
"Image options": "\u56fe\u7247\u9009\u9879", 'Image options': '\u56fe\u7247\u9009\u9879',
"Zoom in": "\u653e\u5927", 'Zoom in': '\u653e\u5927',
"Zoom out": "\u7f29\u5c0f", 'Zoom out': '\u7f29\u5c0f',
"Crop": "\u88c1\u526a", Crop: '\u88c1\u526a',
"Resize": "\u8c03\u6574\u5927\u5c0f", Resize: '\u8c03\u6574\u5927\u5c0f',
"Orientation": "\u65b9\u5411", Orientation: '\u65b9\u5411',
"Brightness": "\u4eae\u5ea6", Brightness: '\u4eae\u5ea6',
"Sharpen": "\u9510\u5316", Sharpen: '\u9510\u5316',
"Contrast": "\u5bf9\u6bd4\u5ea6", Contrast: '\u5bf9\u6bd4\u5ea6',
"Color levels": "\u989c\u8272\u5c42\u6b21", 'Color levels': '\u989c\u8272\u5c42\u6b21',
"Gamma": "\u4f3d\u9a6c\u503c", Gamma: '\u4f3d\u9a6c\u503c',
"Invert": "\u53cd\u8f6c", Invert: '\u53cd\u8f6c',
"Apply": "\u5e94\u7528", Apply: '\u5e94\u7528',
"Back": "\u540e\u9000", Back: '\u540e\u9000',
"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4", 'Insert date\/time': '\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4',
"Date\/time": "\u65e5\u671f\/\u65f6\u95f4", 'Date\/time': '\u65e5\u671f\/\u65f6\u95f4',
"Insert link": "\u63d2\u5165\u94fe\u63a5", 'Insert link': '\u63d2\u5165\u94fe\u63a5',
"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5", 'Insert\/edit link': '\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5',
"Text to display": "\u663e\u793a\u6587\u5b57", 'Text to display': '\u663e\u793a\u6587\u5b57',
"Url": "\u5730\u5740", Url: '\u5730\u5740',
"Target": "\u6253\u5f00\u65b9\u5f0f", Target: '\u6253\u5f00\u65b9\u5f0f',
"None": "\u65e0", None: '\u65e0',
"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00", 'New window': '\u5728\u65b0\u7a97\u53e3\u6253\u5f00',
"Remove link": "\u5220\u9664\u94fe\u63a5", 'Remove link': '\u5220\u9664\u94fe\u63a5',
"Anchors": "\u951a\u70b9", Anchors: '\u951a\u70b9',
"Link": "\u94fe\u63a5", Link: '\u94fe\u63a5',
"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\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 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", '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", 'Link list': '\u94fe\u63a5\u5217\u8868',
"Insert video": "\u63d2\u5165\u89c6\u9891", 'Insert video': '\u63d2\u5165\u89c6\u9891',
"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891", 'Insert\/edit video': '\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891',
"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53", 'Insert\/edit media': '\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53',
"Alternative source": "\u955c\u50cf", 'Alternative source': '\u955c\u50cf',
"Poster": "\u5c01\u9762", Poster: '\u5c01\u9762',
"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:", 'Paste your embed code below:': '\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:',
"Embed": "\u5185\u5d4c", Embed: '\u5185\u5d4c',
"Media": "\u5a92\u4f53", Media: '\u5a92\u4f53',
"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c", 'Nonbreaking space': '\u4e0d\u95f4\u65ad\u7a7a\u683c',
"Page break": "\u5206\u9875\u7b26", 'Page break': '\u5206\u9875\u7b26',
"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c", 'Paste as text': '\u7c98\u8d34\u4e3a\u6587\u672c',
"Preview": "\u9884\u89c8", Preview: '\u9884\u89c8',
"Print": "\u6253\u5370", Print: '\u6253\u5370',
"Save": "\u4fdd\u5b58", Save: '\u4fdd\u5b58',
"Find": "\u67e5\u627e", Find: '\u67e5\u627e',
"Replace with": "\u66ff\u6362\u4e3a", 'Replace with': '\u66ff\u6362\u4e3a',
"Replace": "\u66ff\u6362", Replace: '\u66ff\u6362',
"Replace all": "\u5168\u90e8\u66ff\u6362", 'Replace all': '\u5168\u90e8\u66ff\u6362',
"Prev": "\u4e0a\u4e00\u4e2a", Prev: '\u4e0a\u4e00\u4e2a',
"Next": "\u4e0b\u4e00\u4e2a", Next: '\u4e0b\u4e00\u4e2a',
"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362", 'Find and replace': '\u67e5\u627e\u548c\u66ff\u6362',
"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.", 'Could not find the specified string.': '\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.',
"Match case": "\u533a\u5206\u5927\u5c0f\u5199", 'Match case': '\u533a\u5206\u5927\u5c0f\u5199',
"Whole words": "\u5168\u5b57\u5339\u914d", 'Whole words': '\u5168\u5b57\u5339\u914d',
"Spellcheck": "\u62fc\u5199\u68c0\u67e5", Spellcheck: '\u62fc\u5199\u68c0\u67e5',
"Ignore": "\u5ffd\u7565", Ignore: '\u5ffd\u7565',
"Ignore all": "\u5168\u90e8\u5ffd\u7565", 'Ignore all': '\u5168\u90e8\u5ffd\u7565',
"Finish": "\u5b8c\u6210", Finish: '\u5b8c\u6210',
"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178", 'Add to Dictionary': '\u6dfb\u52a0\u5230\u5b57\u5178',
"Insert table": "\u63d2\u5165\u8868\u683c", 'Insert table': '\u63d2\u5165\u8868\u683c',
"Table properties": "\u8868\u683c\u5c5e\u6027", 'Table properties': '\u8868\u683c\u5c5e\u6027',
"Delete table": "\u5220\u9664\u8868\u683c", 'Delete table': '\u5220\u9664\u8868\u683c',
"Cell": "\u5355\u5143\u683c", Cell: '\u5355\u5143\u683c',
"Row": "\u884c", Row: '\u884c',
"Column": "\u5217", Column: '\u5217',
"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027", 'Cell properties': '\u5355\u5143\u683c\u5c5e\u6027',
"Merge cells": "\u5408\u5e76\u5355\u5143\u683c", 'Merge cells': '\u5408\u5e76\u5355\u5143\u683c',
"Split cell": "\u62c6\u5206\u5355\u5143\u683c", 'Split cell': '\u62c6\u5206\u5355\u5143\u683c',
"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165", 'Insert row before': '\u5728\u4e0a\u65b9\u63d2\u5165',
"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165", 'Insert row after': '\u5728\u4e0b\u65b9\u63d2\u5165',
"Delete row": "\u5220\u9664\u884c", 'Delete row': '\u5220\u9664\u884c',
"Row properties": "\u884c\u5c5e\u6027", 'Row properties': '\u884c\u5c5e\u6027',
"Cut row": "\u526a\u5207\u884c", 'Cut row': '\u526a\u5207\u884c',
"Copy row": "\u590d\u5236\u884c", 'Copy row': '\u590d\u5236\u884c',
"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9", 'Paste row before': '\u7c98\u8d34\u5230\u4e0a\u65b9',
"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9", 'Paste row after': '\u7c98\u8d34\u5230\u4e0b\u65b9',
"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165", 'Insert column before': '\u5728\u5de6\u4fa7\u63d2\u5165',
"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165", 'Insert column after': '\u5728\u53f3\u4fa7\u63d2\u5165',
"Delete column": "\u5220\u9664\u5217", 'Delete column': '\u5220\u9664\u5217',
"Cols": "\u5217", Cols: '\u5217',
"Rows": "\u884c", Rows: '\u884c',
"Width": "\u5bbd", Width: '\u5bbd',
"Height": "\u9ad8", Height: '\u9ad8',
"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd", 'Cell spacing': '\u5355\u5143\u683c\u5916\u95f4\u8ddd',
"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd", 'Cell padding': '\u5355\u5143\u683c\u5185\u8fb9\u8ddd',
"Caption": "\u6807\u9898", Caption: '\u6807\u9898',
"Left": "\u5de6\u5bf9\u9f50", Left: '\u5de6\u5bf9\u9f50',
"Center": "\u5c45\u4e2d", Center: '\u5c45\u4e2d',
"Right": "\u53f3\u5bf9\u9f50", Right: '\u53f3\u5bf9\u9f50',
"Cell type": "\u5355\u5143\u683c\u7c7b\u578b", 'Cell type': '\u5355\u5143\u683c\u7c7b\u578b',
"Scope": "\u8303\u56f4", Scope: '\u8303\u56f4',
"Alignment": "\u5bf9\u9f50\u65b9\u5f0f", Alignment: '\u5bf9\u9f50\u65b9\u5f0f',
"H Align": "\u6c34\u5e73\u5bf9\u9f50", 'H Align': '\u6c34\u5e73\u5bf9\u9f50',
"V Align": "\u5782\u76f4\u5bf9\u9f50", 'V Align': '\u5782\u76f4\u5bf9\u9f50',
"Top": "\u9876\u90e8\u5bf9\u9f50", Top: '\u9876\u90e8\u5bf9\u9f50',
"Middle": "\u5782\u76f4\u5c45\u4e2d", Middle: '\u5782\u76f4\u5c45\u4e2d',
"Bottom": "\u5e95\u90e8\u5bf9\u9f50", Bottom: '\u5e95\u90e8\u5bf9\u9f50',
"Header cell": "\u8868\u5934\u5355\u5143\u683c", 'Header cell': '\u8868\u5934\u5355\u5143\u683c',
"Row group": "\u884c\u7ec4", 'Row group': '\u884c\u7ec4',
"Column group": "\u5217\u7ec4", 'Column group': '\u5217\u7ec4',
"Row type": "\u884c\u7c7b\u578b", 'Row type': '\u884c\u7c7b\u578b',
"Header": "\u8868\u5934", Header: '\u8868\u5934',
"Body": "\u8868\u4f53", Body: '\u8868\u4f53',
"Footer": "\u8868\u5c3e", Footer: '\u8868\u5c3e',
"Border color": "\u8fb9\u6846\u989c\u8272", 'Border color': '\u8fb9\u6846\u989c\u8272',
"Insert template": "\u63d2\u5165\u6a21\u677f", 'Insert template': '\u63d2\u5165\u6a21\u677f',
"Templates": "\u6a21\u677f", Templates: '\u6a21\u677f',
"Template": "\u6a21\u677f", Template: '\u6a21\u677f',
"Text color": "\u6587\u5b57\u989c\u8272", 'Text color': '\u6587\u5b57\u989c\u8272',
"Background color": "\u80cc\u666f\u8272", 'Background color': '\u80cc\u666f\u8272',
"Custom...": "\u81ea\u5b9a\u4e49...", 'Custom...': '\u81ea\u5b9a\u4e49...',
"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272", 'Custom color': '\u81ea\u5b9a\u4e49\u989c\u8272',
"No color": "\u65e0", 'No color': '\u65e0',
"Table of Contents": "\u5185\u5bb9\u5217\u8868", 'Table of Contents': '\u5185\u5bb9\u5217\u8868',
"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846", 'Show blocks': '\u663e\u793a\u533a\u5757\u8fb9\u6846',
"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26", 'Show invisible characters': '\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26',
"Words: {0}": "\u5b57\u6570\uff1a{0}", 'Words: {0}': '\u5b57\u6570\uff1a{0}',
"{0} words": "{0} \u5b57", '{0} words': '{0} \u5b57',
"File": "\u6587\u4ef6", File: '\u6587\u4ef6',
"Edit": "\u7f16\u8f91", Edit: '\u7f16\u8f91',
"Insert": "\u63d2\u5165", Insert: '\u63d2\u5165',
"View": "\u89c6\u56fe", View: '\u89c6\u56fe',
"Format": "\u683c\u5f0f", Format: '\u683c\u5f0f',
"Table": "\u8868\u683c", Table: '\u8868\u683c',
"Tools": "\u5de5\u5177", Tools: '\u5de5\u5177',
"Powered by {0}": "\u7531{0}\u9a71\u52a8", '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" '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
+7 -9
View File
@@ -6,17 +6,17 @@
</a-config-provider> </a-config-provider>
</template> </template>
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device' import enquireScreen from '@/utils/device'
export default { export default {
data () { data () {
return { return {
locale: zhCN, locale: zhCN
} }
}, },
created () { created () {
let that = this const that = this
enquireScreen(deviceType => { enquireScreen(deviceType => {
// tablet // tablet
if (deviceType === 0) { if (deviceType === 0) {
@@ -27,15 +27,13 @@
else if (deviceType === 1) { else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile') that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false) that.$store.dispatch('setSidebar', false)
} } else {
else {
that.$store.commit('TOGGLE_DEVICE', 'desktop') that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.dispatch('setSidebar', true) that.$store.dispatch('setSidebar', true)
} }
}) })
} }
} }
</script> </script>
<style> <style>
#app { #app {
+7 -9
View File
@@ -7,24 +7,22 @@ import Vue from 'vue'
* @param groupId 分组ID,如果不传或者为空则不分组 * @param groupId 分组ID,如果不传或者为空则不分组
* @param expire 过期时间,默认 半分钟 * @param expire 过期时间,默认 半分钟
*/ */
export function httpGroupRequest(getPromise, groupId, expire = 1000 * 30) { export function httpGroupRequest (getPromise, groupId, expire = 1000 * 30) {
if (groupId == null || groupId === '') { if (groupId == null || groupId === '') {
console.log("--------popup----------getFrom DB-------with---no--groupId ") console.log('--------popup----------getFrom DB-------with---no--groupId ')
return getPromise() return getPromise()
} }
if (Vue.ls.get(groupId)) { if (Vue.ls.get(groupId)) {
console.log("---------popup--------getFrom Cache--------groupId = " + groupId) console.log('---------popup--------getFrom Cache--------groupId = ' + groupId)
return Promise.resolve(Vue.ls.get(groupId)); return Promise.resolve(Vue.ls.get(groupId))
} else { } else {
console.log("--------popup----------getFrom DB---------groupId = " + groupId) console.log('--------popup----------getFrom DB---------groupId = ' + groupId)
} }
// 还没有发出请求,就发出第一次的请求 // 还没有发出请求,就发出第一次的请求
return getPromise().then(res => { return getPromise().then(res => {
Vue.ls.set(groupId, res, expire); Vue.ls.set(groupId, res, expire)
return Promise.resolve(res); return Promise.resolve(res)
}) })
} }
+70 -73
View File
@@ -1,101 +1,101 @@
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage' import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue' 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 addRole = (params) => postAction('/sys/role/add', params)
const editRole = (params)=>putAction("/sys/role/edit",params); const editRole = (params) => putAction('/sys/role/edit', params)
const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params); const checkRoleCode = (params) => getAction('/sys/role/checkRoleCode', params)
const queryall = (params)=>getAction("/sys/role/queryall",params); const queryall = (params) => getAction('/sys/role/queryall', params)
//用户管理 // 用户管理
const addUser = (params)=>postAction("/sys/user/add",params); const addUser = (params) => postAction('/sys/user/add', params)
const editUser = (params)=>putAction("/sys/user/edit",params); const editUser = (params) => putAction('/sys/user/edit', params)
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params); const queryUserRole = (params) => getAction('/sys/user/queryUserRole', params)
const getUserList = (params)=>getAction("/sys/user/page",params); const getUserList = (params) => getAction('/sys/user/page', params)
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",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 addPermission = (params) => postAction('/sys/permission/add', params)
const editPermission= (params)=>putAction("/sys/permission/edit",params); const editPermission = (params) => putAction('/sys/permission/edit', params)
const getPermissionList = (params)=>getAction("/sys/permission/page",params); const getPermissionList = (params) => getAction('/sys/permission/page', params)
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params); const getSystemMenuList = (params) => getAction('/sys/permission/getSystemMenuList', params)
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params); const getSystemSubmenu = (params) => getAction('/sys/permission/getSystemSubmenu', params)
const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params) const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params); const queryTreeList = (params) => getAction('/sys/permission/queryTreeList', params)
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params); const queryTreeListForRole = (params) => getAction('/sys/role/queryTreeList', params)
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params); const queryListAsync = (params) => getAction('/sys/permission/queryListAsync', params)
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params); const queryRolePermission = (params) => getAction('/sys/permission/queryRolePermission', params)
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params); const saveRolePermission = (params) => postAction('/sys/permission/saveRolePermission', params)
const queryPermissionsByUser = ()=>getAction("/sys/permission/getUserPermissionByToken"); const queryPermissionsByUser = () => getAction('/sys/permission/getUserPermissionByToken')
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params); const loadAllRoleIds = (params) => getAction('/sys/permission/loadAllRoleIds', params)
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params); const getPermissionRuleList = (params) => getAction('/sys/permission/getPermRuleListByPermId', params)
const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermissionRule",params); const queryPermissionRule = (params) => getAction('/sys/permission/queryPermissionRule', params)
// 部门管理 // 部门管理
const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params); const queryDepartTreeList = (params) => getAction('/sys/sysDepart/queryTreeList', params)
const queryDepartTreeSync = (params)=>getAction("/sys/sysDepart/queryDepartTreeSync",params); const queryDepartTreeSync = (params) => getAction('/sys/sysDepart/queryDepartTreeSync', params)
const queryIdTree = (params)=>getAction("/sys/sysDepart/queryIdTree",params); const queryIdTree = (params) => getAction('/sys/sysDepart/queryIdTree', params)
const queryParentName = (params)=>getAction("/sys/sysDepart/queryParentName",params); const queryParentName = (params) => getAction('/sys/sysDepart/queryParentName', params)
const searchByKeywords = (params)=>getAction("/sys/sysDepart/searchBy",params); const searchByKeywords = (params) => getAction('/sys/sysDepart/searchBy', params)
const deleteByDepartId = (params)=>deleteAction("/sys/sysDepart/delete",params); const deleteByDepartId = (params) => deleteAction('/sys/sysDepart/delete', params)
//二级部门管理 // 二级部门管理
const queryDepartPermission = (params)=>getAction("/sys/permission/queryDepartPermission",params); const queryDepartPermission = (params) => getAction('/sys/permission/queryDepartPermission', params)
const saveDepartPermission = (params)=>postAction("/sys/permission/saveDepartPermission",params); const saveDepartPermission = (params) => postAction('/sys/permission/saveDepartPermission', params)
const queryTreeListForDeptRole = (params)=>getAction("/sys/sysDepartPermission/queryTreeListForDeptRole",params); const queryTreeListForDeptRole = (params) => getAction('/sys/sysDepartPermission/queryTreeListForDeptRole', params)
const queryDeptRolePermission = (params)=>getAction("/sys/sysDepartPermission/queryDeptRolePermission",params); const queryDeptRolePermission = (params) => getAction('/sys/sysDepartPermission/queryDeptRolePermission', params)
const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params); const queryMyDepartTreeList = (params) => getAction('/sys/sysDepart/queryMyDeptTreeList', params)
//日志管理 // 日志管理
const deleteLog = (params)=>deleteAction("/sys/log/delete",params); const deleteLog = (params) => deleteAction('/sys/log/delete', params)
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params); const deleteLogList = (params) => deleteAction('/sys/log/deleteBatch', params)
//数据字典 // 数据字典
const addDict = (params)=>postAction("/sys/dict/add",params); const addDict = (params) => postAction('/sys/dict/add', params)
const editDict = (params)=>putAction("/sys/dict/edit",params); const editDict = (params) => putAction('/sys/dict/edit', params)
const treeList = (params)=>getAction("/sys/dict/treeList",params); const treeList = (params) => getAction('/sys/dict/treeList', params)
const addDictItem = (params)=>postAction("/sys/dictItem/add",params); const addDictItem = (params) => postAction('/sys/dictItem/add', params)
const editDictItem = (params)=>putAction("/sys/dictItem/edit",params); const editDictItem = (params) => putAction('/sys/dictItem/edit', params)
//字典标签专用(通过code获取字典数组) // 字典标签专用(通过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) { function getDictItemsFromCache (dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[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]; const dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]
return dictItems; return dictItems
} }
} }
//系统通告 // 系统通告
const doReleaseData = (params)=>getAction("/sys/annountCement/doReleaseData",params); const doReleaseData = (params) => getAction('/sys/annountCement/doReleaseData', params)
const doReovkeData = (params)=>getAction("/sys/annountCement/doReovkeData",params); const doReovkeData = (params) => getAction('/sys/annountCement/doReovkeData', params)
//获取系统访问量 // 获取系统访问量
const getLoginfo = (params)=>getAction("/sys/loginfo",params); const getLoginfo = (params) => getAction('/sys/loginfo', params)
const getVisitInfo = (params)=>getAction("/sys/visitInfo",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 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)}` const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`
// 中转HTTP请求 // 中转HTTP请求
export const transitRESTful = { export const transitRESTful = {
get: (url, parameter) => getAction(getTransitURL(url), parameter), get: (url, parameter) => getAction(getTransitURL(url), parameter),
post: (url, parameter) => postAction(getTransitURL(url), parameter), post: (url, parameter) => postAction(getTransitURL(url), parameter),
put: (url, parameter) => putAction(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 { export {
@@ -154,6 +154,3 @@ export {
getUserNoticeInfo, getUserNoticeInfo,
getDictItemsFromCache getDictItemsFromCache
} }
+6 -6
View File
@@ -12,7 +12,7 @@ import { axios } from '@/utils/request'
* @param parameter * @param parameter
* @returns {*} * @returns {*}
*/ */
export function login(parameter) { export function login (parameter) {
return axios({ return axios({
url: '/sys/login', url: '/sys/login',
method: 'post', method: 'post',
@@ -20,7 +20,7 @@ export function login(parameter) {
}) })
} }
export function phoneLogin(parameter) { export function phoneLogin (parameter) {
return axios({ return axios({
url: '/sys/phoneLogin', url: '/sys/phoneLogin',
method: 'post', method: 'post',
@@ -28,7 +28,7 @@ export function phoneLogin(parameter) {
}) })
} }
export function getSmsCaptcha(parameter) { export function getSmsCaptcha (parameter) {
return axios({ return axios({
url: api.SendSms, url: api.SendSms,
method: 'post', method: 'post',
@@ -46,7 +46,7 @@ export function getSmsCaptcha(parameter) {
// }) // })
// } // }
export function logout(logoutToken) { export function logout (logoutToken) {
return axios({ return axios({
url: '/sys/logout', url: '/sys/logout',
method: 'post', method: 'post',
@@ -63,7 +63,7 @@ export function logout(logoutToken) {
* @param thirdType * @param thirdType
* @returns {*} * @returns {*}
*/ */
export function thirdLogin(token,thirdType) { export function thirdLogin (token, thirdType) {
return axios({ return axios({
url: `/sys/thirdLogin/getLoginUser/${token}/${thirdType}`, url: `/sys/thirdLogin/getLoginUser/${token}/${thirdType}`,
method: 'get', method: 'get',
@@ -78,7 +78,7 @@ export function thirdLogin(token,thirdType) {
* @param token * @param token
* @returns {*} * @returns {*}
*/ */
export function forceLogout(parameter) { export function forceLogout (parameter) {
return axios({ return axios({
url: '/sys/online/forceLogout', url: '/sys/online/forceLogout',
method: 'post', method: 'post',
+50 -50
View File
@@ -1,6 +1,6 @@
import Vue from 'vue' import Vue from 'vue'
import { axios } from '@/utils/request' 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' import signMd5Utils from '@/utils/encryption/signMd5Utils'
const api = { const api = {
@@ -13,48 +13,48 @@ const api = {
export default api export default api
//post // post
export function postAction(url,parameter) { export function postAction (url, parameter) {
let sign = signMd5Utils.getSign(url, parameter); const sign = signMd5Utils.getSign(url, parameter)
//将签名和时间戳,添加在请求接口 Header // 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()}; const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({ return axios({
url: url, url: url,
method:'post' , method: 'post',
data: parameter, data: parameter,
headers: signHeader headers: signHeader
}) })
} }
//post method= {post | put} // post method= {post | put}
export function httpAction(url,parameter,method) { export function httpAction (url, parameter, method) {
let sign = signMd5Utils.getSign(url, parameter); const sign = signMd5Utils.getSign(url, parameter)
//将签名和时间戳,添加在请求接口 Header // 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()}; const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({ return axios({
url: url, url: url,
method:method , method: method,
data: parameter, data: parameter,
headers: signHeader headers: signHeader
}) })
} }
//put // put
export function putAction(url,parameter) { export function putAction (url, parameter) {
return axios({ return axios({
url: url, url: url,
method:'put', method: 'put',
data: parameter data: parameter
}) })
} }
//get // get
export function getAction(url,parameter) { export function getAction (url, parameter) {
let sign = signMd5Utils.getSign(url, parameter); const sign = signMd5Utils.getSign(url, parameter)
//将签名和时间戳,添加在请求接口 Header // 将签名和时间戳,添加在请求接口 Header
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()}; const signHeader = { 'X-Sign': sign, 'X-TIMESTAMP': signMd5Utils.getDateTimeToString() }
return axios({ return axios({
url: url, url: url,
@@ -64,8 +64,8 @@ export function getAction(url,parameter) {
}) })
} }
//deleteAction // deleteAction
export function deleteAction(url,parameter) { export function deleteAction (url, parameter) {
return axios({ return axios({
url: url, url: url,
method: 'delete', method: 'delete',
@@ -73,7 +73,7 @@ export function deleteAction(url,parameter) {
}) })
} }
export function getUserList(parameter) { export function getUserList (parameter) {
return axios({ return axios({
url: api.user, url: api.user,
method: 'get', method: 'get',
@@ -81,7 +81,7 @@ export function getUserList(parameter) {
}) })
} }
export function getRoleList(parameter) { export function getRoleList (parameter) {
return axios({ return axios({
url: api.role, url: api.role,
method: 'get', method: 'get',
@@ -89,7 +89,7 @@ export function getRoleList(parameter) {
}) })
} }
export function getServiceList(parameter) { export function getServiceList (parameter) {
return axios({ return axios({
url: api.service, url: api.service,
method: 'get', method: 'get',
@@ -97,7 +97,7 @@ export function getServiceList(parameter) {
}) })
} }
export function getPermissions(parameter) { export function getPermissions (parameter) {
return axios({ return axios({
url: api.permissionNoPager, url: api.permissionNoPager,
method: 'get', method: 'get',
@@ -107,7 +107,7 @@ export function getPermissions(parameter) {
// id == 0 add post // id == 0 add post
// id != 0 update put // id != 0 update put
export function saveService(parameter) { export function saveService (parameter) {
return axios({ return axios({
url: api.service, url: api.service,
method: parameter.id == 0 ? 'post' : 'put', method: parameter.id == 0 ? 'post' : 'put',
@@ -121,11 +121,11 @@ export function saveService(parameter) {
* @param parameter * @param parameter
* @returns {*} * @returns {*}
*/ */
export function downFile(url,parameter){ export function downFile (url, parameter) {
return axios({ return axios({
url: url, url: url,
params: parameter, params: parameter,
method:'get' , method: 'get',
responseType: 'blob' responseType: 'blob'
}) })
} }
@@ -137,24 +137,24 @@ export function downFile(url,parameter){
* @param parameter * @param parameter
* @returns {*} * @returns {*}
*/ */
export function downloadFile(url, fileName, parameter) { export function downloadFile (url, fileName, parameter) {
return downFile(url, parameter).then((data) => { return downFile(url, parameter).then((data) => {
if (!data || data.size === 0) { if (!data || data.size === 0) {
Vue.prototype['$message'].warning('文件下载失败') Vue.prototype.$message.warning('文件下载失败')
return return
} }
if (typeof window.navigator.msSaveBlob !== 'undefined') { if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName) window.navigator.msSaveBlob(new Blob([data]), fileName)
} else { } else {
let url = window.URL.createObjectURL(new Blob([data])) const url = window.URL.createObjectURL(new Blob([data]))
let link = document.createElement('a') const link = document.createElement('a')
link.style.display = 'none' link.style.display = 'none'
link.href = url link.href = url
link.setAttribute('download', fileName) link.setAttribute('download', fileName)
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) //下载完成移除元素 document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) //释放掉blob对象 window.URL.revokeObjectURL(url) // 释放掉blob对象
} }
}) })
} }
@@ -165,14 +165,14 @@ export function downloadFile(url, fileName, parameter) {
* @param parameter * @param parameter
* @returns {*} * @returns {*}
*/ */
export function uploadAction(url,parameter){ export function uploadAction (url, parameter) {
return axios({ return axios({
url: url, url: url,
data: parameter, data: parameter,
method:'post' , method: 'post',
headers: { headers: {
'Content-Type': 'multipart/form-data', // 文件上传 'Content-Type': 'multipart/form-data' // 文件上传
}, }
}) })
} }
@@ -182,18 +182,18 @@ export function uploadAction(url,parameter){
* @param subStr * @param subStr
* @returns {*} * @returns {*}
*/ */
export function getFileAccessHttpUrl(avatar,subStr) { export function getFileAccessHttpUrl (avatar, subStr) {
if(!subStr) subStr = 'http' if (!subStr) subStr = 'http'
try { try {
if(avatar && avatar.startsWith(subStr)){ if (avatar && avatar.startsWith(subStr)) {
return avatar; return avatar
}else{ } else {
if(avatar && avatar.length>0 && avatar.indexOf('[')==-1){ if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
let token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN)
return window._CONFIG['staticDomainURL'] + "/" + avatar + "?token=" + token; return window._CONFIG.staticDomainURL + '/' + avatar + '?token=' + token
} }
} }
}catch(err){ } catch (err) {
return;
} }
} }
+40 -41
View File
@@ -1,77 +1,76 @@
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from '@/store/mutation-types'
import store from '@/store' import store from '@/store'
/** /**
* 单点登录 * 单点登录
*/ */
const init = (callback) => { const init = (callback) => {
if (process.env.VUE_APP_SSO == 'true') { if (process.env.VUE_APP_SSO == 'true') {
console.log("-------单点登录开始-------"); console.log('-------单点登录开始-------')
let token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN)
let st = getUrlParam("ticket"); const st = getUrlParam('ticket')
let sevice = "http://" + window.location.host + "/"; const sevice = 'http://' + window.location.host + '/'
if (token) { if (token) {
loginSuccess(callback); loginSuccess(callback)
} else { } else {
if (st) { if (st) {
validateSt(st, sevice, callback); validateSt(st, sevice, callback)
} else { } else {
let serviceUrl = encodeURIComponent(sevice); const serviceUrl = encodeURIComponent(sevice)
window.location.href = window._CONFIG['casPrefixUrl'] + "/login?service=" + serviceUrl; window.location.href = window._CONFIG.casPrefixUrl + '/login?service=' + serviceUrl
} }
} }
console.log("-------单点登录结束-------"); console.log('-------单点登录结束-------')
}else{ } else {
callback && callback() callback && callback()
} }
}; }
const SSO = { const SSO = {
init: init init: init
}; }
function getUrlParam(paraName) { function getUrlParam (paraName) {
let url = document.location.toString(); const url = document.location.toString()
let arrObj = url.split("?"); const arrObj = url.split('?')
if (arrObj.length > 1) { if (arrObj.length > 1) {
let arrPara = arrObj[1].split("&"); const arrPara = arrObj[1].split('&')
let arr; let arr
for (let i = 0; i < arrPara.length; i++) { for (let i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split("="); arr = arrPara[i].split('=')
if (arr != null && arr[0] == paraName) { if (arr != null && arr[0] == paraName) {
return arr[1]; return arr[1]
} }
} }
return ""; return ''
} } else {
else { return ''
return "";
} }
} }
function validateSt(ticket,service,callback){ function validateSt (ticket, service, callback) {
let params = { const params = {
ticket: ticket, ticket: ticket,
service:service service: service
}; }
store.dispatch('ValidateLogin',params).then(res => { store.dispatch('ValidateLogin', params).then(res => {
//this.departConfirm(res) // this.departConfirm(res)
if(res.success){ if (res.success) {
loginSuccess(callback); loginSuccess(callback)
}else{ } else {
let sevice = "http://"+window.location.host+"/"; const sevice = 'http://' + window.location.host + '/'
let serviceUrl = encodeURIComponent(sevice); const serviceUrl = encodeURIComponent(sevice)
window.location.href = window._CONFIG['casPrefixUrl']+"/login?service="+serviceUrl; window.location.href = window._CONFIG.casPrefixUrl + '/login?service=' + serviceUrl
} }
}).catch((err) => { }).catch((err) => {
console.log(err); console.log(err)
//that.requestFailed(err); // that.requestFailed(err);
}); })
} }
function loginSuccess (callback) { function loginSuccess (callback) {
callback(); callback()
} }
export default SSO; export default SSO
+4 -4
View File
@@ -7,10 +7,10 @@
</template> </template>
<script> <script>
import Avatar from 'ant-design-vue/es/avatar' import Avatar from 'ant-design-vue/es/avatar'
import Tooltip from 'ant-design-vue/es/tooltip' import Tooltip from 'ant-design-vue/es/tooltip'
export default { export default {
name: 'AvatarItem', name: 'AvatarItem',
components: { components: {
Avatar, Avatar,
@@ -42,5 +42,5 @@
this.size = val this.size = val
} }
} }
} }
</script> </script>
+7 -8
View File
@@ -5,7 +5,6 @@
<slot></slot> <slot></slot>
<template v-for="item in filterEmpty($slots.default).slice(0, 3)"></template> <template v-for="item in filterEmpty($slots.default).slice(0, 3)"></template>
<template v-if="maxLength > 0 && filterEmpty($slots.default).length > maxLength"> <template v-if="maxLength > 0 && filterEmpty($slots.default).length > maxLength">
<avatar-item :size="size"> <avatar-item :size="size">
<avatar :size="size !== 'mini' && size || 20" :style="excessItemsStyle">{{ `+${maxLength}` }}</avatar> <avatar :size="size !== 'mini' && size || 20" :style="excessItemsStyle">{{ `+${maxLength}` }}</avatar>
@@ -17,11 +16,11 @@
--> -->
<script> <script>
import Avatar from 'ant-design-vue/es/avatar' import Avatar from 'ant-design-vue/es/avatar'
import AvatarItem from './Item' import AvatarItem from './Item'
import { filterEmpty } from '@/components/_util/util' import { filterEmpty } from '@/components/_util/util'
export default { export default {
AvatarItem, AvatarItem,
name: 'AvatarList', name: 'AvatarList',
components: { components: {
@@ -65,7 +64,7 @@
return {} return {}
}, },
methods: { methods: {
getItems(items) { getItems (items) {
const classString = { const classString = {
[`${this.prefixCls}-item`]: true, [`${this.prefixCls}-item`]: true,
[`${this.size}`]: true [`${this.size}`]: true
@@ -85,7 +84,7 @@
const { prefixCls, size } = this.$props const { prefixCls, size } = this.$props
const classString = { const classString = {
[`${prefixCls}`]: true, [`${prefixCls}`]: true,
[`${size}`]: true, [`${size}`]: true
} }
const items = filterEmpty(this.$slots.default) const items = filterEmpty(this.$slots.default)
const itemsDom = items && items.length ? <ul class={`${prefixCls}-items`}>{ this.getItems(items) }</ul> : null const itemsDom = items && items.length ? <ul class={`${prefixCls}-items`}>{ this.getItems(items) }</ul> : null
@@ -96,5 +95,5 @@
</div> </div>
) )
} }
} }
</script> </script>
+23 -23
View File
@@ -6,12 +6,12 @@
<script> <script>
function fixedZero(val) { function fixedZero (val) {
return val * 1 < 10 ? `0${val}` : val; return val * 1 < 10 ? `0${val}` : val
} }
export default { export default {
name: "CountDown", name: 'CountDown',
props: { props: {
format: { format: {
type: Function, type: Function,
@@ -19,7 +19,7 @@
}, },
target: { target: {
type: [Date, Number], type: [Date, Number],
required: true, required: true
}, },
onEnd: { onEnd: {
type: Function, type: Function,
@@ -27,7 +27,7 @@
} }
} }
}, },
data() { data () {
return { return {
dateTime: '0', dateTime: '0',
originTargetTime: 0, originTargetTime: 0,
@@ -37,24 +37,24 @@
} }
}, },
filters: { filters: {
format(time) { format (time) {
const hours = 60 * 60 * 1000; const hours = 60 * 60 * 1000
const minutes = 60 * 1000; const minutes = 60 * 1000
const h = Math.floor(time / hours); const h = Math.floor(time / hours)
const m = Math.floor((time - h * hours) / minutes); const m = Math.floor((time - h * hours) / minutes)
const s = Math.floor((time - h * hours - m * minutes) / 1000); const s = Math.floor((time - h * hours - m * minutes) / 1000)
return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}` return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
} }
}, },
created() { created () {
this.initTime() this.initTime()
this.tick() this.tick()
}, },
methods: { methods: {
initTime() { initTime () {
let lastTime = 0; let lastTime = 0
let targetTime = 0; let targetTime = 0
this.originTargetTime = this.target this.originTargetTime = this.target
try { try {
if (Object.prototype.toString.call(this.target) === '[object Date]') { if (Object.prototype.toString.call(this.target) === '[object Date]') {
@@ -66,19 +66,19 @@
throw new Error('invalid target prop') throw new Error('invalid target prop')
} }
lastTime = targetTime - new Date().getTime(); lastTime = targetTime - new Date().getTime()
this.lastTime = lastTime < 0 ? 0 : lastTime this.lastTime = lastTime < 0 ? 0 : lastTime
}, },
tick() { tick () {
const {onEnd} = this const { onEnd } = this
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
if (this.lastTime < this.interval) { if (this.lastTime < this.interval) {
clearTimeout(this.timer) clearTimeout(this.timer)
this.lastTime = 0 this.lastTime = 0
if (typeof onEnd === 'function') { if (typeof onEnd === 'function') {
onEnd(); onEnd()
} }
} else { } else {
this.lastTime -= this.interval this.lastTime -= this.interval
@@ -92,10 +92,10 @@
this.initTime() this.initTime()
} }
}, },
beforeDestroy() { beforeDestroy () {
clearTimeout(this.timer) clearTimeout(this.timer)
} }
} }
</script> </script>
<style scoped> <style scoped>
@@ -1,7 +1,7 @@
<script> <script>
import { cutStrByFullLength, getStrFullLength } from '@/components/_util/StringUtil' import { cutStrByFullLength, getStrFullLength } from '@/components/_util/StringUtil'
export default { export default {
name: 'Ellipsis', name: 'Ellipsis',
props: { props: {
prefixCls: { prefixCls: {
@@ -10,11 +10,11 @@
}, },
tooltip: { tooltip: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
length: { length: {
type: Number, type: Number,
default: 25, default: 25
}, },
lines: { lines: {
type: Number, type: Number,
@@ -26,7 +26,7 @@
} }
}, },
methods: {}, methods: {},
render() { render () {
const { tooltip, length } = this.$props const { tooltip, length } = this.$props
let text = '' let text = ''
// 处理没有default插槽时的特殊情况 // 处理没有default插槽时的特殊情况
@@ -45,5 +45,5 @@
return (<span>{text}</span>) return (<span>{text}</span>)
} }
} }
} }
</script> </script>
@@ -60,29 +60,29 @@
</template> </template>
<script> <script>
import { getFileAccessHttpUrl } from '@api/manage' import { getFileAccessHttpUrl } from '@api/manage'
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import JFilePop from '@/components/jero/minipop/JFilePop' import JFilePop from '@/components/jero/minipop/JFilePop'
import JVxeUploadCell from '@/components/jero/JVxeTable/components/cells/JVxeUploadCell' import JVxeUploadCell from '@/components/jero/JVxeTable/components/cells/JVxeUploadCell'
export default { export default {
name: 'JVxeFileCell', name: 'JVxeFileCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
components: {JFilePop}, components: { JFilePop },
props: {}, props: {},
data() { data () {
return { return {
innerFile: null, innerFile: null,
number:0, number: 0
} }
}, },
computed: { computed: {
/** upload headers */ /** upload headers */
uploadHeaders() { uploadHeaders () {
let {originColumn: col} = this const { originColumn: col } = this
let headers = {} const headers = {}
if (col.token === true) { if (col.token === true) {
headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN) headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN)
} }
@@ -90,21 +90,21 @@
}, },
/** 上传请求地址 */ /** 上传请求地址 */
uploadAction() { uploadAction () {
if (!this.originColumn.action) { if (!this.originColumn.action) {
return window._CONFIG['domianURL'] + '/sys/common/upload' return window._CONFIG.domianURL + '/sys/common/upload'
} else { } else {
return this.originColumn.action return this.originColumn.action
} }
}, },
hasFile() { hasFile () {
return this.innerFile != null return this.innerFile != null
}, },
ellipsisFileName() { ellipsisFileName () {
let length = 5 const length = 5
let file = this.innerFile const file = this.innerFile
if (!file || !file.name) { if (!file || !file.name) {
return '' return ''
} }
@@ -114,41 +114,41 @@
return file.name return file.name
}, },
responseName() { responseName () {
if (this.originColumn.responseName) { if (this.originColumn.responseName) {
return this.originColumn.responseName return this.originColumn.responseName
} else { } else {
return 'message' return 'message'
} }
}, }
}, },
watch: { watch: {
innerValue: { innerValue: {
immediate: true, immediate: true,
handler() { handler () {
if (this.innerValue) { if (this.innerValue) {
this.innerFile = this.innerValue this.innerFile = this.innerValue
} else { } else {
this.innerFile = null this.innerFile = null
} }
}, }
}, }
}, },
methods: { methods: {
// 点击更多按钮 // 点击更多按钮
handleMoreOperation(originColumn) { handleMoreOperation (originColumn) {
//update-begin-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件 // update-begin-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件
if (originColumn.number) { if (originColumn.number) {
this.number = originColumn.number this.number = originColumn.number
} else { } else {
this.number = 0 this.number = 0
} }
//update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件 // update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number,用于控制上传文件
if(originColumn && originColumn.fieldExtendJson){ if (originColumn && originColumn.fieldExtendJson) {
let json = JSON.parse(originColumn.fieldExtendJson); const json = JSON.parse(originColumn.fieldExtendJson)
this.number = json.uploadnum?json.uploadnum:0; this.number = json.uploadnum ? json.uploadnum : 0
} }
let path = '' let path = ''
if (this.innerFile) { if (this.innerFile) {
@@ -158,17 +158,17 @@
}, },
// 更多上传回调 // 更多上传回调
handleFileSuccess(file) { handleFileSuccess (file) {
if (file) { if (file) {
this.innerFile.path = file.path this.innerFile.path = file.path
this.handleChangeCommon(this.innerFile) this.handleChangeCommon(this.innerFile)
} }
}, },
handleChangeUpload(info) { handleChangeUpload (info) {
let {originColumn: col} = this const { originColumn: col } = this
let {file} = info const { file } = info
let value = { const value = {
name: file.name, name: file.name,
type: file.type, type: file.type,
size: file.size, size: file.size,
@@ -176,30 +176,30 @@
percent: file.percent percent: file.percent
} }
if (file.response) { if (file.response) {
value['responseName'] = file.response[this.responseName] value.responseName = file.response[this.responseName]
} }
if (file.status === 'done') { if (file.status === 'done') {
if (typeof file.response.success === 'boolean') { if (typeof file.response.success === 'boolean') {
if (file.response.success) { if (file.response.success) {
value['path'] = file.response[this.responseName] value.path = file.response[this.responseName]
this.handleChangeCommon(value) this.handleChangeCommon(value)
} else { } else {
value['status'] = 'error' value.status = 'error'
value['message'] = file.response.message || '未知错误' value.message = file.response.message || '未知错误'
} }
} else { } else {
// 考虑到如果设置action上传路径为非jeecg-boot后台,可能不会返回 success 属性的情况,就默认为成功 // 考虑到如果设置action上传路径为非jeecg-boot后台,可能不会返回 success 属性的情况,就默认为成功
value['path'] = file.response[this.responseName] value.path = file.response[this.responseName]
this.handleChangeCommon(value) this.handleChangeCommon(value)
} }
} else if (file.status === 'error') { } else if (file.status === 'error') {
value['message'] = file.response.message || '未知错误' value.message = file.response.message || '未知错误'
} }
this.innerFile = value this.innerFile = value
}, },
handleClickDownloadFile() { handleClickDownloadFile () {
let {url, path} = this.innerFile || {} let { url, path } = this.innerFile || {}
if (!url || url.length === 0) { if (!url || url.length === 0) {
if (path && path.length > 0) { if (path && path.length > 0) {
url = getFileAccessHttpUrl(path.split(',')[0]) url = getFileAccessHttpUrl(path.split(',')[0])
@@ -210,18 +210,18 @@
} }
}, },
handleClickDeleteFile() { handleClickDeleteFile () {
this.handleChangeCommon(null) this.handleChangeCommon(null)
}, }
}, },
// 【组件增强】注释详见:JVxeCellMixins.js // 【组件增强】注释详见:JVxeCellMixins.js
enhanced: { enhanced: {
switches: {visible: true}, switches: { visible: true },
getValue: value => JVxeUploadCell.enhanced.getValue(value), getValue: value => JVxeUploadCell.enhanced.getValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value), setValue: value => JVxeUploadCell.enhanced.setValue(value)
}
} }
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@@ -67,19 +67,19 @@ import JVxeUploadCell from '@/components/jero/JVxeTable/components/cells/JVxeUpl
export default { export default {
name: 'JVxeImageCell', name: 'JVxeImageCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
components: {JFilePop}, components: { JFilePop },
props: {}, props: {},
data() { data () {
return { return {
innerFile: null, innerFile: null,
number:0 number: 0
} }
}, },
computed: { computed: {
/** upload headers */ /** upload headers */
uploadHeaders() { uploadHeaders () {
let {originColumn: col} = this const { originColumn: col } = this
let headers = {} const headers = {}
if (col.token === true) { if (col.token === true) {
headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN) headers['X-Access-Token'] = this.$ls.get(ACCESS_TOKEN)
} }
@@ -87,66 +87,66 @@ export default {
}, },
/** 上传请求地址 */ /** 上传请求地址 */
uploadAction() { uploadAction () {
if (!this.originColumn.action) { if (!this.originColumn.action) {
return window._CONFIG['domianURL'] + '/sys/common/upload' return window._CONFIG.domianURL + '/sys/common/upload'
} else { } else {
return this.originColumn.action return this.originColumn.action
} }
}, },
hasFile() { hasFile () {
return this.innerFile != null return this.innerFile != null
}, },
/** 预览图片地址 */ /** 预览图片地址 */
imgSrc() { imgSrc () {
if (this.innerFile) { if (this.innerFile) {
if (this.innerFile['url']) { if (this.innerFile.url) {
return this.innerFile['url'] return this.innerFile.url
} else if (this.innerFile['path']) { } else if (this.innerFile.path) {
let path = this.innerFile['path'].split(',')[0] const path = this.innerFile.path.split(',')[0]
return getFileAccessHttpUrl(path) return getFileAccessHttpUrl(path)
} }
} }
return '' return ''
}, },
responseName() { responseName () {
if (this.originColumn.responseName) { if (this.originColumn.responseName) {
return this.originColumn.responseName return this.originColumn.responseName
} else { } else {
return 'message' return 'message'
} }
}, }
}, },
watch: { watch: {
innerValue: { innerValue: {
immediate: true, immediate: true,
handler() { handler () {
if (this.innerValue) { if (this.innerValue) {
this.innerFile = this.innerValue this.innerFile = this.innerValue
} else { } else {
this.innerFile = null this.innerFile = null
} }
}, }
}, }
}, },
methods: { methods: {
// 点击更多按钮 // 点击更多按钮
handleMoreOperation(originColumn) { handleMoreOperation (originColumn) {
//update-begin-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number用于控制上传文件 // update-begin-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number用于控制上传文件
if (originColumn.number) { if (originColumn.number) {
this.number = originColumn.number this.number = originColumn.number
} else { } else {
this.number = 0 this.number = 0
} }
//update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number用于控制上传文件 // update-end-author:wangshuai date:20201021 for:LOWCOD-969 判断传过来的字段是否存在number用于控制上传文件
if(originColumn && originColumn.fieldExtendJson){ if (originColumn && originColumn.fieldExtendJson) {
let json = JSON.parse(originColumn.fieldExtendJson); const json = JSON.parse(originColumn.fieldExtendJson)
this.number = json.uploadnum?json.uploadnum:0; this.number = json.uploadnum ? json.uploadnum : 0
} }
let path = '' let path = ''
if (this.innerFile) { if (this.innerFile) {
@@ -156,7 +156,7 @@ export default {
}, },
// 更多上传回调 // 更多上传回调
handleFileSuccess(file) { handleFileSuccess (file) {
if (file) { if (file) {
this.innerFile.path = file.path this.innerFile.path = file.path
this.handleChangeCommon(this.innerFile) this.handleChangeCommon(this.innerFile)
@@ -164,17 +164,17 @@ export default {
}, },
// 弹出上传出错详细信息 // 弹出上传出错详细信息
handleClickShowImageError() { handleClickShowImageError () {
let file = this.innerFile || null const file = this.innerFile || null
if (file && file['message']) { if (file && file.message) {
this.$error({title: '上传出错', content: '错误信息' + file['message'], maskClosable: true}) this.$error({ title: '上传出错', content: '错误信息' + file.message, maskClosable: true })
} }
}, },
handleChangeUpload(info) { handleChangeUpload (info) {
let {originColumn: col} = this const { originColumn: col } = this
let {file} = info const { file } = info
let value = { const value = {
name: file.name, name: file.name,
type: file.type, type: file.type,
size: file.size, size: file.size,
@@ -182,44 +182,44 @@ export default {
percent: file.percent percent: file.percent
} }
if (file.response) { if (file.response) {
value['responseName'] = file.response[this.responseName] value.responseName = file.response[this.responseName]
} }
if (file.status === 'done') { if (file.status === 'done') {
if (typeof file.response.success === 'boolean') { if (typeof file.response.success === 'boolean') {
if (file.response.success) { if (file.response.success) {
value['path'] = file.response[this.responseName] value.path = file.response[this.responseName]
this.handleChangeCommon(value) this.handleChangeCommon(value)
} else { } else {
value['status'] = 'error' value.status = 'error'
value['message'] = file.response.message || '未知错误' value.message = file.response.message || '未知错误'
} }
} else { } else {
// 考虑到如果设置action上传路径为非jeecg-boot后台可能不会返回 success 属性的情况就默认为成功 // 考虑到如果设置action上传路径为非jeecg-boot后台可能不会返回 success 属性的情况就默认为成功
value['path'] = file.response[this.responseName] value.path = file.response[this.responseName]
this.handleChangeCommon(value) this.handleChangeCommon(value)
} }
} else if (file.status === 'error') { } else if (file.status === 'error') {
value['message'] = file.response.message || '未知错误' value.message = file.response.message || '未知错误'
} }
this.innerFile = value this.innerFile = value
}, },
handleClickDownloadFile() { handleClickDownloadFile () {
if (this.imgSrc) { if (this.imgSrc) {
window.open(this.imgSrc) window.open(this.imgSrc)
} }
}, },
handleClickDeleteFile() { handleClickDeleteFile () {
this.handleChangeCommon(null) this.handleChangeCommon(null)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
switches: {visible: true}, switches: { visible: true },
getValue: value => JVxeUploadCell.enhanced.getValue(value), getValue: value => JVxeUploadCell.enhanced.getValue(value),
setValue: value => JVxeUploadCell.enhanced.setValue(value), setValue: value => JVxeUploadCell.enhanced.setValue(value)
} }
} }
</script> </script>
@@ -6,14 +6,14 @@
</template> </template>
<script> <script>
import JVxeCellMixins, { dispatchEvent, vModel } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins, { dispatchEvent, vModel } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxePopupCell', name: 'JVxePopupCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
computed: { computed: {
popupProps() { popupProps () {
const {innerValue, originColumn: col, caseId, cellProps} = this const { innerValue, originColumn: col, caseId, cellProps } = this
return { return {
...cellProps, ...cellProps,
value: innerValue, value: innerValue,
@@ -23,19 +23,19 @@
destFields: col.destFields, destFields: col.destFields,
groupId: caseId, groupId: caseId,
param: col.param, param: col.param,
sorter: col.sorter, sorter: col.sorter
}
} }
},
}, },
methods: { methods: {
/** popup回调 */ /** popup回调 */
handlePopupInput(value, others) { handlePopupInput (value, others) {
const {row, originColumn: col} = this const { row, originColumn: col } = this
// 存储输入的值 // 存储输入的值
let popupValue = value let popupValue = value
if (others && Object.keys(others).length > 0) { if (others && Object.keys(others).length > 0) {
Object.keys(others).forEach(key => { Object.keys(others).forEach(key => {
let currentValue = others[key] const currentValue = others[key]
// 当前列直接赋值其他列通过vModel赋值 // 当前列直接赋值其他列通过vModel赋值
if (key === col.key) { if (key === col.key) {
popupValue = currentValue popupValue = currentValue
@@ -45,17 +45,17 @@
}) })
} }
this.handleChangeCommon(popupValue) this.handleChangeCommon(popupValue)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived(event) { editActived (event) {
dispatchEvent.call(this, event, 'ant-input') dispatchEvent.call(this, event, 'ant-input')
},
},
},
} }
}
}
}
</script> </script>
<style scoped> <style scoped>
@@ -16,37 +16,37 @@
</template> </template>
<script> <script>
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxeRadioCell', name: 'JVxeRadioCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
computed: { computed: {
scrolling() { scrolling () {
return !!this.renderOptions.scrolling return !!this.renderOptions.scrolling
}, },
clazz() { clazz () {
return { return {
'j-vxe-radio': true, 'j-vxe-radio': true,
'no-animation': this.scrolling 'no-animation': this.scrolling
} }
}, }
}, },
methods: { methods: {
handleRadioClick(item) { handleRadioClick (item) {
if (this.originColumn.allowClear === true) { if (this.originColumn.allowClear === true) {
// 取消选择 // 取消选择
if (item.value === this.innerValue) { if (item.value === this.innerValue) {
this.handleChangeCommon(null) this.handleChangeCommon(null)
} }
} }
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
switches: {visible: true}, switches: { visible: true }
}
} }
}
</script> </script>
<style lang="less"> <style lang="less">
@@ -11,19 +11,19 @@ const common = {
labelMap: new Map(), labelMap: new Map(),
/** 公共data */ /** 公共data */
data() { data () {
return { return {
loading: false, loading: false,
innerSelectValue: null, innerSelectValue: null,
innerOptions: [], innerOptions: []
} }
}, },
/** 公共计算属性 */ /** 公共计算属性 */
computed: { computed: {
dict() { dict () {
return this.originColumn.dict return this.originColumn.dict
}, },
options() { options () {
if (this.isAsync) { if (this.isAsync) {
return this.innerOptions return this.innerOptions
} else { } else {
@@ -31,16 +31,16 @@ const common = {
} }
}, },
// 是否是异步模式 // 是否是异步模式
isAsync() { isAsync () {
let isAsync = this.originColumn.async const isAsync = this.originColumn.async
return (isAsync != null && isAsync !== '') ? !!isAsync : true return (isAsync != null && isAsync !== '') ? !!isAsync : true
}, }
}, },
/** 公共属性监听 */ /** 公共属性监听 */
watch: { watch: {
innerValue: { innerValue: {
immediate: true, immediate: true,
handler(value) { handler (value) {
if (value == null || value === '') { if (value == null || value === '') {
this.innerSelectValue = null this.innerSelectValue = null
} else { } else {
@@ -48,7 +48,7 @@ const common = {
} }
} }
}, },
dict() { dict () {
this.loadDataByDict() this.loadDataByDict()
} }
}, },
@@ -56,15 +56,15 @@ const common = {
methods: { methods: {
// 根据 value 查询数据用于回显 // 根据 value 查询数据用于回显
async loadDataByValue(value) { async loadDataByValue (value) {
if (this.isAsync) { if (this.isAsync) {
if (this.innerSelectValue !== value) { if (this.innerSelectValue !== value) {
if (common.labelMap.has(value)) { if (common.labelMap.has(value)) {
this.innerOptions = cloneObject(common.labelMap.get(value)) this.innerOptions = cloneObject(common.labelMap.get(value))
} else { } 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) { if (success && result && result.length > 0) {
this.innerOptions = [{value: value, text: result[0]}] this.innerOptions = [{ value: value, text: result[0] }]
common.labelMap.set(value, cloneObject(this.innerOptions)) common.labelMap.set(value, cloneObject(this.innerOptions))
} }
} }
@@ -74,38 +74,38 @@ const common = {
}, },
// 初始化字典 // 初始化字典
async loadDataByDict() { async loadDataByDict () {
if (!this.isAsync) { if (!this.isAsync) {
// 如果字典项集合有数据 // 如果字典项集合有数据
if (!this.originColumn.options || this.originColumn.options.length === 0) { if (!this.originColumn.options || this.originColumn.options.length === 0) {
// 根据字典Code, 初始化字典数组 // 根据字典Code, 初始化字典数组
let dictStr = '' let dictStr = ''
if (this.dict) { if (this.dict) {
let arr = this.dict.split(',') const arr = this.dict.split(',')
if (arr[0].indexOf('where') > 0) { 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]) dictStr = tbInfo[0].trim() + ',' + arr[1] + ',' + arr[2] + ',' + encodeURIComponent(tbInfo[1])
} else { } else {
dictStr = this.dict dictStr = this.dict
} }
if (this.dict.indexOf(',') === -1) { if (this.dict.indexOf(',') === -1) {
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
let cache = getDictItemsFromCache(this.dict) const cache = getDictItemsFromCache(this.dict)
if (cache) { if (cache) {
this.innerOptions = cache this.innerOptions = cache
return return
} }
} }
let {success, result} = await ajaxGetDictItems(dictStr, null) const { success, result } = await ajaxGetDictItems(dictStr, null)
if (success) { if (success) {
this.innerOptions = result this.innerOptions = result
} }
} }
} }
} }
}, }
}, }
} }
@@ -113,25 +113,25 @@ const common = {
export const DictSearchSpanCell = { export const DictSearchSpanCell = {
name: 'JVxeSelectSearchSpanCell', name: 'JVxeSelectSearchSpanCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
data() { data () {
return { return {
...common.data.apply(this), ...common.data.apply(this)
} }
}, },
computed: { computed: {
...common.computed, ...common.computed
}, },
watch: { watch: {
...common.watch, ...common.watch
}, },
methods: { methods: {
...common.methods, ...common.methods
}, },
render(h) { render (h) {
return h('span', {}, [ return h('span', {}, [
filterDictText(this.innerOptions, this.innerSelectValue || this.innerValue) filterDictText(this.innerOptions, this.innerSelectValue || this.innerValue)
]) ])
}, }
} }
// 请求id // 请求id
@@ -141,7 +141,7 @@ let requestId = 0
export const DictSearchInputCell = { export const DictSearchInputCell = {
name: 'JVxeSelectSearchInputCell', name: 'JVxeSelectSearchInputCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
data() { data () {
return { return {
...common.data.apply(this), ...common.data.apply(this),
@@ -161,26 +161,26 @@ export const DictSearchInputCell = {
}, },
computed: { computed: {
...common.computed, ...common.computed,
tipsContent() { tipsContent () {
return this.originColumn.tipsContent || '请输入搜索内容' return this.originColumn.tipsContent || '请输入搜索内容'
}, },
filterOption() { filterOption () {
if (this.isAsync) { if (this.isAsync) {
return null return null
} }
return (input, option) => option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return (input, option) => option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, }
}, },
watch: { watch: {
...common.watch, ...common.watch
}, },
created() { created () {
this.loadData = debounce(this.loadData, 300)//消抖 this.loadData = debounce(this.loadData, 300)// 消抖
}, },
methods: { methods: {
...common.methods, ...common.methods,
loadData(value) { loadData (value) {
const currentRequestId = ++requestId const currentRequestId = ++requestId
this.loading = true this.loading = true
this.innerOptions = [] this.innerOptions = []
@@ -191,11 +191,11 @@ export const DictSearchInputCell = {
} }
// 字典code格式table,text,code // 字典code格式table,text,code
this.hasRequest = true this.hasRequest = true
getAction(`/sys/dict/loadDict/${this.dict}`, {keyword: value}).then(res => { getAction(`/sys/dict/loadDict/${this.dict}`, { keyword: value }).then(res => {
if (currentRequestId !== requestId) { if (currentRequestId !== requestId) {
return return
} }
let {success, result, message} = res const { success, result, message } = res
if (success) { if (success) {
this.innerOptions = result this.innerOptions = result
result.forEach((item) => { result.forEach((item) => {
@@ -209,11 +209,11 @@ export const DictSearchInputCell = {
}) })
}, },
handleChange(selectedValue) { handleChange (selectedValue) {
this.innerSelectValue = selectedValue this.innerSelectValue = selectedValue
this.handleChangeCommon(this.innerSelectValue) this.handleChangeCommon(this.innerSelectValue)
}, },
handleSearch(value) { handleSearch (value) {
if (this.isAsync) { if (this.isAsync) {
// 在输入时也应该开启加载因为loadData加了消抖所以会有800ms的用户主观上认为的卡顿时间 // 在输入时也应该开启加载因为loadData加了消抖所以会有800ms的用户主观上认为的卡顿时间
this.loading = true this.loading = true
@@ -224,17 +224,17 @@ export const DictSearchInputCell = {
} }
}, },
renderOptionItem() { renderOptionItem () {
let options = [] const options = []
this.options.forEach(({value, text, label, title, disabled}) => { this.options.forEach(({ value, text, label, title, disabled }) => {
options.push( options.push(
<a-select-option key={value} value={value} disabled={disabled}>{text || label || title}</a-select-option> <a-select-option key={value} value={value} disabled={disabled}>{text || label || title}</a-select-option>
) )
}) })
return options return options
}
}, },
}, render () {
render() {
return ( return (
<a-select <a-select
showSearch showSearch
@@ -254,9 +254,9 @@ export const DictSearchInputCell = {
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived(event) { editActived (event) {
dispatchEvent.call(this, event, 'ant-select') dispatchEvent.call(this, event, 'ant-select')
}, }
}, }
} }
} }
+3 -3
View File
@@ -11,8 +11,8 @@
</template> </template>
<script> <script>
export default { export default {
name: "Trend", name: 'Trend',
props: { props: {
prefixCls: { prefixCls: {
type: String, type: String,
@@ -33,7 +33,7 @@
default: false default: false
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+37 -39
View File
@@ -7,79 +7,77 @@ export default class Area {
* 构造器 * 构造器
* @param express * @param express
*/ */
constructor(pcaa) { constructor (pcaa) {
if(!pcaa){ if (!pcaa) {
pcaa = Vue.prototype.$Jpcaa; pcaa = Vue.prototype.$Jpcaa
} }
let arr = [] const arr = []
const province = pcaa['86'] const province = pcaa['86']
Object.keys(province).map(key=>{ Object.keys(province).map(key => {
arr.push({id:key, text:province[key], pid:'86', index:1}); arr.push({ id: key, text: province[key], pid: '86', index: 1 })
const city = pcaa[key]; const city = pcaa[key]
Object.keys(city).map(key2=>{ Object.keys(city).map(key2 => {
arr.push({id:key2, text:city[key2], pid:key, index:2}); arr.push({ id: key2, text: city[key2], pid: key, index: 2 })
const qu = pcaa[key2]; const qu = pcaa[key2]
if(qu){ if (qu) {
Object.keys(qu).map(key3=>{ 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(){ get pca () {
return this.all; return this.all
} }
getCode(text){ getCode (text) {
if(!text || text.length==0){ if (!text || text.length == 0) {
return '' return ''
} }
for(let item of this.all){ for (const item of this.all) {
if(item.text === text){ if (item.text === text) {
return item.id; return item.id
} }
} }
} }
getText(code){ getText (code) {
if(!code || code.length==0){ if (!code || code.length == 0) {
return '' return ''
} }
let arr = [] const arr = []
this.getAreaBycode(code, arr, 3); this.getAreaBycode(code, arr, 3)
return arr.join('/') return arr.join('/')
} }
getRealCode(code){ getRealCode (code) {
let arr = [] const arr = []
this.getPcode(code, arr, 3) this.getPcode(code, arr, 3)
return arr; return arr
} }
getPcode(id, arr, index){ getPcode (id, arr, index) {
for(let item of this.all){ for (const item of this.all) {
if(item.id === id && item.index == index){ if (item.id === id && item.index == index) {
arr.unshift(id) arr.unshift(id)
if(item.pid != '86'){ if (item.pid != '86') {
this.getPcode(item.pid, arr, --index) this.getPcode(item.pid, arr, --index)
} }
} }
} }
} }
getAreaBycode(code, arr, index){ getAreaBycode (code, arr, index) {
for(let item of this.all){ for (const item of this.all) {
if(item.id === code && item.index == index){ if (item.id === code && item.index == index) {
arr.unshift(item.text); arr.unshift(item.text)
if(item.pid != '86'){ if (item.pid != '86') {
this.getAreaBycode(item.pid, arr, --index) this.getAreaBycode(item.pid, arr, --index)
} }
} }
} }
} }
} }
+6 -6
View File
@@ -35,12 +35,12 @@ export const cutStrByFullLength = (str = '', maxLength) => {
} }
// 下划线转换驼峰 // 下划线转换驼峰
export function underLinetoHump(name) { export function underLinetoHump (name) {
return name.replace(/\_(\w)/g, function(all, letter){ return name.replace(/\_(\w)/g, function (all, letter) {
return letter.toUpperCase(); return letter.toUpperCase()
}); })
} }
// 驼峰转换下划线 // 驼峰转换下划线
export function humptoUnderLine(name) { export function humptoUnderLine (name) {
return name.replace(/([A-Z])/g,"_$1").toLowerCase(); return name.replace(/([A-Z])/g, '_$1').toLowerCase()
} }
@@ -13,9 +13,9 @@
</template> </template>
<script> <script>
import { triggerWindowResizeEvent } from '@/utils/util' import { triggerWindowResizeEvent } from '@/utils/util'
export default { export default {
name: 'AreaChartTy', name: 'AreaChartTy',
props: { props: {
// 图表数据 // 图表数据
@@ -70,17 +70,17 @@
} }
}, },
computed: { computed: {
scale() { scale () {
return [ return [
{ dataKey: 'x', title: this.x, alias: this.x }, { dataKey: 'x', title: this.x, alias: this.x },
{ dataKey: 'y', title: this.y, alias: this.y, min: this.min, max: this.max } { dataKey: 'y', title: this.y, alias: this.y, min: this.min, max: this.max }
] ]
} }
}, },
mounted() { mounted () {
triggerWindowResizeEvent() triggerWindowResizeEvent()
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+6 -6
View File
@@ -10,9 +10,9 @@
</template> </template>
<script> <script>
import { triggerWindowResizeEvent } from '@/utils/util' import { triggerWindowResizeEvent } from '@/utils/util'
export default { export default {
name: 'Bar', name: 'Bar',
props: { props: {
dataSource: { dataSource: {
@@ -32,19 +32,19 @@
default: 254 default: 254
} }
}, },
data() { data () {
return { padding: ['auto', 'auto', '40', '50'] } return { padding: ['auto', 'auto', '40', '50'] }
}, },
computed: { computed: {
scale() { scale () {
return [{ return [{
dataKey: 'y', dataKey: 'y',
alias: this.yaxisText alias: this.yaxisText
}] }]
} }
}, },
mounted() { mounted () {
triggerWindowResizeEvent() triggerWindowResizeEvent()
} }
} }
</script> </script>
+12 -12
View File
@@ -12,9 +12,9 @@
</template> </template>
<script> <script>
import { ChartEventMixins } from './mixins/ChartMixins' import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'BarAndLine', name: 'BarAndLine',
mixins: [ChartEventMixins], mixins: [ChartEventMixins],
props: { props: {
@@ -26,12 +26,12 @@
type: Array, type: Array,
default: () => [ default: () => [
{ type: '10:10', bar: 200, line: 1000 }, { type: '10:10', bar: 200, line: 1000 },
{ type: '10:15', bar: 600, line: 1000}, { type: '10:15', bar: 600, line: 1000 },
{ type: '10:20', bar: 200, line: 1000}, { type: '10:20', bar: 200, line: 1000 },
{ type: '10:25', bar: 900, line: 1000}, { type: '10:25', bar: 900, line: 1000 },
{ type: '10:30', bar: 200, line: 1000}, { type: '10:30', bar: 200, line: 1000 },
{ type: '10:35', bar: 200, line: 1000}, { type: '10:35', bar: 200, line: 1000 },
{ type: '10:40', bar: 100, line: 1000} { type: '10:40', bar: 100, line: 1000 }
] ]
}, },
height: { height: {
@@ -39,9 +39,9 @@
default: 400 default: 400
} }
}, },
data() { data () {
return { return {
padding: { top:50, right:50, bottom:100, left:50 }, padding: { top: 50, right: 50, bottom: 100, left: 50 },
scale: [{ scale: [{
dataKey: 'bar', dataKey: 'bar',
min: 0 min: 0
@@ -52,9 +52,9 @@
} }
}, },
computed: { computed: {
data() { data () {
return this.dataSource return this.dataSource
} }
} }
} }
</script> </script>
+11 -11
View File
@@ -11,10 +11,10 @@
</template> </template>
<script> <script>
import { DataSet } from '@antv/data-set' import { DataSet } from '@antv/data-set'
import { ChartEventMixins } from './mixins/ChartMixins' import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'BarMultid', name: 'BarMultid',
mixins: [ChartEventMixins], mixins: [ChartEventMixins],
props: { props: {
@@ -25,8 +25,8 @@
dataSource: { dataSource: {
type: Array, type: Array,
default: () => [ 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: '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: '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: { fields: {
@@ -43,7 +43,7 @@
default: 254 default: 254
} }
}, },
data() { data () {
return { return {
adjust: [{ adjust: [{
type: 'dodge', type: 'dodge',
@@ -52,7 +52,7 @@
} }
}, },
computed: { computed: {
data() { data () {
const dv = new DataSet.View().source(this.dataSource) const dv = new DataSet.View().source(this.dataSource)
dv.transform({ dv.transform({
type: 'fold', type: 'fold',
@@ -62,7 +62,7 @@
}) })
// bar 使用不了 - / 所以替换下 // bar 使用不了 - / 所以替换下
let rows = dv.rows.map(row => { const rows = dv.rows.map(row => {
if (typeof row.x === 'string') { if (typeof row.x === 'string') {
row.x = row.x.replace(/[-/]/g, '_') row.x = row.x.replace(/[-/]/g, '_')
} }
@@ -70,7 +70,7 @@
}) })
// 替换别名 // 替换别名
rows.forEach(row => { rows.forEach(row => {
for (let item of this.aliases) { for (const item of this.aliases) {
if (item.field === row.type) { if (item.field === row.type) {
row.type = item.alias row.type = item.alias
break break
@@ -79,7 +79,7 @@
}) })
return rows return rows
}, },
scale() { scale () {
return [ return [
{ {
type: 'cat', type: 'cat',
@@ -88,7 +88,7 @@
] ]
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+52 -52
View File
@@ -45,16 +45,16 @@
</template> </template>
<script> <script>
import { registerShape } from 'viser-vue'; import { registerShape } from 'viser-vue'
registerShape('point', 'pointer', { registerShape('point', 'pointer', {
draw(cfg, container) { draw (cfg, container) {
let point = cfg.points[0]; let point = cfg.points[0]
point = this.parsePoint(point); point = this.parsePoint(point)
const center = this.parsePoint({ const center = this.parsePoint({
x: 0, x: 0,
y: 0, y: 0
}); })
container.addShape('line', { container.addShape('line', {
attrs: { attrs: {
x1: center.x, x1: center.x,
@@ -63,9 +63,9 @@
y2: point.y + 15, y2: point.y + 15,
stroke: cfg.color, stroke: cfg.color,
lineWidth: 5, lineWidth: 5,
lineCap: 'round', lineCap: 'round'
} }
}); })
return container.addShape('circle', { return container.addShape('circle', {
attrs: { attrs: {
x: center.x, x: center.x,
@@ -73,78 +73,78 @@
r: 9.75, r: 9.75,
stroke: cfg.color, stroke: cfg.color,
lineWidth: 4.5, lineWidth: 4.5,
fill: '#fff', fill: '#fff'
} }
}); })
} }
}); })
const scale = [{ const scale = [{
dataKey: 'value', dataKey: 'value',
min: 0, min: 0,
max: 9, max: 9,
tickInterval: 1, tickInterval: 1,
nice: false, nice: false
}]; }]
const data = [ const data = [
{ value: 7.0 }, { value: 7.0 }
]; ]
export default { export default {
name:"DashChartDemo", name: 'DashChartDemo',
props:{ props: {
datasource:{ datasource: {
type: Number, type: Number,
default:7 default: 7
}, },
title: { title: {
type: String, type: String,
default: '' default: ''
} }
}, },
created(){ created () {
if(!this.datasource){ if (!this.datasource) {
this.chartData = data; this.chartData = data
}else{ } else {
this.chartData = [ this.chartData = [
{ value: this.datasource }, { value: this.datasource }
]; ]
} }
this.getChartData() this.getChartData()
}, },
watch: { watch: {
'datasource': function (val) { datasource: function (val) {
this.chartData = [ this.chartData = [
{ value: val}, { value: val }
]; ]
this.getChartData(); this.getChartData()
} }
}, },
methods:{ methods: {
getChartData(){ getChartData () {
if(this.chartData && this.chartData.length>0){ if (this.chartData && this.chartData.length > 0) {
this.abcd = this.chartData[0].value * 10 this.abcd = this.chartData[0].value * 10
}else{ } else {
this.abcd = 70 this.abcd = 70
} }
}, },
getHtmlGuideHtml(){ getHtmlGuideHtml () {
return '<div style="width: 300px;text-align: center;">\n' + return '<div style="width: 300px;text-align: center;">\n' +
'<p style="font-size: 14px;color: #545454;margin: 0;">'+this.title+'</p>\n' + '<p style="font-size: 14px;color: #545454;margin: 0;">' + this.title + '</p>\n' +
'<p style="font-size: 36px;color: #545454;margin: 0;">'+this.abcd+'%</p>\n' + '<p style="font-size: 36px;color: #545454;margin: 0;">' + this.abcd + '%</p>\n' +
'</div>' '</div>'
}, },
getArcGuide2End(){ getArcGuide2End () {
return [this.chartData[0].value, 0.945] return [this.chartData[0].value, 0.945]
} }
}, },
data() { data () {
return { return {
chartData:[], chartData: [],
height: 400, height: 400,
scale: scale, scale: scale,
abcd:70, abcd: 70,
axisLabel: { axisLabel: {
offset: -16, offset: -16,
textStyle: { textStyle: {
@@ -156,23 +156,23 @@
axisSubTickLine: { axisSubTickLine: {
length: -8, length: -8,
stroke: '#fff', stroke: '#fff',
strokeOpacity: 1, strokeOpacity: 1
}, },
axisTickLine: { axisTickLine: {
length: -17, length: -17,
stroke: '#fff', stroke: '#fff',
strokeOpacity: 1, strokeOpacity: 1
}, },
arcGuide1Start: [0, 0.945], arcGuide1Start: [0, 0.945],
arcGuide1End: [9, 0.945], arcGuide1End: [9, 0.945],
arcGuide1Style: { arcGuide1Style: {
stroke: '#CBCBCB', stroke: '#CBCBCB',
lineWidth: 18, lineWidth: 18
}, },
arcGuide2Start: [0, 0.945], arcGuide2Start: [0, 0.945],
arcGuide2Style: { arcGuide2Style: {
stroke: '#1890FF', stroke: '#1890FF',
lineWidth: 18, lineWidth: 18
}, },
htmlGuidePosition: ['50%', '100%'], htmlGuidePosition: ['50%', '100%'],
htmlGuideHtml: ` htmlGuideHtml: `
@@ -180,8 +180,8 @@
<p style="font-size: 14px;color: #545454;margin: 0;">${this.title}</p> <p style="font-size: 14px;color: #545454;margin: 0;">${this.title}</p>
<p style="font-size: 36px;color: #545454;margin: 0;">${this.abcd}%</p> <p style="font-size: 36px;color: #545454;margin: 0;">${this.abcd}%</p>
</div> </div>
`, `
}; }
}, }
}; }
</script> </script>
+13 -13
View File
@@ -15,47 +15,47 @@
<script> <script>
const data = [] const data = []
for (let i = 0; i < 12; i += 1) { for (let i = 0; i < 12; i += 1) {
data.push({ data.push({
x: `${i + 1}`, x: `${i + 1}`,
y: Math.floor(Math.random() * 1000) + 200 y: Math.floor(Math.random() * 1000) + 200
}) })
} }
const tooltip = [ const tooltip = [
'x*y', 'x*y',
(x, y) => ({ (x, y) => ({
name: x, name: x,
value: y value: y
}) })
] ]
const scale = [{ const scale = [{
dataKey: 'x', dataKey: 'x',
min: 2 min: 2
}, { }, {
dataKey: 'y', dataKey: 'y',
title: '时间', title: '时间',
min: 1, min: 1,
max: 22 max: 22
}] }]
export default { export default {
name: "Bar", name: 'Bar',
props: { props: {
title: { title: {
type: String, type: String,
default: '' default: ''
} }
}, },
mounted(){ mounted () {
this.datasource = data this.datasource = data
}, },
data () { data () {
return { return {
datasource:[], datasource: [],
scale, scale,
tooltip tooltip
} }
} }
} }
</script> </script>
@@ -12,10 +12,10 @@
</template> </template>
<script> <script>
import { DataSet } from '@antv/data-set' import { DataSet } from '@antv/data-set'
import { ChartEventMixins } from './mixins/ChartMixins' import { ChartEventMixins } from './mixins/ChartMixins'
export default { export default {
name: 'LineChartMultid', name: 'LineChartMultid',
mixins: [ChartEventMixins], mixins: [ChartEventMixins],
props: { props: {
@@ -45,7 +45,7 @@
default: () => ['jeroOne', 'jeroTwo'] default: () => ['jeroOne', 'jeroTwo']
}, },
// 别名需要的格式[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}] // 别名需要的格式[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
aliases:{ aliases: {
type: Array, type: Array,
default: () => [] default: () => []
}, },
@@ -54,7 +54,7 @@
default: 254 default: 254
} }
}, },
data() { data () {
return { return {
scale: [{ scale: [{
type: 'cat', type: 'cat',
@@ -66,7 +66,7 @@
} }
}, },
computed: { computed: {
data() { data () {
const dv = new DataSet.View().source(this.dataSource) const dv = new DataSet.View().source(this.dataSource)
dv.transform({ dv.transform({
type: 'fold', type: 'fold',
@@ -74,10 +74,10 @@
key: 'x', key: 'x',
value: 'y' value: 'y'
}) })
let rows = dv.rows const rows = dv.rows
// 替换别名 // 替换别名
rows.forEach(row => { rows.forEach(row => {
for (let item of this.aliases) { for (const item of this.aliases) {
if (item.field === row.x) { if (item.field === row.x) {
row.x = item.alias row.x = item.alias
break break
@@ -87,7 +87,7 @@
return rows return rows
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+5 -5
View File
@@ -48,13 +48,13 @@
<script> <script>
const sourceDataConst = [ const sourceDataConst = [
{ transfer: '一月', value: 813 }, { transfer: '一月', value: 813 },
{ transfer: '二月', value: 233 }, { transfer: '二月', value: 233 },
{ transfer: '三月', value: 561 } { transfer: '三月', value: 561 }
] ]
export default { export default {
name: 'Liquid', name: 'Liquid',
props: { props: {
height: { height: {
@@ -66,13 +66,13 @@
default: 0 default: 0
} }
}, },
data() { data () {
return { return {
data: sourceDataConst, data: sourceDataConst,
scale: [] scale: []
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+10 -10
View File
@@ -10,19 +10,19 @@
</template> </template>
<script> <script>
import moment from 'dayjs' import moment from 'dayjs'
const sourceData = [] const sourceData = []
const beginDay = new Date().getTime() const beginDay = new Date().getTime()
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
sourceData.push({ sourceData.push({
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
y: Math.round(Math.random() * 10) y: Math.round(Math.random() * 10)
}) })
} }
export default { export default {
name: 'MiniArea', name: 'MiniArea',
props: { props: {
dataSource: { dataSource: {
@@ -40,28 +40,28 @@
default: 'y' default: 'y'
} }
}, },
data() { data () {
return { return {
data: [], data: [],
height: 100 height: 100
} }
}, },
computed: { computed: {
scale() { scale () {
return [ return [
{ dataKey: 'x', title: this.x, alias: this.x }, { dataKey: 'x', title: this.x, alias: this.x },
{ dataKey: 'y', title: this.y, alias: this.y } { dataKey: 'y', title: this.y, alias: this.y }
] ]
} }
}, },
created() { created () {
if (this.dataSource.length === 0) { if (this.dataSource.length === 0) {
this.data = sourceData this.data = sourceData
} else { } else {
this.data = this.dataSource this.data = this.dataSource
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+14 -14
View File
@@ -8,37 +8,37 @@
</template> </template>
<script> <script>
import moment from 'dayjs' import moment from 'dayjs'
const sourceData = [] const sourceData = []
const beginDay = new Date().getTime() const beginDay = new Date().getTime()
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
sourceData.push({ sourceData.push({
x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
y: Math.round(Math.random() * 10) y: Math.round(Math.random() * 10)
}) })
} }
const tooltip = [ const tooltip = [
'x*y', 'x*y',
(x, y) => ({ (x, y) => ({
name: x, name: x,
value: y value: y
}) })
] ]
const scale = [{ const scale = [{
dataKey: 'x', dataKey: 'x',
min: 2 min: 2
}, { }, {
dataKey: 'y', dataKey: 'y',
title: '时间', title: '时间',
min: 1, min: 1,
max: 30 max: 30
}] }]
export default { export default {
name: 'MiniBar', name: 'MiniBar',
props: { props: {
dataSource: { dataSource: {
@@ -54,21 +54,21 @@
default: 200 default: 200
} }
}, },
created() { created () {
if (this.dataSource.length === 0) { if (this.dataSource.length === 0) {
this.data = sourceData this.data = sourceData
} else { } else {
this.data = this.dataSource this.data = this.dataSource
} }
}, },
data() { data () {
return { return {
tooltip, tooltip,
data: [], data: [],
scale scale
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@@ -11,7 +11,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'MiniProgress', name: 'MiniProgress',
props: { props: {
target: { target: {
@@ -31,7 +31,7 @@
default: 0 default: 0
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+7 -7
View File
@@ -9,10 +9,10 @@
</template> </template>
<script> <script>
const DataSet = require('@antv/data-set') import { ChartEventMixins } from './mixins/ChartMixins'
import { ChartEventMixins } from './mixins/ChartMixins' const DataSet = require('@antv/data-set')
export default { export default {
name: 'Pie', name: 'Pie',
mixins: [ChartEventMixins], mixins: [ChartEventMixins],
props: { props: {
@@ -35,7 +35,7 @@
] ]
} }
}, },
data() { data () {
return { return {
scale: [{ scale: [{
dataKey: 'percent', dataKey: 'percent',
@@ -54,8 +54,8 @@
} }
}, },
computed: { computed: {
data() { data () {
let dv = new DataSet.View().source(this.dataSource) const dv = new DataSet.View().source(this.dataSource)
// 计算数据百分比 // 计算数据百分比
dv.transform({ dv.transform({
type: 'percent', type: 'percent',
@@ -66,5 +66,5 @@
return dv.rows return dv.rows
} }
} }
} }
</script> </script>
+12 -12
View File
@@ -11,7 +11,7 @@
</template> </template>
<script> <script>
const axis1Opts = { const axis1Opts = {
dataKey: 'item', dataKey: 'item',
line: null, line: null,
tickLine: null, tickLine: null,
@@ -21,8 +21,8 @@
}, },
hideFirstLine: false hideFirstLine: false
} }
} }
const axis2Opts = { const axis2Opts = {
dataKey: 'score', dataKey: 'score',
line: null, line: null,
tickLine: null, tickLine: null,
@@ -32,9 +32,9 @@
lineDash: null lineDash: null
} }
} }
} }
const scale = [ const scale = [
{ {
dataKey: 'score', dataKey: 'score',
min: 0, min: 0,
@@ -43,17 +43,17 @@
dataKey: 'user', dataKey: 'user',
alias: '类型' alias: '类型'
} }
] ]
const sourceData = [ const sourceData = [
{ item: '示例一', score: 40 }, { item: '示例一', score: 40 },
{ item: '示例二', score: 20 }, { item: '示例二', score: 20 },
{ item: '示例三', score: 67 }, { item: '示例三', score: 67 },
{ item: '示例四', score: 43 }, { item: '示例四', score: 43 },
{ item: '示例五', score: 90 } { item: '示例五', score: 90 }
] ]
export default { export default {
name: 'Radar', name: 'Radar',
props: { props: {
height: { height: {
@@ -65,7 +65,7 @@
default: () => [] default: () => []
} }
}, },
data() { data () {
return { return {
axis1Opts, axis1Opts,
axis2Opts, axis2Opts,
@@ -74,7 +74,7 @@
} }
}, },
watch: { watch: {
dataSource(newVal) { dataSource (newVal) {
if (newVal.length === 0) { if (newVal.length === 0) {
this.data = sourceData this.data = sourceData
} else { } else {
@@ -82,7 +82,7 @@
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+3 -3
View File
@@ -12,8 +12,8 @@
</template> </template>
<script> <script>
export default { export default {
name: "RankList", name: 'RankList',
// ['title', 'list'] // ['title', 'list']
props: { props: {
title: { title: {
@@ -29,7 +29,7 @@
default: null default: null
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+13 -13
View File
@@ -12,19 +12,19 @@
</template> </template>
<script> <script>
const DataSet = require('@antv/data-set'); const DataSet = require('@antv/data-set')
export default { export default {
name: 'StackBar', name: 'StackBar',
props: { props: {
dataSource: { dataSource: {
type: Array, type: Array,
required: true, required: true,
default: () => [ default: () => [
{ 'State': '请假', '流转中': 25, '已归档': 18 }, { State: '请假', 流转中: 25, 已归档: 18 },
{ 'State': '出差', '流转中': 30, '已归档': 20 }, { State: '出差', 流转中: 30, 已归档: 20 },
{ 'State': '加班', '流转中': 38, '已归档': 42}, { State: '加班', 流转中: 38, 已归档: 42 },
{ 'State': '用车', '流转中': 51, '已归档': 67} { State: '用车', 流转中: 51, 已归档: 67 }
] ]
}, },
height: { height: {
@@ -32,23 +32,23 @@
default: 254 default: 254
} }
}, },
data() { data () {
return { return {
label: { offset: 12 } label: { offset: 12 }
} }
}, },
computed: { computed: {
data() { data () {
const dv = new DataSet.View().source(this.dataSource); const dv = new DataSet.View().source(this.dataSource)
dv.transform({ dv.transform({
type: 'fold', type: 'fold',
fields: ['流转中', '已归档'], fields: ['流转中', '已归档'],
key: '流程状态', key: '流程状态',
value: '流程数量', value: '流程数量',
retains: ['State'], retains: ['State']
}); })
return dv.rows; return dv.rows
}
} }
} }
}
</script> </script>
@@ -16,7 +16,7 @@
<script> <script>
export default { export default {
name: 'Bar', name: 'Bar',
props: { props: {
title: { title: {
@@ -40,18 +40,18 @@
default: 254 default: 254
} }
}, },
data() { data () {
return {} return {}
}, },
computed: { computed: {
scale() { scale () {
return [ return [
{ dataKey: 'x', title: this.x, alias: this.x }, { dataKey: 'x', title: this.x, alias: this.x },
{ dataKey: 'y', title: this.y, alias: this.y } { dataKey: 'y', title: this.y, alias: this.y }
] ]
} }
}, },
created() { created () {
// this.getMonthBar() // this.getMonthBar()
}, },
methods: { methods: {
@@ -62,5 +62,5 @@
// }) // })
// } // }
} }
} }
</script> </script>
+5 -5
View File
@@ -7,8 +7,8 @@
</template> </template>
<script> <script>
export default { export default {
name: "Trend", name: 'Trend',
props: { props: {
// 同title // 同title
term: { term: {
@@ -45,11 +45,11 @@
} }
}, },
created () { created () {
let type = this.type === null ? this.value >= this.target : this.type const type = this.type === null ? this.value >= this.target : this.type
this.trend = type ? 'up' : 'down'; this.trend = type ? 'up' : 'down'
this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed) this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@@ -1,10 +1,10 @@
export const ChartEventMixins = { export const ChartEventMixins = {
methods: { methods: {
handleClick(event, chart) { handleClick (event, chart) {
this.handleEvent('click', event, chart) this.handleEvent('click', event, chart)
}, },
handleEvent(eventName, event, chart) { handleEvent (eventName, event, chart) {
this.$emit(eventName, event, chart) this.$emit(eventName, event, chart)
}, }
} }
} }
+36 -36
View File
@@ -18,89 +18,89 @@
</template> </template>
<script> <script>
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default { export default {
name: "JDictSelectTag", name: 'JDictSelectTag',
props: { props: {
dictCode: String, dictCode: String,
placeholder: String, placeholder: String,
disabled: Boolean, disabled: Boolean,
value: [String, Number], value: [String, Number],
type: String, type: String,
getPopupContainer:{ getPopupContainer: {
type: Function, type: Function,
default: (node) => node.parentNode default: (node) => node.parentNode
} }
}, },
data() { data () {
return { return {
dictOptions: [], dictOptions: [],
tagType:"" tagType: ''
} }
}, },
watch:{ watch: {
dictCode:{ dictCode: {
immediate:true, immediate: true,
handler() { handler () {
this.initDictData() this.initDictData()
}, }
} }
}, },
created() { created () {
if(!this.type || this.type==="list"){ if (!this.type || this.type === 'list') {
this.tagType = "select" this.tagType = 'select'
}else{ } else {
this.tagType = this.type this.tagType = this.type
} }
}, },
computed: { computed: {
getValueSting(){ getValueSting () {
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------ // update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
// 当有null或 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的文字 ------ // update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
}, }
}, },
methods: { methods: {
initDictData() { initDictData () {
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
if(getDictItemsFromCache(this.dictCode)){ if (getDictItemsFromCache(this.dictCode)) {
this.dictOptions = getDictItemsFromCache(this.dictCode); this.dictOptions = getDictItemsFromCache(this.dictCode)
return return
} }
//根据字典Code, 初始化字典数组 // 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => { ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) { if (res.success) {
this.dictOptions = res.result; this.dictOptions = res.result
} }
}) })
}, },
handleInput(e='') { handleInput (e = '') {
let val; let val
if(Object.keys(e).includes('target')){ if (Object.keys(e).includes('target')) {
val = e.target.value val = e.target.value
}else{ } else {
val = e val = e
} }
console.log(val); console.log(val)
this.$emit('change', val); this.$emit('change', val)
//解决数据规则选择自定义SQL 规则值无法输入空格 // 解决数据规则选择自定义SQL 规则值无法输入空格
this.$emit('input', val); this.$emit('input', val)
}, },
setCurrentDictOptions(dictOptions){ setCurrentDictOptions (dictOptions) {
this.dictOptions = dictOptions this.dictOptions = dictOptions
}, },
getCurrentDictOptions(){ getCurrentDictOptions () {
return this.dictOptions return this.dictOptions
} }
}, },
model:{ model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
+51 -51
View File
@@ -4,28 +4,28 @@
* date: 20190109 * date: 20190109
*/ */
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
import {getAction} from '@/api/manage' import { getAction } from '@/api/manage'
/** /**
* 获取字典数组 * 获取字典数组
* @param dictCode 字典Code * @param dictCode 字典Code
* @return List<Map> * @return List<Map>
*/ */
export async function initDictOptions(dictCode) { export async function initDictOptions (dictCode) {
if (!dictCode) { if (!dictCode) {
return '字典Code不能为空!'; return '字典Code不能为空!'
} }
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
if(getDictItemsFromCache(dictCode)){ if (getDictItemsFromCache(dictCode)) {
let res = {} const res = {}
res.result = getDictItemsFromCache(dictCode); res.result = getDictItemsFromCache(dictCode)
res.success = true; res.success = true
return res; return res
} }
//获取字典数组 // 获取字典数组
let res = await ajaxGetDictItems(dictCode); const res = await ajaxGetDictItems(dictCode)
return res; return res
} }
/** /**
@@ -34,10 +34,10 @@ export async function initDictOptions(dictCode) {
* @param text 字典值 * @param text 字典值
* @return String * @return String
*/ */
export function filterDictText(dictOptions, text) { export function filterDictText (dictOptions, text) {
// --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 --- // --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---
if (text != null && Array.isArray(dictOptions)) { if (text != null && Array.isArray(dictOptions)) {
let result = [] const result = []
// 允许多个逗号分隔允许传数组对象 // 允许多个逗号分隔允许传数组对象
let splitText let splitText
if (Array.isArray(text)) { if (Array.isArray(text)) {
@@ -45,9 +45,9 @@ export function filterDictText(dictOptions, text) {
} else { } else {
splitText = text.toString().trim().split(',') splitText = text.toString().trim().split(',')
} }
for (let txt of splitText) { for (const txt of splitText) {
let dictText = txt let dictText = txt
for (let dictItem of dictOptions) { for (const dictItem of dictOptions) {
if (txt.toString() === dictItem.value.toString()) { if (txt.toString() === dictItem.value.toString()) {
dictText = (dictItem.text || dictItem.title || dictItem.label) dictText = (dictItem.text || dictItem.title || dictItem.label)
break break
@@ -67,11 +67,11 @@ export function filterDictText(dictOptions, text) {
* @param text 字典值 * @param text 字典值
* @return String * @return String
*/ */
export function filterMultiDictText(dictOptions, text) { export function filterMultiDictText (dictOptions, text) {
//js !text 认为0为空所以做提前处理 // js !text 认为0为空所以做提前处理
if(text === 0 || text === '0'){ if (text === 0 || text === '0') {
if(dictOptions){ if (dictOptions) {
for (let dictItem of dictOptions) { for (const dictItem of dictOptions) {
if (text == dictItem.value) { if (text == dictItem.value) {
return dictItem.text return dictItem.text
} }
@@ -79,26 +79,26 @@ export function filterMultiDictText(dictOptions, text) {
} }
} }
if(!text || text=='null' || !dictOptions || dictOptions.length==0){ if (!text || text == 'null' || !dictOptions || dictOptions.length == 0) {
return "" return ''
} }
let re = ""; let re = ''
text = text.toString() text = text.toString()
let arr = text.split(",") const arr = text.split(',')
dictOptions.forEach(function (option) { dictOptions.forEach(function (option) {
if(option){ if (option) {
for(let i=0;i<arr.length;i++){ for (let i = 0; i < arr.length; i++) {
if (arr[i] === option.value) { if (arr[i] === option.value) {
re += option.text+","; re += option.text + ','
break; break
} }
} }
} }
}); })
if(re==""){ if (re == '') {
return text; return text
} }
return re.substring(0,re.length-1); return re.substring(0, re.length - 1)
} }
/** /**
@@ -106,34 +106,34 @@ export function filterMultiDictText(dictOptions, text) {
* @param children * @param children
* @returns string * @returns string
*/ */
export function filterDictTextByCache(dictCode, key) { export function filterDictTextByCache (dictCode, key) {
if(key==null ||key.length==0){ if (key == null || key.length == 0) {
return; return
} }
if (!dictCode) { if (!dictCode) {
return '字典Code不能为空!'; return '字典Code不能为空!'
} }
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
if(getDictItemsFromCache(dictCode)){ 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){ if (item && item.length > 0) {
return item[0]["text"] return item[0].text
} }
} }
} }
/** 通过code获取字典数组 */ /** 通过code获取字典数组 */
export async function getDictItems(dictCode, params) { export async function getDictItems (dictCode, params) {
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
if(getDictItemsFromCache(dictCode)){ if (getDictItemsFromCache(dictCode)) {
let desformDictItems = getDictItemsFromCache(dictCode).map(item => ({...item, label: item.text})) const desformDictItems = getDictItemsFromCache(dictCode).map(item => ({ ...item, label: item.text }))
return desformDictItems; return desformDictItems
} }
//缓存中没有就请求后台 // 缓存中没有就请求后台
return await ajaxGetDictItems(dictCode, params).then(({success, result}) => { return await ajaxGetDictItems(dictCode, params).then(({ success, result }) => {
if (success) { 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) console.log('------- 从DB中获取到了字典-------dictCode : ', dictCode, res)
return Promise.resolve(res) return Promise.resolve(res)
} else { } else {
@@ -20,8 +20,8 @@
</template> </template>
<script> <script>
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default { export default {
name: 'JMultiSelectTag', name: 'JMultiSelectTag',
props: { props: {
dictCode: String, dictCode: String,
@@ -29,87 +29,86 @@
disabled: Boolean, disabled: Boolean,
value: String, value: String,
type: String, type: String,
options:Array, options: Array,
spliter:{ spliter: {
type: String, type: String,
required: false, required: false,
default: ',' default: ','
}, },
popContainer:{ popContainer: {
type:String, type: String,
default:'', default: '',
required:false required: false
}
}, },
}, data () {
data() {
return { return {
dictOptions: [], dictOptions: [],
tagType:"", tagType: '',
arrayValue:!this.value?[]:this.value.split(this.spliter) arrayValue: !this.value ? [] : this.value.split(this.spliter)
} }
}, },
created() { created () {
if(!this.type || this.type==="list_multi"){ if (!this.type || this.type === 'list_multi') {
this.tagType = "select" this.tagType = 'select'
}else{ } else {
this.tagType = this.type this.tagType = this.type
} }
//获取字典数据 // 获取字典数据
// this.initDictData(); // this.initDictData();
}, },
watch:{ watch: {
options (val) { options (val) {
val.forEach((item, index) => { val.forEach((item, index) => {
this.$set(this.dictOptions, index, item) this.$set(this.dictOptions, index, item)
}) })
}, },
dictCode:{ dictCode: {
immediate:true, immediate: true,
handler() { handler () {
this.initDictData() this.initDictData()
}, }
}, },
value (val) { value (val) {
if(!val){ if (!val) {
this.arrayValue = [] this.arrayValue = []
}else{ } else {
this.arrayValue = this.value.split(this.spliter) this.arrayValue = this.value.split(this.spliter)
} }
} }
}, },
methods: { methods: {
initDictData() { initDictData () {
if(this.options && this.options.length>0){ if (this.options && this.options.length > 0) {
this.dictOptions = [...this.options] this.dictOptions = [...this.options]
}else{ } else {
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
let cacheOption = getDictItemsFromCache(this.dictCode) const cacheOption = getDictItemsFromCache(this.dictCode)
if(cacheOption && cacheOption.length>0){ if (cacheOption && cacheOption.length > 0) {
this.dictOptions = cacheOption this.dictOptions = cacheOption
return return
} }
//根据字典Code, 初始化字典数组 // 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => { ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) { if (res.success) {
this.dictOptions = res.result; this.dictOptions = res.result
} }
}) })
} }
}, },
onChange (selectedValue) { onChange (selectedValue) {
this.arrayValue = selectedValue; this.arrayValue = selectedValue
this.$emit('change', selectedValue.join(this.spliter)); this.$emit('change', selectedValue.join(this.spliter))
}, },
getParentContainer(node){ getParentContainer (node) {
if(!this.popContainer){ if (!this.popContainer) {
return node.parentNode return node.parentNode
}else{ } else {
return document.querySelector(this.popContainer) return document.querySelector(this.popContainer)
} }
}, },
// update--begin--autor:lvdandan-----date:20201120------forLOWCOD-1086 下拉多选框,搜索时只字典code进行搜索不能通过字典text搜索 // update--begin--autor:lvdandan-----date:20201120------forLOWCOD-1086 下拉多选框,搜索时只字典code进行搜索不能通过字典text搜索
filterOption(input, option) { filterOption (input, option) {
return option.componentOptions.children[0].children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.componentOptions.children[0].children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
} }
// update--end--autor:lvdandan-----date:20201120------forLOWCOD-1086 下拉多选框,搜索时只字典code进行搜索不能通过字典text搜索 // update--end--autor:lvdandan-----date:20201120------forLOWCOD-1086 下拉多选框,搜索时只字典code进行搜索不能通过字典text搜索
@@ -118,5 +117,5 @@
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
+103 -105
View File
@@ -39,212 +39,210 @@
</template> </template>
<script> <script>
import { ajaxGetDictItems,getDictItemsFromCache } from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce'
import { getAction } from '../../api/manage' import { getAction } from '../../api/manage'
export default { export default {
name: 'JSearchSelectTag', name: 'JSearchSelectTag',
props:{ props: {
disabled: Boolean, disabled: Boolean,
value: [String, Number], value: [String, Number],
dict: String, dict: String,
dictOptions: Array, dictOptions: Array,
async: Boolean, async: Boolean,
placeholder:{ placeholder: {
type:String, type: String,
default:"请选择", default: '请选择',
required:false required: false
}, },
popContainer:{ popContainer: {
type:String, type: String,
default:'', default: '',
required:false required: false
}, },
pageSize:{ pageSize: {
type: Number, type: Number,
default: 10, default: 10,
required: false required: false
}, },
getPopupContainer: { getPopupContainer: {
type:Function, type: Function,
default: null default: null
}
}, },
}, data () {
data(){ this.loadData = debounce(this.loadData, 800)// 消抖
this.loadData = debounce(this.loadData, 800);//消抖 this.lastLoad = 0
this.lastLoad = 0;
return { return {
loading:false, loading: false,
selectedValue:[], selectedValue: [],
selectedAsyncValue:[], selectedAsyncValue: [],
options: [], options: []
} }
}, },
created(){ created () {
this.initDictData(); this.initDictData()
}, },
watch:{ watch: {
"value":{ value: {
immediate:true, immediate: true,
handler(val){ handler (val) {
if(!val){ if (!val) {
if(val==0){ if (val == 0) {
this.initSelectValue() this.initSelectValue()
}else{ } else {
this.selectedValue=[] this.selectedValue = []
this.selectedAsyncValue=[] this.selectedAsyncValue = []
} }
}else{ } else {
this.initSelectValue() this.initSelectValue()
} }
} }
}, },
"dict":{ dict: {
handler(){ handler () {
this.initDictData() this.initDictData()
} }
}, },
'dictOptions':{ dictOptions: {
deep: true, deep: true,
handler(val){ handler (val) {
if(val && val.length>0){ if (val && val.length > 0) {
this.options = [...val] this.options = [...val]
} }
} }
} }
}, },
methods:{ methods: {
initSelectValue(){ initSelectValue () {
if(this.async){ if (this.async) {
if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){ 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=>{ getAction(`/sys/dict/loadDictItem/${this.dict}`, { key: this.value }).then(res => {
if(res.success){ if (res.success) {
let obj = { const obj = {
key:this.value, key: this.value,
label:res.result label: res.result
} }
this.selectedAsyncValue = {...obj} this.selectedAsyncValue = { ...obj }
} }
}) })
} }
}else{ } else {
this.selectedValue = this.value.toString() this.selectedValue = this.value.toString()
} }
}, },
loadData(value){ loadData (value) {
console.log("数据加载",value) console.log('数据加载', value)
this.lastLoad +=1 this.lastLoad += 1
const currentLoad = this.lastLoad const currentLoad = this.lastLoad
this.options = [] this.options = []
this.loading=true this.loading = true
// 字典code格式table,text,code // 字典code格式table,text,code
getAction(`/sys/dict/loadDict/${this.dict}`,{keyword:value, pageSize: this.pageSize}).then(res=>{ getAction(`/sys/dict/loadDict/${this.dict}`, { keyword: value, pageSize: this.pageSize }).then(res => {
this.loading=false this.loading = false
if(res.success){ if (res.success) {
if(currentLoad!=this.lastLoad){ if (currentLoad != this.lastLoad) {
return return
} }
this.options = res.result this.options = res.result
console.log("我是第一个",res) console.log('我是第一个', res)
}else{ } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}) })
}, },
initDictData(){ initDictData () {
if(!this.async){ if (!this.async) {
//如果字典项集合有数据 // 如果字典项集合有数据
if(this.dictOptions && this.dictOptions.length>0){ if (this.dictOptions && this.dictOptions.length > 0) {
this.options = [...this.dictOptions] this.options = [...this.dictOptions]
}else{ } else {
//根据字典Code, 初始化字典数组 // 根据字典Code, 初始化字典数组
let dictStr = '' let dictStr = ''
if(this.dict){ if (this.dict) {
let arr = this.dict.split(',') const arr = this.dict.split(',')
if(arr[0].indexOf('where')>0){ 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]) dictStr = tbInfo[0].trim() + ',' + arr[1] + ',' + arr[2] + ',' + encodeURIComponent(tbInfo[1])
}else{ } else {
dictStr = this.dict dictStr = this.dict
} }
if (this.dict.indexOf(",") == -1) { if (this.dict.indexOf(',') == -1) {
//优先从缓存中读取字典配置 // 优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) { if (getDictItemsFromCache(this.dictCode)) {
this.options = getDictItemsFromCache(this.dictCode); this.options = getDictItemsFromCache(this.dictCode)
return return
} }
} }
ajaxGetDictItems(dictStr, null).then((res) => { ajaxGetDictItems(dictStr, null).then((res) => {
if (res.success) { if (res.success) {
this.options = res.result; this.options = res.result
} }
}) })
} }
} }
}else{ } else {
//异步一开始也加载一点数据 // 异步一开始也加载一点数据
this.loading=true this.loading = true
getAction(`/sys/dict/loadDict/${this.dict}`,{pageSize: this.pageSize, keyword:''}).then(res=>{ getAction(`/sys/dict/loadDict/${this.dict}`, { pageSize: this.pageSize, keyword: '' }).then(res => {
this.loading=false this.loading = false
if(res.success){ if (res.success) {
this.options = res.result this.options = res.result
}else{ } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}) })
} }
}, },
filterOption(input, option) { filterOption (input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
handleChange (selectedValue) { handleChange (selectedValue) {
console.log("selectedValue",selectedValue) console.log('selectedValue', selectedValue)
this.selectedValue = selectedValue this.selectedValue = selectedValue
this.callback() this.callback()
}, },
handleAsyncChange(selectedObj){ handleAsyncChange (selectedObj) {
//update-begin-author:scott date:20201222 for:搜索搜索查询组件删除条件默认下拉还是上次的缓存数据不好 JT-191 // update-begin-author:scott date:20201222 for:搜索搜索查询组件删除条件默认下拉还是上次的缓存数据不好 JT-191
if(selectedObj){ if (selectedObj) {
this.selectedAsyncValue = selectedObj this.selectedAsyncValue = selectedObj
this.selectedValue = selectedObj.key this.selectedValue = selectedObj.key
}else{ } else {
this.selectedAsyncValue = null this.selectedAsyncValue = null
this.selectedValue = null this.selectedValue = null
this.options = null this.options = null
this.loadData("") this.loadData('')
} }
this.callback() this.callback()
//update-end-author:scott date:20201222 for:搜索搜索查询组件删除条件默认下拉还是上次的缓存数据不好 JT-191 // update-end-author:scott date:20201222 for:搜索搜索查询组件删除条件默认下拉还是上次的缓存数据不好 JT-191
}, },
callback(){ callback () {
this.$emit('change', this.selectedValue); this.$emit('change', this.selectedValue)
}, },
setCurrentDictOptions(dictOptions){ setCurrentDictOptions (dictOptions) {
this.options = dictOptions this.options = dictOptions
}, },
getCurrentDictOptions(){ getCurrentDictOptions () {
return this.options return this.options
}, },
getParentContainer(node){ getParentContainer (node) {
if(typeof this.getPopupContainer === 'function'){ if (typeof this.getPopupContainer === 'function') {
return this.getPopupContainer(node) return this.getPopupContainer(node)
} else if(!this.popContainer){ } else if (!this.popContainer) {
return node.parentNode return node.parentNode
}else{ } else {
return document.querySelector(this.popContainer) return document.querySelector(this.popContainer)
} }
}, }
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
+4 -4
View File
@@ -1,13 +1,13 @@
import JDictSelectTag from './JDictSelectTag.vue' import JDictSelectTag from './JDictSelectTag.vue'
import JMultiSelectTag from './JMultiSelectTag.vue' import JMultiSelectTag from './JMultiSelectTag.vue'
import JSearchSelectTag from './JSearchSelectTag.vue' import JSearchSelectTag from './JSearchSelectTag.vue'
import { filterMultiDictText,filterDictText,initDictOptions,filterDictTextByCache } from './JDictSelectUtil' import { filterMultiDictText, filterDictText, initDictOptions, filterDictTextByCache } from './JDictSelectUtil'
export default { export default {
install: function (Vue) { install: function (Vue) {
Vue.component('JDictSelectTag',JDictSelectTag); Vue.component('JDictSelectTag', JDictSelectTag)
Vue.component('JMultiSelectTag',JMultiSelectTag); Vue.component('JMultiSelectTag', JMultiSelectTag)
Vue.component('JSearchSelectTag',JSearchSelectTag); Vue.component('JSearchSelectTag', JSearchSelectTag)
Vue.prototype.$initDictOptions = (dictCode) => initDictOptions(dictCode) Vue.prototype.$initDictOptions = (dictCode) => initDictOptions(dictCode)
Vue.prototype.$filterMultiDictText = (dictOptions, text) => filterMultiDictText(dictOptions, text) Vue.prototype.$filterMultiDictText = (dictOptions, text) => filterMultiDictText(dictOptions, text)
Vue.prototype.$filterDictText = (dictOptions, text) => filterDictText(dictOptions, text) Vue.prototype.$filterDictText = (dictOptions, text) => filterDictText(dictOptions, text)
+31 -31
View File
@@ -29,14 +29,14 @@
</template> </template>
<script> <script>
import Area from '@/components/_util/Area' import Area from '@/components/_util/Area'
export default { export default {
name: 'JAreaLinkage', name: 'JAreaLinkage',
props: { props: {
value: { value: {
type: String, type: String,
required:false required: false
}, },
// 组件的类型可选值 // 组件的类型可选值
// select 下拉样式 // select 下拉样式
@@ -50,7 +50,7 @@
default: '100%' default: '100%'
} }
}, },
data() { data () {
return { return {
pcaa: this.$Jpcaa, pcaa: this.$Jpcaa,
innerValue: [], innerValue: [],
@@ -59,65 +59,65 @@
type: ['cascader', 'select'] type: ['cascader', 'select']
}, },
reloading: false, reloading: false,
areaData:'' areaData: ''
} }
}, },
computed: { computed: {
_listeners() { _listeners () {
let listeners = { ...this.$listeners } const listeners = { ...this.$listeners }
// 去掉已使用的事件防止冲突 // 去掉已使用的事件防止冲突
this.usedListeners.forEach(key => { this.usedListeners.forEach(key => {
delete listeners[key] delete listeners[key]
}) })
return listeners return listeners
}, },
_type() { _type () {
if (this.enums.type.includes(this.type)) { if (this.enums.type.includes(this.type)) {
return this.type return this.type
} else { } else {
console.error(`JAreaLinkage的type属性只能接收指定的值${this.enums.type.join('|')}`) console.error(`JAreaLinkage的type属性只能接收指定的值${this.enums.type.join('|')}`)
return this.enums.type[0] return this.enums.type[0]
} }
}, }
}, },
watch: { watch: {
value: { value: {
immediate: true, immediate: true,
handler() { handler () {
this.loadDataByValue(this.value) this.loadDataByValue(this.value)
} }
}
}, },
}, created () {
created() { this.initAreaData()
this.initAreaData();
}, },
methods: { methods: {
/** 重新加载组件 */ /** 重新加载组件 */
reload() { reload () {
this.reloading = true this.reloading = true
this.$nextTick(() => this.reloading = false) this.$nextTick(() => this.reloading = false)
}, },
/** 通过 value 反推 options */ /** 通过 value 反推 options */
loadDataByValue(value) { loadDataByValue (value) {
if (!value || value.length === 0) { if (!value || value.length === 0) {
this.innerValue = [] this.innerValue = []
} else { } else {
this.initAreaData() this.initAreaData()
let arr = this.areaData.getRealCode(value) const arr = this.areaData.getRealCode(value)
this.innerValue = arr this.innerValue = arr
} }
this.reload() this.reload()
}, },
/** 通过地区code获取子级 */ /** 通过地区code获取子级 */
loadDataByCode(value) { loadDataByCode (value) {
let options = [] const options = []
let data = this.pcaa[value] const data = this.pcaa[value]
if (data) { if (data) {
for (let key in data) { for (const key in data) {
if (data.hasOwnProperty(key)) { if (data.hasOwnProperty(key)) {
options.push({ value: key, label: data[key], }) options.push({ value: key, label: data[key] })
} }
} }
return options return options
@@ -126,25 +126,25 @@
} }
}, },
/** 判断是否有子节点 */ /** 判断是否有子节点 */
hasChildren(options) { hasChildren (options) {
options.forEach(option => { options.forEach(option => {
let data = this.loadDataByCode(option.value) const data = this.loadDataByCode(option.value)
option.isLeaf = data.length === 0 option.isLeaf = data.length === 0
}) })
}, },
handleChange(values) { handleChange (values) {
let value = values[values.length - 1] const value = values[values.length - 1]
this.$emit('change', value) this.$emit('change', value)
}, },
initAreaData(){ initAreaData () {
if(!this.areaData){ 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> </script>
<style lang="less" scoped> <style lang="less" scoped>
+122 -122
View File
@@ -17,157 +17,157 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
export default { export default {
name: 'JCategorySelect', name: 'JCategorySelect',
props: { props: {
value:{ value: {
// type: String, // type: String,
required: false required: false
}, },
placeholder:{ placeholder: {
type: String, type: String,
default: '请选择', default: '请选择',
required: false required: false
}, },
disabled:{ disabled: {
type:Boolean, type: Boolean,
default:false, default: false,
required:false required: false
}, },
condition:{ condition: {
type:String, type: String,
default:'', default: '',
required:false required: false
}, },
// 是否支持多选 // 是否支持多选
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
loadTriggleChange:{ loadTriggleChange: {
type: Boolean, type: Boolean,
default: false, default: false,
required:false required: false
}, },
pid:{ pid: {
type:String, type: String,
default:'', default: '',
required:false required: false
}, },
pCode:{ pCode: {
type:String, type: String,
default:'', default: '',
required:false required: false
}, },
back:{ back: {
type:String, type: String,
default:'', default: '',
required:false required: false
} }
}, },
data () { data () {
return { return {
treeValue:"", treeValue: '',
treeData:[], treeData: [],
url:"/sys/category/loadTreeData", url: '/sys/category/loadTreeData',
view:'/sys/category/loadDictItem/', view: '/sys/category/loadDictItem/',
tableName:"", tableName: '',
text:"", text: '',
code:"", code: ''
} }
}, },
computed:{ computed: {
_attrs() { _attrs () {
let attrs let attrs
attrs = { ...this.$attrs } attrs = { ...this.$attrs }
return attrs return attrs
}, },
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch: { watch: {
value () { value () {
this.loadItemByCode() this.loadItemByCode()
}, },
pCode(){ pCode () {
this.loadRoot(); this.loadRoot()
} }
}, },
created(){ created () {
this.validateProp().then(()=>{ this.validateProp().then(() => {
this.loadRoot() this.loadRoot()
this.loadItemByCode() this.loadItemByCode()
}) })
}, },
methods: { methods: {
/**加载一级节点 */ /** 加载一级节点 */
loadRoot(){ loadRoot () {
let param = { const param = {
pid:this.pid, pid: this.pid,
pcode:!this.pCode?'0':this.pCode, pcode: !this.pCode ? '0' : this.pCode,
condition:this.condition condition: this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url, param).then(res => {
if(res.success && res.result){ if (res.success && res.result) {
for(let i of res.result){ for (const i of res.result) {
i.value = i.key i.value = i.key
if(i.leaf==false){ if (i.leaf == false) {
i.isLeaf=false i.isLeaf = false
}else if(i.leaf==true){ } else if (i.leaf == true) {
i.isLeaf=true i.isLeaf = true
} }
} }
this.treeData = [...res.result] this.treeData = [...res.result]
}else{ } else {
console.log("树一级节点查询结果-else",res) console.log('树一级节点查询结果-else', res)
} }
}) })
}, },
/** 数据回显*/ /** 数据回显 */
loadItemByCode(){ loadItemByCode () {
if(!this.value || this.value=="0"){ if (!this.value || this.value == '0') {
this.treeValue = [] this.treeValue = []
}else{ } else {
getAction(this.view,{ids:this.value}).then(res=>{ getAction(this.view, { ids: this.value }).then(res => {
if(res.success){ if (res.success) {
if (res.result && res.result.length > 0) { if (res.result && res.result.length > 0) {
let values = this.value.split(',') const values = this.value.split(',')
this.treeValue = res.result.map((item, index) => ({ this.treeValue = res.result.map((item, index) => ({
key: values[index], key: values[index],
value: values[index], value: values[index],
label: item label: item
})) }))
this.onLoadTriggleChange(res.result[0]); this.onLoadTriggleChange(res.result[0])
} }
} }
}) })
} }
}, },
onLoadTriggleChange(text){ onLoadTriggleChange (text) {
//只有单选才会触发 // 只有单选才会触发
if(!this.multiple && this.loadTriggleChange){ if (!this.multiple && this.loadTriggleChange) {
this.backValue(this.value,text) this.backValue(this.value, text)
} }
}, },
backValue(value,label){ backValue (value, label) {
let obj = {} const obj = {}
if(this.back){ if (this.back) {
obj[this.back] = label obj[this.back] = label
} }
/* /*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍 * 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍
* 解决办法改变选中时提交的事件名*/ * 解决办法改变选中时提交的事件名 */
this.$emit('change', value, obj) this.$emit('change', value, obj)
}, },
asyncLoadTreeData (treeNode) { asyncLoadTreeData (treeNode) {
@@ -176,94 +176,94 @@
resolve() resolve()
return return
} }
let pid = treeNode.$vnode.key const pid = treeNode.$vnode.key
let param = { const param = {
pid:pid, pid: pid,
condition:this.condition condition: this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url, param).then(res => {
if(res.success){ if (res.success) {
for(let i of res.result){ for (const i of res.result) {
i.value = i.key i.value = i.key
if(i.leaf==false){ if (i.leaf == false) {
i.isLeaf=false i.isLeaf = false
}else if(i.leaf==true){ } else if (i.leaf == true) {
i.isLeaf=true i.isLeaf = true
} }
} }
this.addChildren(pid,res.result,this.treeData) this.addChildren(pid, res.result, this.treeData)
this.treeData = [...this.treeData] this.treeData = [...this.treeData]
} }
resolve() resolve()
}) })
}) })
}, },
addChildren(pid,children,treeArray){ addChildren (pid, children, treeArray) {
if(treeArray && treeArray.length>0){ if (treeArray && treeArray.length > 0) {
for(let item of treeArray){ for (const item of treeArray) {
if(item.key == pid){ if (item.key == pid) {
if(!children || children.length==0){ if (!children || children.length == 0) {
item.isLeaf=true item.isLeaf = true
}else{ } else {
item.children = children item.children = children
} }
break break
}else{ } else {
this.addChildren(pid,children,item.children) this.addChildren(pid, children, item.children)
} }
} }
} }
}, },
onChange(value){ onChange (value) {
if(!value){ if (!value) {
/* /*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍 * 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍
* 解决办法改变选中时提交的事件名*/ * 解决办法改变选中时提交的事件名 */
this.$emit('change', ''); this.$emit('change', '')
this.treeValue = '' this.treeValue = ''
} else if (Array.isArray(value)) { } else if (Array.isArray(value)) {
let labels = [] const labels = []
let values = value.map(item => { const values = value.map(item => {
labels.push(item.label) labels.push(item.label)
return item.value return item.value
}) })
this.backValue(values.join(','), labels.join(',')) this.backValue(values.join(','), labels.join(','))
this.treeValue = value this.treeValue = value
} else { } else {
this.backValue(value.value,value.label) this.backValue(value.value, value.label)
this.treeValue = value this.treeValue = value
} }
}, },
getCurrTreeData(){ getCurrTreeData () {
return this.treeData return this.treeData
}, },
validateProp(){ validateProp () {
let myCondition = this.condition const myCondition = this.condition
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => {
if(!myCondition){ if (!myCondition) {
resolve();
}else{
try {
let test=JSON.parse(myCondition);
if(typeof test == 'object' && test){
resolve() resolve()
}else{ } 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() reject()
} }
} catch(e) { } catch (e) {
this.$message.error("组件JTreeSelect-condition传值有误需要一个json字符串!") this.$message.error('组件JTreeSelect-condition传值有误需要一个json字符串!')
reject() reject()
} }
} }
}) })
} }
}, },
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼 // 2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
+14 -14
View File
@@ -6,41 +6,41 @@
</template> </template>
<script> <script>
export default { export default {
name: 'JCheckbox', name: 'JCheckbox',
props: { props: {
value:{ value: {
type: String, type: String,
required: false required: false
}, },
/*label value*/ /* label value */
options:{ options: {
type: Array, type: Array,
required: true required: true
} }
}, },
data(){ data () {
return { return {
checkboxArray:!this.value?[]:this.value.split(",") checkboxArray: !this.value ? [] : this.value.split(',')
} }
}, },
watch:{ watch: {
value (val) { value (val) {
if(!val){ if (!val) {
this.checkboxArray = [] this.checkboxArray = []
}else{ } else {
this.checkboxArray = this.value.split(",") this.checkboxArray = this.value.split(',')
} }
} }
}, },
methods:{ methods: {
onChange (checkedValues) { onChange (checkedValues) {
this.$emit('change', checkedValues.join(",")); this.$emit('change', checkedValues.join(','))
}, }
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
+48 -48
View File
@@ -21,37 +21,37 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
// 引入全局实例 // 引入全局实例
import _CodeMirror from 'codemirror' import _CodeMirror from 'codemirror'
// 核心样式 // 核心样式
import 'codemirror/lib/codemirror.css' import 'codemirror/lib/codemirror.css'
// 引入主题后还需要在 options 中指定主题才会生效 darcula gruvbox-dark hopscotch monokai // 引入主题后还需要在 options 中指定主题才会生效 darcula gruvbox-dark hopscotch monokai
import 'codemirror/theme/panda-syntax.css' import 'codemirror/theme/panda-syntax.css'
// 提示css // 提示css
import 'codemirror/addon/hint/show-hint.css' import 'codemirror/addon/hint/show-hint.css'
// 需要引入具体的语法高亮库才会有对应的语法高亮效果 // 需要引入具体的语法高亮库才会有对应的语法高亮效果
// codemirror 官方其实支持通过 /addon/mode/loadmode.js /mode/meta.js 来实现动态加载对应语法高亮库 // codemirror 官方其实支持通过 /addon/mode/loadmode.js /mode/meta.js 来实现动态加载对应语法高亮库
// vue 貌似没有无法在实例初始化后再动态加载对应 JS 所以此处才把对应的 JS 提前引入 // vue 貌似没有无法在实例初始化后再动态加载对应 JS 所以此处才把对应的 JS 提前引入
import 'codemirror/mode/javascript/javascript.js' import 'codemirror/mode/javascript/javascript.js'
import 'codemirror/mode/css/css.js' import 'codemirror/mode/css/css.js'
import 'codemirror/mode/xml/xml.js' import 'codemirror/mode/xml/xml.js'
import 'codemirror/mode/clike/clike.js' import 'codemirror/mode/clike/clike.js'
import 'codemirror/mode/markdown/markdown.js' import 'codemirror/mode/markdown/markdown.js'
import 'codemirror/mode/python/python.js' import 'codemirror/mode/python/python.js'
import 'codemirror/mode/r/r.js' import 'codemirror/mode/r/r.js'
import 'codemirror/mode/shell/shell.js' import 'codemirror/mode/shell/shell.js'
import 'codemirror/mode/sql/sql.js' import 'codemirror/mode/sql/sql.js'
import 'codemirror/mode/swift/swift.js' import 'codemirror/mode/swift/swift.js'
import 'codemirror/mode/vue/vue.js' import 'codemirror/mode/vue/vue.js'
import { isIE11, isIE } from '@/utils/browser' import { isIE11, isIE } from '@/utils/browser'
// 尝试获取全局实例 // 尝试获取全局实例
const CodeMirror = window.CodeMirror || _CodeMirror const CodeMirror = window.CodeMirror || _CodeMirror
export default { export default {
name: 'JCodeEditor', name: 'JCodeEditor',
props: { props: {
// 外部传入的内容用于实现双向绑定 // 外部传入的内容用于实现双向绑定
@@ -173,7 +173,7 @@
}, },
watch: { watch: {
fullCoder: { fullCoder: {
handler(value) { handler (value) {
if (value) { if (value) {
this.iconType = 'fullscreen-exit' this.iconType = 'fullscreen-exit'
} else { } else {
@@ -191,12 +191,12 @@
// }, // },
language: { language: {
immediate: true, immediate: true,
handler(language) { handler (language) {
this._getCoder().then(() => { this._getCoder().then(() => {
// 尝试从父容器获取语法类型 // 尝试从父容器获取语法类型
if (language) { if (language) {
// 获取具体的语法类型对象 // 获取具体的语法类型对象
let modeObj = this._getLanguage(language) const modeObj = this._getLanguage(language)
// 判断父容器传入的语法是否被支持 // 判断父容器传入的语法是否被支持
if (modeObj) { if (modeObj) {
@@ -209,14 +209,14 @@
} }
}, },
computed: { computed: {
placeholderShow() { placeholderShow () {
if (this.placeholder == null) { if (this.placeholder == null) {
return `请在此输入${this.language}代码` return `请在此输入${this.language}代码`
} else { } else {
return this.placeholder return this.placeholder
} }
}, },
nullTipStyle() { nullTipStyle () {
if (this.lineNumbers) { if (this.lineNumbers) {
return { left: '36px' } return { left: '36px' }
} else { } else {
@@ -224,7 +224,7 @@
} }
}, },
// coder 配置 // coder 配置
coderOptions() { coderOptions () {
return { return {
tabSize: this.options.tabSize, tabSize: this.options.tabSize,
theme: this.options.theme, theme: this.options.theme,
@@ -233,7 +233,7 @@
hintOptions: this.options.hintOptions hintOptions: this.options.hintOptions
} }
}, },
isAutoHeight() { isAutoHeight () {
let { autoHeight } = this let { autoHeight } = this
if (typeof autoHeight === 'string' && autoHeight.toLowerCase().trim() === '!ie') { if (typeof autoHeight === 'string' && autoHeight.toLowerCase().trim() === '!ie') {
autoHeight = !(isIE() || isIE11()) autoHeight = !(isIE() || isIE11())
@@ -242,8 +242,8 @@
} }
return autoHeight return autoHeight
}, },
fullScreenParentProps() { fullScreenParentProps () {
let props = { const props = {
class: { class: {
'full-screen-parent': true, 'full-screen-parent': true,
'full-screen': this.fullCoder, 'full-screen': this.fullCoder,
@@ -252,13 +252,13 @@
style: {} style: {}
} }
if (isIE() || isIE11()) { if (isIE() || isIE11()) {
props.style['height'] = '240px' props.style.height = '240px'
} }
if (this.fullCoder) { if (this.fullCoder) {
props.style['z-index'] = this.zIndex props.style['z-index'] = this.zIndex
} }
if (!this.isAutoHeight) { 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 return props
} }
@@ -308,10 +308,10 @@
this.coder.showHint() this.coder.showHint()
}) */ }) */
}, },
getCodeContent() { getCodeContent () {
return this.code return this.code
}, },
setCodeContent(val) { setCodeContent (val) {
setTimeout(() => { setTimeout(() => {
if (!val) { if (!val) {
this.coder.setValue('') this.coder.setValue('')
@@ -325,18 +325,18 @@
// 在支持的语法类型列表中寻找传入的语法类型 // 在支持的语法类型列表中寻找传入的语法类型
return this.modes.find((mode) => { return this.modes.find((mode) => {
// 所有的值都忽略大小写方便比较 // 所有的值都忽略大小写方便比较
let currentLanguage = language.toLowerCase() const currentLanguage = language.toLowerCase()
let currentLabel = mode.label.toLowerCase() const currentLabel = mode.label.toLowerCase()
let currentValue = mode.value.toLowerCase() const currentValue = mode.value.toLowerCase()
// 由于真实值可能不规范例如 java 的真实值是 x-java 所以讲 value label 同时和传入语法进行比较 // 由于真实值可能不规范例如 java 的真实值是 x-java 所以讲 value label 同时和传入语法进行比较
return currentLabel === currentLanguage || currentValue === currentLanguage return currentLabel === currentLanguage || currentValue === currentLanguage
}) })
}, },
_getCoder() { _getCoder () {
let _this = this const _this = this
return new Promise((resolve) => { return new Promise((resolve) => {
(function get() { (function get () {
if (_this.coder) { if (_this.coder) {
resolve(_this.coder) resolve(_this.coder)
} else { } else {
@@ -351,16 +351,16 @@
this.coder.setOption('mode', `text/${val}`) 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) this.$emit('language-change', label)
}, },
nullTipClick() { nullTipClick () {
this.coder.focus() this.coder.focus()
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
+16 -16
View File
@@ -8,8 +8,8 @@
</div> </div>
</template> </template>
<script> <script>
import JCronModal from "./modal/JCronModal"; import JCronModal from './modal/JCronModal'
export default { export default {
name: 'JCron', name: 'JCron',
components: { components: {
JCronModal JCronModal
@@ -17,29 +17,29 @@
props: { props: {
value: { value: {
required: false, required: false,
type: String, type: String
} }
}, },
data(){ data () {
return { return {
cron: this.value, cron: this.value
} }
}, },
watch:{ watch: {
value(val){ value (val) {
this.cron = val this.cron = val
} }
}, },
methods:{ methods: {
openModal(){ openModal () {
this.$refs.innerVueCron.show(); this.$refs.innerVueCron.show()
}, },
handleOK(val){ handleOK (val) {
this.cron = val; this.cron = val
this.$emit("change", this.cron); this.$emit('change', this.cron)
//this.$emit("change", Object.assign({}, this.cron)); // this.$emit("change", Object.assign({}, this.cron));
}, },
handleEmpty(){ handleEmpty () {
this.handleOK('') this.handleOK('')
} }
}, },
@@ -47,7 +47,7 @@
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
.components-input-demo-presuffix .anticon-close-circle { .components-input-demo-presuffix .anticon-close-circle {
+37 -37
View File
@@ -57,39 +57,39 @@
</span> </span>
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'JDate', name: 'JDate',
props: { props: {
placeholder:{ placeholder: {
type: String, type: String,
default: '请选择', default: '请选择',
required: false required: false
}, },
value:{ value: {
type: String, type: String,
required: false required: false
}, },
dateFormat:{ dateFormat: {
type: String, type: String,
default: 'YYYY-MM-DD', default: 'YYYY-MM-DD',
required: false required: false
}, },
readOnly:{ readOnly: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
disabled:{ disabled: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
//控制选择时分秒 // 控制选择时分秒
showType:{ showType: {
type: String, type: String,
required: false, required: false,
default:'time' default: 'time'
}, },
getCalendarContainer: { getCalendarContainer: {
type: Function, type: Function,
@@ -97,64 +97,64 @@
} }
}, },
data () { data () {
let dateStr = this.value; const dateStr = this.value
return { return {
yearShowOne:false, //控制年份模态框的显示与否 yearShowOne: false, // 控制年份模态框的显示与否
year:'', // mode==year 专用 year: '', // mode==year 专用
momVal:!dateStr?null:moment(dateStr,this.dateFormat) momVal: !dateStr ? null : moment(dateStr, this.dateFormat)
} }
}, },
computed: { computed: {
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch: { watch: {
value (val) { value (val) {
let fm = this.dateFormat const fm = this.dateFormat
moment.prototype.toJSON = function(){ moment.prototype.toJSON = function () {
return moment(this).format(fm) return moment(this).format(fm)
} }
if(!val){ if (!val) {
this.momVal = null this.momVal = null
}else{ } else {
this.momVal = moment(val,this.dateFormat) this.momVal = moment(val, this.dateFormat)
} }
} }
}, },
methods: { methods: {
moment, moment,
handleDateChange(mom,dateStr){ handleDateChange (mom, dateStr) {
this.$emit('change', dateStr); this.$emit('change', dateStr)
}, },
handleMonthChange(mom,dateStr){ handleMonthChange (mom, dateStr) {
this.$emit('change',dateStr) this.$emit('change', dateStr)
}, },
/** /**
* 弹出日历和关闭日历的回调 * 弹出日历和关闭日历的回调
* status打开或关闭的状态 * status打开或关闭的状态
* */ * */
openChangeOne(status){ openChangeOne (status) {
this.yearShowOne = status this.yearShowOne = status
}, },
// 得到年份选择器的值 // 得到年份选择器的值
panelChangeOne(value){ panelChangeOne (value) {
this.yearShowOne = false this.yearShowOne = false
let year = moment(value,this.dateFormat).year().toString() // 处理成字符串 const year = moment(value, this.dateFormat).year().toString() // 处理成字符串
this.year = value //组件显示的 this.year = value // 组件显示的
this.$emit('change',year) this.$emit('change', year)
} }
}, },
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 // 2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
@@ -114,7 +114,7 @@ export default {
default: null default: null
} }
}, },
data() { data () {
return { return {
curtab: this.hideSecond ? 'minute' : 'second', curtab: this.hideSecond ? 'minute' : 'second',
second: '*', second: '*',
@@ -124,13 +124,13 @@ export default {
month: '*', month: '*',
week: '?', week: '?',
year: '*', year: '*',
inputValues: {second: '', minute: '', hour: '', day: '', month: '', week: '', year: '', cron: ''}, inputValues: { second: '', minute: '', hour: '', day: '', month: '', week: '', year: '', cron: '' },
preTimeList: '执行预览会忽略年份参数', preTimeList: '执行预览会忽略年份参数'
} }
}, },
computed: { computed: {
cronValue_c() { cronValue_c () {
let result = [] const result = []
if (!this.hideSecond) result.push(this.second ? this.second : '*') if (!this.hideSecond) result.push(this.second ? this.second : '*')
result.push(this.minute ? this.minute : '*') result.push(this.minute ? this.minute : '*')
result.push(this.hour ? this.hour : '*') result.push(this.hour ? this.hour : '*')
@@ -140,7 +140,7 @@ export default {
if (!this.hideYear && !this.hideSecond) result.push(this.year ? this.year : '*') if (!this.hideYear && !this.hideSecond) result.push(this.year ? this.year : '*')
return result.join(' ') return result.join(' ')
}, },
cronValue_c2() { cronValue_c2 () {
const v = this.cronValue_c const v = this.cronValue_c
if (this.hideYear || this.hideSecond) return v if (this.hideYear || this.hideSecond) return v
const vs = v.split(' ') const vs = v.split(' ')
@@ -149,62 +149,62 @@ export default {
vs[5] = this.convertQuartzWeekToCParser(vs[5]) vs[5] = this.convertQuartzWeekToCParser(vs[5])
} }
return vs.slice(0, vs.length - 1).join(' ') return vs.slice(0, vs.length - 1).join(' ')
}, }
}, },
watch: { watch: {
cronValue(newVal, oldVal) { cronValue (newVal, oldVal) {
if (newVal === this.cronValue_c) { if (newVal === this.cronValue_c) {
// console.info('same cron value: ' + newVal) // console.info('same cron value: ' + newVal)
return return
} }
this.formatValue() this.formatValue()
}, },
cronValue_c(newVal, oldVal) { cronValue_c (newVal, oldVal) {
this.calTriggerList() this.calTriggerList()
this.$emit('change', newVal) this.$emit('change', newVal)
this.assignInput() this.assignInput()
}, },
minute() { minute () {
if (this.second === '*') { if (this.second === '*') {
this.second = '0' this.second = '0'
} }
}, },
hour() { hour () {
if (this.minute === '*') { if (this.minute === '*') {
this.minute = '0' this.minute = '0'
} }
}, },
day(day) { day (day) {
if (day !== '?' && this.hour === '*') { if (day !== '?' && this.hour === '*') {
this.hour = '0' this.hour = '0'
} }
}, },
week(week) { week (week) {
if (week !== '?' && this.hour === '*') { if (week !== '?' && this.hour === '*') {
this.hour = '0' this.hour = '0'
} }
}, },
month() { month () {
if (this.day === '?' && this.week === '*') { if (this.day === '?' && this.week === '*') {
this.week = '1' this.week = '1'
} else if (this.week === '?' && this.day === '*') { } else if (this.week === '?' && this.day === '*') {
this.day = '1' this.day = '1'
} }
}, },
year() { year () {
if (this.month === '*') { if (this.month === '*') {
this.month = '1' this.month = '1'
} }
}
}, },
}, created () {
created() {
this.formatValue() this.formatValue()
this.$nextTick(() => { this.$nextTick(() => {
this.calTriggerListInner() this.calTriggerListInner()
}) })
}, },
methods: { methods: {
assignInput() { assignInput () {
Object.assign(this.inputValues, { Object.assign(this.inputValues, {
second: this.second, second: this.second,
minute: this.minute, minute: this.minute,
@@ -213,10 +213,10 @@ export default {
month: this.month, month: this.month,
week: this.week, week: this.week,
year: this.year, year: this.year,
cron: this.cronValue_c, cron: this.cronValue_c
}) })
}, },
formatValue() { formatValue () {
if (!this.cronValue) return if (!this.cronValue) return
const values = this.cronValue.split(' ').filter(item => !!item) const values = this.cronValue.split(' ').filter(item => !!item)
if (!values || values.length <= 0) return if (!values || values.length <= 0) return
@@ -233,7 +233,7 @@ export default {
calTriggerList: simpleDebounce(function () { calTriggerList: simpleDebounce(function () {
this.calTriggerListInner() this.calTriggerListInner()
}, 500), }, 500),
calTriggerListInner() { calTriggerListInner () {
// 设置了回调函数 // 设置了回调函数
if (this.remote) { if (this.remote) {
this.remote(this.cronValue_c, +new Date(), v => { this.remote(this.cronValue_c, +new Date(), v => {
@@ -252,7 +252,7 @@ export default {
} }
this.preTimeList = result.length > 0 ? result.join('\n') : '无执行时间' this.preTimeList = result.length > 0 ? result.join('\n') : '无执行时间'
}, },
onInputBlur(){ onInputBlur () {
this.second = this.inputValues.second this.second = this.inputValues.second
this.minute = this.inputValues.minute this.minute = this.inputValues.minute
this.hour = this.inputValues.hour this.hour = this.inputValues.hour
@@ -261,14 +261,14 @@ export default {
this.week = this.inputValues.week this.week = this.inputValues.week
this.year = this.inputValues.year this.year = this.inputValues.year
}, },
onInputCronBlur(event){ onInputCronBlur (event) {
this.$emit('change', event.target.value) this.$emit('change', event.target.value)
}, }
}, },
model: { model: {
prop: 'cronValue', prop: 'cronValue',
event: 'change' event: 'change'
}, }
} }
</script> </script>
@@ -24,7 +24,7 @@ import EasyCron from './EasyCron.vue'
export default { export default {
name: 'input-cron', name: 'input-cron',
components: {EasyCron}, components: { EasyCron },
model: { model: {
prop: 'cronValue', prop: 'cronValue',
event: 'change' event: 'change'
@@ -63,25 +63,25 @@ export default {
default: null default: null
} }
}, },
data() { data () {
return { return {
editCronValue: this.cronValue, editCronValue: this.cronValue,
show: false, show: false
} }
}, },
watch: { watch: {
cronValue(newVal, oldVal) { cronValue (newVal, oldVal) {
if (newVal === this.editCronValue) { if (newVal === this.editCronValue) {
return return
} }
this.editCronValue = newVal this.editCronValue = newVal
}, },
editCronValue(newVal, oldVal) { editCronValue (newVal, oldVal) {
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
methods: { methods: {
showConfigDlg() { showConfigDlg () {
if (!this.disabled) { if (!this.disabled) {
this.show = true this.show = true
} }
@@ -1,11 +1,11 @@
export const WEEK_MAP_EN = { export const WEEK_MAP_EN = {
'SUN': '1', SUN: '1',
'MON': '2', MON: '2',
'TUE': '3', TUE: '3',
'WED': '4', WED: '4',
'THU': '5', THU: '5',
'FRI': '6', FRI: '6',
'SAT': '7' SAT: '7'
} }
export const replaceWeekName = (c) => { export const replaceWeekName = (c) => {
@@ -60,30 +60,30 @@ export default {
default: '?' default: '?'
} }
}, },
data() { data () {
return {} return {}
}, },
computed: { computed: {
disableChoice() { disableChoice () {
return (this.week && this.week !== '?') || this.disabled return (this.week && this.week !== '?') || this.disabled
} }
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
// 数值变化 // 数值变化
this.updateValue() this.updateValue()
}, },
week(newVal, oldVal) { week (newVal, oldVal) {
// console.info('new week: ' + newVal) // console.info('new week: ' + newVal)
this.updateValue() this.updateValue()
} }
}, },
methods: { methods: {
updateValue() { updateValue () {
this.$emit('change', this.disableChoice ? '?' : this.value_c) this.$emit('change', this.disableChoice ? '?' : this.value_c)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 1 this.minValue = 1
this.maxValue = 31 this.maxValue = 31
@@ -41,15 +41,15 @@ import mixin from './mixin'
export default { export default {
name: 'minute', name: 'minute',
mixins: [mixin], mixins: [mixin],
data() { data () {
return {} return {}
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 0 this.minValue = 0
this.maxValue = 23 this.maxValue = 23
@@ -41,15 +41,15 @@ import mixin from './mixin'
export default { export default {
name: 'minute', name: 'minute',
mixins: [mixin], mixins: [mixin],
data() { data () {
return {} return {}
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 0 this.minValue = 0
this.maxValue = 59 this.maxValue = 59
@@ -68,7 +68,7 @@ export default {
}, },
computed: { computed: {
value_c () { value_c () {
let result = [] const result = []
switch (this.type) { switch (this.type) {
case TYPE_NOT_SET: case TYPE_NOT_SET:
result.push('?') result.push('?')
@@ -101,13 +101,13 @@ export default {
return result.length > 0 ? result.join('') : this.DEFAULT_VALUE return result.length > 0 ? result.join('') : this.DEFAULT_VALUE
}, },
// 指定值范围区间介于最小值和最大值之间 // 指定值范围区间介于最小值和最大值之间
specifyRange() { specifyRange () {
let range = [] const range = []
for (let i = this.minValue; i <= this.maxValue; i++) { for (let i = this.minValue; i <= this.maxValue; i++) {
range.push(i) range.push(i)
} }
return range return range
}, }
}, },
methods: { methods: {
parseProp (value) { parseProp (value) {
@@ -41,15 +41,15 @@ import mixin from './mixin'
export default { export default {
name: 'month', name: 'month',
mixins: [mixin], mixins: [mixin],
data() { data () {
return {} return {}
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 1 this.minValue = 1
this.maxValue = 12 this.maxValue = 12
@@ -41,15 +41,15 @@ import mixin from './mixin'
export default { export default {
name: 'second', name: 'second',
mixins: [mixin], mixins: [mixin],
data() { data () {
return {} return {}
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 0 this.minValue = 0
this.maxValue = 59 this.maxValue = 59
@@ -51,14 +51,14 @@ import mixin from './mixin'
import { replaceWeekName, WEEK_MAP_EN } from './const.js' import { replaceWeekName, WEEK_MAP_EN } from './const.js'
const WEEK_MAP = { const WEEK_MAP = {
'周一': 2, 周一: 2,
'周二': 3, 周二: 3,
'周三': 4, 周三: 4,
'周四': 5, 周四: 5,
'周五': 6, 周五: 6,
'周六': 7, 周六: 7,
// 按照国人习惯将周日放到每周的最后一天 // 按照国人习惯将周日放到每周的最后一天
'周日': 1, 周日: 1
} }
export default { export default {
@@ -70,36 +70,36 @@ export default {
default: '*' default: '*'
} }
}, },
data() { data () {
return { return {
WEEK_MAP, WEEK_MAP,
WEEK_MAP_EN WEEK_MAP_EN
} }
}, },
computed: { computed: {
disableChoice() { disableChoice () {
return (this.day && this.day !== '?') || this.disabled return (this.day && this.day !== '?') || this.disabled
} }
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
// 如果设置日那么星期就直接不设置 // 如果设置日那么星期就直接不设置
this.updateValue() this.updateValue()
}, },
day(newVal) { day (newVal) {
// console.info('new day: ' + newVal) // console.info('new day: ' + newVal)
this.updateValue() this.updateValue()
} }
}, },
methods: { methods: {
updateValue() { updateValue () {
this.$emit('change', this.disableChoice ? '?' : this.value_c) this.$emit('change', this.disableChoice ? '?' : this.value_c)
}, },
preProcessProp(c) { preProcessProp (c) {
return replaceWeekName(c) return replaceWeekName(c)
} }
}, },
created() { created () {
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
// 0,7表示周日 1表示周一 // 0,7表示周日 1表示周一
this.minValue = 1 this.minValue = 1
@@ -31,16 +31,16 @@ import mixin from './mixin'
export default { export default {
name: 'year', name: 'year',
mixins: [mixin], mixins: [mixin],
data() { data () {
return {} return {}
}, },
watch: { watch: {
value_c(newVal, oldVal) { value_c (newVal, oldVal) {
// console.info('change:' + newVal) // console.info('change:' + newVal)
this.$emit('change', newVal) this.$emit('change', newVal)
} }
}, },
created() { created () {
const nowYear = (new Date()).getFullYear() const nowYear = (new Date()).getFullYear()
this.DEFAULT_VALUE = '*' this.DEFAULT_VALUE = '*'
this.minValue = 0 this.minValue = 0
File diff suppressed because it is too large Load Diff
+55 -55
View File
@@ -11,35 +11,35 @@
</template> </template>
<script> <script>
import tinymce from 'tinymce/tinymce' import tinymce from 'tinymce/tinymce'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import 'tinymce/themes/silver/theme' import 'tinymce/themes/silver/theme'
import 'tinymce/plugins/image' import 'tinymce/plugins/image'
import 'tinymce/plugins/link' import 'tinymce/plugins/link'
import 'tinymce/plugins/media' import 'tinymce/plugins/media'
import 'tinymce/plugins/table' import 'tinymce/plugins/table'
import 'tinymce/plugins/lists' import 'tinymce/plugins/lists'
import 'tinymce/plugins/contextmenu' import 'tinymce/plugins/contextmenu'
import 'tinymce/plugins/wordcount' import 'tinymce/plugins/wordcount'
import 'tinymce/plugins/colorpicker' import 'tinymce/plugins/colorpicker'
import 'tinymce/plugins/textcolor' import 'tinymce/plugins/textcolor'
import 'tinymce/plugins/fullscreen' import 'tinymce/plugins/fullscreen'
import 'tinymce/icons/default' import 'tinymce/icons/default'
import { uploadAction,getFileAccessHttpUrl } from '@/api/manage' import { uploadAction, getFileAccessHttpUrl } from '@/api/manage'
import { getVmParentByName } from '@/utils/util' import { getVmParentByName } from '@/utils/util'
export default { export default {
components: { components: {
Editor Editor
}, },
props: { props: {
value: { value: {
type: String, type: String,
required:false required: false
}, },
triggerChange:{ triggerChange: {
type: Boolean, type: Boolean,
default: false, default: false,
required:false required: false
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
@@ -52,12 +52,12 @@
toolbar: { toolbar: {
type: [String, Array], type: [String, Array],
default: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link unlink image media table | removeformat | fullscreen', default: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link unlink image media table | removeformat | fullscreen',
branding:false branding: false
} }
}, },
data() { data () {
return { return {
//初始化配置 // 初始化配置
init: { init: {
language_url: '/tinymce/langs/zh_CN.js', language_url: '/tinymce/langs/zh_CN.js',
language: 'zh_CN', language: 'zh_CN',
@@ -69,17 +69,17 @@
menubar: false, menubar: false,
toolbar_drawer: false, toolbar_drawer: false,
images_upload_handler: (blobInfo, success) => { images_upload_handler: (blobInfo, success) => {
let formData = new FormData() const formData = new FormData()
formData.append('file', blobInfo.blob(), blobInfo.filename()); formData.append('file', blobInfo.blob(), blobInfo.filename())
formData.append('biz', "jeditor"); formData.append('biz', 'jeditor')
formData.append("jeditor","1"); formData.append('jeditor', '1')
uploadAction(window._CONFIG['domianURL']+"/sys/common/upload", formData).then((res) => { uploadAction(window._CONFIG.domianURL + '/sys/common/upload', formData).then((res) => {
if (res.success) { if (res.success) {
if(res.message == 'local'){ if (res.message == 'local') {
const img = 'data:image/jpeg;base64,' + blobInfo.base64() const img = 'data:image/jpeg;base64,' + blobInfo.base64()
success(img) success(img)
}else{ } else {
let img = getFileAccessHttpUrl(res.message) const img = getFileAccessHttpUrl(res.message)
success(img) success(img)
} }
} }
@@ -87,24 +87,24 @@
} }
}, },
myValue: this.value, myValue: this.value,
reloading: false, reloading: false
} }
}, },
mounted() { mounted () {
this.initATabsChangeAutoReload() this.initATabsChangeAutoReload()
}, },
methods: { methods: {
reload() { reload () {
this.reloading = true this.reloading = true
this.$nextTick(() => this.reloading = false) this.$nextTick(() => this.reloading = false)
}, },
onClick(e) { onClick (e) {
this.$emit('onClick', e, tinymce) this.$emit('onClick', e, tinymce)
}, },
//可以添加一些自己的自定义事件如清空内容 // 可以添加一些自己的自定义事件如清空内容
clear() { clear () {
this.myValue = '' this.myValue = ''
}, },
@@ -114,13 +114,13 @@
* 由于 tabs 组件切换会导致 tinymce 无法输入 * 由于 tabs 组件切换会导致 tinymce 无法输入
* 只有重新加载才能使用无论是vue版的还是jQuery版tinymce都有这个通病 * 只有重新加载才能使用无论是vue版的还是jQuery版tinymce都有这个通病
*/ */
initATabsChangeAutoReload() { initATabsChangeAutoReload () {
// 获取父级 // 获取父级
let tabs = getVmParentByName(this, 'ATabs') const tabs = getVmParentByName(this, 'ATabs')
let tabPane = getVmParentByName(this, 'ATabPane') const tabPane = getVmParentByName(this, 'ATabPane')
if (tabs && tabPane) { if (tabs && tabPane) {
// 用户自定义的 key // 用户自定义的 key
let currentKey = tabPane.$vnode.key const currentKey = tabPane.$vnode.key
// 添加事件监听 // 添加事件监听
tabs.$on('change', (key) => { tabs.$on('change', (key) => {
// 切换到自己时执行reload // 切换到自己时执行reload
@@ -128,13 +128,13 @@
this.reload() this.reload()
} }
}) })
//update--begin--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------ // update--begin--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------
this.reload() this.reload()
//update--end--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------ // update--end--autor:liusq-----date:20210316------for富文本编辑器tab父组件可能导致的赋值问题------
}else{ } else {
//update--begin--autor:wangshuai-----date:20200724------for富文本编辑器切换tab无法修改------ // 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不能使用------ // update--begin--autor:liusq-----date:20210713------for处理特殊情况excuteCallback不能使用------
try { try {
tabLayout.excuteCallback(() => { tabLayout.excuteCallback(() => {
this.reload() this.reload()
@@ -144,25 +144,25 @@
this.reload() this.reload()
} }
} }
//update--end--autor:liusq-----date:20210713------for处理特殊情况excuteCallback不能使用------ // update--end--autor:liusq-----date:20210713------for处理特殊情况excuteCallback不能使用------
//update--begin--autor:wangshuai-----date:20200724------for文本编辑器切换tab无法修改------ // update--begin--autor:wangshuai-----date:20200724------for文本编辑器切换tab无法修改------
}
} }
},
}, },
watch: { watch: {
value(newValue) { value (newValue) {
this.myValue = (newValue == null ? '' : newValue) this.myValue = (newValue == null ? '' : newValue)
}, },
myValue(newValue) { myValue (newValue) {
if(this.triggerChange){ if (this.triggerChange) {
this.$emit('change', newValue) this.$emit('change', newValue)
}else{ } else {
this.$emit('input', newValue) this.$emit('input', newValue)
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+4 -4
View File
@@ -11,20 +11,20 @@
</template> </template>
<script> <script>
export default { export default {
name: 'JEllipsis', name: 'JEllipsis',
props: { props: {
value: { value: {
type: String, type: String,
required: false, required: false
}, },
length: { length: {
type: Number, type: Number,
required: false, required: false,
default: 25, default: 25
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
+10 -10
View File
@@ -11,7 +11,7 @@
</template> </template>
<script> <script>
/** /**
* 使用方法 * 使用方法
* 在form下直接写这个组件就行了 * 在form下直接写这个组件就行了
*<a-form layout="inline" :form="form" > *<a-form layout="inline" :form="form" >
@@ -20,19 +20,19 @@
* </j-form-container> * </j-form-container>
*</a-form> *</a-form>
*/ */
export default { export default {
name: 'JFormContainer', name: 'JFormContainer',
props:{ props: {
disabled:{ disabled: {
type:Boolean, type: Boolean,
default:false, default: false,
required:false required: false
} }
}, },
mounted(){ mounted () {
console.log("我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用") console.log('我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用')
}
} }
}
</script> </script>
<style> <style>
.jero-form-container-disabled{ .jero-form-container-disabled{
+116 -116
View File
@@ -27,207 +27,207 @@
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage' import { getFileAccessHttpUrl } from '@/api/manage'
const Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
const uidGenerator=()=>{ const uidGenerator = () => {
return '-'+parseInt(Math.random()*10000+1,10); return '-' + parseInt(Math.random() * 10000 + 1, 10)
} }
export default { export default {
name: 'JImageUpload', name: 'JImageUpload',
data(){ data () {
return { return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload", uploadAction: window._CONFIG.domianURL + '/sys/common/upload',
uploadLoading:false, uploadLoading: false,
picUrl:false, picUrl: false,
headers:{}, headers: {},
fileList: [], fileList: [],
previewImage:"", previewImage: ''
} }
}, },
props:{ props: {
text:{ text: {
type:String, type: String,
required:false, required: false,
default:"上传" default: '上传'
}, },
/*这个属性用于控制文件上传的业务路径*/ /* 这个属性用于控制文件上传的业务路径 */
bizPath:{ bizPath: {
type:String, type: String,
required:false, required: false,
default:"temp" default: 'temp'
}, },
value:{ value: {
type:[String,Array], type: [String, Array],
required:false required: false
}, },
disabled:{ disabled: {
type:Boolean, type: Boolean,
required:false, required: false,
default: false default: false
}, },
isMultiple:{ isMultiple: {
type:Boolean, type: Boolean,
required:false, required: false,
default: false default: false
}, },
//update-begin-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性用于判断上传数量 // update-begin-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性用于判断上传数量
number:{ number: {
type:Number, type: Number,
required:false, required: false,
default:0 default: 0
} }
//update-end-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性用于判断上传数量 // update-end-author:wangshuai date:20201021 for:LOWCOD-969 新增number属性用于判断上传数量
}, },
computed: { computed: {
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch:{ watch: {
value: { value: {
handler(val,oldValue) { handler (val, oldValue) {
if (val instanceof Array) { if (val instanceof Array) {
this.initFileList(val.join(',')) this.initFileList(val.join(','))
} else { } else {
this.initFileList(val) this.initFileList(val)
} }
if(!val || val.length==0){ if (!val || val.length == 0) {
this.picUrl = false; this.picUrl = false
} }
}, },
//立刻执行handler // 立刻执行handler
immediate: true immediate: true
} }
}, },
created(){ created () {
const token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = {"X-Access-Token":token} this.headers = { 'X-Access-Token': token }
}, },
methods:{ methods: {
initFileList(paths){ initFileList (paths) {
if(!paths || paths.length==0){ if (!paths || paths.length == 0) {
this.fileList = []; this.fileList = []
return; return
} }
this.picUrl = true; this.picUrl = true
let fileList = []; const fileList = []
let arr = paths.split(",") const arr = paths.split(',')
for(var a=0;a<arr.length;a++){ for (var a = 0; a < arr.length; a++) {
let url = getFileAccessHttpUrl(arr[a]); const url = getFileAccessHttpUrl(arr[a])
fileList.push({ fileList.push({
uid: uidGenerator(), uid: uidGenerator(),
name: arr[a], name: arr[a],
status: 'done', status: 'done',
url: url, url: url,
response:{ response: {
status:"history", status: 'history',
message:arr[a] message: arr[a]
} }
}) })
} }
this.fileList = fileList this.fileList = fileList
}, },
beforeUpload: function(file){ beforeUpload: function (file) {
var fileType = file.type; var fileType = file.type
if(fileType.indexOf('image')<0){ if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片'); this.$message.warning('请上传图片')
return false; return false
} }
}, },
handleChange(info) { handleChange (info) {
this.picUrl = false; this.picUrl = false
let fileList = info.fileList let fileList = info.fileList
//update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选返回选定的元素 // update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选返回选定的元素
if(this.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和是否多选返回选定的元素 // update-end-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选返回选定的元素
if(info.file.status==='done'){ if (info.file.status === 'done') {
if(info.file.response.success){ if (info.file.response.success) {
this.picUrl = true; this.picUrl = true
fileList = fileList.map((file) => { fileList = fileList.map((file) => {
if (file.response) { 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} 上传成功!`); // this.$message.success(`${info.file.name} 上传成功!`);
}else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`); this.$message.error(`${info.file.name} 上传失败.`)
}else if(info.file.status === 'removed'){ } else if (info.file.status === 'removed') {
this.handleDelete(info.file) this.handleDelete(info.file)
} }
this.fileList = fileList this.fileList = fileList
if(info.file.status==='done' || info.file.status === 'removed'){ if (info.file.status === 'done' || info.file.status === 'removed') {
this.handlePathChange() this.handlePathChange()
} }
}, },
// 预览 // 预览
handlePreview(file) { handlePreview (file) {
if (file && file.url) { if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/${file.url}` var fileFullUrl = `${window._CONFIG.domianWebSocketURL}/${file.url}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url) window.open(url)
} }
}, },
getAvatarView(){ getAvatarView () {
if(this.fileList.length>0){ 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) return getFileAccessHttpUrl(url)
} }
}, },
handlePathChange(){ handlePathChange () {
let uploadFiles = this.fileList const uploadFiles = this.fileList
let path = '' let path = ''
if(!uploadFiles || uploadFiles.length==0){ if (!uploadFiles || uploadFiles.length == 0) {
path = '' path = ''
} }
let arr = []; const arr = []
if(!this.isMultiple && uploadFiles && uploadFiles.length > 0){ if (!this.isMultiple && uploadFiles && uploadFiles.length > 0) {
arr.push(uploadFiles[uploadFiles.length-1].url) arr.push(uploadFiles[uploadFiles.length - 1].url)
}else{ } else {
for(let a=0;a<uploadFiles.length;a++){ for (let a = 0; a < uploadFiles.length; a++) {
// update-begin-author:taoyan date:20200819 for:开源问题z上传图片组件 LOWCOD-783 // update-begin-author:taoyan date:20200819 for:开源问题z上传图片组件 LOWCOD-783
if(uploadFiles[a].status === 'done' ) { if (uploadFiles[a].status === 'done') {
arr.push(uploadFiles[a].url) arr.push(uploadFiles[a].url)
}else{ } else {
return; return
} }
// update-end-author:taoyan date:20200819 for:开源问题z上传图片组件 LOWCOD-783 // update-end-author:taoyan date:20200819 for:开源问题z上传图片组件 LOWCOD-783
} }
} }
if(arr.length>0){ if (arr.length > 0) {
path = arr.join(",") path = arr.join(',')
} }
this.$emit('change', path); this.$emit('change', path)
}, },
handleDelete(file){ handleDelete (file) {
//如有需要新增 删除逻辑 // 如有需要新增 删除逻辑
}, },
handleCancel() { handleCancel () {
this.close(); this.close()
this.previewVisible = false; this.previewVisible = false
}, },
close () { close () {
}, }
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
+38 -38
View File
@@ -36,92 +36,92 @@
</template> </template>
<script> <script>
import { postAction } from '@/api/manage' import { postAction } from '@/api/manage'
export default { export default {
name: 'JImportModal', name: 'JImportModal',
props:{ props: {
url:{ url: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
visible:{ visible: {
type: Boolean, type: Boolean,
default: '', default: '',
required: false required: false
}, },
biz:{ biz: {
type: String, type: String,
default: '', default: '',
required: false required: false
} }
}, },
data(){ data () {
return { return {
uploading:false, uploading: false,
fileList:[], fileList: [],
uploadAction:'', uploadAction: '',
foreignKeys:'' foreignKeys: ''
} }
}, },
watch: { watch: {
url (val) { url (val) {
if(val){ if (val) {
this.uploadAction = window._CONFIG['domianURL']+val this.uploadAction = window._CONFIG.domianURL + val
} }
} }
}, },
created () { created () {
console.log(this.$attrs) console.log(this.$attrs)
this.uploadAction = window._CONFIG['domianURL']+this.url this.uploadAction = window._CONFIG.domianURL + this.url
}, },
methods:{ methods: {
handleClose(){ handleClose () {
this.visible=false this.visible = false
}, },
show(arg){ show (arg) {
this.fileList = [] this.fileList = []
this.uploading = false this.uploading = false
this.visible = true this.visible = true
this.foreignKeys = arg; this.foreignKeys = arg
}, },
handleRemove(file) { handleRemove (file) {
const index = this.fileList.indexOf(file); const index = this.fileList.indexOf(file)
const newFileList = this.fileList.slice(); const newFileList = this.fileList.slice()
newFileList.splice(index, 1); newFileList.splice(index, 1)
this.fileList = newFileList this.fileList = newFileList
}, },
beforeUpload(file) { beforeUpload (file) {
this.fileList = [...this.fileList, file] this.fileList = [...this.fileList, file]
return false; return false
}, },
handleImport() { handleImport () {
const { fileList } = this; const { fileList } = this
const formData = new FormData(); const formData = new FormData()
if(this.biz){ if (this.biz) {
formData.append('isSingleTableImport',this.biz); formData.append('isSingleTableImport', this.biz)
} }
if(this.foreignKeys && this.foreignKeys.length>0){ if (this.foreignKeys && this.foreignKeys.length > 0) {
formData.append('foreignKeys',this.foreignKeys); formData.append('foreignKeys', this.foreignKeys)
} }
fileList.forEach((file) => { fileList.forEach((file) => {
formData.append('files[]', file); formData.append('files[]', file)
}); })
this.uploading = true this.uploading = true
postAction(this.uploadAction, formData).then((res) => { postAction(this.uploadAction, formData).then((res) => {
this.uploading = false this.uploading = false
if(res.success){ if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.visible=false this.visible = false
this.$emit('ok') this.$emit('ok')
}else{ } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}) })
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+50 -50
View File
@@ -9,16 +9,16 @@
<script> <script>
import { Input } from 'ant-design-vue' import { Input } from 'ant-design-vue'
const JINPUT_QUERY_LIKE = 'like'; const JINPUT_QUERY_LIKE = 'like'
const JINPUT_QUERY_NE = 'ne'; const JINPUT_QUERY_NE = 'ne'
const JINPUT_QUERY_GE = 'ge'; //大于等于 const JINPUT_QUERY_GE = 'ge' // 大于等于
const JINPUT_QUERY_LE = 'le'; //小于等于 const JINPUT_QUERY_LE = 'le' // 小于等于
export default { export default {
name: 'JInput', name: 'JInput',
props:{ props: {
...Input.props, // 拿到全部外部的参数 ...Input.props, // 拿到全部外部的参数
value: { value: {
type: String, type: String,
@@ -38,91 +38,91 @@
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
}
}, },
}, data () {
data(){
return { return {
inputVal:'' inputVal: ''
} }
}, },
computed: { computed: {
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch:{ watch: {
value:{ value: {
immediate:true, immediate: true,
handler:function(){ handler: function () {
this.initVal(); this.initVal()
} }
}, },
// type 变化的时候重新计算值 // type 变化的时候重新计算值
type() { type () {
this.backValue({ target: { value: this.inputVal } }) this.backValue({ target: { value: this.inputVal } })
}
}, },
}, methods: {
methods:{ initVal () {
initVal(){ if (!this.value) {
if(!this.value){
this.inputVal = '' this.inputVal = ''
}else{ } else {
let text = this.value let text = this.value
switch (this.type) { switch (this.type) {
case JINPUT_QUERY_LIKE: case JINPUT_QUERY_LIKE:
//修复路由传参的值传送到jinput框被前后各截取了一位 #1336 // 修复路由传参的值传送到jinput框被前后各截取了一位 #1336
if(text.indexOf("*") != -1){ if (text.indexOf('*') != -1) {
text = text.substring(1,text.length-1); text = text.substring(1, text.length - 1)
} }
break; break
case JINPUT_QUERY_NE: case JINPUT_QUERY_NE:
text = text.substring(1); text = text.substring(1)
break; break
case JINPUT_QUERY_GE: case JINPUT_QUERY_GE:
text = text.substring(2); text = text.substring(2)
break; break
case JINPUT_QUERY_LE: case JINPUT_QUERY_LE:
text = text.substring(2); text = text.substring(2)
break; break
default: default:
} }
this.inputVal = text this.inputVal = text
} }
}, },
backValue(e){ backValue (e) {
let text = e.target.value let text = e.target.value
if(text && this.trim===true){ if (text && this.trim === true) {
text = text.trim() text = text.trim()
} }
switch (this.type) { switch (this.type) {
case JINPUT_QUERY_LIKE: case JINPUT_QUERY_LIKE:
text = "*"+text+"*"; text = '*' + text + '*'
break; break
case JINPUT_QUERY_NE: case JINPUT_QUERY_NE:
text = "!"+text; text = '!' + text
break; break
case JINPUT_QUERY_GE: case JINPUT_QUERY_GE:
text = ">="+text; text = '>=' + text
break; break
case JINPUT_QUERY_LE: case JINPUT_QUERY_LE:
text = "<="+text; text = '<=' + text
break; break
default: default:
} }
this.$emit('change', text); this.$emit('change', text)
} }
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
@@ -27,10 +27,10 @@
<script> <script>
import 'codemirror/lib/codemirror.css' import 'codemirror/lib/codemirror.css'
import '@toast-ui/editor/dist/toastui-editor.css'; import '@toast-ui/editor/dist/toastui-editor.css'
import '@toast-ui/editor/dist/i18n/zh-cn'; 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 defaultOptions from './default-options'
import JUpload from '@/components/jero/JUpload' import JUpload from '@/components/jero/JUpload'
import { getFileAccessHttpUrl } from '@/api/manage' import { getFileAccessHttpUrl } from '@/api/manage'
@@ -38,7 +38,7 @@ import { getFileAccessHttpUrl } from '@/api/manage'
export default { export default {
name: 'JMarkdownEditor', name: 'JMarkdownEditor',
components: { components: {
JUpload, JUpload
}, },
props: { props: {
value: { value: {
@@ -48,13 +48,13 @@ export default {
id: { id: {
type: String, type: String,
required: false, required: false,
default() { default () {
return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
} }
}, },
options: { options: {
type: Object, type: Object,
default() { default () {
return defaultOptions return defaultOptions
} }
}, },
@@ -73,22 +73,22 @@ export default {
default: 'zh-CN' default: 'zh-CN'
} }
}, },
data() { data () {
return { return {
editor: null, editor: null,
isShow:false, isShow: false,
activeIndex:"1", activeIndex: '1',
dialogVisible:false, dialogVisible: false,
index:"1", index: '1',
fileList:[], fileList: [],
remark:"", remark: '',
imageName:"", imageName: '',
imageUrl:"", imageUrl: '',
networkPic:"" networkPic: ''
} }
}, },
computed: { computed: {
editorOptions() { editorOptions () {
const options = Object.assign({}, defaultOptions, this.options) const options = Object.assign({}, defaultOptions, this.options)
options.initialEditType = this.mode options.initialEditType = this.mode
options.height = this.height options.height = this.height
@@ -97,30 +97,30 @@ export default {
} }
}, },
watch: { watch: {
value(newValue, preValue) { value (newValue, preValue) {
if (newValue !== preValue && newValue !== this.editor.getMarkdown()) { if (newValue !== preValue && newValue !== this.editor.getMarkdown()) {
this.editor.setMarkdown(newValue) this.editor.setMarkdown(newValue)
} }
}, },
language(val) { language (val) {
this.destroyEditor() this.destroyEditor()
this.initEditor() this.initEditor()
}, },
height(newValue) { height (newValue) {
this.editor.height(newValue) this.editor.height(newValue)
}, },
mode(newValue) { mode (newValue) {
this.editor.changeMode(newValue) this.editor.changeMode(newValue)
} }
}, },
mounted() { mounted () {
this.initEditor() this.initEditor()
}, },
destroyed() { destroyed () {
this.destroyEditor() this.destroyEditor()
}, },
methods: { methods: {
initEditor() { initEditor () {
this.editor = new Editor({ this.editor = new Editor({
el: document.getElementById(this.id), el: document.getElementById(this.id),
...this.editorOptions ...this.editorOptions
@@ -131,20 +131,20 @@ export default {
this.editor.on('change', () => { this.editor.on('change', () => {
this.$emit('change', this.editor.getMarkdown()) this.$emit('change', this.editor.getMarkdown())
}) })
//--begin 添加自定义上传按钮 // --begin 添加自定义上传按钮
/* /*
* 添加自定义按钮 * 添加自定义按钮
*/ */
//获取编辑器上的功能条 // 获取编辑器上的功能条
let toolbar = this.editor.getUI().getToolbar(); const toolbar = this.editor.getUI().getToolbar()
let fileDom = this.$refs.files; const fileDom = this.$refs.files
//添加图片点击事件 // 添加图片点击事件
this.editor.eventManager.addEventType('isShowClickEvent'); this.editor.eventManager.addEventType('isShowClickEvent')
this.editor.eventManager.listen('isShowClickEvent', () => { this.editor.eventManager.listen('isShowClickEvent', () => {
this.isShow = true this.isShow = true
this.dialogVisible = true this.dialogVisible = true
}); })
//addImageBlobHook图片上传剪切拖拽都会走此方法 // addImageBlobHook图片上传剪切拖拽都会走此方法
// 删除默认监听事件 // 删除默认监听事件
this.editor.eventManager.removeEventHandler('addImageBlobHook') this.editor.eventManager.removeEventHandler('addImageBlobHook')
// 添加自定义监听事件 // 添加自定义监听事件
@@ -154,85 +154,85 @@ export default {
}) })
}) })
// 添加自定义按钮 第二个参数代表位置不传默认放在最后 // 添加自定义按钮 第二个参数代表位置不传默认放在最后
toolbar.insertItem(15,{ toolbar.insertItem(15, {
type: 'button', type: 'button',
options:{ options: {
name: 'customize', name: 'customize',
className: 'tui-image tui-toolbar-icons', className: 'tui-image tui-toolbar-icons',
event: 'isShowClickEvent', event: 'isShowClickEvent',
tooltip: '上传图片', tooltip: '上传图片'
} }
// //
}); })
//--end 添加自定义上传按钮 // --end 添加自定义上传按钮
}, },
destroyEditor() { destroyEditor () {
if (!this.editor) return if (!this.editor) return
this.editor.off('change') this.editor.off('change')
this.editor.remove() this.editor.remove()
}, },
setMarkdown(value) { setMarkdown (value) {
this.editor.setMarkdown(value) this.editor.setMarkdown(value)
}, },
getMarkdown() { getMarkdown () {
return this.editor.getMarkdown() return this.editor.getMarkdown()
}, },
setHtml(value) { setHtml (value) {
this.editor.setHtml(value) this.editor.setHtml(value)
}, },
getHtml() { getHtml () {
return this.editor.getHtml() return this.editor.getHtml()
}, },
handleOk(){ handleOk () {
if(this.index=='1'){ if (this.index == '1') {
this.imageUrl = getFileAccessHttpUrl(this.fileList) this.imageUrl = getFileAccessHttpUrl(this.fileList)
if(this.remark){ if (this.remark) {
this.addImgToMd(this.imageUrl,this.remark) this.addImgToMd(this.imageUrl, this.remark)
}else{
this.addImgToMd(this.imageUrl,"")
}
}else{
if(this.remark){
this.addImgToMd(this.networkPic,this.remark)
}else{
this.addImgToMd(this.networkPic,"")
}
}
this.index="1"
this.fileList=[]
this.imageName="";
this.imageUrl="";
this.remark=""
this.networkPic=""
this.dialogVisible=false
this.isShow=false;
},
handleClose(done) {
done();
},
handleChange(val){
this.fileList=[]
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();
if (isMarkdownMode) {
editor.replaceSelection(`![${name}](${data})`);
} else { } else {
let range = editorHtml.getRange(); this.addImgToMd(this.imageUrl, '')
let img = document.createElement('img');
img.src = `${data}`;
img.alt = name;
range.insertNode(img);
} }
} else {
if (this.remark) {
this.addImgToMd(this.networkPic, this.remark)
} else {
this.addImgToMd(this.networkPic, '')
}
}
this.index = '1'
this.fileList = []
this.imageName = ''
this.imageUrl = ''
this.remark = ''
this.networkPic = ''
this.dialogVisible = false
this.isShow = false
}, },
handleClose (done) {
done()
},
handleChange (val) {
this.fileList = []
this.remark = ''
this.imageName = ''
this.imageUrl = ''
this.networkPic = ''
this.index = val
},
// 添加图片到markdown
addImgToMd (data, name) {
const editor = this.editor.getCodeMirror()
const editorHtml = this.editor.getCurrentModeEditor()
const isMarkdownMode = this.editor.isMarkdownMode()
if (isMarkdownMode) {
editor.replaceSelection(`![${name}](${data})`)
} else {
const range = editorHtml.getRange()
const img = document.createElement('img')
img.src = `${data}`
img.alt = name
range.insertNode(img)
}
}
}, },
model: { model: {
prop: 'value', prop: 'value',
+31 -31
View File
@@ -70,102 +70,102 @@ export default {
okClose: { okClose: {
type: Boolean, type: Boolean,
default: true default: true
}
}, },
}, data () {
data() {
return { return {
// 内部使用的 slots 不再处理 // 内部使用的 slots 不再处理
usedSlots: ['title'], usedSlots: ['title'],
// 实际控制是否全屏的参数 // 实际控制是否全屏的参数
innerFullscreen: this.fullscreen, innerFullscreen: this.fullscreen
} }
}, },
computed: { computed: {
// 一些未处理的参数或特殊处理的参数绑定到 a-modal // 一些未处理的参数或特殊处理的参数绑定到 a-modal
_attrs() { _attrs () {
let attrs = { ...this.$attrs } const attrs = { ...this.$attrs }
// 如果全屏就将宽度设为 100% // 如果全屏就将宽度设为 100%
if (this.innerFullscreen) { if (this.innerFullscreen) {
attrs['width'] = '100%' attrs.width = '100%'
} }
return attrs return attrs
}, },
modalClass() { modalClass () {
return { return {
'j-modal-box': true, 'j-modal-box': true,
'fullscreen': this.innerFullscreen, fullscreen: this.innerFullscreen,
'no-title': this.isNoTitle, 'no-title': this.isNoTitle,
'no-footer': this.isNoFooter, 'no-footer': this.isNoFooter
} }
}, },
modalStyle() { modalStyle () {
let style = {} const style = {}
// 如果全屏就将top设为 0 // 如果全屏就将top设为 0
if (this.innerFullscreen) { if (this.innerFullscreen) {
style['top'] = '0' style.top = '0'
} }
return style return style
}, },
isNoTitle() { isNoTitle () {
return !this.title && !this.allSlotsKeys.includes('title') return !this.title && !this.allSlotsKeys.includes('title')
}, },
isNoFooter() { isNoFooter () {
return this._attrs['footer'] === null return this._attrs.footer === null
}, },
slotsKeys() { slotsKeys () {
return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key)) return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
}, },
scopedSlotsKeys() { scopedSlotsKeys () {
return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key)) return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key))
}, },
allSlotsKeys() { allSlotsKeys () {
return Object.keys(this.$slots).concat(Object.keys(this.$scopedSlots)) return Object.keys(this.$slots).concat(Object.keys(this.$scopedSlots))
}, },
// 切换全屏的按钮图标 // 切换全屏的按钮图标
fullscreenButtonIcon() { fullscreenButtonIcon () {
return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen' return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
}, }
}, },
watch: { watch: {
visible() { visible () {
if (this.visible) { if (this.visible) {
this.innerFullscreen = this.fullscreen this.innerFullscreen = this.fullscreen
} }
}, },
innerFullscreen(val) { innerFullscreen (val) {
this.$emit('update:fullscreen', val) this.$emit('update:fullscreen', val)
}, }
}, },
methods: { methods: {
getClass(clazz) { getClass (clazz) {
return { ...getClass(this), ...clazz } return { ...getClass(this), ...clazz }
}, },
getStyle(style) { getStyle (style) {
return { ...getStyle(this), ...style } return { ...getStyle(this), ...style }
}, },
close() { close () {
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
handleOk() { handleOk () {
if (this.okClose) { if (this.okClose) {
this.close() this.close()
} }
}, },
handleCancel() { handleCancel () {
this.close() this.close()
}, },
/** 切换全屏 */ /** 切换全屏 */
toggleFullscreen() { toggleFullscreen () {
this.innerFullscreen = !this.innerFullscreen this.innerFullscreen = !this.innerFullscreen
triggerWindowResizeEvent() triggerWindowResizeEvent()
}, }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
+21 -21
View File
@@ -16,37 +16,37 @@ import pick from 'lodash.pick'
export default { export default {
name: 'JPrompt', name: 'JPrompt',
data() { data () {
return { return {
visible: false, visible: false,
loading: false, loading: false,
content: '', content: '',
// 弹窗参数 // 弹窗参数
modalProps: { modalProps: {
title: '', title: ''
}, },
inputProps: { inputProps: {
placeholder: '', placeholder: ''
}, },
// form model // form model
model: { model: {
input: '', input: ''
}, },
// 校验 // 校验
rule: [], rule: [],
// 回调函数 // 回调函数
callback: {}, callback: {}
} }
}, },
computed: { computed: {
rules() { rules () {
return { return {
input: this.rule input: this.rule
} }
}, }
}, },
methods: { methods: {
show(options) { show (options) {
this.content = options.content this.content = options.content
if (Array.isArray(options.rule)) { if (Array.isArray(options.rule)) {
this.rule = options.rule this.rule = options.rule
@@ -55,10 +55,10 @@ export default {
this.model.input = options.defaultValue 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) this.modalProps = Object.assign({}, pickModalProps, options.modalProps)
// 取出常用的input参数 // 取出常用的input参数
let pickInputProps = pick(options, 'placeholder', 'allowClear') const pickInputProps = pick(options, 'placeholder', 'allowClear')
this.inputProps = Object.assign({}, pickInputProps, options.inputProps) this.inputProps = Object.assign({}, pickInputProps, options.inputProps)
// 回调函数 // 回调函数
this.callback = pick(options, 'onOk', 'onOkAsync', 'onCancel') this.callback = pick(options, 'onOk', 'onOkAsync', 'onCancel')
@@ -66,10 +66,10 @@ export default {
this.$nextTick(() => this.$refs.input.focus()) this.$nextTick(() => this.$refs.input.focus())
}, },
onOk() { onOk () {
this.$refs.form.validate((ok, err) => { this.$refs.form.validate((ok, err) => {
if (ok) { if (ok) {
let event = {value: this.model.input, target: this} const event = { value: this.model.input, target: this }
// 异步方法优先级高于同步方法 // 异步方法优先级高于同步方法
if (typeof this.callback.onOkAsync === 'function') { if (typeof this.callback.onOkAsync === 'function') {
this.callback.onOkAsync(event) this.callback.onOkAsync(event)
@@ -82,40 +82,40 @@ export default {
} }
}) })
}, },
onCancel() { onCancel () {
if (typeof this.callback.onCancel === 'function') { if (typeof this.callback.onCancel === 'function') {
this.callback.onCancel(this.model.input) this.callback.onCancel(this.model.input)
} }
this.close() this.close()
}, },
onInputPressEnter() { onInputPressEnter () {
this.onOk() this.onOk()
}, },
close() { close () {
this.visible = this.loading ? this.visible : false this.visible = this.loading ? this.visible : false
}, },
forceClose() { forceClose () {
this.visible = false this.visible = false
}, },
showLoading() { showLoading () {
this.loading = true this.loading = true
}, },
hideLoading() { hideLoading () {
this.loading = false this.loading = false
}, },
afterClose(e) { afterClose (e) {
if (typeof this.modalProps.afterClose === 'function') { if (typeof this.modalProps.afterClose === 'function') {
this.modalProps.afterClose(e) this.modalProps.afterClose(e)
} }
this.$emit('after-close', e) this.$emit('after-close', e)
}, }
}, }
} }
</script> </script>
+2 -2
View File
@@ -2,7 +2,7 @@ import JModal from './JModal'
import JPrompt from './JPrompt' import JPrompt from './JPrompt'
export default { export default {
install(Vue) { install (Vue) {
Vue.component(JModal.name, JModal) Vue.component(JModal.name, JModal)
const JPromptExtend = Vue.extend(JPrompt) const JPromptExtend = Vue.extend(JPrompt)
@@ -14,5 +14,5 @@ export default {
vm.$on('after-close', () => vm.$destroy()) vm.$on('after-close', () => vm.$destroy())
return vm return vm
} }
}, }
} }
+34 -34
View File
@@ -47,10 +47,10 @@
<script> <script>
import { getClass, getStyle } from '@/utils/props-util' import { getClass, getStyle } from '@/utils/props-util'
import { triggerWindowResizeEvent } from '@/utils/util' import { triggerWindowResizeEvent } from '@/utils/util'
export default { export default {
name: 'JModal', name: 'JModal',
props: { props: {
title: String, title: String,
@@ -70,102 +70,102 @@
okClose: { okClose: {
type: Boolean, type: Boolean,
default: true default: true
}
}, },
}, data () {
data() {
return { return {
// 内部使用的 slots 不再处理 // 内部使用的 slots 不再处理
usedSlots: ['title'], usedSlots: ['title'],
// 实际控制是否全屏的参数 // 实际控制是否全屏的参数
innerFullscreen: this.fullscreen, innerFullscreen: this.fullscreen
} }
}, },
computed: { computed: {
// 一些未处理的参数或特殊处理的参数绑定到 a-modal // 一些未处理的参数或特殊处理的参数绑定到 a-modal
_attrs() { _attrs () {
let attrs = { ...this.$attrs } const attrs = { ...this.$attrs }
// 如果全屏就将宽度设为 100% // 如果全屏就将宽度设为 100%
if (this.innerFullscreen) { if (this.innerFullscreen) {
attrs['width'] = '100%' attrs.width = '100%'
} }
return attrs return attrs
}, },
modalClass() { modalClass () {
return { return {
'j-modal-box': true, 'j-modal-box': true,
'fullscreen': this.innerFullscreen, fullscreen: this.innerFullscreen,
'no-title': this.isNoTitle, 'no-title': this.isNoTitle,
'no-footer': this.isNoFooter, 'no-footer': this.isNoFooter
} }
}, },
modalStyle() { modalStyle () {
let style = {} const style = {}
// 如果全屏就将top设为 0 // 如果全屏就将top设为 0
if (this.innerFullscreen) { if (this.innerFullscreen) {
style['top'] = '0' style.top = '0'
} }
return style return style
}, },
isNoTitle() { isNoTitle () {
return !this.title && !this.allSlotsKeys.includes('title') return !this.title && !this.allSlotsKeys.includes('title')
}, },
isNoFooter() { isNoFooter () {
return this._attrs['footer'] === null return this._attrs.footer === null
}, },
slotsKeys() { slotsKeys () {
return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key)) return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
}, },
scopedSlotsKeys() { scopedSlotsKeys () {
return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key)) return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key))
}, },
allSlotsKeys() { allSlotsKeys () {
return Object.keys(this.$slots).concat(Object.keys(this.$scopedSlots)) return Object.keys(this.$slots).concat(Object.keys(this.$scopedSlots))
}, },
// 切换全屏的按钮图标 // 切换全屏的按钮图标
fullscreenButtonIcon() { fullscreenButtonIcon () {
return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen' return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
}, }
}, },
watch: { watch: {
visible() { visible () {
if (this.visible) { if (this.visible) {
this.innerFullscreen = this.fullscreen this.innerFullscreen = this.fullscreen
} }
}, },
innerFullscreen(val) { innerFullscreen (val) {
this.$emit('update:fullscreen', val) this.$emit('update:fullscreen', val)
}, }
}, },
methods: { methods: {
getClass(clazz) { getClass (clazz) {
return { ...getClass(this), ...clazz } return { ...getClass(this), ...clazz }
}, },
getStyle(style) { getStyle (style) {
return { ...getStyle(this), ...style } return { ...getStyle(this), ...style }
}, },
close() { close () {
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
handleOk() { handleOk () {
if (this.okClose) { if (this.okClose) {
this.close() this.close()
} }
}, },
handleCancel() { handleCancel () {
this.close() this.close()
}, },
/** 切换全屏 */ /** 切换全屏 */
toggleFullscreen() { toggleFullscreen () {
this.innerFullscreen = !this.innerFullscreen this.innerFullscreen = !this.innerFullscreen
triggerWindowResizeEvent() triggerWindowResizeEvent()
}, }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
+34 -34
View File
@@ -20,9 +20,9 @@
</template> </template>
<script> <script>
import JPopupOnlReport from './modal/JPopupOnlReport' import JPopupOnlReport from './modal/JPopupOnlReport'
export default { export default {
name: 'JPopup', name: 'JPopup',
components: { components: {
JPopupOnlReport JPopupOnlReport
@@ -82,13 +82,13 @@
required: false, required: false,
default: false default: false
}, },
//popup动态参数 支持系统变量语法 // popup动态参数 支持系统变量语法
param:{ param: {
type: Object, type: Object,
required: false, required: false,
default: ()=>{} default: () => {}
}, },
spliter:{ spliter: {
type: String, type: String,
required: false, required: false,
default: ',' default: ','
@@ -97,7 +97,7 @@
groupId: String groupId: String
}, },
data() { data () {
return { return {
showText: '', showText: '',
title: '', title: '',
@@ -105,9 +105,9 @@
} }
}, },
computed: { computed: {
uniqGroupId() { uniqGroupId () {
if (this.groupId) { if (this.groupId) {
let { groupId, code, field, orgFields, destFields } = this const { groupId, code, field, orgFields, destFields } = this
return `${groupId}_${code}_${field}_${orgFields}_${destFields}` return `${groupId}_${code}_${field}_${orgFields}_${destFields}`
} }
} }
@@ -115,7 +115,7 @@
watch: { watch: {
value: { value: {
immediate: true, immediate: true,
handler: function(val) { handler: function (val) {
if (!val) { if (!val) {
this.showText = '' this.showText = ''
} else { } else {
@@ -124,9 +124,9 @@
} }
} }
}, },
created() { created () {
}, },
mounted() { mounted () {
if (!this.orgFields || !this.destFields || !this.code) { if (!this.orgFields || !this.destFields || !this.code) {
this.$message.error('popup参数未正确配置!') this.$message.error('popup参数未正确配置!')
this.avalid = false this.avalid = false
@@ -137,18 +137,18 @@
} }
}, },
methods: { methods: {
openModal() { openModal () {
if (this.disabled === false) { if (this.disabled === false) {
this.$refs.jPopupOnlReport.show() this.$refs.jPopupOnlReport.show()
} }
}, },
handleEmpty() { handleEmpty () {
this.showText = '' this.showText = ''
let destFieldsArr = this.destFields.split(',') const destFieldsArr = this.destFields.split(',')
if (destFieldsArr.length === 0) { if (destFieldsArr.length === 0) {
return return
} }
let res = {} const res = {}
for (let i = 0; i < destFieldsArr.length; i++) { for (let i = 0; i < destFieldsArr.length; i++) {
res[destFieldsArr[i]] = '' res[destFieldsArr[i]] = ''
} }
@@ -158,58 +158,58 @@
this.$emit('input', '', res) this.$emit('input', '', res)
} }
}, },
callBack(rows) { callBack (rows) {
// update--begin--autor:lvdandan-----date:20200630------for多选时未带回多个值------ // update--begin--autor:lvdandan-----date:20200630------for多选时未带回多个值------
let orgFieldsArr = this.orgFields.split(',') const orgFieldsArr = this.orgFields.split(',')
let destFieldsArr = this.destFields.split(',') const destFieldsArr = this.destFields.split(',')
let resetText = false let resetText = false
if (this.field && this.field.length > 0) { if (this.field && this.field.length > 0) {
this.showText = '' this.showText = ''
resetText = true resetText = true
} }
let res = {} const res = {}
if (orgFieldsArr.length > 0) { if (orgFieldsArr.length > 0) {
for (let i = 0; i < orgFieldsArr.length; i++) { for (let i = 0; i < orgFieldsArr.length; i++) {
let tempDestArr = [] const tempDestArr = []
for(let rw of rows){ for (const rw of rows) {
let val = rw[orgFieldsArr[i]] let val = rw[orgFieldsArr[i]]
// update--begin--autor:liusq-----date:20210713------for处理val等于0的情况issues/I3ZL4T------ // update--begin--autor:liusq-----date:20210713------for处理val等于0的情况issues/I3ZL4T------
if(typeof val=='undefined'|| val==null || val.toString()==""){ if (typeof val === 'undefined' || val == null || val.toString() == '') {
val = "" val = ''
} }
// update--end--autor:liusq-----date:20210713------for处理val等于0的情况issues/I3ZL4T------ // update--end--autor:liusq-----date:20210713------for处理val等于0的情况issues/I3ZL4T------
tempDestArr.push(val) tempDestArr.push(val)
} }
res[destFieldsArr[i]] = tempDestArr.join(",") res[destFieldsArr[i]] = tempDestArr.join(',')
} }
if (resetText === true) { if (resetText === true) {
let tempText = [] const tempText = []
for(let rw of rows){ for (const rw of rows) {
let val = rw[orgFieldsArr[destFieldsArr.indexOf(this.field)]] let val = rw[orgFieldsArr[destFieldsArr.indexOf(this.field)]]
if(!val){ if (!val) {
val = "" val = ''
} }
tempText.push(val) tempText.push(val)
} }
this.showText = tempText.join(",") this.showText = tempText.join(',')
} }
// update--end--autor:lvdandan-----date:20200630------for多选时未带回多个值------ // update--end--autor:lvdandan-----date:20200630------for多选时未带回多个值------
} }
if (this.triggerChange) { if (this.triggerChange) {
//v-dec时即triggerChange为true时 将整个对象给form页面 让他自己setFieldsValue // v-dec时即triggerChange为true时 将整个对象给form页面 让他自己setFieldsValue
this.$emit('callback', res) this.$emit('callback', res)
} else { } else {
//v-model时 需要传一个参数field 表示当前这个字段 从而根据这个字段的顺序找到原始值 // v-model时 需要传一个参数field 表示当前这个字段 从而根据这个字段的顺序找到原始值
// this.$emit("input",row[orgFieldsArr[destFieldsArr.indexOf(this.field)]]) // this.$emit("input",row[orgFieldsArr[destFieldsArr.indexOf(this.field)]])
let str = '' let str = ''
if(this.showText){ if (this.showText) {
str = this.showText.split(',').join(this.spliter) str = this.showText.split(',').join(this.spliter)
} }
this.$emit('input', str, res) this.$emit('input', str, res)
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.components-input-demo-presuffix .anticon-close-circle { .components-input-demo-presuffix .anticon-close-circle {
@@ -17,78 +17,78 @@
</template> </template>
<script> <script>
//option {label:,value:} // option {label:,value:}
export default { export default {
name: 'JSelectMultiple', name: 'JSelectMultiple',
props: { props: {
placeholder:{ placeholder: {
type: String, type: String,
default:'', default: '',
required: false required: false
}, },
value:{ value: {
type: String, type: String,
required: false required: false
}, },
readOnly:{ readOnly: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
options:{ options: {
type: Array, type: Array,
required: true required: true
}, },
triggerChange:{ triggerChange: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
spliter:{ spliter: {
type: String, type: String,
required: false, required: false,
default: ',' default: ','
}, },
popContainer:{ popContainer: {
type:String, type: String,
default:'', default: '',
required:false required: false
},
},
data(){
return {
newOptions:[],
arrayValue:!this.value?[]:this.value.split(this.spliter) // arrayValue是已选中的数据
} }
}, },
watch:{ data () {
return {
newOptions: [],
arrayValue: !this.value ? [] : this.value.split(this.spliter) // arrayValue是已选中的数据
}
},
watch: {
value (val) { value (val) {
if(!val){ if (!val) {
this.arrayValue = [] this.arrayValue = []
}else{ } else {
this.arrayValue = this.value.split(this.spliter) this.arrayValue = this.value.split(this.spliter)
} }
} }
}, },
created(){ created () {
this.newOptions = this.options this.newOptions = this.options
}, },
methods:{ methods: {
onChange (selectedValue) { onChange (selectedValue) {
this.newOptions = this.options this.newOptions = this.options
if(this.triggerChange){ if (this.triggerChange) {
this.$emit('change', selectedValue.join(this.spliter)); this.$emit('change', selectedValue.join(this.spliter))
}else{ } else {
this.$emit('input', selectedValue.join(this.spliter)); this.$emit('input', selectedValue.join(this.spliter))
} }
}, },
getParentContainer(node){ getParentContainer (node) {
if(!this.popContainer){ if (!this.popContainer) {
return node.parentNode return node.parentNode
}else{ } else {
return document.querySelector(this.popContainer) return document.querySelector(this.popContainer)
} }
} }
},
} }
}
</script> </script>
+46 -46
View File
@@ -7,74 +7,74 @@
</template> </template>
<script> <script>
export default { export default {
name:"JSlider", name: 'JSlider',
data(){ data () {
return { return {
beginClientX:0, /*距离屏幕左端距离*/ beginClientX: 0, /* 距离屏幕左端距离 */
mouseMoveStata:false, /*触发拖动状态 判断*/ mouseMoveStata: false, /* 触发拖动状态 判断 */
maxwidth:'', /*拖动最大宽度,依据滑块宽度算出来的*/ maxwidth: '', /* 拖动最大宽度,依据滑块宽度算出来的 */
confirmWords:'拖动滑块验证', /*滑块文字*/ confirmWords: '拖动滑块验证', /* 滑块文字 */
confirmSuccess:false /*验证成功判断*/ confirmSuccess: false /* 验证成功判断 */
} }
}, },
methods: { methods: {
isSuccess(){ isSuccess () {
return this.confirmSuccess return this.confirmSuccess
}, },
mousedownFn:function (e) { mousedownFn: function (e) {
if(!this.confirmSuccess){ if (!this.confirmSuccess) {
e.preventDefault && e.preventDefault(); //阻止文字选中等 浏览器默认事件 e.preventDefault && e.preventDefault() // 阻止文字选中等 浏览器默认事件
this.mouseMoveStata = true; this.mouseMoveStata = true
this.beginClientX = e.clientX; this.beginClientX = e.clientX
} }
}, //mousedoen 事件 }, // mousedoen 事件
successFunction(){ successFunction () {
this.confirmSuccess = true this.confirmSuccess = true
this.confirmWords = '验证通过'; this.confirmWords = '验证通过'
if(window.addEventListener){ if (window.addEventListener) {
document.getElementsByTagName('html')[0].removeEventListener('mousemove',this.mouseMoveFn); document.getElementsByTagName('html')[0].removeEventListener('mousemove', this.mouseMoveFn)
document.getElementsByTagName('html')[0].removeEventListener('mouseup',this.moseUpFn); document.getElementsByTagName('html')[0].removeEventListener('mouseup', this.moseUpFn)
}else { } else {
document.getElementsByTagName('html')[0].removeEventListener('mouseup',()=>{}); document.getElementsByTagName('html')[0].removeEventListener('mouseup', () => {})
} }
document.getElementsByClassName('drag_text')[0].style.color = '#fff' document.getElementsByClassName('drag_text')[0].style.color = '#fff'
document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px'; document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px'; document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px'
this.$emit("onSuccess",true) this.$emit('onSuccess', true)
}, //验证成功函数 }, // 验证成功函数
mouseMoveFn(e){ mouseMoveFn (e) {
if(this.mouseMoveStata){ if (this.mouseMoveStata) {
let width = e.clientX - this.beginClientX; const width = e.clientX - this.beginClientX
if(width>0 && width<=this.maxwidth){ if (width > 0 && width <= this.maxwidth) {
document.getElementsByClassName('handler')[0].style.left = width + 'px'; document.getElementsByClassName('handler')[0].style.left = width + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = width + 'px'; document.getElementsByClassName('drag_bg')[0].style.width = width + 'px'
}else if(width>this.maxwidth){ } else if (width > this.maxwidth) {
this.successFunction(); this.successFunction()
} }
} }
}, //mousemove事件 }, // mousemove事件
moseUpFn(e){ moseUpFn (e) {
this.mouseMoveStata = false; this.mouseMoveStata = false
var width = e.clientX - this.beginClientX; var width = e.clientX - this.beginClientX
if(width<this.maxwidth){ if (width < this.maxwidth) {
// ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ---- // ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
let handler = document.getElementsByClassName('handler')[0] const handler = document.getElementsByClassName('handler')[0]
if (handler) { if (handler) {
handler.style.left = 0 + 'px' handler.style.left = 0 + 'px'
document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px' document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'
} }
// ---- update-end- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ---- // ---- update-end- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
} }
} //mouseup事件 } // mouseup事件
}, },
mounted(){ mounted () {
this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth; this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth
document.getElementsByTagName('html')[0].addEventListener('mousemove',this.mouseMoveFn); document.getElementsByTagName('html')[0].addEventListener('mousemove', this.mouseMoveFn)
document.getElementsByTagName('html')[0].addEventListener('mouseup',this.moseUpFn) document.getElementsByTagName('html')[0].addEventListener('mouseup', this.moseUpFn)
}
} }
}
</script> </script>
<style scoped> <style scoped>
+84 -86
View File
@@ -201,11 +201,9 @@
</a-tree> </a-tree>
</a-card> </a-card>
</a-col> </a-col>
</a-row> </a-row>
</a-spin> </a-spin>
<a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk"> <a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk">
@@ -217,16 +215,16 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import * as utils from '@/utils/util' import * as utils from '@/utils/util'
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import JDate from '@/components/jero/JDate.vue' import JDate from '@/components/jero/JDate.vue'
import JSelectDepart from '@/components/jerobiz/JSelectDepart' import JSelectDepart from '@/components/jerobiz/JSelectDepart'
import JSelectMultiUser from '@/components/jerobiz/JSelectMultiUser' import JSelectMultiUser from '@/components/jerobiz/JSelectMultiUser'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag' import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import JAreaLinkage from '@comp/jero/JAreaLinkage' import JAreaLinkage from '@comp/jero/JAreaLinkage'
export default { export default {
name: 'JSuperQuery', name: 'JSuperQuery',
mixins: [mixinDevice], mixins: [mixinDevice],
components: { JAreaLinkage, JMultiSelectTag, JDate, JSelectDepart, JSelectMultiUser }, components: { JAreaLinkage, JMultiSelectTag, JDate, JSelectDepart, JSelectMultiUser },
@@ -267,7 +265,7 @@
} }
}, },
data() { data () {
return { return {
moment, moment,
fieldTreeData: [], fieldTreeData: [],
@@ -286,30 +284,30 @@
saveCodeBefore: 'JSuperQuerySaved_', saveCodeBefore: 'JSuperQuerySaved_',
// 查询类型过滤条件匹配andor // 查询类型过滤条件匹配andor
matchType: 'and', matchType: 'and',
superQueryFlag: false, superQueryFlag: false
} }
}, },
computed: { computed: {
izMobile() { izMobile () {
return this.device === 'mobile' return this.device === 'mobile'
}, },
tooltipProps() { tooltipProps () {
return this.izMobile ? { visible: false } : {} return this.izMobile ? { visible: false } : {}
}, },
fullSaveCode() { fullSaveCode () {
let saveCode = this.saveCode let saveCode = this.saveCode
if (saveCode == null || saveCode === '') { if (saveCode == null || saveCode === '') {
saveCode = this.$route.fullPath saveCode = this.$route.fullPath
} }
return this.saveCodeBefore + saveCode return this.saveCodeBefore + saveCode
}, }
}, },
watch: { watch: {
// saveCode 变化时重新查询已保存的条件 // saveCode 变化时重新查询已保存的条件
fullSaveCode: { fullSaveCode: {
immediate: true, immediate: true,
handler() { handler () {
let list = this.$ls.get(this.fullSaveCode) const list = this.$ls.get(this.fullSaveCode)
if (list instanceof Array) { if (list instanceof Array) {
this.saveTreeData = list.map(i => this.renderSaveTreeData(i)) this.saveTreeData = list.map(i => this.renderSaveTreeData(i))
} }
@@ -318,17 +316,17 @@
fieldList: { fieldList: {
deep: true, deep: true,
immediate: true, immediate: true,
handler(val) { handler (val) {
let mainData = [], subData = [] const mainData = []; const subData = []
val.forEach(item => { val.forEach(item => {
let data = { ...item } const data = { ...item }
data.label = data.label || data.text data.label = data.label || data.text
let hasChildren = (data.children instanceof Array) const hasChildren = (data.children instanceof Array)
data.disabled = hasChildren data.disabled = hasChildren
data.selectable = !hasChildren data.selectable = !hasChildren
if (hasChildren) { if (hasChildren) {
data.children = data.children.map(item2 => { data.children = data.children.map(item2 => {
let child = { ...item2 } const child = { ...item2 }
child.label = child.label || child.text child.label = child.label || child.text
child.label = data.label + '-' + child.label child.label = data.label + '-' + child.label
child.value = data.value + ',' + child.value child.value = data.value + ',' + child.value
@@ -347,26 +345,26 @@
}, },
methods: { methods: {
show() { show () {
if (!this.queryParamsModel || this.queryParamsModel.length === 0) { if (!this.queryParamsModel || this.queryParamsModel.length === 0) {
this.resetLine() this.resetLine()
} }
this.visible = true this.visible = true
}, },
getDictInfo(item) { getDictInfo (item) {
let str = '' let str = ''
if(!item.dictTable){ if (!item.dictTable) {
str = item.dictCode str = item.dictCode
}else{ } else {
str = item.dictTable+','+item.dictText+','+item.dictCode str = item.dictTable + ',' + item.dictText + ',' + item.dictCode
} }
console.log('高级查询字典信息',str) console.log('高级查询字典信息', str)
return str return str
}, },
handleOk() { handleOk () {
if (!this.isNullArray(this.queryParamsModel)) { if (!this.isNullArray(this.queryParamsModel)) {
let event = { const event = {
matchType: this.matchType, matchType: this.matchType,
params: this.removeEmptyObject(this.queryParamsModel) params: this.removeEmptyObject(this.queryParamsModel)
} }
@@ -376,13 +374,13 @@
} }
this.emitCallback(event) this.emitCallback(event)
} else { } else {
this.$message.warn("不能查询空条件") this.$message.warn('不能查询空条件')
} }
}, },
emitCallback(event = {}) { emitCallback (event = {}) {
let { params = [], matchType = this.matchType } = event const { params = [], matchType = this.matchType } = event
this.superQueryFlag = (params && params.length > 0) this.superQueryFlag = (params && params.length > 0)
for (let param of params) { for (const param of params) {
if (Array.isArray(param.val)) { if (Array.isArray(param.val)) {
param.val = param.val.join(',') param.val = param.val.join(',')
} }
@@ -390,50 +388,50 @@
console.debug('---高级查询参数--->', { params, matchType }) console.debug('---高级查询参数--->', { params, matchType })
this.$emit(this.callback, params, matchType) this.$emit(this.callback, params, matchType)
}, },
handleCancel() { handleCancel () {
this.close() this.close()
}, },
close() { close () {
this.$emit('close') this.$emit('close')
this.visible = false this.visible = false
}, },
handleAdd() { handleAdd () {
this.addNewLine() this.addNewLine()
}, },
addNewLine() { addNewLine () {
this.queryParamsModel.push({ rule: 'eq' }) this.queryParamsModel.push({ rule: 'eq' })
}, },
resetLine() { resetLine () {
this.superQueryFlag = false this.superQueryFlag = false
this.queryParamsModel = [] this.queryParamsModel = []
this.addNewLine() this.addNewLine()
}, },
handleDel(index) { handleDel (index) {
this.queryParamsModel.splice(index, 1) this.queryParamsModel.splice(index, 1)
}, },
handleSelected(node, item) { handleSelected (node, item) {
let { type, dbType, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef const { type, dbType, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef
item['type'] = type item.type = type
item['dbType'] = dbType item.dbType = dbType
item['options'] = options item.options = options
item['dictCode'] = dictCode item.dictCode = dictCode
item['dictTable'] = dictTable item.dictTable = dictTable
item['dictText'] = dictText item.dictText = dictText
item['customReturnField'] = customReturnField item.customReturnField = customReturnField
if (popup) { if (popup) {
item['popup'] = popup item.popup = popup
} }
this.$set(item, 'val', undefined) this.$set(item, 'val', undefined)
}, },
handleOpen() { handleOpen () {
this.show() this.show()
}, },
handleReset() { handleReset () {
this.resetLine() this.resetLine()
this.emitCallback() this.emitCallback()
}, },
handleSave() { handleSave () {
let queryParams = this.removeEmptyObject(this.queryParamsModel) const queryParams = this.removeEmptyObject(this.queryParamsModel)
if (this.isNullArray(queryParams)) { if (this.isNullArray(queryParams)) {
this.$message.warning('空条件不能保存') this.$message.warning('空条件不能保存')
} else { } else {
@@ -441,16 +439,16 @@
this.prompt.visible = true this.prompt.visible = true
} }
}, },
handlePromptOk() { handlePromptOk () {
let { value } = this.prompt const { value } = this.prompt
if(!value){ if (!value) {
this.$message.warning('保存名称不能为空') this.$message.warning('保存名称不能为空')
return 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) { if (filterList.length > 0) {
this.$confirm({ this.$confirm({
content: `${value} 已存在是否覆盖`, content: `${value} 已存在是否覆盖`,
@@ -475,41 +473,41 @@
this.$message.success('保存成功') this.$message.success('保存成功')
} }
}, },
handleTreeSelect(idx, event) { handleTreeSelect (idx, event) {
if (event.selectedNodes[0]) { if (event.selectedNodes[0]) {
let { matchType, records } = event.selectedNodes[0].data.props const { matchType, records } = event.selectedNodes[0].data.props
// 将保存的matchType取出兼容旧数据如果没有保存就还是使用原来的 // 将保存的matchType取出兼容旧数据如果没有保存就还是使用原来的
this.matchType = matchType || this.matchType this.matchType = matchType || this.matchType
this.queryParamsModel = utils.cloneObject(records) this.queryParamsModel = utils.cloneObject(records)
} }
}, },
handleRemoveSaveTreeItem(event, vNode) { handleRemoveSaveTreeItem (event, vNode) {
// 阻止事件冒泡 // 阻止事件冒泡
event.stopPropagation() event.stopPropagation()
this.$confirm({ this.$confirm({
content: '是否删除当前查询', content: '是否删除当前查询',
onOk: () => { onOk: () => {
let { eventKey } = vNode const { eventKey } = vNode
this.saveTreeData.splice(Number.parseInt(eventKey.substring(2)), 1) this.saveTreeData.splice(Number.parseInt(eventKey.substring(2)), 1)
this.saveToLocalStore() this.saveToLocalStore()
}, }
}) })
}, },
// 将查询保存到 LocalStore // 将查询保存到 LocalStore
saveToLocalStore() { 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) this.$ls.set(this.fullSaveCode, saveValue)
}, },
isNullArray(array) { isNullArray (array) {
//判断是不是空数组对象 // 判断是不是空数组对象
if (!array || array.length === 0) { if (!array || array.length === 0) {
return true return true
} }
if (array.length === 1) { if (array.length === 1) {
let obj = array[0] const obj = array[0]
if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) { if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) {
return true return true
} }
@@ -517,18 +515,18 @@
return false return false
}, },
// 去掉数组中的空对象 // 去掉数组中的空对象
removeEmptyObject(arr) { removeEmptyObject (arr) {
let array = utils.cloneObject(arr) const array = utils.cloneObject(arr)
for (let i = 0; i < array.length; i++) { for (let i = 0; i < array.length; i++) {
let item = array[i] const item = array[i]
if (item == null || Object.keys(item).length <= 0) { if (item == null || Object.keys(item).length <= 0) {
array.splice(i--, 1) array.splice(i--, 1)
} else { } else {
if (Array.isArray(item.options)) { if (Array.isArray(item.options)) {
// 如果有字典属性就不需要保存 options // 如果有字典属性就不需要保存 options
//update-begin-author:taoyan date:20200819 for:开源问题 高级查询 下拉框作为并且选项很多多多 LOWCOD-779 // update-begin-author:taoyan date:20200819 for:开源问题 高级查询 下拉框作为并且选项很多多多 LOWCOD-779
delete item.options delete item.options
//update-end-author:taoyan date:20200819 for:开源问题 高级查询 下拉框作为并且选项很多多多 LOWCOD-779 // update-end-author:taoyan date:20200819 for:开源问题 高级查询 下拉框作为并且选项很多多多 LOWCOD-779
} }
} }
} }
@@ -536,9 +534,9 @@
}, },
/** 渲染保存查询条件的 title(加个删除按钮) */ /** 渲染保存查询条件的 title(加个删除按钮) */
renderSaveTreeData(item) { renderSaveTreeData (item) {
item.icon = this.treeIcon item.icon = this.treeIcon
item.originTitle = item['title'] item.originTitle = item.title
item.title = (arg1, arg2) => { item.title = (arg1, arg2) => {
let vNode let vNode
// 兼容旧版的Antdv // 兼容旧版的Antdv
@@ -549,7 +547,7 @@
} else { } else {
return <span style="color:red;">Antdv版本不支持</span> return <span style="color:red;">Antdv版本不支持</span>
} }
let {originTitle} = vNode.dataRef const { originTitle } = vNode.dataRef
return ( return (
<div class="j-history-tree-title"> <div class="j-history-tree-title">
<span>{originTitle}</span> <span>{originTitle}</span>
@@ -564,12 +562,12 @@
}, },
/** 判断是否允许多选 */ /** 判断是否允许多选 */
allowMultiple(item) { allowMultiple (item) {
return item.rule === 'in' return item.rule === 'in'
}, },
handleRuleChange(item, newValue) { handleRuleChange (item, newValue) {
let oldValue = item.rule const oldValue = item.rule
this.$set(item, 'rule', newValue) this.$set(item, 'rule', newValue)
// 上一个规则是否是 in且type是字典或下拉 // 上一个规则是否是 in且type是字典或下拉
if (oldValue === 'in') { if (oldValue === 'in') {
@@ -585,12 +583,12 @@
} }
}, },
handleChangeJPopup(item, e, values) { handleChangeJPopup (item, e, values) {
item.val = values[item.popup['destFields']] item.val = values[item.popup.destFields]
}, }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
+35 -36
View File
@@ -20,24 +20,24 @@
</template> </template>
<script> <script>
export default { export default {
name: 'JSwitch', name: 'JSwitch',
props: { props: {
value:{ value: {
type: String | Number, type: String | Number,
required: false required: false
}, },
disabled:{ disabled: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
options:{ options: {
type:Array, type: Array,
required:false, required: false,
default:()=>['Y','N'] default: () => ['Y', 'N']
}, },
query:{ query: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
@@ -48,55 +48,54 @@
checkStatus: false checkStatus: false
} }
}, },
computed:{ computed: {
queryOption(){ queryOption () {
let arr = [] const arr = []
arr.push({value:this.options[0],text:'是'}) arr.push({ value: this.options[0], text: '是' })
arr.push({value:this.options[1],text:'否'}) arr.push({ value: this.options[1], text: '否' })
return arr; return arr
}, },
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch: { watch: {
value:{ value: {
immediate: true, immediate: true,
handler(val){ handler (val) {
if(!this.query){ if (!this.query) {
if(!val){ if (!val) {
this.checkStatus = false this.checkStatus = false
this.$emit('change', this.options[1]); this.$emit('change', this.options[1])
}else{ } else {
if(this.options[0]==val){ if (this.options[0] == val) {
this.checkStatus = true this.checkStatus = true
}else{ } else {
this.checkStatus = false this.checkStatus = false
} }
} }
} }
} }
} }
}, },
methods: { methods: {
handleChange(checked){ handleChange (checked) {
let flag = checked===false?this.options[1]:this.options[0]; const flag = checked === false ? this.options[1] : this.options[0]
this.$emit('change', flag); this.$emit('change', flag)
}, },
handleSelectChange(value){ handleSelectChange (value) {
this.$emit('change', value); this.$emit('change', value)
} }
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
+58 -57
View File
@@ -67,9 +67,9 @@
<script> <script>
import get from 'lodash.get' import get from 'lodash.get'
const LEFT_FROZEN = 1; // 1为左侧冻结 const LEFT_FROZEN = 1 // 1为左侧冻结
const RIGHT_FROZEN = 2; // 2为右侧冻结 const RIGHT_FROZEN = 2 // 2为右侧冻结
const NO_FROZEN = 3; // 3为不冻结或解冻 const NO_FROZEN = 3 // 3为不冻结或解冻
export default { export default {
name: 'JTable', name: 'JTable',
@@ -89,33 +89,33 @@ export default {
}, },
isShowPage: { isShowPage: {
type: Boolean, type: Boolean,
default() { default () {
return true return true
}, }
}, },
isCheck: { isCheck: {
type: Boolean, type: Boolean,
default() { default () {
return true return true
}, }
}, },
isShowDropdown: { isShowDropdown: {
type: Boolean, type: Boolean,
default() { default () {
return true return true
}, }
}, },
rowSelection: { rowSelection: {
type: Object, type: Object,
default() { default () {
return { return {
type: 'checkbox', type: 'checkbox'
}
} }
},
}, },
pagination: { pagination: {
type: Object, type: Object,
default() { default () {
return { return {
current: 1, current: 1,
pageSize: 10, pageSize: 10,
@@ -127,43 +127,43 @@ export default {
return range[0] + '-' + range[1] + ' ' + total + '条' return range[0] + '-' + range[1] + ' ' + total + '条'
} }
} }
}
}
}, },
}, data () {
},
data() {
return { return {
key: "customer_cloumns_" + this.$route.path, // 存储当前列表的用户存储信息 key: 'customer_cloumns_' + this.$route.path, // 存储当前列表的用户存储信息
defaultOperationKey: "action", // 操作列dataIndex=action不作相关处理默认去除 defaultOperationKey: 'action', // 操作列dataIndex=action不作相关处理默认去除
usedSlots: [], // 内部使用的 slots 不再处理 usedSlots: [], // 内部使用的 slots 不再处理
needTotalList: [], needTotalList: [],
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
curTableColumns: this.columns, curTableColumns: this.columns,
checkedList: [], checkedList: [],
plainOptions: [], //筛选显示的列头数组 plainOptions: [], // 筛选显示的列头数组
radioStyle: { radioStyle: {
display: 'block', display: 'block',
height: '30px', height: '30px',
lineHeight: '30px', lineHeight: '30px'
}, }
} }
}, },
computed: { computed: {
rowSelect() { rowSelect () {
if (this.isCheck) { if (this.isCheck) {
return this.rowSelection return this.rowSelection
} else { } else {
return null return null
} }
}, },
ispagination() { ispagination () {
if (this.isShowPage) { if (this.isShowPage) {
return this.pagination return this.pagination
} else { } else {
return false return false
} }
}, },
isShowIcon() { isShowIcon () {
if (this.isShowDropdown) { if (this.isShowDropdown) {
return true return true
} else { } else {
@@ -171,26 +171,26 @@ export default {
} }
}, },
// 获取插槽信息 // 获取插槽信息
scopedSlotsKeys() { scopedSlotsKeys () {
return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key)) return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key))
}, },
// 需要插槽处理的列的信息 // 需要插槽处理的列的信息
columnsSlot() { columnsSlot () {
let a= this.curTableColumns.filter( const a = this.curTableColumns.filter(
item => item.slots item => item.slots
); )
console.log(a) console.log(a)
return a return a
} }
}, },
mounted() { mounted () {
// 遍历出筛选列头的所有选项 // 遍历出筛选列头的所有选项
this.columns.forEach((item) => { this.columns.forEach((item) => {
if (item.slots && item.slots.title){ if (item.slots && item.slots.title) {
let colItem = { const colItem = {
value: item.slots.title, value: item.slots.title,
label: item.slots.title, label: item.slots.title,
disabled: false, disabled: false
} }
this.plainOptions.push(colItem) this.plainOptions.push(colItem)
} }
@@ -204,7 +204,7 @@ export default {
} }
// 遍历出筛选列头中的已选项 // 遍历出筛选列头中的已选项
this.curTableColumns.forEach((item) => { this.curTableColumns.forEach((item) => {
if (item.slots && item.slots.title){ if (item.slots && item.slots.title) {
this.checkedList.push(item.slots.title) this.checkedList.push(item.slots.title)
} else if (item.title) { } else if (item.title) {
this.checkedList.push(item.title) this.checkedList.push(item.title)
@@ -212,14 +212,14 @@ export default {
}) })
console.log(this.checkedList) console.log(this.checkedList)
}, },
created() { created () {
this.needTotalList = this.initTotalList(this.columns) this.needTotalList = this.initTotalList(this.columns)
console.log(this.$route.path) console.log(this.$route.path)
console.log(this.key) console.log(this.key)
}, },
methods: { methods: {
// 用户可自行筛选列头显示的字段 // 用户可自行筛选列头显示的字段
onChange(e) { onChange (e) {
// 只剩一个时候,最后一个多选按钮禁用 // 只剩一个时候,最后一个多选按钮禁用
if (this.checkedList.length === 1) { if (this.checkedList.length === 1) {
this.plainOptions.forEach((item) => { this.plainOptions.forEach((item) => {
@@ -233,10 +233,10 @@ export default {
}) })
} }
let trfList = [] //将中文转换为dataIndex const trfList = [] // 将中文转换为dataIndex
let initList = [] //最初始list const initList = [] // 最初始list
let diffList = [] //两个数组不同 let diffList = [] // 两个数组不同
//转换为dataIndex // 转换为dataIndex
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.columns.find((item) => { this.columns.find((item) => {
if (item.slots && item.slots.title === e[i]) { if (item.slots && item.slots.title === e[i]) {
@@ -264,19 +264,19 @@ export default {
} }
}, },
// 比较两个数组之间的不同,生成新数组 // 比较两个数组之间的不同,生成新数组
getArrDifference(arr1, arr2) { getArrDifference (arr1, arr2) {
let that = this; const that = this
return arr1.concat(arr2).filter(function (v, i, arr) { return arr1.concat(arr2).filter(function (v, i, arr) {
if (v !== that.defaultOperationKey){ if (v !== that.defaultOperationKey) {
return arr.indexOf(v) === arr.lastIndexOf(v) return arr.indexOf(v) === arr.lastIndexOf(v)
} else { } else {
return false; return false
} }
}) })
}, },
fixedChange(e, dataIndex) { fixedChange (e, dataIndex) {
if (e.target.value === LEFT_FROZEN) { if (e.target.value === LEFT_FROZEN) {
//左侧冻结 // 左侧冻结
this.curTableColumns.find((item) => { this.curTableColumns.find((item) => {
if (item.dataIndex === dataIndex) { if (item.dataIndex === dataIndex) {
item.fixed = 'left' item.fixed = 'left'
@@ -292,7 +292,7 @@ export default {
// } // }
// this.curTableColumns.unshift(arr[0]) // this.curTableColumns.unshift(arr[0])
} else if (e.target.value === RIGHT_FROZEN) { } else if (e.target.value === RIGHT_FROZEN) {
//右侧冻结 // 右侧冻结
this.curTableColumns.find((item) => { this.curTableColumns.find((item) => {
if (item.dataIndex === dataIndex) { if (item.dataIndex === dataIndex) {
item.fixed = 'right' item.fixed = 'right'
@@ -309,7 +309,7 @@ export default {
// this.curTableColumns.push(arr[0]) // this.curTableColumns.push(arr[0])
} else { } else {
this.curTableColumns.find((item) => { this.curTableColumns.find((item) => {
//解冻 // 解冻
if (item.dataIndex === dataIndex) { if (item.dataIndex === dataIndex) {
item.fixed = false item.fixed = false
} }
@@ -318,10 +318,10 @@ export default {
} }
}, },
// 列头重新排序 // 列头重新排序
diffColunms() { diffColunms () {
let newColumnsList = [] //没有fixed属性的List const newColumnsList = [] // 没有fixed属性的List
let newFixedLeftList = [] //fixed=left的List const newFixedLeftList = [] // fixed=left的List
let newFixedRightList = [] //fixed=right的List const newFixedRightList = [] // fixed=right的List
this.curTableColumns.forEach((item) => { this.curTableColumns.forEach((item) => {
if (!item.fixed) { if (!item.fixed) {
newColumnsList.push(item) newColumnsList.push(item)
@@ -350,29 +350,30 @@ export default {
}, },
updateSelect (selectedRowKeys, selectedRows) { updateSelect (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
let list = this.needTotalList const list = this.needTotalList
this.needTotalList = list.map(item => { this.needTotalList = list.map(item => {
return { return {
...item, ...item,
total: selectedRows.reduce((sum, val) => { total: selectedRows.reduce((sum, val) => {
let total = sum + get(val, item.dataIndex) const total = sum + get(val, item.dataIndex)
return isNaN(total) ? 0 : total return isNaN(total) ? 0 : total
}, 0) }, 0)
} }
}) })
}, },
initTotalList(columns) { initTotalList (columns) {
const totalList = [] const totalList = []
columns && columns instanceof Array && columns.forEach(column => { columns && columns instanceof Array && columns.forEach(column => {
if (column.needTotal) { if (column.needTotal) {
totalList.push({ ...column, totalList.push({
...column,
total: 0 total: 0
}) })
} }
}) })
return totalList return totalList
}, }
}, }
} }
</script> </script>
+24 -24
View File
@@ -11,30 +11,30 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'JTime', name: 'JTime',
props: { props: {
placeholder:{ placeholder: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
value:{ value: {
type: String, type: String,
required: false required: false
}, },
dateFormat:{ dateFormat: {
type: String, type: String,
default: 'HH:mm:ss', default: 'HH:mm:ss',
required: false required: false
}, },
readOnly:{ readOnly: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, },
disabled:{ disabled: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
@@ -45,44 +45,44 @@
} }
}, },
data () { data () {
let timeStr = this.value; const timeStr = this.value
return { return {
decorator:"", decorator: '',
momVal:!timeStr?null:moment(timeStr,this.dateFormat) momVal: !timeStr ? null : moment(timeStr, this.dateFormat)
} }
}, },
computed: { computed: {
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
watch: { watch: {
value (val) { value (val) {
if(!val){ if (!val) {
this.momVal = null this.momVal = null
}else{ } else {
this.momVal = moment(val,this.dateFormat) this.momVal = moment(val, this.dateFormat)
} }
} }
}, },
methods: { methods: {
moment, moment,
handleTimeChange(mom,timeStr){ handleTimeChange (mom, timeStr) {
this.$emit('change', timeStr); this.$emit('change', timeStr)
} }
}, },
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼 // 2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style scoped> <style scoped>
+91 -91
View File
@@ -17,94 +17,94 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
export default { export default {
name: 'JTreeDict', name: 'JTreeDict',
data(){ data () {
return { return {
treeData:[], treeData: [],
treeValue: null, treeValue: null,
url_root:"/sys/category/loadTreeRoot", url_root: '/sys/category/loadTreeRoot',
url_children:"/sys/category/loadTreeChildren", url_children: '/sys/category/loadTreeChildren',
url_view:'/sys/category/loadOne', url_view: '/sys/category/loadOne'
} }
}, },
props:{ props: {
value:{ value: {
// type: String, // type: String,
required: false required: false
}, },
placeholder:{ placeholder: {
type: String, type: String,
default: '请选择', default: '请选择',
required: false required: false
}, },
parentCode:{ parentCode: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
field:{ field: {
type: String, type: String,
default: 'id', default: 'id',
required: false required: false
}, },
root:{ root: {
type:Object, type: Object,
required:false, required: false,
default:()=>{ default: () => {
return { return {
pid:'0' pid: '0'
} }
} }
}, },
async:{ async: {
type:Boolean, type: Boolean,
default:false, default: false,
required:false required: false
}, },
disabled:{ disabled: {
type:Boolean, type: Boolean,
default:false, default: false,
required:false required: false
} }
}, },
watch:{ watch: {
root:{ root: {
handler(val){ handler (val) {
console.log("root-change",val) console.log('root-change', val)
}, },
deep:true deep: true
}, },
parentCode:{ parentCode: {
handler(){ handler () {
this.loadRoot() this.loadRoot()
} }
}, },
value:{ value: {
handler(){ handler () {
this.loadViewInfo() this.loadViewInfo()
} }
} }
}, },
computed:{ computed: {
_attrs(){ _attrs () {
let attrs let attrs
attrs = { ...this.$attrs } attrs = { ...this.$attrs }
return attrs return attrs
}, },
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
created(){ created () {
this.loadRoot() this.loadRoot()
this.loadViewInfo() this.loadViewInfo()
}, },
@@ -112,42 +112,42 @@
prop: 'value', prop: 'value',
event: 'change' event: 'change'
}, },
methods:{ methods: {
loadViewInfo(){ loadViewInfo () {
if(!this.value || this.value=="0"){ if (!this.value || this.value == '0') {
this.treeValue = null this.treeValue = null
}else{ } else {
let param = { const param = {
field:this.field, field: this.field,
val:this.value val: this.value
} }
getAction(this.url_view,param).then(res=>{ getAction(this.url_view, param).then(res => {
if(res.success){ if (res.success) {
this.treeValue = { this.treeValue = {
value:this.value, value: this.value,
label:res.result.name label: res.result.name
} }
} }
}) })
} }
}, },
loadRoot(){ loadRoot () {
let param = { const param = {
async:this.async, async: this.async,
pcode:this.parentCode pcode: this.parentCode
} }
getAction(this.url_root,param).then(res=>{ getAction(this.url_root, param).then(res => {
if(res.success){ if (res.success) {
this.handleTreeNodeValue(res.result) this.handleTreeNodeValue(res.result)
this.treeData = [...res.result] this.treeData = [...res.result]
}else{ } else {
this.$message.error(res.message) this.$message.error(res.message)
} }
}) })
}, },
asyncLoadTreeData (treeNode) { asyncLoadTreeData (treeNode) {
return new Promise((resolve) => { return new Promise((resolve) => {
if(!this.async){ if (!this.async) {
resolve() resolve()
return return
} }
@@ -155,64 +155,64 @@
resolve() resolve()
return return
} }
let pid = treeNode.$vnode.key const pid = treeNode.$vnode.key
let param = { const param = {
pid:pid pid: pid
} }
getAction(this.url_children,param).then(res=>{ getAction(this.url_children, param).then(res => {
if(res.success){ if (res.success) {
this.handleTreeNodeValue(res.result) this.handleTreeNodeValue(res.result)
this.addChildren(pid,res.result,this.treeData) this.addChildren(pid, res.result, this.treeData)
this.treeData = [...this.treeData] this.treeData = [...this.treeData]
} }
resolve() resolve()
}) })
}) })
}, },
addChildren(pid,children,treeArray){ addChildren (pid, children, treeArray) {
if(treeArray && treeArray.length>0){ if (treeArray && treeArray.length > 0) {
for(let item of treeArray){ for (const item of treeArray) {
if(item.key == pid){ if (item.key == pid) {
if(!children || children.length==0){ if (!children || children.length == 0) {
item.leaf = true item.leaf = true
}else{ } else {
item.children = children item.children = children
} }
break break
}else{ } else {
this.addChildren(pid,children,item.children) this.addChildren(pid, children, item.children)
} }
} }
} }
}, },
handleTreeNodeValue(result){ handleTreeNodeValue (result) {
let storeField = this.field=='code'?'code':'key' const storeField = this.field == 'code' ? 'code' : 'key'
for(let i of result){ for (const i of result) {
i.value = i[storeField] i.value = i[storeField]
i.isLeaf = (!i.leaf)?false:true i.isLeaf = !(!i.leaf)
if(i.children && i.children.length>0){ if (i.children && i.children.length > 0) {
this.handleTreeNodeValue(i.children) this.handleTreeNodeValue(i.children)
} }
} }
}, },
onChange(value){ onChange (value) {
if(!value){ if (!value) {
/* /*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍 * 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍
* 解决办法改变选中时提交的事件名*/ * 解决办法改变选中时提交的事件名 */
this.$emit('change', ''); this.$emit('change', '')
}else{ } else {
this.$emit('change', value.value); this.$emit('change', value.value)
} }
this.treeValue = value this.treeValue = value
}, },
onSearch(value){ onSearch (value) {
console.log(value) console.log(value)
}, },
getCurrTreeData(){ getCurrTreeData () {
return this.treeData return this.treeData
} }
} }
} }
</script> </script>
+145 -145
View File
@@ -39,300 +39,300 @@
</template> </template>
<script> <script>
/* /*
* 异步树加载组件 通过传入表名 显示字段 存储字段 加载一个树控件 * 异步树加载组件 通过传入表名 显示字段 存储字段 加载一个树控件
* <j-tree-select dict="aa_tree_test,aad,id" pid-field="pid" ></j-tree-select> * <j-tree-select dict="aa_tree_test,aad,id" pid-field="pid" ></j-tree-select>
* */ * */
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
export default { export default {
name: 'JTreeSelect', name: 'JTreeSelect',
props: { props: {
isAsync:{ // 是否采用异步方式初始化树 isAsync: { // 是否采用异步方式初始化树
type:Boolean, type: Boolean,
required:false, required: false,
default:true default: true
}, },
value:{ value: {
// type: String, // type: String,
required: false required: false
}, },
placeholder:{ placeholder: {
type: String, type: String,
default: '请选择', default: '请选择',
required: false required: false
}, },
dict:{ dict: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
pidField:{ pidField: {
type: String, type: String,
default: 'pid', default: 'pid',
required: false required: false
}, },
pidValue:{ pidValue: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
disabled:{ disabled: {
type:Boolean, type: Boolean,
default:false, default: false,
required:false required: false
}, },
hasChildField:{ hasChildField: {
type: String, type: String,
default: '', default: '',
required: false required: false
}, },
condition:{ condition: {
type:String, type: String,
default:'', default: '',
required:false required: false
}, },
// 是否支持多选 // 是否支持多选
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
loadTriggleChange:{ loadTriggleChange: {
type: Boolean, type: Boolean,
default: false, default: false,
required:false required: false
} }
}, },
data () { data () {
return { return {
treeValue: null, // 选中的数据 treeValue: null, // 选中的数据
treeData:[],// 渲染树的数组 treeData: [], // 渲染树的数组
url:"/sys/dict/loadTreeData", url: '/sys/dict/loadTreeData',
view:'/sys/dict/loadDictItem/', view: '/sys/dict/loadDictItem/',
tableName:"", tableName: '',
text:"", text: '',
code:"", code: ''
} }
}, },
watch: { watch: {
value () { value () {
this.loadItemByCode() this.loadItemByCode()
}, },
dict(){ dict () {
this.initDictInfo() this.initDictInfo()
this.loadRoot() this.loadRoot()
} }
}, },
computed:{ computed: {
_attrs() { _attrs () {
let attrs let attrs
attrs = { ...this.$attrs } attrs = { ...this.$attrs }
return attrs return attrs
}, },
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
} }
}, },
created(){ created () {
this.validateProp().then(()=>{ this.validateProp().then(() => {
this.initDictInfo() this.initDictInfo()
this.loadRoot() this.loadRoot()
this.loadItemByCode() this.loadItemByCode()
}) })
}, },
mounted(){ mounted () {
window.that = this window.that = this
}, },
methods: { methods: {
loadItemByCode(){ loadItemByCode () {
if( !this.value || this.value == "0" ){ if (!this.value || this.value == '0') {
this.treeValue = null this.treeValue = null
}else{ } else {
getAction(`${this.view}${this.dict}`,{key:this.value}).then(res=>{ getAction(`${this.view}${this.dict}`, { key: this.value }).then(res => {
if(res.success){ if (res.success) {
let values = this.value.split(',') const values = this.value.split(',')
this.treeValue = values // v-model接收的是string || string[] this.treeValue = values // v-model接收的是string || string[]
//将节点名称显示在选择框上 // 将节点名称显示在选择框上
this.treeValue = res.result[0] this.treeValue = res.result[0]
this.onLoadTriggleChange(res.result[0]); this.onLoadTriggleChange(res.result[0])
} }
}) })
} }
}, },
onLoadTriggleChange(text){ onLoadTriggleChange (text) {
//只有单选才会触发 // 只有单选才会触发
if(!this.multiple && this.loadTriggleChange){ if (!this.multiple && this.loadTriggleChange) {
this.$emit('change', this.value,text) this.$emit('change', this.value, text)
} }
}, },
initDictInfo(){ //取出父组件传过来的codetexttableName initDictInfo () { // 取出父组件传过来的codetexttableName
let arr = this.dict.split(",") const arr = this.dict.split(',')
this.tableName = arr[0] this.tableName = arr[0]
this.text = arr[1] this.text = arr[1]
this.code = arr[2] this.code = arr[2]
}, },
//异步加载树节点 // 异步加载树节点
asyncLoadTreeData (treeNode) { asyncLoadTreeData (treeNode) {
return new Promise((resolve) => { return new Promise((resolve) => {
if (treeNode.$vnode.children) { if (treeNode.$vnode.children) {
resolve() resolve()
return return
} }
let pid = treeNode.$vnode.key const pid = treeNode.$vnode.key
let param = { const param = {
pid:pid, pid: pid,
tableName:this.tableName, tableName: this.tableName,
text:this.text, text: this.text,
code:this.code, code: this.code,
pidField:this.pidField, pidField: this.pidField,
hasChildField:this.hasChildField, hasChildField: this.hasChildField,
condition:this.condition condition: this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url, param).then(res => {
if(res.success){ if (res.success) {
for(let i of res.result){ for (const i of res.result) {
i.value = i.key i.value = i.key
if(i.leaf==false){ if (i.leaf == false) {
i.isLeaf=false i.isLeaf = false
}else if(i.leaf==true){ } else if (i.leaf == true) {
i.isLeaf=true i.isLeaf = true
} }
} }
this.addChildren(pid,res.result,this.treeData) this.addChildren(pid, res.result, this.treeData)
this.treeData = [...this.treeData] this.treeData = [...this.treeData]
} }
resolve() resolve()
}) })
}) })
}, },
addChildren(pid,children,treeArray){ addChildren (pid, children, treeArray) {
if(treeArray && treeArray.length>0){ if (treeArray && treeArray.length > 0) {
for(let item of treeArray){ for (const item of treeArray) {
if(item.key == pid){ //找到当前元素所在的父节点 if (item.key == pid) { // 找到当前元素所在的父节点
if(!children || children.length==0){ if (!children || children.length == 0) {
item.isLeaf=true item.isLeaf = true
}else{ } else {
item.children = children // 搜索出来的children添加到原树子children item.children = children // 搜索出来的children添加到原树子children
} }
break break
}else{ } else {
this.addChildren(pid,children,item.children) this.addChildren(pid, children, item.children)
} }
} }
} }
}, },
/** /**
* 初始化树 * 初始化树
* isAsynctrue===异步获取 false===同步获取数据 默认异步*/ * isAsynctrue===异步获取 false===同步获取数据 默认异步 */
loadRoot(){ loadRoot () {
if (this.isAsync){ if (this.isAsync) {
let param = { const param = {
pid:this.pidValue, pid: this.pidValue,
tableName:this.tableName, tableName: this.tableName,
text:this.text, text: this.text,
code:this.code, code: this.code,
pidField:this.pidField, pidField: this.pidField,
hasChildField:this.hasChildField, hasChildField: this.hasChildField,
condition:this.condition condition: this.condition
} }
getAction(this.url,param).then(res=>{ getAction(this.url, param).then(res => {
if(res.success && res.result){ if (res.success && res.result) {
for(let i of res.result){ for (const i of res.result) {
i.value = i.key i.value = i.key
if(i.leaf==false){ if (i.leaf == false) {
i.isLeaf=false i.isLeaf = false
}else if(i.leaf==true){ } else if (i.leaf == true) {
i.isLeaf=true i.isLeaf = true
} }
} }
this.treeData = [...res.result] this.treeData = [...res.result]
}else{ } else {
console.log("数根节点查询结果-else",res) console.log('数根节点查询结果-else', res)
} }
}) })
}else{ } else {
//同步 // 同步
let param = { const param = {
code:this.code, code: this.code,
pidField:this.pidField, pidField: this.pidField,
tableName:this.tableName, tableName: this.tableName,
text:this.text text: this.text
} }
getAction('/sys/dict/queryAllTreeData',param).then((res)=>{ getAction('/sys/dict/queryAllTreeData', param).then((res) => {
if (res.success){ if (res.success) {
this.treeData = deepFor(res.result) this.treeData = deepFor(res.result)
} }
}) })
} }
}, },
onChange(value){ onChange (value) {
if(!value){ if (!value) {
/* /*
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍 * 使用$listeners向上暴露事件---和$emit一起使用出现的问题change事件会执行两遍
* 解决办法改变选中时提交的事件名*/ * 解决办法改变选中时提交的事件名 */
this.$emit('change', ''); this.$emit('change', '')
this.treeValue = null this.treeValue = null
} else if (value instanceof Array) { } else if (value instanceof Array) {
//多选 // 多选
this.$emit('change', value.join(',').toString()) //修改第一次选中时选中为空的情况 this.$emit('change', value.join(',').toString()) // 修改第一次选中时选中为空的情况
this.treeValue = value this.treeValue = value
} else { } else {
//单选 // 单选
this.$emit('change', value) this.$emit('change', value)
this.treeValue = value this.treeValue = value
} }
}, },
getCurrTreeData(){ getCurrTreeData () {
return this.treeData return this.treeData
}, },
validateProp(){ validateProp () {
let myCondition = this.condition const myCondition = this.condition
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => {
if(!myCondition){ if (!myCondition) {
resolve();
}else{
try {
let test=JSON.parse(myCondition);
if(typeof test == 'object' && test){
resolve() resolve()
}else{ } 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() reject()
} }
} catch(e) { } catch (e) {
this.$message.error("组件JTreeSelect-condition传值有误需要一个json字符串!") this.$message.error('组件JTreeSelect-condition传值有误需要一个json字符串!')
reject() reject()
} }
} }
}) })
} }
}, },
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 // 2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
//递归整个树判断是否是叶子节点----同步获取数据时用到 // 递归整个树判断是否是叶子节点----同步获取数据时用到
function deepFor(source){ function deepFor (source) {
for(let i of source){ for (const i of source) {
i.value = i.key i.value = i.key
if(i.leaf==false){ if (i.leaf == false) {
i.isLeaf=false i.isLeaf = false
}else if(i.leaf==true){ } else if (i.leaf == true) {
i.isLeaf=true i.isLeaf = true
} }
if (i.children && i.children.length > 0){ if (i.children && i.children.length > 0) {
deepFor(i.children) deepFor(i.children)
} }
} }
return source return source
} }
</script> </script>
+24 -24
View File
@@ -17,9 +17,9 @@
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
export default { export default {
name: 'JTreeTable', name: 'JTreeTable',
props: { props: {
rowKey: { rowKey: {
@@ -61,64 +61,64 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
condition:{ condition: {
type:String, type: String,
default:'', default: '',
required:false required: false
} }
}, },
data() { data () {
return { return {
dataSource: [], dataSource: [],
expandedRowKeys: [] expandedRowKeys: []
} }
}, },
computed: { computed: {
getChildrenUrl() { getChildrenUrl () {
if (this.childrenUrl) { if (this.childrenUrl) {
return this.childrenUrl return this.childrenUrl
} else { } else {
return this.url return this.url
} }
}, },
slots() { slots () {
let slots = [] const slots = []
for (let column of this.columns) { for (const column of this.columns) {
if (column.scopedSlots && column.scopedSlots.customRender) { if (column.scopedSlots && column.scopedSlots.customRender) {
slots.push(column.scopedSlots.customRender) slots.push(column.scopedSlots.customRender)
} }
} }
return slots return slots
}, },
tableAttrs() { tableAttrs () {
return Object.assign(this.$attrs, this.tableProps) return Object.assign(this.$attrs, this.tableProps)
} }
}, },
watch: { watch: {
queryParams: { queryParams: {
deep: true, deep: true,
handler() { handler () {
this.loadData() this.loadData()
} }
} }
}, },
created() { created () {
if (this.immediateRequest) this.loadData() if (this.immediateRequest) this.loadData()
}, },
methods: { methods: {
/** 加载数据*/ /** 加载数据 */
loadData(id = this.topValue, first = true, url = this.url) { loadData (id = this.topValue, first = true, url = this.url) {
this.$emit('requestBefore', { first }) this.$emit('requestBefore', { first })
if (first) { if (first) {
this.expandedRowKeys = [] this.expandedRowKeys = []
} }
let params = Object.assign({}, this.queryParams || {}) const params = Object.assign({}, this.queryParams || {})
params[this.queryKey] = id params[this.queryKey] = id
if(this.condition && this.condition.length>0){ if (this.condition && this.condition.length > 0) {
params['condition'] = this.condition params.condition = this.condition
} }
return getAction(url, params).then(res => { return getAction(url, params).then(res => {
@@ -130,17 +130,17 @@
} else { } else {
throw '返回数据类型不识别' throw '返回数据类型不识别'
} }
let dataSource = list.map(item => { const dataSource = list.map(item => {
// 判断是否标记了带有子级 // 判断是否标记了带有子级
if (item.hasChildren === true) { if (item.hasChildren === true) {
// 查找第一个带有dataIndex的值的列 // 查找第一个带有dataIndex的值的列
let firstColumn let firstColumn
for (let column of this.columns) { for (const column of this.columns) {
firstColumn = column.dataIndex firstColumn = column.dataIndex
if (firstColumn) break if (firstColumn) break
} }
// 定义默认展开时显示的loading子级实际子级数据只在展开时加载 // 定义默认展开时显示的loading子级实际子级数据只在展开时加载
let loadChild = { id: `${item.id}_loadChild`, [firstColumn]: 'loading...', isLoading: true } const loadChild = { id: `${item.id}_loadChild`, [firstColumn]: 'loading...', isLoading: true }
item.children = [loadChild] item.children = [loadChild]
} }
return item return item
@@ -154,7 +154,7 @@
}, },
/** 点击展开图标时触发 */ /** 点击展开图标时触发 */
handleExpand(expanded, record) { handleExpand (expanded, record) {
// 判断是否是展开状态 // 判断是否是展开状态
if (expanded) { if (expanded) {
// 判断子级的首个项的标记是否是正在加载中如果是就加载数据 // 判断子级的首个项的标记是否是正在加载中如果是就加载数据
@@ -172,7 +172,7 @@
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
+148 -148
View File
@@ -35,58 +35,58 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage'; import { getFileAccessHttpUrl } from '@/api/manage'
const Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
const FILE_TYPE_ALL = "all" const FILE_TYPE_ALL = 'all'
const FILE_TYPE_IMG = "image" const FILE_TYPE_IMG = 'image'
const FILE_TYPE_TXT = "file" const FILE_TYPE_TXT = 'file'
const uidGenerator=()=>{ const uidGenerator = () => {
return '-'+parseInt(Math.random()*10000+1,10); return '-' + parseInt(Math.random() * 10000 + 1, 10)
} }
export default { export default {
name: 'JUpload', name: 'JUpload',
data(){ data () {
return { return {
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload", uploadAction: window._CONFIG.domianURL + '/sys/common/upload',
headers:{}, headers: {},
fileList: [], fileList: [],
newFileList: [], newFileList: [],
uploadGoOn:true, uploadGoOn: true
} }
}, },
props:{ props: {
text:{ text: {
type:String, type: String,
required:false, required: false,
default:"点击上传" default: '点击上传'
}, },
fileType:{ fileType: {
type:String, type: String,
required:false, required: false,
default:FILE_TYPE_ALL default: FILE_TYPE_ALL
}, },
/*这个属性用于控制文件上传的业务路径*/ /* 这个属性用于控制文件上传的业务路径 */
bizPath:{ bizPath: {
type:String, type: String,
required:false, required: false,
default:"temp" default: 'temp'
}, },
value:{ value: {
type:[String,Array], type: [String, Array],
required:false required: false
}, },
// update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击 // update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
disabled:{ disabled: {
type:Boolean, type: Boolean,
required:false, required: false,
default: false default: false
}, },
// update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击 // update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
//此属性被废弃了 // 此属性被废弃了
triggerChange:{ triggerChange: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
@@ -96,19 +96,19 @@
* true仅返回url * true仅返回url
* false返回fileName filePath fileSize * false返回fileName filePath fileSize
*/ */
returnUrl:{ returnUrl: {
type:Boolean, type: Boolean,
required:false, required: false,
default: true default: true
}, },
number:{ number: {
type:Number, type: Number,
required:false, required: false,
default: 0 default: 0
}, },
buttonVisible:{ buttonVisible: {
type:Boolean, type: Boolean,
required:false, required: false,
default: true default: true
}, },
multiple: { multiple: {
@@ -123,16 +123,16 @@
default: true default: true
} }
}, },
watch:{ watch: {
value:{ value: {
immediate: true, immediate: true,
handler() { handler () {
let val = this.value const val = this.value
if (val instanceof Array) { if (val instanceof Array) {
if(this.returnUrl){ if (this.returnUrl) {
this.initFileList(val.join(',')) this.initFileList(val.join(','))
}else{ } else {
this.initFileListArr(val); this.initFileListArr(val)
} }
} else { } else {
this.initFileList(val) this.initFileList(val)
@@ -140,88 +140,88 @@
} }
} }
}, },
computed:{ computed: {
//透传给下级组件的事件需要排除本组件使用的change事件 // 透传给下级组件的事件需要排除本组件使用的change事件
childListeners() { childListeners () {
const vm = this; const vm = this
let result = Object.assign({}, const result = Object.assign({},
this.$listeners, this.$listeners
) )
delete result.change; delete result.change
return result; return result
}, },
isImageComp(){ isImageComp () {
return this.fileType === FILE_TYPE_IMG return this.fileType === FILE_TYPE_IMG
}, },
complistType(){ complistType () {
return this.fileType === FILE_TYPE_IMG?'picture-card':'text' return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text'
},
},
created(){
const token = Vue.ls.get(ACCESS_TOKEN);
//---------------------------- begin 图片左右换位置 -------------------------------------
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;
} }
for(var a=0;a<val.length;a++){ },
this.fileList.forEach((item)=>{ created () {
if (item.url === val[a]){ const token = Vue.ls.get(ACCESS_TOKEN)
// ---------------------------- begin 图片左右换位置 -------------------------------------
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
}
for (var a = 0; a < val.length; a++) {
this.fileList.forEach((item) => {
if (item.url === val[a]) {
item.uid = uidGenerator() item.uid = uidGenerator()
item.response.status = 'done' item.response.status = 'done'
} }
}) })
} }
}, },
initFileList(paths){ initFileList (paths) {
if(!paths || paths.length==0){ if (!paths || paths.length == 0) {
this.fileList = []; this.fileList = []
return; return
} }
let arr = paths.split(",") const arr = paths.split(',')
for(var a=0;a<arr.length;a++){ for (var a = 0; a < arr.length; a++) {
this.fileList.forEach((item)=>{ this.fileList.forEach((item) => {
if (item.url === arr[a]){ if (item.url === arr[a]) {
item.uid = uidGenerator() item.uid = uidGenerator()
item.response.status = 'history' item.response.status = 'history'
} }
}) })
} }
}, },
handlePathChange(){ handlePathChange () {
let uploadFiles = this.fileList const uploadFiles = this.fileList
let path = '' let path = ''
if(!uploadFiles || uploadFiles.length==0){ if (!uploadFiles || uploadFiles.length == 0) {
path = '' path = ''
} }
let arr = []; const arr = []
for(var a=0;a<uploadFiles.length;a++){ for (var a = 0; a < uploadFiles.length; a++) {
if(uploadFiles[a].status === 'done' ) { if (uploadFiles[a].status === 'done') {
arr.push(uploadFiles[a].url) arr.push(uploadFiles[a].url)
}else{ } else {
return; return
} }
} }
if(arr.length>0){ if (arr.length > 0) {
path = arr.join(",") path = arr.join(',')
} }
this.$emit('change', path); this.$emit('change', path)
}, },
doBeforeUpload(file){ doBeforeUpload (file) {
this.uploadGoOn=true this.uploadGoOn = true
var fileType = file.type; var fileType = file.type
if(this.fileType===FILE_TYPE_IMG){ if (this.fileType === FILE_TYPE_IMG) {
if(fileType.indexOf('image')<0){ if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片'); this.$message.warning('请上传图片')
this.uploadGoOn=false this.uploadGoOn = false
return false; return false
} }
} }
// 扩展 beforeUpload 验证 // 扩展 beforeUpload 验证
@@ -230,80 +230,80 @@
} }
return true return true
}, },
handleChange(info) { handleChange (info) {
if(!info.file.status && this.uploadGoOn === false){ if (!info.file.status && this.uploadGoOn === false) {
info.fileList.pop(); info.fileList.pop()
} }
let fileList = info.fileList let fileList = info.fileList
if(info.file.status==='done'){ if (info.file.status === 'done') {
if(this.number>0){ if (this.number > 0) {
fileList = fileList.slice(-this.number); fileList = fileList.slice(-this.number)
} }
if(info.file.response.success){ if (info.file.response.success) {
fileList = fileList.map((file) => { fileList = fileList.map((file) => {
if (file.response) { if (file.response) {
let reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`; const reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`
file.url = getFileAccessHttpUrl(reUrl); file.url = getFileAccessHttpUrl(reUrl)
} }
return file; return file
}); })
} }
//this.$message.success(`${info.file.name} 上传成功!`); // this.$message.success(`${info.file.name} 上传成功!`);
}else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`); this.$message.error(`${info.file.name} 上传失败.`)
}else if(info.file.status === 'removed'){ } else if (info.file.status === 'removed') {
this.handleDelete(info.file) this.handleDelete(info.file)
} }
this.fileList = fileList this.fileList = fileList
if(info.file.status==='done' || info.file.status === 'removed'){ if (info.file.status === 'done' || info.file.status === 'removed') {
//returnUrl为true时仅返回文件路径 // returnUrl为true时仅返回文件路径
if(this.returnUrl){ if (this.returnUrl) {
this.handlePathChange() this.handlePathChange()
}else{ } else {
//returnUrl为false时返回文件名称文件路径及文件大小 // returnUrl为false时返回文件名称文件路径及文件大小
this.newFileList = []; this.newFileList = []
for(var a=0;a<fileList.length;a++){ for (var a = 0; a < fileList.length; a++) {
// update-begin-author:lvdandan date:20200603 for:TESTA-514开源issue多个文件同时上传时控制台报错 // update-begin-author:lvdandan date:20200603 for:TESTA-514开源issue多个文件同时上传时控制台报错
if(fileList[a].status === 'done' ) { if (fileList[a].status === 'done') {
var fileJson = { var fileJson = {
fileName:fileList[a].name, fileName: fileList[a].name,
filePath:fileList[a].url, filePath: fileList[a].url,
fileSize:fileList[a].size fileSize: fileList[a].size
}; }
this.newFileList.push(fileJson); this.newFileList.push(fileJson)
}else{ } else {
return; return
} }
// update-end-author:lvdandan date:20200603 for:TESTA-514开源issue多个文件同时上传时控制台报错 // update-end-author:lvdandan date:20200603 for:TESTA-514开源issue多个文件同时上传时控制台报错
} }
this.$emit('change', this.newFileList); this.$emit('change', this.newFileList)
} }
} }
}, },
handleDelete(file){ handleDelete (file) {
//如有需要新增 删除逻辑 // 如有需要新增 删除逻辑
console.log(file) console.log(file)
}, },
handlePreview(file) { handlePreview (file) {
if (file && file.url) { 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}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url) window.open(url)
} }
}, },
handleDownload(file) { handleDownload (file) {
if (file && file.url) { 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) window.open(fileFullUrl)
} }
} }
}, },
mounted(){}, mounted () {},
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change'
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
@@ -20,46 +20,46 @@
</template> </template>
<script> <script>
import { cloneObject } from '@/utils/util' import { cloneObject } from '@/utils/util'
export default { export default {
name: 'JVxeDetailsModal', name: 'JVxeDetailsModal',
inject: ['superTrigger'], inject: ['superTrigger'],
data() { data () {
return { return {
visible: false, visible: false,
fullscreen: false, fullscreen: false,
row: null, row: null,
column: null, column: null
} }
}, },
created() { created () {
}, },
methods: { methods: {
open(event) { open (event) {
let {row, column} = event const { row, column } = event
this.row = cloneObject(row) this.row = cloneObject(row)
this.column = column this.column = column
this.visible = true this.visible = true
}, },
close() { close () {
this.visible = false this.visible = false
}, },
handleOk() { handleOk () {
this.superTrigger('detailsConfirm', { this.superTrigger('detailsConfirm', {
row: this.row, row: this.row,
column: this.column, column: this.column,
callback: (success) => { callback: (success) => {
this.visible = !success this.visible = !success
},
})
},
},
} }
})
}
}
}
</script> </script>
<style lang="less"> <style lang="less">
.fade-enter-active, .fade-enter-active,
@@ -10,16 +10,16 @@
</template> </template>
<script> <script>
import PropTypes from 'ant-design-vue/es/_util/vue-types' import PropTypes from 'ant-design-vue/es/_util/vue-types'
export default { export default {
name: 'JVxePagination', name: 'JVxePagination',
props: { props: {
size: String, size: String,
disabled: PropTypes.bool, disabled: PropTypes.bool,
pagination: PropTypes.object.def({}), pagination: PropTypes.object.def({})
}, },
data() { data () {
return { return {
defaultPagination: { defaultPagination: {
current: 1, current: 1,
@@ -35,31 +35,31 @@
} }
}, },
computed: { computed: {
bindProps() { bindProps () {
return { return {
...this.defaultPagination, ...this.defaultPagination,
...this.pagination, ...this.pagination,
size: this.size === 'tiny' ? 'small' : '' size: this.size === 'tiny' ? 'small' : ''
} }
}, },
boxClass() { boxClass () {
return { return {
'j-vxe-pagination': true, 'j-vxe-pagination': true,
'show-quick-jumper': !!this.bindProps.showQuickJumper 'show-quick-jumper': !!this.bindProps.showQuickJumper
} }
}, }
}, },
methods: { methods: {
handleChange(current, pageSize) { handleChange (current, pageSize) {
this.$set(this.pagination, 'current', current) this.$set(this.pagination, 'current', current)
this.$emit('change', {current, pageSize}) this.$emit('change', { current, pageSize })
}, },
handleShowSizeChange(current, pageSize) { handleShowSizeChange (current, pageSize) {
this.$set(this.pagination, 'pageSize', pageSize) this.$set(this.pagination, 'pageSize', pageSize)
this.$emit('change', {current, pageSize}) this.$emit('change', { current, pageSize })
},
},
} }
}
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@@ -17,13 +17,13 @@
</a-popover> </a-popover>
</template> </template>
<script> <script>
import domAlign from 'dom-align' import domAlign from 'dom-align'
import { getParentNodeByTagName } from '../utils/vxeUtils' import { getParentNodeByTagName } from '../utils/vxeUtils'
import { cloneObject, triggerWindowResizeEvent } from '@/utils/util' import { cloneObject, triggerWindowResizeEvent } from '@/utils/util'
export default { export default {
name: 'JVxeSubPopover', name: 'JVxeSubPopover',
data() { data () {
return { return {
visible: false, visible: false,
// 当前行 // 当前行
@@ -37,19 +37,18 @@
placement: 'bottom' placement: 'bottom'
} }
}, },
created() { created () {
}, },
methods: { methods: {
toggle(event) { toggle (event) {
// update-begin-author:taoyan date:20200921 for: 弹出子表时子表会闪一下类似重新计算子表的位置
//update-begin-author:taoyan date:20200921 for: 弹出子表时子表会闪一下类似重新计算子表的位置 if (document.body.clientHeight - event.$event.clientY > 350) {
if(document.body.clientHeight - event.$event.clientY > 350){
this.placement = 'bottom' this.placement = 'bottom'
}else{ } else {
this.placement = 'top' this.placement = 'top'
} }
//update-end-author:taoyan date:20200921 for: 弹出子表时子表会闪一下类似重新计算子表的位置 // update-end-author:taoyan date:20200921 for: 弹出子表时子表会闪一下类似重新计算子表的位置
if (this.row == null) { if (this.row == null) {
this.open(event) this.open(event)
} else { } else {
@@ -57,14 +56,14 @@
} }
}, },
open(event, level = 0) { open (event, level = 0) {
if (level > 3) { if (level > 3) {
this.$message.error('打开子表失败') this.$message.error('打开子表失败')
console.warn('JVxeSubPopover打开子表失败') console.warn('JVxeSubPopover打开子表失败')
return return
} }
let {row, column, $table, $event: {target}} = event const { row, column, $table, $event: { target } } = event
this.row = cloneObject(row) this.row = cloneObject(row)
this.column = column this.column = column
@@ -83,31 +82,31 @@
if (className.includes('vxe-radio--icon') || className.includes('vxe-cell--radio')) { if (className.includes('vxe-radio--icon') || className.includes('vxe-cell--radio')) {
return return
} }
let table = $table.$el const table = $table.$el
let tr = getParentNodeByTagName(target, 'tr') const tr = getParentNodeByTagName(target, 'tr')
if (table && tr) { if (table && tr) {
let clientWidth = table.clientWidth const clientWidth = table.clientWidth
let clientHeight = tr.clientHeight const clientHeight = tr.clientHeight
this.$refs.div.style.width = clientWidth + 'px' this.$refs.div.style.width = clientWidth + 'px'
this.$refs.div.style.height = clientHeight + 'px' this.$refs.div.style.height = clientHeight + 'px'
this.overlayStyle.width = Number.parseInt((clientWidth - clientWidth * 0.04)) + 'px' this.overlayStyle.width = Number.parseInt((clientWidth - clientWidth * 0.04)) + 'px'
this.overlayStyle.maxWidth = this.overlayStyle.width this.overlayStyle.maxWidth = this.overlayStyle.width
//update-begin-author:taoyan date:20200921 for: 子表弹出位置存在现实位置问题 // update-begin-author:taoyan date:20200921 for: 子表弹出位置存在现实位置问题
//let realTable = getParentNodeByTagName(tr, 'table') // let realTable = getParentNodeByTagName(tr, 'table')
//let left = realTable.parentNode.scrollLeft // let left = realTable.parentNode.scrollLeft
let h = event.$event.clientY let h = event.$event.clientY
if(h){ if (h) {
h = h-140 h = h - 140
} }
let toolbar = this.$refs.div.nextSibling const toolbar = this.$refs.div.nextSibling
domAlign(this.$refs.div, toolbar, { domAlign(this.$refs.div, toolbar, {
points: ['tl', 'tl'], points: ['tl', 'tl'],
offset: [0, h], offset: [0, h],
overflow: { overflow: {
alwaysByViewport: true alwaysByViewport: true
}, }
}) })
//update-end-author:taoyan date:20200921 for: 子表弹出位置存在现实位置问题 // update-end-author:taoyan date:20200921 for: 子表弹出位置存在现实位置问题
this.$nextTick(() => { this.$nextTick(() => {
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
@@ -115,23 +114,23 @@
}) })
}) })
} else { } else {
let num = ++level const num = ++level
console.warn('JVxeSubPopovertable or tr 获取失败正在进行第 ' + num + '次重试', {event, table, tr}) console.warn('JVxeSubPopovertable or tr 获取失败正在进行第 ' + num + '次重试', { event, table, tr })
window.setTimeout(() => this.open(event, num), 100) window.setTimeout(() => this.open(event, num), 100)
} }
}, },
close() { close () {
if (this.visible) { if (this.visible) {
this.row = null this.row = null
this.visible = false this.visible = false
} }
}, },
reopen(event) { reopen (event) {
this.close() this.close()
this.open(event) this.open(event)
},
},
} }
}
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.j-vxe-popover-title { .j-vxe-popover-title {
File diff suppressed because it is too large Load Diff
@@ -29,7 +29,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'JVxeToolbar', name: 'JVxeToolbar',
props: { props: {
toolbarConfig: Object, toolbarConfig: Object,
@@ -37,81 +37,81 @@
size: String, size: String,
disabled: Boolean, disabled: Boolean,
disabledRows: Object, disabledRows: Object,
selectedRowIds: Array, selectedRowIds: Array
}, },
data() { data () {
return { return {
// 是否收起 // 是否收起
collapsed: true, collapsed: true
} }
}, },
computed: { computed: {
boxClass() { boxClass () {
return { return {
'j-vxe-toolbar': true, 'j-vxe-toolbar': true,
'j-vxe-toolbar-collapsed': this.collapsed, 'j-vxe-toolbar-collapsed': this.collapsed
} }
}, },
btns() { btns () {
let arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection'] const arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection']
let exclude = [...this.excludeCode] const exclude = [...this.excludeCode]
// TODO 需要将remove替换batch_delete // TODO 需要将remove替换batch_delete
// 系统默认的批量删除编码配置为 batch_delete 此处需要转化一下 // 系统默认的批量删除编码配置为 batch_delete 此处需要转化一下
if(exclude.indexOf('batch_delete')>=0){ if (exclude.indexOf('batch_delete') >= 0) {
exclude.push('remove') exclude.push('remove')
} }
// 按钮权限 需要去掉不被授权的按钮 // 按钮权限 需要去掉不被授权的按钮
return arr.filter(item=>{ return arr.filter(item => {
return exclude.indexOf(item)<0 return exclude.indexOf(item) < 0
}) })
}, },
slots() { slots () {
return this.toolbarConfig.slot || ['prefix', 'suffix'] return this.toolbarConfig.slot || ['prefix', 'suffix']
}, },
showPrefix() { showPrefix () {
return this.slots.includes('prefix') return this.slots.includes('prefix')
}, },
showSuffix() { showSuffix () {
return this.slots.includes('suffix') return this.slots.includes('suffix')
}, },
showAdd() { showAdd () {
return this.btns.includes('add') return this.btns.includes('add')
}, },
showSave() { showSave () {
return this.btns.includes('save') return this.btns.includes('save')
}, },
showRemove() { showRemove () {
return this.btns.includes('remove') return this.btns.includes('remove')
}, },
showClearSelection() { showClearSelection () {
if (this.btns.includes('clearSelection')) { if (this.btns.includes('clearSelection')) {
// 有禁用行时才显示清空选择按钮 // 有禁用行时才显示清空选择按钮
// 因为禁用行会阻止选择行导致无法取消全选 // 因为禁用行会阻止选择行导致无法取消全选
let length = Object.keys(this.disabledRows).length const length = Object.keys(this.disabledRows).length
return length > 0 return length > 0
} }
return false return false
}, },
showCollapse() { showCollapse () {
return this.btns.includes('collapse') return this.btns.includes('collapse')
}, },
btnSize() { btnSize () {
return this.size === 'tiny' ? 'small' : null return this.size === 'tiny' ? 'small' : null
}, }
}, },
methods: { methods: {
/** 触发事件 */ /** 触发事件 */
trigger(name) { trigger (name) {
this.$emit(name) this.$emit(name)
}, },
// 切换展开收起 // 切换展开收起
toggleCollapse() { toggleCollapse () {
this.collapsed = !this.collapsed this.collapsed = !this.collapsed
},
},
} }
}
}
</script> </script>
<style lang="less"> <style lang="less">
@@ -10,50 +10,50 @@
</template> </template>
<script> <script>
import { neverNull } from '@/utils/util' import { neverNull } from '@/utils/util'
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxeCheckboxCell', name: 'JVxeCheckboxCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
props: {}, props: {},
computed: { computed: {
bordered() { bordered () {
return !!this.renderOptions.bordered return !!this.renderOptions.bordered
}, },
scrolling() { scrolling () {
return !!this.renderOptions.scrolling return !!this.renderOptions.scrolling
}, },
clazz() { clazz () {
return { return {
'j-vxe-checkbox': true, 'j-vxe-checkbox': true,
'no-animation': this.scrolling 'no-animation': this.scrolling
} }
}, },
boxStyle() { boxStyle () {
const style = {} const style = {}
// 如果有边框且未设置align属性就强制居中 // 如果有边框且未设置align属性就强制居中
if (this.bordered && !this.originColumn.align) { if (this.bordered && !this.originColumn.align) {
style['text-align'] = 'center' style['text-align'] = 'center'
} }
return style return style
}, }
}, },
methods: { methods: {
handleChange(event) { handleChange (event) {
this.handleChangeCommon(event.target.checked) this.handleChangeCommon(event.target.checked)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
switches: { switches: {
visible: true, visible: true
}, },
getValue(value) { getValue (value) {
let {own: col} = this.column const { own: col } = this.column
// 处理 customValue // 处理 customValue
if (Array.isArray(col.customValue)) { if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col) const customValue = getCustomValue(col)
if (typeof value === 'boolean') { if (typeof value === 'boolean') {
return value ? customValue[0] : customValue[1] return value ? customValue[0] : customValue[1]
} else { } else {
@@ -63,33 +63,33 @@
return value return value
} }
}, },
setValue(value) { setValue (value) {
let {own: col} = this.column const { own: col } = this.column
// 判断是否设定了customValue自定义值 // 判断是否设定了customValue自定义值
if (Array.isArray(col.customValue)) { if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col) const customValue = getCustomValue(col)
return neverNull(value).toString() === customValue[0].toString() return neverNull(value).toString() === customValue[0].toString()
} else { } else {
return !!value return !!value
} }
}, },
createValue({column}) { createValue ({ column }) {
let {own: col} = column const { own: col } = column
if (Array.isArray(col.customValue)) { if (Array.isArray(col.customValue)) {
let customValue = getCustomValue(col) const customValue = getCustomValue(col)
return col.defaultChecked ? customValue[0] : customValue[1] return col.defaultChecked ? customValue[0] : customValue[1]
} else { } else {
return !!col.defaultChecked return !!col.defaultChecked
} }
},
} }
} }
}
function getCustomValue(col) { function getCustomValue (col) {
let customTrue = neverNull(col.customValue[0], true) const customTrue = neverNull(col.customValue[0], true)
let customFalse = neverNull(col.customValue[1], false) const customFalse = neverNull(col.customValue[1], false)
return [customTrue, customFalse] return [customTrue, customFalse]
} }
</script> </script>
<style lang="less"> <style lang="less">
@@ -13,32 +13,32 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import { JVXETypes } from '@/components/jero/JVxeTable/index' import { JVXETypes } from '@/components/jero/JVxeTable/index'
import JVxeCellMixins, { dispatchEvent } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins, { dispatchEvent } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxeDateCell', name: 'JVxeDateCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
props: {}, props: {},
data() { data () {
return { return {
innerDateValue: null, innerDateValue: null
} }
}, },
computed: { computed: {
isDatetime() { isDatetime () {
return this.$type === JVXETypes.datetime return this.$type === JVXETypes.datetime
}, },
dateFormat() { dateFormat () {
let format = this.originColumn.format const format = this.originColumn.format
return format ? format : (this.isDatetime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD') return format || (this.isDatetime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')
}, }
}, },
watch: { watch: {
innerValue: { innerValue: {
immediate: true, immediate: true,
handler(val) { handler (val) {
if (val == null || val === '') { if (val == null || val === '') {
this.innerDateValue = null this.innerDateValue = null
} else { } else {
@@ -48,19 +48,19 @@
} }
}, },
methods: { methods: {
handleChange(mom, dateStr) { handleChange (mom, dateStr) {
this.handleChangeCommon(dateStr) this.handleChangeCommon(dateStr)
} }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
aopEvents: { aopEvents: {
editActived(event) { editActived (event) {
dispatchEvent.call(this, event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event)) dispatchEvent.call(this, event, 'ant-calendar-picker', el => el.children[0].dispatchEvent(event.$event))
},
},
} }
} }
}
}
</script> </script>
<style scoped> <style scoped>
@@ -26,16 +26,16 @@
</template> </template>
<script> <script>
import JVxeCellMixins, { dispatchEvent } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins, { dispatchEvent } from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
import JSelectDepartModal from '@/components/jerobiz/modal/JSelectDepartModal' import JSelectDepartModal from '@/components/jerobiz/modal/JSelectDepartModal'
export default { export default {
name: 'JVxeDepartSelectCell', name: 'JVxeDepartSelectCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
components:{ components: {
JSelectDepartModal JSelectDepartModal
}, },
data() { data () {
return { return {
departNames: '', departNames: '',
departIds: '', departIds: '',
@@ -44,8 +44,8 @@
} }
}, },
computed: { computed: {
custProps() { custProps () {
const {departIds, originColumn: col, caseId, cellProps} = this const { departIds, originColumn: col, caseId, cellProps } = this
return { return {
...cellProps, ...cellProps,
value: departIds, value: departIds,
@@ -54,30 +54,30 @@
class: 'jvxe-select' class: 'jvxe-select'
} }
}, },
componentDisabled(){ componentDisabled () {
if(this.cellProps.disabled==true){ if (this.cellProps.disabled == true) {
return true return true
} }
return false return false
}, },
modalWidth(){ modalWidth () {
if(this.cellProps.modalWidth){ if (this.cellProps.modalWidth) {
return this.cellProps.modalWidth return this.cellProps.modalWidth
}else{ } else {
return 500 return 500
} }
}, },
multi(){ multi () {
if(this.cellProps.multi==false){ if (this.cellProps.multi == false) {
return false return false
}else{ } else {
return true return true
} }
}, },
rootOpened(){ rootOpened () {
if(this.cellProps.open==false){ if (this.cellProps.open == false) {
return false return false
}else{ } else {
return true return true
} }
} }
@@ -85,7 +85,7 @@
watch: { watch: {
innerValue: { innerValue: {
immediate: true, immediate: true,
handler(val) { handler (val) {
if (val == null || val === '') { if (val == null || val === '') {
this.departIds = '' this.departIds = ''
} else { } else {
@@ -95,28 +95,28 @@
} }
}, },
methods: { methods: {
openSelect(){ openSelect () {
this.$refs.innerDepartSelectModal.show() this.$refs.innerDepartSelectModal.show()
}, },
handleEmpty(){ handleEmpty () {
this.handleOK('') this.handleOK('')
}, },
handleOK(rows, idstr) { handleOK (rows, idstr) {
let value = '' let value = ''
if (!rows && rows.length <= 0) { if (!rows && rows.length <= 0) {
this.departNames = '' this.departNames = ''
this.departIds = '' this.departIds = ''
} else { } else {
value = rows.map(row => row[this.customReturnField]).join(',') 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.departIds = idstr
} }
this.handleChangeCommon(this.departIds) this.handleChangeCommon(this.departIds)
}, },
initComp(departNames){ initComp (departNames) {
this.departNames = departNames this.departNames = departNames
}, },
handleChange(value) { handleChange (value) {
this.handleChangeCommon(value) this.handleChangeCommon(value)
} }
}, },
@@ -128,7 +128,7 @@
enabled: false enabled: false
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
@@ -20,51 +20,51 @@
</template> </template>
<script> <script>
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxeDragSortCell', name: 'JVxeDragSortCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
computed: { computed: {
// 排序结果保存字段 // 排序结果保存字段
dragSortKey() { dragSortKey () {
return this.renderOptions.dragSortKey || 'orderNum' return this.renderOptions.dragSortKey || 'orderNum'
}, },
disabledMoveUp() { disabledMoveUp () {
return this.rowIndex === 0 return this.rowIndex === 0
}, },
disabledMoveDown() { disabledMoveDown () {
return this.rowIndex === (this.fullDataLength - 1) return this.rowIndex === (this.fullDataLength - 1)
}, }
}, },
methods: { methods: {
/** 向上移 */ /** 向上移 */
handleRowMoveUp(event) { handleRowMoveUp (event) {
// event.target.blur() // event.target.blur()
if (!this.disabledMoveUp) { if (!this.disabledMoveUp) {
this.trigger('rowMoveUp', this.rowIndex) this.trigger('rowMoveUp', this.rowIndex)
} }
}, },
/** 向下移 */ /** 向下移 */
handleRowMoveDown(event) { handleRowMoveDown (event) {
// event.target.blur() // event.target.blur()
if (!this.disabledMoveDown) { if (!this.disabledMoveDown) {
this.trigger('rowMoveDown', this.rowIndex) this.trigger('rowMoveDown', this.rowIndex)
} }
}, },
/** 插入一行 */ /** 插入一行 */
handleRowInsertDown() { handleRowInsertDown () {
this.trigger('rowInsertDown', this.rowIndex) this.trigger('rowInsertDown', this.rowIndex)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
// 功能开关 // 功能开关
switches: { switches: {
editRender: false editRender: false
},
},
} }
}
}
</script> </script>
<style lang="less"> <style lang="less">
@@ -9,20 +9,20 @@
</template> </template>
<script> <script>
import { JVXETypes } from '@/components/jero/JVxeTable' import { JVXETypes } from '@/components/jero/JVxeTable'
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
const NumberRegExp = /^-?\d+\.?\d*$/ const NumberRegExp = /^-?\d+\.?\d*$/
export default { export default {
name: 'JVxeInputCell', name: 'JVxeInputCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
methods: { methods: {
/** 处理change事件 */ /** 处理change事件 */
handleChange(event) { handleChange (event) {
let {$type} = this const { $type } = this
let {target} = event const { target } = event
let {value, selectionStart} = target let { value, selectionStart } = target
let change = true let change = true
if ($type === JVXETypes.inputNumber) { if ($type === JVXETypes.inputNumber) {
// 判断输入的值是否匹配数字正则表达式不匹配就还原 // 判断输入的值是否匹配数字正则表达式不匹配就还原
@@ -47,9 +47,9 @@
}, },
/** 处理blur失去焦点事件 */ /** 处理blur失去焦点事件 */
handleBlur(event) { handleBlur (event) {
let {$type} = this const { $type } = this
let {target} = event const { target } = event
// 判断输入的值是否匹配数字正则表达式不匹配就置空 // 判断输入的值是否匹配数字正则表达式不匹配就置空
if ($type === JVXETypes.inputNumber) { if ($type === JVXETypes.inputNumber) {
if (!NumberRegExp.test(target.value)) { if (!NumberRegExp.test(target.value)) {
@@ -61,25 +61,25 @@
} }
this.handleBlurCommon(target.value) this.handleBlurCommon(target.value)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
installOptions: { installOptions: {
// 自动聚焦的 class 类名 // 自动聚焦的 class 类名
autofocus: '.ant-input', autofocus: '.ant-input'
}, },
getValue(value) { getValue (value) {
if (this.$type === JVXETypes.inputNumber && typeof value === 'string') { if (this.$type === JVXETypes.inputNumber && typeof value === 'string') {
if (NumberRegExp.test(value)) { if (NumberRegExp.test(value)) {
return Number.parseFloat(value) return Number.parseFloat(value)
} }
} }
return value return value
},
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@@ -7,34 +7,34 @@
</template> </template>
<script> <script>
import ReloadEffect from './ReloadEffect' import ReloadEffect from './ReloadEffect'
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
export default { export default {
name: 'JVxeNormalCell', name: 'JVxeNormalCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
components: {ReloadEffect}, components: { ReloadEffect },
computed: { computed: {
reloadEffectRowKeysMap() { reloadEffectRowKeysMap () {
return this.renderOptions.reloadEffectRowKeysMap return this.renderOptions.reloadEffectRowKeysMap
}, },
reloadEffect() { reloadEffect () {
return (this.renderOptions.reloadEffect && this.reloadEffectRowKeysMap[this.row.id]) === true return (this.renderOptions.reloadEffect && this.reloadEffectRowKeysMap[this.row.id]) === true
}, }
}, },
methods: { methods: {
// 特效结束 // 特效结束
handleEffectEnd() { handleEffectEnd () {
this.$delete(this.reloadEffectRowKeysMap, this.row.id) this.$delete(this.reloadEffectRowKeysMap, this.row.id)
}, }
}, },
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
switches: { switches: {
editRender: false, editRender: false
},
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@@ -8,33 +8,33 @@
</template> </template>
<script> <script>
import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins' import JVxeCellMixins from '@/components/jero/JVxeTable/mixins/JVxeCellMixins'
// JVxe 进度条组件 // JVxe 进度条组件
export default { export default {
name: 'JVxeProgressCell', name: 'JVxeProgressCell',
mixins: [JVxeCellMixins], mixins: [JVxeCellMixins],
data() { data () {
return {} return {}
}, },
computed: { computed: {
clazz() { clazz () {
return { return {
'j-vxe-progress': true, 'j-vxe-progress': true,
'no-animation': this.scrolling 'no-animation': this.scrolling
} }
}, },
scrolling() { scrolling () {
return !!this.renderOptions.scrolling return !!this.renderOptions.scrolling
}, }
}, },
methods: {}, methods: {},
// 组件增强注释详见JVxeCellMixins.js // 组件增强注释详见JVxeCellMixins.js
enhanced: { enhanced: {
switches: { switches: {
editRender: false, editRender: false
}, },
setValue(value) { setValue (value) {
try { try {
if (typeof value !== 'number') { if (typeof value !== 'number') {
return Number.parseFloat(value) return Number.parseFloat(value)
@@ -44,9 +44,9 @@
} catch { } catch {
return 0 return 0
} }
},
} }
} }
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

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