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

35 lines
1010 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { findDataInfo } from "../../../api/documentManagement"
export default{
data(){
return{
typeArray:[],
}
},
mounted(){
// this.fetchDataInfo()
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
}
}
}
}