|
@@ -1,33 +1,11 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="body" style="font-size:14px">
|
3
|
|
- <el-card class="box-card">
|
4
|
|
- 实例名称:<el-input
|
5
|
|
- v-model="name"
|
6
|
|
- size="mini"
|
7
|
|
- style="width: 200px; margin-right: 20px"
|
8
|
|
- />
|
9
|
|
- 创建时间:
|
10
|
|
- <el-date-picker
|
11
|
|
- v-model="daterange"
|
12
|
|
- size="mini"
|
13
|
|
- type="daterange"
|
14
|
|
- range-separator="至"
|
15
|
|
- start-placeholder="开始日期"
|
16
|
|
- end-placeholder="结束日期"
|
17
|
|
- value-format="yyyy-MM-dd"
|
18
|
|
- style="margin-right: 20px"
|
19
|
|
- @change="dateChange"
|
20
|
|
- />
|
21
|
|
-
|
22
|
|
- <el-button type="primary" size="mini" @click="onSearch">查询</el-button>
|
23
|
|
- <el-button size="mini" @click="onReset">重置</el-button>
|
24
|
|
- <el-button type="primary" size="mini" @click="handleAdd">添加特征库</el-button>
|
25
|
|
- </el-card>
|
|
3
|
+ <el-button type="primary" size="mini" style="float: right; margin-bottom: 20px;" @click="handleAdd">添加特征</el-button>
|
26
|
4
|
<el-table stripe :data="tableData" border style="width: 100%">
|
27
|
5
|
<el-table-column prop="name" label="实例名称" />
|
28
|
6
|
<el-table-column prop="thumb" label="实例图片">
|
29
|
7
|
<template slot-scope="scope">
|
30
|
|
- <el-image :src="scope.row.icon" style="width: 100px; height: 100px" />
|
|
8
|
+ <el-image :src="scope.row.thumb" style="width: 100px; height: 100px" />
|
31
|
9
|
</template>
|
32
|
10
|
</el-table-column>
|
33
|
11
|
<el-table-column prop="createDate" label="创建时间">
|
|
@@ -67,42 +45,36 @@ export default {
|
67
|
45
|
startDate: undefined
|
68
|
46
|
}
|
69
|
47
|
},
|
70
|
|
- mounted() {
|
71
|
|
- this.onSearch()
|
|
48
|
+ watch: {
|
|
49
|
+ gameId() {
|
|
50
|
+ if (this.gameId) {
|
|
51
|
+ this.onSearch()
|
|
52
|
+ }
|
|
53
|
+ }
|
72
|
54
|
},
|
73
|
55
|
methods: {
|
74
|
56
|
handleAdd() {
|
75
|
|
- this.$emit('handleAddGameCharcter', true)
|
|
57
|
+ this.$emit('handleAddGameCharacter', true)
|
76
|
58
|
},
|
77
|
59
|
handleEdit(row) {
|
78
|
|
- this.$emit('handleEditGameCharcter', row.characterId)
|
|
60
|
+ this.$emit('handleEditGameCharacter', row.characterId)
|
79
|
61
|
},
|
80
|
62
|
handleDelete(row) {
|
81
|
63
|
deleteGameCharacter(row.characterId).then(() => {
|
82
|
64
|
// 让父组件给右边编辑特征页面一个空的characterId
|
83
|
65
|
// 防止当前特征正在编辑时删除了右边再次进行保存会报错
|
84
|
66
|
this.$message('删除特征成功')
|
85
|
|
- this.$emit('handleCloseGameCharcter', true)
|
|
67
|
+ this.$emit('handleCloseGameCharacter', true)
|
86
|
68
|
this.onSearch()
|
87
|
69
|
})
|
88
|
70
|
},
|
89
|
71
|
onSearch() {
|
90
|
72
|
getGameCharacterList({
|
91
|
|
- gameId: this.gameId,
|
92
|
|
- name: this.name,
|
93
|
|
- startDate: this.startDate,
|
94
|
|
- endDate: this.endDate
|
|
73
|
+ gameId: this.gameId
|
95
|
74
|
}).then((res) => {
|
96
|
75
|
this.tableData = res.data.records
|
97
|
76
|
})
|
98
|
77
|
},
|
99
|
|
- onReset() {
|
100
|
|
- this.name = ''
|
101
|
|
- this.daterange = ''
|
102
|
|
- this.startDate = ''
|
103
|
|
- this.endDate = ''
|
104
|
|
- this.onSearch()
|
105
|
|
- },
|
106
|
78
|
dateChange(val) {
|
107
|
79
|
this.startDate = this.daterange[0]
|
108
|
80
|
this.endDate = this.daterange[1]
|