工程信息管理添加删除功能
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
<template>
|
||||
<div class="default-main" :style="{ height: pageHeight.height }">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="tableStore.table.data"
|
||||
:column-config="{ resizable: true }"
|
||||
:tree-config="{expandAll: true }"
|
||||
>
|
||||
<vxe-table v-loading="tableStore.table.loading" height="auto" auto-resize ref="tableRef"
|
||||
v-bind="defaultAttribute" :data="tableStore.table.data" :column-config="{ resizable: true }"
|
||||
:tree-config="{ expandAll: true }">
|
||||
<vxe-column field="name" align="left" title="名称" tree-node></vxe-column>
|
||||
<vxe-column field="area" title="区域">
|
||||
<template #default="{ row }">
|
||||
@@ -21,6 +14,15 @@
|
||||
{{ row.remark || '/' }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="remark" title="操作" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="deletes(row)" v-if="!row.path">
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
@@ -29,6 +31,9 @@ import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { auditEngineering } from '@/api/cs-device-boot/edData';
|
||||
import { activateUser, deluser, passwordConfirm } from '@/api/user-boot/user'
|
||||
defineOptions({
|
||||
name: 'govern/manage/engineering'
|
||||
})
|
||||
@@ -40,17 +45,48 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
column: [],
|
||||
|
||||
loadCallback: () => {}
|
||||
loadCallback: () => {
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 500)
|
||||
// setTimeout(() => {
|
||||
// tableRef.value.setAllTreeExpand(true)
|
||||
// }, 500)
|
||||
})
|
||||
const deletes = (row: any) => {
|
||||
ElMessageBox.prompt('二次校验密码确认', '', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
customClass: 'customInput',
|
||||
inputType: 'text'
|
||||
}).then(({ value }) => {
|
||||
passwordConfirm(value).then(res => {
|
||||
auditEngineering({
|
||||
id: row.id,
|
||||
status: 0
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const addMenu = () => {}
|
||||
|
||||
}
|
||||
|
||||
const addMenu = () => { }
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.customInput {
|
||||
.el-input__inner {
|
||||
-webkit-text-security: disc !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user