|
@@ -18,12 +18,6 @@
|
|
|
<Button type="primary" @click="save">保存</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Modal :show="modalStatusTip" title="提示" mode="tip" type="info">
|
|
|
- <template #content> 填写内容未保存,确定保存吗? </template>
|
|
|
- <template #handle>
|
|
|
- <Button>11</Button>
|
|
|
- </template>
|
|
|
- </Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -62,10 +56,9 @@ export default {
|
|
|
return {
|
|
|
anchorList: [],
|
|
|
info: {},
|
|
|
- refresh: false,
|
|
|
- modalStatusTip: false,
|
|
|
- isSaved: true,
|
|
|
- hasChange: false,
|
|
|
+ refresh: false, // 节点重新渲染
|
|
|
+ isSaved: true, // 是否已经保存
|
|
|
+ hasChange: false, // 是否有修改
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -78,6 +71,7 @@ export default {
|
|
|
this.initEvent();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取参数字典
|
|
|
async getDict() {
|
|
|
return Dic.getDataDictionary({
|
|
|
type: "project",
|
|
@@ -108,6 +102,7 @@ export default {
|
|
|
console.log(keys);
|
|
|
});
|
|
|
},
|
|
|
+ // 获取数据信息
|
|
|
async getInfo() {
|
|
|
return ScanController.getAllProject({
|
|
|
filters: `projectId=${this.projectId}`,
|
|
@@ -119,6 +114,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 跳转到锚点
|
|
|
goAnchor(anchor) {
|
|
|
let name = anchor;
|
|
|
let dom = document.querySelector(`.${name}-container`);
|
|
@@ -127,6 +123,7 @@ export default {
|
|
|
right.scrollTop = dom.offsetTop - 120;
|
|
|
}
|
|
|
},
|
|
|
+ // 保存
|
|
|
save() {
|
|
|
ScanController.updateProjectInfo({ content: [this.info] }).then((res) => {
|
|
|
this.$message.success("保存成功");
|
|
@@ -178,18 +175,14 @@ export default {
|
|
|
this.loading = IndexLoading();
|
|
|
this.refresh = true;
|
|
|
Promise.all([this.getInfo(), this.getDict()]).then(() => {
|
|
|
- console.log(222);
|
|
|
this.refresh = false;
|
|
|
IndexLoading.remove(this.loading);
|
|
|
});
|
|
|
- // this.getInfo();
|
|
|
- // this.getDict();
|
|
|
- // this.openLoading();
|
|
|
},
|
|
|
},
|
|
|
+ // 二次确认
|
|
|
beforeRouteLeave(to, from, next) {
|
|
|
if (this.hasChange && !this.isSaved) {
|
|
|
- // this.modalStatusTip = true;
|
|
|
next(false);
|
|
|
this.$confirm("填写内容未保存,确定保存吗?", "提示", {
|
|
|
confirmButtonText: "保存",
|