Commit 462c6a6a by yuwei

项目初始化

parent e2476051
......@@ -50,6 +50,8 @@ public class ModelColumnDto implements Serializable {
private String isInsert;
@ApiModelProperty(value = "是否编辑字段(0否,1是)")
private String isEdit;
@ApiModelProperty(value = "是否详情字段(0否,1是)")
private String isDetail;
@ApiModelProperty(value = "是否列表字段(0否,1是)")
private String isList;
@ApiModelProperty(value = "是否查询字段(0否,1是)")
......
......@@ -88,6 +88,11 @@ public class ModelColumnEntity extends BaseEntity {
private String isEdit;
/**
* 是否详情字段(0否,1是)
*/
private String isDetail;
/**
* 是否列表字段(0否,1是)
*/
private String isList;
......
......@@ -25,11 +25,6 @@ public class Condition implements Serializable {
private String queryType;
/**
* 字段类型,如int、varchar、datetime
*/
private String type;
/**
* 查询类型between时left查询字段值
*/
private String leftValue;
......
......@@ -35,6 +35,7 @@ public class ModelColumnVo implements Serializable {
private String isRequired;
private String isInsert;
private String isEdit;
private String isDetail;
private String isList;
private String isQuery;
private String queryType;
......
......@@ -164,4 +164,10 @@ public class ModelController extends BaseController {
Map<String, Object> map = modelService.getTableParamById(id);
return R.ok().setData(map);
}
@GetMapping("/form/param/{id}")
public R getFormParamById(@PathVariable String id) {
Map<String, Object> map = modelService.getFormParamById(id);
return R.ok().setData(map);
}
}
......@@ -32,4 +32,6 @@ public interface ModelService extends BaseService<ModelEntity> {
void dropTable(String id);
Map<String, Object> getTableParamById(String id);
Map<String, Object> getFormParamById(String id);
}
......@@ -133,25 +133,59 @@ public class ModelServiceImpl extends BaseServiceImpl<ModelDao, ModelEntity> imp
List<ModelColumnEntity> modelColumns = modelEntity.getModelColumns();
// 列表展示字段
List<Map<String, Object>> columnList = modelColumns.stream().filter(s -> DataConstant.TrueOrFalse.TRUE.getKey().equals(s.getIsList())).map(s -> {
Map<String, Object> map = new HashMap<>(2);
Map<String, Object> map = new HashMap<>(4);
map.put("prop", s.getColumnName());
map.put("label", s.getColumnComment());
return map;
}).collect(Collectors.toList());
// 查询参数字段
List<Map<String, Object>> queryList = modelColumns.stream().filter(s -> DataConstant.TrueOrFalse.TRUE.getKey().equals(s.getIsQuery())).map(s -> {
Map<String, Object> map = new HashMap<>(2);
Map<String, Object> map = new HashMap<>(4);
map.put("column", s.getColumnName());
map.put("queryType", s.getQueryType());
map.put("type", s.getColumnType());
map.put("columnName", s.getColumnComment());
map.put("queryType", s.getQueryType());
map.put("htmlType", s.getHtmlType());
return map;
}).collect(Collectors.toList());
Map<String, Object> map = new HashMap<>();
Map<String, Object> map = new HashMap<>(4);
map.put("modelId", id);
map.put("tableName", tableName);
map.put("columnList", columnList);
map.put("queryList", queryList);
return map;
}
@Override
public Map<String, Object> getFormParamById(String id) {
ModelEntity modelEntity = super.getById(id);
String tableName = modelEntity.getModelPhysicalTable();
List<ModelColumnEntity> modelColumns = modelEntity.getModelColumns();
List<Map<String, Object>> columnList = modelColumns.stream().filter(s -> DataConstant.TrueOrFalse.FALSE.getKey().equals(s.getIsSystem())).map(s -> {
Map<String, Object> map = new HashMap<>(16);
map.put("id", s.getId());
map.put("columnName", s.getColumnName());
map.put("columnComment", s.getColumnComment());
map.put("columnType", s.getColumnType());
map.put("columnLength", s.getColumnLength());
map.put("columnScale", s.getColumnScale());
map.put("defaultValue", s.getDefaultValue());
map.put("isRequired", s.getIsRequired());
map.put("isInsert", s.getIsInsert());
map.put("isEdit", s.getIsEdit());
map.put("isDetail", s.getIsEdit());
map.put("isList", s.getIsList());
map.put("isQuery", s.getIsQuery());
map.put("queryType", s.getQueryType());
map.put("isBindDict", s.getIsBindDict());
map.put("bindDictColumn", s.getBindDictColumn());
map.put("dictList", null);
map.put("htmlType", s.getHtmlType());
return map;
}).collect(Collectors.toList());
Map<String, Object> map = new HashMap<>(4);
map.put("modelId", id);
map.put("tableName", tableName);
map.put("columnList", columnList);
return map;
}
}
......@@ -23,6 +23,7 @@
<result column="is_required" property="isRequired" />
<result column="is_insert" property="isInsert" />
<result column="is_edit" property="isEdit" />
<result column="is_detail" property="isDetail" />
<result column="is_list" property="isList" />
<result column="is_query" property="isQuery" />
<result column="query_type" property="queryType" />
......@@ -42,7 +43,7 @@
update_by,
update_time,
remark,
model_id, column_name, column_comment, column_type, column_length, column_scale, default_value, is_system, is_pk, is_required, is_insert, is_edit, is_list, is_query, query_type, is_bind_dict, bind_dict_type_id, bind_dict_column, html_type, sort
model_id, column_name, column_comment, column_type, column_length, column_scale, default_value, is_system, is_pk, is_required, is_insert, is_edit, is_detail, is_list, is_query, query_type, is_bind_dict, bind_dict_type_id, bind_dict_column, html_type, sort
</sql>
</mapper>
......@@ -73,3 +73,10 @@ export function getTableParam(id) {
method: 'get'
})
}
export function getFormParam(id) {
return request({
url: '/data/masterdata/models/form/param/' + id,
method: 'get'
})
}
......@@ -10,7 +10,7 @@
<div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item
v-for="(item, index) in columns"
v-for="(item, index) in columnList"
:key="item.id"
:label="item.columnComment"
:prop="item.columnName"
......@@ -20,6 +20,7 @@
<el-input
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'textarea'">
......@@ -27,15 +28,44 @@
type="textarea"
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'number'">
<el-input-number
v-model.trim="form[item.columnName]"
:controls="false"
:precision="parseInt(item.columnScale)"
></el-input-number>
</template>
<template v-if="item.htmlType === 'datetime'">
<template v-if="item.columnType === 'date'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
></el-date-picker>
</template>
<template v-if="item.columnType === 'time'">
<el-time-picker
v-model="form[item.columnName]"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="选择时间点">
</el-time-picker>
</template>
<template v-if="item.columnType === 'year'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy"
value-format="yyyy"
type="year"
placeholder="选择年份"
></el-date-picker>
</template>
<template v-if="item.columnType === 'datetime'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd HH:mm:ss"
......@@ -44,6 +74,7 @@
placeholder="选择日期时间"
></el-date-picker>
</template>
</template>
</el-form-item>
</el-form>
</div>
......@@ -51,8 +82,7 @@
</template>
<script>
import { addChangeRecord } from '@/api/metadata/changerecord'
import { getDataModel } from '@/api/masterdata/datamodel'
import { getFormParam } from '@/api/masterdata/datamodel'
import { addData } from '@/api/masterdata/datamanage'
export default {
......@@ -84,17 +114,17 @@ export default {
},
// 表单参数
form: {},
// 表单校验
rules: {},
columns: []
tableName: '',
columnList: []
}
},
created() {
console.log('data:' + this.data)
getDataModel(this.data.modelId).then(response => {
getFormParam(this.data.modelId).then(response => {
if (response.success) {
const { data } = response
this.columns = data.modelColumns
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isInsert === '1')
}
})
},
......@@ -104,33 +134,32 @@ export default {
},
/** 提交按钮 */
submitForm: function() {
console.log(this.form)
return false
// this.$refs['form'].validate(valid => {
// if (valid) {
// this.loadingOptions.loading = true
// this.loadingOptions.loadingText = '保存中...'
// this.loadingOptions.isDisabled = true
// addChangeRecord(this.form).then(response => {
// if (response.success) {
// this.$message.success('保存成功')
// setTimeout(() => {
// // 2秒后跳转列表页
// this.$emit('showCard', this.showOptions)
// }, 2000)
// } else {
// this.$message.error('保存失败')
// this.loadingOptions.loading = false
// this.loadingOptions.loadingText = '保存'
// this.loadingOptions.isDisabled = false
// }
// }).catch(() => {
// this.loadingOptions.loading = false
// this.loadingOptions.loadingText = '保存'
// this.loadingOptions.isDisabled = false
// })
// }
// })
this.$refs['form'].validate(valid => {
if (valid) {
const data = { tableName: this.tableName, datas: this.form }
this.loadingOptions.loading = true
this.loadingOptions.loadingText = '保存中...'
this.loadingOptions.isDisabled = true
addData(data).then(response => {
if (response.success) {
this.$message.success('保存成功')
setTimeout(() => {
// 2秒后跳转列表页
this.$emit('showCard', this.showOptions)
}, 2000)
} else {
this.$message.error('保存失败')
this.loadingOptions.loading = false
this.loadingOptions.loadingText = '保存'
this.loadingOptions.isDisabled = false
}
}).catch(() => {
this.loadingOptions.loading = false
this.loadingOptions.loadingText = '保存'
this.loadingOptions.isDisabled = false
})
}
})
}
}
}
......
......@@ -8,26 +8,72 @@
</div>
<div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" />
</el-form-item>
<el-form-item label="原来的值" prop="fieldOldValue">
<el-input v-model="form.fieldOldValue" />
</el-form-item>
<el-form-item label="最新的值" prop="fieldNewValue">
<el-input v-model="form.fieldNewValue" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.id"
:label="dict.itemText"
>{{ dict.itemValue }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" />
<el-form-item
v-for="(item, index) in columnList"
:key="item.id"
:label="item.columnComment"
:prop="item.columnName"
:rules="[{ required: item.isRequired, message: item.columnComment + '不能为空' }]"
>
<template v-if="item.htmlType === 'input'">
<el-input
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'textarea'">
<el-input
type="textarea"
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'number'">
<el-input-number
v-model.trim="form[item.columnName]"
:controls="false"
:precision="parseInt(item.columnScale)"
></el-input-number>
</template>
<template v-if="item.htmlType === 'datetime'">
<template v-if="item.columnType === 'date'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
></el-date-picker>
</template>
<template v-if="item.columnType === 'time'">
<el-time-picker
v-model="form[item.columnName]"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="选择时间点">
</el-time-picker>
</template>
<template v-if="item.columnType === 'year'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy"
value-format="yyyy"
type="year"
placeholder="选择年份"
></el-date-picker>
</template>
<template v-if="item.columnType === 'datetime'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择日期时间"
></el-date-picker>
</template>
</template>
</el-form-item>
</el-form>
</div>
......@@ -35,8 +81,7 @@
</template>
<script>
import { getChangeRecord } from '@/api/metadata/changerecord'
import { getDataModel } from '@/api/masterdata/datamodel'
import { getFormParam } from '@/api/masterdata/datamodel'
import { getData } from '@/api/masterdata/datamanage'
export default {
......@@ -61,22 +106,31 @@ export default {
showDetail: false
},
// 表单参数
form: {}
form: {},
tableName: '',
columnList: []
}
},
created() {
console.log('id:' + this.data.id)
console.log('data:' + this.data)
getFormParam(this.data.modelId).then(response => {
if (response.success) {
const { data } = response
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isDetail === '1')
}
})
},
mounted() {
this.getChangeRecord(this.data.id)
this.getData(this.data.id)
},
methods: {
showCard() {
this.$emit('showCard', this.showOptions)
},
/** 获取详情 */
getChangeRecord: function(id) {
getChangeRecord(id).then(response => {
getData: function(id) {
getData({ id: id, tableName: this.tableName }).then(response => {
if (response.success) {
this.form = response.data
}
......
......@@ -8,15 +8,73 @@
</el-button-group>
</div>
<div class="body-wrapper">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
<el-form-item label="原来的值" prop="fieldOldValue">
<el-input v-model="form.fieldOldValue" placeholder="请输入原来的值" disabled />
</el-form-item>
<el-form-item label="最新的值" prop="fieldNewValue">
<el-input v-model="form.fieldNewValue" placeholder="请输入最新的值" />
<el-form ref="form" :model="form" label-width="80px">
<el-form-item
v-for="(item, index) in columnList"
:key="item.id"
:label="item.columnComment"
:prop="item.columnName"
:rules="[{ required: item.isRequired, message: item.columnComment + '不能为空' }]"
>
<template v-if="item.htmlType === 'input'">
<el-input
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'textarea'">
<el-input
type="textarea"
v-model.trim="form[item.columnName]"
:placeholder="'请输入' + item.columnComment"
:maxlength="parseInt(item.columnLength)"
/>
</template>
<template v-if="item.htmlType === 'number'">
<el-input-number
v-model.trim="form[item.columnName]"
:controls="false"
:precision="parseInt(item.columnScale)"
></el-input-number>
</template>
<template v-if="item.htmlType === 'datetime'">
<template v-if="item.columnType === 'date'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
></el-date-picker>
</template>
<template v-if="item.columnType === 'time'">
<el-time-picker
v-model="form[item.columnName]"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="选择时间点">
</el-time-picker>
</template>
<template v-if="item.columnType === 'year'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy"
value-format="yyyy"
type="year"
placeholder="选择年份"
></el-date-picker>
</template>
<template v-if="item.columnType === 'datetime'">
<el-date-picker
v-model.trim="form[item.columnName]"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择日期时间"
></el-date-picker>
</template>
</template>
</el-form-item>
</el-form>
</div>
......@@ -24,8 +82,7 @@
</template>
<script>
import { getChangeRecord, updateChangeRecord } from '@/api/metadata/changerecord'
import { getDataModel } from '@/api/masterdata/datamodel'
import { getFormParam } from '@/api/masterdata/datamodel'
import { getData, updateData } from '@/api/masterdata/datamanage'
export default {
......@@ -57,44 +114,30 @@ export default {
},
// 表单参数
form: {},
// 表单校验
rules: {
objectId: [
{ required: true, message: '源数据表主键不能为空', trigger: 'blur' }
],
fieldName: [
{ required: true, message: '数据表的字段名不能为空', trigger: 'blur' }
],
fieldOldValue: [
{ required: true, message: '原来的值不能为空', trigger: 'blur' }
],
fieldNewValue: [
{ required: true, message: '最新的值不能为空', trigger: 'blur' }
],
version: [
{ required: true, message: '版本号不能为空', trigger: 'blur' }
]
}
tableName: '',
columnList: []
}
},
created() {
console.log('data:' + this.data)
getDataModel(this.data.modelId).then(response => {
getFormParam(this.data.modelId).then(response => {
if (response.success) {
console.log(response)
const { data } = response
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isEdit === '1')
}
})
},
mounted() {
// this.getChangeRecord(this.data.id)
this.getData(this.data.id)
},
methods: {
showCard() {
this.$emit('showCard', this.showOptions)
},
/** 获取详情 */
getChangeRecord: function(id) {
getChangeRecord(id).then(response => {
getData: function(id) {
getData({ id: id, tableName: this.tableName }).then(response => {
if (response.success) {
this.form = response.data
}
......@@ -104,10 +147,11 @@ export default {
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
const data = { id: this.data.id, tableName: this.tableName, datas: this.form }
this.loadingOptions.loading = true
this.loadingOptions.loadingText = '保存中...'
this.loadingOptions.isDisabled = true
updateChangeRecord(this.form).then(response => {
updateData(data).then(response => {
if (response.success) {
this.$message.success('保存成功')
setTimeout(() => {
......
......@@ -33,7 +33,7 @@
</el-tab-pane>
<el-tab-pane label="字段属性" name="second">
<el-button type="primary" @click="addRow">添加</el-button>
<el-form ref="table" :model="form" :rules="rules" size="mini">
<el-form ref="secondTable" :model="form" :rules="rules" size="mini">
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
......@@ -99,6 +99,36 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-form-item>
<el-button :disabled="scope.row.isSystem === '1' || scope.$index < 8" icon="el-icon-arrow-up" circle @click="upRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)" icon="el-icon-arrow-down" circle @click="downRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1'" icon="el-icon-delete" circle @click="delRow(scope.$index)" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<el-tab-pane label="页面属性" name="third">
<el-form ref="thirdTable" :model="form" :rules="rules" size="mini">
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
<template slot-scope="scope">
<el-form-item>
<el-input :disabled="true" v-model="scope.row.columnName" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列描述">
<template slot-scope="scope">
<el-form-item>
<el-input :disabled="true" v-model="scope.row.columnComment" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="插入" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isInsert'">
......@@ -113,6 +143,13 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="详情" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isDetail'">
<el-checkbox :disabled="scope.row.isSystem === '1'" v-model="scope.row.isDetail" true-label="1" false-label="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列表" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isList'">
......@@ -155,22 +192,13 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-form-item>
<el-button :disabled="scope.row.isSystem === '1' || scope.$index < 8" icon="el-icon-arrow-up" circle @click="upRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)" icon="el-icon-arrow-down" circle @click="downRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1'" icon="el-icon-delete" circle @click="delRow(scope.$index)" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<!-- <el-tab-pane label="唯一约束" name="fourth">唯一约束</el-tab-pane>-->
<!-- <el-tab-pane label="条件约束" name="fifth">条件约束</el-tab-pane>-->
<!-- <el-tab-pane label="外键约束" name="sixth">外键约束</el-tab-pane>-->
<!-- <el-tab-pane label="索引" name="seventh">索引</el-tab-pane>-->
<!-- <el-tab-pane label="索引" name="fourth">索引</el-tab-pane>-->
<!-- <el-tab-pane label="唯一约束" name="fifth">唯一约束</el-tab-pane>-->
<!-- <el-tab-pane label="条件约束" name="sixth">条件约束</el-tab-pane>-->
<!-- <el-tab-pane label="外键约束" name="seventh">外键约束</el-tab-pane>-->
</el-tabs>
</div>
</el-card>
......@@ -243,13 +271,13 @@ export default {
htmlTypeOptions: [],
// 系统默认列
systemColumns: [
{ columnName: 'id', columnComment: '主键ID', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '1', isRequired: '1', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'status', columnComment: '状态(0禁用,1启用)', columnType: 'tinyint', columnLength: '0', columnScale: '0', defaultValue: '1', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'number', isSystem: '1' },
{ columnName: 'create_by', columnComment: '创建人', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'create_time', columnComment: '创建日期', columnType: 'datetime', columnLength: '0', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'datetime', isSystem: '1' },
{ columnName: 'create_dept', columnComment: '创建人所属部门', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'update_by', columnComment: '更新人', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'update_time', columnComment: '更新日期', columnType: 'datetime', columnLength: '0', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'datetime', isSystem: '1' }
{ columnName: 'id', columnComment: '主键ID', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '1', isRequired: '1', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'status', columnComment: '状态(0禁用,1启用)', columnType: 'tinyint', columnLength: '0', columnScale: '0', defaultValue: '1', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'number', isSystem: '1' },
{ columnName: 'create_by', columnComment: '创建人', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'create_time', columnComment: '创建日期', columnType: 'datetime', columnLength: '0', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'datetime', isSystem: '1' },
{ columnName: 'create_dept', columnComment: '创建人所属部门', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'update_by', columnComment: '更新人', columnType: 'varchar', columnLength: '20', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'input', isSystem: '1' },
{ columnName: 'update_time', columnComment: '更新日期', columnType: 'datetime', columnLength: '0', columnScale: '0', defaultValue: '', isPk: '0', isRequired: '0', isInsert: '0', isEdit: '0', isDetail: '0', isList: '0', isQuery: '0', queryType: '', htmlType: 'datetime', isSystem: '1' }
]
}
},
......@@ -295,6 +323,7 @@ export default {
isRequired: '1',
isInsert: '1',
isEdit: '1',
isDetail: '1',
isList: '1',
isQuery: '0',
queryType: '',
......
......@@ -35,7 +35,7 @@
</el-form>
</el-tab-pane>
<el-tab-pane label="字段信息" name="second">
<el-form ref="table" :model="form" size="mini" disabled>
<el-form ref="secondTable" :model="form" size="mini" disabled>
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
......@@ -101,6 +101,27 @@
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<el-tab-pane label="页面属性" name="third">
<el-form ref="thirdTable" :model="form" size="mini">
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
<template slot-scope="scope">
<el-form-item>
<el-input v-model="scope.row.columnName" clearable placeholder="请输入列名称" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列描述">
<template slot-scope="scope">
<el-form-item>
<el-input v-model="scope.row.columnComment" clearable placeholder="请输入列描述" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="插入" align="center" width="55">
<template slot-scope="scope">
<el-form-item>
......@@ -115,6 +136,13 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="详情" align="center" width="55">
<template slot-scope="scope">
<el-form-item>
<el-checkbox v-model="scope.row.isDetail" true-label="1" false-label="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列表" align="center" width="55">
<template slot-scope="scope">
<el-form-item>
......
......@@ -33,7 +33,7 @@
</el-tab-pane>
<el-tab-pane label="字段信息" name="second">
<el-button type="primary" @click="addRow">添加</el-button>
<el-form ref="table" :model="form" :rules="rules" size="mini">
<el-form ref="secondTable" :model="form" :rules="rules" size="mini">
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
......@@ -99,6 +99,36 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-form-item>
<el-button :disabled="scope.row.isSystem === '1' || scope.$index < 8" icon="el-icon-arrow-up" circle @click="upRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)" icon="el-icon-arrow-down" circle @click="downRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1'" icon="el-icon-delete" circle @click="delRow(scope.$index)" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<el-tab-pane label="页面属性" name="third">
<el-form ref="thirdTable" :model="form" :rules="rules" size="mini">
<el-table :data="form.modelColumns" border style="width: 100%; margin: 15px 0;">
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="列名称">
<template slot-scope="scope">
<el-form-item>
<el-input :disabled="true" v-model="scope.row.columnName" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列描述">
<template slot-scope="scope">
<el-form-item>
<el-input :disabled="true" v-model="scope.row.columnComment" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="插入" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isInsert'">
......@@ -113,6 +143,13 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="详情" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isDetail'">
<el-checkbox :disabled="scope.row.isSystem === '1'" v-model="scope.row.isDetail" true-label="1" false-label="0" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="列表" align="center" width="55">
<template slot-scope="scope">
<el-form-item :prop="'modelColumns.' + scope.$index + '.isList'">
......@@ -155,15 +192,6 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-form-item>
<el-button :disabled="scope.row.isSystem === '1' || scope.$index < 8" icon="el-icon-arrow-up" circle @click="upRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)" icon="el-icon-arrow-down" circle @click="downRow(scope.$index)" />
<el-button :disabled="scope.row.isSystem === '1'" icon="el-icon-delete" circle @click="delRow(scope.$index)" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
......@@ -284,6 +312,7 @@ export default {
isRequired: '1',
isInsert: '1',
isEdit: '1',
isDetail: '1',
isList: '1',
isQuery: '0',
queryType: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment