Browse Source
Merge branches 'gin-vue-admin-adjust-log' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin-adjust-log
Merge branches 'gin-vue-admin-adjust-log' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin-adjust-log
Conflicts: QMPlusServer/init/qmsql/initMysql.go QMPlusServer/main.go QMPlusVuePage/src/view/superAdmin/autoCode/index.vuemain
pixel
5 years ago
10 changed files with 261 additions and 10 deletions
-
16QMPlusServer/Dockerfile
-
3QMPlusServer/config/config.go
-
5QMPlusServer/init/qmsql/initMysql.go
-
15QMPlusServer/main.go
-
23QMPlusServer/model/autoCodeModel/autoCode.go
-
5QMPlusServer/static/config/config.json
-
2QMPlusVuePage/src/view/login/login.vue
-
179QMPlusVuePage/src/view/superAdmin/autoCode/component/componentDialog.vue
-
2QMPlusVuePage/src/view/superAdmin/autoCode/index.vue
-
11docker-compose.yml
@ -0,0 +1,16 @@ |
|||||
|
FROM golang:1.12 AS build |
||||
|
|
||||
|
WORKDIR /go/src/gin-vue-admin |
||||
|
COPY . . |
||||
|
|
||||
|
ENV GO111MODULE=on |
||||
|
ENV GOPROXY=https://goproxy.cn |
||||
|
RUN go get ./... \ |
||||
|
&& go build -o gin-vue-admin |
||||
|
|
||||
|
FROM golang:1.12 AS serve |
||||
|
|
||||
|
COPY --from=build /go/src/gin-vue-admin /go/src/gin-vue-admin |
||||
|
|
||||
|
EXPOSE 8080 |
||||
|
ENTRYPOINT [ "./gin-vue-admin" ] |
@ -0,0 +1,23 @@ |
|||||
|
package autoCodeModel |
||||
|
|
||||
|
//开发中功能,若您发现这块代码可以研究,可以无视
|
||||
|
type AutoCodeStruct struct { |
||||
|
StructName string `json:"structName"` |
||||
|
StructType []string `json:"structType"` |
||||
|
Components []Component `json:"components"` |
||||
|
} |
||||
|
|
||||
|
type Component struct { |
||||
|
ComponentName string `json:"componentName"` |
||||
|
ComponentType string `json:"componentType"` |
||||
|
Ismultiple bool `json:"isMultiple"` |
||||
|
ComponentShowType string `json:"componentShowType"` |
||||
|
NideDictionary bool `json:"nideDictionary"` |
||||
|
DictionaryName string `json:"dictionaryName"` |
||||
|
ComponentDictionary []Dictionary `json:"dictionary"` |
||||
|
} |
||||
|
|
||||
|
type Dictionary struct { |
||||
|
Label string `json:"label"` |
||||
|
Value string `json:"value"` |
||||
|
} |
@ -0,0 +1,179 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-form :model="dialogMiddle" :inline="true" > |
||||
|
<el-form-item label="组件名称" label-width="80" :span="8"> |
||||
|
<el-input v-model="dialogMiddle.componentName" autocomplete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="数据类型" label-width="80" :span="8"> |
||||
|
<el-select v-model="dialogMiddle.componentType" placeholder="请选择活动区域"> |
||||
|
<el-option |
||||
|
v-for="item in typeOptions" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="展示类型" label-width="80" :span="8"> |
||||
|
<el-select v-model="dialogMiddle.componentShowType" placeholder="请选择活动区域"> |
||||
|
<el-option |
||||
|
v-for="item in showTypeOptions" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="字典Key" label-width="80" :span="8"> |
||||
|
<el-input v-model="dialogMiddle.dictionaryName" autocomplete="off"></el-input> |
||||
|
</el-form-item> |
||||
|
<div> |
||||
|
<el-form-item label="是否多选" label-width="80"> |
||||
|
<el-switch |
||||
|
v-model="dialogMiddle.isMultiple" |
||||
|
active-text="多选" |
||||
|
inactive-text="单选"> |
||||
|
</el-switch> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
<div> |
||||
|
<el-form-item label="是否使用字典" label-width="80"> |
||||
|
<el-switch |
||||
|
v-model="dialogMiddle.nideDictionary" |
||||
|
active-text="使用" |
||||
|
inactive-text="不使用"> |
||||
|
</el-switch> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
<div class="button-box clearflex"> |
||||
|
<el-button @click="addDictionary" type="primary">新增组件</el-button> |
||||
|
</div> |
||||
|
<el-table |
||||
|
:data="dialogMiddle.componentDictionary" |
||||
|
stripe |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
label="展示值" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.label"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="交互值" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-input v-model="scope.row.value"></el-input> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="操作" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-popover |
||||
|
placement="top" |
||||
|
width="160" |
||||
|
v-model="scope.row.visible"> |
||||
|
<p>这是一段内容这是一段内容确定删除吗?</p> |
||||
|
<div style="text-align: right; margin: 0"> |
||||
|
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button> |
||||
|
<el-button type="primary" size="mini" @click="deleteRow(scope)">确定</el-button> |
||||
|
</div> |
||||
|
<el-button type="text" slot="reference">删除</el-button> |
||||
|
</el-popover> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
const dictionaryTemplate = { |
||||
|
label:"", |
||||
|
value:"", |
||||
|
visible:false |
||||
|
} |
||||
|
export default { |
||||
|
name:"ComponentDialog", |
||||
|
props:{ |
||||
|
dialogMiddle:{ |
||||
|
type:Object, |
||||
|
default:function(){ |
||||
|
return {} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data(){ |
||||
|
return{ |
||||
|
visible:false, |
||||
|
typeOptions:[ |
||||
|
{ |
||||
|
label:"字符串", |
||||
|
value:"string" |
||||
|
}, |
||||
|
{ |
||||
|
label:"整型", |
||||
|
value:"int" |
||||
|
}, |
||||
|
{ |
||||
|
label:"布尔值", |
||||
|
value:"bool" |
||||
|
}, |
||||
|
{ |
||||
|
label:"浮点型", |
||||
|
value:"float64" |
||||
|
}, |
||||
|
{ |
||||
|
label:"时间", |
||||
|
value:"time.Time" |
||||
|
}, |
||||
|
], |
||||
|
showTypeOptions:[ |
||||
|
{ |
||||
|
label:"单选框", |
||||
|
value:"radio" |
||||
|
}, |
||||
|
{ |
||||
|
label:"多选框", |
||||
|
value:"checkBox" |
||||
|
}, |
||||
|
{ |
||||
|
label:"输入框", |
||||
|
value:"input" |
||||
|
}, |
||||
|
{ |
||||
|
label:"计数器", |
||||
|
value:"inputNumber" |
||||
|
}, |
||||
|
{ |
||||
|
label:"选择器", |
||||
|
value:"select" |
||||
|
}, |
||||
|
{ |
||||
|
label:"级联选择器", |
||||
|
value:"cascader" |
||||
|
}, |
||||
|
{ |
||||
|
label:"开关", |
||||
|
value:"switch" |
||||
|
}, |
||||
|
{ |
||||
|
label:"时间日期选择器", |
||||
|
value:"datePicker" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
addDictionary(){ |
||||
|
this.dialogMiddle.componentDictionary.push({...dictionaryTemplate}) |
||||
|
}, |
||||
|
deleteRow(row){ |
||||
|
this.dialogMiddle.componentDictionary.splice(row.$index,1) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
|
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue