Skip to content

Commit 8c5ae61

Browse files
committed
顶部搜索功能添加及生成代码功能去重校验
1 parent ad4562b commit 8c5ae61

File tree

5 files changed

+77
-52
lines changed

5 files changed

+77
-52
lines changed

server/model/sys_user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package model
22

33
import (
44
"github.com/jinzhu/gorm"
5-
uuid "github.com/satori/go.uuid"
5+
"github.com/satori/go.uuid"
66
)
77

88
type SysUser struct {
@@ -15,3 +15,4 @@ type SysUser struct {
1515
Authority SysAuthority `json:"authority" gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"`
1616
AuthorityId string `json:"authorityId" gorm:"default:888"`
1717
}
18+

web/package-lock.json

Lines changed: 18 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/view/layout/index.vue

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@
2828
>{{item.meta.title}}</el-breadcrumb-item>
2929
</el-breadcrumb>
3030
<div class="fl-right right-box">
31+
<transition name="el-fade-in-linear">
32+
<div v-show="show" class="transition-box" style="display: inline-block; ">
33+
<el-select v-model="value" filterable placeholder="请选择" @blur="test()">
34+
<el-option
35+
v-for="item in options"
36+
:key="item.value"
37+
:label="item.label"
38+
:value="item.value">
39+
</el-option>
40+
</el-select>
41+
</div>
42+
</transition>
43+
<i class="el-icon-search" style="font-size: 20px; display: inline-block; " @click="show = !show"></i>
3144
<Screenfull class="screenfull"></Screenfull>
3245
<el-dropdown>
3346
<span class="el-dropdown-link">
@@ -95,6 +108,7 @@ export default {
95108
name: "Layout",
96109
data() {
97110
return {
111+
show:false,
98112
isCollapse: false,
99113
isSider: true,
100114
isMobile: false,
@@ -124,7 +138,24 @@ export default {
124138
trigger: "blur"
125139
}
126140
]
127-
}
141+
},
142+
options: [{
143+
value: '选项1',
144+
label: '黄金糕'
145+
}, {
146+
value: '选项2',
147+
label: '双皮奶'
148+
}, {
149+
value: '选项3',
150+
label: '蚵仔煎'
151+
}, {
152+
value: '选项4',
153+
label: '龙须面'
154+
}, {
155+
value: '选项5',
156+
label: '北京烤鸭'
157+
}],
158+
value:''
128159
};
129160
},
130161
components: {
@@ -133,6 +164,9 @@ export default {
133164
Screenfull
134165
},
135166
methods: {
167+
test(){
168+
this.show = false
169+
},
136170
...mapActions("user", ["LoginOut"]),
137171
totalCollapse() {
138172
this.isCollapse = !this.isCollapse;
@@ -321,7 +355,7 @@ $mainHight: 100vh;
321355
&:not(.el-menu--collapse) {
322356
width: 220px;
323357
}
324-
358+
325359
}
326360
.el-menu--collapse{
327361
li{
@@ -374,8 +408,12 @@ $mainHight: 100vh;
374408
vertical-align: middle;
375409
}
376410
}
411+
.el-input__inner{
412+
border: none;
413+
border-bottom: 1px solid #606266;
414+
}
377415
.screenfull{
378416
display: inline-block;
379-
417+
380418
}
381419
</style>

web/src/view/systemTools/autoCode/component/fieldDialog.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ export default {
7878
fieldJson:[ { required: true, message: '请输入field格式化json', trigger: 'blur' }],
7979
fieldType:[ { required: true, message: '请选择field数据类型', trigger: 'blur' }]
8080
}
81-
81+
8282
}
83-
}
83+
},
8484
}
8585
</script>
8686
<style lang="scss">
87-
88-
</style>
87+
88+
</style>

web/src/view/systemTools/autoCode/index.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
width="280">
2929
</el-table-column>
3030
<el-table-column
31-
v-test
3231
prop="fieldName"
3332
label="Field名"
3433
width="280">
@@ -117,12 +116,6 @@ export default {
117116
components:{
118117
FieldDialog
119118
},
120-
directives:{
121-
'test':function(el,binding,vnode){
122-
/** el可以获取当前dom节点,并且进行编译,也可以操作事件 **/
123-
/** binding指的是一个对象,一般不用 **/ /** vnode 是 Vue 编译生成的虚拟节点 **/
124-
console.log(el.click()); //获取v-model的值
125-
}},
126119
methods:{
127120
editAndAddField(item){
128121
this.dialogFlag = true
@@ -135,9 +128,14 @@ export default {
135128
this.dialogMiddle = JSON.parse(JSON.stringify(fieldTemplate))
136129
}
137130
},
131+
regExp(ele){
132+
return ele.replace(/\s*/g,"")
133+
},
138134
enterDialog(){
139-
console.log(this.dialogMiddle.fieldName.replace(/\s*/g,""))
140-
135+
this.dialogMiddle.fieldName = this.regExp(this.dialogMiddle.fieldName)
136+
this.dialogMiddle.fieldDesc = this.regExp(this.dialogMiddle.fieldDesc)
137+
this.dialogMiddle.fieldJson = this.regExp(this.dialogMiddle.fieldJson)
138+
this.dialogMiddle.columnName = this.regExp(this.dialogMiddle.columnName)
141139
this.$refs.fieldDialog.$refs.fieldDialogFrom.validate((valid) => {
142140
if (valid) {
143141
this.dialogMiddle.fieldName = toUpperCase(this.dialogMiddle.fieldName)
@@ -170,7 +168,11 @@ export default {
170168
}
171169
this.$refs.autoCodeForm.validate(async (valid) => {
172170
if (valid) {
173-
this.form.structName = toUpperCase(this.form.structName)
171+
this.form.structName = this.regExp(this.form.structName)
172+
this.form.structName = toUpperCase(this.form.structName)
173+
this.form.abbreviation = this.regExp(this.form.abbreviation)
174+
this.form.packageName = this.regExp(this.form.packageName)
175+
174176
if(this.form.structName == this.form.abbreviation){
175177
this.$message({
176178
type:"error",

0 commit comments

Comments
 (0)