35 lines
1010 B
JavaScript
35 lines
1010 B
JavaScript
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
|
||
}
|
||
|
||
}
|
||
}
|
||
} |