Skip to content

Commit 52cc28e

Browse files
author
yuchenyao
committed
查询、创建带上workspaceId
1 parent ac6a5e8 commit 52cc28e

File tree

3 files changed

+31
-20
lines changed

3 files changed

+31
-20
lines changed

web/src/js/component/workflowContentItem/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
</h3>
66
<slot></slot>
77
<Row
8-
v-if="dataList.length > 0"
98
class="content-item">
109
<i-col
1110
:xs="12" :sm="8" :md="6" :lg="4"
@@ -163,9 +162,9 @@
163162
</i-col>
164163

165164
</Row>
166-
<div
165+
<!-- <div
167166
class="no-data"
168-
v-else>{{$t('message.workflowItem.nodata')}}</div>
167+
v-else>{{$t('message.workflowItem.nodata')}}</div> -->
169168
<Page
170169
v-if="dataList.length > 0 && pagination.size < dataList.length "
171170
class="page-bar"

web/src/js/module/project/index.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
:key="item.id"
1313
:hide-button-bar="false"
1414
:hide-publish-andcopy="false"
15-
:data-list="item.dwsProjectList"
15+
:data-list="item.dssProjectList"
1616
:current-data="item"
1717
:precent-list="precentList"
1818
source="project"
@@ -158,6 +158,7 @@ export default {
158158
showResourceView: false, // 是否展示资源文件上传
159159
projectResources: [], // 工程级别资源文件
160160
activeItem: {},
161+
workspaceId: 1 // 默认工作空间Id
161162
};
162163
},
163164
computed: {
@@ -171,7 +172,14 @@ export default {
171172
return this.$t('message.project.tips');
172173
}
173174
},
175+
watch: {
176+
$route() {
177+
this.workspaceId = this.$route.query.workspaceId; //获取传来的参数
178+
this.getclassListData();
179+
}
180+
},
174181
created() {
182+
this.workspaceId = this.$route.query.workspaceId;
175183
// 获取所有分类和工程
176184
this.getclassListData();
177185
},
@@ -183,10 +191,10 @@ export default {
183191
methods: {
184192
getclassListData() {
185193
this.loading = true;
186-
return api.fetch(`/dss/tree`, {}, 'get').then((res) => {
194+
return api.fetch(`/dss/tree`, { workspaceId: this.workspaceId }, 'get').then((res) => {
187195
this.cacheData = res.data;
188196
this.dataList = this.cacheData;
189-
// this.activeItem = this.dataList[0];
197+
this.activeItem = this.dataList[0];
190198
this.dataList.forEach(item => {
191199
this.sortType[item.id] = this.$t('message.project.updteTime');
192200
})
@@ -207,20 +215,22 @@ export default {
207215
let projectList = this.cacheData.filter((item) => {
208216
return item.id === projectData.taxonomyID;
209217
});
210-
if (this.checkName(projectList[0].dwsProjectList, projectData.name, projectData.id)) return this.$Message.warning(this.$t('message.project.nameUnrepeatable'));
218+
if (this.checkName(projectList[0].dssProjectList, projectData.name, projectData.id)) return this.$Message.warning(this.$t('message.project.nameUnrepeatable'));
219+
projectData.workspaceId = this.workspaceId;
211220
this.loading = true;
212221
if (this.actionType === 'add') {
213222
api.fetch('/dss/addProject', projectData, 'post').then(() => {
214-
this.$Message.success(`${this.$t('message.project.createProject')}${this.$t('message.newConst.success')}`);
223+
this.$Message.success(`${this.$t('message.project.createproject')}${this.$t('message.newConst.success')}`);
215224
this.getclassListData().then((data) => {
216225
// 新建完工程进到工作流页
217-
const currentProject = data[0].dwsProjectList.filter((project) => project.name === projectData.name)[0];
226+
const currentProject = data[0].dssProjectList.filter((project) => project.name === projectData.name)[0];
218227
this.$router.push({
219228
name: 'Workflow',
220229
query: {
221230
projectTaxonomyID: 1,
222231
projectID: currentProject.latestVersion.projectID,
223232
projectVersionID: currentProject.latestVersion.id,
233+
workspaceId: this.workspaceId
224234
}
225235
});
226236
});
@@ -312,7 +322,7 @@ export default {
312322
projectID: subItem.id,
313323
projectVersionID: subItem.latestVersion.id,
314324
projectName: subItem.name,
315-
workspaceId: this.$route.query.workspaceId
325+
workspaceId: this.workspaceId
316326
}
317327
this.$router.push({
318328
name: 'Workflow',
@@ -332,7 +342,7 @@ export default {
332342
let tepArray = storage.get('projectList', 'local');
333343
this.dataList = tepArray.map((item) => {
334344
if (id === item.id) {
335-
item.dwsProjectList = item.dwsProjectList.filter((subItem) => {
345+
item.dssProjectList = item.dssProjectList.filter((subItem) => {
336346
return subItem.name.indexOf(event.target.value) != -1;
337347
});
338348
}
@@ -401,7 +411,7 @@ export default {
401411
let projectList = this.cacheData.filter((item) => {
402412
return item.id === this.currentProjectData.taxonomyID;
403413
});
404-
if (this.checkName(projectList[0].dwsProjectList, name, this.currentProjectData.id)) return this.$Message.warning(this.$t('message.project.nameUnrepeatable'));
414+
if (this.checkName(projectList[0].dssProjectList, name, this.currentProjectData.id)) return this.$Message.warning(this.$t('message.project.nameUnrepeatable'));
405415
};
406416
this.dispatch('Project:copy', copyCheckName);
407417
} else if (this.currentForm === 'publishForm') {
@@ -493,7 +503,7 @@ export default {
493503
this.sortType[id] = name === 'updateTime' ? this.$t('message.project.updteTime') : this.$t('message.project.name')
494504
this.dataList = this.dataList.map((item) => {
495505
if (!id || id === item.id) {
496-
item.dwsProjectList = item.dwsProjectList.sort((a, b) => {
506+
item.dssProjectList = item.dssProjectList.sort((a, b) => {
497507
if (name === 'updateTime') {
498508
return b.latestVersion[name] - a.latestVersion[name];
499509
} else {

web/src/js/module/workflow/index.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
:hide-button-bar="false"
1515
:hide-publish-andcopy="true"
1616
:current-data="item"
17-
:data-list="item.dwsFlowList"
17+
:data-list="item.dssFlowList"
1818
:readonly="myReadonly"
1919
source="workflow"
2020
tag-prop="uses"
@@ -120,6 +120,7 @@ export default {
120120
flowTaxonomyID: 0, // 工作流分类的id
121121
readonly: 'false',
122122
currentWorkflowData: null,
123+
workspaceId: null
123124
// publishModelShow: false,
124125
};
125126
},
@@ -144,6 +145,7 @@ export default {
144145
}
145146
},
146147
created() {
148+
this.workspaceId = this.$route.query.workspaceId;
147149
this.fetchFlowData();
148150
},
149151
methods: {
@@ -155,9 +157,9 @@ export default {
155157
// 获取工作流的参数
156158
getParams(isRootFlow, flowTaxonomyID) {
157159
if (flowTaxonomyID) {
158-
this.params = `?projectTaxonomyID=${this.$route.query.projectTaxonomyID}&projectVersionID=${this.$route.query.projectVersionID}&flowTaxonomyID=${flowTaxonomyID}&isRootFlow=${!isRootFlow}`;
160+
this.params = `?projectTaxonomyID=${this.$route.query.projectTaxonomyID}&projectVersionID=${this.$route.query.projectVersionID}&flowTaxonomyID=${flowTaxonomyID}&isRootFlow=${!isRootFlow}&workspaceId=${this.workspaceId}`;
159161
} else {
160-
this.params = `?projectTaxonomyID=${this.$route.query.projectTaxonomyID}&projectVersionID=${this.$route.query.projectVersionID}&isRootFlow=${!isRootFlow}`;
162+
this.params = `?projectTaxonomyID=${this.$route.query.projectTaxonomyID}&projectVersionID=${this.$route.query.projectVersionID}&isRootFlow=${!isRootFlow}&workspaceId=${this.workspaceId}`;
161163
}
162164
},
163165
// 获取所有分类和工作流
@@ -184,7 +186,7 @@ export default {
184186
let flowList = this.cacheData.filter((item) => {
185187
return item.id === projectData.taxonomyID;
186188
});
187-
if (this.checkName(flowList[0].dwsFlowList, projectData.name, projectData.id)) return this.$Message.warning(this.$t('message.workflow.nameUnrepeatable'));
189+
if (this.checkName(flowList[0].dssFlowList, projectData.name, projectData.id)) return this.$Message.warning(this.$t('message.workflow.nameUnrepeatable'));
188190
this.loading = true;
189191
if (this.actionType === 'add') {
190192
api.fetch('/dss/addFlow', projectData, 'post').then(() => {
@@ -356,8 +358,8 @@ export default {
356358
projectVersionID: +this.$route.query.projectVersionID,
357359
};
358360
for (let i = 0; i < this.dataList.length; i++) {
359-
for (let j = 0; j < this.dataList[i].dwsFlowList.length; j++) {
360-
if (this.dataList[i].dwsFlowList[j].id === project.id) {
361+
for (let j = 0; j < this.dataList[i].dssFlowList.length; j++) {
362+
if (this.dataList[i].dssFlowList[j].id === project.id) {
361363
this.flowTaxonomyID = this.dataList[i].id;
362364
break;
363365
}
@@ -378,7 +380,7 @@ export default {
378380
let tepArray = storage.get('flowsList');
379381
this.dataList = tepArray.map((item) => {
380382
if (id === item.id) {
381-
item.dwsFlowList = item.dwsFlowList.filter((subItem) => {
383+
item.dssFlowList = item.dssFlowList.filter((subItem) => {
382384
return subItem.name.indexOf(event.target.value) != -1;
383385
});
384386
}

0 commit comments

Comments
 (0)