parent
ff19f4ddbe
commit
49861c1923
27
src/main.js
27
src/main.js
|
@ -74,3 +74,30 @@ new Vue({
|
|||
components: { App },
|
||||
template: '<App/>'
|
||||
})
|
||||
|
||||
/**
|
||||
* json格式转树状结构
|
||||
* @param {json} json数据
|
||||
* @param {String} id的字符串
|
||||
* @param {String} 父id的字符串
|
||||
* @param {String} children的字符串
|
||||
* @return {Array} 数组
|
||||
*/
|
||||
Vue.prototype.listTransTree = function(json, idStr, pidStr, chindrenStr) {
|
||||
// eslint-disable-next-line one-var
|
||||
var r = [], hash = {}, id = idStr, pid = pidStr, children = chindrenStr, i = 0, j = 0, len = json.length
|
||||
for (; i < len; i++) {
|
||||
hash[json[i][id]] = json[i]
|
||||
}
|
||||
for (; j < len; j++) {
|
||||
// eslint-disable-next-line one-var
|
||||
var aVal = json[j], hashVP = hash[aVal[pid]]
|
||||
if (hashVP) {
|
||||
!hashVP[children] && (hashVP[children] = [])
|
||||
hashVP[children].push(aVal)
|
||||
} else {
|
||||
r.push(aVal)
|
||||
}
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
|
|
@ -437,10 +437,7 @@ export default {
|
|||
}
|
||||
var hasCARD = (rule, value, callback) => {
|
||||
requestFN(
|
||||
'/user/hasUserCARD',
|
||||
{
|
||||
CARD_ID: value
|
||||
}
|
||||
'/user/goCheck?CARD_NO=' + value
|
||||
).then((data) => {
|
||||
if (data.pd) {
|
||||
callback(new Error('身份证号已存在'))
|
||||
|
@ -648,7 +645,7 @@ export default {
|
|||
},
|
||||
{ validator: hasCARD, trigger: 'blur' }
|
||||
],
|
||||
EMAIL: [{ required: true, message: '电子邮箱不能为空', trigger: 'blur' }],
|
||||
// EMAIL: [{ required: true, message: '电子邮箱不能为空', trigger: 'blur' }],
|
||||
AGE: [{ required: true, message: '年龄不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^\d{2}$/,
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="CARD_ID" class="input-width">
|
||||
<el-input v-model="form.CARD_ID" placeholder="这里输入身份证号..."/>
|
||||
<el-input v-model="form.CARD_ID" placeholder="这里输入身份证号..." @blur="goCheck()"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -91,7 +91,13 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电子邮箱" prop="EMAIL" class="input-width">
|
||||
<el-input v-model="form.EMAIL" placeholder="这里输入电子邮箱..."/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="民族" prop="NATIONALITY">
|
||||
|
|
Loading…
Reference in New Issue