|
@ -226,6 +226,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
import {defaultAddStaticBtn} from "@/utils/disposition/defaultButtons"; |
|
|
import {defaultAddStaticBtn} from "@/utils/disposition/defaultButtons"; |
|
|
|
|
|
import {releaseMoving, releaseStatic} from "@/api/battery/monomer"; |
|
|
|
|
|
|
|
|
defineOptions({ name: 'CellDevice' }) |
|
|
defineOptions({ name: 'CellDevice' }) |
|
|
|
|
|
|
|
@ -263,7 +264,7 @@ const HeadButttondata = [ |
|
|
defaultButtons.defaultAddStaticBtn({hasPermi:'battery:monomer:update'}), // 静态数据 |
|
|
defaultButtons.defaultAddStaticBtn({hasPermi:'battery:monomer:update'}), // 静态数据 |
|
|
defaultButtons.defaultAddBtn({hasPermi:'battery:monomer:create'}), // 新增 |
|
|
defaultButtons.defaultAddBtn({hasPermi:'battery:monomer:create'}), // 新增 |
|
|
// defaultButtons.defaultImportBtn({hasPermi:'battery:cellDevice:import'}), // 导入 |
|
|
// defaultButtons.defaultImportBtn({hasPermi:'battery:cellDevice:import'}), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'battery:monomer:export'}), // 导出 |
|
|
// defaultButtons.defaultExportBtn({hasPermi:'battery:monomer:export'}), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
// defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
// defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
@ -293,13 +294,23 @@ const buttonBaseClick = (val, item) => { |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// isShowButton |
|
|
|
|
|
const isShowButton = (row,val) => { |
|
|
|
|
|
if (row.type == 'static') { |
|
|
|
|
|
return false |
|
|
|
|
|
} else if (row.sending == '0') { |
|
|
|
|
|
return false |
|
|
|
|
|
} else{ |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row,$index) => { |
|
|
const butttondata = (row,$index) => { |
|
|
|
|
|
|
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'battery:monomer:update'}), // 编辑 |
|
|
defaultButtons.mainListEditBtn({hide:isShowButton(row,['FALSE']),hasPermi:'battery:monomer:update'}), // 编辑 |
|
|
defaultButtons.mainListReleaseBtn({hide:(row.release =='0' || row.type !='static'),hasPermi:'battery:monomer:update'}), // 发布 |
|
|
defaultButtons.mainListReleaseBtn({hide:isShowButton(row,['FALSE']),hasPermi:'battery:monomer:update'}), // 发布 |
|
|
defaultButtons.mainListDeleteBtn({hide:row.type =='static' ,hasPermi:'battery:monomer:delete'}), // 删除 |
|
|
defaultButtons.mainListDeleteBtn({hide:row.type =='static' ,hasPermi:'battery:monomer:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
@ -307,10 +318,11 @@ const butttondata = (row,$index) => { |
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'edit') { // 编辑 |
|
|
|
|
|
|
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
|
|
|
}else if (val == 'release') { // 发布 |
|
|
|
|
|
handleRelease(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -410,6 +422,23 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicCellDevice') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicCellDevice') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleRelease = async (row?: any) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// 删除的二次确认 |
|
|
|
|
|
await message.releaseConfirm() |
|
|
|
|
|
// 发起删除 |
|
|
|
|
|
if(row.type == 'static'){ |
|
|
|
|
|
await MonomerApi.releaseStatic(row); |
|
|
|
|
|
}else{ |
|
|
|
|
|
await MonomerApi.releaseMoving(row); |
|
|
|
|
|
} |
|
|
|
|
|
message.success('发送成功') |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
const handleDelete = async (id: number) => { |
|
|
const handleDelete = async (id: number) => { |
|
|
try { |
|
|
try { |
|
|