|
@@ -2239,8 +2239,6 @@ export default { |
|
|
*/ |
|
|
*/ |
|
|
modifyTemplate() { |
|
|
modifyTemplate() { |
|
|
var thisApp = this; |
|
|
var thisApp = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证表单 |
|
|
// 验证表单 |
|
|
thisApp.$refs['tempform'].validate(async (valid) => { |
|
|
thisApp.$refs['tempform'].validate(async (valid) => { |
|
|
if (!valid) return; |
|
|
if (!valid) return; |
|
@@ -2259,7 +2257,7 @@ export default { |
|
|
data.Temple.Disable = +data.Temple.Disable; |
|
|
data.Temple.Disable = +data.Temple.Disable; |
|
|
data.Temple.Locked = +data.Temple.Locked; |
|
|
data.Temple.Locked = +data.Temple.Locked; |
|
|
} |
|
|
} |
|
|
console.log(data); |
|
|
|
|
|
|
|
|
// console.log(data); |
|
|
data.ChildIndustry = [data.IndLevel3, data.IndLevel4] |
|
|
data.ChildIndustry = [data.IndLevel3, data.IndLevel4] |
|
|
.filter((a) => a) |
|
|
.filter((a) => a) |
|
|
.join(","); |
|
|
.join(","); |
|
@@ -2373,55 +2371,55 @@ export default { |
|
|
/** |
|
|
/** |
|
|
* 编辑模板 |
|
|
* 编辑模板 |
|
|
*/ |
|
|
*/ |
|
|
async modifyTemplateOld() { |
|
|
|
|
|
const currentTemplate = this.currentTemplateData; |
|
|
|
|
|
debugger; |
|
|
|
|
|
|
|
|
// async modifyTemplateOld() { |
|
|
|
|
|
// const currentTemplate = this.currentTemplateData; |
|
|
|
|
|
// debugger; |
|
|
|
|
|
|
|
|
// if (this.selectDetailIndustryIndex === "") { |
|
|
|
|
|
// const dataIndex = this.currentTemp.detailIndustryID; |
|
|
|
|
|
// this.currentTemp.detailIndustryID = this.listSonIndustry[dataIndex].id; |
|
|
|
|
|
// this.currentTemp.fullCode = |
|
|
|
|
|
// this.listSonIndustry[dataIndex].data.fullCode + |
|
|
|
|
|
// this.currentTemp.customCode; |
|
|
|
|
|
// } else { |
|
|
|
|
|
// const dataIndex = this.selectDetailIndustryIndex; |
|
|
|
|
|
// this.currentTemp.detailIndustryID = this.listDetailIndustry[ |
|
|
|
|
|
// dataIndex |
|
|
|
|
|
// ].id; |
|
|
|
|
|
// this.currentTemp.fullCode = |
|
|
|
|
|
// this.listDetailIndustry[dataIndex].data.fullCode + |
|
|
|
|
|
// this.currentTemp.customCode; |
|
|
|
|
|
// } |
|
|
|
|
|
// this.currentTemp.listProperty = this.listTempProp; |
|
|
|
|
|
// var thisApp = this; |
|
|
|
|
|
// this.$axios({ |
|
|
|
|
|
// method: "put", |
|
|
|
|
|
// url: encodeURI(process.env.API_HOST + "Templates/"), |
|
|
|
|
|
// data: thisApp.currentTemp, |
|
|
|
|
|
// }) |
|
|
|
|
|
// .then(function (response) { |
|
|
|
|
|
// if (response.data.state == 1) { |
|
|
|
|
|
// thisApp.$notify({ |
|
|
|
|
|
// title: "恭喜您", |
|
|
|
|
|
// message: response.data.message, |
|
|
|
|
|
// type: "success", |
|
|
|
|
|
// offset: 100, |
|
|
|
|
|
// duration: 2500, |
|
|
|
|
|
// }); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// thisApp.$notify({ |
|
|
|
|
|
// title: "温馨提示", |
|
|
|
|
|
// message: response.data.message, |
|
|
|
|
|
// type: "success", |
|
|
|
|
|
// offset: 100, |
|
|
|
|
|
// duration: 5000, |
|
|
|
|
|
// }); |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// .catch(function (error) { |
|
|
|
|
|
// console.log(error); |
|
|
|
|
|
// }); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// // if (this.selectDetailIndustryIndex === "") { |
|
|
|
|
|
// // const dataIndex = this.currentTemp.detailIndustryID; |
|
|
|
|
|
// // this.currentTemp.detailIndustryID = this.listSonIndustry[dataIndex].id; |
|
|
|
|
|
// // this.currentTemp.fullCode = |
|
|
|
|
|
// // this.listSonIndustry[dataIndex].data.fullCode + |
|
|
|
|
|
// // this.currentTemp.customCode; |
|
|
|
|
|
// // } else { |
|
|
|
|
|
// // const dataIndex = this.selectDetailIndustryIndex; |
|
|
|
|
|
// // this.currentTemp.detailIndustryID = this.listDetailIndustry[ |
|
|
|
|
|
// // dataIndex |
|
|
|
|
|
// // ].id; |
|
|
|
|
|
// // this.currentTemp.fullCode = |
|
|
|
|
|
// // this.listDetailIndustry[dataIndex].data.fullCode + |
|
|
|
|
|
// // this.currentTemp.customCode; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // this.currentTemp.listProperty = this.listTempProp; |
|
|
|
|
|
// // var thisApp = this; |
|
|
|
|
|
// // this.$axios({ |
|
|
|
|
|
// // method: "put", |
|
|
|
|
|
// // url: encodeURI(process.env.API_HOST + "Templates/"), |
|
|
|
|
|
// // data: thisApp.currentTemp, |
|
|
|
|
|
// // }) |
|
|
|
|
|
// // .then(function (response) { |
|
|
|
|
|
// // if (response.data.state == 1) { |
|
|
|
|
|
// // thisApp.$notify({ |
|
|
|
|
|
// // title: "恭喜您", |
|
|
|
|
|
// // message: response.data.message, |
|
|
|
|
|
// // type: "success", |
|
|
|
|
|
// // offset: 100, |
|
|
|
|
|
// // duration: 2500, |
|
|
|
|
|
// // }); |
|
|
|
|
|
// // } else { |
|
|
|
|
|
// // thisApp.$notify({ |
|
|
|
|
|
// // title: "温馨提示", |
|
|
|
|
|
// // message: response.data.message, |
|
|
|
|
|
// // type: "success", |
|
|
|
|
|
// // offset: 100, |
|
|
|
|
|
// // duration: 5000, |
|
|
|
|
|
// // }); |
|
|
|
|
|
// // } |
|
|
|
|
|
// // }) |
|
|
|
|
|
// // .catch(function (error) { |
|
|
|
|
|
// // console.log(error); |
|
|
|
|
|
// // }); |
|
|
|
|
|
// }, |
|
|
/** |
|
|
/** |
|
|
* 重命名文件夹 |
|
|
* 重命名文件夹 |
|
|
*/ |
|
|
*/ |
|
@@ -2684,61 +2682,43 @@ export default { |
|
|
* 删除模板 |
|
|
* 删除模板 |
|
|
*/ |
|
|
*/ |
|
|
delTemplateClick: function () { |
|
|
delTemplateClick: function () { |
|
|
var thisApp = this; |
|
|
|
|
|
|
|
|
const currentTemplate = this.currentTemplateData; |
|
|
this.$confirm( |
|
|
this.$confirm( |
|
|
"您正在删除 [" + thisApp.currentTemp.tempName + "] 模板是否继续?", |
|
|
|
|
|
|
|
|
"您正在删除 [" + currentTemplate.Temple.TempName + "] 模板是否继续?", |
|
|
"删除", |
|
|
"删除", |
|
|
{ |
|
|
{ |
|
|
confirmButtonText: "确定", |
|
|
confirmButtonText: "确定", |
|
|
cancelButtonText: "取消", |
|
|
cancelButtonText: "取消", |
|
|
type: "warning", |
|
|
type: "warning", |
|
|
} |
|
|
} |
|
|
).then(() => { |
|
|
|
|
|
this.$axios({ |
|
|
|
|
|
method: "delete", |
|
|
|
|
|
url: encodeURI( |
|
|
|
|
|
process.env.API_HOST + |
|
|
|
|
|
"Templates/" + |
|
|
|
|
|
thisApp.currentTemp.templateID + |
|
|
|
|
|
"/" + |
|
|
|
|
|
thisApp.currentTemp.tempName + |
|
|
|
|
|
"/" + |
|
|
|
|
|
sessionStorage.userId |
|
|
|
|
|
), |
|
|
|
|
|
}) |
|
|
|
|
|
.then(function (response) { |
|
|
|
|
|
thisApp.$notify({ |
|
|
|
|
|
title: "恭喜您", |
|
|
|
|
|
message: response.data.message, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
offset: 100, |
|
|
|
|
|
duration: 2500, |
|
|
|
|
|
}); |
|
|
|
|
|
thisApp.getTemplateData(); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(function (error) { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
).then(async () => { |
|
|
|
|
|
const res = await services.deleteTemplate(currentTemplate.Temple.Id); |
|
|
|
|
|
if( res.Code !== 0) return; |
|
|
|
|
|
notify.success('删除成功'); |
|
|
|
|
|
this.getTemplateData(); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 获取思维导图数据 |
|
|
* 获取思维导图数据 |
|
|
*/ |
|
|
*/ |
|
|
getTemplateMindTree: function () { |
|
|
|
|
|
var thisApp = this; |
|
|
|
|
|
this.$axios({ |
|
|
|
|
|
method: "get", |
|
|
|
|
|
url: encodeURI( |
|
|
|
|
|
process.env.API_HOST + "templates/treenodes/" + thisApp.templateID |
|
|
|
|
|
), |
|
|
|
|
|
}) |
|
|
|
|
|
.then((response) => { |
|
|
|
|
|
thisApp.listTemplateMindTree = response.data; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((error) => { |
|
|
|
|
|
console.log(error); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// async getTemplateMindTree() { |
|
|
|
|
|
// debugger; |
|
|
|
|
|
// const templateId = this.templateID; |
|
|
|
|
|
// const res = await services.queryTemplateNodeByTemplateId(templateId); |
|
|
|
|
|
// this.listTemplateMindTree = res.Data || []; |
|
|
|
|
|
// // this.$axios({ |
|
|
|
|
|
// // method: "get", |
|
|
|
|
|
// // url: encodeURI( |
|
|
|
|
|
// // process.env.API_HOST + "templates/treenodes/" + thisApp.templateID |
|
|
|
|
|
// // ), |
|
|
|
|
|
// // }) |
|
|
|
|
|
// // .then((response) => { |
|
|
|
|
|
// // thisApp.listTemplateMindTree = response.data; |
|
|
|
|
|
// // }) |
|
|
|
|
|
// // .catch((error) => { |
|
|
|
|
|
// // console.log(error); |
|
|
|
|
|
// // }); |
|
|
|
|
|
// }, |
|
|
//导入Xmind模板的dialog |
|
|
//导入Xmind模板的dialog |
|
|
importXmind: function () { |
|
|
importXmind: function () { |
|
|
this.isImportDialog = true; |
|
|
this.isImportDialog = true; |
|
@@ -3414,7 +3394,7 @@ export default { |
|
|
name: this.templateName, |
|
|
name: this.templateName, |
|
|
id: this.templateID, |
|
|
id: this.templateID, |
|
|
data: this.treeMenuClickData, |
|
|
data: this.treeMenuClickData, |
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
backmodlemain: function () { |
|
|
backmodlemain: function () { |
|
@@ -3461,21 +3441,24 @@ export default { |
|
|
* 查看样板文件 |
|
|
* 查看样板文件 |
|
|
*/ |
|
|
*/ |
|
|
toNodeFile: function () { |
|
|
toNodeFile: function () { |
|
|
debugger; |
|
|
|
|
|
var templateId = this.currentTemp.templateID; |
|
|
|
|
|
|
|
|
const currentTemplateData = this.currentTemplateData; |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
name: "system_template_file", |
|
|
name: "system_template_file", |
|
|
params: { |
|
|
params: { |
|
|
id: templateId, |
|
|
|
|
|
data: this.currentTemp, |
|
|
|
|
|
|
|
|
id: currentTemplateData.Temple.Id, |
|
|
|
|
|
data: currentTemplateData.Temple, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/*---------- ----------*/ |
|
|
/*---------- ----------*/ |
|
|
async getTemplateDetail(templateId) { |
|
|
async getTemplateDetail(templateId) { |
|
|
const res = await services.queryTemplateById(templateId); |
|
|
|
|
|
|
|
|
const [res, countRes] = await Promise.all([ |
|
|
|
|
|
services.queryTemplateById(templateId), |
|
|
|
|
|
services.queryTemplateQuoteCount(templateId), |
|
|
|
|
|
]); |
|
|
const mapIndIdToIndNode = this.mapIndIdToIndNode; |
|
|
const mapIndIdToIndNode = this.mapIndIdToIndNode; |
|
|
|
|
|
this.nowCount = countRes.Data || 0; |
|
|
if (res.Code !== 0) return; |
|
|
if (res.Code !== 0) return; |
|
|
const { propertys, template } = res.Data; |
|
|
const { propertys, template } = res.Data; |
|
|
// this.currentTemp = template; |
|
|
// this.currentTemp = template; |
|
|