|
|
@@ -0,0 +1,122 @@
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ v-if="visible"
|
|
|
+ :title="baseInfo.name+'-扩展字段管理'"
|
|
|
+ :visible.sync="visible"
|
|
|
+ width="1200px"
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-form :model="queryForm" inline size="small">
|
|
|
+ <el-form-item label="字段编码">
|
|
|
+ <el-input v-model="queryForm.fieldKey" placeholder="字段编码"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="字段名称">
|
|
|
+ <el-input v-model="queryForm.fieldLabel" placeholder="字段名称"/>
|
|
|
+ </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 v-permission="['category.base.extend.column']" size="small" @click.native="$refs.extendColumnDialogForm.open({},baseInfo.id)">
|
|
|
+ 新建
|
|
|
+ </el-button>
|
|
|
+ <el-button v-permission="['category.base.extend.column']" size="small" @click.native="deleteByIds(multipleSelection)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </el-row>
|
|
|
+ <el-table
|
|
|
+ v-loading="isLoading"
|
|
|
+ :data="pageData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55"/>
|
|
|
+ <el-table-column label="字段编码" prop="fieldKey" width="200"/>
|
|
|
+ <el-table-column label="字段名称" prop="fieldLabel" width="200"/>
|
|
|
+ <el-table-column label="字段类型" prop="fieldType" width="100"/>
|
|
|
+ <el-table-column label="默认值" prop="defaultValue" min-width="300"/>
|
|
|
+ <el-table-column label="操作" width="80" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-permission="['category.base.extend.column']" type="text" @click.native="$refs.extendColumnDialogForm.open(scope.row)">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination
|
|
|
+ class="pagination-container"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="pageData.total"
|
|
|
+ :page-size="pageData.pageSize"
|
|
|
+ @current-change="paginationChange"
|
|
|
+ />
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="visible = false">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ <extend-column-dialog-form ref="extendColumnDialogForm" @ok="fetchData"/>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import { findPage, deleteByIds } from '@/api/base/category_extend_column'
|
|
|
+import ExtendColumnDialogForm from './ExtendColumnDialogForm'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: { ExtendColumnDialogForm },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ isLoading: false,
|
|
|
+ baseInfo: {},
|
|
|
+ queryForm: {},
|
|
|
+ pageData: {},
|
|
|
+ currentPage: 1,
|
|
|
+ multipleSelection: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ open(data) {
|
|
|
+ this.visible = true
|
|
|
+ this.isLoading = false
|
|
|
+ this.baseInfo = Object.assign({}, data)
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ selectionChange(val) {
|
|
|
+ const temp = []
|
|
|
+ val.forEach(o => {
|
|
|
+ temp.push(o.id)
|
|
|
+ })
|
|
|
+ this.multipleSelection = temp
|
|
|
+ },
|
|
|
+ paginationChange(val) {
|
|
|
+ this.currentPage = val
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ deleteByIds(ids) {
|
|
|
+ this.$confirm('确认要删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ deleteByIds(ids).then(() => {
|
|
|
+ this.fetchData()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fetchData() {
|
|
|
+ this.isLoading = true
|
|
|
+ findPage({ ...this.queryForm, current: this.currentPage })
|
|
|
+ .then((response) => {
|
|
|
+ this.pageData = response
|
|
|
+ })
|
|
|
+ .finally(() => (this.isLoading = false))
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|