diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts index a8fa0f1..47ab284 100644 --- a/src/api/eqpt/device/model.ts +++ b/src/api/eqpt/device/model.ts @@ -20,11 +20,10 @@ }) } // 设备名称列表/equipment/model/listEquipmentName -export function getDeviceNameList(params: any) { +export function getDeviceNameList() { return request({ url: '/equipment/model/listEquipmentName', method: 'get', - params, }) } // 导出 diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts index a8fa0f1..47ab284 100644 --- a/src/api/eqpt/device/model.ts +++ b/src/api/eqpt/device/model.ts @@ -20,11 +20,10 @@ }) } // 设备名称列表/equipment/model/listEquipmentName -export function getDeviceNameList(params: any) { +export function getDeviceNameList() { return request({ url: '/equipment/model/listEquipmentName', method: 'get', - params, }) } // 导出 diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts index 1365711..0720b82 100644 --- a/src/api/system/expire.ts +++ b/src/api/system/expire.ts @@ -18,3 +18,11 @@ data, }) } +// 删除 + +export function delRemind(id: string) { + return request({ + url: `/system/remind/remove?id=${id}`, + method: 'post', + }) +} diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts index a8fa0f1..47ab284 100644 --- a/src/api/eqpt/device/model.ts +++ b/src/api/eqpt/device/model.ts @@ -20,11 +20,10 @@ }) } // 设备名称列表/equipment/model/listEquipmentName -export function getDeviceNameList(params: any) { +export function getDeviceNameList() { return request({ url: '/equipment/model/listEquipmentName', method: 'get', - params, }) } // 导出 diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts index 1365711..0720b82 100644 --- a/src/api/system/expire.ts +++ b/src/api/system/expire.ts @@ -18,3 +18,11 @@ data, }) } +// 删除 + +export function delRemind(id: string) { + return request({ + url: `/system/remind/remove?id=${id}`, + method: 'post', + }) +} diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index f71ee79..1e6757a 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -40,7 +40,8 @@ const token = userStore.token const params = `?token=${token}` console.log(token, 'token') - window.location.href = system.url + params + // window.location.href = system.url + params + window.open(system.url + params) } else { localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts index a8fa0f1..47ab284 100644 --- a/src/api/eqpt/device/model.ts +++ b/src/api/eqpt/device/model.ts @@ -20,11 +20,10 @@ }) } // 设备名称列表/equipment/model/listEquipmentName -export function getDeviceNameList(params: any) { +export function getDeviceNameList() { return request({ url: '/equipment/model/listEquipmentName', method: 'get', - params, }) } // 导出 diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts index 1365711..0720b82 100644 --- a/src/api/system/expire.ts +++ b/src/api/system/expire.ts @@ -18,3 +18,11 @@ data, }) } +// 删除 + +export function delRemind(id: string) { + return request({ + url: `/system/remind/remove?id=${id}`, + method: 'post', + }) +} diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index f71ee79..1e6757a 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -40,7 +40,8 @@ const token = userStore.token const params = `?token=${token}` console.log(token, 'token') - window.location.href = system.url + params + // window.location.href = system.url + params + window.open(system.url + params) } else { localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue new file mode 100644 index 0000000..470ca33 --- /dev/null +++ b/src/views/system/expire/device.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/.env.development b/.env.development index f2fee42..19ebebf 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.101:5909 +VITE_APP_API_BASEURL = http://192.168.8.100:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 # VITE_APP_API_BASEURL = http://192.168.8.107:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 diff --git a/.env.production b/.env.production index 7595683..36e6ad3 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://127.0.0.1:5909 +VITE_APP_API_BASEURL = http://111.198.10.15:21611 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index 313fcf7..13aa1a9 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.101:5909" + "baseUrl": "http://192.168.8.100:5909" } diff --git a/src/api/eqpt/device/model.ts b/src/api/eqpt/device/model.ts index a8fa0f1..47ab284 100644 --- a/src/api/eqpt/device/model.ts +++ b/src/api/eqpt/device/model.ts @@ -20,11 +20,10 @@ }) } // 设备名称列表/equipment/model/listEquipmentName -export function getDeviceNameList(params: any) { +export function getDeviceNameList() { return request({ url: '/equipment/model/listEquipmentName', method: 'get', - params, }) } // 导出 diff --git a/src/api/system/expire.ts b/src/api/system/expire.ts index 1365711..0720b82 100644 --- a/src/api/system/expire.ts +++ b/src/api/system/expire.ts @@ -18,3 +18,11 @@ data, }) } +// 删除 + +export function delRemind(id: string) { + return request({ + url: `/system/remind/remove?id=${id}`, + method: 'post', + }) +} diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index f71ee79..1e6757a 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -40,7 +40,8 @@ const token = userStore.token const params = `?token=${token}` console.log(token, 'token') - window.location.href = system.url + params + // window.location.href = system.url + params + window.open(system.url + params) } else { localStorage.setItem('currentSys', JSON.stringify({ name: system.name, code: system.code })) diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue new file mode 100644 index 0000000..470ca33 --- /dev/null +++ b/src/views/system/expire/device.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/src/views/system/expire/edit.vue b/src/views/system/expire/edit.vue index 72d45f9..bfd1272 100644 --- a/src/views/system/expire/edit.vue +++ b/src/views/system/expire/edit.vue @@ -3,11 +3,14 @@ import { nextTick, reactive } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' +import device from './device.vue' +import task from './task.vue' import { getList, updateRemind } from '@/api/system/expire' // ----------------------- 以下是字段定义 emits props --------------------- const emits = defineEmits(['closeRefresh']) const dialogVisible = ref(false) +const dialogStatus = ref('新建') const data = ref({ createDeptId: 0, createDeptName: '', @@ -16,15 +19,30 @@ createUserName: '', id: '', remindName: '', - remindTime: 0, + remindTime: 30, updateTime: '', + remindType: '1', + taskIds: [] as string[], + taskNames: [] as string[], + equipmentNames: [] as string[], + modelIds: [] as string[], + equipmentExt: [] as string[], + taskExt: [] as string[], + }) // ---------------表单提交-------------------------------- // 表单对象 const dataFormRef = ref() - +const rules = ref({ + remindName: [{ required: true, message: '提醒名称必填', trigger: ['blur', 'change'] }], + remindType: [{ required: true, message: '到期提醒类型必选', trigger: ['blur', 'change'] }], + modelIds: [{ required: true, message: '设备必选', trigger: ['blur', 'change'] }], + taskIds: [{ required: true, message: '任务必选', trigger: ['blur', 'change'] }], + remindTime: [{ required: true, message: '提醒时间必选', trigger: ['blur', 'change'] }], +}) // 表单验证规则 // 表单提交 function submitForm() { + console.log(data.value, 'data.value') if (dataFormRef) { dataFormRef.value?.validate((valid: boolean) => { if (valid) { @@ -39,9 +57,18 @@ } // ----------初始化、关闭对话框相关----------------- -function initDialog(row: any) { +function initDialog(row: any, status: string) { dialogVisible.value = true - data.value = row + if (status === 'create') { + dialogStatus.value = '新建' + nextTick(() => { + dataFormRef.value?.resetFields() + }) + } + else { + data.value = row + dialogStatus.value = '编辑' + } } // 关闭并刷新 @@ -55,30 +82,139 @@ } // ----------------------- 以下是暴露的方法内容 ---------------------------- defineExpose({ initDialog }) + +// 选择设备 +const deviceRef = ref() +const selectDevice = () => { + deviceRef.value.initDialog() +} +// 确认设备 +const confirmDevice = (list: any[]) => { + console.log(list, '选中的设备') + list.forEach((item: any) => { + if (!data.value.modelIds.includes(item.id)) { + data.value.equipmentExt.push(`${item.equipmentName}/${item.model}/${item.helpInstruction}`) + data.value.modelIds.push(item.id) + } + }) +} +const removeDeviceStr = ref() +const removeDevice = (device: string) => { + removeDeviceStr.value = device +} +watch(() => data.value.equipmentExt, (newVal, oldVal) => { + if (newVal && oldVal) { + if (newVal.length < oldVal.length) { + const index = oldVal.indexOf(removeDeviceStr.value) + data.value.modelIds = data.value.modelIds.filter((item, cindex) => cindex !== index) + } + } +}, { + deep: true, +}) +// 选择任务 +const taskRef = ref() +const selectTask = () => { + taskRef.value.initDialog() +} +// 确认设备 +const confirmTask = (list: any[]) => { + console.log(list, '选中的任务') + list.forEach((item: any) => { + if (!data.value.taskIds.includes(item.id)) { + data.value.taskExt.push(item) + data.value.taskIds.push(item.id) + } + }) +} +const removeTaskStr = ref() +const removeTask = (device: string) => { + removeDeviceStr.value = device +} +watch(() => data.value.taskExt, (newVal, oldVal) => { + if (newVal && oldVal) { + if (newVal.length < oldVal.length) { + const index = oldVal.indexOf(removeTaskStr.value) + data.value.taskIds = data.value.taskIds.filter((item, cindex) => cindex !== index) + } + } +}, { + deep: true, +})