|
@@ -62,7 +62,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="tsx" setup>
|
|
|
-import app from '@/api/system/app'
|
|
|
+import department from '@/api/system/department'
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
|
import { ElMessage, ElTree } from 'element-plus'
|
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
@@ -135,7 +135,7 @@ const queryList = async () => {
|
|
|
const { options, searchParams } = tableOpts
|
|
|
options.loading = true
|
|
|
try {
|
|
|
- const { records: list, total } = await app.appPageApi(searchParams)
|
|
|
+ const { records: list, total } = await department.departmentPageApi(searchParams)
|
|
|
tableOpts.total = total
|
|
|
tableOpts.list = list
|
|
|
} catch {
|
|
@@ -148,6 +148,11 @@ const queryList = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const selectionChange = e => {
|
|
|
+ // console.error('click 测试', e)
|
|
|
+ console.log(e, 'selectionChange')
|
|
|
+}
|
|
|
+
|
|
|
// table 参数
|
|
|
const columns = [
|
|
|
{
|
|
@@ -213,7 +218,9 @@ const columns = [
|
|
|
const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows, updateParams } = useTablePage(
|
|
|
{
|
|
|
options: {
|
|
|
- showIndex: false
|
|
|
+ showIndex: false,
|
|
|
+ treeProps: { children: 'children', hasChildren: 'hasChildren' },
|
|
|
+ onSelectionChange: selectionChange
|
|
|
},
|
|
|
// 需要展示的列
|
|
|
columns,
|
|
@@ -231,7 +238,7 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
|
|
|
// 删除
|
|
|
const deleteItem = async ids => {
|
|
|
try {
|
|
|
- await app.appDeleteApi(ids)
|
|
|
+ await department.departmentDeleteApi(ids)
|
|
|
updateParams()
|
|
|
} catch (e) {
|
|
|
console.log('删除失败')
|
|
@@ -261,9 +268,8 @@ const submitHandler = async params => {
|
|
|
formOptions.value.formConfig.submitLoading = true
|
|
|
try {
|
|
|
params.status = params.status ? 1 : 0
|
|
|
- params.expire = params.expire + ' 00:00:00'
|
|
|
params.id = activeData.value.id ? activeData.value.id : null
|
|
|
- await app.appAddOrEditSaveApi(params)
|
|
|
+ await department.departmentAddOrEditSaveApi(params)
|
|
|
ElMessage.success(`${isCreate.value ? '新增' : '修改'}成功~`)
|
|
|
visible.value = false
|
|
|
updateParams()
|