|
|
@@ -5,12 +5,23 @@
|
|
|
<el-input v-model="queryForm.name" placeholder="名称"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="类型">
|
|
|
- <el-select v-model="queryForm.isEnable" clearable placeholder="用户状态">
|
|
|
- <el-option label="是" value="Y"/>
|
|
|
- <el-option label="否" value="N"/>
|
|
|
+ <el-select v-model="queryForm.categoryId" placeholder="请选择场所类型" clearable>
|
|
|
+ <el-option v-for="item in listDataType" :key="item.id" :label="item.name" :value="item.id"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+
|
|
|
+ <el-row class="action-bar-container" type="flex" justify="end">
|
|
|
+ <el-button type="primary" size="small" @click.native="fetchData">查询</el-button>
|
|
|
+ <el-button-group>
|
|
|
+ <el-button size="small" @click.native="$refs.dialogForm.open({})">
|
|
|
+ 新建
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" @click.native="deleteByIds(multipleSelection)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </el-row>
|
|
|
<el-table
|
|
|
v-loading="isLoading"
|
|
|
:data="pageData.records"
|
|
|
@@ -20,9 +31,15 @@
|
|
|
@selection-change="selectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55"/>
|
|
|
- <el-table-column label="名称" prop="id" width="150"/>
|
|
|
- <el-table-column label="地址" prop="name"/>
|
|
|
- <el-table-column label="类型" prop="publicKey" width="150"/>
|
|
|
+ <el-table-column label="#" prop="id" width="150"/>
|
|
|
+ <el-table-column label="名称" prop="name"/>
|
|
|
+ <el-table-column label="地址" prop="address"/>
|
|
|
+ <el-table-column label="类型" prop="category.name" width="150"/>
|
|
|
+ <el-table-column label="操作" width="70" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click.native="$refs.dialogForm.open(scope.row)">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination
|
|
|
@@ -33,28 +50,70 @@
|
|
|
:page-size="pageData.pageSize"
|
|
|
@current-change="paginationChange"
|
|
|
/>
|
|
|
+ <dialog-form ref="dialogForm" @ok="fetchData"/>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
+import { findAllDataType } from '@/api/place/base_info'
|
|
|
+import { deleteMediaByIds, findMediaPage } from '@/api/bz'
|
|
|
+import DialogForm from './DialogForm'
|
|
|
+
|
|
|
export default {
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ DialogForm
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isLoading: true,
|
|
|
queryForm: {},
|
|
|
- pageData: {}
|
|
|
+ pageData: {},
|
|
|
+ listDataType: [],
|
|
|
+ multipleSelection: []
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
|
created() {
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.fetchData()
|
|
|
+ findAllDataType().then(listDataType => {
|
|
|
+ this.listDataType = listDataType
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+ deleteByIds(ids) {
|
|
|
+ this.$confirm('确认要删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ deleteMediaByIds(ids).then(() => {
|
|
|
+ this.fetchData()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fetchData() {
|
|
|
+ this.isLoading = true
|
|
|
+ findMediaPage({ ...this.queryForm, current: this.currentPage })
|
|
|
+ .then((response) => {
|
|
|
+ this.pageData = response
|
|
|
+ })
|
|
|
+ .finally(() => (this.isLoading = false))
|
|
|
+ },
|
|
|
paginationChange(val) {
|
|
|
this.currentPage = val
|
|
|
this.fetchData()
|
|
|
+ },
|
|
|
+ selectionChange(val) {
|
|
|
+ const temp = []
|
|
|
+ val.forEach(o => {
|
|
|
+ temp.push(o.id)
|
|
|
+ })
|
|
|
+ this.multipleSelection = temp
|
|
|
}
|
|
|
}
|
|
|
}
|