Commit c9591a4d by 彭祥礼

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

parent cdfbd68b
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="学校名称"> <a-form-item label="学校名称">
<a-input placeholder="学校名称" v-model="queryParam.productUniversity" ></a-input> <a-input placeholder="学校名称" v-model="queryParam.productUniversity"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="12" :sm="12"> <a-col :md="12" :sm="12">
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
</div> </div>
<!--列表--> <!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" :locale="emptyText"> <s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling"
:locale="emptyText">
<!--拦截器--> <!--拦截器-->
<template slot="productLastUpdateTime" slot-scope="text"> <template slot="productLastUpdateTime" slot-scope="text">
{{ text | dayjs}} {{ text | dayjs}}
...@@ -52,7 +53,8 @@ ...@@ -52,7 +53,8 @@
</template> </template>
</s-table> </s-table>
<!----弹框--> <!----弹框-->
<a-modal :title="add ?'添加宽带': '编辑宽带'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px"> <a-modal :title="add ?'添加宽带': '编辑宽带'" :visible="modifyvisible" @ok="createfunctionOk"
@cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-drawer <a-drawer
title="适用学校详情" title="适用学校详情"
placement="right" placement="right"
...@@ -73,33 +75,62 @@ ...@@ -73,33 +75,62 @@
<p><span>计费属性:{{chouti.universityChargingAttribute}}</span></p> <p><span>计费属性:{{chouti.universityChargingAttribute}}</span></p>
<p><span>学校联系号码:{{chouti.universityContactPhone}}</span></p> <p><span>学校联系号码:{{chouti.universityContactPhone}}</span></p>
</a-drawer> </a-drawer>
<a-drawer
title="正则校检详情"
placement="right"
:closable="false"
@close="visibleT2 = false"
:visible="visibleT2"
width=" 40%"
>
<p><span>正则名称:{{regular.name}}</span></p>
<p><span>正则表达示:{{regular.regular}}</span></p>
<p><span>错误提示:{{regular.tips}}</span></p>
<p><span>输入框默认提示:{{regular.placeholder}}</span></p>
</a-drawer>
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带标题:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带标题:">
<a-input placeholder="宽带标题" v-decorator="[ 'productTitle', {rules: [{ required: true, message: '宽带标题不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="宽带标题"
v-decorator="[ 'productTitle', {rules: [{ required: true, message: '宽带标题不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="区域:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="区域:">
<a-input placeholder="区域" v-decorator="[ 'productRegion', {rules: [{ required: true, message: '区域不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="区域"
v-decorator="[ 'productRegion', {rules: [{ required: true, message: '区域不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="资费:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="资费:">
<a-input placeholder="资费" v-decorator="[ 'productPrice', {rules: [{required: true, message: '资费不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="资费"
v-decorator="[ 'productPrice', {rules: [{required: true, message: '资费不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带速率:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带速率:">
<a-input placeholder="宽带速率" v-decorator="[ 'productMeal', {rules: [{ required: true, message: '宽带速率不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="宽带速率"
v-decorator="[ 'productMeal', {rules: [{ required: true, message: '宽带速率不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="包年包月情况:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="包年包月情况:">
<a-input placeholder="包年包月情况" v-decorator="[ 'productRate', {rules: [{ required: true, message: '包年包月情况不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="包年包月情况"
v-decorator="[ 'productRate', {rules: [{ required: true, message: '包年包月情况不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="适用学校:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="适用学校:">
<a-select v-model="universityName" style="width: 330px"> <a-select v-model="universityName" style="width: 330px">
<a-select-option @click="universitySchoolName('请选择')" value="请选择">请选择</a-select-option> <a-select-option @click="universitySchoolName('请选择')" value="请选择">请选择</a-select-option>
<a-select-option @click="universitySchoolName(item)" v-for="item in universitySchool" :value="item.universityId">{{item.universityName}}</a-select-option> <a-select-option @click="universitySchoolName(item)" v-for="item in universitySchool" :value="item.universityId">
{{item.universityName}}
</a-select-option>
</a-select> </a-select>
<a @click="visibleT = true">详情</a> <a @click="visibleT = true">详情</a>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="套餐情况:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="套餐情况:">
<a-input :rows="10" v-model="modelData.productMealPrice"/> <a-input :rows="10" v-model="modelData.productMealPrice"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则验证名:">
<a-select v-model="regularName" style="width: 330px">
<a-select-option @click="regularsName('请选择')" value="请选择">请选择</a-select-option>
<a-select-option @click="regularsName(item)" v-for="item in regulars" :value="item.regularId">
{{item.regularName}}
</a-select-option>
</a-select>
<a @click="visibleT2 = true">详情</a>
</a-form-item>
<div v-show="!add"> <div v-show="!add">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="状态"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="状态">
<a-select placeholder="状态" v-decorator="[ 'productState']"> <a-select placeholder="状态" v-decorator="[ 'productState']">
...@@ -123,42 +154,54 @@ ...@@ -123,42 +154,54 @@
<script> <script>
import STable from '@/components/table'; import STable from '@/components/table';
import {productList,productDelete,productInsert,productUpdate,universitySchool} from "@/api/school-center/productAPI" import {
productList,
productDelete,
productInsert,
productUpdate,
universitySchool
} from "@/api/school-center/productAPI"
import {cloneObject} from '@/utils/util'; import {cloneObject} from '@/utils/util';
export default { export default {
name: "product", name: "product",
components: { components: {
STable, STable,
}, },
data(){ data() {
return { return {
universityIdtrue:true, universityIdtrue: true,
universityName:'', universityName: '',
visibleT:false, regularName: '',
chouti:{}, visibleT: false,
universitySchool:[], visibleT2: false,
chouti: {},
regular: {},
universitySchool: [],
regulars: [],
emptyText: {emptyText: '暂无数据'}, emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this), Formtable: this.$form.createForm(this),
modifyvisible: false, modifyvisible: false,
add: true, add: true,
productIntroduction:"", productIntroduction: "",
productSetMealIntroduction:'', productSetMealIntroduction: '',
queryParam: { queryParam: {
productUniversity :'', //适用学校 productUniversity: '', //适用学校
productRegion :'', // 区域 productRegion: '', // 区域
productTitle :'', //宽带标题 productTitle: '', //宽带标题
productState :'' // 宽带狀態 productState: '' // 宽带狀態
}, },
modelData:{ modelData: {
universityId:'', universityId: '',
productMealPrice:'', productMealPrice: '',
productMeal:'', productMeal: '',
productTitle:'', productTitle: '',
productUniversity:'', productUniversity: '',
productPrice:'', productPrice: '',
productRegion:'', productRegion: '',
productRate:'', productRate: '',
productId:'' productId: '',
productIntroductionPic2: ''
}, },
columns: [ columns: [
{dataIndex: 'productTitle', width: 200, title: '宽带标题 '}, {dataIndex: 'productTitle', width: 200, title: '宽带标题 '},
...@@ -166,8 +209,18 @@ ...@@ -166,8 +209,18 @@
{dataIndex: 'productPrice', width: 80, title: '资费 '}, {dataIndex: 'productPrice', width: 80, title: '资费 '},
{dataIndex: 'productRegion', width: 80, title: '县分'}, {dataIndex: 'productRegion', width: 80, title: '县分'},
{dataIndex: 'productCreater', width: 80, title: '创建人 '}, {dataIndex: 'productCreater', width: 80, title: '创建人 '},
{dataIndex: 'productLastUpdateTime', width: 200, title: '更新时间 ' ,scopedSlots: {customRender: 'productLastUpdateTime'}}, {
{dataIndex: 'productCreateTime', width: 200, title: '创建时间 ', scopedSlots: {customRender: 'productCreateTime'}}, dataIndex: 'productLastUpdateTime',
width: 200,
title: '更新时间 ',
scopedSlots: {customRender: 'productLastUpdateTime'}
},
{
dataIndex: 'productCreateTime',
width: 200,
title: '创建时间 ',
scopedSlots: {customRender: 'productCreateTime'}
},
{dataIndex: 'productState', width: 80, title: '状态 ', scopedSlots: {customRender: 'productState'}}, {dataIndex: 'productState', width: 80, title: '状态 ', scopedSlots: {customRender: 'productState'}},
{dataIndex: 'productMealPrice', width: 200, title: '套餐情况 ', scopedSlots: {customRender: 'text'}}, {dataIndex: 'productMealPrice', width: 200, title: '套餐情况 ', scopedSlots: {customRender: 'text'}},
{dataIndex: 'productRate', width: 120, title: '包年包月情况 '}, {dataIndex: 'productRate', width: 120, title: '包年包月情况 '},
...@@ -189,7 +242,7 @@ ...@@ -189,7 +242,7 @@
} }
let obj = cloneObject(this.queryParam) let obj = cloneObject(this.queryParam)
//表示 //表示
return productList(Object.assign(params,obj)).then(res => { return productList(Object.assign(params, obj)).then(res => {
let data = {} let data = {}
if (res.state !== 'success') { if (res.state !== 'success') {
this.$message.error("查询失败!", 5); this.$message.error("查询失败!", 5);
...@@ -201,11 +254,12 @@ ...@@ -201,11 +254,12 @@
totalCount: 0 totalCount: 0
} }
} else { } else {
this.regulars = res.data.regulars;
data = { data = {
data: res.data.records, data: res.data.page.records,
pageSize: parameter.pageSize, pageSize: parameter.pageSize,
pageNo: parameter.pageNo, pageNo: parameter.pageNo,
totalCount: res.data.total totalCount: res.data.page.total
} }
} }
return data return data
...@@ -213,14 +267,23 @@ ...@@ -213,14 +267,23 @@
} }
} }
}, },
methods:{ methods: {
universitySchoolName(item){ universitySchoolName(item) {
if(item == '请选择'){ if (item == '请选择') {
this.modelData.productUniversity=item this.modelData.universityId = ''
}else { } else {
this.modelData.productUniversity=item.universityName this.modelData.productUniversity = item.universityName
this.modelData.universityId=item.universityId this.modelData.universityId = item.universityId
this.chouti=item this.chouti = item
}
},
regularsName(item) {
if (item == '请选择') {
this.modelData.productIntroductionPic2 = ''
} else {
this.modelData.productIntroductionPic2 = item.id
this.name = item.name
this.regular = item
} }
}, },
search() { search() {
...@@ -228,82 +291,90 @@ ...@@ -228,82 +291,90 @@
}, },
remove(id) { remove(id) {
productDelete(id).then((res) => { productDelete(id).then((res) => {
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}) })
}, },
modifyfunction(data){ modifyfunction(data) {
universitySchool().then(res => { universitySchool().then(res => {
this.universitySchool=res.data this.universitySchool = res.data
res.data.forEach(value=>{ res.data.forEach(value => {
if(data.universityId == value.universityId){ if (data.universityId == value.universityId) {
this.chouti = value this.chouti = value
} }
}) })
console.log(this.universitySchool) console.log(this.universitySchool)
}) })
if(data != undefined ){ if (data != undefined) {
this.productIntroduction=data.productIntroduction, this.productIntroduction = data.productIntroduction
this.productSetMealIntroduction=data.productSetMealIntroduction, this.productSetMealIntroduction = data.productSetMealIntroduction
this.modelData.productMealPrice=data.productMealPrice this.modelData.productMealPrice = data.productMealPrice
this.modelData.productUniversity=data.productUniversity this.modelData.productUniversity = data.productUniversity
this.universityName=data.productUniversity this.universityName = data.productUniversity
this.modelData.universityId=data.universityId for (var i = 0; i < this.regulars.length; i++) {
this.modelData.productId=data.productId if (data.productIntroductionPic2 == this.regulars[i].regularId + '') {
setTimeout(()=>{ this.regularName = this.regulars[i].regularName
this.modelData.productIntroductionPic2 = this.regulars[i].regularId
}
}
this.modelData.universityId = data.universityId
this.modelData.productId = data.productId
setTimeout(() => {
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"productMeal":data.productMeal, "productMeal": data.productMeal,
"productTitle":data.productTitle, "productTitle": data.productTitle,
"productPrice":data.productPrice, "productPrice": data.productPrice,
"productRegion":data.productRegion, "productRegion": data.productRegion,
"productRate":data.productRate, "productRate": data.productRate,
productState:data.productState "productState": data.productState
}) })
},0) }, 0)
this.add=false; this.add = false;
}else { } else {
this.universityName='请选择' this.universityName = '请选择'
this.regularName = "请选择";
} }
this.modifyvisible=true; this.modifyvisible = true;
}, },
createfunctionOk(){ createfunctionOk() {
if(this.modelData.universityId == '' || this.modelData.universityId == undefined || this.modelData.productUniversity=='请选择'){ if (this.modelData.universityId == '' || this.modelData.universityId == undefined || this.modelData.productUniversity == '请选择') {
this.$notification.error({message: '请选择适用学校', duration: 4}) this.$notification.error({message: '请选择适用学校', duration: 4})
return return
} }
let that = this; let that = this;
that.Formtable.validateFields(['productMeal','productTitle','productPrice','productRegion','productRate','productState'], {force: true}, (err, values) => { that.Formtable.validateFields(['productMeal', 'productTitle', 'productPrice', 'productRegion', 'productRate', 'productState'], {force: true}, (err, values) => {
if (err ) { if (err) {
return; return;
} }
that.modelData.productMeal=values.productMeal that.modelData.productMeal = values.productMeal
that.modelData.productTitle=values.productTitle that.modelData.productTitle = values.productTitle
that.modelData.productPrice=values.productPrice that.modelData.productPrice = values.productPrice
that.modelData.productRegion=values.productRegion that.modelData.productRegion = values.productRegion
that.modelData.productRate=values.productRate that.modelData.productRate = values.productRate
that.modelData.productState=values.productState that.modelData.productState = values.productState
if(this.add){ if (this.add) {
let obj= that.modelData; let obj = that.modelData;
delete obj.productId delete obj.productId
let product= JSON.stringify(obj); let product = JSON.stringify(obj);
productInsert({product}).then((res) => { productInsert({product}).then((res) => {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
this.search() this.search()
}) })
}else { } else {
let obj= that.modelData; let obj = that.modelData;
let product= JSON.stringify(obj); let product = JSON.stringify(obj);
productUpdate({product}).then((res) => { productUpdate({product}).then((res) => {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
this.search() this.search()
...@@ -311,28 +382,29 @@ ...@@ -311,28 +382,29 @@
} }
}) })
}, },
createfunctionCancel(){ createfunctionCancel() {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
this.add=true; this.add = true;
}, },
//清除弹窗信息 //清除弹窗信息
clearmodel() { clearmodel() {
this.add=true this.add = true
let that = this; let that = this;
that.modelData.productMealPrice='' that.modelData.productMealPrice = ''
that.modelData.productId='' that.modelData.productId = ''
that.modelData.productIntroduction='' that.modelData.productIntroduction = ''
that.modelData.productSetMealIntroduction='' that.modelData.productSetMealIntroduction = ''
that.modelData.productUniversity='', that.modelData.productUniversity = ''
that.modelData.universityId='', that.modelData.universityId = ''
that.modelData.productIntroductionPic2 = ''
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
productMeal:'', productMeal: '',
productTitle:'', productTitle: '',
productPrice:'', productPrice: '',
productRegion:'', productRegion: '',
productRate:'', productRate: '',
productState:'0' productState: '0'
}) })
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="正则名称"> <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-form-item>
</a-col> </a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;"> <span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
<span> <span>
<a @click="modifyfunction(record)">编辑</a> <a @click="modifyfunction(record)">编辑</a>
<a-divider type="vertical"/> <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>隐藏</a>
</a-popconfirm> </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>显示</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
...@@ -51,11 +51,11 @@ ...@@ -51,11 +51,11 @@
<!----弹框--> <!----弹框-->
<a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px"> <a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="id:"> <a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="">
<a-input placeholder="id" v-decorator="[ 'id', {rules: [{ required: true, message: 'id' ,validator: 'click'}]} ]"></a-input> <a-input placeholder="regularId" v-decorator="[ 'regularId', {rules: [{ required: true, message: 'regularId' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则名称:"> <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>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则表达示:"> <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> <a-input placeholder="正则表达示" v-decorator="[ 'regular', {rules: [{ required: true, message: '表达示不能为空!' ,validator: 'click'}]} ]"></a-input>
...@@ -66,6 +66,12 @@ ...@@ -66,6 +66,12 @@
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="输入框默认值:"> <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-input placeholder="输入框默认值" v-decorator="[ 'placeholder', {rules: [{ required: true, message: '外线方式不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item> </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-form>
</a-modal> </a-modal>
</div> </div>
...@@ -87,32 +93,31 @@ ...@@ -87,32 +93,31 @@
modifyvisible: false, modifyvisible: false,
add: true, add: true,
queryParam: { queryParam: {
name :'', //学校 regularName :'',
}, },
modelData:{ modelData:{
id: '', regularId: '',
name:'', regularName:'',
regular:'', regular:'',
tips:'', tips:'',
placeholder:'', placeholder:'',
isShow:'' isShow: '1'
}, },
columns: [ columns: [
{dataIndex: 'id', width: 20, title: 'id',istrue: true}, {dataIndex: 'regularId', width: 20, title: 'regularId',istrue: true},
{dataIndex: 'name', width: 100, title: '正则名称'}, {dataIndex: 'regularName', width: 70, title: '正则名称'},
{dataIndex: 'regular', width: 100, title: '正则表达示 '}, {dataIndex: 'regular', width: 100, title: '正则表达示 '},
{dataIndex: 'tips', width: 100, title: '错误提示'}, {dataIndex: 'tips', width: 70, title: '错误提示'},
{dataIndex: 'placeholder', width: 100, title: '输入框默认提示 '}, {dataIndex: 'placeholder', width: 70, title: '输入框默认提示 '},
{ {
dataIndex: 'operation', dataIndex: 'operation',
width: 40, width: 26,
title: '操作', title: '操作',
scopedSlots: {customRender: 'operation'}, scopedSlots: {customRender: 'operation'},
fixed: "right" fixed: "right"
}] }]
, ,
rowdata: parameter => { rowdata: parameter => {
let params = { let params = {
pageNo: parameter.pageNo, pageNo: parameter.pageNo,
pageSize: parameter.pageSize pageSize: parameter.pageSize
...@@ -147,8 +152,8 @@ ...@@ -147,8 +152,8 @@
search() { search() {
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
remove(id,isShow) { remove(regularId,isShow) {
regularDelete({'id':id,'isShow':isShow}).then((res) => { regularDelete({'regularId':regularId,'isShow':isShow}).then((res) => {
if(res.state=="success"){ if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
...@@ -157,11 +162,11 @@ ...@@ -157,11 +162,11 @@
}, },
modifyfunction(data){ modifyfunction(data){
if(data != undefined ){ if(data != undefined ){
this.modelData.regularId=data.regularId
setTimeout(()=>{ setTimeout(()=>{
this.modelData.id=data.uid
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"id":data.id, "regularId":data.regularId,
"name":data.name, "regularName":data.regularName,
"regular":data.regular, "regular":data.regular,
"tips":data.tips, "tips":data.tips,
"placeholder":data.placeholder, "placeholder":data.placeholder,
...@@ -174,11 +179,11 @@ ...@@ -174,11 +179,11 @@
}, },
createfunctionOk(){ createfunctionOk(){
let that = this; 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 ) { if (err ) {
return; return;
} }
that.modelData.name=values.name that.modelData.regularName=values.regularName
that.modelData.regular=values.regular that.modelData.regular=values.regular
that.modelData.tips=values.tips that.modelData.tips=values.tips
that.modelData.placeholder=values.placeholder that.modelData.placeholder=values.placeholder
...@@ -217,9 +222,9 @@ ...@@ -217,9 +222,9 @@
//清除弹窗信息 //清除弹窗信息
clearmodel() { clearmodel() {
this.add=true this.add=true
this.modelData.id='' this.modelData.regularId=''
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"name":'', "regularName":'',
"regular":'', "regular":'',
"tips":'', "tips":'',
"placeholder":'', "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