diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java index c8aba42..f44b662 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrumentInstructions.java @@ -37,6 +37,11 @@ public class WxInstrumentInstructions extends BaseEntity { @Excel(name = "说明书链接") private String link; + /** + * 拼接接口地址给用户复制使用 + */ + private String nameUrl; + /** * 状态(0正常 1停用) */ @@ -83,6 +88,14 @@ public class WxInstrumentInstructions extends BaseEntity { return status; } + public String getNameUrl() { + return nameUrl; + } + + public void setNameUrl(String nameUrl) { + this.nameUrl = nameUrl; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java index 0f7ea9e..349ec03 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentInstructionsServiceImpl.java @@ -6,6 +6,8 @@ import com.flossom.common.core.domain.entity.WxInstrumentInstructions; import com.flossom.common.core.mapper.WxInstrumentInstructionsMapper; import com.flossom.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.stereotype.Service; import com.flossom.system.service.IWxInstrumentInstructionsService; @@ -16,11 +18,15 @@ import com.flossom.system.service.IWxInstrumentInstructionsService; * @date 2024-01-16 */ @Service +@RefreshScope public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstructionsService { @Autowired private WxInstrumentInstructionsMapper wxInstrumentInstructionsMapper; + @Value("${instruction.domain}") + private String instructionDomain; + /** * 查询仪器说明书 * @@ -40,7 +46,15 @@ public class WxInstrumentInstructionsServiceImpl implements IWxInstrumentInstruc */ @Override public List selectWxInstrumentInstructionsList(WxInstrumentInstructions wxInstrumentInstructions) { - return wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions); + List instructionList = wxInstrumentInstructionsMapper.selectWxInstrumentInstructionsList(wxInstrumentInstructions); + if (instructionList != null && instructionList.size() > 0) { + for (WxInstrumentInstructions instrumentInstructions : instructionList) { + StringBuffer url = new StringBuffer(instructionDomain); + StringBuffer nameUrl = url.append("/book?type=").append(instrumentInstructions.getName()).append("&id=").append(instrumentInstructions.getInstrumentId()); + instrumentInstructions.setNameUrl(nameUrl.toString()); + } + } + return instructionList; } /** diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index a38995b..ed17aa2 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1188,26 +1188,33 @@ @@ -2279,7 +2286,7 @@ export default { for (let i = 0; i < response.data.length; i++) { this.instrumentInstructions.instructionList[i].fileList = [ { - name: response.data[i].name + '.pdf', + name: response.data[i].name, url: response.data[i].url, }, ] @@ -2346,8 +2353,13 @@ export default { } }, viewInstrumentInstruction(item) { - window.open(item.link, '_blank') + window.open(item.nameUrl, '_blank') }, + copyInstructionNameUrl(item) { + navigator.clipboard.writeText(item.nameUrl).then(() => { + this.$message.success('已成功复制到剪贴板') + }); + }, /* 模式 */ openModeIdDialog() { this.mode.modeIdsValueTemp = [] diff --git a/flossom-ui/vue.config.js b/flossom-ui/vue.config.js index c89e41a..a4b129d 100644 --- a/flossom-ui/vue.config.js +++ b/flossom-ui/vue.config.js @@ -43,8 +43,9 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://110.41.134.131:8080`, - // target: `http://192.168.10.147:8080`, + // target: `http://110.41.134.131:8080`, + // target: `http://localhost:8080`, + target: `http://192.168.10.147:8080`, changeOrigin: true, pathRewrite: { ["^" + process.env.VUE_APP_BASE_API]: "",