diff --git a/src/components/GuipDialog.vue b/src/components/GuipDialog.vue new file mode 100644 index 0000000..851b853 --- /dev/null +++ b/src/components/GuipDialog.vue @@ -0,0 +1,114 @@ + + + + + + + + {{ cancelText }} + {{ confirmText }} + + + + + + + \ No newline at end of file diff --git a/src/components/GuipForm copy.vue b/src/components/GuipForm copy.vue new file mode 100644 index 0000000..60f31c8 --- /dev/null +++ b/src/components/GuipForm copy.vue @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + {{ element.label }} + + + + + + + + {{ city }} + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/GuipFormItem.vue b/src/components/GuipFormItem.vue index e04262a..f38d3b5 100644 --- a/src/components/GuipFormItem.vue +++ b/src/components/GuipFormItem.vue @@ -1,6 +1,6 @@ + :class="[{'column':column},{'error':hasError},{'w510':addClass=='w510'},{'w388':addClass=='w388'},'form-item1']"> {{ label }} @@ -48,60 +48,5 @@ export default { } \ No newline at end of file diff --git a/src/components/GuipInput.vue b/src/components/GuipInput.vue index 7a90d08..90a661f 100644 --- a/src/components/GuipInput.vue +++ b/src/components/GuipInput.vue @@ -1,11 +1,15 @@ - + + {{ desc }} + + + + + \ No newline at end of file + + \ No newline at end of file diff --git a/src/components/GuipRadio.vue b/src/components/GuipRadio.vue index c6947ad..d2ecd50 100644 --- a/src/components/GuipRadio.vue +++ b/src/components/GuipRadio.vue @@ -1,26 +1,85 @@ - - - - {{ text }} - - - - - \ No newline at end of file + + + + + {{ option.label }} + + + + + + + + + \ No newline at end of file diff --git a/src/components/GuipSelect.vue b/src/components/GuipSelect.vue index 1772644..1d64d9d 100644 --- a/src/components/GuipSelect.vue +++ b/src/components/GuipSelect.vue @@ -1,23 +1,49 @@ - - - - + + + {{ desc }} + + + + + + \ No newline at end of file diff --git a/src/components/GuipTable.vue b/src/components/GuipTable.vue index 0478808..6048c01 100644 --- a/src/components/GuipTable.vue +++ b/src/components/GuipTable.vue @@ -1,20 +1,52 @@ - + :border="border" + @selection-change="handleSelectionChange" + :style="{width: width? width :'100%'}"> + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/style/theme/common.scss b/src/style/theme/common.scss index 2df8bc7..d5706c1 100644 --- a/src/style/theme/common.scss +++ b/src/style/theme/common.scss @@ -150,6 +150,12 @@ body{ border-color: transparent; transition: all .5s; } +.el-select .el-input__inner:focus{ + border-color: transparent; +} +.el-select>.el-input{ + height: 100%; +} // select end // textarea start @@ -164,4 +170,150 @@ body{ transition: all .5s; outline: 3px solid #D8E9FA; } -// textarea end \ No newline at end of file +// textarea end + + +.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{ + content: ''; +} +.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label::after, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::after{ + content: url(../../assets/require.svg); + display: inline-block; + // background-image: url(../../assets/require.svg); + color: #ff4d4f; + margin-right: 4px; + margin-left: 4px; +} + +.form-item1{ + display: flex; + align-items: center; + label{ + min-width: 54px; + margin-right: 8px; + } + .form-item-top{ + height: 18px; + display: flex; + align-items: center; + text-align: left; + } + .form-item-bottom{ + flex: 1; + } + .rightdesc{ + flex: 1; + text-align: right; + font-size: 12px; + line-height: 13px; + letter-spacing: 0.08em; + font-variation-settings: "opsz" auto; + color: #8A9099; + } + .form-item{ + margin-bottom: 0; + } +} +.el-form-item__content{ + // width: 100%; + flex: 1; + position: relative; + .desc_right{ + position: absolute; + right: 0; + top: -40px; + margin: 0; + font-size: 12px; + line-height: 40px; + letter-spacing: 0.08em; + font-variation-settings: "opsz" auto; + color: #8A9099; + } + } +.w510{ + width: 510px; +} +.w388{ + width: 388px; +} +.form-item{ + display: flex; + align-items: center; +} +.column{ + display: flex; + flex-direction: column !important; + align-items: self-start; + .form-item-top{ + width: 100%; + margin-bottom: 12px; + justify-content: space-between; + } + .form-item-bottom{ + width: 100%; + } + .el-form-item__content{ + width: 100%; + } +} +.form-top-icon{ + display: flex; + align-items: center; + img{ + width: 16px; + height: 16px; + margin-right: 8px; + } + span{ + color: #1E2226; + } +} + + +// table start +.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{ + background-color: #F6F7FA; +} +.el-table td.el-table__cell{ + border-bottom: 1px solid#EAECF0; +} +.el-table--fit{ + border: 1px solid#EAECF0; +} +.el-button--text{ + padding: 0; + width: auto !important; + height: auto !important; +} +.el-table th.el-table__cell{ + background: #F6F7FA; + padding: 18px 0; +} +.el-table th.el-table__cell>.cell{ + padding-left: 16px; + padding-right: 16px; +} +.el-table .el-table__cell{ + padding: 18px 0; +} +.el-table .cell{ + padding-left: 16px; + padding-right: 16px; +} +.el-table .el-form-item{ + margin-bottom: 0; +} + +// table end + +// dialog--start +.el-dialog__footer{ + display: flex; + justify-content: center; +} +// dialog--end + +.flex{ + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/src/views/elementGroups.vue b/src/views/elementGroups.vue index a4a262f..8d319b4 100644 --- a/src/views/elementGroups.vue +++ b/src/views/elementGroups.vue @@ -1,38 +1,84 @@ + + 单选框: + + + 下拉框: - + 表格: - - + 全选按钮 + + + + + + + + + + + + + + {{ scope.row.price }} + + + - + + + + + + + + fixed="right" + label="操作" + width="100"> + + + 查看 + 编辑 + + - - + 文本域: + + 输入框: 随便写的 - 表单校验: - + + - - 表单左右布局 + + 表单左右布局(直接使用封装好的input) - - - - - - - 表单上下布局 - - - + addClass="w510" + v-model="form.username" label="Username" prop="username" :rules="usernameRules" + placeholder="这是自定义默认提11示语"/> - - 表单上下布局(带右侧文案) - - 这是右侧文案 + + 表单上下布局 (宽度 510 388 用的最多 已有这2种宽度类名设置) - - - 获取手机验证码 + + 获取手机验证码(布局也可更改,使用插槽自定义展示内容) + 表单Submit + +--------------------分割线0------------------------------ - - --> + + 打开弹框 + + + + + 这是一个自定义内容的弹框。 + + + @@ -235,7 +275,9 @@ import { rules } from "../assets/vabForm"; // @ is an alias to /src import GuipFormItem from '@/components/GuipFormItem.vue'; - import GuipForm from '@/components/GuipForm.vue'; + import GuipDialog from '@/components/GuipDialog.vue'; + import GuipRadio from '@/components/GuipRadio.vue'; +// import GuipForm from '@/components/GuipForm.vue'; import PhoneCode from '@/components/PhoneCode.vue'; import GuipButton from '@/components/GuipButton.vue'; // import GuipConfirm from '@/components/GuipConfirm.vue'; @@ -250,8 +292,9 @@ import { rules } from "../assets/vabForm"; components: { GuipTextarea, GuipTable, - GuipForm, - // GuipRadio, + // GuipForm, + GuipDialog, + GuipRadio, GuipFormItem, PhoneCode, GuipButton, @@ -262,14 +305,38 @@ import { rules } from "../assets/vabForm"; }, data(){ return { + dialogVisible: false,//是否展示弹框 + showCancelButton: true, // 控制是否显示取消按钮 + showCloseButton: true, // 控制是否显示关闭按钮 + // inputValue: '', form: { - username: '' + username: '', + language:'', }, + languageOptions: [ + { label: 'JavaScript', value: 'js' }, + { label: 'Python', value: 'py' }, + { label: 'Java', value: 'java', disabled: true }, // 禁用选项 + { label: 'Go', value: 'go' }, + ], rules: { username: [ { required: true, message: '请输入用户名', trigger: 'blur' } + ], + card: [ + { required: true, message: '请选择有效信息', trigger: 'blur' } + ], + language: [ + { required: true, message: '请选择语言', trigger: 'blur' }, + ], + phone: [ + { required: true, message: '请输入手机号', trigger: 'blur' } + ], + age: [ + { required: true, message: '请输入年龄', trigger: 'blur' } ] }, + usernameRules:[{ required: true, message: 'Username is required', trigger: 'blur' }],//单独自定义rules msg: "测试", title: "相关附件", edit: false, @@ -370,22 +437,25 @@ import { rules } from "../assets/vabForm"; height:'40px' }, styleObject1:{ - width:'300px', + width:'600px', height:'50px' }, plain:false, tableData: [{ date: '2016-05-03', name: '王小虎', - address: '上海市普陀区金沙江路 1518 弄' + address: '上海市普陀区金沙江路 1518 弄', + price:'20', }, { date: '2016-05-02', name: '王小虎', - address: '上海市普陀区金沙江路 1518 弄' + address: '上海市普陀区金沙江路 1518 弄', + price:'10', }, { date: '2016-05-04', name: '王小虎', - address: '上海市普陀区金沙江路 1518 弄' + address: '上海市普陀区金沙江路 1518 弄', + price:'200', }, { date: '2016-05-01', name: '王小虎', @@ -422,8 +492,46 @@ import { rules } from "../assets/vabForm"; } }, methods:{ + // 弹框相关方法---start + openDialog() { + this.dialogVisible = true; + }, + // 确认按钮事件 + handleConfirm() { + this.$message.success('点击了确认按钮'); + this.dialogVisible = false; + }, + // 取消按钮事件 + handleCancel() { + this.$message.warning('点击了取消按钮'); + this.dialogVisible = false; + }, + // 关闭弹框事件 + handleClose() { + this.$message.info('弹框已关闭'); + this.dialogVisible = false; + }, + dialogVisibleChange(data){ + console.log(data,'data098908090'); + }, + // 弹框相关方法---end + + // 选择表格某一项 点击 + handlePriceClick(row) { + this.currentRow = row; + this.editedPrice = row.price; + this.dialogVisible = true; + }, + // 监听单选框组变化 + radioChange(data){ + console.log(data,'radio--data'); + }, + handleClick(row) { + console.log(row); + }, submitForm() { - this.$refs.myForm.validate((valid) => { + this.$refs.formRef.validate((valid) => { + console.log(this.form,'======formxinxi'); if (valid) { alert('提交成功!'); } else { @@ -431,8 +539,12 @@ import { rules } from "../assets/vabForm"; } }); }, + // 重置表单 + resetForm() { + this.$refs.form.resetFields(); + }, triggerError() { - this.$refs.myForm.validateField('username', (error) => { + this.$refs.formRef.validateField('username', (error) => { if (error) { console.log('错误信息:', error); } else { @@ -440,10 +552,6 @@ import { rules } from "../assets/vabForm"; } }); }, - // 监听单选框组变化 - radioChange() { - // console.log(this.radio,'====='); - }, getFormdata(){ console.log(this.$refs.GuipInput.value); }, @@ -467,6 +575,24 @@ import { rules } from "../assets/vabForm"; }); this.formList = dataList; }, + save() { + this.$refs.VabForm.submitForm("ruleForm"); + }, + //取消 + cancellation() { + this.$refs.VabForm.resetForm("ruleForm"); + }, + // 表格点击、选择 + handleSelectionChange(data){ + // 多选模式下的时候 data 为数组格式 + // 单选的时候是 对象 + console.log(data,'表格行信息'); + }, + // 全选按钮 + toggleAllSelection() { + // console.log(this.$refs.multipleTable,'this.$refs.multipleTable'); + this.$refs.multipleTable.$refs.guiptable.toggleAllSelection(); + }, }, mounted() { this.getList(); @@ -492,5 +618,24 @@ import { rules } from "../assets/vabForm"; } } } + + +.ScaleBox { + width: 1000px; + background-size: 100% 100%; + -ms-transition: 0.3s; + transition: 0.3s; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + margin: 0 auto; +} +.cardfooter { + width: 100%; +// position: fixed; + bottom: 20px; + right: 30px; + text-align: right; + justify-content: center; +} \ No newline at end of file
{{ desc }}
这是一个自定义内容的弹框。