Bläddra i källkod

工作空间 选择工作链 接口调整

master
unknown 4 år sedan
förälder
incheckning
75787bbc11
1 ändrade filer med 30 tillägg och 19 borttagningar
  1. +30
    -19
      src/views/components_web/newProj/newProj.vue

+ 30
- 19
src/views/components_web/newProj/newProj.vue Visa fil

@@ -67,8 +67,8 @@
<el-form-item label="选择工作链">
<el-select v-model="newProjData.projectData.templateID" filterable no-data-text="暂无数据"
placeholder="请选择工作链" class="bg_w" @change="changeSelectTemplate">
<el-option v-for="item in selectTemlateData" :key="item.templateID" :label="item.tempName"
:value="item.templateID">
<el-option v-for="item in templateList" :key="item.Id" :label="item.TempName"
:value="item.Id">
</el-option>
</el-select>
</el-form-item>
@@ -549,6 +549,7 @@
</template>
<script>
import * as templateService from '@/services/template';
export default {
props: {
isNewProj: {
@@ -640,6 +641,9 @@
currSelectData: [],
currUser:JSON.parse(sessionStorage.user),
isShowManager:true,
/* */
templateList: [], // 模板列表
};
},
watch: {
@@ -1416,23 +1420,30 @@
/**
* 获取模板列表数据
*/
getSelectTemplateData: function() {
var thisApp = this;
this.$axios({
method: 'get',
url: encodeURI(process.env.API_HOST + "templates/company/enable/" + sessionStorage.companyId),
})
.then(response => {
thisApp.selectTemlateData = response.data;
if (thisApp.selectTemlateData != null && thisApp.selectTemlateData.length > 0) {
thisApp.selectTemlateID = thisApp.selectTemlateData[0].templateID;
// thisApp.newProjData.projectData.templateID= thisApp.selectTemlateID;
// thisApp.changeSelectTemplate(thisApp.selectTemlateID);
}
})
.catch(error => {
console.log(error);
});
async getSelectTemplateData() {
const templateListRes = await templateService.queryTemplateList();
const templateList = templateListRes.Data || [];
this.templateList = templateList;
console.log(templateList);
if(this.templateList && this.templateList.length) {
this.selectTemlateID = templateList[0].Id;
}
// var thisApp = this;
// this.$axios({
// method: 'get',
// url: encodeURI(process.env.API_HOST + "templates/company/enable/" + sessionStorage.companyId),
// })
// .then(response => {
// thisApp.selectTemlateData = response.data;
// if (thisApp.selectTemlateData != null && thisApp.selectTemlateData.length > 0) {
// thisApp.selectTemlateID = thisApp.selectTemlateData[0].templateID;
// // thisApp.newProjData.projectData.templateID= thisApp.selectTemlateID;
// // thisApp.changeSelectTemplate(thisApp.selectTemlateID);
// }
// })
// .catch(error => {
// console.log(error);
// });
},
/**
* 获取模板属性字段


Laddar…
Avbryt
Spara