提交 aed0dcf1 编写于 作者: S shenjizhe

1

上级 b1133ba9
......@@ -7,15 +7,17 @@ module.exports = {
generateCode: generateCode,
getComponents: getComponents,
saveComponents: saveComponents,
addComponent: addComponent,
getDataSources: getDataSources,
getTemplates: getTemplates,
createGit,createGit,
createGit,
createGit,
pushGit: pushGit
}
let url = 'http://localhost:8099';
let url = 'http://localhost:8071';
// let url = 'http://dzlc.licaiedu.com/code';
let headers = {
"Access-Control-Allow-Origin": "http://localhost:8099"
"Access-Control-Allow-Origin": "http://dzlc.licaiedu.com/code"
};
function loadEntities(domainId, success, fail, complete) {
......@@ -46,6 +48,10 @@ function saveComponents(datas, success, fail, complete) {
http.put(url + '/components/batch/', datas, headers, success, fail, complete);
}
function addComponent(data, success, fail, complete) {
http.post(url + '/components/', data, headers, success, fail, complete);
}
function getDataSources(success, fail, complete) {
http.get(url + '/db-sources/batch/?ids=', headers, success, fail, complete);
}
......
......@@ -44,7 +44,9 @@
},
"ios" : {},
/* ios打包配置 */
"sdkConfigs" : {}
"sdkConfigs" : {
"ad" : {}
}
},
"nvueLaunchMode" : ""
},
......
......@@ -2,7 +2,7 @@
<view style="display: flex;flex-direction: column;justify-content: space-between;">
<view><uni-steps :options="progress" :active="processIndex"></uni-steps></view>
<scroll-view style="height: 88vh">
<thirdlucky-data-form v-if="processIndex == 0" :showButton="false" :columns="repository.columns" :formData="repository.data"></thirdlucky-data-form>
<thirdlucky-data-form v-if="processIndex == 0" :showButton="false" :columns="component.columns" :formData="component.data"></thirdlucky-data-form>
<thirdlucky-data-view
v-if="processIndex == 1"
:buttons="buttons"
......@@ -13,10 +13,18 @@
@selected="onSelected"
></thirdlucky-data-view>
<thirdlucky-data-form v-if="processIndex == 2" :showButton="false" :columns="code.columns" :formData="code.data"></thirdlucky-data-form>
<view v-if="processIndex == 3">
<button @click="onCreateComponent">新建组件</button>
<button @click="onCreateGit">新建git</button>
<button @click="onSaveModel">保存模型</button>
<button @click="onGenerateCode">生成代码</button>
<button @click="onUpload">上传代码</button>
<thirdlucky-console-view ref="console" class="console-view"></thirdlucky-console-view>
</view>
</scroll-view>
<view style="display: flex;flex-direction: row;">
<button style="flex: 1;" :disabled="processIndex == 0" @click="onPrevious">上一步</button>
<button style="flex: 1;" :disabled="processIndex == 4" @click="onNext">下一步</button>
<button style="flex: 1;" :disabled="processIndex == 3" @click="onNext">下一步</button>
</view>
</view>
</template>
......@@ -59,7 +67,7 @@ export default {
datas: [],
tableNames: ['name', 'comment']
},
repository: {
component: {
columns: [
{
name: 'name',
......@@ -179,9 +187,43 @@ export default {
}
this.processIndex++;
}
},
onCreateComponent() {
callApi(this.api.addComponent, this.component.data);
},
onCreateGit() {},
onSaveModel() {},
onGenerateCode() {},
onUpload() {},
callApi(apifunc, data) {
apifunc(
data,
res => {
uni.showToast({
title: '提交成功:',
icon: 'succes',
duration: 2000
});
},
res => {
uni.showToast({
title: '提交失败:' + res.errMsg,
icon: 'error',
duration: 2000
});
}
);
}
}
};
</script>
<style></style>
<style>
.console-view {
background: white;
border-style: solid;
border-width: 100%;
height: 60vh;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册