|
|
|
|
@ -1,19 +1,27 @@
@@ -1,19 +1,27 @@
|
|
|
|
|
<template> |
|
|
|
|
<EdfsWrap class="wh-full" :title="'工程列表'" :use-scroll-bar="false"> |
|
|
|
|
<EdfsWrap :title="'工程列表'" :use-scroll-bar="false" class="wh-full"> |
|
|
|
|
<template #title-right> |
|
|
|
|
<div v-if="!isBatchMode"> |
|
|
|
|
<el-button type="danger" plain @click="enterBatchMode"> 批量删除 </el-button> |
|
|
|
|
<el-button plain type="danger" @click="enterBatchMode">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
:disabled="selectedItems.length === 0" |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleBatchDelete" |
|
|
|
|
> |
|
|
|
|
确认删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button @click="exitBatchMode">取消</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-button |
|
|
|
|
v-if="!isBatchMode" |
|
|
|
|
plain |
|
|
|
|
type="primary" |
|
|
|
|
class="ml-2" |
|
|
|
|
@click="importEngineering" |
|
|
|
|
>导入工程</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<div class="engineering-list-container"> |
|
|
|
|
<el-checkbox-group v-model="selectedItems" class="engineering-grid"> |
|
|
|
|
@ -30,21 +38,21 @@
@@ -30,21 +38,21 @@
|
|
|
|
|
<div class="card-header"> |
|
|
|
|
<div class="flex items-center gap-2 flex-1 overflow-hidden"> |
|
|
|
|
<el-checkbox v-if="isBatchMode" :value="item.name" @click.stop> |
|
|
|
|
<span class="card-title" :title="item.name" |
|
|
|
|
<span :title="item.name" class="card-title" |
|
|
|
|
>工程名称:{{ item.name }}</span |
|
|
|
|
> |
|
|
|
|
</el-checkbox> |
|
|
|
|
<div v-else class="h-32 leading-32px"> |
|
|
|
|
<span class="card-title" :title="item.name" |
|
|
|
|
<span :title="item.name" class="card-title" |
|
|
|
|
>工程名称:{{ item.name }}</span |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-button |
|
|
|
|
link |
|
|
|
|
type="danger" |
|
|
|
|
v-if="!isBatchMode" |
|
|
|
|
:icon="Delete" |
|
|
|
|
link |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete(item)" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
@ -52,12 +60,12 @@
@@ -52,12 +60,12 @@
|
|
|
|
|
<p class="card-desc">工程描述:{{ item.description }}</p> |
|
|
|
|
</div> |
|
|
|
|
<div class="card-footer"> |
|
|
|
|
<el-button type="primary" text @click="handleDownload(item)" |
|
|
|
|
>下载工程</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" text @click="enterEngineering(item)" |
|
|
|
|
>进入工程</el-button |
|
|
|
|
> |
|
|
|
|
<el-button text type="primary" @click="handleDownload(item)" |
|
|
|
|
>下载工程 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button text type="primary" @click="enterEngineering(item)" |
|
|
|
|
>进入工程 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
@ -72,13 +80,13 @@
@@ -72,13 +80,13 @@
|
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus' |
|
|
|
|
import EdfsWrap from '@/components/Edfs-wrap.vue' |
|
|
|
|
import type { IEngineeringOV } from '@/api/module/engineering/index.d' |
|
|
|
|
import CreateEngineeringDlg from './components/create-engineering-dlg.vue' |
|
|
|
|
import { Plus, Delete } from '@element-plus/icons-vue' |
|
|
|
|
import { Delete, Plus } from '@element-plus/icons-vue' |
|
|
|
|
import { useEngineeringStore } from '@/stores/engineering' |
|
|
|
|
import { storeToRefs } from 'pinia' |
|
|
|
|
import { deleteEngineering, deleteEngineeringBatch } from '@/api/module/engineering' |
|
|
|
|
@ -102,10 +110,18 @@ onMounted(() => {
@@ -102,10 +110,18 @@ onMounted(() => {
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function addEngineering() { |
|
|
|
|
createEngineeringDlgRef.value?.open() |
|
|
|
|
createEngineeringDlgRef.value?.open('create') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function importEngineering() { |
|
|
|
|
createEngineeringDlgRef.value?.open('import') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleSave(name: string) { |
|
|
|
|
function handleSave(name: string, actionType: string) { |
|
|
|
|
if (actionType === 'import') { |
|
|
|
|
engineeringStore.fetchEngineeringList() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
enterEngineering({ name, description: '', isCreate: true }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -193,7 +209,7 @@ function handleBatchDelete() {
@@ -193,7 +209,7 @@ function handleBatchDelete() {
|
|
|
|
|
ElMessage.success('删除成功') |
|
|
|
|
selectedItems.value = [] |
|
|
|
|
isBatchMode.value = false |
|
|
|
|
engineeringStore.fetchEngineeringList() |
|
|
|
|
await engineeringStore.fetchEngineeringList() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}) |
|
|
|
|
@ -209,7 +225,7 @@ function exitBatchMode() {
@@ -209,7 +225,7 @@ function exitBatchMode() {
|
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.engineering-list-container { |
|
|
|
|
height: 100%; |
|
|
|
|
overflow-y: auto; |
|
|
|
|
@ -257,6 +273,7 @@ function exitBatchMode() {
@@ -257,6 +273,7 @@ function exitBatchMode() {
|
|
|
|
|
.card-body { |
|
|
|
|
flex: 1; |
|
|
|
|
margin-bottom: 16px; |
|
|
|
|
|
|
|
|
|
.card-desc { |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #606266; |
|
|
|
|
|