diff --git a/src/components/upload_file.vue b/src/components/upload_file.vue index d98d14297c1471108bed946bae41bcdee270e659..a5d7aaf74304e14fd462466ac090e66e1086bf22 100644 --- a/src/components/upload_file.vue +++ b/src/components/upload_file.vue @@ -5,7 +5,7 @@
= this.max; } }, + created(){ + if(this.directory){ + this.anotherData={ + directory: this.directory + } + } + }, methods: { beforeAvatarUpload(file) { if (this.type == "mp3") { @@ -122,16 +133,16 @@ export default { if (this.type == "mp3") { if (response.success == 1) { this.fileArray.push({ - url: response.data.dbUrl, - name: response.data.fileName + url: response.data, + name: file.name }); } this.$emit("getNewList", this.fileArray); } else if (this.type == "picture") { if (response.success == 1) { this.fileArray.push({ - url: response.data.dbUrl, - name: response.data.fileName + url: response.data, + name: file.name }); } this.$emit("getNewList", this.fileArray); @@ -139,15 +150,15 @@ export default { this.hideUpload = fileList.length >= this.max; }, handleRemove(file, fileList) { - if (!(fileList && fileList.length > 0)) { - return; - } + // if (!(fileList && fileList.length > 0)) { + // return; + // } let url = file.url; let detection = true; if (url) detection = url.indexOf("blob") != -1; if (detection) { this.fileArray.forEach((item, i, arr) => { - if (item.url === file.response.data.dbUrl) { + if (item.url === file.url) { this.fileArray.splice(i, 1); } }); @@ -158,6 +169,7 @@ export default { } }); } + this.hideUpload = fileList.length >= this.max; this.$emit("getNewList", this.fileArray); }, diff --git a/src/pages/authority/organizationedit.vue b/src/pages/authority/organizationedit.vue index 7f6815f82c978a0e884169f398246c735186e4c1..e8f99fc327392ba0d9b3719fd3acf63b50b0a6aa 100644 --- a/src/pages/authority/organizationedit.vue +++ b/src/pages/authority/organizationedit.vue @@ -14,7 +14,7 @@

组织机构简称:

- +

组织机构编码:

@@ -30,6 +30,7 @@ :list="imgList" @getNewList="getNewList" ref="servicepic" + directory="manage" > 更换封面
@@ -79,10 +80,8 @@ export default { date:'', fileList:'' }, - open:true, - open1:false, - open2:'true', now_user: 2, //0:普通用户,1:组织管理员,2:超级管理员 + edit_flag:0,//0:新增,1:编辑:2详情 imgList: [], area_arr:[ { @@ -126,14 +125,14 @@ export default { { required: true, message: '请输入组织机构名称', trigger: 'blur' }, ], shortname:[ - { required: true, message: '请输入组织机构简称', trigger: 'blur' }, + // { required: true, message: '请输入组织机构简称', trigger: 'blur' }, ], desc:[ - { required: true, message: '请输入组织说明', trigger: 'blur' }, + // { required: true, message: '请输入组织说明', trigger: 'blur' }, { max: 200, message: '长度小于200个字符', trigger: 'blur' } ], fileList:[ - {required: true, message: '请上传图片', trigger: 'change'} + // {required: true, message: '请上传图片', trigger: 'change'} ] } @@ -148,10 +147,39 @@ export default { this.$store.commit('rolefun',data) this.getOriginArr() }); - console.log(this.$route); + this.get_now_page() }, mounted() {}, methods: { + get_now_page(){ + if(this.$route.path.indexOf('add')!==-1){ + this.edit_flag = 0 + } + if(this.$route.path.indexOf('edit')!==-1){ + this.edit_flag = 1 + } + if(this.$route.path.indexOf('detail')!==-1){ + this.edit_flag = 2 + } + }, + add_user(){ + var temp = { + "department_name":this.form.name, + "description":this.form.desc, + "department_display":this.form.shortname, + "picture_path":this.form.fileList, + } + this.$http + .post('/apaas/backmgt/department',temp) + .then(response => { + console.log(response); + this.$message.success('保存成功') + this.$router.back(-1) + }) + .catch((response)=> { + + }); + }, getOriginArr(){ this.$http .get('/static/serviceedit.json') @@ -170,7 +198,7 @@ export default { console.log('submit!'); this.$refs[formName].validate((valid) => { if (valid) { - alert('submit!'); + this.add_user() } else { console.log('error submit!!'); return false; @@ -180,7 +208,7 @@ export default { getNewList(val) { console.log(val); this.form.fileList = "" - this.form.fileList = url.map((v,k)=>{ + this.form.fileList = val.map((v,k)=>{ return v.url }).join(';') console.log(this.form.fileList) diff --git a/src/pages/workbench/fwgl/serviceEdit.vue b/src/pages/workbench/fwgl/serviceEdit.vue index 6762dece890124e267c884a8b9f6cdaba19796ee..caa77263cca82dd589fbca43526eaf9ea778f8d9 100644 --- a/src/pages/workbench/fwgl/serviceEdit.vue +++ b/src/pages/workbench/fwgl/serviceEdit.vue @@ -13,7 +13,7 @@ 服务安全设置
- +

服务名称:

@@ -58,6 +58,7 @@ :readOnly="false" fit="fill" :list="imgList" + directory="service" @getNewList="getNewList" ref="servicepic" > @@ -96,7 +97,7 @@
-
+
{ console.log(response); + this.$message.success('保存成功') this.getServiceInfo() }) .catch(function(response) { @@ -348,13 +350,25 @@ export default { this.onSubmit('form') }, openstart(){ - this.open = !this.open + if(this.open){ + this.open = 0 + }else{ + this.open = 1 + } }, openstart1(){ - this.open1 = !this.open1 + if(this.open1){ + this.open1 = 0 + }else{ + this.open1 = 1 + } }, openstart2(){ - this.open2 = !this.open2 + if(this.open2){ + this.open2 = 0 + }else{ + this.open2 = 1 + } }, removepic(){ this.$refs.servicepic.handleRemove() @@ -373,7 +387,7 @@ export default { getNewList(val) { console.log(val); this.form.fileList = "" - this.form.fileList = url.map((v,k)=>{ + this.form.fileList = val.map((v,k)=>{ return v.url }).join(';') console.log(this.form.fileList)