@@ -40,7 +40,6 @@
@@ -52,6 +51,11 @@
{{ $t('导出为') }} DAT {{ $t('文件') }}
+
+
* {
+ margin-right: 14px;
+ }
}
.my-create-btn {
position: absolute;
diff --git a/frontend/desktop/src/pages/template/TemplatePreview/index.vue b/frontend/desktop/src/pages/template/TemplatePreview/index.vue
index 54f764d1b2..17ba751969 100644
--- a/frontend/desktop/src/pages/template/TemplatePreview/index.vue
+++ b/frontend/desktop/src/pages/template/TemplatePreview/index.vue
@@ -15,8 +15,7 @@
},
props: {
project_id: [Number, String],
- template_id: [Number, String],
- common: [Number, String]
+ template_id: [Number, String]
},
data () {
return {
@@ -33,17 +32,17 @@
this.getTemplateData()
},
methods: {
- ...mapActions('template/', [
- 'loadTemplateData'
+ ...mapActions('templateMarket/', [
+ 'loadTemplatePreviewData'
]),
async getTemplateData () {
try {
this.templateLoading = true
- const resp = await this.loadTemplateData({
- templateId: this.template_id,
- common: this.common
+ const resp = await this.loadTemplatePreviewData({
+ template_id: this.template_id,
+ project_id: this.project_id
})
- const pipelineTree = JSON.parse(resp.pipeline_tree)
+ const pipelineTree = JSON.parse(resp.data.pipeline_tree)
this.templateData = formatCanvasData('perview', pipelineTree)
} catch (e) {
console.log(e)
diff --git a/frontend/desktop/src/store/modules/index.js b/frontend/desktop/src/store/modules/index.js
index 1178ed301c..08b395a75c 100644
--- a/frontend/desktop/src/store/modules/index.js
+++ b/frontend/desktop/src/store/modules/index.js
@@ -23,6 +23,7 @@ import periodic from './periodic.js'
import clocked from './clocked.js'
import manage from './manage.js'
import admin from './admin.js'
+import templateMarket from './templateMarket.js'
const modules = {
template,
@@ -38,7 +39,8 @@ const modules = {
clocked,
manage,
project,
- admin
+ admin,
+ templateMarket
}
export default modules
diff --git a/frontend/desktop/src/store/modules/templateMarket.js b/frontend/desktop/src/store/modules/templateMarket.js
new file mode 100644
index 0000000000..2809adcb9a
--- /dev/null
+++ b/frontend/desktop/src/store/modules/templateMarket.js
@@ -0,0 +1,38 @@
+
+import axios from 'axios'
+
+const templateMarket = {
+ namespaced: true,
+ actions: {
+ loadMarkedServiceCategory ({ commit }) {
+ return axios.get('/template_market/api/templates_scene/get_service_category/').then(response => response.data)
+ },
+ loadMarkedSceneLabel ({ commit }) {
+ return axios.get('/template_market/api/templates_scene/get_scene_label/').then(response => response.data)
+ },
+ loadMarkedRiskLevel ({ commit }) {
+ return axios.get('/template_market/api/templates_scene/get_risk_level/').then(response => response.data)
+ },
+ getFileUploadAddr ({ commit }, params) {
+ return axios.get('/template_market/api/templates_scene/get_file_upload_addr/', { params }).then(response => response.data.data)
+ },
+ createLabel ({ commit }, params) {
+ return axios.post('/template_market/api/templates_scene/create_scene_label/', params).then(response => response.data)
+ },
+ loadSharedTemplateRecord ({ commit }) {
+ return axios.get('/template_market/api/templates_scene/').then(response => response.data)
+ },
+ sharedTemplateRecord ({ commit }, params) {
+ const { id } = params
+ const baseUrl = '/template_market/api/templates_scene/'
+ const url = id ? `${baseUrl}${id}/` : baseUrl
+ const method = id ? 'patch' : 'post'
+ return axios[method](url, params).then(response => response.data)
+ },
+ loadTemplatePreviewData ({ commit }, params) {
+ return axios.get('/template_market/api/template_preview/', { params }).then(response => response.data)
+ }
+ }
+}
+
+export default templateMarket