From 32036b116096d852c7371dbbab43f23559b69c32 Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Wed, 29 Jul 2026 16:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/illustrated.ts | 36 +- src/api/nccode.ts | 1 + src/utils/request.ts | 6 +- src/views/NCcode/index.vue | 162 ++++---- src/views/lllustrated/index.vue | 685 +++++++++++++++++++++----------- vite.config.ts | 2 +- 7 files changed, 596 insertions(+), 300 deletions(-) diff --git a/.env.development b/.env.development index 441908a..a3d6602 100644 --- a/.env.development +++ b/.env.development @@ -9,10 +9,10 @@ VITE_APP_ENV = 'development' #VITE_APP_BASE_API = 'http://192.168.12.4:8888/api' #VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway' -VITE_APP_BASE_API = 'http://localhost/api' +#VITE_APP_BASE_API = 'http://localhost/api' #VITE_APP_BASE_API = 'http://localhost:9100/gateway' -#VITE_APP_BASE_API = '/dev-api' +VITE_APP_BASE_API = '/api' diff --git a/src/api/illustrated.ts b/src/api/illustrated.ts index 5054de1..83236e5 100644 --- a/src/api/illustrated.ts +++ b/src/api/illustrated.ts @@ -23,7 +23,7 @@ export function editDrawing(data:any) { //列表 export function drawinglist(params:any) { return request({ - url: `/biz/ncCode/page`, + url: `/biz/drawingFile/page`, method: 'get', params }) @@ -45,3 +45,37 @@ export function deleteDrawing(ids:any) { method: 'delete' }) } + +//生成图纸编号 +export function generateDFCode() { + return request({ + url: `/biz/drawingFile/generateDFCode`, + method: 'get' + }) +} + +//导出 +export function exportdraFile(params:any) { + return request({ + url: `biz/drawingFile/export`, + method: 'get', + responseType: 'blob', + params + }) +} + +//任务树 +export function opertree() { + return request({ + url: `biz/ncCode/operationTree`, + method: 'get' + }) +} + +//查询已上传文件 +export function filelist(id:any) { + return request({ + url: `sys/file/${id}`, + method: 'get' + }) +} diff --git a/src/api/nccode.ts b/src/api/nccode.ts index 1de4ba7..0160396 100644 --- a/src/api/nccode.ts +++ b/src/api/nccode.ts @@ -88,6 +88,7 @@ export function exportNccode(params:any) { return request({ url: `biz/ncCode/export`, method: 'get', + responseType: 'blob', params }) } diff --git a/src/utils/request.ts b/src/utils/request.ts index 7c07d4b..59d5edf 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,7 +1,7 @@ import axios, { type AxiosInstance, type AxiosRequestConfig, type AxiosResponse } from 'axios' import { useUserStore } from '@/stores/user' -// const BASE_API = import.meta.env.VITE_APP_BASE_API +const BASE_API = import.meta.env.VITE_APP_BASE_API // API响应结构 interface ApiResponse { @@ -116,7 +116,8 @@ async function decryptResponseData(data: string): Promise { // 创建axios实例 // 后端 API 统一使用 /api 前缀 const service: AxiosInstance = axios.create({ - baseURL:'/api', + //baseURL:'/api', + baseURL:BASE_API, timeout: 30000 }) @@ -158,7 +159,6 @@ service.interceptors.response.use( return response.data } - const res = response.data if (res.code !== 200) { diff --git a/src/views/NCcode/index.vue b/src/views/NCcode/index.vue index 972f49e..b7f6bc4 100644 --- a/src/views/NCcode/index.vue +++ b/src/views/NCcode/index.vue @@ -210,32 +210,40 @@ - - - + + @@ -280,7 +288,8 @@ import { issuecopy, generateNccode, opertree, - exportNccode + exportNccode, + deleteIssue } from '@/api/nccode' const dialog = useDialog() @@ -302,8 +311,8 @@ const searchForm = reactive({ page: 1, pageSize: 20, ncCode:'', - ncName:'', - status:1 + ncName:'' + //status:1 }) @@ -385,7 +394,7 @@ const columns = [ key:"isIssued", minWidth:150, render(row:any) { - if(row.isIssued == 1){ + if(row.isSued== 1){ return '已下发' } return '未下发' @@ -401,7 +410,7 @@ const columns = [ { align:"center", title:"下发人", - key:"issueBy", + key:"issueName", minWidth:150 }, { @@ -426,7 +435,7 @@ const columns = [ type:'info', ghost:true, onClick: () => { - issuehand() + issuehand(row) } }, { default: () => '下发'} )) @@ -505,7 +514,8 @@ function search() { //重置 function reset() { - + searchForm.ncCode = '' + searchForm.ncName = '' } //获取列表数据 @@ -558,9 +568,9 @@ let formData = reactive({ deviceId:'', //设备ID deviceName:'', //设备名称 status:1, //状态:1-启用 0-禁用 - // isIssued:1, //是否已下发:1-已下发 0-未下发 - // issueTime:null, //下发时间 - // issueBy:'', //下发人 + // isIssued:1, //是否已下发:1-已下发 0-未下发 + // issueTime:null, //下发时间 + // issueBy:'', //下发人 remark:'' //备注 }) const addrules = { @@ -596,11 +606,6 @@ function addhand(type:any,row?:any) { addModel.value = true formData.value?.restoreValidation() isstype.value = type - if(type == 1 || type == 3){ - generateNccode().then(rps => { - formData.ncCode = rps - }) - } if(row){ formData.id = row.id @@ -633,6 +638,11 @@ function addhand(type:any,row?:any) { // formData.issueBy = '' formData.remark = '' } + if(type == 1 || type == 3){ + generateNccode().then(rps => { + formData.ncCode = rps + }) + } } function addEdi(){ @@ -694,7 +704,7 @@ function delhand() { //let issequiplist = ref([]) let treeData:any = [] -let value = ref>([]) +let xfsbvalue = ref>([]) let renderSourceList:any = '' let options = ref([]) //flattenTree(createData()) @@ -716,10 +726,6 @@ function flattenTree(list: undefined | any[]) { } -function tranupdate(v:any) { - console.log(v) -} - //下发 let issueModel = ref(false) // let issformData = reactive({ @@ -739,30 +745,44 @@ let issueModel = ref(false) -function renderlabe() {} - -function issuehand() { - - issueModel.value = true - - +let issarr:any[] = [] +let ncCode = ref('') +function tranupdate(v:any) { + issarr = [] + if(v.length > 0){ + v.forEach((n:any) => { + if(n.split('-').length == 3){ + issarr.push(n) + } + }) + } +} + +let ncid = '' +function issuehand(row:any) { + issueModel.value = true + issarr = [] + ncid = row.id + ncCode.value = row.code } -const issformRef = ref() function isssavehand() { - issformRef.value?.validate((e:any) => { - if (!e) { - batchIssue('').then(() => { - message.success('操作成功') - setTimeout(() => { - getlist() - issueModel.value = false - },1500) - }) - - } + if(issarr.length > 0){ + batchIssue({ + ncCode:ncid, + ncCodeList:issarr + }).then(() => { + message.success('操作成功') + setTimeout(() => { + getlist() + issueModel.value = false + },1500) }) + }else{ + message.warning('请选择设备') + } + } //导出 //let selectedIds = ref([]) @@ -783,10 +803,10 @@ function handleExport() { getlist() //查看下发记录 -async function handleDispatchRecord(row:ncCode){ - const ncId = row.id - // ncDispatchRecords.value = await -} +// async function handleDispatchRecord(row:ncCode){ +// const ncId = row.id +// // ncDispatchRecords.value = await +// } onMounted(() => { @@ -795,7 +815,6 @@ onMounted(() => { opertree().then(rps => { treeData = rps options.value = flattenTree(treeData) - console.log(rps,'112') renderSourceList = function (obj:any) { return h(NTree, { style: 'margin: 0 4px;', @@ -809,10 +828,9 @@ onMounted(() => { cascade:true, defaultExpandAll:true, pattern:obj.pattern, - checkedKeys: value.value, - onUpdateCheckedKeys: (checkedKeys: Array) => { + checkedKeys: xfsbvalue.value, + onUpdateCheckedKeys: (checkedKeys:any) => { obj.onCheck(checkedKeys) - console.log(value.value,'tree') } }) } diff --git a/src/views/lllustrated/index.vue b/src/views/lllustrated/index.vue index 6d08291..ff6fd8f 100644 --- a/src/views/lllustrated/index.vue +++ b/src/views/lllustrated/index.vue @@ -10,15 +10,15 @@ label-placement="left" > - - + + - - - - - + @@ -35,7 +35,7 @@ - + 删除 --> - +