中核反馈bug修改
This commit is contained in:
parent
ae8a71ad78
commit
77bfb3df65
@ -14,7 +14,7 @@
|
||||
v-model:current-page="currentPage" v-model:page-size="pageSize" @current-change="pagechange" />
|
||||
<div
|
||||
style="display: flex; display: -webkit-flex; align-items: center;-webkit-align-items: center; margin-left: 10px; " :style="{ fontSize: appStore.size === 'default' ? '14px' : '16px' }">
|
||||
<div>前往</div><el-input v-model="inputgo" style="width:40px;margin-left:5px ; " @blur="sizechange($event)"
|
||||
<div>前往</div><el-input-number :controls="false" v-model="inputgo" style="width:60px;margin-left:5px ; " @blur="sizechange($event)"
|
||||
@keyup.enter="sizechange($event)" />
|
||||
<div style="margin-left:5px ; ">页</div>
|
||||
</div>
|
||||
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, PropType, defineEmits, computed ,onMounted} from 'vue'
|
||||
import { ref, PropType, computed ,onMounted} from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
const appStore = useAppStore();
|
||||
@ -104,19 +104,22 @@ function pagechange(val: any) {
|
||||
emit('pagination');
|
||||
}
|
||||
function sizechange(event: any) {
|
||||
if (event.target.value.length !== 0) {
|
||||
if (event.target.value > Math.ceil(props.total / props.size) ) {
|
||||
ElMessage({
|
||||
message: '请输入正确的页数',
|
||||
type: 'warning',
|
||||
})
|
||||
|
||||
}else{
|
||||
emit('update:current', event.target.value);
|
||||
emit('update:current',inputgo.value);
|
||||
emit('pagination');
|
||||
|
||||
}
|
||||
}
|
||||
// if (event.target.value.length !== 0) {
|
||||
// if (event.target.value > Math.ceil(props.total / props.size) ) {
|
||||
// ElMessage({
|
||||
// message: '请输入正确的页数',
|
||||
// type: 'warning',
|
||||
// })
|
||||
|
||||
// }else{
|
||||
// debugger
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
<template>
|
||||
<div class="cursor-pointer w-[40px] h-[50px] leading-[50px] text-center" style="display: flex;display: -webkit-flex; align-items: center; -webkit-align-items: center; justify-content: center;-webkit-justify-content: center;">
|
||||
<!-- <svg-icon
|
||||
:icon-class="isFullscreen ? 'exit-fullscreen' : 'fullscreen'"
|
||||
@click="toggle"
|
||||
/> -->
|
||||
<!-- {{ isFullscreen }}
|
||||
<img :src="isFullscreen ? '@/assets/MenuIcon/top_qp.png' : '@/assets/MenuIcon/top_qp1.png'" alt=""> -->
|
||||
<img v-if="isFullscreen" src="@/assets/MenuIcon/top_qp1.png" alt="" @click="toggle" style="width:16px;height: 16px;">
|
||||
<img v-else src="@/assets/MenuIcon/top_qp.png" alt="" @click="toggle" style="width:16px;height: 16px;">
|
||||
</div>
|
||||
|
||||
@ -191,9 +191,37 @@ const validator1 = (rule: any, value: any, callback: any) => { // 校验数字
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const validateCode = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 20) {
|
||||
callback(new Error('设备编码最多20个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('设备名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
|
||||
code: [
|
||||
{ required: true, message: '请输入设备编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入设备名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
|
||||
volume: [
|
||||
{
|
||||
validator: validator1,
|
||||
|
||||
@ -66,7 +66,7 @@ if(deviceTypetype.value == ''){
|
||||
onMounted(() => {
|
||||
deviceTypetype.value = props.deviceInfo.type
|
||||
if(props.changesettingsData != null && props.changesettingsData.length > 0){
|
||||
tableData.value = props.changesettingsData
|
||||
tableData.value = JSON.parse(JSON.stringify(props.changesettingsData))
|
||||
}else{
|
||||
getInit(props.materialInfo);
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ const selectedDevice:any = ref({}) // 选中患者
|
||||
|
||||
function confirmClick(formEl: any) {
|
||||
formEl.validate((valid: any) => {
|
||||
debugger
|
||||
if (valid) {
|
||||
const params = {
|
||||
...info.value,
|
||||
@ -93,10 +92,34 @@ const validator1 = (rule: any, value: any, callback: any) => { // 校验数字
|
||||
callback();
|
||||
}
|
||||
}
|
||||
const validateCode = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 20) {
|
||||
callback(new Error('设备编码最多20个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('设备名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
|
||||
code: [
|
||||
{ required: true, message: '请输入设备编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入设备名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
volume: [
|
||||
{
|
||||
validator: validator1,
|
||||
|
||||
@ -1691,13 +1691,20 @@ function dialogCopy(){
|
||||
const loading = ref(false)
|
||||
const confirmCopyClick = async ()=>{
|
||||
|
||||
if(copyDeviceInfo.value.name == ''){
|
||||
if(copyDeviceInfo.value.name == '' || copyDeviceInfo.value.name.trim() == ''){
|
||||
ElMessage({
|
||||
type: "warning",
|
||||
message: "请输入新设备名称",
|
||||
});
|
||||
return
|
||||
}
|
||||
if(copyDeviceInfo.value.name.length > 100){
|
||||
ElMessage({
|
||||
type: "warning",
|
||||
message: "设备名称最多100个字符",
|
||||
});
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
copyNodeInfo.value.store.data.attrs.label.text = copyDeviceInfo.value.name
|
||||
copyNodeInfo.value.store.data.deviceInfo.name = copyDeviceInfo.value.name
|
||||
@ -1758,18 +1765,26 @@ const confirmCopyClick = async ()=>{
|
||||
if(result == false || result == undefined){
|
||||
loading.value = false
|
||||
ElMessage({
|
||||
type: "success",
|
||||
type: "error",
|
||||
message: "复制失败",
|
||||
});
|
||||
return
|
||||
}
|
||||
if(result.code == 1){
|
||||
loading.value = false
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: result.msg,
|
||||
});
|
||||
return
|
||||
}
|
||||
if(materialInfo !=null && materialInfo.materialId != null){
|
||||
const results:any = await saveOrUpdate(materialInfo);
|
||||
if(results == false || results == undefined){
|
||||
loading.value = false
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "复制失败",
|
||||
type: "error",
|
||||
message: results.msg,
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
@ -182,9 +182,29 @@ const validator3 = (rule: any, value: any, callback: any) => {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
// 失理输入框失去焦点事件
|
||||
function handleBlur() {
|
||||
if(infoForm.value != null){
|
||||
infoForm.value.validateField(['ePu238', 'ePu239', 'ePu240', 'ePu241', 'ePu242']);
|
||||
}
|
||||
}
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('物料数据名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
//新建物料数据
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入物料数据名称", trigger: "blur" }],
|
||||
name: [
|
||||
{ required: true, message: '请输入物料数据名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
uConcentration: [
|
||||
{
|
||||
validator: validator1,
|
||||
@ -504,24 +524,24 @@ function delIconBase(){
|
||||
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-238占比" prop="ePu238">
|
||||
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
|
||||
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="materialmodel_dialog_display">
|
||||
<el-form-item label="PU-239占比" prop="ePu239">
|
||||
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')"></el-input>
|
||||
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-240占比" prop="ePu240">
|
||||
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')"></el-input>
|
||||
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="materialmodel_dialog_display">
|
||||
<el-form-item label="PU-241占比" prop="ePu241">
|
||||
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')"></el-input>
|
||||
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-242占比" prop="ePu242">
|
||||
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')"></el-input>
|
||||
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
||||
@ -18,6 +18,18 @@ import { useUserStore } from '@/store/modules/user';
|
||||
import { useSettingsStore } from '@/store/modules/settings';
|
||||
import Cookies from 'js-cookie';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useFullscreen } from '@vueuse/core';
|
||||
|
||||
const { isFullscreen, toggle } = useFullscreen();
|
||||
const tooltipRef = ref();
|
||||
const handleScreenfullClick = () => {
|
||||
// 先隐藏 tooltip
|
||||
if (tooltipRef.value) {
|
||||
tooltipRef.value.hide();
|
||||
}
|
||||
// 再切换全屏
|
||||
toggle();
|
||||
};
|
||||
|
||||
const url = import.meta.env.VITE_APP_BASE_API;
|
||||
const username = Cookies.get('username');
|
||||
@ -67,8 +79,11 @@ onBeforeUnmount(()=>{
|
||||
<div v-if="settingsStore.layout === 'left'" class="flex justify-start">
|
||||
<div class="flex justify-center items-center">
|
||||
<!-- 全屏 -->
|
||||
<el-tooltip content="全屏缩放" effect="dark" placement="bottom">
|
||||
<screenfull id="screenfull" />
|
||||
<el-tooltip ref="tooltipRef" content="全屏缩放" effect="dark" placement="bottom">
|
||||
<div class="cursor-pointer w-[40px] h-[50px] leading-[50px] text-center" style="display: flex;display: -webkit-flex; align-items: center; -webkit-align-items: center; justify-content: center;-webkit-justify-content: center;">
|
||||
<img v-if="isFullscreen" src="@/assets/MenuIcon/top_qp1.png" alt="" @click="handleScreenfullClick" style="width:16px;height: 16px;">
|
||||
<img v-else src="@/assets/MenuIcon/top_qp.png" alt="" @click="handleScreenfullClick" style="width:16px;height: 16px;">
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<!--语言选择-->
|
||||
<!-- <lang-select /> -->
|
||||
|
||||
@ -276,14 +276,13 @@ function confirmClick(formEl: any) {
|
||||
size: JSON.stringify(info.value.size),
|
||||
}
|
||||
addCriticalData(params).then((res:any) => {
|
||||
if(res === true){
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}else{
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: '新增失败',
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
@ -293,14 +292,13 @@ function confirmClick(formEl: any) {
|
||||
size: JSON.stringify(info.value.size),
|
||||
}
|
||||
updateCriticalData(params).then((res:any) => {
|
||||
if(res === true){
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}else{
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: '修改失败',
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -92,8 +92,10 @@ function menuInit() {
|
||||
|
||||
function handleMenu(row:any) {
|
||||
queryParams.value.type = row.itemCode
|
||||
input.value = ""
|
||||
sourceTempData.value = sizeSchemaInfo.value[queryParams.value.type].fields
|
||||
gettableData()
|
||||
|
||||
}
|
||||
|
||||
const infoForm = ref();
|
||||
@ -154,9 +156,16 @@ function confirmClick(formEl: any) {
|
||||
...info.value,
|
||||
size: JSON.stringify( info.value.size)
|
||||
}
|
||||
addDevices(params).then((res) => {
|
||||
addDevices(params).then((res:any) => {
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '新增成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
|
||||
});
|
||||
} else if (info.value.deviceId) {
|
||||
const params = {
|
||||
@ -164,9 +173,15 @@ function confirmClick(formEl: any) {
|
||||
...info.value,
|
||||
size: JSON.stringify( info.value.size)
|
||||
}
|
||||
updateDevices(params).then((res) => {
|
||||
updateDevices(params).then((res:any) => {
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
@ -193,10 +208,34 @@ const validator1 = (rule: any, value: any, callback: any) => { // 校验数字
|
||||
callback();
|
||||
}
|
||||
}
|
||||
const validateCode = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 20) {
|
||||
callback(new Error('设备编码最多20个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('设备名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const rulesInfo = ref({
|
||||
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
|
||||
code: [
|
||||
{ required: true, message: '请输入设备编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入设备名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
volume: [
|
||||
{
|
||||
validator: validator1,
|
||||
|
||||
@ -134,9 +134,15 @@ function confirmClick(formEl: any) {
|
||||
...info.value,
|
||||
customAttrs: JSON.stringify( customAttrsData.value)
|
||||
}
|
||||
addMaterials(params).then((res) => {
|
||||
addMaterials(params).then((res:any) => {
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
});
|
||||
} else if (info.value.materialId) {
|
||||
const params = {
|
||||
@ -144,9 +150,15 @@ function confirmClick(formEl: any) {
|
||||
...info.value,
|
||||
customAttrs: JSON.stringify( customAttrsData.value)
|
||||
}
|
||||
updateMaterials(params).then((res) => {
|
||||
updateMaterials(params).then((res:any) => {
|
||||
if(res.code == '0'){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: '修改成功',
|
||||
});
|
||||
gettableData();
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
@ -224,9 +236,27 @@ const validator3 = (rule: any, value: any, callback: any) => {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
// 失理输入框失去焦点事件
|
||||
function handleBlur() {
|
||||
if(infoForm.value != null){
|
||||
infoForm.value.validateField(['ePu238', 'ePu239', 'ePu240', 'ePu241', 'ePu242']);
|
||||
}
|
||||
}
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('物料数据名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
//新建物料数据
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入物料数据名称", trigger: "blur" }],
|
||||
name: [
|
||||
{ required: true, message: '请输入物料数据名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
uConcentration: [
|
||||
{
|
||||
validator: validator1,
|
||||
@ -560,24 +590,24 @@ function downloadFile(obj :any, name :any, suffix :any) {
|
||||
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-238占比" prop="ePu238">
|
||||
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
|
||||
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="Materials_dialog_display">
|
||||
<el-form-item label="PU-239占比" prop="ePu239">
|
||||
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')"></el-input>
|
||||
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-240占比" prop="ePu240">
|
||||
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')"></el-input>
|
||||
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="Materials_dialog_display">
|
||||
<el-form-item label="PU-241占比" prop="ePu241">
|
||||
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')"></el-input>
|
||||
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="PU-242占比" prop="ePu242">
|
||||
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')"></el-input>
|
||||
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')" @blur="handleBlur"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
|
||||
@ -145,10 +145,36 @@ function handleClose() {
|
||||
dialogPermissionVisible.value = false;
|
||||
if (infoForm.value != null) infoForm.value.resetFields();
|
||||
}
|
||||
|
||||
const validateCode = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 20) {
|
||||
callback(new Error('项目编码最多20个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('项目名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
//新建项目
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
||||
code: [{ required: true, message: "请输入项目编码", trigger: "blur" }],
|
||||
name: [
|
||||
{ required: true, message: '请输入项目名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '请输入项目编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
//修改项目
|
||||
function editClick(row: any) { // 打开修改项目弹窗
|
||||
|
||||
@ -32,10 +32,40 @@ const info: any = ref({
|
||||
code: "",
|
||||
description: "",
|
||||
});
|
||||
|
||||
|
||||
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (value.length > 100) {
|
||||
callback(new Error('事故情景名称最多100个字符'));
|
||||
}else if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateKeffThreshold = (rule: any, value: any, callback: any) => {
|
||||
if (value < 0) {
|
||||
callback(new Error('keff阈值不能小于0'));
|
||||
return;
|
||||
} else if (value > 1) {
|
||||
callback(new Error('keff阈值不能大于1'));
|
||||
return;
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const rules = ref({ //
|
||||
name: [{ required: true, message: "请输入事故情景名称", trigger: "blur" }],
|
||||
name: [
|
||||
{ required: true, message: '请输入事故情景名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
algorithmType: [{ required: true, message: "请选择算法类型", trigger: "change" }],
|
||||
keffThreshold: [{ required: true, message: "请输入keff阈值", trigger: "blur" }],
|
||||
keffThreshold: [
|
||||
{ required: true, message: '请输入keff阈值', trigger: 'blur' },
|
||||
{ validator: validateKeffThreshold, trigger: 'blur' }
|
||||
],
|
||||
});
|
||||
function handleScenarioClose(){
|
||||
emit("closeCreatescenario",false)
|
||||
|
||||
@ -122,10 +122,37 @@ function handleClose() {
|
||||
if (infoForm.value != null) infoForm.value.resetFields();
|
||||
}
|
||||
//新建事故情景
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: "请输入事故情景名称", trigger: "blur" }],
|
||||
const validateNotEmpty = (rule: any, value: any, callback: any) => {
|
||||
if (!value || value.trim() === '') {
|
||||
callback(new Error('不能为空或仅含空格'));
|
||||
}if (value.length > 100) {
|
||||
callback(new Error('事故情景名称最多100个字符'));
|
||||
}else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
const validateKeffThreshold = (rule: any, value: any, callback: any) => {
|
||||
if (value < 0) {
|
||||
callback(new Error('keff阈值不能小于0'));
|
||||
return;
|
||||
} else if (value > 1) {
|
||||
callback(new Error('keff阈值不能大于1'));
|
||||
return;
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const rules = ref({ //
|
||||
name: [
|
||||
{ required: true, message: '请输入事故情景名称', trigger: 'blur' },
|
||||
{ validator: validateNotEmpty, trigger: 'blur' }
|
||||
],
|
||||
algorithmType: [{ required: true, message: "请选择算法类型", trigger: "change" }],
|
||||
keffThreshold: [{ required: true, message: "请输入keff阈值", trigger: "blur" }],
|
||||
keffThreshold: [
|
||||
{ required: true, message: '请输入keff阈值', trigger: 'blur' },
|
||||
{ validator: validateKeffThreshold, trigger: 'blur' }
|
||||
],
|
||||
});
|
||||
//修改事故情景
|
||||
function editClick(row: any,type: string) {
|
||||
@ -259,10 +286,14 @@ function submitClick(){
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
infoForm.value.validate((valid: any) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
const data:any = {
|
||||
projectId: props.projectInfo.projectId,
|
||||
name: info.value.name,
|
||||
scenarioId: info.value.scenarioId,
|
||||
algorithmType: info.value.algorithmType,
|
||||
description: info.value.description,
|
||||
keffThreshold: info.value.keffThreshold,
|
||||
@ -282,9 +313,6 @@ function submitClick(){
|
||||
if(isTrue == true){
|
||||
data.deviceAlgoConfig = JSON.stringify(device_algo_config)
|
||||
}
|
||||
|
||||
|
||||
|
||||
updateScenarios(data).then((res:any) => {
|
||||
if (res == true) {
|
||||
ElMessage({
|
||||
@ -295,6 +323,7 @@ function submitClick(){
|
||||
gettableData();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
const algorithmModelsData = ref<any>([])
|
||||
onMounted(() => {
|
||||
@ -628,11 +657,12 @@ function handlefailDetail(row:any){
|
||||
<div style="width: 100%;padding-top: 40px;">
|
||||
<div v-for="(item,index) in deviceData" :key="item.deviceId" style="display: flex;align-items: center;margin-bottom: 10px;">
|
||||
<div style="width: 150px;text-align: right;padding-right: 10px;">{{item.deviceName}}</div>
|
||||
<el-select v-model="item.algorithmType" placeholder="请选择" style="width:300px;margin-right: 10px;" clearable
|
||||
<el-select v-model="item.algorithmType" placeholder="请选择" style="width:300px;margin-right: 10px;"
|
||||
clearable :disabled="title == '查看事故情景'"
|
||||
@change="changeSonAlgorithmType(item.algorithmType,item.deviceType,index)">
|
||||
<el-option v-for="item in algorithmTypeData" :key="item.algorithmType" :label="item.name" :value="item.algorithmType" />
|
||||
</el-select>
|
||||
<el-select v-model="item.algorithmModelId" placeholder="请选择" style="width:180px;" >
|
||||
<el-select v-model="item.algorithmModelId" placeholder="请选择" style="width:180px;" :disabled="title == '查看事故情景'" >
|
||||
<el-option v-for="items in item.algorithmModelsData" :key="items.algorithmModelId" :label="items.versionTag" :value="items.algorithmModelId" />
|
||||
</el-select>
|
||||
</div>
|
||||
@ -655,7 +685,7 @@ function handlefailDetail(row:any){
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: right;">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button @click="handleClose" v-if="title == '修改事故情景'">取消</el-button>
|
||||
<el-button type="primary" @click="submitClick" v-if="title == '修改事故情景'">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -152,7 +152,8 @@ function savePass(formEl: any){
|
||||
id: info.value.id,
|
||||
password: encrypt(pass.value.newPassword)
|
||||
}
|
||||
updatePassword(params).then((res) => {
|
||||
updatePassword(params).then((res: any) => {
|
||||
if(res.code == 0) {
|
||||
userStore.logout().then(() => {
|
||||
tagsViewStore.delAllViews();
|
||||
}).then(() => {
|
||||
@ -162,6 +163,7 @@ function savePass(formEl: any){
|
||||
type: 'success',
|
||||
message: '修改成功,请重新登录',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user