Merge pull request #3 from JustinChia/master

修改 iview弹出message提示框 出错
develop
vform666 2021-09-29 16:58:36 +08:00 committed by GitHub
commit 04dff4ebfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 45 additions and 197 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'"
@ -1571,7 +1529,7 @@
}
}
.el-form-item.selected,
.ivu-form-item.selected,
.static-content-item.selected {
outline: 2px solid $--color-primary;
}

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

@ -543,51 +543,7 @@
v-if="hasConfig('labelTooltip')">
<Input type="text" v-model="optionModel.labelTooltip" />
</FormItem>
<!-- 复合输入框 -->
<FormItem :label-width="0" v-if="hasConfig('appendControl')">
<Divider size="small" class="custom-divider">{{i18nt('designer.setting.inputControl')}}
</Divider>
<div style="font-size:12px;line-height:15px;color:#AAAAAA">提示受iview组件限制切换前置/后置组件可能无法及时生效请刷新页面</div>
</FormItem>
<!-- 添加前置按钮 -->
<FormItem :label="i18nt('designer.setting.prependControl')" v-if="hasConfig('prependControl')">
<Checkbox v-model="optionModel.prependControl" @on-change="updateFormView"></Checkbox>
</FormItem>
<FormItem :label="i18nt('designer.setting.prependControlDisabled')" v-if="hasConfig('prependControlDisabled')">
<Checkbox v-model="optionModel.prependControlDisabled"></Checkbox>
</FormItem>
<FormItem :label="i18nt('designer.setting.prependControlIcon')" v-if="hasConfig('prependControlIcon')">
<Input type="text" v-model="optionModel.prependControlIcon" />
</FormItem>
<FormItem :label="i18nt('designer.setting.prependControlType')" v-if="hasConfig('prependControlType')">
<Select v-model="optionModel.prependControlType">
<Option v-for="item in inputControlType" :key="item.value"
:label="item.label" :value="item.value">
</Option>
</Select>
</FormItem>
<FormItem :label="i18nt('designer.setting.prependControlText')" v-if="hasConfig('prependControlText')">
<Input type="text" v-model="optionModel.prependControlText" />
</FormItem>
<!-- 添加后置按钮 -->
<FormItem :label="i18nt('designer.setting.appendControl')" v-if="hasConfig('appendControl')">
<Checkbox v-model="optionModel.appendControl" @on-change="updateFormView"></Checkbox>
</FormItem>
<FormItem :label="i18nt('designer.setting.appendControlDisabled')" v-if="hasConfig('appendControlDisabled')">
<Checkbox v-model="optionModel.appendControlDisabled"></Checkbox>
</FormItem>
<FormItem :label="i18nt('designer.setting.appendControlIcon')" v-if="hasConfig('appendControlIcon')">
<Input type="text" v-model="optionModel.appendControlIcon" />
</FormItem>
<FormItem :label="i18nt('designer.setting.appendControlType')" v-if="hasConfig('appendControlType')">
<Select v-model="optionModel.appendControlType">
<Option v-for="item in inputControlType" :key="item.value"
:label="item.label" :value="item.value">
</Option>
</Select>
</FormItem>
<FormItem :label="i18nt('designer.setting.appendControlText')" v-if="hasConfig('appendControlText')">
<Input type="text" v-model="optionModel.appendControlText" />
</FormItem>
@ -1554,7 +1510,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 +1519,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 +1537,7 @@
spanSum += colItem.options.span
})
if (spanSum > 24) {
//this.$message.info('24')
//this.$Message.info('24')
console.log('列栅格之和超出24')
//TODO:
}
@ -1639,7 +1595,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

@ -240,20 +240,13 @@ export default {
showWordLimit: 'Show Word Limit',
prefixIcon: 'Prefix Icon',
suffixIcon: 'Suffix Icon',
inputControl: 'Complex Input Setting',
prependControl: 'Prepend Control',
prependControlDisabled: 'Disable Prepend Control',
prependControlType: 'Prepend Control Type',
prependControlText: 'Prepend Control Type',
appendControl: 'Append Control',
appendControlDisabled: 'Disable Append Control',
appendControlType: 'Append Control Type',
appendControlText: 'Append Control Text',
buttonIcon: 'Button Icon',
activeText: 'Active Text',
inactiveText: 'Inactive Text',
activeColor: 'Active Color',
inactiveColor: 'Inactive Color',
inputButton: 'Input Button Setting',
appendButton: 'Append Button',
appendButtonDisabled: 'Button Disabled',
buttonIcon: 'Button Icon',
switchWidth: 'Width of Switch(px)',
activeText: 'Active Text',
inactiveText: 'Inactive Text',
maxStars: 'Stars Max Number',
lowThreshold: 'Low Threshold',
highThreshold: 'High Threshold',

View File

@ -239,21 +239,14 @@ export default {
maxLength: '最大长度',
showWordLimit: '显示字数统计',
prefixIcon: '头部Icon',
suffixIcon: '尾部Icon',
inputControl: '复合输入框设置',
prependControl: '添加前置按钮',
prependControlDisabled: '前置按钮禁用',
prependControlType: '前置按钮类型',
prependControlIcon: '前置按钮图标',
prependControlText: '前置按钮文字',
appendControl: '添加后置按钮',
appendControlDisabled: '后置按钮禁用',
appendControlType: '后置按钮类型',
appendControlIcon: '后置按钮图标',
appendControlText: '后置按钮文字',
buttonIcon: '后置按钮Icon',
activeText: '开启时文字描述',
inactiveText: '关闭时文字描述',
suffixIcon: '尾部Icon',
inputButton: '输入框按钮设置',
appendButton: '添加后置按钮',
appendButtonDisabled: '后置按钮禁用',
buttonIcon: '后置按钮Icon',
switchWidth: '开关宽度(像素)',
activeText: '开启时文字描述',
inactiveText: '关闭时文字描述',
activeColor: '开启时背景色',
inactiveColor: '关闭时背景色',
maxStars: '最大评分值',

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)
})
}
}