|
@@ -31,7 +31,7 @@
|
|
|
<el-button type="warning" class="ml-2" @click="importClick">导入</el-button>
|
|
|
<el-button v-yes-com:[deriveTableItem] type="primary" class="ml-2" :disabled="tableCheckKeys.length <= 0">批量导出</el-button>
|
|
|
</template>
|
|
|
- <HcTableList ref="tableRef" is-admin :datas="tableData" @tap="rowNameClick" @check="tableCheck" />
|
|
|
+ <HcTableList ref="tableRef" is-admin :datas="tableData" @tap="rowNameClick" @check="tableCheck" @change="searchClick" />
|
|
|
<template #action>
|
|
|
<div>建设规模:共计 xx 公里</div>
|
|
|
<hc-pages :pages="searchForm" @change="pageChange" />
|
|
@@ -88,7 +88,7 @@
|
|
|
<script setup>
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
import HcTableList from '../modules/project-list.vue'
|
|
|
-import { getArrValue } from 'js-fast-way'
|
|
|
+import { arrToId, getArrValue } from 'js-fast-way'
|
|
|
import mainApi from '~api/project/project'
|
|
|
import { getDictionaryData } from '~src/utils/tools'
|
|
|
|
|
@@ -160,9 +160,17 @@ const rowNameClick = (row) => {
|
|
|
}
|
|
|
|
|
|
//批量删除
|
|
|
-const delTableItem = (_, resolve) => {
|
|
|
- tableRef.value?.batchRemove()
|
|
|
- resolve()
|
|
|
+//批量删除
|
|
|
+const delTableItem = async (_, resolve) => {
|
|
|
+ const ids = arrToId(tableCheckKeys.value)
|
|
|
+ const { error, code, msg } = await mainApi.del(ids)
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message.success('删除成功')
|
|
|
+ resolve()
|
|
|
+ searchClick()
|
|
|
+ } else {
|
|
|
+ window.$message.error(msg ?? '删除失败')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//批量导出
|