自定义标准更改

uat_us
caiyiling 2024-07-18 17:16:54 +08:00
parent b637fc5856
commit c74806a367
6 changed files with 143 additions and 118 deletions

View File

@ -1052,11 +1052,11 @@ export default {
this.uploadStatus = status this.uploadStatus = status
this.uploadImageVisible = true this.uploadImageVisible = true
}, },
getWwcTpl() { async getWwcTpl() {
const loading = this.$loading({ fullscreen: true }) // const loading = this.$loading({ fullscreen: true })
getUserWLTemplateList() try {
.then((res) => { let res = await getUserWLTemplateList()
this.customWwcTpl = [] this.customWwcTpl = []
res.Result.map((i) => { res.Result.map((i) => {
this.customWwcTpl.push({ this.customWwcTpl.push({
label: i.TemplateName, label: i.TemplateName,
@ -1065,35 +1065,32 @@ export default {
}) })
}) })
this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl] this.wwwcArr = [...this.defaultWwwc, ...this.customWwcTpl]
loading.close() } catch(e) {
}) console.log(e)
.catch(() => { }
loading.close()
})
}, },
getHotKeys() { async getHotKeys() {
const loading = this.$loading({ fullscreen: true }) // const loading = this.$loading({ fullscreen: true })
getDoctorShortcutKey({ imageToolType: 0 }) try {
.then((res) => { let res = await getDoctorShortcutKey({ imageToolType: 0 })
res.Result.map((item) => { res.Result.map((item) => {
this.hotKeyList.push({ this.hotKeyList.push({
id: item.Id, id: item.Id,
altKey: item.AltKey, altKey: item.AltKey,
ctrlKey: item.CtrlKey, ctrlKey: item.CtrlKey,
shiftKey: item.ShiftKey, shiftKey: item.ShiftKey,
metaKey: item.MetaKey, metaKey: item.MetaKey,
key: item.Keyboardkey, key: item.Keyboardkey,
code: item.Code, code: item.Code,
text: item.Text, text: item.Text,
shortcutKeyEnum: item.ShortcutKeyEnum shortcutKeyEnum: item.ShortcutKeyEnum
})
}) })
this.bindHotKey()
loading.close()
})
.catch(() => {
loading.close()
}) })
this.bindHotKey()
} catch(e) {
console.log(e)
}
}, },
resetHotkeyList(arr) { resetHotkeyList(arr) {
this.hotKeyList = [] this.hotKeyList = []

View File

@ -57,10 +57,11 @@ export default {
this.getHotkeys() this.getHotkeys()
}, },
methods: { methods: {
getHotkeys(isReset = false) { async getHotkeys(isReset = false) {
this.loading = true this.loading = true
this.hotKeyList = [] this.hotKeyList = []
getDoctorShortcutKey({ imageToolType: this.readingTool }).then(res => { try{
let res = await getDoctorShortcutKey({ imageToolType: this.readingTool })
res.Result.map(item => { res.Result.map(item => {
this.hotKeyList.push({ id: item.Id, keys: { controlKey: { altKey: item.AltKey, ctrlKey: item.CtrlKey, shiftKey: item.ShiftKey, metaKey: item.MetaKey, key: item.Keyboardkey, code: item.Code }, text: item.Text }, label: item.ShortcutKeyEnum }) this.hotKeyList.push({ id: item.Id, keys: { controlKey: { altKey: item.AltKey, ctrlKey: item.CtrlKey, shiftKey: item.ShiftKey, metaKey: item.MetaKey, key: item.Keyboardkey, code: item.Code }, text: item.Text }, label: item.ShortcutKeyEnum })
}) })
@ -68,11 +69,12 @@ export default {
this.$emit('reset', this.hotKeyList) this.$emit('reset', this.hotKeyList)
} }
this.loading = false this.loading = false
}).catch(() => { }catch(e){
this.loading = false this.loading = false
}) }
}, },
handleSave() { async handleSave() {
this.loading = true this.loading = true
var params = { var params = {
imageToolType: this.readingTool, imageToolType: this.readingTool,
@ -93,28 +95,34 @@ export default {
) )
}) })
params.shortcutKeyList = shortcutKeyList params.shortcutKeyList = shortcutKeyList
setShortcutKey(params).then(res => { try {
await setShortcutKey(params)
this.$emit('reset', this.hotKeyList) this.$emit('reset', this.hotKeyList)
this.$emit('close') this.$emit('close')
this.loading = false this.loading = false
}).catch(() => { }catch(e){
this.loading = false this.loading = false
}) }
}, },
handleReset() { async handleReset() {
// '' // ''
this.$confirm(this.$t('trials:hotkeys:message:confirmReset'), { const confirm = await this.$confirm(
type: 'warning', this.$t('trials:hotkeys:message:confirmReset'),
distinguishCancelAndClose: true {
}) type: 'warning',
.then(() => { distinguishCancelAndClose: true
this.loading = true }
restoreDefaultShortcutKey({ imageToolType: this.readingTool }).then(res => { )
this.$message.success(this.$t('trials:hotkeys:message:resetSuccessfully')) // '' if (confirm !== 'confirm') return
this.getHotkeys(true) this.loading = true
}).catch(() => { this.loading = false }) try{
}) await restoreDefaultShortcutKey({ imageToolType: this.readingTool })
.catch(action => {}) this.$message.success(this.$t('trials:hotkeys:message:resetSuccessfully')) // ''
this.getHotkeys(true)
this.loading = false
}catch(e){
this.loading = false
}
}, },
handleHotkeyVerify(hotkey) { handleHotkeyVerify(hotkey) {
for (const item of this.hotKeyList) { for (const item of this.hotKeyList) {

View File

@ -51,19 +51,22 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList() { async getList() {
this.loading = true this.loading = true
var param = { var param = {
trialId: this.trialId trialId: this.trialId
} }
getManualList(param).then(res => { try{
let res = await getManualList(param)
this.fileList = res.Result this.fileList = res.Result
if (this.fileList.length > 0) { if (this.fileList.length > 0) {
this.preview(this.fileList[0]) this.preview(this.fileList[0])
} }
this.loading = false this.loading = false
}).catch(() => { this.loading = false }) }catch(e){
this.loading = false
}
}, },
preview(file) { preview(file) {
this.$set(this.selected, 'filePath', file.Path) this.$set(this.selected, 'filePath', file.Path)

View File

@ -3,7 +3,7 @@
<div class="base-dialog-body" style="height:380px;overflow-y: auto;"> <div class="base-dialog-body" style="height:380px;overflow-y: auto;">
<el-form ref="otherForm" :model="form"> <el-form ref="otherForm" :model="form">
<el-form-item <el-form-item
label="是否自动切换到下一任务" :label="$t('trials:reading:label:autoSwitch')"
prop="AutoCutNextTask" prop="AutoCutNextTask"
:rules="[ :rules="[
{ required: true, message: $t('common:ruleMessage:select')} { required: true, message: $t('common:ruleMessage:select')}
@ -35,27 +35,27 @@ export default {
this.initForm() this.initForm()
}, },
methods: { methods: {
initForm() { async initForm() {
this.loading = true this.loading = true
getAutoCutNextTask().then(async res => { try{
await getAutoCutNextTask()
this.form.AutoCutNextTask = res.Result.AutoCutNextTask this.form.AutoCutNextTask = res.Result.AutoCutNextTask
this.loading = false this.loading = false
}).catch(() => { }catch(e){
this.loading = false this.loading = false
}) }
}, },
handleSave() { async handleSave() {
this.$refs.otherForm.validate((valid) => { let valid = await this.$refs.otherForm.validate()
if (valid) { if (!valid) return
this.loading = true this.loading = true
setAutoCutNextTask(this.form).then((res) => { try{
this.loading = false await setAutoCutNextTask(this.form)
this.$message.success(this.$t('common:message:savedSuccessfully')) this.loading = false
}).catch(() => { this.$message.success(this.$t('common:message:savedSuccessfully'))
this.loading = false }catch(e){
}) this.loading = false
} }
})
} }
} }
} }

View File

@ -7,16 +7,19 @@
style="width: 100%" style="width: 100%"
class="wl-table" class="wl-table"
> >
<!-- 名称 -->
<el-table-column <el-table-column
label="名称" :label="$t('trials:reading:label:wlTplName')"
prop="TemplateName" prop="TemplateName"
/> />
<!-- 窗宽 -->
<el-table-column <el-table-column
label="窗宽" :label="$t('trials:reading:label:wlTplWW')"
prop="WW" prop="WW"
/> />
<!-- 窗位 -->
<el-table-column <el-table-column
label="窗位" :label="$t('trials:reading:label:wlTplWL')"
prop="WL" prop="WL"
/> />
<el-table-column <el-table-column
@ -24,22 +27,25 @@
width="200" width="200"
> >
<template slot="header"> <template slot="header">
<!-- 新增 -->
<el-button <el-button
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>Add</el-button> >{{ $t('common:button:new') }}</el-button>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 编辑 -->
<el-button <el-button
type="text" type="text"
size="mini" size="mini"
@click="handleEdit(scope.row)" @click="handleEdit(scope.row)"
>Edit</el-button> >{{ $t('common:button:edit') }}</el-button>
<!-- 删除 -->
<el-button <el-button
type="text" type="text"
size="mini" size="mini"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>Delete</el-button> >{{ $t('common:button:delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -77,16 +83,19 @@ export default {
this.getWL() this.getWL()
}, },
methods: { methods: {
getWL() { async getWL() {
this.loading = true this.loading = true
getUserWLTemplateList().then(res => { try {
const res = await getUserWLTemplateList()
this.tableData = res.Result this.tableData = res.Result
this.loading = false this.loading = false
this.$emit('getWwcTpl') this.$emit('getWwcTpl')
}).catch(() => { this.loading = false }) } catch (e) {
this.loading = false
}
}, },
handleAdd() { handleAdd() {
this.customWwc.title = this.$t('common:button:add') this.customWwc.title = this.$t('common:button:new')
this.row = {} this.row = {}
this.customWwc.visible = true this.customWwc.visible = true
}, },
@ -95,20 +104,27 @@ export default {
this.row = Object.assign({}, row) this.row = Object.assign({}, row)
this.customWwc.visible = true this.customWwc.visible = true
}, },
handleDelete(row) { async handleDelete(row) {
var msg = this.$t('trials:staffResearch:message:confirmDel') // ''
this.$confirm(msg, { var msg = this.$t('trials:reading:wlTemplate:delete')
type: 'warning', const confirm = await this.$confirm(
distinguishCancelAndClose: true msg,
}).then(() => { {
this.loading = true type: 'warning',
deleteUserWLTemplate(row.Id).then(res => { distinguishCancelAndClose: true
this.loading = false }
// )
this.$message.success(this.$t('common:message:deletedSuccessfully')) if (confirm !== 'confirm') return
this.getWL() this.loading = true
}).catch(() => { this.loading = false }) try {
}) await deleteUserWLTemplate(row.Id)
this.loading = false
//
this.$message.success(this.$t('common:message:deletedSuccessfully'))
this.getWL()
} catch (e) {
this.loading = false
}
} }
} }
} }

View File

@ -8,14 +8,16 @@
size="small" size="small"
> >
<!-- 名称 --> <!-- 名称 -->
<el-form-item label="名称" prop="TemplateName"> <el-form-item :label="$t('trials:reading:label:wlTplName')" prop="TemplateName">
<el-input v-model="form.TemplateName" /> <el-input v-model="form.TemplateName" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('CustomWwwcForm:form:label:ww')" prop="WW"> <!-- 窗宽 -->
<el-input-number v-model="form.WW" controls-position="right" :min="1" :precision="0" :step="1" /> <el-form-item :label="$t('trials:reading:label:wlTplWW')" prop="WW">
<el-input-number v-model="form.WW" controls-position="right" :min="1" :max="100000" :precision="0" :step="1" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('CustomWwwcForm:form:label:wl')" prop="WL"> <!-- 窗位 -->
<el-input-number v-model="form.WL" controls-position="right" :precision="0" :step="1" /> <el-form-item :label="$t('trials:reading:label:wlTplWL')" prop="WL">
<el-input-number v-model="form.WL" controls-position="right" :min="-100000" :max="100000" :precision="0" :step="1" />
</el-form-item> </el-form-item>
<el-form-item style="text-align:right;"> <el-form-item style="text-align:right;">
<!-- Cancel --> <!-- Cancel -->
@ -81,24 +83,23 @@ export default {
} }
}, },
methods: { methods: {
handleSave() { async handleSave() {
this.$refs.wlForm.validate((valid) => { const valid = await this.$refs.wlForm.validate()
if (valid) { if (!valid) return
this.loading = true this.loading = true
addOrUpdateUserWLTemplate(this.form).then((res) => { try {
this.loading = false await addOrUpdateUserWLTemplate(this.form)
this.$emit('getWL') this.loading = false
this.$emit('close') this.$emit('getWL')
if (this.form.Id) { this.$emit('close')
this.$message.success(this.$t('common:message:savedSuccessfully')) if (this.form.Id) {
} else { this.$message.success(this.$t('common:message:savedSuccessfully'))
this.$message.success(this.$t('common:message:addedSuccessfully')) } else {
} this.$message.success(this.$t('common:message:addedSuccessfully'))
}).catch(() => {
this.loading = false
})
} }
}) } catch (e) {
this.loading = false
}
}, },
handleCancel() { handleCancel() {
this.$emit('close') this.$emit('close')