no message

This commit is contained in:
小陌 2023-07-04 23:39:00 +08:00
parent 2acc1dac76
commit 235bc2c547
2 changed files with 100 additions and 38 deletions

View File

@ -36,7 +36,7 @@
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="24">
<el-form-item label="操作部分" prop="key"> <el-form-item label="操作部分" prop="key">
<el-checkbox-group v-model="form.operationtype"> <el-checkbox-group v-model="form.operationtype">
<el-checkbox-button label="plus">添加</el-checkbox-button> <el-checkbox-button label="plus">添加</el-checkbox-button>
@ -49,52 +49,100 @@
</el-row> </el-row>
<el-row :gutter="10" v-show="form.operationtype.includes('batchdeletion')"> <el-row :gutter="10" v-show="form.operationtype.includes('batchdeletion')">
<el-col :span="8"> <el-col :span="6">
<el-form-item label="批量删除按钮" prop="key"> <el-form-item label="批量删除按钮" prop="label">
<el-input v-model="form.operation.batchdeletion.label" placeholder="名称"></el-input> <el-input v-model="form.operation.batchdeletion.label" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="12">
<el-form-item label="批量删除请求" prop="key"> <el-form-item label="批量删除请求" prop="url">
<el-input v-model="form.operation.batchdeletion.url" placeholder="请求 URL"></el-input> <el-input v-model="form.operation.batchdeletion.url" placeholder="请求 URL"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="类型" prop="type">
<el-select v-model="form.operation.batchdeletion.type" placeholder="选择">
<el-option value="primary" key="primary" label="Primary"> Primary </el-option>
<el-option value="success" key="success" label="Success"> Success </el-option>
<el-option value="warning" key="warning" label="Warning"> Warning </el-option>
<el-option value="danger" key="danger" label="Danger"> Danger </el-option>
<el-option value="info" key="info" label="Info"> Info </el-option>
<el-option value="text" key="text" label="Text"> Text </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="10" v-show="form.operationtype.includes('edit')"> <el-row :gutter="10" v-show="form.operationtype.includes('edit')">
<el-col :span="8"> <el-col :span="6">
<el-form-item label="编辑按钮" prop="key"> <el-form-item label="编辑按钮" prop="key">
<el-input v-model="form.operation.edit.label" placeholder="名称"></el-input> <el-input v-model="form.operation.edit.label" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="12">
<el-form-item label="编辑请求" prop="key"> <el-form-item label="编辑请求" prop="edit">
<el-input v-model="form.operation.edit.url" placeholder="请求 URL"></el-input> <el-input v-model="form.operation.edit.url" placeholder="请求 URL"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="类型" prop="type">
<el-select v-model="form.operation.edit.type" placeholder="选择">
<el-option value="primary" key="primary" label="Primary"> Primary </el-option>
<el-option value="success" key="success" label="Success"> Success </el-option>
<el-option value="warning" key="warning" label="Warning"> Warning </el-option>
<el-option value="danger" key="danger" label="Danger"> Danger </el-option>
<el-option value="info" key="info" label="Info"> Info </el-option>
<el-option value="text" key="text" label="Text"> Text </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="10" v-show="form.operationtype.includes('delete')"> <el-row :gutter="10" v-show="form.operationtype.includes('delete')">
<el-col :span="8"> <el-col :span="6">
<el-form-item label="下架按钮" prop="key"> <el-form-item label="下架按钮" prop="key">
<el-input v-model="form.operation.delete.label" placeholder="名称"></el-input> <el-input v-model="form.operation.delete.label" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="12">
<el-form-item label="下架请求" prop="key"> <el-form-item label="下架请求" prop="delete">
<el-input v-model="form.operation.delete.url" placeholder="请求 URL"></el-input> <el-input v-model="form.operation.delete.url" placeholder="请求 URL"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="类型" prop="type">
<el-select v-model="form.operation.delete.type" placeholder="选择">
<el-option value="primary" key="primary" label="Primary"> Primary </el-option>
<el-option value="success" key="success" label="Success"> Success </el-option>
<el-option value="warning" key="warning" label="Warning"> Warning </el-option>
<el-option value="danger" key="danger" label="Danger"> Danger </el-option>
<el-option value="info" key="info" label="Info"> Info </el-option>
<el-option value="text" key="text" label="Text"> Text </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="10" v-show="form.operationtype.includes('plus')"> <el-row :gutter="10" v-show="form.operationtype.includes('plus')">
<el-col :span="8"> <el-col :span="6">
<el-form-item label="添加按钮" prop="key"> <el-form-item label="添加按钮" prop="key">
<el-input v-model="form.operation.plus.label" placeholder="名称"></el-input> <el-input v-model="form.operation.plus.label" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="12">
<el-form-item label="添加请求" prop="key"> <el-form-item label="添加请求" prop="plus">
<el-input v-model="form.operation.plus.url" placeholder="请求 URL"></el-input> <el-input v-model="form.operation.plus.url" placeholder="请求 URL"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="类型" prop="type">
<el-select v-model="form.operation.plus.type" placeholder="选择">
<el-option value="primary" key="primary" label="Primary"> Primary </el-option>
<el-option value="success" key="success" label="Success"> Success </el-option>
<el-option value="warning" key="warning" label="Warning"> Warning </el-option>
<el-option value="danger" key="danger" label="Danger"> Danger </el-option>
<el-option value="info" key="info" label="Info"> Info </el-option>
<el-option value="text" key="text" label="Text"> Text </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
@ -125,11 +173,13 @@
</template> </template>
</el-table-column> </el-table-column>
</sc-form-table> </sc-form-table>
<sc-title title="Column表格"></sc-title> <sc-title title="Column表格"></sc-title>
<sc-form-table v-model="form.column" :addTemplate="addcolumnTemplate" drag-sort placeholder="暂无数据"> <sc-form-table v-model="form.column" :addTemplate="addcolumnTemplate" drag-sort placeholder="暂无数据">
<el-table-column prop="label" label="名称">
<template #default="scope">
<el-input v-model="scope.row.label" placeholder="名称"></el-input>
</template>
</el-table-column>
<el-table-column prop="component" label="表单组件" width="120"> <el-table-column prop="component" label="表单组件" width="120">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.component" placeholder="选择"> <el-select v-model="scope.row.component" placeholder="选择">
@ -156,9 +206,9 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="label" label="名称"> <el-table-column prop="span" label="表单跨度" width="110">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.label" placeholder="名称"></el-input> <el-input v-model="scope.row.span" :disabled="!scope.row.component" placeholder="表单跨度"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="字段"> <el-table-column prop="name" label="字段">
@ -166,11 +216,6 @@
<el-input v-model="scope.row.name" :disabled="scope.row.component=='title'" placeholder="字段名"></el-input> <el-input v-model="scope.row.name" :disabled="scope.row.component=='title'" placeholder="字段名"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="width" label="宽" width="80">
<template #default="scope">
<el-input v-model="scope.row.width" :disabled="scope.row.component=='title'" placeholder="宽"></el-input>
</template>
</el-table-column>
<el-table-column prop="columntype" label="表格类型" width="120"> <el-table-column prop="columntype" label="表格类型" width="120">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.columntype" placeholder="选择"> <el-select v-model="scope.row.columntype" placeholder="选择">
@ -184,16 +229,18 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="hide" label="隐藏" width="70" align="center"> <el-table-column prop="hide" label="隐藏" width="70" align="center">
<template #default="scope"> <template #default="scope">
<el-switch v-model="scope.row.hide" active-value="1" inactive-value="0"></el-switch> <el-switch v-model="scope.row.hide" :disabled="scope.row.component=='title'"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="span" label="表单跨度" width="110"> <el-table-column prop="width" label="宽" width="80">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.span" placeholder="表单跨度"></el-input> <el-input v-model="scope.row.width" :disabled="scope.row.component=='title'" placeholder="宽"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="operator" label="筛选" width="110"> <el-table-column prop="operator" label="筛选" width="110">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.filter" placeholder="选择"> <el-select v-model="scope.row.filter" placeholder="选择">

View File

@ -23,19 +23,19 @@
</el-table-column> </el-table-column>
<el-table-column label="名称" prop="title" minWidth="100"> <el-table-column label="名称" prop="title" minWidth="100">
<template #default="scope"> <template #default="scope">
{{ scope.row.title }} <input class="el-input__inner" type="text" readonly :value="scope.row.title">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标识" prop="title" minWidth="100"> <el-table-column label="标识" prop="title" minWidth="100">
<template #default="scope"> <template #default="scope">
{{ scope.row.name }} <input class="el-input__inner" type="text" readonly :value="scope.row.name">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="主键" prop="key" width="150"></el-table-column> <el-table-column label="主键" prop="key" width="80"></el-table-column>
<el-table-column label="请求" prop="viewnum" width="90"> <el-table-column label="请求" prop="views" width="80">
<template #default="scope"> <template #default="scope">
<el-link :underline="false" size="small" @click="setImage(scope.row)"> <el-link :underline="false" size="small" @click="setImage(scope.row)">
<el-badge :value="scope.row.viewnum" type="info"></el-badge> <el-badge :value="scope.row.views" type="primary"></el-badge>
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
@ -58,17 +58,17 @@
<input class="el-input__inner" type="text" readonly :value="scope.row.operationtype"> <input class="el-input__inner" type="text" readonly :value="scope.row.operationtype">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" prop="remark" width="160"> <el-table-column label="Api" prop="api" width="190">
<template #default="scope"> <template #default="scope">
<input class="el-input__inner" type="text" readonly :value="scope.row.remark"> <input class="el-input__inner" type="text" readonly :value="scope.row.api">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Api" prop="api" width="150"></el-table-column>
<el-table-column label="添加时间" prop="timestamp" width="150"></el-table-column> <el-table-column label="添加时间" prop="timestamp" width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="120"> <el-table-column label="操作" fixed="right" align="left" width="170">
<template #default="scope"> <template #default="scope">
<el-button-group> <el-button-group>
<el-button type="warning" size="small" @click="table_copy(scope.row, scope.$index)">复制</el-button>
<el-button type="primary" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> <el-button type="primary" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
<el-popconfirm :title="'确定删除吗?'" @confirm="table_del(scope.row, scope.$index)"> <el-popconfirm :title="'确定删除吗?'" @confirm="table_del(scope.row, scope.$index)">
<template #reference> <template #reference>
@ -136,6 +136,21 @@
this.$refs.column.open('edit').setData(row) this.$refs.column.open('edit').setData(row)
}) })
}, },
//
async table_copy(row){
var res = await this.$http.post('system/table/copy', {id: row.id});
if(res.code == 200){
this.$refs.table.reload({})
if (res.data) {
this.table_edit(res.data)
}
this.$message.success("复制成功")
return ;
}
this.$alert(res.message, "提示", {type: 'error'})
},
// //
async table_del(row, index){ async table_del(row, index){
var res = await this.$http.post('system/table/delete', {id: row.id}); var res = await this.$http.post('system/table/delete', {id: row.id});
@ -143,9 +158,9 @@
// OR / // OR /
this.$refs.table.tableData.splice(index, 1); this.$refs.table.tableData.splice(index, 1);
this.$message.success("删除成功") this.$message.success("删除成功")
}else{ return ;
this.$alert(res.message, "提示", {type: 'error'})
} }
this.$alert(res.message, "提示", {type: 'error'})
}, },
// //
async batch_del(){ async batch_del(){