中心添加AE标题修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
36ffd8b371
commit
57a8bb4e24
|
@ -109,7 +109,10 @@ export default {
|
|||
this.TrialSiteId = row.TrialSiteId
|
||||
this.config.title = this.$t(
|
||||
'trials:trials-panel:setting:personnel-manage:dicomAETitle'
|
||||
).replace('xxx', `${row.TrialSiteCode}、${row.TrialSiteAliasName}`)
|
||||
)
|
||||
.replace('xxx', `${row.TrialSiteCode}`)
|
||||
.replace('yyy', `${row.TrialSiteAliasName}`)
|
||||
|
||||
this.siteData = row
|
||||
this.config.visible = true
|
||||
this.getList()
|
||||
|
|
|
@ -47,26 +47,26 @@
|
|||
:disabled="loading"
|
||||
@click="config.visible = false"
|
||||
>
|
||||
{{ $t("common:button:cancel") }}
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="save">
|
||||
{{ $t("common:button:save") }}
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</base-model>
|
||||
</template>
|
||||
<script>
|
||||
import { addOrUpdateTrialSiteDicomAE } from "@/api/trials";
|
||||
import BaseModel from "@/components/BaseModel";
|
||||
import { addOrUpdateTrialSiteDicomAE } from '@/api/trials'
|
||||
import BaseModel from '@/components/BaseModel'
|
||||
export default {
|
||||
name: "dicomForm",
|
||||
name: 'dicomForm',
|
||||
components: { BaseModel },
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
visible: false,
|
||||
title: null,
|
||||
width: "600px",
|
||||
width: '600px',
|
||||
appendToBody: true,
|
||||
},
|
||||
form: {
|
||||
|
@ -80,128 +80,127 @@ export default {
|
|||
CallingAE: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /[a-zA-Z0-9]/,
|
||||
message: this.$t("common:ruleMessage:CallingAEPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:CallingAEPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
min: 1,
|
||||
max: 16,
|
||||
message: this.$t("common:ruleMessage:CallingAEPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:CallingAEPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
Ip: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (
|
||||
value === "" ||
|
||||
typeof value === "undefined" ||
|
||||
value === '' ||
|
||||
typeof value === 'undefined' ||
|
||||
value == null
|
||||
) {
|
||||
callback(new Error(this.$t("common:ruleMessage:ipPattern")));
|
||||
callback(new Error(this.$t('common:ruleMessage:ipPattern')))
|
||||
} else {
|
||||
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])$/;
|
||||
if (!reg.test(value) && value !== "") {
|
||||
callback(new Error(this.$t("common:ruleMessage:ipPattern")));
|
||||
/^(\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 !== '') {
|
||||
callback(new Error(this.$t('common:ruleMessage:ipPattern')))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
}
|
||||
},
|
||||
message: this.$t("common:ruleMessage:ipPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:ipPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
Port: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: "number",
|
||||
type: 'number',
|
||||
min: 0,
|
||||
max: 65535,
|
||||
message: this.$t("common:ruleMessage:portPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:portPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (
|
||||
value &&
|
||||
(String(value).includes(".") ||
|
||||
(String(value).includes('.') ||
|
||||
new RegExp(/\D/g).test(String(value)))
|
||||
) {
|
||||
callback(new Error(this.$t("common:ruleMessage:portPattern")));
|
||||
callback(new Error(this.$t('common:ruleMessage:portPattern')))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: "blur",
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
siteData: {},
|
||||
loading: false,
|
||||
status: "add",
|
||||
};
|
||||
status: 'add',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(siteData, data = null, status = "add") {
|
||||
this.siteData = siteData;
|
||||
this.status = status;
|
||||
open(siteData, data = null, status = 'add') {
|
||||
this.siteData = siteData
|
||||
this.status = status
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
this.form[key] = null;
|
||||
});
|
||||
if (data && status === "edit") {
|
||||
this.form[key] = null
|
||||
})
|
||||
if (data && status === 'edit') {
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
this.form[key] = data[key];
|
||||
});
|
||||
this.form.Ip = data.IP;
|
||||
this.form[key] = data[key]
|
||||
})
|
||||
this.form.Ip = data.IP
|
||||
}
|
||||
this.config.title = this.$t(
|
||||
"trials:trials-panel:setting:personnel-manage:dicomAETitle"
|
||||
).replace(
|
||||
"xxx",
|
||||
`${siteData.TrialSiteCode}、${siteData.TrialSiteAliasName}`
|
||||
);
|
||||
this.config.visible = true;
|
||||
'trials:trials-panel:setting:personnel-manage:dicomAETitle'
|
||||
)
|
||||
.replace('xxx', `${siteData.TrialSiteCode}`)
|
||||
.replace('yyy', `${siteData.TrialSiteAliasName}`)
|
||||
this.config.visible = true
|
||||
},
|
||||
// 保存
|
||||
async save() {
|
||||
try {
|
||||
let validate = await this.$refs.dicomForm.validate();
|
||||
if (!validate) return false;
|
||||
this.loading = true;
|
||||
this.form.TrialSiteId = this.siteData.TrialSiteId;
|
||||
this.form.TrialId = this.$route.query.trialId;
|
||||
let res = await addOrUpdateTrialSiteDicomAE(this.form);
|
||||
this.loading = false;
|
||||
let validate = await this.$refs.dicomForm.validate()
|
||||
if (!validate) return false
|
||||
this.loading = true
|
||||
this.form.TrialSiteId = this.siteData.TrialSiteId
|
||||
this.form.TrialId = this.$route.query.trialId
|
||||
let res = await addOrUpdateTrialSiteDicomAE(this.form)
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.status === "add"
|
||||
? this.$t("common:message:savedSuccessfully")
|
||||
: this.$t("common:message:savedFail");
|
||||
this.$emit("getList");
|
||||
this.$emit("save");
|
||||
this.config.visible = false;
|
||||
this.status === 'add'
|
||||
? this.$t('common:message:savedSuccessfully')
|
||||
: this.$t('common:message:savedFail')
|
||||
this.$emit('getList')
|
||||
this.$emit('save')
|
||||
this.config.visible = false
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
this.loading = false;
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
Loading…
Reference in New Issue