修改 iview弹出message提示框 出错问题

pull/3/head
justin 2021-09-30 00:12:06 +08:00
parent d7acd839f7
commit bcc8d8abb2
11 changed files with 28 additions and 122 deletions

View File

@ -135,7 +135,7 @@ export function createDesigner(vueInstance) {
let wgCategory = evt.draggedContext.element.category
if (!!evt.to) {
if ((evt.to.className === 'sub-form-table') && (wgCategory === 'container')) {
//this.$message.info(this.vueInstance.i18nt('designer.hint.onlyFieldWidgetAcceptable'))
//this.$Message.info(this.vueInstance.i18nt('designer.hint.onlyFieldWidgetAcceptable'))
return false
}
}
@ -650,7 +650,7 @@ export function createDesigner(vueInstance) {
})
if (spanSum >= 24) {
//this.$message.info('列栅格之和超出24')
//this.$Message.info('列栅格之和超出24')
console.log('列栅格之和超出24')
gridWidget.cols.push(newGridCol)
} else {

View File

@ -48,48 +48,6 @@
</Input>
</template>
<template v-if="field.type === 'input-composite'">
<Input ref="fieldEditor"
v-model="fieldModel"
:disabled="field.options.disabled"
:readonly="field.options.readonly"
:size="field.options.size||'default'"
class="hide-spin-button"
:type="inputType"
:password ="field.options.showPassword"
:placeholder="field.options.placeholder"
:clearable="field.options.clearable"
:maxlength="field.options.maxLength"
:show-word-limit="field.options.showWordLimit"
:minlength="field.options.minLength"
@change="handleChangeEvent"
@focus="handleFocusCustomEvent"
@blur="handleBlurCustomEvent"
@input="handleInputCustomEvent">
<div slot="prepend" v-if="field.options.prependControl&&field.options.prependControlType=='div'">
<Icon :type="field.options.prependControlIcon" />{{field.options.prependControlText}}
</div>
<div slot="append" v-if="field.options.appendControl&&field.options.appendControlType=='div'">
<Icon :type="field.options.appendControlIcon" />{{field.options.appendControlText}}
</div>
<Button slot="prepend"
v-if="field.options.prependControl&&field.options.prependControlType==='button'"
type="primary"
:disabled="field.options.disabled || field.options.prependControlDisabled"
:icon="field.options.prependControlIcon"
@click.native="emitPrependButtonClick">{{field.options.prependControlText}}</Button>
<Button slot="append"
v-if="field.options.appendControl&&field.options.appendControlType==='button'"
type="primary"
:disabled="field.options.disabled || field.options.appendButtonDisabled"
:icon="field.options.appendControlIcon"
@click.native="emitAppendButtonClick">{{field.options.appendControlText}}</Button>
</Input>
</template>
<template v-if="field.type === 'textarea'">
<Input type="textarea" ref="fieldEditor" v-model="fieldModel" :disabled="field.options.disabled"
:readonly="field.options.readonly" :size="field.options.size||'default'"

View File

@ -161,7 +161,7 @@
getWidgetRef(widgetName, showError) {
let foundRef = this.widgetRefList[widgetName]
if (!foundRef && !!showError) {
this.$message.error(this.i18nt('designer.hint.refNotFound') + widgetName)
this.$Message.error(this.i18nt('designer.hint.refNotFound') + widgetName)
}
return foundRef
},

View File

@ -1554,7 +1554,7 @@
let oldName = this.designer.selectedWidgetName
if (isEmptyStr(newName)) {
this.selectedWidget.options.name = oldName
this.$message.info(this.i18nt('designer.hint.nameRequired'))
this.$Message.info(this.i18nt('designer.hint.nameRequired'))
return
}
@ -1563,7 +1563,7 @@
let foundRef = this.designer.formWidget.getWidgetRef(newName)
if (!!foundRef) {
this.selectedWidget.options.name = oldName
this.$message.info(this.i18nt('designer.hint.duplicateName') + newName)
this.$Message.info(this.i18nt('designer.hint.duplicateName') + newName)
return
}
@ -1581,7 +1581,7 @@
spanSum += colItem.options.span
})
if (spanSum > 24) {
//this.$message.info('24')
//this.$Message.info('24')
console.log('列栅格之和超出24')
//TODO:
}
@ -1639,7 +1639,7 @@
deleteTabPane(curTabs, tpIdx) {
if (curTabs.tabs.length === 1) {
this.$message.info(this.i18nt('designer.hint.lastPaneCannotBeDeleted'))
this.$Message.info(this.i18nt('designer.hint.lastPaneCannotBeDeleted'))
return
}

View File

@ -234,7 +234,7 @@
this.showImportCascaderDialogFlag = false
} catch (ex) {
this.$message.error(this.i18nt('designer.hint.invalidOptionsData') + ex.message)
this.$Message.error(this.i18nt('designer.hint.invalidOptionsData') + ex.message)
}
},

View File

@ -311,11 +311,11 @@
this.designer.loadFormJson(importObj)
this.showImportJsonDialogFlag = false
this.$message.success(this.i18nt('designer.hint.importJsonSuccess'))
this.$Message.success(this.i18nt('designer.hint.importJsonSuccess'))
this.designer.emitHistoryChange()
} catch (ex) {
this.$message.error(ex + '')
this.$Message.error(ex + '')
}
},
@ -337,11 +337,11 @@
this.$nextTick(() => {
let copyClipboard = new Clipboard('.copy-json-btn')
copyClipboard.on('success', e => {
this.$message.success(this.i18nt('designer.hint.copyJsonSuccess'))
this.$Message.success(this.i18nt('designer.hint.copyJsonSuccess'))
copyClipboard.destroy() //
})
copyClipboard.on('error', e => { //
this.$message.error(this.i18nt('designer.hint.copyJsonFail'))
this.$Message.error(this.i18nt('designer.hint.copyJsonFail'))
copyClipboard.destroy()
})
})
@ -354,21 +354,21 @@
this.$nextTick(() => {
let vueClipboard = new Clipboard('.copy-vue-btn')
vueClipboard.on('success', e => {
this.$message.success(this.i18nt('designer.hint.copyVueCodeSuccess'))
this.$Message.success(this.i18nt('designer.hint.copyVueCodeSuccess'))
vueClipboard.destroy() //
})
vueClipboard.on('error', e => { //
this.$message.error(this.i18nt('designer.hint.copyVueCodeFail'))
this.$Message.error(this.i18nt('designer.hint.copyVueCodeFail'))
vueClipboard.destroy()
})
let htmlClipboard = new Clipboard('.copy-html-btn')
htmlClipboard.on('success', e => {
this.$message.success(this.i18nt('designer.hint.copyHtmlCodeSuccess'))
this.$Message.success(this.i18nt('designer.hint.copyHtmlCodeSuccess'))
htmlClipboard.destroy() //
})
htmlClipboard.on('error', e => { //
this.$message.error(this.i18nt('designer.hint.copyHtmlCodeFail'))
this.$Message.error(this.i18nt('designer.hint.copyHtmlCodeFail'))
htmlClipboard.destroy()
})
})
@ -376,7 +376,7 @@
copyVueCode(e) {
copyToClipboard(this.vueCode, e,
this.$message,
this.$Message,
this.i18nt('designer.hint.copyVueCodeSuccess'),
this.i18nt('designer.hint.copyVueCodeFail')
)
@ -384,7 +384,7 @@
copyHtmlCode(e) {
copyToClipboard(this.htmlCode, e,
this.$message,
this.$Message,
this.i18nt('designer.hint.copyHtmlCodeSuccess'),
this.i18nt('designer.hint.copyHtmlCodeFail')
)
@ -410,7 +410,7 @@
copyV2SFC(e) {
copyToClipboard(this.sfcCode, e,
this.$message,
this.$Message,
this.i18nt('designer.hint.copySFCSuccess'),
this.i18nt('designer.hint.copySFCFail')
)
@ -418,7 +418,7 @@
copyV3SFC(e) {
copyToClipboard(this.sfcCodeV3, e,
this.$message,
this.$Message,
this.i18nt('designer.hint.copySFCSuccess'),
this.i18nt('designer.hint.copySFCFail')
)
@ -447,16 +447,16 @@
this.$nextTick(() => {
let copyClipboard = new Clipboard('.copy-form-data-json-btn')
copyClipboard.on('success', e => {
this.$message.success(this.i18nt('designer.hint.copyJsonSuccess'))
this.$Message.success(this.i18nt('designer.hint.copyJsonSuccess'))
copyClipboard.destroy() //
})
copyClipboard.on('error', e => { //
this.$message.error(this.i18nt('designer.hint.copyJsonFail'))
this.$Message.error(this.i18nt('designer.hint.copyJsonFail'))
copyClipboard.destroy()
})
})
}).catch(error => {
this.$message.error(error)
this.$Message.error(error)
})
},

View File

@ -138,59 +138,7 @@ export const basicFields = [
onBlur: '',
onValidate: '',
},
},
{
type: 'input-composite',
icon: 'text-field',
formItemFlag: true,
options: {
name: '',
label: '',
labelAlign: '',
type: 'text',
defaultValue: '',
placeholder: '',
columnWidth: '200px',
size: '',
labelWidth: null,
labelHidden: false,
readonly: false,
disabled: false,
hidden: false,
clearable: true,
showPassword: false,
required: false,
validation: '',
validationHint: '',
//-------------------
customClass: '', //自定义css类名
labelIconClass: null,
labelIconPosition: 'rear',
labelTooltip: null,
// minLength: null,
maxLength: null,
showWordLimit: false,
prependControl: true,
prependControlDisabled: false,
prependControlText:"", //后置按钮文字
prependControlIcon: 'ios-person', //后置按钮文字
prependControlType: 'button',
appendControl: true,
appendControlDisabled: false,
appendControlText:"", //后置按钮文字
appendControlIcon: 'ios-search', //后置按钮文字
appendControlType: 'button',
//-------------------
onCreated: '',
onMounted: '',
onInput: '',
onChange: '',
onFocus: '',
onBlur: '',
onValidate: '',
},
},
},
{
type: 'textarea',
icon: 'textarea-field',

View File

@ -472,7 +472,7 @@
//TODO:
return this.formModel[this.widget.options.name]
} else {
this.$message.error(this.i18nt('render.hint.nonSubFormType'))
this.$Message.error(this.i18nt('render.hint.nonSubFormType'))
}
},

View File

@ -288,7 +288,7 @@
getWidgetRef(widgetName, showError = false) {
let foundRef = this.widgetRefList[widgetName]
if (!foundRef && !!showError) {
this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName)
this.$Message.error(this.i18nt('render.hint.refNotFound') + widgetName)
}
return foundRef
},

View File

@ -9,7 +9,7 @@ export default {
getWidgetRef(widgetName, showError) {
let foundRef = this.refList[widgetName]
if (!foundRef && !!showError) {
this.$message.error(this.i18nt('render.hint.refNotFound') + widgetName)
this.$Message.error(this.i18nt('render.hint.refNotFound') + widgetName)
}
return foundRef
},

View File

@ -80,7 +80,7 @@ export const generateCode = function(formJson, codeType= 'vue') {
alert( JSON.stringify(formData) )
}).catch(error => {
// Form Validation failed
this.$message.error(error)
this.$Message.error(error)
})
}
}