File tree Expand file tree Collapse file tree 4 files changed +27
-11
lines changed
view/systemTools/autoCode/component Expand file tree Collapse file tree 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -73,17 +73,12 @@ func newT(f func(chan struct{}) error) *T {
7373//@description: 添加任务
7474
7575func (t * T ) AddTask () {
76- if len (t .ch ) == 1 {
77- return
78- }
79- t .Lock ()
80- defer t .Unlock ()
81- if len (t .ch ) == 1 {
76+ select {
77+ case t .ch <- struct {}{}:
78+ default :
8279 // 代表已经有任务了
8380 // 直接丢弃这次任务
84- return
8581 }
86- t .ch <- struct {}{}
8782}
8883
8984//@author: [songzhibin97](https://github.com/songzhibin97)
Original file line number Diff line number Diff line change 1313 <el-upload
1414 class =" image-uploader"
1515 :action =" `${path}/fileUploadAndDownload/upload`"
16+ :headers =" { 'x-token': token }"
1617 :show-file-list =" false"
1718 :on-success =" handleImageSuccess"
1819 :before-upload =" beforeImageUpload"
1920 :multiple =" false"
2021 >
21- <img v-if =" imageUrl" :src =" imageUrl" class =" image" />
22+ <img v-if =" imageUrl" :src =" path + imageUrl" class =" image" />
2223 <i v-else class =" el-icon-plus image-uploader-icon" ></i >
2324 </el-upload >
2425 </div >
2526</template >
2627<script >
2728const path = process .env .VUE_APP_BASE_API ;
29+ import { mapGetters } from " vuex" ;
2830import ImageCompress from " @/utils/image.js" ;
2931export default {
3032 name: " upload-image" ,
@@ -51,6 +53,9 @@ export default {
5153 path: path,
5254 };
5355 },
56+ computed: {
57+ ... mapGetters (" user" , [" userInfo" , " token" ]),
58+ },
5459 methods: {
5560 beforeImageUpload (file ) {
5661 let isRightSize = file .size / 1024 < this .fileSize ;
@@ -97,4 +102,4 @@ export default {
97102 height : 178px ;
98103 display : block ;
99104}
100- </style >
105+ </style >
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ export const toUpperCase = (str) => {
77 }
88}
99
10+ export const toLowerCase = ( str ) => {
11+ if ( str [ 0 ] ) {
12+ return str . replace ( str [ 0 ] , str [ 0 ] . toLowerCase ( ) )
13+ } else {
14+ return ""
15+ }
16+ }
17+
1018// 驼峰转换下划线
1119export const toSQLLine = ( str ) => {
1220 if ( str == "ID" ) return "ID"
Original file line number Diff line number Diff line change 1212 <el-col :span =" 6" >
1313 <el-input v-model =" dialogMiddle.fieldName" autocomplete =" off" ></el-input >
1414 </el-col >
15+ <el-col :offset =" 1" :span =" 2" >
16+ <el-button @click =" autoFill" >自动填充</el-button >
17+ </el-col >
1518 </el-form-item >
1619 <el-form-item label =" Field中文名" prop =" fieldDesc" >
1720 <el-col :span =" 6" >
103106</template >
104107<script >
105108import { getDict } from " @/utils/dictionary" ;
109+ import { toSQLLine , toLowerCase } from " @/utils/stringFun.js" ;
106110import { getSysDictionaryList } from " @/api/sysDictionary" ;
107111export default {
108112 name: " FieldDialog" ,
@@ -183,6 +187,10 @@ export default {
183187 };
184188 },
185189 methods: {
190+ autoFill (){
191+ this .dialogMiddle .fieldJson = toLowerCase (this .dialogMiddle .fieldName )
192+ this .dialogMiddle .columnName = toSQLLine (this .dialogMiddle .fieldJson )
193+ },
186194 async getDbfdOptions () {
187195 this .dialogMiddle .dataType = " "
188196 this .dialogMiddle .dataTypeLong = " "
@@ -201,7 +209,7 @@ export default {
201209 });
202210
203211 this .dictOptions = dictRes .data .list
204- }
212+ },
205213};
206214 </script >
207215<style lang="scss">
You can’t perform that action at this time.
0 commit comments