| | |
| | | import deepClone from "@/utils/deepClone" |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import request from "@/utils/request"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {ElDatePicker, ElMessage, ElMessageBox} from "element-plus"; |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import userInfo from "@/stores/userInfo"; |
| | | import {VxeUI} from 'vxe-pc-ui' |
| | | import GlassComputed from "@/views/pp/glassOptimize/GlassComputed.vue"; |
| | | |
| | | const {t} = useI18n() |
| | |
| | | {code: 'undocompute', name: '撤销模拟计算', prefixIcon: 'vxe-icon-error-circle-fill'}, |
| | | {code: 'Initializeproject', name: '初始化工程', prefixIcon: 'vxe-icon-undo'}, |
| | | {code: 'delproject', name: '删除工程', prefixIcon: 'vxe-icon-delete'}, |
| | | {code: 'viewtempered ', name: '查看钢化版图', prefixIcon: 'vxe-icon-custom-column'}, |
| | | {code: 'viewoptimize', name: '查看优化版图', prefixIcon: 'vxe-icon-layout'}, |
| | | {code: 'viewTempered', name: '查看钢化版图', prefixIcon: 'vxe-icon-custom-column'}, |
| | | {code: 'viewOptimize', name: '查看优化版图', prefixIcon: 'vxe-icon-layout'}, |
| | | {code: 'Export', name: '数据导出', prefixIcon: 'vxe-icon-download', visible: true, disabled: false}, |
| | | |
| | | ], |
| | |
| | | initialState: ['1', '2', '10', '20', '100'], |
| | | targetState: null, |
| | | successMsg: '工程删除成功!', |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | checkMessage: '当前工程状态不符合删除条件,请确认工程状态后再操作!', |
| | | }, |
| | | { |
| | |
| | | initialState: [], |
| | | targetState: null, |
| | | successMsg: '文件导出成功!', |
| | | gridRef: xGrid, // 将xGrid的引用传递进来,用于调用exportData方法 |
| | | gridRef: xGrid, |
| | | requiresRow: false, |
| | | }, |
| | | { |
| | | code: 'viewTempered', |
| | | initialState: [], |
| | | targetState: null, |
| | | successMsg: '钢化版图已打开!', |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | }, |
| | | { |
| | | code: 'viewOptimize', |
| | | initialState: [], |
| | | targetState: null, |
| | | successMsg: '优化版图已打开!', |
| | | failureMsg: '工程删除失败,请联系管理员!', |
| | | } |
| | | ]; |
| | | function getOriginalState(targetState) { |
| | |
| | | if ($grid) { |
| | | const config = operationConfigs.find(c => c.code === menu.code); |
| | | if (config) { |
| | | if (config.requiresRow &&!row) { |
| | | ElMessage.warning('未选中工程,请选中工程后再进行当前操作!'); |
| | | return; |
| | | } |
| | | if (config.code === 'Export') { |
| | | config.gridRef.value.exportData(); |
| | | ElMessage.success(config.successMsg); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (config.code === 'viewTempered'){ |
| | | ElMessageBox.alert('当前点击的是查看钢化版图功能,目前暂时仅做提示,暂无实际查看操作!', '功能提示', { |
| | | confirmButtonText: '我知道了' |
| | | }); |
| | | return; |
| | | } |
| | | if (config.code === 'viewOptimize'){ |
| | | ElMessageBox.alert('当前点击的是查看钢化版图功能,目前暂时仅做提示,暂无实际查看操作!', '功能提示', { |
| | | confirmButtonText: '我知道了' |
| | | }); |
| | | return; |
| | | } |
| | | if (config.code === 'delproject') { |
| | |
| | | updateProjectStateAndHandleResponse(row, row.projectNumber, config.targetState, config.successMsg); |
| | | } |
| | | } |
| | | }).catch(() => { |
| | | // 用户点击取消后执行的逻辑 |
| | | ElMessage.info('已取消操作'); |
| | | }); |
| | | } else { |
| | | console.error(`未找到操作选项 ${menu.code} 对应的配置,请检查配置项`); |
| | | } |
| | |
| | | }, |
| | | { |
| | | value: '100', |
| | | label: '完成优化', |
| | | label: '允许生产', |
| | | }, |
| | | { |
| | | value: '200', |