公司信息改为后端配置
continuous-integration/drone/push Build is running Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-18 16:38:09 +08:00
parent 857abb2c0d
commit 2c268cbd4f
3 changed files with 179 additions and 162 deletions

View File

@ -255,6 +255,19 @@ async function VueInit() {
} catch (e) { } catch (e) {
} }
} }
Vue.prototype.$company = (isShort = true) => {
let companyName = null
if (localStorage.getItem('CompanyInfo')) {
let CompanyInfo = JSON.parse(localStorage.getItem('CompanyInfo'))
let isZh = zzSessionStorage.getItem('lang') === 'zh' || _vm.$i18n.locale == 'zh'
if (isZh) {
companyName = isShort ? CompanyInfo.CompanyShortNameCN : CompanyInfo.CompanyNameCN
} else {
companyName = isShort ? CompanyInfo.CompanyShortName : CompanyInfo.CompanyName
}
}
return companyName;
}
Vue.prototype.$updateDictionary = function () { Vue.prototype.$updateDictionary = function () {
Vue.prototype.$d = function (code) { Vue.prototype.$d = function (code) {
var dictInfo = res.Result var dictInfo = res.Result

View File

@ -97,6 +97,7 @@ const actions = {
zzSessionStorage.setItem('my_username', username.trim()) zzSessionStorage.setItem('my_username', username.trim())
zzSessionStorage.setItem('my_password', md5(password)) zzSessionStorage.setItem('my_password', md5(password))
zzSessionStorage.setItem('my_EMail', response.Result.BasicInfo.EMail) zzSessionStorage.setItem('my_EMail', response.Result.BasicInfo.EMail)
localStorage.setItem('CompanyInfo', JSON.stringify(response.Result.CompanyInfo))
const data = response.Result const data = response.Result
if (data.BasicInfo.IsFirstAdd || data.BasicInfo.LoginState === 1) { if (data.BasicInfo.IsFirstAdd || data.BasicInfo.LoginState === 1) {
try { try {

View File

@ -37,7 +37,7 @@
<p class="form_p copyBox"> <p class="form_p copyBox">
{{ form.CalledAE }} {{ form.CalledAE }}
<el-tooltip placement="right" effect="light" v-if="form.CalledAE"> <el-tooltip placement="right" effect="light" v-if="form.CalledAE">
<div slot="content">{{ $t("common:button:tip:copy") }}</div> <div slot="content">{{ $t('common:button:tip:copy') }}</div>
<i class="el-icon-document-copy" @click.stop="copyLink"></i> <i class="el-icon-document-copy" @click.stop="copyLink"></i>
</el-tooltip> </el-tooltip>
</p> </p>
@ -61,7 +61,7 @@
effect="plain" effect="plain"
v-if="form.IsTestOK !== null" v-if="form.IsTestOK !== null"
> >
{{ $fd("DicomTest", form.IsTestOK) }} {{ $fd('DicomTest', form.IsTestOK) }}
</el-tag> </el-tag>
<!-- 测试DICOM AE style="position: absolute; right: 100px; top: 0"--> <!-- 测试DICOM AE style="position: absolute; right: 100px; top: 0"-->
<el-button <el-button
@ -74,7 +74,7 @@
size="mini" size="mini"
@click.stop="testSCPServerConnect" @click.stop="testSCPServerConnect"
> >
{{ $t("common:button:DicomTest") }} {{ $t('common:button:DicomTest') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</template> </template>
@ -88,7 +88,7 @@
type="primary" type="primary"
@click="addOrUpdateDicomAE" @click="addOrUpdateDicomAE"
> >
{{ $t("common:button:save") }} {{ $t('common:button:save') }}
</el-button> </el-button>
<!-- 配置确认:disabled="!form.IsTestOK" --> <!-- 配置确认:disabled="!form.IsTestOK" -->
<el-button <el-button
@ -99,7 +99,7 @@
type="primary" type="primary"
@click="handleConfirm" @click="handleConfirm"
> >
{{ $t("trials:trialCfg:button:confirm") }} {{ $t('trials:trialCfg:button:confirm') }}
</el-button> </el-button>
<!-- 配置更新 --> <!-- 配置更新 -->
<el-button <el-button
@ -111,7 +111,7 @@
type="primary" type="primary"
@click="isEdit = true" @click="isEdit = true"
> >
{{ $t("trials:trialCfg:button:update") }} {{ $t('trials:trialCfg:button:update') }}
</el-button> </el-button>
<!-- 配置更新确认:disabled="!form.IsTestOK" --> <!-- 配置更新确认:disabled="!form.IsTestOK" -->
<el-button <el-button
@ -123,7 +123,7 @@
type="primary" type="primary"
@click="handleUpdate" @click="handleUpdate"
> >
{{ $t("trials:trialCfg:button:updateAndConfirm") }} {{ $t('trials:trialCfg:button:updateAndConfirm') }}
</el-button> </el-button>
<!-- 取消 --> <!-- 取消 -->
<el-button <el-button
@ -135,7 +135,7 @@
type="primary" type="primary"
@click.stop="confirmCancel" @click.stop="confirmCancel"
> >
{{ $t("common:button:cancel") }} {{ $t('common:button:cancel') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -148,9 +148,9 @@
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<div slot="title"> <div slot="title">
<span style="font-size: 18px">{{ $t("common:dialogTitle:sign") }}</span> <span style="font-size: 18px">{{ $t('common:dialogTitle:sign') }}</span>
<span style="font-size: 12px; margin-left: 5px">{{ <span style="font-size: 12px; margin-left: 5px">{{
`(${$t("common:label:sign")}${currentUser})` `(${$t('common:label:sign')}${currentUser})`
}}</span> }}</span>
</div> </div>
<SignForm <SignForm
@ -190,7 +190,7 @@
> >
<!-- 确认 --> <!-- 确认 -->
<el-button size="small" type="primary" @click="handleConfirmConfigData"> <el-button size="small" type="primary" @click="handleConfirmConfigData">
{{ $t("trials:trialCfg:button:confirmCfg") }} {{ $t('trials:trialCfg:button:confirmCfg') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -243,7 +243,7 @@
> >
<!-- 确认 --> <!-- 确认 -->
<el-button size="small" type="primary" @click="handleUpdateConfigData"> <el-button size="small" type="primary" @click="handleUpdateConfigData">
{{ $t("trials:trialCfg:button:confirmCfg") }} {{ $t('trials:trialCfg:button:confirmCfg') }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -256,11 +256,11 @@ import {
testSCPServerConnect, testSCPServerConnect,
ConfigTrialPACSInfoConfirm, ConfigTrialPACSInfoConfirm,
getTrialPacsConfigInfo, getTrialPacsConfigInfo,
} from "@/api/trials"; } from '@/api/trials'
import SignForm from "@/views/trials/components/newSignForm"; import SignForm from '@/views/trials/components/newSignForm'
import const_ from "@/const/sign-code"; import const_ from '@/const/sign-code'
export default { export default {
name: "dicomConfig", name: 'dicomConfig',
components: { SignForm }, components: { SignForm },
data() { data() {
return { return {
@ -279,91 +279,91 @@ export default {
IsPACSConnect: [ IsPACSConnect: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
], ],
CalledAE: [ CalledAE: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
let reg = /[a-zA-Z0-9]/; let reg = /[a-zA-Z0-9]/
if (!reg.test(value) && value !== "") { if (!reg.test(value) && value !== '') {
callback( callback(
new Error(this.$t("common:ruleMessage:CallingAEPattern")) new Error(this.$t('common:ruleMessage:CallingAEPattern'))
); )
} else { } else {
callback(); callback()
} }
}, },
message: this.$t("common:ruleMessage:CallingAEPattern"), message: this.$t('common:ruleMessage:CallingAEPattern'),
trigger: "blur", trigger: 'blur',
}, },
{ {
min: 1, min: 1,
max: 16, max: 16,
message: this.$t("common:ruleMessage:CallingAEPattern"), message: this.$t('common:ruleMessage:CallingAEPattern'),
trigger: "blur", trigger: 'blur',
}, },
], ],
Ip: [ Ip: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if ( if (
value === "" || value === '' ||
typeof value === "undefined" || typeof value === 'undefined' ||
value == null value == null
) { ) {
callback(new Error(this.$t("common:ruleMessage:ipPattern"))); callback(new Error(this.$t('common:ruleMessage:ipPattern')))
} else { } else {
const reg = const reg =
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
if (!reg.test(value) && value !== "") { if (!reg.test(value) && value !== '') {
callback(new Error(this.$t("common:ruleMessage:ipPattern"))); callback(new Error(this.$t('common:ruleMessage:ipPattern')))
} else { } else {
callback(); callback()
} }
} }
}, },
message: this.$t("common:ruleMessage:ipPattern"), message: this.$t('common:ruleMessage:ipPattern'),
trigger: "blur", trigger: 'blur',
}, },
], ],
Port: [ Port: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:specify"), message: this.$t('common:ruleMessage:specify'),
trigger: "blur", trigger: 'blur',
}, },
{ {
type: "number", type: 'number',
min: 0, min: 0,
max: 65535, max: 65535,
message: this.$t("common:ruleMessage:portPattern"), message: this.$t('common:ruleMessage:portPattern'),
trigger: "blur", trigger: 'blur',
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if ( if (
value && value &&
(String(value).includes(".") || (String(value).includes('.') ||
new RegExp(/\D/g).test(String(value))) new RegExp(/\D/g).test(String(value)))
) { ) {
callback(new Error(this.$t("common:ruleMessage:portPattern"))); callback(new Error(this.$t('common:ruleMessage:portPattern')))
} else { } else {
callback(); callback()
} }
}, },
trigger: "blur", trigger: 'blur',
}, },
], ],
}, },
@ -371,91 +371,94 @@ export default {
Id: null, Id: null,
signVisible: false, signVisible: false,
signCode: null, signCode: null,
currentUser: zzSessionStorage.getItem("userName"), currentUser: zzSessionStorage.getItem('userName'),
confirmData: [], confirmData: [],
confirmVisible: false, confirmVisible: false,
updateVisible: false, updateVisible: false,
defaultObj: {}, defaultObj: {},
}; }
}, },
methods: { methods: {
copyLink() { copyLink() {
this.$copyText( this.$copyText(
`${this.$t("trials:dicomCfg:form:CalledAE")}: ${ `${this.$t('trials:dicomCfg:form:CalledAE')}: ${
this.form.CalledAE this.form.CalledAE
}\n${this.$t("trials:dicomCfg:form:Ip")}: ${this.form.Ip}\n${this.$t( }\n${this.$t('trials:dicomCfg:form:Ip')}: ${this.form.Ip}\n${this.$t(
"trials:dicomCfg:form:Port" 'trials:dicomCfg:form:Port'
)}: ${this.form.Port}\n${this.$t( )}: ${this.form.Port}\n${this.$t(
"trials:dicomCfg:form:Description" 'trials:dicomCfg:form:Description'
)}: ${this.$t("trials:dicomCfg:Description:message")}` )}: ${this.$t('trials:dicomCfg:Description:message').replace(
'xxx',
this.$company()
)}`
) )
.then((res) => { .then((res) => {
// //
this.$message.success( this.$message.success(
this.$t("trials:researchRecord:message:copySuccessfully") this.$t('trials:researchRecord:message:copySuccessfully')
); )
}) })
.catch(() => { .catch(() => {
// //
this.$alert(this.$t("trials:researchRecord:message:copyFailed")); this.$alert(this.$t('trials:researchRecord:message:copyFailed'))
}); })
}, },
// //
async getTrialPacsConfigInfo() { async getTrialPacsConfigInfo() {
try { try {
let param = { let param = {
TrialId: this.$route.query.trialId, TrialId: this.$route.query.trialId,
}; }
let res = await getTrialPacsConfigInfo(param); let res = await getTrialPacsConfigInfo(param)
if (res.IsSuccess) { if (res.IsSuccess) {
this.defaultObj = res.Result; this.defaultObj = res.Result
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
changeConnect(val) { changeConnect(val) {
if (!val) { if (!val) {
this.form.CalledAE = null; this.form.CalledAE = null
this.form.Ip = null; this.form.Ip = null
this.form.Port = null; this.form.Port = null
this.form.Modality = null; this.form.Modality = null
this.form.IsTestOK = null; this.form.IsTestOK = null
} else { } else {
this.form.CalledAE = this.defaultObj.TrialCalledAE; this.form.CalledAE = this.defaultObj.TrialCalledAE
this.form.Ip = this.defaultObj.Ip; this.form.Ip = this.defaultObj.Ip
this.form.Port = this.defaultObj.Port; this.form.Port = this.defaultObj.Port
this.testSCPServerConnect(); this.testSCPServerConnect()
} }
}, },
initForm(res) { initForm(res) {
this.getInfo(); this.getInfo()
this.getTrialPacsConfigInfo(); this.getTrialPacsConfigInfo()
}, },
// //
confirmCancel() { confirmCancel() {
this.isEdit = false; this.isEdit = false
this.form = { ...this.initialForm }; this.form = { ...this.initialForm }
}, },
// dicomAE // dicomAE
async testSCPServerConnect() { async testSCPServerConnect() {
try { try {
let validate = await this.$refs.dicomConfigForm.validate(); let validate = await this.$refs.dicomConfigForm.validate()
if (!validate) return; if (!validate) return
let data = { let data = {
CalledAE: this.form.CalledAE, CalledAE: this.form.CalledAE,
Ip: this.form.Ip, Ip: this.form.Ip,
Port: this.form.Port, Port: this.form.Port,
}; }
this.loading = true; this.loading = true
let d = await testSCPServerConnect(data); let d = await testSCPServerConnect(data)
this.loading = false; this.loading = false
if (d.IsSuccess) { if (d.IsSuccess) {
this.form.IsTestOK = d.Result; this.form.IsTestOK = d.Result
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
this.loading = false; this.loading = false
} }
}, },
// //
@ -463,66 +466,66 @@ export default {
try { try {
let data = { let data = {
TrialId: this.$route.query.trialId, TrialId: this.$route.query.trialId,
}; }
this.loading = true; this.loading = true
let res = await getTrialDicomAE(data); let res = await getTrialDicomAE(data)
this.loading = false; this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
res.Result = res.Result || {}; res.Result = res.Result || {}
this.form.IsPACSConnect = res.OtherInfo.IsPACSConnect; this.form.IsPACSConnect = res.OtherInfo.IsPACSConnect
this.form.IsTrialPACSConfirmed = res.OtherInfo.IsTrialPACSConfirmed; this.form.IsTrialPACSConfirmed = res.OtherInfo.IsTrialPACSConfirmed
if (!res.OtherInfo.IsTrialPACSConfirmed) { if (!res.OtherInfo.IsTrialPACSConfirmed) {
this.isEdit = true; this.isEdit = true
} }
this.form.IsTestOK = res.Result.IsTestOK || null; this.form.IsTestOK = res.Result.IsTestOK || null
this.form.CalledAE = res.Result.CalledAE; this.form.CalledAE = res.Result.CalledAE
this.form.Ip = res.Result.IP; this.form.Ip = res.Result.IP
this.form.Port = res.Result.Port; this.form.Port = res.Result.Port
this.Id = res.Result.Id; this.Id = res.Result.Id
this.initialForm.IsPACSConnect = res.OtherInfo.IsPACSConnect; this.initialForm.IsPACSConnect = res.OtherInfo.IsPACSConnect
this.initialForm.IsTrialPACSConfirmed = this.initialForm.IsTrialPACSConfirmed =
res.OtherInfo.IsTrialPACSConfirmed; res.OtherInfo.IsTrialPACSConfirmed
this.initialForm.IsTestOK = res.Result.IsTestOK; this.initialForm.IsTestOK = res.Result.IsTestOK
this.initialForm.CalledAE = res.Result.CalledAE; this.initialForm.CalledAE = res.Result.CalledAE
this.initialForm.Ip = res.Result.IP; this.initialForm.Ip = res.Result.IP
this.initialForm.Port = res.Result.Port; this.initialForm.Port = res.Result.Port
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
this.loading = false; this.loading = false
} }
}, },
// //
async addOrUpdateDicomAE() { async addOrUpdateDicomAE() {
try { try {
let validate = await this.$refs.dicomConfigForm.validate(); let validate = await this.$refs.dicomConfigForm.validate()
if (!validate) return; if (!validate) return
if (this.Id) { if (this.Id) {
this.form.Id = this.Id; this.form.Id = this.Id
} }
this.form.TrialId = this.$route.query.trialId; this.form.TrialId = this.$route.query.trialId
this.loading = true; this.loading = true
let res = await addOrUpdateDicomAE(this.form); let res = await addOrUpdateDicomAE(this.form)
this.loading = false; this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
// this.$emit("refresh"); // this.$emit("refresh");
this.Id = res.Result; this.Id = res.Result
return res.Result || res.IsSuccess; return res.Result || res.IsSuccess
} }
return false; return false
} catch (err) { } catch (err) {
console.log(err); console.log(err)
this.loading = false; this.loading = false
return false; return false
} }
}, },
// //
closeSignDialog(isSign, signInfo) { closeSignDialog(isSign, signInfo) {
if (isSign) { if (isSign) {
this.signConfirm(signInfo); this.signConfirm(signInfo)
} else { } else {
this.signVisible = false; this.signVisible = false
} }
}, },
async signConfirm(signInfo) { async signConfirm(signInfo) {
@ -534,89 +537,89 @@ export default {
IsTrialPACSConfirmed: true, IsTrialPACSConfirmed: true,
}, },
signInfo, signInfo,
}; }
let res = await ConfigTrialPACSInfoConfirm(data); let res = await ConfigTrialPACSInfoConfirm(data)
if (res.IsSuccess) { if (res.IsSuccess) {
this.signVisible = false; this.signVisible = false
this.confirmVisible = false; this.confirmVisible = false
this.updateVisible = false; this.updateVisible = false
this.isEdit = false; this.isEdit = false
res = await this.addOrUpdateDicomAE(); res = await this.addOrUpdateDicomAE()
if (res) this.$emit("refresh"); if (res) this.$emit('refresh')
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
// //
handleUpdateConfigData() { handleUpdateConfigData() {
const { DicomConfigUpdates } = const_.processSignature; const { DicomConfigUpdates } = const_.processSignature
this.signCode = DicomConfigUpdates; this.signCode = DicomConfigUpdates
this.signVisible = true; this.signVisible = true
}, },
// //
handleConfirmConfigData() { handleConfirmConfigData() {
const { DicomConfigConfirmation } = const_.processSignature; const { DicomConfigConfirmation } = const_.processSignature
this.signCode = DicomConfigConfirmation; this.signCode = DicomConfigConfirmation
this.signVisible = true; this.signVisible = true
}, },
// //
handleConfirm() { handleConfirm() {
this.$refs["dicomConfigForm"].validate(async (valid) => { this.$refs['dicomConfigForm'].validate(async (valid) => {
if (!valid) return; if (!valid) return
if (!this.form.IsTestOK && this.form.IsPACSConnect) if (!this.form.IsTestOK && this.form.IsPACSConnect)
return this.$message.warning( return this.$message.warning(
this.$t("trials:dicomCfg:message:IsTestNo") this.$t('trials:dicomCfg:message:IsTestNo')
); )
this.getConfigArr(); this.getConfigArr()
this.confirmVisible = true; this.confirmVisible = true
}); })
}, },
// //
handleUpdate() { handleUpdate() {
this.$refs["dicomConfigForm"].validate(async (valid) => { this.$refs['dicomConfigForm'].validate(async (valid) => {
if (!valid) return; if (!valid) return
if (!this.form.IsTestOK && this.form.IsPACSConnect) if (!this.form.IsTestOK && this.form.IsPACSConnect)
return this.$message.warning( return this.$message.warning(
this.$t("trials:dicomCfg:message:IsTestNo") this.$t('trials:dicomCfg:message:IsTestNo')
); )
this.getConfigArr(); this.getConfigArr()
this.updateVisible = true; this.updateVisible = true
}); })
}, },
// //
getConfigArr() { getConfigArr() {
this.confirmData = [ this.confirmData = [
{ {
Name: this.$t("trials:dicomCfg:form:pacsLine"), // pacs Name: this.$t('trials:dicomCfg:form:pacsLine'), // pacs
NewVal: this.$fd("PACSConnectMode", this.form.IsPACSConnect), NewVal: this.$fd('PACSConnectMode', this.form.IsPACSConnect),
OldVal: this.$fd("PACSConnectMode", this.initialForm.IsPACSConnect), OldVal: this.$fd('PACSConnectMode', this.initialForm.IsPACSConnect),
}, },
{ {
Name: this.$t("trials:dicomCfg:form:CalledAE"), // AE Name: this.$t('trials:dicomCfg:form:CalledAE'), // AE
NewVal: this.form.CalledAE, NewVal: this.form.CalledAE,
OldVal: this.initialForm.CalledAE, OldVal: this.initialForm.CalledAE,
}, },
{ {
Name: this.$t("trials:dicomCfg:form:Ip"), // IP Name: this.$t('trials:dicomCfg:form:Ip'), // IP
NewVal: this.form.Ip, NewVal: this.form.Ip,
OldVal: this.initialForm.Ip, OldVal: this.initialForm.Ip,
}, },
{ {
Name: this.$t("trials:dicomCfg:form:Port"), Name: this.$t('trials:dicomCfg:form:Port'),
NewVal: this.form.Port, NewVal: this.form.Port,
OldVal: this.initialForm.Port, OldVal: this.initialForm.Port,
}, },
{ {
Name: this.$t("trials:dicomCfg:form:IsTestOK"), // Name: this.$t('trials:dicomCfg:form:IsTestOK'), //
NewVal: this.$fd("DicomTest", this.form.IsTestOK), NewVal: this.$fd('DicomTest', this.form.IsTestOK),
OldVal: this.$fd("DicomTest", this.initialForm.IsTestOK), OldVal: this.$fd('DicomTest', this.initialForm.IsTestOK),
}, },
]; ]
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fontColor { .fontColor {