|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="button__example--wrap">
|
|
|
- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="open(false)">ę°å¢</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-circle-plus-outline" @click="open(false, 'InfoWrite')">ę°å¢</el-button>
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
icon="el-icon-delete"
|
|
@@ -45,20 +45,32 @@
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
<template #action="scope">
|
|
|
- <el-button type="primary" size="mini" @click="open(scope.row)">ē¼č¾</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="open(scope.row, 'InfoWrite')">ē¼č¾</el-button>
|
|
|
+ <el-button type="success" size="mini" @click="open(scope.row, 'Detail')">ę„ē</el-button>
|
|
|
<el-button type="danger" size="mini" @click="dels(scope.row)">å é¤</el-button>
|
|
|
</template>
|
|
|
</com-table>
|
|
|
|
|
|
<com-dialog v-model="dialogVisible" :title="title">
|
|
|
- <ifno-write :info="info" @close="close" @success="success" />
|
|
|
+ <info-write
|
|
|
+ v-if="comName === 'InfoWrite'"
|
|
|
+ :info="info"
|
|
|
+ @close="toggleVisible"
|
|
|
+ @success="success"
|
|
|
+ />
|
|
|
+ <detail
|
|
|
+ v-if="comName === 'Detail'"
|
|
|
+ :info="info"
|
|
|
+ @close="toggleVisible"
|
|
|
+ />
|
|
|
</com-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, ref } from 'vue'
|
|
|
-import IfnoWrite from './components/IfnoWrite.vue'
|
|
|
+import InfoWrite from './components/InfoWrite.vue'
|
|
|
+import Detail from './components/Detail.vue'
|
|
|
|
|
|
import { useExample } from '@/hooks/useExample'
|
|
|
import { Message } from '_c/Message'
|
|
@@ -104,7 +116,7 @@ const columns = [
|
|
|
{
|
|
|
field: 'action',
|
|
|
label: 'ęä½',
|
|
|
- width: '150px',
|
|
|
+ width: '220px',
|
|
|
slots: {
|
|
|
default: 'action'
|
|
|
}
|
|
@@ -114,7 +126,8 @@ const columns = [
|
|
|
export default defineComponent({
|
|
|
// name: 'ExampleDialog',
|
|
|
components: {
|
|
|
- IfnoWrite
|
|
|
+ InfoWrite,
|
|
|
+ Detail
|
|
|
},
|
|
|
setup() {
|
|
|
const info = ref<any>(null)
|
|
@@ -130,7 +143,9 @@ export default defineComponent({
|
|
|
sizeChange,
|
|
|
handleSelectionChange,
|
|
|
selectionData,
|
|
|
- delData
|
|
|
+ delData,
|
|
|
+ comName,
|
|
|
+ toggleVisible
|
|
|
} = useExample()
|
|
|
|
|
|
// 请ę±ę°ę®
|
|
@@ -198,15 +213,11 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
// ęå¼å¼¹ēŖ
|
|
|
- function open(row: any) {
|
|
|
- title.value = row ? 'ē¼č¾' : 'ę°å¢'
|
|
|
+ function open(row: any, component: string) {
|
|
|
+ comName.value = component
|
|
|
+ title.value = !row ? 'ę°å¢' : (component === 'Detail' ? '详ę
' : 'ē¼č¾')
|
|
|
info.value = row || null
|
|
|
- dialogVisible.value = true
|
|
|
- }
|
|
|
-
|
|
|
- // å¼¹ēŖå
³é
|
|
|
- function close() {
|
|
|
- dialogVisible.value = false
|
|
|
+ toggleVisible(true)
|
|
|
}
|
|
|
|
|
|
// ęåä¹åēåč°
|
|
@@ -234,7 +245,9 @@ export default defineComponent({
|
|
|
handleCurrentChange,
|
|
|
handleSelectionChange,
|
|
|
dels,
|
|
|
- close, success
|
|
|
+ close, success,
|
|
|
+ comName,
|
|
|
+ toggleVisible
|
|
|
}
|
|
|
}
|
|
|
})
|