m2pool_web_frontend/mining-pool/src/views/documentManagement/modifyDocument/index.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2025-07-18 08:22:28 +00:00
import { findDataInfo } from "../../../api/documentManagement"
export default{
data(){
return{
typeArray:[],
2025-07-18 08:22:28 +00:00
}
},
mounted(){
// this.fetchDataInfo()
2025-07-18 08:22:28 +00:00
if (this.$route.query.id) {
this.fetchDataInfo({id:this.$route.query.id})
}
},
methods:{
async fetchDataInfo(params){
const res = await findDataInfo(params)
if (res && res.code === 200) {
this.modifyData = res.data
this.addParams = this.modifyData
// 确保type字段为字符串类型以便与TypeList中的value匹配
this.addParams.type = String(this.addParams.type)
this.addParams.childType = String(this.addParams.childType)
this.typeArray = [this.addParams.type]
// 标记已从后台获取数据,避免被本地存储覆盖
this.hasBackendData = true
2025-07-29 07:53:40 +00:00
// 删除 editor.setHtml 的调用,内容初始化交由 onCreated 统一处理
2025-07-18 08:22:28 +00:00
}
}
}
}