Commit c9591a4d by 彭祥礼

宽带产品增加正则验证选择

parent cdfbd68b
......@@ -7,7 +7,7 @@
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="正则名称">
<a-input placeholder="正则名称" v-model="queryParam.name" ></a-input>
<a-input placeholder="正则名称" v-model="queryParam.regularName" ></a-input>
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
......@@ -39,10 +39,10 @@
<span>
<a @click="modifyfunction(record)">编辑</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定不显示吗" v-if="record.isShow == 1" @confirm="remove(record.id,0)">
<a-popconfirm title="确定不显示吗" v-if="record.isShow == 1" @confirm="remove(record.regularId,0)">
<a>隐藏</a>
</a-popconfirm>
<a-popconfirm title="确定显示吗" v-if="record.isShow == 0" @confirm="remove(record.id,1)">
<a-popconfirm title="确定显示吗" v-if="record.isShow == 0" @confirm="remove(record.regularId,1)">
<a>显示</a>
</a-popconfirm>
</span>
......@@ -51,11 +51,11 @@
<!----弹框-->
<a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable">
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="id:">
<a-input placeholder="id" v-decorator="[ 'id', {rules: [{ required: true, message: 'id' ,validator: 'click'}]} ]"></a-input>
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="">
<a-input placeholder="regularId" v-decorator="[ 'regularId', {rules: [{ required: true, message: 'regularId' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则名称:">
<a-input placeholder="正则名称" v-decorator="[ 'name', {rules: [{ required: true, message: '学校名称不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="正则名称" v-decorator="[ 'regularName', {rules: [{ required: true, message: '学校名称不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则表达示:">
<a-input placeholder="正则表达示" v-decorator="[ 'regular', {rules: [{ required: true, message: '表达示不能为空!' ,validator: 'click'}]} ]"></a-input>
......@@ -66,6 +66,12 @@
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="输入框默认值:">
<a-input placeholder="输入框默认值" v-decorator="[ 'placeholder', {rules: [{ required: true, message: '外线方式不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="是否显示:">
<a-select v-decorator="[ 'isShow' ]" style="width: 330px">
<a-select-option key="1"></a-select-option>
<a-select-option key="0"></a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
</div>
......@@ -87,32 +93,31 @@
modifyvisible: false,
add: true,
queryParam: {
name :'', //学校
regularName :'',
},
modelData:{
id: '',
name:'',
regularId: '',
regularName:'',
regular:'',
tips:'',
placeholder:'',
isShow:''
isShow: '1'
},
columns: [
{dataIndex: 'id', width: 20, title: 'id',istrue: true},
{dataIndex: 'name', width: 100, title: '正则名称'},
{dataIndex: 'regularId', width: 20, title: 'regularId',istrue: true},
{dataIndex: 'regularName', width: 70, title: '正则名称'},
{dataIndex: 'regular', width: 100, title: '正则表达示 '},
{dataIndex: 'tips', width: 100, title: '错误提示'},
{dataIndex: 'placeholder', width: 100, title: '输入框默认提示 '},
{dataIndex: 'tips', width: 70, title: '错误提示'},
{dataIndex: 'placeholder', width: 70, title: '输入框默认提示 '},
{
dataIndex: 'operation',
width: 40,
width: 26,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}]
,
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
......@@ -147,8 +152,8 @@
search() {
this.$refs.table.refresh({search: true})
},
remove(id,isShow) {
regularDelete({'id':id,'isShow':isShow}).then((res) => {
remove(regularId,isShow) {
regularDelete({'regularId':regularId,'isShow':isShow}).then((res) => {
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
......@@ -157,11 +162,11 @@
},
modifyfunction(data){
if(data != undefined ){
this.modelData.regularId=data.regularId
setTimeout(()=>{
this.modelData.id=data.uid
this.Formtable.setFieldsValue({
"id":data.id,
"name":data.name,
"regularId":data.regularId,
"regularName":data.regularName,
"regular":data.regular,
"tips":data.tips,
"placeholder":data.placeholder,
......@@ -174,11 +179,11 @@
},
createfunctionOk(){
let that = this;
that.Formtable.validateFields(['name','regular','tips','placeholder','isShow'], {force: true}, (err, values) => {
that.Formtable.validateFields(['regularName','regular','tips','placeholder','isShow'], {force: true}, (err, values) => {
if (err ) {
return;
}
that.modelData.name=values.name
that.modelData.regularName=values.regularName
that.modelData.regular=values.regular
that.modelData.tips=values.tips
that.modelData.placeholder=values.placeholder
......@@ -217,9 +222,9 @@
//清除弹窗信息
clearmodel() {
this.add=true
this.modelData.id=''
this.modelData.regularId=''
this.Formtable.setFieldsValue({
"name":'',
"regularName":'',
"regular":'',
"tips":'',
"placeholder":'',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment