| | |
| | | return |
| | | } |
| | | |
| | | if (res.data && res.data.data &&res.data.data.code == 401) { |
| | | Message({ |
| | | message: res.data.msg || '登录已过期,请重新登录', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }) |
| | | sessionStorage.clear(); |
| | | window.location.replace('/'); |
| | | return |
| | | } |
| | | |
| | | |
| | | if (res.data.code == 200) { |
| | | if (!res.data) { |
| | |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }) |
| | | sessionStorage.clear(); |
| | | window.location.replace('/'); |
| | | } else if ((res.data && res.data.data && (res.data.data.code == 500)) || res.data.code == 500) { |
| | | Message({ |
| | | message: res.data.data.msg || '服务器错误', |
| | |
| | | confirmStorage, |
| | | deleteNode, |
| | | updateChild, |
| | | edit, |
| | | } from "./service"; |
| | | export default { |
| | | name: "AddPedigree", |
| | |
| | | }, |
| | | one: buildTree(this.graphData.nodes, this.graphData.edges), |
| | | }; |
| | | |
| | | if (this.$route.query.id) { |
| | | edit({ ...baseData, id: this.$route.query.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("编辑成功"); |
| | | this.$router.back(); |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | add(baseData).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("保存成功"); |
| | |
| | | content = `${cfg.planCount || 0}`; |
| | | } else if (cfg.number) { |
| | | // 获取类型名称 |
| | | let typeName = "传代菌种"; |
| | | let typeName = "接种菌种"; |
| | | if (cfg.data && cfg.data.strainType) { |
| | | const typeMap = { |
| | | "1": "原始祖代菌株SO", |
| | | "2": "分离菌落 CO", |
| | | "3": "祖代菌株 O", |
| | | }; |
| | | typeName = typeMap[cfg.data.strainType] || "传代菌种"; |
| | | typeName = typeMap[cfg.data.strainType] || "接种菌种"; |
| | | } |
| | | content = `${typeName}编号:${cfg.number}`; |
| | | } |
| | |
| | | confirmStorage, |
| | | deleteNode, |
| | | updateChild, |
| | | edit |
| | | } from "./service"; |
| | | |
| | | export default { |
| | |
| | | parent: { ...this.form }, |
| | | one: processNodeData(this.graphData.nodes), |
| | | }; |
| | | if (this.$route.query.id) { |
| | | edit({ ...baseData, id: this.$route.query.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("编辑成功"); |
| | | this.$router.back(); |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | add(baseData).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("保存成功"); |
| | |
| | | content = `${cfg.planCount || 0}`; |
| | | } else if (cfg.number) { |
| | | // 获取类型名称 |
| | | let typeName = "传代菌种"; |
| | | let typeName = "接种菌种"; |
| | | if (cfg.data && cfg.data.strainType) { |
| | | const typeMap = { |
| | | "1": "原始祖代菌株SO", |
| | | "2": "分离菌落 CO", |
| | | "3": "祖代菌株 O", |
| | | }; |
| | | typeName = typeMap[cfg.data.strainType] || "传代菌种"; |
| | | typeName = typeMap[cfg.data.strainType] || "接种菌种"; |
| | | } |
| | | content = `${typeName}编号:${cfg.number}`; |
| | | } |
| | |
| | | return axios.post('/api/t-pedigree-chart/addProgenitor', { ...data }) |
| | | } |
| | | |
| | | //编辑 |
| | | export const edit = (data) => { |
| | | return axios.post('/api/t-pedigree-chart/editProgenitor', { ...data }) |
| | | } |
| | | |
| | | // 谱系图详情 |
| | | export const getDetail = (params) => { |
| | | return axios.get('/open/t-pedigree-chart/getDetailInfoById', { params }) |