Commit 90e1db50 by 严立

修复问题

parent f5081806
......@@ -2346,6 +2346,25 @@
"esutils": "^2.0.2"
}
},
"babel-polyfill": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
"dev": true,
"requires": {
"babel-runtime": "^6.26.0",
"core-js": "^2.5.0",
"regenerator-runtime": "^0.10.5"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
"dev": true
}
}
},
"babel-preset-env": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz",
......
......@@ -22,6 +22,7 @@
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
......
let output = {
// 开发路径
// base: 'http://bid-server.meiqicloud.com/',
// resources: 'http://bid-web.meiqicloud.com/',
// agentSignIn: 'http://bid-vue.meiqicloud.com/'
base: 'http://bid-server.meiqicloud.com/',
resources: 'http://bid-web.meiqicloud.com/',
agentSignIn: 'http://bid-vue.meiqicloud.com/'
// 正式路径
base: '/Api/',
resources: 'http://bid-web.meiqicloud.com',
agentSignIn: 'http://bid-vue.meiqicloud.com/'
// base: '/Api/',
// resources: 'http://bid-web.meiqicloud.com',
// agentSignIn: 'http://bid-vue.meiqicloud.com/'
}
output.uploadFile = output.base + 'bid/common/webupload/upload'
......
......@@ -52,7 +52,6 @@ let output = {
let funStatus = funcXMLHttpRequest.status
if ((funStatus >= 200 && funStatus < 300) || funStatus === 304) {
try {
let funcInterceptorsResponse = iInterceptors.response(funcConfigure, funcXMLHttpRequest.responseText)
if (funcInterceptorsResponse.state) {
funcResolve(funcInterceptorsResponse.response)
......@@ -67,6 +66,8 @@ let output = {
funcReject(funcResponse.response)
}
}
}).catch((funcError) => {
console.log('catch', funcError)
})
return funcPromise
}
......@@ -108,18 +109,12 @@ let output = {
funcReject(funcResponse.response)
}
}
}).catch((funcError) => {
console.log('catch', funcError)
})
return funcPromise
}
},
get: function () {
},
post: function () {
},
}
export default output
\ No newline at end of file
......@@ -2,7 +2,7 @@
<!-- 通用组件 - 底部 -->
<div class="components-skill row">
<div v-for="(list, index) in skillList" :key="index" class="row">
<el-select v-model="selectItem[index]" :value="selectItem[index]" value-key="value" placeholder="请选择" @change="(item) => { onSelect(item, index) }">
<el-select v-model="selectionItem[index]" :value="selectionItem[index]" value-key="value" placeholder="请选择" @change="(item) => { onSelection(item, index) }">
<el-option v-for="item in list" :key="item.value" :label="item.label" :value="item"></el-option>
</el-select>
</div>
......@@ -19,11 +19,10 @@
data () {
return {
skillRawData: {},
skillAll: [], // 原始数据
skillList: [], // 列表数据
selectItem: [], // 选择对象
selectIndex: [], // 选择索引缓存
selectIndexBuffer: [], // 选择索引缓存
selectionItem: [], // 选择对象
selectionIndex: [0, 0, 0, 0, 0], // 选择索引缓存
}
},
......@@ -43,9 +42,7 @@
},
componentSkill: {
handler: function (funcNewValue, funcOldValue) {
if (funcNewValue.length > 1 && funcNewValue[this.identity]) {
this.selectIndexBuffer = funcNewValue
}
},
deep: true,
immediate: true,
......@@ -54,161 +51,106 @@
},
created: function () {
this.setSkillRawData()
this.querySkill()
},
methods: {
setSkillRawData: function () {
let funcSelectIndexBuffer
querySkill: function () {
if (this.$store.getters.componentSkillData.length) {
funcSelectIndexBuffer = this.$store.getters.componentSkill[this.identity]
this.skillAll = this.$store.getters.componentSkillData
this.skillRawData = this.$store.getters.componentSkillData
this.selectIndexBuffer = funcSelectIndexBuffer ? funcSelectIndexBuffer : []
this.setSkillList(0, this.skillRawData)
// 读取选择缓存
this.selectionIndex = this.$store.getters.componentSkill[this.identity]
if (!this.selectionIndex) this.selectionIndex = [0, 0, 0, 0, 0]
this.ergodicSkill(this.skillAll)
} else {
iRequest.request(iHost.base + 'bid/common/getApiProjectTypeOptions', {}, 'json', 'get')
.then((funcResponse) => {
funcSelectIndexBuffer = this.$store.getters.componentSkill[this.identity]
this.skillAll = funcResponse
this.$store.commit('componentSkillData', this.skillAll)
this.skillRawData = funcResponse
this.selectIndexBuffer = funcSelectIndexBuffer ? funcSelectIndexBuffer : []
this.selectionIndex = this.$store.getters.componentSkill[this.identity]
if (!this.selectionIndex) this.selectionIndex = [0, 0, 0, 0, 0]
// 记录原始数据避免重复请求
this.setSkillList(0, this.skillRawData)
this.$store.commit('componentSkillData', this.skillRawData)
})
.catch((funcError) => {
console.log('iRequest', funcError)
this.ergodicSkill(this.skillAll)
})
}
},
setSkillList: function (funcRankIndex, funcSkillData) {
console.log(funcRankIndex)
console.log(funcSkillData)
function createSkillList () {
if (!funcSkillData) return
ergodicSkill: function (funcSkillAll) {
function setSkillOption (funcSelectionIndex, funcSkillList) {
let funcList = []
for (let i = 0, len = funcSkillData.length; i < len; i++) {
for (let i = 0, l = funcSkillList.length; i < l; i++) {
let funcItem = {
'index': i,
'value': funcSkillData[i].value,
'label': funcSkillData[i].label,
'isChildren': funcSkillData[i].children ? true : false
'value': funcSkillList[i].value,
'label': funcSkillList[i].label,
'isChildren': funcSkillList[i].children ? true : false
}
funcList.push(funcItem)
}
funcSkillOption.push(funcList)
funcSkillItem.push(funcList[funcSelectionIndex])
This.$set(This.skillList, funcRankIndex, funcList)
This.$set(This.selectIndex, funcRankIndex, This.selectIndexBuffer[funcRankIndex] ? This.selectIndexBuffer[funcRankIndex] : 0)
This.$set(This.selectItem, funcRankIndex, This.skillList[funcRankIndex][This.selectIndex[funcRankIndex]])
This.saveSelect(This.selectIndex)
// 当子分类只有一个的时候无法触发组件 change 事件
// 因此主动触发一次选择当前分类事件
if (funcList.length === 1) {
let funcSkillDataBuffer = This.skillRawData
for (let i = 0, len = This.selectIndex.length; i < len; i++) {
if (funcSkillDataBuffer[This.selectIndex[i]].children) {
funcSkillDataBuffer = funcSkillDataBuffer[This.selectIndex[i]].children
}
}
funcRankIndex = funcRankIndex + 1
funcSkillData = funcSkillDataBuffer
createSkillList()
return
}
// 如果当前索引之下的元素还有子元素,则追加默认选择为第一个继续遍历
if (funcRankIndex === This.selectIndexBuffer.length && This.selectItem[funcRankIndex].isChildren) {
This.selectIndexBuffer.push(0)
}
if (funcRankIndex < This.selectIndexBuffer.length) {
let funcSelectItem = funcSkillData[This.selectIndexBuffer[funcRankIndex]]
if (funcSkillData[This.selectIndexBuffer[funcRankIndex]].children) {
funcSkillData = funcSkillData[This.selectIndexBuffer[funcRankIndex]].children
funcRankIndex = funcRankIndex + 1
createSkillList()
}
// 判断是否需要继续遍历
if (funcSkillItem[funcSkillItem.length - 1].isChildren) {
let funcSelectionIndex = funcLevel
funcLevel = funcLevel + 1
setSkillOption(funcSelection[funcLevel], funcSkillList[funcSelection[funcSelectionIndex]].children)
}
}
// 重置变量
let This = this
createSkillList()
// 初始组件完毕需要传递当前选择的 id
let funcInitSelectId = []
for (let i = 0, l = this.selectItem.length; i < l; i++) {
funcInitSelectId.push(this.selectItem[i].value)
}
this.$emit('change', funcInitSelectId)
this.skillList = []
this.selectionItem = []
let funcLevel = 0
let funcSkillOption = []
let funcSkillItem = []
let funcSelection = this.selectionIndex
setSkillOption(funcSelection[funcLevel], funcSkillAll)
this.skillList = funcSkillOption
this.selectionItem = funcSkillItem
this.saveSelection()
this.returnSelectionId()
},
saveSelect: function (funcSelectIndexBuffer) {
let funcComponentSkill = this.$store.getters.componentSkill
funcComponentSkill[this.identity] = funcSelectIndexBuffer
this.$store.commit('componentSkill', funcComponentSkill)
saveSelection: function () {
let funcSaveSelection = this.$store.getters.componentSkill
funcSaveSelection[this.identity] = this.selectionIndex
this.$store.commit('componentSkill', funcSaveSelection)
},
returnSelectId: function () {
let funcSelectId = []
let funcSkillData = this.skillRawData
for (let i = 0, len = this.selectIndex.length; i < len; i++) {
funcSelectId.push(funcSkillData[this.selectIndex[i]].value)
if (funcSkillData[this.selectIndex[i]].children) {
funcSkillData = funcSkillData[this.selectIndex[i]].children
returnSelectionId: function () {
let funcSeletion = []
for (let i = 0, l = this.selectionItem.length; i < l; i++) {
funcSeletion.push(this.selectionItem[i].value)
}
}
this.$emit('change', funcSelectId) // 设置完成数据触发一次选择事件使父组件获取选择数据
this.$emit('change', funcSeletion)
},
onSelect: function (funcItem, funcRankIndex) {
// 清除选择分类之后所有数据
this.selectIndex[funcRankIndex] = funcItem.index
this.selectIndexBuffer[funcRankIndex] = funcItem.index
let funcSkillList = []
let funcSelectIndex = []
for (let i = 0; i <= funcRankIndex; i++) {
funcSkillList.push(this.skillList[i])
funcSelectIndex.push(this.selectIndex[i])
}
this.skillList = funcSkillList
this.selectIndex = funcSelectIndex
this.selectIndexBuffer = funcSelectIndex
// 保存当前选择数据
this.saveSelect(this.selectIndex)
// 定位选择分类查找下级分类
let funcIsChildren = false
let funcSkillData = this.skillRawData
for (let i = 0, len = this.selectIndex.length; i < len; i++) {
if (funcSkillData[this.selectIndex[i]].children) {
funcSkillData = funcSkillData[this.selectIndex[i]].children
funcIsChildren = true
} else {
funcIsChildren = false
onSelection: function (funcSkillItem, funcLevel) {
// 定位选择层级改变选择索引
let funcSkillList = this.skillList[funcLevel]
for (let i = 0, l = funcSkillList.length; i < l; i++) {
if (funcSkillItem.value === funcSkillList[i].value) {
this.selectionIndex[funcLevel] = i
break
}
}
if (funcIsChildren) {
this.setSkillList(funcRankIndex + 1, funcSkillData)
} else {
this.setSkillList(funcRankIndex, funcSkillData)
// 重置层级之后的选择索引
for (let i = 0, l = this.selectionIndex.length; i < l; i++) {
if (i > funcLevel) {
this.selectionIndex[i] = 0
}
}
this.returnSelectId()
// 重新渲染列表
this.ergodicSkill(this.skillAll)
},
}
}
......
import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import store from './store/store.js'
......@@ -24,6 +25,5 @@ let output = new Vue({
'components': { App },
'template': '<App/>'
})
window.Promise = Promise
export default output
\ No newline at end of file
import 'babel-polyfill'
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
......
......@@ -322,6 +322,7 @@
}
this.listBanner = funcList
})
.catch((funcError) => {})
},
queryData: function () {
let funcParam = {
......
......@@ -437,7 +437,14 @@
onUploadChange: function (funcType, funcFile, funcFileList) {
if (funcFile.status === 'ready') {
if (this.checkFileFormat(funcType, funcFile)) {
funcFile.name = Math.round(new Date())
// 重新定义上传文件名称
let funcFileFormat = funcFile.name.substring(funcFile.name.lastIndexOf('.'), funcFile.name.length)
let funcFileName = funcType + (new Date() - 0) + funcFileFormat
let funcCopyFile = new File([funcFile.raw], funcFileName, { type: funcFile.raw.type})
funcCopyFile.uid = funcFile.raw.uid
funcFile.raw = funcCopyFile
funcFile.name = funcFileName
this.formRegister[funcType + 'Image'] = 'image'
this.uploadOption[funcType].image.push(funcFile)
} else {
......
......@@ -292,7 +292,6 @@
official: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/Statement/'
},
image: []
......@@ -300,7 +299,6 @@
statement: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/Statement/'
},
image: []
......@@ -308,7 +306,6 @@
skill: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/skill/'
},
image: []
......@@ -316,7 +313,6 @@
education: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/education/'
},
image: []
......@@ -421,7 +417,7 @@
* @returns
*/
reset: function () {
this.state = 1
this.state = 3
this.formRegister = {
// 基础信息
name: '',
......@@ -454,7 +450,7 @@
// 重置区域选择数据
this.$store.commit('areaSelection', [])
this.$store.commit('componentSkill', [])
this.$store.commit('componentSkillData', {})
this.$store.commit('componentSkillData', [])
},
......@@ -698,7 +694,6 @@
// 职称上传
case 3:
console.log(this.formRegister)
this.$refs.formSkill.validate(funcValid => {
if (funcValid) {
if (this.uploadOption.skill.image.length > 0) {
......@@ -779,7 +774,7 @@
onSkillInsert: function () {
if (this.skillQuantity < 5) this.skillQuantity = this.skillQuantity + 1
let funcComponentSkill = this.$store.getters.componentSkill
funcComponentSkill.push([])
funcComponentSkill.push([0, 0, 0, 0, 0])
this.$store.commit('componentSkill', funcComponentSkill)
},
......@@ -858,7 +853,14 @@
onUploadChange: function (funcType, funcFile, funcFileList) {
if (funcFile.status === 'ready') {
if (this.checkFileFormat(funcType, funcFile)) {
funcFile.name = Math.round(new Date())
// 重新定义上传文件名称
let funcFileFormat = funcFile.name.substring(funcFile.name.lastIndexOf('.'), funcFile.name.length)
let funcFileName = funcType + (new Date() - 0) + funcFileFormat
let funcCopyFile = new File([funcFile.raw], funcFileName, { type: funcFile.raw.type})
funcCopyFile.uid = funcFile.raw.uid
funcFile.raw = funcCopyFile
funcFile.name = funcFileName
this.formRegister[funcType + 'Image'] = 'image'
this.uploadOption[funcType].image.push(funcFile)
} else {
......
......@@ -64,6 +64,7 @@
:action="uploadOption.license.url"
:data="uploadOption.license.params"
:on-preview="onUploadPreviewFile"
:before-upload="(file) => { ononUploadBefore('license', file) }"
:on-remove="(file, fileList) => { onUploadRemove('license', file, fileList) }"
:on-change="(file, fileList) => { onUploadChange('license', file, fileList) }"
:on-success="(respons, file, fileList) => { onUploadSuccess('license', respons, file, fileList) }"
......@@ -840,9 +841,17 @@
* @returns
*/
onUploadChange: function (funcType, funcFile, funcFileList) {
console.log(funcFile)
if (funcFile.status === 'ready') {
if (this.checkFileFormat(funcType, funcFile)) {
funcFile.name = Math.round(new Date())
// 重新定义上传文件名称
let funcFileFormat = funcFile.name.substring(funcFile.name.lastIndexOf('.'), funcFile.name.length)
let funcFileName = funcType + (new Date() - 0) + funcFileFormat
let funcCopyFile = new File([funcFile.raw], funcFileName, { type: funcFile.raw.type})
funcCopyFile.uid = funcFile.raw.uid
funcFile.raw = funcCopyFile
funcFile.name = funcFileName
this.formRegister[funcType + 'Image'] = 'image'
this.uploadOption[funcType].image.push(funcFile)
} else {
......
......@@ -66,6 +66,29 @@
</div>
</el-upload>
</el-form-item>
<el-form-item label="专家入库申明:" prop="statementImage">
<!-- 此处 input 是为了模拟校验而设置的隐藏组件 -->
<el-input class="global-none" v-model="formRegister.statementImage"></el-input>
<el-upload :class="uploadOption.statement.image.length > 0 ? 'upload-none' : ''"
ref="uploadStatement"
list-type="picture-card"
:auto-upload="false"
:limit="1"
:file-list="uploadOption.statement.image"
:action="uploadOption.statement.url"
:data="uploadOption.statement.params"
:on-preview="onUploadPreviewFile"
:on-remove="(file, fileList) => { onUploadRemove('statement', file, fileList) }"
:on-change="(file, fileList) => { onUploadChange('statement', file, fileList) }"
:on-success="(respons, file, fileLis) => { onUploadSuccess('statement', respons, file, fileLis) }"
:on-error="(error) => { onUploadFail('statement', error) }"
>
<div class="col">
<i class="el-icon-plus"></i>
<span>点击上传</span>
</div>
</el-upload>
</el-form-item>
<el-form-item label="最高学历:" prop="education">
<el-radio-group v-model="formRegister.education">
<el-radio label="1">专科</el-radio>
......@@ -201,7 +224,13 @@
official: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/Statement/'
},
image: []
},
statement: {
url: iHost.uploadFile,
params: {
'uploadPath': 'register/specialist/Statement/'
},
image: []
......@@ -209,7 +238,6 @@
skill: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/skill/'
},
image: []
......@@ -217,7 +245,6 @@
education: {
url: iHost.uploadFile,
params: {
'file': '',
'uploadPath': 'register/specialist/education/'
},
image: []
......@@ -252,16 +279,17 @@
{ required: true, message: '请选择', trigger: 'blur' }
],
officialImage: [
{ required: true, message: '请上传上传政府专家证明资料', trigger: 'blur' }
{ required: true, message: '请上传政府专家证明资料', trigger: 'blur' }
],
statement: [
{ required: true, message: '请上传入库声明', trigger: 'blur' }
],
skillSelect: [
{ required: true, message: '请选择评审专业', trigger: 'blur' }
],
skillImage: [
{ required: true, message: '请上传上传职称证书', trigger: 'blur' }
{ required: true, message: '请上传职称证书', trigger: 'blur' }
],
education: [
{ required: true, message: '请选择最高学历', trigger: 'blur' }
],
......@@ -416,6 +444,7 @@
company: '',
isOfficial: '0',
officialImage: '',
statementImage: '',
// 职称信息
skillSelect: '',
......@@ -649,7 +678,14 @@
onUploadChange: function (funcType, funcFile, funcFileList) {
if (funcFile.status === 'ready') {
if (this.checkFileFormat(funcType, funcFile)) {
funcFile.name = Math.round(new Date())
// 重新定义上传文件名称
let funcFileFormat = funcFile.name.substring(funcFile.name.lastIndexOf('.'), funcFile.name.length)
let funcFileName = funcType + (new Date() - 0) + funcFileFormat
let funcCopyFile = new File([funcFile.raw], funcFileName, { type: funcFile.raw.type})
funcCopyFile.uid = funcFile.raw.uid
funcFile.raw = funcCopyFile
funcFile.name = funcFileName
this.formRegister[funcType + 'Image'] = 'image'
this.uploadOption[funcType].image.push(funcFile)
} else {
......
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 sign in to comment