wsw检验日期修改
This commit is contained in:
parent
fe03afe569
commit
ccc7165298
@ -36,6 +36,7 @@
|
||||
"select2": "^4.1.0-rc.0",
|
||||
"socket.io-client": "^4.8.1",
|
||||
"sortablejs": "^1.14.0",
|
||||
"three": "^0.181.2",
|
||||
"vue": "3.5.23",
|
||||
"vue-cropper": "1.1.1",
|
||||
"vue-plugin-hiprint": "^0.0.60",
|
||||
|
||||
@ -179,4 +179,12 @@ export function cbebCheck(data?: Object) {
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
//修改样本检验日期
|
||||
export function changepatjyrq(data?: Object) {
|
||||
return request({
|
||||
url: '/lisworkgerm/changepatjyrq',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,511 @@
|
||||
<script setup lang="ts">
|
||||
// @ts-ignore
|
||||
import { Clock, Mesh, OrthographicCamera, PlaneGeometry, Scene, ShaderMaterial, Vector2, Vector3, WebGLRenderer } from 'three';
|
||||
import { onBeforeUnmount, onMounted, ref, useTemplateRef, watch, type CSSProperties } from 'vue';
|
||||
|
||||
const vertexShader = `
|
||||
precision highp float;
|
||||
|
||||
void main() {
|
||||
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
||||
}
|
||||
`;
|
||||
|
||||
const fragmentShader = `
|
||||
precision highp float;
|
||||
|
||||
uniform float iTime;
|
||||
uniform vec3 iResolution;
|
||||
uniform float animationSpeed;
|
||||
|
||||
uniform bool enableTop;
|
||||
uniform bool enableMiddle;
|
||||
uniform bool enableBottom;
|
||||
|
||||
uniform int topLineCount;
|
||||
uniform int middleLineCount;
|
||||
uniform int bottomLineCount;
|
||||
|
||||
uniform float topLineDistance;
|
||||
uniform float middleLineDistance;
|
||||
uniform float bottomLineDistance;
|
||||
|
||||
uniform vec3 topWavePosition;
|
||||
uniform vec3 middleWavePosition;
|
||||
uniform vec3 bottomWavePosition;
|
||||
|
||||
uniform vec2 iMouse;
|
||||
uniform bool interactive;
|
||||
uniform float bendRadius;
|
||||
uniform float bendStrength;
|
||||
uniform float bendInfluence;
|
||||
|
||||
uniform bool parallax;
|
||||
uniform float parallaxStrength;
|
||||
uniform vec2 parallaxOffset;
|
||||
|
||||
uniform vec3 lineGradient[8];
|
||||
uniform int lineGradientCount;
|
||||
|
||||
const vec3 BLACK = vec3(0.0);
|
||||
const vec3 PINK = vec3(233.0, 71.0, 245.0) / 255.0;
|
||||
const vec3 BLUE = vec3(47.0, 75.0, 162.0) / 255.0;
|
||||
|
||||
mat2 rotate(float r) {
|
||||
return mat2(cos(r), sin(r), -sin(r), cos(r));
|
||||
}
|
||||
|
||||
vec3 background_color(vec2 uv) {
|
||||
vec3 col = vec3(0.0);
|
||||
|
||||
float y = sin(uv.x - 0.2) * 0.3 - 0.1;
|
||||
float m = uv.y - y;
|
||||
|
||||
col += mix(BLUE, BLACK, smoothstep(0.0, 1.0, abs(m)));
|
||||
col += mix(PINK, BLACK, smoothstep(0.0, 1.0, abs(m - 0.8)));
|
||||
return col * 0.5;
|
||||
}
|
||||
|
||||
vec3 getLineColor(float t, vec3 baseColor) {
|
||||
if (lineGradientCount <= 0) {
|
||||
return baseColor;
|
||||
}
|
||||
|
||||
vec3 gradientColor;
|
||||
|
||||
if (lineGradientCount == 1) {
|
||||
gradientColor = lineGradient[0];
|
||||
} else {
|
||||
float clampedT = clamp(t, 0.0, 0.9999);
|
||||
float scaled = clampedT * float(lineGradientCount - 1);
|
||||
int idx = int(floor(scaled));
|
||||
float f = fract(scaled);
|
||||
int idx2 = min(idx + 1, lineGradientCount - 1);
|
||||
|
||||
vec3 c1 = lineGradient[idx];
|
||||
vec3 c2 = lineGradient[idx2];
|
||||
|
||||
gradientColor = mix(c1, c2, f);
|
||||
}
|
||||
|
||||
return gradientColor * 0.5;
|
||||
}
|
||||
|
||||
float wave(vec2 uv, float offset, vec2 screenUv, vec2 mouseUv, bool shouldBend) {
|
||||
float time = iTime * animationSpeed;
|
||||
|
||||
float x_offset = offset;
|
||||
float x_movement = time * 0.1;
|
||||
float amp = sin(offset + time * 0.2) * 0.3;
|
||||
float y = sin(uv.x + x_offset + x_movement) * amp;
|
||||
|
||||
if (shouldBend) {
|
||||
vec2 d = screenUv - mouseUv;
|
||||
float influence = exp(-dot(d, d) * bendRadius);
|
||||
float bendOffset = (mouseUv.y - screenUv.y) * influence * bendStrength * bendInfluence;
|
||||
y += bendOffset;
|
||||
}
|
||||
|
||||
float m = uv.y - y;
|
||||
return 0.0175 / max(abs(m) + 0.01, 1e-3) + 0.01;
|
||||
}
|
||||
|
||||
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
||||
vec2 baseUv = (2.0 * fragCoord - iResolution.xy) / iResolution.y;
|
||||
baseUv.y *= -1.0;
|
||||
|
||||
if (parallax) {
|
||||
baseUv += parallaxOffset;
|
||||
}
|
||||
|
||||
vec3 col = vec3(0.0);
|
||||
|
||||
vec3 b = lineGradientCount > 0 ? vec3(0.0) : background_color(baseUv);
|
||||
|
||||
vec2 mouseUv = vec2(0.0);
|
||||
if (interactive) {
|
||||
mouseUv = (2.0 * iMouse - iResolution.xy) / iResolution.y;
|
||||
mouseUv.y *= -1.0;
|
||||
}
|
||||
|
||||
if (enableBottom) {
|
||||
for (int i = 0; i < bottomLineCount; ++i) {
|
||||
float fi = float(i);
|
||||
float t = fi / max(float(bottomLineCount - 1), 1.0);
|
||||
vec3 lineCol = getLineColor(t, b);
|
||||
|
||||
float angle = bottomWavePosition.z * log(length(baseUv) + 1.0);
|
||||
vec2 ruv = baseUv * rotate(angle);
|
||||
col += lineCol * wave(
|
||||
ruv + vec2(bottomLineDistance * fi + bottomWavePosition.x, bottomWavePosition.y),
|
||||
1.5 + 0.2 * fi,
|
||||
baseUv,
|
||||
mouseUv,
|
||||
interactive
|
||||
) * 0.2;
|
||||
}
|
||||
}
|
||||
|
||||
if (enableMiddle) {
|
||||
for (int i = 0; i < middleLineCount; ++i) {
|
||||
float fi = float(i);
|
||||
float t = fi / max(float(middleLineCount - 1), 1.0);
|
||||
vec3 lineCol = getLineColor(t, b);
|
||||
|
||||
float angle = middleWavePosition.z * log(length(baseUv) + 1.0);
|
||||
vec2 ruv = baseUv * rotate(angle);
|
||||
col += lineCol * wave(
|
||||
ruv + vec2(middleLineDistance * fi + middleWavePosition.x, middleWavePosition.y),
|
||||
2.0 + 0.15 * fi,
|
||||
baseUv,
|
||||
mouseUv,
|
||||
interactive
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (enableTop) {
|
||||
for (int i = 0; i < topLineCount; ++i) {
|
||||
float fi = float(i);
|
||||
float t = fi / max(float(topLineCount - 1), 1.0);
|
||||
vec3 lineCol = getLineColor(t, b);
|
||||
|
||||
float angle = topWavePosition.z * log(length(baseUv) + 1.0);
|
||||
vec2 ruv = baseUv * rotate(angle);
|
||||
ruv.x *= -1.0;
|
||||
col += lineCol * wave(
|
||||
ruv + vec2(topLineDistance * fi + topWavePosition.x, topWavePosition.y),
|
||||
1.0 + 0.2 * fi,
|
||||
baseUv,
|
||||
mouseUv,
|
||||
interactive
|
||||
) * 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
fragColor = vec4(col, 1.0);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 color = vec4(0.0);
|
||||
mainImage(color, gl_FragCoord.xy);
|
||||
gl_FragColor = color;
|
||||
}
|
||||
`;
|
||||
|
||||
const MAX_GRADIENT_STOPS = 8;
|
||||
|
||||
type WavePosition = {
|
||||
x: number;
|
||||
y: number;
|
||||
rotate: number;
|
||||
};
|
||||
|
||||
type FloatingLinesProps = {
|
||||
linesGradient?: string[];
|
||||
enabledWaves?: Array<'top' | 'middle' | 'bottom'>;
|
||||
lineCount?: number | number[];
|
||||
lineDistance?: number | number[];
|
||||
topWavePosition?: WavePosition;
|
||||
middleWavePosition?: WavePosition;
|
||||
bottomWavePosition?: WavePosition;
|
||||
animationSpeed?: number;
|
||||
interactive?: boolean;
|
||||
bendRadius?: number;
|
||||
bendStrength?: number;
|
||||
mouseDamping?: number;
|
||||
parallax?: boolean;
|
||||
parallaxStrength?: number;
|
||||
mixBlendMode?: CSSProperties['mixBlendMode'];
|
||||
};
|
||||
|
||||
const props = withDefaults(defineProps<FloatingLinesProps>(), {
|
||||
enabledWaves: () => ['top', 'middle', 'bottom'],
|
||||
lineCount: () => [6],
|
||||
lineDistance: () => [5],
|
||||
bottomWavePosition: () => ({ x: 2.0, y: -0.7, rotate: -1 }),
|
||||
animationSpeed: 1,
|
||||
interactive: true,
|
||||
bendRadius: 5.0,
|
||||
bendStrength: -0.5,
|
||||
mouseDamping: 0.05,
|
||||
parallax: true,
|
||||
parallaxStrength: 0.2,
|
||||
mixBlendMode: 'screen'
|
||||
});
|
||||
|
||||
function hexToVec3(hex: string): Vector3 {
|
||||
let value = hex.trim();
|
||||
|
||||
if (value.startsWith('#')) {
|
||||
value = value.slice(1);
|
||||
}
|
||||
|
||||
let r = 255;
|
||||
let g = 255;
|
||||
let b = 255;
|
||||
|
||||
if (value.length === 3) {
|
||||
r = parseInt(value[0] + value[0], 16);
|
||||
g = parseInt(value[1] + value[1], 16);
|
||||
b = parseInt(value[2] + value[2], 16);
|
||||
} else if (value.length === 6) {
|
||||
r = parseInt(value.slice(0, 2), 16);
|
||||
g = parseInt(value.slice(2, 4), 16);
|
||||
b = parseInt(value.slice(4, 6), 16);
|
||||
}
|
||||
|
||||
return new Vector3(r / 255, g / 255, b / 255);
|
||||
}
|
||||
|
||||
const containerRef = useTemplateRef('containerRef');
|
||||
const targetMouseRef = ref<Vector2>(new Vector2(-1000, -1000));
|
||||
const currentMouseRef = ref<Vector2>(new Vector2(-1000, -1000));
|
||||
const targetInfluenceRef = ref<number>(0);
|
||||
const currentInfluenceRef = ref<number>(0);
|
||||
const targetParallaxRef = ref<Vector2>(new Vector2(0, 0));
|
||||
const currentParallaxRef = ref<Vector2>(new Vector2(0, 0));
|
||||
|
||||
let cleanup: (() => void) | null = null;
|
||||
const setup = () => {
|
||||
if (!containerRef.value) return;
|
||||
|
||||
const getLineCount = (waveType: 'top' | 'middle' | 'bottom'): number => {
|
||||
if (typeof props.lineCount === 'number') return props.lineCount;
|
||||
if (!props.enabledWaves.includes(waveType)) return 0;
|
||||
const index = props.enabledWaves.indexOf(waveType);
|
||||
return props.lineCount[index] ?? 6;
|
||||
};
|
||||
|
||||
const getLineDistance = (waveType: 'top' | 'middle' | 'bottom'): number => {
|
||||
if (typeof props.lineDistance === 'number') return props.lineDistance;
|
||||
if (!props.enabledWaves.includes(waveType)) return 0.1;
|
||||
const index = props.enabledWaves.indexOf(waveType);
|
||||
return props.lineDistance[index] ?? 0.1;
|
||||
};
|
||||
|
||||
const topLineCount = props.enabledWaves.includes('top') ? getLineCount('top') : 0;
|
||||
const middleLineCount = props.enabledWaves.includes('middle') ? getLineCount('middle') : 0;
|
||||
const bottomLineCount = props.enabledWaves.includes('bottom') ? getLineCount('bottom') : 0;
|
||||
|
||||
const topLineDistance = props.enabledWaves.includes('top') ? getLineDistance('top') * 0.01 : 0.01;
|
||||
const middleLineDistance = props.enabledWaves.includes('middle') ? getLineDistance('middle') * 0.01 : 0.01;
|
||||
const bottomLineDistance = props.enabledWaves.includes('bottom') ? getLineDistance('bottom') * 0.01 : 0.01;
|
||||
|
||||
const scene = new Scene();
|
||||
|
||||
const camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);
|
||||
camera.position.z = 1;
|
||||
|
||||
const renderer = new WebGLRenderer({ antialias: true, alpha: false });
|
||||
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||
renderer.domElement.style.width = '100%';
|
||||
renderer.domElement.style.height = '100%';
|
||||
containerRef.value.appendChild(renderer.domElement);
|
||||
|
||||
const uniforms = {
|
||||
iTime: { value: 0 },
|
||||
iResolution: { value: new Vector3(1, 1, 1) },
|
||||
animationSpeed: { value: props.animationSpeed },
|
||||
|
||||
enableTop: { value: props.enabledWaves.includes('top') },
|
||||
enableMiddle: { value: props.enabledWaves.includes('middle') },
|
||||
enableBottom: { value: props.enabledWaves.includes('bottom') },
|
||||
|
||||
topLineCount: { value: topLineCount },
|
||||
middleLineCount: { value: middleLineCount },
|
||||
bottomLineCount: { value: bottomLineCount },
|
||||
|
||||
topLineDistance: { value: topLineDistance },
|
||||
middleLineDistance: { value: middleLineDistance },
|
||||
bottomLineDistance: { value: bottomLineDistance },
|
||||
|
||||
topWavePosition: {
|
||||
value: new Vector3(
|
||||
props.topWavePosition?.x ?? 10.0,
|
||||
props.topWavePosition?.y ?? 0.5,
|
||||
props.topWavePosition?.rotate ?? -0.4
|
||||
)
|
||||
},
|
||||
middleWavePosition: {
|
||||
value: new Vector3(
|
||||
props.middleWavePosition?.x ?? 5.0,
|
||||
props.middleWavePosition?.y ?? 0.0,
|
||||
props.middleWavePosition?.rotate ?? 0.2
|
||||
)
|
||||
},
|
||||
bottomWavePosition: {
|
||||
value: new Vector3(
|
||||
props.bottomWavePosition?.x ?? 2.0,
|
||||
props.bottomWavePosition?.y ?? -0.7,
|
||||
props.bottomWavePosition?.rotate ?? 0.4
|
||||
)
|
||||
},
|
||||
|
||||
iMouse: { value: new Vector2(-1000, -1000) },
|
||||
interactive: { value: props.interactive },
|
||||
bendRadius: { value: props.bendRadius },
|
||||
bendStrength: { value: props.bendStrength },
|
||||
bendInfluence: { value: 0 },
|
||||
|
||||
parallax: { value: props.parallax },
|
||||
parallaxStrength: { value: props.parallaxStrength },
|
||||
parallaxOffset: { value: new Vector2(0, 0) },
|
||||
|
||||
lineGradient: {
|
||||
value: Array.from({ length: MAX_GRADIENT_STOPS }, () => new Vector3(1, 1, 1))
|
||||
},
|
||||
lineGradientCount: { value: 0 }
|
||||
};
|
||||
|
||||
if (props.linesGradient && props.linesGradient.length > 0) {
|
||||
const stops = props.linesGradient.slice(0, MAX_GRADIENT_STOPS);
|
||||
uniforms.lineGradientCount.value = stops.length;
|
||||
|
||||
stops.forEach((hex, i) => {
|
||||
const color = hexToVec3(hex);
|
||||
uniforms.lineGradient.value[i].set(color.x, color.y, color.z);
|
||||
});
|
||||
}
|
||||
|
||||
const material = new ShaderMaterial({
|
||||
uniforms,
|
||||
vertexShader,
|
||||
fragmentShader
|
||||
});
|
||||
|
||||
const geometry = new PlaneGeometry(2, 2);
|
||||
const mesh = new Mesh(geometry, material);
|
||||
scene.add(mesh);
|
||||
|
||||
const clock = new Clock();
|
||||
|
||||
const setSize = () => {
|
||||
const el = containerRef.value!;
|
||||
const width = el.clientWidth || 1;
|
||||
const height = el.clientHeight || 1;
|
||||
|
||||
renderer.setSize(width, height, false);
|
||||
|
||||
const canvasWidth = renderer.domElement.width;
|
||||
const canvasHeight = renderer.domElement.height;
|
||||
uniforms.iResolution.value.set(canvasWidth, canvasHeight, 1);
|
||||
};
|
||||
|
||||
setSize();
|
||||
|
||||
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(setSize) : null;
|
||||
|
||||
if (ro && containerRef.value) {
|
||||
ro.observe(containerRef.value);
|
||||
}
|
||||
|
||||
const handlePointerMove = (event: PointerEvent) => {
|
||||
const rect = renderer.domElement.getBoundingClientRect();
|
||||
const x = event.clientX - rect.left;
|
||||
const y = event.clientY - rect.top;
|
||||
const dpr = renderer.getPixelRatio();
|
||||
|
||||
targetMouseRef.value.set(x * dpr, (rect.height - y) * dpr);
|
||||
targetInfluenceRef.value = 1.0;
|
||||
|
||||
if (props.parallax) {
|
||||
const centerX = rect.width / 2;
|
||||
const centerY = rect.height / 2;
|
||||
const offsetX = (x - centerX) / rect.width;
|
||||
const offsetY = -(y - centerY) / rect.height;
|
||||
targetParallaxRef.value.set(offsetX * props.parallaxStrength, offsetY * props.parallaxStrength);
|
||||
}
|
||||
};
|
||||
|
||||
const handlePointerLeave = () => {
|
||||
targetInfluenceRef.value = 0.0;
|
||||
};
|
||||
|
||||
if (props.interactive) {
|
||||
renderer.domElement.addEventListener('pointermove', handlePointerMove);
|
||||
renderer.domElement.addEventListener('pointerleave', handlePointerLeave);
|
||||
}
|
||||
|
||||
let raf = 0;
|
||||
const renderLoop = () => {
|
||||
uniforms.iTime.value = clock.getElapsedTime();
|
||||
|
||||
if (props.interactive) {
|
||||
currentMouseRef.value.lerp(targetMouseRef.value, props.mouseDamping);
|
||||
uniforms.iMouse.value.copy(currentMouseRef.value);
|
||||
|
||||
currentInfluenceRef.value += (targetInfluenceRef.value - currentInfluenceRef.value) * props.mouseDamping;
|
||||
uniforms.bendInfluence.value = currentInfluenceRef.value;
|
||||
}
|
||||
|
||||
if (props.parallax) {
|
||||
currentParallaxRef.value.lerp(targetParallaxRef.value, props.mouseDamping);
|
||||
uniforms.parallaxOffset.value.copy(currentParallaxRef.value);
|
||||
}
|
||||
|
||||
renderer.render(scene, camera);
|
||||
raf = requestAnimationFrame(renderLoop);
|
||||
};
|
||||
renderLoop();
|
||||
|
||||
cleanup = () => {
|
||||
cancelAnimationFrame(raf);
|
||||
if (ro && containerRef.value) {
|
||||
ro.disconnect();
|
||||
}
|
||||
|
||||
if (props.interactive) {
|
||||
renderer.domElement.removeEventListener('pointermove', handlePointerMove);
|
||||
renderer.domElement.removeEventListener('pointerleave', handlePointerLeave);
|
||||
}
|
||||
|
||||
geometry.dispose();
|
||||
material.dispose();
|
||||
renderer.dispose();
|
||||
if (renderer.domElement.parentElement) {
|
||||
renderer.domElement.parentElement.removeChild(renderer.domElement);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
setup();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
cleanup?.();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => [
|
||||
props.linesGradient,
|
||||
props.enabledWaves,
|
||||
props.lineCount,
|
||||
props.lineDistance,
|
||||
props.topWavePosition,
|
||||
props.middleWavePosition,
|
||||
props.bottomWavePosition,
|
||||
props.animationSpeed,
|
||||
props.interactive,
|
||||
props.bendRadius,
|
||||
props.bendStrength,
|
||||
props.mouseDamping,
|
||||
props.parallax,
|
||||
props.parallaxStrength
|
||||
],
|
||||
() => {
|
||||
cleanup?.();
|
||||
setup();
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="containerRef" class="relative w-full h-full overflow-hidden floating-lines-container" :style="{
|
||||
mixBlendMode: mixBlendMode
|
||||
}" />
|
||||
</template>
|
||||
@ -217,9 +217,9 @@ const handleRowClick = (row: any) => {
|
||||
const myEcharts = ref()
|
||||
const getEcharts = (data: any) => {
|
||||
const periods = ['nine', 'eight', 'seven', 'six', 'five', 'four', 'three', 'two', 'one', 'first']
|
||||
|
||||
const xData = periods.map(period => { return data[`${period}Date`] }).filter(Boolean) //过滤掉空值
|
||||
const yData = periods.map(period => { return data[`${period}Csjg`] }).filter(Boolean)
|
||||
if (!data) return
|
||||
const xData = periods.map(period => { return data[`${period}Date`] })?.filter(Boolean) //过滤掉空值
|
||||
const yData = periods.map(period => { return data[`${period}Csjg`] })?.filter(Boolean)
|
||||
const Intance = echarts.init(myEcharts.value);
|
||||
|
||||
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="日期:" prop="jyrq">
|
||||
<el-date-picker v-model="ybJyrq" type="date" label-width="1.25rem" placeholder="检验日期"
|
||||
value-format="YYYY-MM-DD" :clearable="false" @change="jyrqChange"
|
||||
style="width:100%"></el-date-picker>
|
||||
value-format="YYYY-MM-DD" :clearable="false" @change="jyrqChange" ref="datePickerRef"
|
||||
style="width:100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@ -65,12 +65,12 @@
|
||||
<el-col :span="16">
|
||||
<el-tabs v-model="activeName" type="card" class="demo-tabs">
|
||||
<el-tab-pane label="鉴定(终报)结果" name="first">
|
||||
<ZbReport ref="labResultRef" v-model:labPat="labInfo" :labPatKey="queryParams"
|
||||
<ZbReport ref="labResultRef" v-model:labPat="labPat" :labPatKey="queryParams"
|
||||
@update:labPatKey="queryParams = $event" :dictData="dictData" :labResutsData="zbLabResuts"
|
||||
@fetchLabResults="resultsHandle" @changeStatus="changeStatus" @previewHandle="previewHandle" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="初级和二级报告" name="second">
|
||||
<CbReport v-model:labPat="labInfo" :labPatKey="queryParams" @update:labPatKey="queryParams = $event"
|
||||
<CbReport v-model:labPat="labPat" :labPatKey="queryParams" @update:labPatKey="queryParams = $event"
|
||||
:instrdComOpt="instrdComOpt" :dictData="dictData" @changeStatus="changeStatus" :userList="userList"
|
||||
@previewHandle="previewHandle" />
|
||||
</el-tab-pane>
|
||||
@ -78,7 +78,7 @@
|
||||
<Pyj :labPat="labPat" :labPatKey="queryParams" :userList="userList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作记录" name="fourth">
|
||||
<Record :labPat="labInfo" :labPatKey="queryParams" />
|
||||
<Record :labPat="labPat" :labPatKey="queryParams" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
@ -134,8 +134,8 @@
|
||||
</template>
|
||||
|
||||
|
||||
<component :is="activeTabName" :queryParams="queryParams" :dictData="dictData" :instrOptions="instrOptions"
|
||||
@fetchResults="fetchLabResults" :tablekey="queryParams" />
|
||||
<component :is="activeTabName" :queryParams="{ ...queryParams, jyrq: ybJyrq }" :dictData="dictData"
|
||||
:instrOptions="instrOptions" @fetchResults="fetchLabResults" :tablekey="labPat" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -179,7 +179,7 @@ import Record from './labresult/record.vue';
|
||||
// @ts-ignore
|
||||
import { comDict } from '@/utils/dict'
|
||||
import { queryLabResults, loadDefault, queryLabPat, instrdconfig, delSample, getGroupInstrdList, checkuser, updateLabPat } from "@/api/liswork/work/LisWork";
|
||||
import { wswsamplelistpage, sampleMedInfo } from "@/api/liswork/micro/index";
|
||||
import { wswsamplelistpage, sampleMedInfo, changepatjyrq } from "@/api/liswork/micro/index";
|
||||
import { getComDicts, queryComDictListService } from "@/api/liswork/dict/ComDict";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import BatchCode from '../work/components/batchCode.vue';
|
||||
@ -192,6 +192,7 @@ import { listUser } from '@/api/system/user.js'
|
||||
import dayjs from 'dayjs'
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
import { initWebSocket, sendWebSocketMessage, closeWebSocket, getWebSocketState } from '@/utils/webSocket';
|
||||
import Labpat from './labpat.vue';
|
||||
|
||||
const previewShow = ref(false);
|
||||
const lbFlag = ref(false);
|
||||
@ -271,7 +272,9 @@ watch(() => labPat.value, (newValue) => {
|
||||
}, { deep: true });
|
||||
|
||||
const checkUserRef = ref()
|
||||
const datePickerRef = ref()
|
||||
const jyrqChange = (val: string) => {
|
||||
datePickerRef.value?.blur();
|
||||
ElMessageBox.confirm(
|
||||
`确定修改当前样本检验日期?`,
|
||||
'提示',
|
||||
@ -288,6 +291,7 @@ const jyrqChange = (val: string) => {
|
||||
}
|
||||
}).catch(() => {
|
||||
fetchLabPat();
|
||||
datePickerRef.value?.blur();
|
||||
})
|
||||
|
||||
};
|
||||
@ -299,6 +303,7 @@ const handleCheckUserConfirm = (info: { yhdh: string, mm: string }) => {
|
||||
updateJyrq()
|
||||
} else {
|
||||
fetchLabPat();
|
||||
datePickerRef.value?.blur();
|
||||
}
|
||||
})
|
||||
};
|
||||
@ -309,7 +314,19 @@ const checkUserCancel = () => {
|
||||
|
||||
// 更新检验日期
|
||||
const updateJyrq = () => {
|
||||
// updateLabPat({ ...queryParams.value, ...labPat.value })
|
||||
changepatjyrq({ ...queryParams.value, jyrq: ybJyrq.value }).then((response: any) => {
|
||||
if (response.code == 0) {
|
||||
ElMessage.success('检验日期修改成功');
|
||||
changeStatus(
|
||||
{
|
||||
jyrq: ybJyrq.value,
|
||||
ybh: labPat.value.ybh,
|
||||
yq: labPat.value.yq
|
||||
}, false
|
||||
)
|
||||
datePickerRef.value?.blur();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 模糊查询
|
||||
@ -475,22 +492,22 @@ const lastRow: any = ref({})
|
||||
// 批量扫码ybh同步样本编号
|
||||
const ybhChangeTb = (val: string) => {
|
||||
// console.log('val==>', val);
|
||||
labInfo.value.ybh = val
|
||||
labPat.value.ybh = val
|
||||
queryParams.value.ybh = val
|
||||
handleQuery();
|
||||
}
|
||||
const handleQuery = () => {
|
||||
if (!labPatList.value.length) return
|
||||
if (!labInfo.value.ybh) {
|
||||
if (!labPat.value.ybh) {
|
||||
highlightRowIndex.value = -1;
|
||||
ElMessage.warning('请输入样本编号')
|
||||
labInfo.value.ybh = lastRow.value.ybh
|
||||
labPat.value.ybh = lastRow.value.ybh
|
||||
queryParams.value.ybh = lastRow.value.ybh
|
||||
return;
|
||||
}
|
||||
// queryParams.value = { ...queryParams.value };
|
||||
// 查找匹配的行
|
||||
const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == labInfo.value.ybh);
|
||||
const matchedIndex = labPatList.value.findIndex((item: any) => item.ybh == labPat.value.ybh);
|
||||
const row = labPatList.value[matchedIndex]
|
||||
|
||||
if (matchedIndex !== -1) {
|
||||
@ -524,15 +541,15 @@ const handleCreate = () => {
|
||||
|
||||
// 删除样本
|
||||
const delSampleHd = () => {
|
||||
if (labInfo.value.jgbz == '2') return ElMessage.warning('标本已审核,不能删除!')
|
||||
if (labPat.value.jgbz == '2') return ElMessage.warning('标本已审核,不能删除!')
|
||||
const data = {
|
||||
jyrq: labInfo.value.jyrq,
|
||||
yq: labInfo.value.yq.trim(),
|
||||
ybh: labInfo.value.ybh,
|
||||
jyrq: labPat.value.jyrq,
|
||||
yq: labPat.value.yq.trim(),
|
||||
ybh: labPat.value.ybh,
|
||||
}
|
||||
|
||||
ElMessageBox.confirm(
|
||||
`确定删除当前${labInfo.value.ybh}号标本?`,
|
||||
`确定删除当前${labPat.value.ybh}号标本?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
@ -544,7 +561,7 @@ const delSampleHd = () => {
|
||||
delSample(data).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('删除成功')
|
||||
labPatList.value = labPatList.value.filter((item: any) => item.ybh != labInfo.value.ybh)
|
||||
labPatList.value = labPatList.value.filter((item: any) => item.ybh != labPat.value.ybh)
|
||||
// 删除跳当前页面下一个样本
|
||||
// handleNext()
|
||||
if (highlightRowIndex.value > labPatList.value.length - 1) {
|
||||
@ -564,8 +581,7 @@ const delSampleHd = () => {
|
||||
// 上一个样本
|
||||
const handlePrev = () => {
|
||||
if (!lbFlag.value) {
|
||||
const ybh = getPreviousNumber(labInfo.value.ybh) as string;
|
||||
labInfo.value.ybh = ybh;
|
||||
const ybh = getPreviousNumber(labPat.value.ybh) as string;
|
||||
queryParams.value.ybh = ybh;
|
||||
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||
if (index !== -1) {
|
||||
@ -594,8 +610,7 @@ const handlePrev = () => {
|
||||
// 下一个样本
|
||||
const handleNext = () => {
|
||||
if (!lbFlag.value) {
|
||||
const ybh = getNextNumber(labInfo.value.ybh) as string;
|
||||
labInfo.value.ybh = ybh;
|
||||
const ybh = getNextNumber(labPat.value.ybh) as string;
|
||||
queryParams.value.ybh = ybh;
|
||||
const index = labPatList.value.findIndex((item: any) => item.ybh == ybh)
|
||||
if (index !== -1) {
|
||||
@ -617,15 +632,13 @@ const handleNext = () => {
|
||||
}
|
||||
selectJob(row);
|
||||
} else {
|
||||
labInfo.value.ybh = getNextNumber(labInfo.value.ybh) as string;
|
||||
queryParams.value.ybh = labInfo.value.ybh;
|
||||
queryParams.value.ybh = labPat.value.ybh;
|
||||
handleCreate();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 最后一个样本
|
||||
const handleLast = () => {
|
||||
labInfo.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
||||
queryParams.value.ybh = labPatList.value[labPatList.value.length - 1].ybh;
|
||||
handleNext();
|
||||
}
|
||||
|
||||
@ -102,7 +102,6 @@ const handleCsjgEnter = (row: any) => {
|
||||
const handleInputFocus = (row: any) => {
|
||||
updateItem.value = row;
|
||||
pyjRef.value.openDictSelector();
|
||||
console.log('row', row);
|
||||
}
|
||||
const selectItem = (item: any) => {
|
||||
if (updateItem.value) {
|
||||
@ -117,7 +116,6 @@ const selectItem = (item: any) => {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('labPat==>', labPat.value);
|
||||
const data = {
|
||||
mediumno: item.value,
|
||||
mediumname: item.label,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="checkShow" :title="title" width="500" :close-on-click-modal="false" :draggable="true"
|
||||
@close="handleCancel">
|
||||
@close="close">
|
||||
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto">
|
||||
<el-form-item label="用户工号:" prop="yhdh">
|
||||
<el-input ref="yhdhRef" v-model.trim="ruleForm.yhdh" placeholder="请输入用户工号" maxlength="20"
|
||||
@ -70,6 +70,7 @@ const rules = ref(
|
||||
const yhdhRef = ref();
|
||||
const open = () => {
|
||||
checkShow.value = true;
|
||||
flag.value = true;
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
yhdhRef.value.focus();
|
||||
@ -78,11 +79,13 @@ const open = () => {
|
||||
};
|
||||
const checkShow = ref(false);
|
||||
const ruleFormRef = ref();
|
||||
const flag = ref(true);
|
||||
// 处理确认验证
|
||||
const handleConfirm = () => {
|
||||
ruleFormRef.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
emit('onConfirm', { yhdh: ruleForm.value.yhdh, mm: ruleForm.value.mm });
|
||||
flag.value = false;
|
||||
checkShow.value = false;
|
||||
} else {
|
||||
return false;
|
||||
@ -99,6 +102,15 @@ const handleCancel = () => {
|
||||
emit('onCancel');
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
ruleForm.value.yhdh = '';
|
||||
ruleForm.value.mm = '';
|
||||
ruleFormRef.value.resetFields();
|
||||
if (flag.value) {
|
||||
emit('onCancel');
|
||||
}
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
|
||||
177
src/views/liswork/work/components/builtDialog.vue
Normal file
177
src/views/liswork/work/components/builtDialog.vue
Normal file
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="builtShow" title="检验结果对照" width="40vw" :close-on-click-modal="false" :draggable="true">
|
||||
<div class="tips mb10">字典中不存在项目</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="16">
|
||||
<el-table :data="builtTableData" height="50vh" border show-overflow-tooltip>
|
||||
<el-table-column label="接口/通道号" prop="xmdh" />
|
||||
<el-table-column label="结果" prop="csjg" />
|
||||
<el-table-column label="对应检验项目" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.xmdh0" placeholder="" filterable @change="" size="small"
|
||||
class="full-width-input">
|
||||
<el-option v-for="item in builtOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="tips">
|
||||
提示:<br />
|
||||
如果结果就是某个检验项目的结果,请在“对应检验项目”列表中直接选择进行对照。<br />
|
||||
如果不是,<br />
|
||||
请选择菜单“字典”一>“检验项目”进入检验维护作业后点击按钮<br />
|
||||
自动加载”加入项目。<br />
|
||||
</div>
|
||||
<div class="btns_box">
|
||||
<div class="btn" @click="cpHandle">存盘</div>
|
||||
<div class="btn" @click="builtShow = false">退出</div>
|
||||
<div class="btn" @lcick="clearProHandle">清除未做</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { noiteMresult, queryXmInfo, setitemInter } from '@/api/liswork/work/LisWork';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
tableKey: {
|
||||
type: Object as PropType<any>,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
const { tableKey } = toRefs(props);
|
||||
|
||||
|
||||
const builtShow = ref(false);
|
||||
const builtTableData = ref<Array<any>>([]);
|
||||
const builtOptions = ref<Array<any>>([]);
|
||||
|
||||
const emits = defineEmits(['clearPro']);
|
||||
const open = () => {
|
||||
queryXmInfo({ yq: tableKey.value.yq }).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
builtOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.xmdh,
|
||||
label: item.xmdh + ' - ' + item.xmmc
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
noiteMresult(tableKey.value).then((res: any) => {
|
||||
builtTableData.value = res.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
xmdh0: ''
|
||||
}
|
||||
})
|
||||
})
|
||||
builtShow.value = true;
|
||||
}
|
||||
const cpHandle = () => {
|
||||
const validItems = builtTableData.value.filter(item => item.xmdh0);
|
||||
|
||||
if (validItems.length === 0) {
|
||||
console.log("没有需要处理的项");
|
||||
return;
|
||||
}
|
||||
|
||||
let successCount = 0;
|
||||
let failCount = 0;
|
||||
|
||||
|
||||
const requests = validItems.map((item, index) => {
|
||||
return setitemInter({ ...tableKey.value, xmdh0: item.xmdh0, xmdh: item.xmdh })
|
||||
.then((response: any) => ({
|
||||
index,
|
||||
success: true,
|
||||
data: response
|
||||
}))
|
||||
.catch((error: any) => ({
|
||||
index,
|
||||
success: false,
|
||||
error: error
|
||||
}));
|
||||
});
|
||||
|
||||
Promise.all(requests).then(results => {
|
||||
results.forEach((result: any) => {
|
||||
if (result.success) {
|
||||
successCount++;
|
||||
// console.log(`第 ${result.index + 1} 项成功:`, result.data);
|
||||
} else {
|
||||
failCount++;
|
||||
// console.error(`第 ${result.index + 1} 项失败:`, result.error);
|
||||
}
|
||||
});
|
||||
// 输出统计结果
|
||||
ElMessageBox.alert(
|
||||
`项目与通道号对照已经完成,成功${successCount}个;失败${failCount}个。<br />你可以重新从仪器端传送一遍数据,就可以看到正确的结果了。`,
|
||||
'信息',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
}
|
||||
)
|
||||
})
|
||||
};
|
||||
|
||||
const clearProHandle = () => {
|
||||
emits('clearPro')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.tips {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
}
|
||||
|
||||
|
||||
.btns_box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin-top: 1.875rem;
|
||||
|
||||
.btn {
|
||||
width: 80%;
|
||||
height: 2.5rem;
|
||||
line-height: 2.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
border-radius: 0.5rem;
|
||||
background-color: var(--el-color-primary);
|
||||
color: var(--el-color-white);
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--el-color-primary-light-2);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background-color: var(--el-color-primary-light-5);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -159,39 +159,7 @@
|
||||
<ViewBackup ref="backRef" :backLabInfo="backLabInfo" :backTableData="backTableData" :userList="userList"
|
||||
:dictData="dictData" />
|
||||
<!-- 未建项目结果 -->
|
||||
<el-dialog v-model="builtShow" title="检验结果对照" width="40vw" :close-on-click-modal="false" :draggable="true">
|
||||
<div class="tips mb10">字典中不存在项目</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="16">
|
||||
<el-table :data="builtTableData" height="50vh" border show-overflow-tooltip>
|
||||
<el-table-column label="接口/通道号" prop="xmdh" />
|
||||
<el-table-column label="结果" prop="csjg" />
|
||||
<el-table-column label="对应检验项目" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.xmdh0" placeholder="" filterable @change="" size="small"
|
||||
class="full-width-input">
|
||||
<el-option v-for="item in builtOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="tips">
|
||||
提示:<br />
|
||||
如果结果就是某个检验项目的结果,请在“对应检验项目”列表中直接选择进行对照。<br />
|
||||
如果不是,<br />
|
||||
请选择菜单“字典”一>“检验项目”进入检验维护作业后点击按钮<br />
|
||||
自动加载”加入项目。<br />
|
||||
</div>
|
||||
<div class="btns_box">
|
||||
<div class="btn" @click="cpHandle">存盘</div>
|
||||
<div class="btn" @click="builtShow = false">退出</div>
|
||||
<div class="btn" @lcick="clearProHandle">清除未做</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<BuiltDialog ref="builtRef" :tableKey="tableKey" @clearPro="clearProHandle" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -206,6 +174,7 @@ import {
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import ProjectDetails from "@/components/projectDetails/index.vue";
|
||||
import projectsJg from "@/components/projectsjg/index.vue"
|
||||
import BuiltDialog from "./builtDialog.vue";
|
||||
import { classCom } from '@/utils/classCom'
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import dayjs from 'dayjs';
|
||||
@ -366,82 +335,12 @@ const handleMenuSelect = (item) => {
|
||||
break;
|
||||
}
|
||||
};
|
||||
const builtShow = ref(false)
|
||||
const builtTableData = ref([])
|
||||
const builtOptions = ref([])
|
||||
const builtRef = ref()
|
||||
|
||||
const unbuiltHandle = () => {
|
||||
queryXmInfo({ yq: tableKey.value.yq }).then(res => {
|
||||
if (res.code == 0) {
|
||||
builtOptions.value = res.data.map(item => {
|
||||
return {
|
||||
value: item.xmdh,
|
||||
label: item.xmdh + ' - ' + item.xmmc
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
noiteMresult(tableKey.value).then(res => {
|
||||
builtTableData.value = res.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
xmdh0: ''
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
builtShow.value = true
|
||||
builtRef.value.open()
|
||||
};
|
||||
|
||||
const cpHandle = () => {
|
||||
const validItems = builtTableData.value.filter(item => item.xmdh0);
|
||||
|
||||
if (validItems.length === 0) {
|
||||
console.log("没有需要处理的项");
|
||||
return;
|
||||
}
|
||||
|
||||
let successCount = 0;
|
||||
let failCount = 0;
|
||||
|
||||
|
||||
const requests = validItems.map((item, index) => {
|
||||
return setitemInter({ ...tableKey.value, xmdh0: item.xmdh0, xmdh: item.xmdh })
|
||||
.then(response => ({
|
||||
index,
|
||||
success: true,
|
||||
data: response
|
||||
}))
|
||||
.catch(error => ({
|
||||
index,
|
||||
success: false,
|
||||
error: error
|
||||
}));
|
||||
});
|
||||
|
||||
Promise.all(requests).then(results => {
|
||||
results.forEach(result => {
|
||||
if (result.success) {
|
||||
successCount++;
|
||||
// console.log(`第 ${result.index + 1} 项成功:`, result.data);
|
||||
} else {
|
||||
failCount++;
|
||||
// console.error(`第 ${result.index + 1} 项失败:`, result.error);
|
||||
}
|
||||
});
|
||||
// 输出统计结果
|
||||
ElMessageBox.alert(
|
||||
`项目与通道号对照已经完成,成功${successCount}个;失败${failCount}个。<br />你可以重新从仪器端传送一遍数据,就可以看到正确的结果了。`,
|
||||
'信息',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
}
|
||||
)
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
|
||||
const clearPrintHandle = () => {
|
||||
clearPrintflag(tableKey.value).then(res => {
|
||||
if (res.code == 0) {
|
||||
@ -791,7 +690,7 @@ const shHandleCheck = () => {
|
||||
const unconfirmlogRef = ref();
|
||||
const unShHandle = () => {
|
||||
uncheck2({ ...tableKey.value, yhdh: props.labPat.yhdh }).then(res => {
|
||||
console.log('res',res);
|
||||
console.log('res', res);
|
||||
if (res.code == "4") {
|
||||
tableKey.value.problemId = res.problemId;
|
||||
reasonText.value = res.msg;
|
||||
@ -1103,43 +1002,4 @@ const formatDict = (v, dictType) => {
|
||||
.custom-table-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
}
|
||||
|
||||
.btns_box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin-top: 1.875rem;
|
||||
|
||||
.btn {
|
||||
width: 80%;
|
||||
height: 2.5rem;
|
||||
line-height: 2.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
border-radius: 0.5rem;
|
||||
background-color: var(--el-color-primary);
|
||||
color: var(--el-color-white);
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--el-color-primary-light-2);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background-color: var(--el-color-primary-light-5);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginRef" class="login-form">
|
||||
<!-- <FloatingLines :enabled-waves="['top', 'middle', 'bottom']" :line-count="[10, 15, 20]" :line-distance="[8, 6, 4]"
|
||||
:bend-radius="5.0" :bend-strength="-0.5" :interactive="true" :parallax="true" /> -->
|
||||
<el-form ref="loginRef" class="login-form">
|
||||
<div class="login-header">
|
||||
<div class="login-logo">
|
||||
<img src="@/assets/images/logo_new.png" alt="系统Logo" />
|
||||
</div>
|
||||
<div class="login-split"></div>
|
||||
<div class="login-title">
|
||||
<h1>{{ oem.appname}}</h1>
|
||||
<h1>{{ oem.appname }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,21 +17,12 @@
|
||||
<el-tabs v-model="activeName" type="card" @tab-click="handleClick" class="login-tabs">
|
||||
<!-- 工号登录 Tab -->
|
||||
<el-tab-pane label="账号密码登录" name="first">
|
||||
<el-form-item label="医疗机构:" prop="loginYLJG"class="custom-select">
|
||||
<el-select
|
||||
v-model="loginForm.loginParam.loginYLJG"
|
||||
placeholder="请选择医疗机构"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-form-item label="医疗机构:" prop="loginYLJG" class="custom-select">
|
||||
<el-select v-model="loginForm.loginParam.loginYLJG" placeholder="请选择医疗机构" style="width: 100%">
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="international" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in selectOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-option v-for="item in selectOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -43,7 +36,7 @@
|
||||
|
||||
<el-form-item label="登录密码:" prop="password">
|
||||
<el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码"
|
||||
@keyup.enter="handleLogin">
|
||||
@keyup.enter="handleLogin">
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="password" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
@ -56,15 +49,8 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="code" label="验 证 码 :" v-if="captchaEnabled">
|
||||
<el-input
|
||||
|
||||
v-model="loginForm.code"
|
||||
size="large"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 53%"
|
||||
@keyup.enter="handleLogin"
|
||||
>
|
||||
<el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 53%"
|
||||
@keyup.enter="handleLogin">
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="validCode" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
@ -75,7 +61,8 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="width: 100%;">
|
||||
<el-button :loading="loading" size="large" type="primary" class="login-btn" style="width: 100%;" @click.prevent="handleLogin">
|
||||
<el-button :loading="loading" size="large" type="primary" class="login-btn" style="width: 100%;"
|
||||
@click.prevent="handleLogin">
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
</el-button>
|
||||
@ -87,7 +74,9 @@
|
||||
|
||||
<el-tab-pane label="扫码登录" name="second">
|
||||
<div class="tab-placeholder">
|
||||
<el-icon class="placeholder-icon"><Sms /></el-icon>
|
||||
<el-icon class="placeholder-icon">
|
||||
<Sms />
|
||||
</el-icon>
|
||||
<p>正在加载二维码...</p>
|
||||
<el-button type="success" icon="wechat" class="wechat-login-btn">刷新二维码</el-button>
|
||||
</div>
|
||||
@ -95,7 +84,9 @@
|
||||
|
||||
<el-tab-pane label="UKEY登录" name="third">
|
||||
<div class="tab-placeholder">
|
||||
<el-icon class="placeholder-icon"><Wechat /></el-icon>
|
||||
<el-icon class="placeholder-icon">
|
||||
<Wechat />
|
||||
</el-icon>
|
||||
<p>UKEY登录功能开发中...</p>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@ -103,7 +94,7 @@
|
||||
</el-form>
|
||||
|
||||
<div class="el-login-footer">
|
||||
<span>版权所有(R)2022-2026 {{ oem.compay}} 电话:{{oem.phone}} E-mail:{{oem.Email}} version:{{oem.version}}</span>
|
||||
<span>版权所有(R)2022-2026 {{ oem.compay }} 电话:{{ oem.phone }} E-mail:{{ oem.Email }} version:{{ oem.version }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -116,6 +107,7 @@ import { getCodeImg, getInfo, getLocalconfig } from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import FloatingLines from '@/components/Ballpit/index.vue';
|
||||
|
||||
// 初始化响应式变量
|
||||
const activeName = ref('first');
|
||||
@ -136,12 +128,12 @@ const loginForm = ref({
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: "",
|
||||
loginParam:{loginYLJG:"",localid:""}
|
||||
loginParam: { loginYLJG: "", localid: "" }
|
||||
});
|
||||
const selectOptions = ref([{ id: '1', name: '总院' }]);
|
||||
const loginRules = ref({ // 修复:改为ref响应式,方便动态修改
|
||||
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
|
||||
// password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
||||
// password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
||||
hospid: [{ required: true, message: '请选择医疗机构', trigger: 'change' }],
|
||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
||||
});
|
||||
@ -153,41 +145,41 @@ const redirect = ref(undefined);
|
||||
|
||||
// 路由监听(优化版)
|
||||
watch(
|
||||
() => route.query.redirect,
|
||||
(newRedirect) => {
|
||||
if (redirect.value !== newRedirect) {
|
||||
redirect.value = newRedirect || '';
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: false }
|
||||
() => route.query.redirect,
|
||||
(newRedirect) => {
|
||||
if (redirect.value !== newRedirect) {
|
||||
redirect.value = newRedirect || '';
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: false }
|
||||
);
|
||||
|
||||
// 登录方法(修复proxy.$refs问题)
|
||||
const handleLogin = async () => {
|
||||
loginForm.value.loginParam.loginYLJG
|
||||
loading.value = true;
|
||||
Cookies.set("czlis_username", loginForm.value.username, { expires: 30 });
|
||||
Cookies.set("czlis_loginYLJG", loginForm.value.loginParam.loginYLJG, {expires: 30});
|
||||
// 调用action的登录方法
|
||||
userStore.login(loginForm.value).then(() => {
|
||||
const query = route.query;
|
||||
const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
|
||||
if (cur !== "redirect") {
|
||||
acc[cur] = query[cur];
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
const targetPath = redirect.value || "/";
|
||||
if (route.path !== targetPath) {
|
||||
router.push({ path: targetPath, query: otherQueryParams });
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
// 重新获取验证码
|
||||
if (captchaEnabled.value) {
|
||||
getCode();
|
||||
}
|
||||
});
|
||||
loading.value = true;
|
||||
Cookies.set("czlis_username", loginForm.value.username, { expires: 30 });
|
||||
Cookies.set("czlis_loginYLJG", loginForm.value.loginParam.loginYLJG, { expires: 30 });
|
||||
// 调用action的登录方法
|
||||
userStore.login(loginForm.value).then(() => {
|
||||
const query = route.query;
|
||||
const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
|
||||
if (cur !== "redirect") {
|
||||
acc[cur] = query[cur];
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
const targetPath = redirect.value || "/";
|
||||
if (route.path !== targetPath) {
|
||||
router.push({ path: targetPath, query: otherQueryParams });
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
// 重新获取验证码
|
||||
if (captchaEnabled.value) {
|
||||
getCode();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 获取验证码
|
||||
@ -202,7 +194,7 @@ const getCode = () => {
|
||||
if (!captchaEnabled.value) {
|
||||
loginRules.value.code = [];
|
||||
} else {
|
||||
loginRules.value.code = [{required: true, trigger: "change", message: "请输入验证码"}];
|
||||
loginRules.value.code = [{ required: true, trigger: "change", message: "请输入验证码" }];
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -212,10 +204,10 @@ const getCookie = () => {
|
||||
const cookieUsername = Cookies.get("czlis_username");
|
||||
const cookieloginYLJG = Cookies.get("czlis_loginYLJG");
|
||||
//console.log('cookieloginYLJG', cookieloginYLJG);
|
||||
if (cookieUsername !== undefined && cookieUsername !== null&& cookieUsername !=="") {
|
||||
if (cookieUsername !== undefined && cookieUsername !== null && cookieUsername !== "") {
|
||||
loginForm.value.username = cookieUsername;
|
||||
}
|
||||
if (cookieloginYLJG !== undefined && cookieloginYLJG !== null&& cookieloginYLJG !=="") {
|
||||
if (cookieloginYLJG !== undefined && cookieloginYLJG !== null && cookieloginYLJG !== "") {
|
||||
loginForm.value.loginParam.loginYLJG = cookieloginYLJG;
|
||||
}
|
||||
//console.log('loginForm', loginForm);
|
||||
@ -223,16 +215,16 @@ const getCookie = () => {
|
||||
|
||||
// 获取本地配置
|
||||
const Localconfig = (localid) => {
|
||||
getLocalconfig({localid}).then(res => {
|
||||
getLocalconfig({ localid }).then(res => {
|
||||
if (res) {
|
||||
const {localconfig, hosplist, oem: oemData} = res;
|
||||
const { localconfig, hosplist, oem: oemData } = res;
|
||||
// 修复:赋值oem数据,显示动态标题
|
||||
if (oemData) oem.value = oemData;
|
||||
// console.log('oemData', oemData);
|
||||
// console.log('oem', oem.value);
|
||||
// console.log('oemData', oemData);
|
||||
// console.log('oem', oem.value);
|
||||
// 修复:判重后更新下拉选项,避免递归
|
||||
if (JSON.stringify(selectOptions.value) !== JSON.stringify(hosplist)) {
|
||||
selectOptions.value = hosplist || [{id: '1', name: '总院'}];
|
||||
selectOptions.value = hosplist || [{ id: '1', name: '总院' }];
|
||||
// 判重后赋值,避免重复修改触发更新
|
||||
if (!selectOptions.value.some(item => item.id === loginForm.value.hospid)) {
|
||||
loginForm.value.loginParam.loginYLJG = selectOptions.value[0]?.id || '1';
|
||||
@ -246,11 +238,11 @@ const Localconfig = (localid) => {
|
||||
};
|
||||
|
||||
// 获取指纹并加载配置
|
||||
const {getFingerprint} = useFingerprint();
|
||||
const { getFingerprint } = useFingerprint();
|
||||
const refreshFingerprint = async () => {
|
||||
try {
|
||||
const res = await getFingerprint();
|
||||
loginForm.value.loginParam.localid=res.visitorId
|
||||
loginForm.value.loginParam.localid = res.visitorId
|
||||
Localconfig(res.visitorId);
|
||||
} catch (err) {
|
||||
console.error("获取指纹失败:", err);
|
||||
@ -276,15 +268,18 @@ onMounted(() => {
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
background-image: url("../assets/images/login-background.jpg");
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
@ -390,7 +385,8 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.custom-select {
|
||||
margin-top: 20px; /* 可根据需求调整数值 */
|
||||
margin-top: 20px;
|
||||
/* 可根据需求调整数值 */
|
||||
}
|
||||
|
||||
/* Tab占位样式 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user