| | |
| | | }, |
| | | "dependencies": { |
| | | "@tinymce/tinymce-vue": "^3.2.8", |
| | | "aieditor": "^1.3.6", |
| | | "aieditor": "^1.4.0", |
| | | "ant-design-vue": "^1.7.8", |
| | | "axios": "^0.24.0", |
| | | "core-js": "^3.41.0", |
| | |
| | | <AiEditor |
| | | :ref="`editor_${item.id}`" |
| | | v-model="item.data.content" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入内容..." |
| | | /> |
| | | </div> |
| | |
| | | <template> |
| | | <el-dialog |
| | | :title="isEdit? '编辑表数据' : '添加表数据'" |
| | | :title="isEdit ? '编辑表数据' : '添加表数据'" |
| | | :visible.sync="dialogVisible" |
| | | width="60%" |
| | | :close-on-click-modal="false" |
| | |
| | | :label="header.name" |
| | | :prop="header.name" |
| | | :rules="{ |
| | | required: header.required === true || header.required === 'true', |
| | | required: |
| | | header.required === true || header.required === 'true', |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ['blur', 'change'] |
| | | trigger: ['blur', 'change'], |
| | | }" |
| | | v-if="header.type == 'text'" |
| | | > |
| | |
| | | :label="header.name" |
| | | :prop="header.name" |
| | | :rules="{ |
| | | required: header.required === true || header.required === 'true', |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ['blur', 'change'] |
| | | required: |
| | | header.required === true || header.required === 'true', |
| | | trigger: ['blur', 'change'], |
| | | }" |
| | | class="image-form-item" |
| | | v-if="header.type == 'image'" |
| | | > |
| | | <el-upload |
| | |
| | | :file-list="imageList" |
| | | :auto-upload="true" |
| | | list-type="picture-card" |
| | | :beforeUpload="beforeImageUpload" |
| | | :on-change="handleImageChange" |
| | | :on-remove="handleImageRemove" |
| | | :on-success="handleImageSuccess" |
| | | :on-preview="handlePreview" |
| | | :disabled="!checkEditPermission(header)" |
| | | > |
| | | <i class="el-icon-plus"></i> |
| | | <div |
| | | style=" |
| | | display: flex; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | " |
| | | > |
| | | <i class="el-icon-plus"></i> |
| | | </div> |
| | | <div slot="tip" class="el-upload__tip">只支持.jpg格式</div> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="header.name" |
| | | :prop="header.name" |
| | | :rules="{ |
| | | required: header.required === true || header.required === 'true', |
| | | required: |
| | | header.required === true || header.required === 'true', |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ['blur', 'change'] |
| | | trigger: ['blur', 'change'], |
| | | }" |
| | | v-if="header.type == 'date'" |
| | | > |
| | |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :disabled="!checkEditPermission(header)" |
| | | :picker-options="{ |
| | | shortcuts: [{ |
| | | text: '今天', |
| | | onClick(picker) { |
| | | picker.$emit('pick', new Date()); |
| | | } |
| | | }, { |
| | | text: '昨天', |
| | | onClick(picker) { |
| | | const date = new Date(); |
| | | date.setTime(date.getTime() - 3600 * 1000 * 24); |
| | | picker.$emit('pick', date); |
| | | } |
| | | }, { |
| | | text: '一周前', |
| | | onClick(picker) { |
| | | const date = new Date(); |
| | | date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit('pick', date); |
| | | } |
| | | }] |
| | | shortcuts: [ |
| | | { |
| | | text: '今天', |
| | | onClick(picker) { |
| | | picker.$emit('pick', new Date()); |
| | | }, |
| | | }, |
| | | { |
| | | text: '昨天', |
| | | onClick(picker) { |
| | | const date = new Date(); |
| | | date.setTime(date.getTime() - 3600 * 1000 * 24); |
| | | picker.$emit('pick', date); |
| | | }, |
| | | }, |
| | | { |
| | | text: '一周前', |
| | | onClick(picker) { |
| | | const date = new Date(); |
| | | date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit('pick', date); |
| | | }, |
| | | }, |
| | | ], |
| | | }" |
| | | /> |
| | | </el-form-item> |
| | |
| | | :label="header.name" |
| | | :prop="header.name" |
| | | :rules="{ |
| | | required: header.required === true || header.required === 'true', |
| | | required: |
| | | header.required === true || header.required === 'true', |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ['blur', 'change'] |
| | | trigger: ['blur', 'change'], |
| | | }" |
| | | v-if="header.type == 'user'" |
| | | > |
| | |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import { listByRole } from './service'; |
| | | import { getFullUrl } from '@/utils/utils'; |
| | | import apiConfig from '@/utils/baseurl'; |
| | | import { listByRole } from "./service"; |
| | | import { getFullUrl } from "@/utils/utils"; |
| | | import apiConfig from "@/utils/baseurl"; |
| | | |
| | | export default { |
| | | name: "AddDialog", |
| | |
| | | isEdit: { |
| | | type: Boolean, |
| | | default: false, |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | isIPad: /iPad/i.test(navigator.userAgent), |
| | | showHeaderList: [{"name":"sd","type":"text","required":true,"message":"请输入表头名称","role":[]}], |
| | | showHeaderList: [ |
| | | { |
| | | name: "sd", |
| | | type: "text", |
| | | required: true, |
| | | message: "请输入表头名称", |
| | | role: [], |
| | | }, |
| | | ], |
| | | form: {}, |
| | | rules: {}, |
| | | photoList: [], |
| | | imageList: [], |
| | | defaultImageUrl: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', // 默认图片地址 |
| | | defaultImageUrl: |
| | | "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", // 默认图片地址 |
| | | userOptions: [], |
| | | imagePreviewVisible: false, |
| | | imagePreviewUrl: '', |
| | | imagePreviewUrl: "", |
| | | uploadUrl: apiConfig.imgUrl, |
| | | uploadHeaders: { |
| | | Authorization: sessionStorage.getItem('token') || '' |
| | | } |
| | | Authorization: sessionStorage.getItem("token") || "", |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | }, |
| | | currentUserId() { |
| | | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}'); |
| | | const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "{}"); |
| | | return userInfo.userId; |
| | | } |
| | | }, |
| | | }, |
| | | watch: { |
| | | visible: { |
| | |
| | | }, |
| | | methods: { |
| | | getUserOptions() { |
| | | listByRole().then(res => { |
| | | if (res) { |
| | | this.userOptions = res.map(user => ({ |
| | | value: user.userId, |
| | | label: user.nickName || user.userName |
| | | })); |
| | | } else { |
| | | this.$message.error('获取用户列表失败'); |
| | | } |
| | | }).catch(err => { |
| | | console.error('获取用户列表失败', err); |
| | | }); |
| | | listByRole() |
| | | .then((res) => { |
| | | if (res) { |
| | | this.userOptions = res.map((user) => ({ |
| | | value: user.userId, |
| | | label: user.nickName || user.userName, |
| | | })); |
| | | } else { |
| | | this.$message.error("获取用户列表失败"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error("获取用户列表失败", err); |
| | | }); |
| | | }, |
| | | checkEditPermission(header) { |
| | | if (!header.role || !Array.isArray(header.role)) { |
| | |
| | | // 初始化校验规则 |
| | | const rules = {}; |
| | | if (this.headerList && this.headerList.length) { |
| | | this.headerList.forEach(header => { |
| | | this.headerList.forEach((header) => { |
| | | // 处理required可能是字符串的情况 |
| | | const isRequired = header.required === true || header.required === 'true'; |
| | | const isRequired = |
| | | header.required === true || header.required === "true"; |
| | | if (isRequired) { |
| | | rules[header.name] = [{ |
| | | required: true, |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ['blur', 'change'] |
| | | }]; |
| | | rules[header.name] = [ |
| | | { |
| | | required: true, |
| | | message: header.message || `请输入${header.name}`, |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ]; |
| | | } |
| | | }); |
| | | } |
| | |
| | | const formData = { |
| | | updateTime: this.formatDateTime(new Date()), |
| | | }; |
| | | |
| | | |
| | | // 根据headerList初始化表单数据 |
| | | if (this.headerList && this.headerList.length) { |
| | | this.headerList.forEach(header => { |
| | | if (header.type === 'user') { |
| | | this.headerList.forEach((header) => { |
| | | if (header.type === "user") { |
| | | formData[header.name] = []; |
| | | } else { |
| | | formData[header.name] = ''; |
| | | formData[header.name] = ""; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 使用Vue.set确保响应式 |
| | | Object.keys(formData).forEach(key => { |
| | | Object.keys(formData).forEach((key) => { |
| | | this.$set(this.form, key, formData[key]); |
| | | }); |
| | | }, |
| | |
| | | |
| | | // 根据headerList设置表单数据 |
| | | if (this.headerList && this.headerList.length) { |
| | | this.headerList.forEach(header => { |
| | | if (header.type === 'user') { |
| | | this.headerList.forEach((header) => { |
| | | if (header.type === "user") { |
| | | formData[header.name] = data[header.name] || []; |
| | | } else { |
| | | formData[header.name] = data[header.name] || ''; |
| | | formData[header.name] = data[header.name] || ""; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 使用Vue.set确保响应式 |
| | | Object.keys(formData).forEach(key => { |
| | | Object.keys(formData).forEach((key) => { |
| | | this.$set(this.form, key, formData[key]); |
| | | }); |
| | | |
| | |
| | | |
| | | // 设置图谱列表 |
| | | this.imageList = []; |
| | | const imageHeader = this.headerList.find(h => h.type === 'image'); |
| | | const imageHeader = this.headerList.find((h) => h.type === "image"); |
| | | if (imageHeader && data[imageHeader.name]) { |
| | | this.imageList = [{ |
| | | name: 'image', |
| | | url: getFullUrl(data[imageHeader.name]), |
| | | }]; |
| | | this.imageList = [ |
| | | { |
| | | name: "image", |
| | | url: getFullUrl(data[imageHeader.name]), |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | | // 重置表单校验状态 |
| | |
| | | }, |
| | | formatDateTime(date) { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | handleClose() { |
| | |
| | | this.initFormData(); |
| | | }, |
| | | handleSubmit() { |
| | | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | const submitData = { |
| | | ...this.form, |
| | | photos: this.photoList, |
| | | }; |
| | | |
| | | |
| | | // 为用户类型字段添加用户完整信息 |
| | | if (this.headerList && this.headerList.length) { |
| | | this.headerList.forEach(header => { |
| | | if (header.type === 'user' && Array.isArray(submitData[header.name])) { |
| | | this.headerList.forEach((header) => { |
| | | if ( |
| | | header.type === "user" && |
| | | Array.isArray(submitData[header.name]) |
| | | ) { |
| | | // 为每个用户类型字段添加userInfo属性,包含用户完整信息 |
| | | submitData[`${header.name}_userInfo`] = submitData[header.name].map(userId => { |
| | | const userInfo = this.userOptions.find(user => user.value === userId); |
| | | submitData[`${header.name}_userInfo`] = submitData[ |
| | | header.name |
| | | ].map((userId) => { |
| | | const userInfo = this.userOptions.find( |
| | | (user) => user.value === userId |
| | | ); |
| | | return userInfo ? userInfo : { value: userId, label: userId }; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.$emit("success", submitData); |
| | | this.handleClose(); |
| | | } else { |
| | | this.$message.error('请填写必填项'); |
| | | this.$message.error("请填写必填项"); |
| | | } |
| | | }); |
| | | }, |
| | | beforeImageUpload(file) { |
| | | const isJPG = file.type === "image/jpeg"; |
| | | // const isLt2M = file.size / 1024 / 1024 < 2; |
| | | |
| | | if (!isJPG) { |
| | | this.$message.error("上传图片只能是 JPG 格式!"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | handleImageChange(file, fileList) { |
| | | this.imageList = fileList; |
| | | const imageHeader = this.headerList.find(h => h.type === 'image'); |
| | | const imageHeader = this.headerList.find((h) => h.type === "image"); |
| | | if (imageHeader) { |
| | | this.$refs.form.validateField(imageHeader.name); |
| | | } |
| | |
| | | handleImageSuccess(res, file, fileList) { |
| | | const url = res.msg; |
| | | file.url = getFullUrl(url); |
| | | const imageHeader = this.headerList.find(h => h.type === 'image'); |
| | | const imageHeader = this.headerList.find((h) => h.type === "image"); |
| | | if (imageHeader) { |
| | | this.$set(this.form, imageHeader.name, url); |
| | | this.$refs.form.validateField(imageHeader.name); |
| | | } |
| | | this.imageList = fileList.map(f => { |
| | | this.imageList = fileList.map((f) => { |
| | | if (f.uid === file.uid) { |
| | | return file; |
| | | } |
| | |
| | | }); |
| | | }, |
| | | handleImageRemove(file, fileList) { |
| | | const imageHeader = this.headerList.find(h => h.type === 'image'); |
| | | const imageHeader = this.headerList.find((h) => h.type === "image"); |
| | | if (imageHeader) { |
| | | this.$set(this.form, imageHeader.name, ''); |
| | | this.$set(this.form, imageHeader.name, ""); |
| | | } |
| | | this.imageList = fileList; |
| | | }, |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style scoped lang="less"> |
| | | ::v-deep .el-dialog__body { |
| | | padding: 0; |
| | |
| | | background: #f5f7fa; |
| | | } |
| | | } |
| | | .el-form-item::after{ |
| | | .el-form-item::after { |
| | | height: 10px !important; |
| | | } |
| | | } |
| | |
| | | height: 120px; |
| | | line-height: 120px; |
| | | } |
| | | |
| | | |
| | | .el-upload-list--picture-card { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | |
| | | |
| | | .el-upload-list__item { |
| | | width: 120px; |
| | | height: 120px; |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 让上传按钮始终显示在列表最后 |
| | | .el-upload--picture-card { |
| | | order: 9999; |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 包裹容器也使用flex布局 |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | |
| | | background-color: #f5f7fa; |
| | | } |
| | | } |
| | | .el-upload__tip { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | margin-top: 8px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | .el-upload__tip { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | margin-top: 115px !important; |
| | | margin-right: -105px !important; |
| | | } |
| | | ::v-deep .image-form-item { |
| | | .el-form-item__error { |
| | | display: none !important; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <div v-for="(item, idx) in components" :key="item.id" class="dynamic-component"> |
| | | <!-- 富文本 --> |
| | | <div v-if="item.type == 'richText'"> |
| | | <AiEditor :ref="`editor_${item.id}`" :value="item.data.content" height="200px" :readOnly="!editable" |
| | | <AiEditor :ref="`editor_${item.id}`" :value="item.data.content" height="400px" :readOnly="!editable" |
| | | placeholder="请输入内容..." :disabled="!editable" /> |
| | | </div> |
| | | <!-- 自定义表格 --> |
| | |
| | | </template> |
| | | <!-- 图片类型显示 --> |
| | | <template v-else-if="header.type === 'image'"> |
| | | <img v-if="scope.row[header.name]" :src="getFullUrl(scope.row[header.name])" alt="头像" |
| | | <el-image v-if="scope.row[header.name]" :preview-src-list="[getFullUrl(scope.row[header.name])]" :src="getFullUrl(scope.row[header.name])" alt="头像" |
| | | class="table-image" /> |
| | | </template> |
| | | <!-- 其他类型 --> |
| | |
| | | beforeImageUpload(file) { |
| | | const isJPG = file.type === 'image/jpeg'; |
| | | const isPNG = file.type === 'image/png'; |
| | | const isLt2M = file.size / 1024 / 1024 < 2; |
| | | // const isLt2M = file.size / 1024 / 1024 < 2; |
| | | |
| | | if (!isJPG && !isPNG) { |
| | | this.$message.error('上传图片只能是 JPG 或 PNG 格式!'); |
| | | return false; |
| | | } |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 2MB!'); |
| | | return false; |
| | | } |
| | | // if (!isLt2M) { |
| | | // this.$message.error('上传图片大小不能超过 2MB!'); |
| | | // return false; |
| | | // } |
| | | this.imagePreviewVisible = true; |
| | | return true; |
| | | }, |
| | |
| | | roleIds: [this.roleType], |
| | | } |
| | | const res = await getUserList(params); |
| | | this.tableData = res.records.filter(item => item.status == 0); |
| | | this.tableData = res.records; |
| | | } else { |
| | | const res = await getUserList(params); |
| | | this.tableData = res.records.filter(item => item.status == 0); |
| | |
| | | <AiEditor |
| | | ref="purposeEditor" |
| | | :value="editorContents.experimentObjective" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入实验目的..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="materialEditor" |
| | | :value="editorContents.experimentMaterial" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入实验材料..." |
| | | /> |
| | | <div class="item-title"> |
| | |
| | | <AiEditor |
| | | ref="equipmentEditor" |
| | | :value="editorContents.experimentDevice" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入实验设备..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="methodEditor" |
| | | :value="editorContents.experimentTestMethod" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入检测方法及开发..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="stepsEditor" |
| | | :value="editorContents.experimentProcedure" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入实验步骤..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="dataAnalysisEditor" |
| | | :value="editorContents.dataAcquisition" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入数据采集及分析..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="evaluationEditor" |
| | | :value="editorContents.resultEvaluation" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入结果评估..." |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="notesEditor" |
| | | :value="editorContents.precautions" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入注意事项..." |
| | | /> |
| | | <div class="add-project-footer"> |
| | |
| | | <AiEditor |
| | | ref="purposeEditor" |
| | | :value="form.experimentObjective" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="materialEditor" |
| | | :value="form.experimentMaterial" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="item-title"> |
| | |
| | | <AiEditor |
| | | ref="equipmentEditor" |
| | | :value="form.experimentDevice" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="methodEditor" |
| | | :value="form.experimentTestMethod" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="stepsEditor" |
| | | :value="form.experimentProcedure" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="dataAnalysisEditor" |
| | | :value="form.dataAcquisition" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="evaluationEditor" |
| | | :value="form.resultEvaluation" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | <div class="header-title"> |
| | |
| | | <AiEditor |
| | | ref="notesEditor" |
| | | :value="form.precautions" |
| | | height="200px" |
| | | height="400px" |
| | | :readOnly="true" |
| | | /> |
| | | </template> |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :visible.sync="dialogVisible" @close="$emit('close')" title="新增检测项" width="50%"> |
| | | <el-dialog :visible.sync="dialogVisible" @close="$emit('close')" title="新增检测项" width="85%"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-position="top" class="test-item-form"> |
| | | <div class="form-row"> |
| | | <el-form-item label="检测项编号" prop="termCode" class="form-item"> |
| | |
| | | const index = this.groupTableData.findIndex( |
| | | (item) => item.id === form.id |
| | | ); |
| | | console.log('groupTableData',this.groupTableData,'form',form) |
| | | if (index > -1) { |
| | | this.groupTableData.splice(index, 1, form); |
| | | } else { |
| | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | const eventName = "submit"; |
| | | this.$emit(eventName, {...this.form}); |
| | | this.$emit(eventName, {...this.form,id:this.form.id || new Date().getTime()}); |
| | | this.handleClose(); |
| | | } |
| | | }); |
| | |
| | | <AiEditor |
| | | ref="totalResultEditor" |
| | | :value="editorContents.totalResult" |
| | | height="200px" |
| | | height="400px" |
| | | style="margin: 20px 0" |
| | | placeholder="请输入本次检验结果总表..." |
| | | :readOnly="pageType === 'view'" |
| | |
| | | <AiEditor |
| | | ref="resultEditor" |
| | | :value="editorContents.result" |
| | | height="200px" |
| | | height="400px" |
| | | style="margin: 20px 0" |
| | | placeholder="请输入本次检验结果..." |
| | | :readOnly="pageType === 'view'" |
| | |
| | | <div class="sample-dialog"> |
| | | <div class="sample-content"> |
| | | <div class="form-content"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-position="top" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-position="top"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="数据编号" prop="dataCode"> |
| | |
| | | |
| | | <el-row v-if="showPhotoUpload" :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="检测拍照" prop="photos"> |
| | | <div v-if="isIPad"> |
| | | <el-button type="primary" @click="handleIPadPhoto">拍照</el-button> |
| | | <el-button type="primary" @click="handleIPadUpload">上传</el-button> |
| | | </div> |
| | | <el-form-item label="检测拍照" prop="photoList"> |
| | | <!-- <div v-if="isIPad"> |
| | | <el-button type="primary" @click="handleIPadPhoto" |
| | | >拍照</el-button |
| | | > |
| | | <el-button type="primary" @click="handleIPadUpload" |
| | | >上传</el-button |
| | | > |
| | | </div> --> |
| | | <el-upload |
| | | v-else |
| | | class="upload-demo" |
| | | action="#" |
| | | :file-list="photoList" |
| | | :auto-upload="false" |
| | | :auto-upload="true" |
| | | list-type="picture-card" |
| | | :http-request="handlePhotoUpload" |
| | | :on-remove="handlePhotoRemove" |
| | |
| | | |
| | | <el-row v-if="showSpectrumUpload" :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="检测图谱" prop="spectrums"> |
| | | <el-form-item label="检测图谱" prop="spectrumList"> |
| | | <div v-if="isIPad"> |
| | | <el-button type="primary" @click="handleIPadSpectrum">选择图谱</el-button> |
| | | <el-button type="primary" @click="handleIPadSpectrum" |
| | | >选择图谱</el-button |
| | | > |
| | | </div> |
| | | <el-upload |
| | | v-else |
| | | class="upload-file" |
| | | action="#" |
| | | :file-list="spectrumList" |
| | | :auto-upload="false" |
| | | :auto-upload="true" |
| | | :http-request="handleSpectrumUpload" |
| | | :on-remove="handleSpectrumRemove" |
| | | > |
| | | <el-button type="primary"> |
| | | <i class="el-icon-upload"></i> 选择文件 |
| | | </el-button> |
| | | <div class="el-upload__tip" slot="tip">支持 jpg、png、pdf 格式文件</div> |
| | | <div class="el-upload__tip" slot="tip"> |
| | | 支持 jpg、png、pdf 格式文件 |
| | | </div> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { customUploadRequest, getFullUrl } from '@/utils/utils' |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | export default { |
| | | name: "AddDialog", |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | default: false, |
| | | }, |
| | | isEdit: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | default: false, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | dataFiles: "", |
| | | dataPictures: "", |
| | | photos: [], |
| | | spectrums: [] |
| | | spectrums: [], |
| | | }, |
| | | rules: { |
| | | dataCode: [ |
| | | { required: true, message: "请输入数据编号", trigger: "blur" } |
| | | { required: true, message: "请输入数据编号", trigger: "blur" }, |
| | | ], |
| | | dataTitle: [ |
| | | { required: true, message: "请输入检测数据", trigger: "blur" } |
| | | { required: true, message: "请输入检测数据", trigger: "blur" }, |
| | | ], |
| | | dataType: [ |
| | | { |
| | | type: 'array', |
| | | required: true, |
| | | message: "请至少选择一种检测类型", |
| | | trigger: "change" |
| | | } |
| | | ], |
| | | photos: [ |
| | | { |
| | | required: true, |
| | | message: "请上传检测照片", |
| | | { |
| | | type: "array", |
| | | required: true, |
| | | message: "请至少选择一种检测类型", |
| | | trigger: "change", |
| | | validator: (rule, value, callback) => { |
| | | if (this.form.dataType.includes('1') && (!this.photoList || !this.photoList.length)) { |
| | | callback(new Error('请上传检测照片')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | ], |
| | | spectrums: [ |
| | | { |
| | | required: true, |
| | | message: "请上传检测图谱", |
| | | trigger: "change", |
| | | validator: (rule, value, callback) => { |
| | | if (this.form.dataType.includes('2') && (!this.spectrumList || !this.spectrumList.length)) { |
| | | callback(new Error('请上传检测图谱')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | // photoList: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请上传检测照片", |
| | | // trigger: "change", |
| | | // validator: (rule, value, callback) => { |
| | | // if (this.form.dataType.includes('1') && (!this.photoList || !this.photoList.length)) { |
| | | // callback(new Error('请上传检测照片')); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // } |
| | | // } |
| | | // ], |
| | | // spectrumList: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请上传检测图谱", |
| | | // trigger: "change", |
| | | // validator: (rule, value, callback) => { |
| | | // if (this.form.dataType.includes('2') && (!this.spectrumList || !this.spectrumList.length)) { |
| | | // callback(new Error('请上传检测图谱')); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // } |
| | | // } |
| | | // ] |
| | | }, |
| | | photoList: [], |
| | | spectrumList: [] |
| | | spectrumList: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | set(val) { |
| | | this.$emit("update:visible", val); |
| | | } |
| | | }, |
| | | }, |
| | | showPhotoUpload() { |
| | | return this.form.dataType.includes('1'); |
| | | return this.form.dataType.includes("1"); |
| | | }, |
| | | showSpectrumUpload() { |
| | | return this.form.dataType.includes('2'); |
| | | } |
| | | return this.form.dataType.includes("2"); |
| | | }, |
| | | }, |
| | | methods: { |
| | | setFormData(data) { |
| | |
| | | this.form.dataCode = data.dataCode; |
| | | this.form.dataTitle = data.dataTitle; |
| | | // 处理 dataType,确保它是数组格式 |
| | | this.form.dataType = Array.isArray(data.dataType) ? data.dataType : (data.dataType ? data.dataType.split(',') : []); |
| | | this.form.dataType = Array.isArray(data.dataType) |
| | | ? data.dataType |
| | | : data.dataType |
| | | ? data.dataType.split(",") |
| | | : []; |
| | | |
| | | // 设置照片列表 |
| | | if (data.dataPictures) { |
| | | try { |
| | | const pictures = typeof data.dataPictures === 'string' ? JSON.parse(data.dataPictures) : data.dataPictures; |
| | | this.photoList = pictures.map(photo => ({ |
| | | const pictures = |
| | | typeof data.dataPictures === "string" |
| | | ? JSON.parse(data.dataPictures) |
| | | : data.dataPictures; |
| | | this.photoList = pictures.map((photo) => ({ |
| | | name: photo.name, |
| | | url: photo.url, |
| | | status: 'success' |
| | | status: "success", |
| | | })); |
| | | } catch (e) { |
| | | console.error('解析照片数据失败:', e); |
| | | console.error("解析照片数据失败:", e); |
| | | this.photoList = []; |
| | | } |
| | | } else { |
| | |
| | | // 设置图谱列表 |
| | | if (data.dataFiles) { |
| | | try { |
| | | const files = typeof data.dataFiles === 'string' ? JSON.parse(data.dataFiles) : data.dataFiles; |
| | | this.spectrumList = files.map(file => ({ |
| | | const files = |
| | | typeof data.dataFiles === "string" |
| | | ? JSON.parse(data.dataFiles) |
| | | : data.dataFiles; |
| | | this.spectrumList = files.map((file) => ({ |
| | | name: file.name, |
| | | url: file.url, |
| | | status: 'success' |
| | | status: "success", |
| | | })); |
| | | } catch (e) { |
| | | console.error('解析图谱数据失败:', e); |
| | | console.error("解析图谱数据失败:", e); |
| | | this.spectrumList = []; |
| | | } |
| | | } else { |
| | |
| | | dataFiles: "", |
| | | dataPictures: "", |
| | | photos: [], |
| | | spectrums: [] |
| | | spectrums: [], |
| | | }; |
| | | }, |
| | | handleSubmit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | console.log('this.form.dataType',this.form.dataType,'this.photoList',this.photoList,'this.spectrumList',this.spectrumList) |
| | | if ( |
| | | this.form.dataType.includes("1") && |
| | | (!this.photoList || !this.photoList.length) |
| | | ) { |
| | | this.$message.error("请上传检测照片"); |
| | | return; |
| | | } |
| | | if ( |
| | | this.form.dataType.includes("2") && |
| | | (!this.spectrumList || !this.spectrumList.length) |
| | | ) { |
| | | this.$message.error("请上传检测图谱"); |
| | | return; |
| | | } |
| | | const submitData = { |
| | | ...this.form, |
| | | // 确保 dataType 在提交时转换为字符串 |
| | | dataType: Array.isArray(this.form.dataType) ? this.form.dataType.join(',') : this.form.dataType, |
| | | dataType: Array.isArray(this.form.dataType) |
| | | ? this.form.dataType.join(",") |
| | | : this.form.dataType, |
| | | dataFiles: JSON.stringify(this.spectrumList), |
| | | dataPictures: JSON.stringify(this.photoList) |
| | | dataPictures: JSON.stringify(this.photoList), |
| | | }; |
| | | this.$emit("success", submitData); |
| | | } |
| | |
| | | customUploadRequest({ |
| | | file, |
| | | onSuccess: (res) => { |
| | | if (res.code === 200) { |
| | | console.log('res',res) |
| | | if (res.code == 200) { |
| | | const fileObj = { |
| | | name: file.name, |
| | | url: getFullUrl(res.msg || res.data || ''), |
| | | status: 'success' |
| | | url: getFullUrl(res.msg || res.data || ""), |
| | | status: "success", |
| | | }; |
| | | this.photoList.push(fileObj); |
| | | this.$refs.form.validateField('photos'); |
| | | this.$message.success('图片上传成功'); |
| | | // this.$refs.form.validateField("photos"); |
| | | this.$message.success("图片上传成功"); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '图片上传失败'); |
| | | this.$message.error(res.message || "图片上传失败"); |
| | | onError(); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('图片上传失败'); |
| | | this.$message.error("图片上传失败"); |
| | | onError(err); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | handlePhotoRemove(file) { |
| | | const index = this.photoList.findIndex(item => item.name === file.name); |
| | | const index = this.photoList.findIndex((item) => item.name === file.name); |
| | | if (index !== -1) { |
| | | this.photoList.splice(index, 1); |
| | | this.$refs.form.validateField('photos'); |
| | | // this.$refs.form.validateField("photos"); |
| | | } |
| | | }, |
| | | // 真实图谱上传 |
| | |
| | | if (res.code === 200) { |
| | | const fileObj = { |
| | | name: file.name, |
| | | url: getFullUrl(res.msg || res.data || ''), |
| | | status: 'success' |
| | | url: getFullUrl(res.msg || res.data || ""), |
| | | status: "success", |
| | | }; |
| | | this.spectrumList.push(fileObj); |
| | | this.$refs.form.validateField('spectrums'); |
| | | this.$message.success('文件上传成功'); |
| | | // this.$refs.form.validateField('spectrums'); |
| | | this.$message.success("文件上传成功"); |
| | | onSuccess(res); |
| | | } else { |
| | | this.$message.error(res.message || '文件上传失败'); |
| | | this.$message.error(res.message || "文件上传失败"); |
| | | onError(); |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | this.$message.error('文件上传失败'); |
| | | this.$message.error("文件上传失败"); |
| | | onError(err); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | handleSpectrumRemove(file) { |
| | | const index = this.spectrumList.findIndex(item => item.name === file.name); |
| | | const index = this.spectrumList.findIndex( |
| | | (item) => item.name === file.name |
| | | ); |
| | | if (index !== -1) { |
| | | this.spectrumList.splice(index, 1); |
| | | this.$refs.form.validateField('spectrums'); |
| | | // this.$refs.form.validateField('spectrums'); |
| | | } |
| | | }, |
| | | // iPad 相关方法 |
| | | handleIPadPhoto() { |
| | | // 模拟 iPad 拍照功能 |
| | | const mockFile = { |
| | | name: 'iPad拍照.jpg', |
| | | url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', |
| | | status: 'success' |
| | | name: "iPad拍照.jpg", |
| | | url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", |
| | | status: "success", |
| | | }; |
| | | this.photoList = [...this.photoList, mockFile]; |
| | | this.$refs.form.validateField('photos'); |
| | | this.$refs.form.validateField("photos"); |
| | | }, |
| | | handleIPadUpload() { |
| | | // 模拟 iPad 上传功能 |
| | | const mockFile = { |
| | | name: 'iPad上传图片.jpg', |
| | | url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', |
| | | status: 'success' |
| | | name: "iPad上传图片.jpg", |
| | | url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", |
| | | status: "success", |
| | | }; |
| | | this.photoList = [...this.photoList, mockFile]; |
| | | this.$refs.form.validateField('photos'); |
| | | this.$refs.form.validateField("photos"); |
| | | }, |
| | | handleIPadSpectrum() { |
| | | // 模拟 iPad 选择图谱功能 |
| | | const mockFile = { |
| | | name: 'iPad图谱.pdf', |
| | | url: 'https://example.com/test.pdf', |
| | | status: 'success' |
| | | name: "iPad图谱.pdf", |
| | | url: "https://example.com/test.pdf", |
| | | status: "success", |
| | | }; |
| | | this.spectrumList = [...this.spectrumList, mockFile]; |
| | | this.$refs.form.validateField('spectrums'); |
| | | } |
| | | } |
| | | this.$refs.form.validateField("spectrums"); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | ::v-deep .el-dialog__body { |
| | | padding: 0; |
| | | max-height: calc(100vh - 200px); // 设置最大高度 |
| | | max-height: calc(100vh - 200px); // 设置最大高度 |
| | | } |
| | | |
| | | ::v-deep .el-dialog { |
| | | margin-top: 5vh !important; // 调整弹窗位置 |
| | | max-height: 90vh; // 设置弹窗最大高度 |
| | | margin-top: 5vh !important; // 调整弹窗位置 |
| | | max-height: 90vh; // 设置弹窗最大高度 |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | |
| | | .el-dialog__body { |
| | | flex: 1; |
| | | overflow: hidden; // 防止出现双滚动条 |
| | | overflow: hidden; // 防止出现双滚动条 |
| | | } |
| | | } |
| | | |
| | | .sample-dialog { |
| | | height: 100%; |
| | | |
| | | |
| | | .sample-content { |
| | | background: #ffffff; |
| | | border-radius: 10px; |
| | |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | |
| | | .form-content { |
| | | flex: 1; |
| | | overflow-y: auto; |
| | | padding: 0 10px; |
| | | max-height: calc(90vh - 250px); // 设置内容区域最大高度 |
| | | |
| | | max-height: calc(90vh - 250px); // 设置内容区域最大高度 |
| | | |
| | | &::-webkit-scrollbar { |
| | | width: 6px; |
| | | } |
| | | |
| | | |
| | | &::-webkit-scrollbar-thumb { |
| | | background: #c0c4cc; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | |
| | | &::-webkit-scrollbar-track { |
| | | background: #f5f7fa; |
| | | } |
| | |
| | | justify-content: center; |
| | | padding: 15px 20px; |
| | | border-top: 1px solid #e4e7ed; |
| | | margin-top: auto; // 保持在底部 |
| | | |
| | | margin-top: auto; // 保持在底部 |
| | | |
| | | button { |
| | | width: 150px; |
| | | } |
| | |
| | | height: 120px; |
| | | line-height: 120px; |
| | | } |
| | | |
| | | |
| | | .el-upload-list--picture-card { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | |
| | | |
| | | .el-upload-list__item { |
| | | width: 120px; |
| | | height: 120px; |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 让上传按钮始终显示在列表最后 |
| | | .el-upload--picture-card { |
| | | order: 9999; |
| | | margin: 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 包裹容器也使用flex布局 |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | |
| | | |
| | | .el-row { |
| | | margin-bottom: 20px; |
| | | |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; // 最后一行不要margin |
| | | margin-bottom: 0; // 最后一行不要margin |
| | | } |
| | | } |
| | | |
| | |
| | | // 优化表单布局 |
| | | ::v-deep .el-form { |
| | | .el-form-item { |
| | | margin-bottom: 15px; // 减小表单项间距 |
| | | |
| | | margin-bottom: 15px; // 减小表单项间距 |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | |
| | | ::v-deep .el-upload-list--picture-card { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 8px; // 设置图片间距 |
| | | gap: 8px; // 设置图片间距 |
| | | } |
| | | |
| | | .upload-file { |
| | |
| | | margin-top: 10px; |
| | | } |
| | | .el-upload-list__item { |
| | | transition: all .3s; |
| | | transition: all 0.3s; |
| | | &:hover { |
| | | background-color: #f5f7fa; |
| | | } |
| | |
| | | <div>一 、检测标准</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="standardEditor" :value="editorContents.termStandard" height="200px" style="margin: 20px 0;" |
| | | <AiEditor ref="standardEditor" :value="editorContents.termStandard" height="400px" style="margin: 20px 0;" |
| | | placeholder="请输入检测标准..." :readOnly="isDetail" /> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | <div>二 、检测仪器</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="instrumentEditor" :value="editorContents.termInstrument" height="200px" style="margin: 20px 0;" |
| | | <AiEditor ref="instrumentEditor" :value="editorContents.termInstrument" height="400px" style="margin: 20px 0;" |
| | | placeholder="请输入检测仪器..." :readOnly="isDetail" /> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | <div>三 、检测试剂</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="reagentEditor" :value="editorContents.termReagent" height="200px" style="margin: 20px 0;" |
| | | <AiEditor ref="reagentEditor" :value="editorContents.termReagent" height="400px" style="margin: 20px 0;" |
| | | placeholder="请输入检测试剂..." :readOnly="isDetail" /> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | <div>四 、检测步骤</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="stepsEditor" :value="editorContents.termStep" height="200px" style="margin: 20px 0;" |
| | | <AiEditor ref="stepsEditor" :value="editorContents.termStep" height="400px" style="margin: 20px 0;" |
| | | placeholder="请输入检测步骤..." :readOnly="isDetail" /> |
| | | |
| | | <div class="header-title" style="margin-bottom: 38px"> |
| | |
| | | <div>六 、检测结果运算</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="resultCalculationEditor" :value="editorContents.termResult" height="200px" style="margin: 20px 0;" |
| | | <AiEditor ref="resultCalculationEditor" :value="editorContents.termResult" height="400px" style="margin: 20px 0;" |
| | | placeholder="请输入检测结果运算..." :readOnly="isDetail" /> |
| | | <Table :data="taskTableData" :total="0" :height="null" class="rwuTable"> |
| | | <el-table-column type="index" label="序号" width="80"></el-table-column> |
| | |
| | | <el-input v-model="form.sampleCode" :disabled="true" placeholder="自动生成" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div>取样单编号:{{ form.sampleCode }}</div> |
| | | <!-- <div>取样单编号:{{ form.sampleCode }}</div> --> |
| | | <div class="header-title-left" style="margin-top: 38px"> |
| | | <img src="@/assets/public/headercard.png" /> |
| | | <span>取样操作记录</span> |
| | |
| | | </template> |
| | | <template #table> |
| | | <el-table-column |
| | | width="180" |
| | | v-for="(column, index) in currentColumns" |
| | | :key="index" |
| | | :prop="column.prop" |
| | |
| | | <el-image |
| | | v-for="(url, index) in scope.row.pictures.split(',')" |
| | | :key="index" |
| | | :src="url" |
| | | :preview-src-list="[url]" |
| | | :src="getFullUrl(url)" |
| | | :preview-src-list="[getFullUrl(url)]" |
| | | style="width: 50px; height: 50px;" |
| | | /> |
| | | </template> |
| | |
| | | ref="purposeEditor" |
| | | :readOnly="isEdit" |
| | | :value="editorContents.purpose" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入实验目的..." |
| | | /> |
| | | </div> |
| | |
| | | ref="processEditor" |
| | | :readOnly="isEdit" |
| | | :value="editorContents.process" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入工艺参数及路线..." |
| | | /> |
| | | </div> |
| | |
| | | } catch (err) { |
| | | console.error("获取组别列表失败:", err); |
| | | } |
| | | getParticipantsByDispatchId({ dispatchId: data.experimentDispatch.id }) |
| | | .then((res) => { |
| | | if (res) { |
| | | this.participantsData = res || []; |
| | | } else { |
| | | this.$message.error(res.msg || "获取参加人员列表失败"); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.$message.error("获取参加人员列表失败"); |
| | | console.error("获取参加人员列表失败:", err); |
| | | }); |
| | | } |
| | | |
| | | // 填充参与人员 |
| | |
| | | } |
| | | |
| | | .groupTable { |
| | | width: 65%; |
| | | width: 100%; |
| | | padding-left: 40px; |
| | | } |
| | | |
| | | .rwuTable { |
| | | width: 85%; |
| | | width: 100%; |
| | | padding-left: 40px; |
| | | } |
| | | |
| | |
| | | .content-box { |
| | | padding: 0 25px; |
| | | margin-bottom: 20px; |
| | | width: 65%; |
| | | width: 95%; |
| | | display: flex; |
| | | .content-box-left { |
| | | flex: 1; |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.experimentObjective" height="200px" |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.experimentObjective" height="400px" |
| | | placeholder="请输入实验目的..." /> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor ref="processEditor" :readOnly="true" :value="form.experimentParamRoute" height="200px" |
| | | <AiEditor ref="processEditor" :readOnly="true" :value="form.experimentParamRoute" height="400px" |
| | | placeholder="请输入工艺参数及路线..." /> |
| | | </div> |
| | | |
| | |
| | | <el-table-column prop="projectName" label="所属项目课题方案"></el-table-column> |
| | | <el-table-column prop="experimentCode" label="实验编号"></el-table-column> |
| | | <el-table-column prop="experimentName" label="实验名称"></el-table-column> |
| | | <el-table-column prop="experimentDate" label="通知时间"></el-table-column> |
| | | <el-table-column prop="createTime" label="通知时间"></el-table-column> |
| | | <el-table-column prop="experimentStartTime" label="实验开始时间"></el-table-column> |
| | | <el-table-column prop="experimentEndTime" label="实验结束时间"></el-table-column> |
| | | <el-table-column prop="participantsName" label="参加人员"></el-table-column> |
| | |
| | | </div> |
| | | </template> |
| | | <template #table> |
| | | <el-table-column prop="projectName" label="项目课题方案名称"></el-table-column> |
| | | <el-table-column prop="experimentCode" label="实验编号"></el-table-column> |
| | | <el-table-column prop="experimentName" label="实验名称"></el-table-column> |
| | | <el-table-column prop="experimentDate" label="实验日期"></el-table-column> |
| | | <el-table-column prop="schemePersonName" label="实验员"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建日期"></el-table-column> |
| | | <el-table-column prop="createBy" label="创建人"></el-table-column> |
| | | <el-table-column prop="status" label="当前状态"> |
| | | <el-table-column prop="projectName" label="项目课题方案名称" width="250"></el-table-column> |
| | | <el-table-column prop="experimentCode" label="实验编号" width="150"></el-table-column> |
| | | <el-table-column prop="experimentName" label="实验名称" width="150"></el-table-column> |
| | | <el-table-column prop="experimentDate" label="实验日期" width="150"></el-table-column> |
| | | <el-table-column prop="schemePersonName" label="实验员" width="150"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建日期" width="150"></el-table-column> |
| | | <el-table-column prop="createBy" label="创建人" width="150"></el-table-column> |
| | | <el-table-column prop="status" label="当前状态" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getStatusType(scope.row.status)"> |
| | | {{ getStatusText(scope.row.status) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="250"> |
| | | <el-table-column label="操作" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <!-- 草稿箱模式下,只显示编辑和详情 --> |
| | | <template v-if="currentType === 'draft'"> |
| | |
| | | <AiEditor |
| | | ref="reasonEditor" |
| | | :value="editorContent" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="请输入申请说明..." |
| | | /> |
| | | </div> |
| | |
| | | <div>中止原因说明</div> |
| | | </div> |
| | | </div> |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.stopReason" height="200px" placeholder="请输入文字" /> |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.stopReason" height="400px" placeholder="请输入文字" /> |
| | | |
| | | </template> |
| | | </Card> |
| | |
| | | return statusMap[status] || "未知"; |
| | | }, |
| | | handleClose() { |
| | | this.$emit('update:visible', false); |
| | | this.$emit('close', false); |
| | | this.remark = ""; |
| | | }, |
| | | handleApprove() { |
| | |
| | | ref="descriptionEditor" |
| | | :readOnly="true" |
| | | :value="data?.testReason || ''" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="暂无检验说明..." |
| | | /> |
| | | </div> |
| | |
| | | ref="descriptionEditor" |
| | | :readOnly="true" |
| | | :value="data?.testReason || ''" |
| | | height="200px" |
| | | height="400px" |
| | | placeholder="暂无检验说明..." |
| | | /> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.experimentObjective" height="200px" |
| | | <AiEditor ref="purposeEditor" :readOnly="true" :value="form.experimentObjective" height="400px" |
| | | placeholder="请输入实验目的..." /> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | <div class="content-box"> |
| | | <AiEditor ref="processEditor" :readOnly="true" :value="form.experimentParamRoute" height="200px" |
| | | <AiEditor ref="processEditor" :readOnly="true" :value="form.experimentParamRoute" height="400px" |
| | | placeholder="请输入工艺参数及路线..." /> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="content-box"> |
| | | <AiEditor ref="analysisEditor" :readOnly="isView" :value="form.experimentResult" height="200px" |
| | | <AiEditor ref="analysisEditor" :readOnly="isView" :value="form.experimentResult" height="400px" |
| | | placeholder="暂无实验数据分析及结论..." /> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="middleground" :class="{ |
| | | column: windowWidth < 1240, |
| | | column: windowWidth < 1440, |
| | | mobile: windowWidth < 800, |
| | | }"> |
| | | <!-- 左侧模块区域 --> |
| | |
| | | '/deliveryAssessment/reportEvaluation','/dataManagement/dispatching','/dataManagement/confirmation-sheet', |
| | | '/sampleManage/manage','/dataManagement/dispatching' |
| | | ] |
| | | let url=urlList[item.noticeType *1] |
| | | let url=urlList[(item.noticeType *1) -1] |
| | | this.$router.push({ |
| | | path: url, |
| | | }); |
| | |
| | | margin: 0; |
| | | padding: 10px; |
| | | margin: 0 !important; |
| | | flex-direction: column; |
| | | |
| | | .left-modules { |
| | | width: 100%; |
| | |
| | | uid: file.id |
| | | } |
| | | }) |
| | | this.form.feasibilityReportFiles = res.fileList |
| | | this.form.feasibilityReportFiles = res.feasibilityReportFiles |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.feasibilityReportFiles = [] |
| | |
| | | uid: file.id |
| | | } |
| | | }) |
| | | this.form.feasibilityReportFiles = res.fileList |
| | | this.form.feasibilityReportFiles = res.feasibilityReportFiles |
| | | } else { |
| | | this.fileList = [] |
| | | this.form.feasibilityReportFiles = [] |
| | |
| | | <template #table> |
| | | <el-table-column label="序号" type="index" show-overflow-tooltip /> |
| | | <el-table-column label="操作时间" prop="operTime" show-overflow-tooltip /> |
| | | <el-table-column label="操作人" prop="operName" show-overflow-tooltip /> |
| | | <el-table-column label="操作人" prop="nickName" show-overflow-tooltip /> |
| | | <el-table-column label="操作内容" prop="title" show-overflow-tooltip /> |
| | | </template> |
| | | </TableCustom> |
| | |
| | | <div class="sconed"> |
| | | <div class="subpage"> |
| | | <div class="title">页面名称</div> |
| | | <div class="btns">权限</div> |
| | | <!-- <div class="btns">权限</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="subpage" v-else> |
| | | <!-- <div class="subpage" v-else> |
| | | <div class="two"> |
| | | <!-- <div class="left"> |
| | | </div> --> |
| | | |
| | | <div class="right"> |
| | | <div v-for="item1 in item.children" :key="item1.menuId"> |
| | | <el-checkbox disabled :checked="item1.selected"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | roleInfoFromUserId({ userId: 1 }).then(res => { |
| | | roleInfoFromUserId().then(res => { |
| | | getRoleInfo({ roleId: this.$route.query.roleId }).then(resp => { |
| | | this.form = { |
| | | roleName: resp.roleName, |
| | |
| | | border: 1px solid #e8e8e8; |
| | | |
| | | .w20 { |
| | | width: 15%; |
| | | width: 35%; |
| | | padding: 8px 20px; |
| | | } |
| | | |
| | |
| | | |
| | | // 获取菜单树 |
| | | export const roleInfoFromUserId = (params) => { |
| | | return axios.get(`/system/role/roleInfoFromUserId`, { params }) |
| | | return axios.get(`/system/menu/levelList`, { params }) |
| | | } |
| | | |
| | | // 获取角色详情 |
| | |
| | | }, |
| | | submit() { |
| | | let params={ |
| | | userId:this.id, |
| | | oldUserId:this.tableData[0].id |
| | | userId:this.row.userId, |
| | | oldUserId:this.tableData[0].userId |
| | | } |
| | | inherit(params).then(res=>{ |
| | | inherit({...params}).then(res=>{ |
| | | this.$message.success('继承成功') |
| | | this.$emit('close') |
| | | }) |
| | |
| | | <template slot-scope="{ row }"> |
| | | <div> |
| | | <el-button type="text" @click="edit(row)" class="action-button">编辑</el-button> |
| | | <el-button type="text" @click="inherit(row)" class="action-button" v-if="row.status == 1">账号继承</el-button> |
| | | <el-button type="text" @click="inherit(row)" class="action-button">账号继承</el-button> |
| | | <el-button v-if="row.status != 0" type="text" @click="updateStatus(row, true)" class="action-button"> |
| | | 启用 |
| | | </el-button> |
| | |
| | | } |
| | | |
| | | export const inherit = (data) => { |
| | | return axios.put(`/open/system/user/inherit`, { ...data }) |
| | | console.log('222222222222',data) |
| | | return axios.put(`/open/system/user/inherit?userId=${data.userId}&oldUserId=${data.oldUserId}`, { ...data }) |
| | | } |