瀏覽代碼

完成编辑项目

master
revive 4 年之前
父節點
當前提交
fd5ad4fe11
共有 6 個檔案被更改,包括 218 行新增167 行删除
  1. +1
    -0
      public/static/css/main.css
  2. +25
    -0
      src/services/project.js
  3. +2
    -1
      src/utils/request.js
  4. +1
    -61
      src/views/components_web/newProj/newProj.vue
  5. +147
    -77
      src/views/components_web/projSetting/projSetting.vue
  6. +42
    -28
      src/views/main_web/index/index.vue

+ 1
- 0
public/static/css/main.css 查看文件

@@ -3666,6 +3666,7 @@ button:focus {
bottom: 10px;
font-size: 12px;
background-color: #fff;
color: #000;
}
.listUpdateBtn .webuploader-pick{
width: 80px;


+ 25
- 0
src/services/project.js 查看文件

@@ -0,0 +1,25 @@
import { fetchApi , wrapErrorHint} from '@/utils/request';
/**
* 用户拥有的项目
* @param {string} id
*/
export async function queryProjectsByUserId(userId){
const res = await fetchApi('project/queryProjectListByUserId',{userId:userId})
return wrapErrorHint(res);
}

/**
* 项目详情
*/
export async function QueryProjectInfoByProjId(projId){
const res = await fetchApi('project/QueryProjectInfoByProjId',{projId:projId})
return wrapErrorHint(res);
}

/**
* 编辑项目
*/
export async function EditProject(proj){
const res = await fetchApi('project/EditProject',proj)
return wrapErrorHint(res);
}

+ 2
- 1
src/utils/request.js 查看文件

@@ -88,7 +88,7 @@ export default axios;

function mapApiPathToFullPath(path) {
const [service] = path.split('/');
const fullpath = `api/${service === 'template' ? 'pms' : 'cms'}/${service === 'authentication' ? '' : 'v1/'}${path}`;
const fullpath = `api/${(service === 'template' || service ==='project') ? 'pms' : 'cms'}/${service === 'authentication' ? '' : 'v1/'}${path}`;
let method = 'GET';

switch (path) {
@@ -109,6 +109,7 @@ function mapApiPathToFullPath(path) {
case 'template/addTemplateNodeModelFile':
case 'template/createNestedRelevance':
case 'template/deleteNestedRelevance':
case 'project/EditProject':
// case 'template/deleteTemplateNodeModelFile':
method = 'POST';
break;


+ 1
- 61
src/views/components_web/newProj/newProj.vue 查看文件

@@ -108,19 +108,6 @@
<div class="yiyun_col-6">
<div class="pageImgBox">
<img :src="coverSrc | resolveAvator" alt="" />
<!-- <file-Uploader
:mutiple="false"
:label="uploadLabel"
:auto="true"
accept="image"
ref="webUploadlist"
:btn-id="filePicker"
:companyId="uploadCompId"
:typeId="uploadTypeCover"
@upload-success="coverUploadSuccess"
:url="chunkUploadUrl" class="listUpdateBtn">
</file-Uploader> -->
<file-uploader
:on-success="coverUploadSuccess"
class="listUpdateBtn editCoverBtn"
@@ -577,16 +564,7 @@
default: false
}
},
filters:{
resolveCover(imgSrc){
if(this.imgList.includes(imgSrc)){
return imgSrc
}
const imgsrc=getFileUrl(imgSrc);
return imgsrc
}
},
data() {
return {
imgSrc: process.env.API_HOST + 'archives/cover?path=',
@@ -626,18 +604,6 @@
"listProjProp": [],
"userId": "",
}, // 新建项目
imgList:[
'static\img\faceImg\face01.png',
'static\img\faceImg\face02.png',
'static\img\faceImg\face03.png',
'static\img\faceImg\face04.png',
'static\img\faceImg\face05.png',
'static\img\faceImg\face06.png',
'static\img\faceImg\face07.png',
'static\img\faceImg\face08.png',
'static\img\faceImg\face09.png',
'static\img\faceImg\face10.png',
],
listTempProp: [],
listProjProp: [],
checked: false,
@@ -704,7 +670,6 @@
created: function() {
},
mounted: function() {
this.listDeptUsers();
this.getSelectTemplateData();
@@ -1326,30 +1291,6 @@
console.log(error);
});
},
/**
* 设置系统封面
*/
setSystemCover: function() {
// this.coverSrc = "static\\img\\faceImg\\face" + this.srcIndex + ".png";
// this.newProjData.projectData.showImgUrl = this.srcIndex;
// if (this.srcIndex < 9) {
// this.srcIndex = this.srcIndex + 1;
// } else {
// this.srcIndex = 1;
// }
// setSystemCover: function() {
// this.coverSrc = "static\\img\\faceImg\\face0" + this.srcIndex + ".png";
// this.newProjData.projectData.showImgUrl = this.srcIndex;
// if (this.srcIndex < 9) {
// this.srcIndex = this.srcIndex + 1;
// } else {
// this.srcIndex = 1;
// }
// },
},
/**
* 设置随机封面
@@ -1368,7 +1309,6 @@
this.newProjData.projectData.showImgUrl = this.srcIndex;
},
/**
* 封面上传成功时
*/


+ 147
- 77
src/views/components_web/projSetting/projSetting.vue 查看文件

@@ -162,32 +162,37 @@
<div class="yiyun_col-6 fl">
<div class="bianju_item_fr">
<el-form-item label="项目负责人:">
<span>{{ nowProject.userCnName }}</span>
<span>{{nowProject.ProjCreateUserName}}</span>
</el-form-item>
</div>
</div>
<div class="yiyun_col-6 fl">
<div class="bianju_item_fr">
<el-form-item label="创建时间:">
<span>{{ nowProject.strCreateTime }}</span>
<span>{{ nowProject.ProjCreateTime }}</span>
</el-form-item>
</div>
</div>
<div class="yiyun_col-12 fl" v-for="prop in listProjProp" :key="prop.projPropID">
<div class="yiyun_col-12 fl" v-for="prop in listProjProp" :key="prop.TempPropId">
<div class="bianju_item_fr">
<el-form-item :label='prop.propName+":"'>
<el-input v-model="prop.propValue" placeholder="输入" class="labelinputbefore" v-if="isShowInfoEdit"></el-input>
<span v-if="!isShowInfoEdit">{{ prop.propValue }}</span>
<el-form-item :label='prop.PropertyName+":"'>
<el-input v-model="prop.PropValue" placeholder="输入" class="labelinputbefore" v-if="isShowInfoEdit"></el-input>
<span v-if="!isShowInfoEdit">{{ prop.PropValue }}</span>
</el-form-item>
</div>
</div>
<div class="yiyun_col-12 fl mt-10">
<div class="clear"></div>
<div class="yiyun_col-6">
<div class="pageImgBox ml-110">
<img v-lazy="coverSrc" alt="" />
<file-Uploader v-show="isShowSaveAllBtn" :mutiple="false" label="编辑封面" :auto="true" accept="image" ref="webUploadlist" :btn-id="filePicker" :companyId="uploadCompId" :typeId="uploadTypeCover" @upload-success="coverUploadSuccess" :url="chunkUploadUrl" class="listUpdateBtn">
</file-Uploader>
<div class="pageImgBox">
<img :src="coverSrc | resolveAvator" alt="" />
<file-uploader
v-show="isShowSaveAllBtn"
:on-success="coverUploadSuccess"
class="listUpdateBtn editCoverBtn"
>
<span>编辑</span>
</file-uploader>
<span class="faceBtn" v-show="isShowSaveAllBtn" @click="setSystemCover">使用随机封面</span>
</div>
</div>
@@ -518,7 +523,14 @@
</template>
<script>
import * as prjService from '@/services/project'
import { wrapOssProtocol} from "@/services/oss";
import FileUploader from "@/components/file-uploader";
import dayjs from 'dayjs'
export default {
components:{
FileUploader
},
props: {
isProjManager: {
type: Boolean,
@@ -531,6 +543,10 @@
projId:{
type:String,
default:''
},
createUserId:{
type:String,
default:''
}
},
data() {
@@ -579,7 +595,7 @@
isShowSetUsers: false, // 分配工作人员面板
isShowProjInfo: true, // 项目概况
isShowInfoEdit: false, // 项目概况编辑
isShowEditProjBtn: false, // 编辑项目概况按钮
isShowEditProjBtn: true, // 编辑项目概况按钮
isShowSaveAllBtn: false, // 保存全部信息按钮
currWorkName: "", // 分配人员时工作名称
currentProjId:"",
@@ -587,8 +603,7 @@
};
},
mounted: function () {
this.listProjFolder();
this.listDeptUsers();
//this.listDeptUsers();
},
computed: {
/**
@@ -684,48 +699,72 @@
/**
* 保存项目概况
*/
saveProjectInfo: function () {
async saveProjectInfo(){
var CustomProps=[];
this.listProjProp.forEach(item=>{
var prop = {};
prop.Id=item.ProjPropId;
prop.PropValue=item.PropValue;
CustomProps.push(prop);
})
var updateData = {
ProjId: this.currentProjId,
ImgeUrl:this.nowProject.ShowImgUrl,
Projprops: CustomProps,
};
console.log(updateData)
const res=await prjService.EditProject(updateData);
this.projInfo(this.currentProjId);
this.isShowSaveAllBtn = false;
this.isShowInfoEdit = false;
this.isShowEditProjBtn = true;
// 提交到数据库进行保存数据
var thisApp = this;
var updateData = {
listProjProp: this.listProjProp,
projId: this.currentProjId,
showImageUrl:this.nowProject.showImgUrl,
userId: sessionStorage.userId
};
thisApp
.$axios({
method: "put",
url: encodeURI(process.env.API_HOST + "projects/prop"),
data: updateData
})
.then(response => {
if (response.data.state == 1) {
thisApp.$notify({
title: "恭喜您",
message: response.data.message,
type: "success",
offset: 100,
duration: 2500
});
thisApp.$emit("editSuccess");
} else {
thisApp.$notify({
title: "温馨提示",
message: response.data.message,
type: "success",
offset: 100,
duration: 5000
});
}
})
.catch(error => {
console.log(error);
});
this.isShowEditProjBtn = true;
},
// saveProjectInfo: function () {
// this.isShowSaveAllBtn = false;
// this.isShowInfoEdit = false;
// this.isShowEditProjBtn = true;
// // 提交到数据库进行保存数据
// var thisApp = this;
// var updateData = {
// listProjProp: this.listProjProp,
// projId: this.currentProjId,
// showImageUrl:this.nowProject.showImgUrl,
// userId: sessionStorage.userId
// };
// thisApp
// .$axios({
// method: "put",
// url: encodeURI(process.env.API_HOST + "projects/prop"),
// data: updateData
// })
// .then(response => {
// if (response.data.state == 1) {
// thisApp.$notify({
// title: "恭喜您",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 2500
// });
// thisApp.$emit("editSuccess");
// } else {
// thisApp.$notify({
// title: "温馨提示",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 5000
// });
// }
// })
// .catch(error => {
// console.log(error);
// });
// },
/**
* 初始底部弹框
*/
@@ -1058,26 +1097,40 @@
* 加载需要分配的文件夹
*/
listProjFolder: function () {
var thisApp = this;
thisApp
.$axios({
method: "get",
url: encodeURI(
process.env.API_HOST + "projects/info/" + this.currentProjId
)
})
.then(response => {
if (response.data != '')
{
thisApp.nowProject = response.data.data.projectData;
thisApp.listNewFolder = response.data.data.listFolder;
thisApp.listProjProp = response.data.data.listProjProp;
thisApp.coverSrc=thisApp.imgSrc+ thisApp.nowProject.showImgUrl;
}
})
.catch(error => {
console.log(error);
});
// var thisApp = this;
// thisApp
// .$axios({
// method: "get",
// url: encodeURI(
// process.env.API_HOST + "projects/info/" + this.currentProjId
// )
// })
// .then(response => {
// if (response.data != '')
// {
// thisApp.nowProject = response.data.data.projectData;
// thisApp.listNewFolder = response.data.data.listFolder;
// thisApp.listProjProp = response.data.data.listProjProp;
// thisApp.coverSrc=thisApp.imgSrc+ thisApp.nowProject.showImgUrl;
// }
// })
// .catch(error => {
// console.log(error);
// });
},
/**
* 加载项目信息
*/
async projInfo(id){
const projectInfoRes= await prjService.QueryProjectInfoByProjId(id);
this.nowProject=projectInfoRes.Data;
this.nowProject.ProjCreateTime=dayjs(this.nowProject.ProjCreateTime).format('YYYY-MM-DD HH:mm:ss')
this.listProjProp=projectInfoRes.Data.CustomProps;
this.coverSrc=projectInfoRes.Data.ShowImgUrl;
},
/**
* 获取全部的Dept数据
@@ -1134,16 +1187,19 @@
console.log(error);
});
},
/**
* 封面上传成功时
*/
coverUploadSuccess: function (file) {
this.nowProject.showImgUrl = file.filePath;
this.coverSrc = this.imgSrc + file.filePath;
const filePath = wrapOssProtocol(file.ossUrl);
this.coverSrc = filePath;
this.nowProject.ShowImgUrl=filePath;
},
/**
* 设置系统封面
*/
setSystemCover: function () {
this.coverSrc = "static\\img\\faceImg\\face0" + this.srcIndex + ".png";
this.nowProject.showImgUrl = this.srcIndex;
@@ -1156,6 +1212,20 @@
this.srcIndex = 1;
}
},
},
setSystemCoverRandom: function() {
var temp=Math.ceil(Math.random()*10);
while(this.srcIndex ===temp){
temp=Math.ceil(Math.random()*10);
}
this.srcIndex=temp;
if(this.srcIndex===10){
this.coverSrc = "static\\img\\faceImg\\face" + this.srcIndex + ".png";
}else{
this.coverSrc = "static\\img\\faceImg\\face0" + this.srcIndex + ".png";
}
this.nowProjData.ShowImgUrl = this.srcIndex;
},
watch: {
isProjManager(val) {
@@ -1171,10 +1241,10 @@
}
},
projId(val){
//console.log(val);
this.currentProjId=val;
this.listProjFolder();
this.listDeptUsers();
this.projInfo(val);}
//this.listDeptUsers();
}
}
};
</script>

+ 42
- 28
src/views/main_web/index/index.vue 查看文件

@@ -35,14 +35,6 @@
<div class="yiyun-rows mt-20" id="new">
<div class="yiyun-col-4">
<div class="yiyun_row" style="width: 95%;">
<!-- 系统时间 -->
<!-- <div class="section_item fl section_item_aside_fl">
<h1>{{ nowTime }}</h1>
<div>
<span class="nowshijian">{{ nowDate }}</span>
<span class="nowshijian">{{ welcome }}</span>
</div>
</div> -->
<timer :cnName="cnName"></timer>
</div>
</div>
@@ -107,7 +99,7 @@
</span>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="projectEdit(projItem)">
<el-dropdown-item @click.native="openPrjInfo(projItem)">
<span>项目概况</span>
</el-dropdown-item>
<el-dropdown-item
@@ -207,7 +199,9 @@
>
<ProjSetting
:isProjManager="isProjectManager"
:createUserId="createUserId"
:projId="currProjId"
:nowprj="nowProj"
:isSetFolder="isEditProjFolder"
@offDialog="closeProjSet"
@editSuccess="projEditSuccess"
@@ -225,6 +219,7 @@ import DistWork from "@/views/components_web/distWork/distWork";
import NewProj from "@/views/components_web/newProj/newProj";
import ProjSetting from "@/views/components_web/projSetting/projSetting";
import { haveAccess, AccessCode } from '@/utils/access';
import * as prjService from '@/services/project'
import Timer from '@/views/main_web/time'
const BMap = window.BMap;
const Velocity = window.Velocity;
@@ -248,8 +243,10 @@ export default {
currProjId: "",
feedbackdesc: "",
projList: [], // 项目列表
nowProj:"",
projPageList: [], // 分页项目数据
isEmpty: false,
createUserId:'',
newProjData: {
projectData: {
projID: "",
@@ -386,25 +383,30 @@ export default {
/**
* 获取项目数据
*/
listProjects: function () {
var thisApp = this;
this.$axios({
method: "get",
url: encodeURI(
process.env.API_HOST + "projects/" + sessionStorage.userId
),
})
.then(function (response) {
thisApp.projList = response.data;
if (sessionStorage.login === "login") {
thisApp.projectsWithPage();
} else {
thisApp.projectsWithPage();
}
})
.catch(function (error) {
console.log(error);
});
// listProjects: function () {
// var thisApp = this;
// this.$axios({
// method: "get",
// url: encodeURI(
// process.env.API_HOST + "projects/" + sessionStorage.userId
// ),
// })
// .then(function (response) {
// thisApp.projList = response.data;
// if (sessionStorage.login === "login") {
// thisApp.projectsWithPage();
// } else {
// thisApp.projectsWithPage();
// }
// })
// .catch(function (error) {
// console.log(error);
// });
// },
async listProjects(){
const projectListRes = await prjService.queryProjectsByUserId(this.$store.state.accountId);
this.projList=projectListRes.Data;
this.projectsWithPage();
},
/**
* 设置分页项目数据
@@ -627,6 +629,18 @@ export default {
console.log(error);
});
},
/**
* 打开项目概况
*/
openPrjInfo(proj){
//const projectInfoRes= await prjService.QueryProjectInfoByProjId(proj.Id);
//this.isProjectManager = projectInfoRes.Data.Status;
this.currProjId = proj.Id;
this.isShowProjSetting = true;
this.isEditProjFolder = false;
//this.nowProj=projectInfoRes.Data;
//console.log(this.nowProj.Status)
},
/**
* @description: 编辑项目概况回调
* @param {type}


Loading…
取消
儲存