zhengzhou 3年前
コミット
41eeaa7500
3個のファイルの変更1607行の追加1193行の削除
  1. +53
    -34
      src/views/components_web/project/newProj.vue
  2. +13
    -1
      src/views/main_web/project/components/plain-folder-list.vue
  3. +1541
    -1158
      src/views/main_web/project/index.vue

+ 53
- 34
src/views/components_web/project/newProj.vue ファイルの表示

@@ -21,7 +21,11 @@
<div class="newProj_title"> <div class="newProj_title">
输入项目名称 输入项目名称
</div> </div>
<el-button type="primary" class="nextbtn" @click.stop="enterTemplateSelect()">下一步</el-button>
<el-button
type="primary"
class="nextbtn"
@click.stop="enterTemplateSelect()"
>下一步</el-button>
</div> </div>
<div class="newProj_content"> <div class="newProj_content">
<div class="upload_img"> <div class="upload_img">
@@ -68,7 +72,11 @@
:class="{'header-bottom-shadow': isProjDescScroll}" :class="{'header-bottom-shadow': isProjDescScroll}"
> >
<template #right> <template #right>
<el-button @click.stop="enterTemplateImprove()" class="slot_btn" :disabled="!selectTemplate.Id">选定模板</el-button>
<el-button
@click.stop="enterTemplateImprove()"
class="slot_btn"
:disabled="!selectTemplate.Id"
>选定模板</el-button>
</template> </template>
</TopHeader> </TopHeader>
<div class="template_select_content"> <div class="template_select_content">
@@ -84,7 +92,10 @@
><i class="el-icon-check"></i></div> ><i class="el-icon-check"></i></div>
<span class="template_info_name">{{item.TempName}}</span> <span class="template_info_name">{{item.TempName}}</span>
</div> </div>
<div v-if="!templateList.length" class="template_empty">没有可供使用的项目模板,请联系管理员。</div>
<div
v-if="!templateList.length"
class="template_empty"
>没有可供使用的项目模板,请联系管理员。</div>
</div> </div>


</div> </div>
@@ -148,7 +159,8 @@ import * as templateService from "@/services/template";
import { fetchAddressBook, getUserListByNode } from "@/services/user.js"; import { fetchAddressBook, getUserListByNode } from "@/services/user.js";
import { wrapOssProtocol, getFileUrl } from "@/services/oss"; import { wrapOssProtocol, getFileUrl } from "@/services/oss";
import FileUploader from "@/components/file-uploader"; import FileUploader from "@/components/file-uploader";
import { fetchApi } from "@/utils/request";
import { fetchApi, wrapErrorHint } from "@/utils/request";
import { notify } from "@/utils/tool";
export default { export default {
components: { components: {
AppHeader, AppHeader,
@@ -157,7 +169,10 @@ export default {
}, },
props: {}, props: {},
data() { data() {
const { parentFolderId } = this.$route.params;
console.log("parentFolderId: ", parentFolderId);
return { return {
parentFolderId, // 互链项目
companyId: sessionStorage.companyId, companyId: sessionStorage.companyId,
isProjName: true, isProjName: true,
isTemSelect: false, isTemSelect: false,
@@ -290,7 +305,9 @@ export default {
temp = Math.ceil(Math.random() * 10); temp = Math.ceil(Math.random() * 10);
} }
this.srcIndex = temp; this.srcIndex = temp;
this.coverSrc = `static/img/faceImg/face${`${100 + this.srcIndex}`.slice(1)}.png`
this.coverSrc = `static/img/faceImg/face${`${100 + this.srcIndex}`.slice(
1
)}.png`;
this.newProjData.projectData.showImgUrl = this.coverSrc; this.newProjData.projectData.showImgUrl = this.coverSrc;
}, },
/** /**
@@ -305,7 +322,9 @@ export default {
* 获取模板列表数据 * 获取模板列表数据
*/ */
async getSelectTemplateData() { async getSelectTemplateData() {
const templateListRes = await templateService.queryTemplateByCompanyId(this.companyId);
const templateListRes = await templateService.queryTemplateByCompanyId(
this.companyId
);
const templateList = templateListRes.Data || []; const templateList = templateListRes.Data || [];
this.templateList = templateList; this.templateList = templateList;


@@ -378,37 +397,37 @@ export default {
this.selectTemplate.Id this.selectTemplate.Id
); );
this.checkNewProjData.Node = res.Data; this.checkNewProjData.Node = res.Data;
this.$fetchApi("project/createProject", this.checkNewProjData)
const iParams = { ...this.checkNewProjData };
if (this.parentFolderId) {
iParams.FolderId = this.parentFolderId;
}
this.$fetchApi("project/createProject", iParams)
.then((res) => { .then((res) => {
if (res.Code === 0) {
thisApp.$notify({
message: "新项目创建成功。",
type: ["success"],
});
wrapErrorHint(res);
if (res.Code !== 0) {
return;
}
thisApp.$notify({
message: "新项目创建成功。",
type: ["success"],
});


sessionStorage.projId = res.Data;
sessionStorage.createUserID = sessionStorage.userId;
sessionStorage.templateID = this.selectTemplate.Id;
sessionStorage.allocated = 0;
sessionStorage.projId = res.Data;
sessionStorage.createUserID = sessionStorage.userId;
sessionStorage.templateID = this.selectTemplate.Id;
sessionStorage.allocated = 0;


// 新建项目新建完成后直接到达工作指派页面
this.$router
.push({
name: "projdetail",
query: {
isShowDistworkPage: true,
},
})
.catch((err) => {
console.log(err);
});
} else {
thisApp.$notify.error({
message: `项目创建失败, 请稍后重试。`,
offset: 100,
duration: 5000,
// 新建项目新建完成后直接到达工作指派页面
this.$router
.push({
name: "projdetail",
query: {
isShowDistworkPage: true,
},
})
.catch((err) => {
console.log(err);
}); });
}
}) })
.catch((err) => console.log(err)); .catch((err) => console.log(err));
const params = { const params = {
@@ -636,7 +655,7 @@ export default {
.template_empty { .template_empty {
margin-top: 100px; margin-top: 100px;
text-align: center; text-align: center;
color: #C0C4CC;
color: #c0c4cc;
} }
} }
.template_info:hover { .template_info:hover {


+ 13
- 1
src/views/main_web/project/components/plain-folder-list.vue ファイルの表示

@@ -119,7 +119,7 @@
<span :style="{ marginLeft: '13px' }">互链项目</span> <span :style="{ marginLeft: '13px' }">互链项目</span>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item>通过新建项目互链</el-dropdown-item>
<el-dropdown-item @click.native="createNestProject(folder)">通过新建项目互链</el-dropdown-item>
<el-dropdown-item @click.native="enterNestTemp(folder)">选择已有项目建立互链</el-dropdown-item> <el-dropdown-item @click.native="enterNestTemp(folder)">选择已有项目建立互链</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@@ -128,6 +128,7 @@
class="extra-button" class="extra-button"
size="mini" size="mini"
v-else v-else
@click.stop="checkNestProject(folder)"
> >
<icon-triangle-circle class="extra-button-icon" :size="14" color="#3C7DFF" /> <icon-triangle-circle class="extra-button-icon" :size="14" color="#3C7DFF" />
<span :style="{ marginLeft: '13px' }">管理互链项目</span> <span :style="{ marginLeft: '13px' }">管理互链项目</span>
@@ -230,6 +231,17 @@ export default {
// } // }
// return false; // return false;
}, },
createNestProject(folder) {
this.$router.push({
name: 'newproject',
params: {
parentFolderId: folder.id
}
})
},
checkNestProject(folder) {
this.$bus.$emit('checkNestProject', folder);
},
enterNestTemp(folder) { enterNestTemp(folder) {
this.$bus.$emit("enterNestTemp", folder); this.$bus.$emit("enterNestTemp", folder);
//this.$bus.$emit('enterNestTemp'); //this.$bus.$emit('enterNestTemp');


+ 1541
- 1158
src/views/main_web/project/index.vue
ファイル差分が大きすぎるため省略します
ファイルの表示


読み込み中…
キャンセル
保存