修改禅道bug

This commit is contained in:
2025-11-19 16:50:24 +08:00
parent c845aabb1b
commit 96f8ae2af0
9 changed files with 68 additions and 23 deletions

View File

@ -20,12 +20,10 @@ declare module 'vue' {
ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']

View File

@ -104,7 +104,7 @@ service.interceptors.response.use(
pendingRequests.delete(key)
}
// 统一错误处理
const {response} = error
const { response } = error
if (response) {
return Promise.reject(response)

View File

@ -147,9 +147,20 @@ const getTableList = async () => {
}
getTableList()
eventBus.on('addOptionResuit', () => {
let func = () => {
console.log('111111')
getTableList()
}
// eventBus.on('addOptionResuit', () => {
// console.log('111111')
// getTableList()
// })
onMounted(() => {
eventBus.on('addOptionResuit', func)
})
onUnmounted(() => {
eventBus.off('addOptionResuit', func)
})
//------------------添加--------------------
@ -232,7 +243,6 @@ const attachUpload = async () => {
const params = new URLSearchParams()
params.append('filePath', path[0])
deviceApi.uploadSingle(params).then((res) => {
console.log(res, 'res')
ElMessage.success('导入成功')
getTableList()
})

View File

@ -23,10 +23,16 @@
</div>
<div class="nav_table">
<el-table :data="tableData" height="40vh" style="width: 100%">
<el-table
:data="tableData"
:header-cell-style="{ 'text-align': 'center' }"
height="40vh"
style="width: 100%"
>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="name" label="名称" />
<el-table-column prop="num" label="总计数量" width="120" />
<el-table-column prop="num" label="总计数量" />
<el-table-column prop="unit" label="单位" />
<el-table-column fixed="right" label="操作" width="160">
<template #default="scope">
<el-button type="primary" size="small" @click="edit('编辑物资', scope.row)">
@ -116,9 +122,15 @@ const getTableList = async () => {
}
getTableList()
eventBus.on('addOptionResuit2', () => {
let func = () => {
getTableList()
}
onMounted(() => {
eventBus.on('addOptionResuit2', func)
})
onUnmounted(() => {
eventBus.off('addOptionResuit2', func)
})
//------------------添加--------------------
@ -144,7 +156,7 @@ var edit = (type, row) => {
addForm = JSON.parse(JSON.stringify(row))
// addForm.areaId = +row.areaId
}
eventBus.emit('openAddMaterial', { title: type, data: addForm })
eventBus.emit('openAddMaterial', { title: row ? 'edit' : 'add', data: addForm })
}
var delFun = (row) => {

View File

@ -25,7 +25,7 @@
</el-button>
</div>
<el-input
v-model="photoName"
v-model.trim="photoName"
style="max-width: 150px"
placeholder="请输入模型名称进行搜索"
class="input-with-select"
@ -97,7 +97,7 @@
<template #default="{ row }">
<el-image
style="width: 80px; height: 60px"
:src="service + row.posterDataUrl"
:src="service + row.posterDataUrl + '?t=' + row.updatedAt"
fit="contain"
/>
</template>
@ -132,7 +132,7 @@
<!-- 添加类型弹窗 -->
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30%" :before-close="handleClose">
<el-input v-model="modelType" placeholder="请输入模型类型名称" />
<el-input v-model.trim="modelType" placeholder="请输入模型类型名称" />
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
@ -522,7 +522,9 @@ const toggleExpand = (row: any) => {
// loadModelsByType(row.id)
contextMenu.visible && (contextMenu.visible = false)
}
let clickTypeId = null //存储点击数据,用来删除时更新右侧列表
const getModelListByType = (id) => {
clickTypeId = id
let formData = new FormData()
formData.append('modelTypeId', id)
ModelApi.showModelByType(formData).then((res) => {
@ -624,11 +626,16 @@ const handleDeleteType = (row: TypeNode) => {
})
.then(() => {
let formData = new FormData()
formData.append('modelTypeId', row.id)
ModelApi.delModelType(formData).then((res) => {
if (res.code == 0 || res.code == 200) {
ElMessage.success('删除成功')
getModelList()
//如果删除当前选中数据 清空右侧列表
if (row.id === clickTypeId) {
modelList.value = []
}
}
})
})

View File

@ -146,6 +146,7 @@ var submitProtal = () => {
if (res.code === 200) {
ElMessage.success('操作成功')
console.log('ccccccccc')
eventBus.emit('addOptionResuit')
}
} else {

View File

@ -9,15 +9,18 @@
>
<template #content>
<el-form
label-width="0px"
label-width="80px"
style="width: 300px"
:model="addForm"
:rules="peopleRules"
ref="peopleFormRef"
>
<el-form-item label="" prop="name">
<el-form-item label="物资名称" prop="name">
<el-input v-model.trim="addForm.name" placeholder="请输入物资名称" clearable />
</el-form-item>
<el-form-item label="物资单位" prop="unit">
<el-input v-model.trim="addForm.unit" placeholder="请输入物资单位" clearable />
</el-form-item>
</el-form>
</template>
<template #footer>
@ -46,11 +49,13 @@ var addTitle = ref('')
var peopleFormRef: any = ref('')
var addForm: any = ref({
name: ''
name: '',
unit: ''
})
const peopleRules: any = reactive({
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
unit: [{ required: true, message: '请输入单位', trigger: 'blur' }]
})
var cancel = () => {
@ -68,12 +73,14 @@ var submitProtal = () => {
const res = await MaterialApi.add(addForm.value)
if (res.code === 200) {
ElMessage.success('操作成功')
console.log('aaaaaaaaaaaaa')
eventBus.emit('addOptionResuit2')
}
} else {
const res = await MaterialApi.update(addForm.value)
if (res.code === 200) {
ElMessage.success('操作成功')
console.log('bbbbbbbbbbbb')
eventBus.emit('addOptionResuit2')
}
}
@ -87,13 +94,15 @@ var submitProtal = () => {
}
eventBus.on('openAddMaterial', (params) => {
console.log(params, 'iuiuuiuiu')
addTitle.value = params.title
if (addTitle.value != '添加物资') {
addTitle.value = params.title == 'add' ? '添加物资' : '修改物资'
if (params.title == 'edit') {
addForm.value.name = params.data.name
addForm.value.unit = params.data.unit
addForm.value.id = params.data.id
} else {
addForm.value = {
name: ''
name: '',
unit: ''
}
}
baseDialog.value?.open()

View File

@ -13,6 +13,12 @@
<div class="imageCon" ref="threeCanvas">
<!-- <img class="image" :src="rowData.thumbnail" alt="" /> -->
</div>
<span
class="label"
style="display: inline-block; height: 30px; line-height: 30px; padding-left: 10px"
>属性信息</span
>
<span class="custom-divider"></span>
<div class="inputCon">
<span class="label">模型名称</span>
<input class="input" maxlength="40" type="text" v-model="rowData.name" />
@ -21,7 +27,9 @@
</template>
<template #footer>
<div style="position: absolute; left: -400px; display: flex">
<button @click="setImage">设置预览图</button>
<button @click="setImage">
<svg-icon name="sys_set" :size="14" style="margin-top: -1px"></svg-icon>设置预览图
</button>
</div>
<button @click="save">保存</button>
<button @click="close">关闭</button>