From 5d5aca22b99b50e3490975b72f4de27f6ccf60f3 Mon Sep 17 00:00:00 2001 From: wujj <1027418825@qq.com> Date: Fri, 2 Apr 2021 19:48:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/manager/cms/content/form.ftl | 43 ++++--------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl index 59c7593a..d53b962e 100644 --- a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl @@ -1,8 +1,9 @@ - 文章 + 文章1 <#include "../../include/head-file.ftl"> +
@@ -440,50 +441,24 @@ changeModel: function () { var that = this; that.editableTabs = [that.editableTabs[0]]; - this.removeModel(); if (this.currCategory) { if (this.currCategory.mdiyModelId) { - ms.http.get(ms.manager + "/mdiy/model/get.do", { - id: this.currCategory.mdiyModelId - }).then(function (data) { - if (data.data && data.data.id) { - that.rederModel(data.data, JSON.parse(data.data.modelJson)); - } - }); + that.rederModel(this.currCategory.mdiyModelId) } } }, - rederModel: function (modelEntity, data) { + rederModel: function (modelId) { var that = this; that.editableTabs.push({ - title: modelEntity.modelName, + title: '', name: 'custom-name' }); - this.removeModel(); - that.$nextTick(function () { - var div = document.createElement('div'); - div.id = 'c_model'; - var model = document.getElementById('model1'); - model.appendChild(div); - var s = document.createElement('script'); - s.innerHTML = data.script; - var con = document.createElement('div'); - con.id = 'custom-model'; - con.innerHTML = data.html; - div.appendChild(s); - div.appendChild(con); //初始化自定义模型并传入关联参数 - - that.model = new custom_model({ - data: { - title: modelEntity.modelName, - modelId: modelEntity.id, - form: { - linkId: that.form.id - } - } - }); + ms.mdiy.model.model("model1", {id:modelId},{ linkId: that.form.id }).then(function(obj) { + that.model = obj; + that.editableTabs[1].title = obj.modelName }); + }, getValue: function (data) { this.form.categoryId = data.id;