| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <el-card shadow="never" style="border: 0;">
- <yun-form
- ref="yunform"
- @render="onFormRender"
- @submit="onSubmit"
- @success="onSuccess"
- @fail="onFail"
- :data="row"
- :columns="columns">
- <template #default>
- {:token_field()}
- </template>
-
- </yun-form>
- </el-card>
- </template>
- <script>
- import form from "@components/Form.js";
- export default{
- components:{
- 'YunForm':form
- },
- data:{
- columns:[
- {field:"id",title:"ID",edit:"hidden"},
- {field:"shop_id",title:"店铺名称",searchList:Yunqi.data.shopList,edit: 'select',rules:'required'},
- ],
- row:Yunqi.data.row || {}
- },
- //页面加载完成时执行
- onLoad:function(query){
- console.log(query);
- },
- //页面初始显示或在框架内显示时执行
- onShow:function(){
- },
- //页面在框架内隐藏时执行
- onHide:function(){
- },
- //页面在框架内关闭时执行
- onUnload:function(){
- },
- methods: {
- onFormRender:function(rows){
- //表单渲染完成后执行
- },
- onSubmit:function(rows){
- //表单提交前执行,返回false可以阻止表单提交
- /**
- * form常用方法
- * this.$refs.yunform.setError(field,message);//聚焦表单项并显示错误信息
- * this.$refs.yunform.hideField(field);//隐藏表单项
- * this.$refs.yunform.showField(field);//显示表单项
- * this.$refs.yunform.setValue(field,value);//为表单项设置值
- * this.$refs.yunform.getValue(field);//为获取表单项的值
- * this.$refs.yunform.setField(field,key,value);//修改表单json的其他属性值,比如rules,title,searchList等
- */
- return true;
- },
- onSuccess:function(response){
- //表单提交成功后执行
- },
- onFail:function(err){
- //表单提交失败后执行
- }
- }
- }
- </script>
- <style>
- </style>
|