修改confirm弹窗的默认按钮,增加无数据的提示
This commit is contained in:
		
							parent
							
								
									ec6cb33835
								
							
						
					
					
						commit
						c45cd40ba9
					
				| 
						 | 
				
			
			@ -63,7 +63,7 @@ export default {
 | 
			
		|||
        if (res.success) {
 | 
			
		||||
          this.content = res.result
 | 
			
		||||
        } else {
 | 
			
		||||
          this.content = res
 | 
			
		||||
          this.content = ""
 | 
			
		||||
        }
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.error(error)
 | 
			
		||||
| 
						 | 
				
			
			@ -80,28 +80,34 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleOk() {
 | 
			
		||||
      let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
      // if (this.type == 1 || this.type == 3) {
 | 
			
		||||
      //   saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
 | 
			
		||||
      // } else {
 | 
			
		||||
      //   saveAs(strData, `${this.type == 2 ?'Gamma-':'Beta-'} RRR.txt`)
 | 
			
		||||
      // }
 | 
			
		||||
      let _this = this
 | 
			
		||||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        onOk() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      if (this.content) {
 | 
			
		||||
        let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
        // if (this.type == 1 || this.type == 3) {
 | 
			
		||||
        //   saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
 | 
			
		||||
        // } else {
 | 
			
		||||
        //   saveAs(strData, `${this.type == 2 ?'Gamma-':'Beta-'} RRR.txt`)
 | 
			
		||||
        // }
 | 
			
		||||
        let _this = this
 | 
			
		||||
        this.$confirm({
 | 
			
		||||
          title: 'Please enter file name',
 | 
			
		||||
          content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
          okText: 'Cancle',
 | 
			
		||||
          cancelText: 'Save',
 | 
			
		||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
          onOk() {
 | 
			
		||||
            console.log('Cancel');
 | 
			
		||||
          },
 | 
			
		||||
          onCancel() {
 | 
			
		||||
            if (_this.fileName) {
 | 
			
		||||
              _this.visible = false
 | 
			
		||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$message.warning("No data can be saved!")
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,7 +41,7 @@ export default {
 | 
			
		|||
        const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/gamma/viewAutomaticAnalysisLog', {  // 自动分析日志接口暂用都是gammam,beta暂时没有
 | 
			
		||||
          sampleId
 | 
			
		||||
        })
 | 
			
		||||
        this.content = res
 | 
			
		||||
        this.content = ""
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        console.error(error)
 | 
			
		||||
      } finally {
 | 
			
		||||
| 
						 | 
				
			
			@ -54,24 +54,30 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
 | 
			
		||||
    handleOk() {
 | 
			
		||||
      let _this = this
 | 
			
		||||
      let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
      // saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'}Automatic Analysis Log.txt`)
 | 
			
		||||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        onOk() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      if (this.content) {
 | 
			
		||||
        let _this = this
 | 
			
		||||
        let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
        // saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'}Automatic Analysis Log.txt`)
 | 
			
		||||
        this.$confirm({
 | 
			
		||||
          title: 'Please enter file name',
 | 
			
		||||
          content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
          okText: 'Cancle',
 | 
			
		||||
          cancelText: 'Save',
 | 
			
		||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
          onOk() {
 | 
			
		||||
            console.log('Cancel');
 | 
			
		||||
          },
 | 
			
		||||
          onCancel() {
 | 
			
		||||
            if (_this.fileName) {
 | 
			
		||||
              _this.visible = false
 | 
			
		||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$message.warning("No data can be saved!")
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -142,17 +142,19 @@ export default {
 | 
			
		|||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        okText: 'Cancle',
 | 
			
		||||
        cancelText: 'Save',
 | 
			
		||||
        okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
        cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
        onOk() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,7 @@ export default {
 | 
			
		|||
          this.content = res.result
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
          this.content = ""
 | 
			
		||||
          this.$message.error(res.message)
 | 
			
		||||
        }
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			@ -59,24 +60,30 @@ export default {
 | 
			
		|||
      }
 | 
			
		||||
    },
 | 
			
		||||
    saveText() {
 | 
			
		||||
      let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
      // saveAs(strData, `Beta-View Sample Infomation.txt`)
 | 
			
		||||
      let _this = this
 | 
			
		||||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        onOk() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      if (this.content) { 
 | 
			
		||||
        let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
        // saveAs(strData, `Beta-View Sample Infomation.txt`)
 | 
			
		||||
        let _this = this
 | 
			
		||||
        this.$confirm({
 | 
			
		||||
          title: 'Please enter file name',
 | 
			
		||||
          content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
          okText: 'Cancle',
 | 
			
		||||
          cancelText: 'Save',
 | 
			
		||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
          onOk() {
 | 
			
		||||
            console.log('Cancel');
 | 
			
		||||
          },
 | 
			
		||||
          onCancel() {
 | 
			
		||||
            if (_this.fileName) {
 | 
			
		||||
              _this.visible = false
 | 
			
		||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$message.warning("No data can be saved!")
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,7 +77,7 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
    handleOk() {
 | 
			
		||||
      let text = ""
 | 
			
		||||
      if (this.currTab==1) {
 | 
			
		||||
      if (this.currTab == 1) {
 | 
			
		||||
        text=this.content.sample.join('\n')
 | 
			
		||||
      } else if (this.currTab == 2) {
 | 
			
		||||
        text=this.content.gasBg.join('\n')
 | 
			
		||||
| 
						 | 
				
			
			@ -86,25 +86,30 @@ export default {
 | 
			
		|||
      }else if (this.currTab == 4) {
 | 
			
		||||
        text=this.content.qc.join('\n')
 | 
			
		||||
      }
 | 
			
		||||
      console.log(text);
 | 
			
		||||
      let strData = new Blob([text], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
      // saveAs(strData, `GammaViewer Log.txt`)
 | 
			
		||||
      let _this = this
 | 
			
		||||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        onOk() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            // _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      if (this.text) { 
 | 
			
		||||
        let strData = new Blob([text], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
        // saveAs(strData, `GammaViewer Log.txt`)
 | 
			
		||||
        let _this = this
 | 
			
		||||
        this.$confirm({
 | 
			
		||||
          title: 'Please enter file name',
 | 
			
		||||
          content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
          okText: 'Cancle',
 | 
			
		||||
          cancelText: 'Save',
 | 
			
		||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
          onOk() {
 | 
			
		||||
            console.log('Cancel');
 | 
			
		||||
          },
 | 
			
		||||
          onCancel() {
 | 
			
		||||
            if (_this.fileName) {
 | 
			
		||||
              _this.visible = false
 | 
			
		||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$message.warning("No data can be saved!")
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,29 +45,36 @@ export default {
 | 
			
		|||
        if (res.success) {
 | 
			
		||||
          this.text = res.result
 | 
			
		||||
        } else {
 | 
			
		||||
          this.text = ""
 | 
			
		||||
          this.$message.warning("This operation fails. Contact your system administrator")
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    handleOk() {
 | 
			
		||||
      let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
      // saveAs(strData, `GammaViewer Log.txt`)
 | 
			
		||||
      let _this = this
 | 
			
		||||
      this.$confirm({
 | 
			
		||||
        title: 'Please enter file name',
 | 
			
		||||
        content:  h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
        okText: 'Save',
 | 
			
		||||
        cancelText: 'Cancle',
 | 
			
		||||
        onOk() {
 | 
			
		||||
          if (_this.fileName) {
 | 
			
		||||
            _this.visible = false
 | 
			
		||||
            saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        onCancel() {
 | 
			
		||||
          console.log('Cancel');
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      if (this.text) {
 | 
			
		||||
        let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' });
 | 
			
		||||
        // saveAs(strData, `GammaViewer Log.txt`)
 | 
			
		||||
        let _this = this
 | 
			
		||||
        this.$confirm({
 | 
			
		||||
          title: 'Please enter file name',
 | 
			
		||||
          content: h => <a-input v-model={_this.fileName} />,
 | 
			
		||||
          okText: 'Cancle',
 | 
			
		||||
          cancelText: 'Save',
 | 
			
		||||
          okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
 | 
			
		||||
          cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
 | 
			
		||||
          onOk() {
 | 
			
		||||
            console.log('Cancel');
 | 
			
		||||
          },
 | 
			
		||||
          onCancel() {
 | 
			
		||||
            if (_this.fileName) {
 | 
			
		||||
              _this.visible = false
 | 
			
		||||
              saveAs(strData, `${_this.fileName}.txt`)
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$message.warning("No data can be saved!")
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user