ice 3 anni fa
parent
commit
5c724b3131

+ 26 - 3
server/main_test.go

@@ -1,6 +1,14 @@
 package main
 
 import (
+	"fmt"
+	"github.com/flipped-aurora/gin-vue-admin/server/core"
+	"github.com/flipped-aurora/gin-vue-admin/server/global"
+	"github.com/flipped-aurora/gin-vue-admin/server/initialize"
+	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
+	"github.com/flipped-aurora/gin-vue-admin/server/service"
+	"github.com/xuri/excelize/v2"
+	"strings"
 	"testing"
 )
 
@@ -10,9 +18,9 @@ func TestName(t *testing.T) {
 	//vi:="gIEEvlb9cEjErJxZ5sflrw=="
 	//phone , _ := weapp.DecryptMobile(ssk, r, vi)
 	//fmt.Print(phone)
-	//global.GVA_VP = core.Viper()      // 初始化Viper
-	//global.GVA_LOG = core.Zap()       // 初始化zap日志库
-	//global.GVA_DB = initialize.Gorm() // gorm连接数据库
+	global.GVA_VP = core.Viper()      // 初始化Viper
+	global.GVA_LOG = core.Zap()       // 初始化zap日志库
+	global.GVA_DB = initialize.Gorm() // gorm连接数据库
 	//var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
 	//f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
 	//files := f.GetSheetList()
@@ -44,4 +52,19 @@ func TestName(t *testing.T) {
 	//	j++
 	//	fmt.Println()
 	//}
+	var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
+	f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
+	files := f.GetSheetList()
+	for _, sheet := range files {
+		rows, _ := f.GetRows(sheet)
+		for _, row := range rows {
+			if len(row) > 1 && row[1] != "" {
+				fmt.Printf("\t%v", row[0])
+				places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1),Position:strings.Replace(row[1], "\n", "", -1) ,
+					Type:strings.Replace(row[2], "\n", "", -1),Region:strings.Replace(row[3], "\n", "", -1) })
+				fmt.Println()
+			}
+		}
+		fmt.Println()
+	}
 }

+ 0 - 2
web/src/core/gin-vue-admin.js

@@ -10,7 +10,5 @@ export const run = function(app) {
     console.log(`
      欢迎使用 cc
      微信:zk1006
-     默认自动化文档地址:http://127.0.0.1:${import.meta.env.VITE_SERVER_PORT}/swagger/index.html
-     默认前端文件运行地址:http://127.0.0.1:${import.meta.env.VITE_CLI_PORT}
   `)
 }

+ 3 - 0
web/src/view/content/banner.vue

@@ -104,11 +104,14 @@ import {
 } from '@/api/content' //  此处请自行替换地址
 import infoList from '@/mixins/infoList'
 import { mapGetters } from 'vuex'
+
+const path = import.meta.env.VITE_BASE_API
 export default {
   name: 'Content',
   mixins: [infoList],
   data() {
     return {
+      path: path,
       listApi: getContentList,
       dialogFormVisible: false,
       type: '',

+ 1 - 1
web/src/view/content/content.vue

@@ -111,7 +111,7 @@ import {
 import infoList from '@/mixins/infoList'
 import { mapGetters } from 'vuex'
 
-const path = process.env.VUE_APP_BASE_API
+const path = import.meta.env.VITE_BASE_API
 export default {
   name: 'Content',
   mixins: [infoList],

+ 3 - 0
web/src/view/content/norm.vue

@@ -104,11 +104,14 @@ import {
 } from '@/api/content' //  此处请自行替换地址
 import infoList from '@/mixins/infoList'
 import { mapGetters } from 'vuex'
+
+const path = process.env.VUE_APP_BASE_API
 export default {
   name: 'Content',
   mixins: [infoList],
   data() {
     return {
+      path: path,
       listApi: getContentList,
       dialogFormVisible: false,
       type: '',

+ 2 - 2
web/src/view/login/index.vue

@@ -84,8 +84,8 @@ export default {
       curYear: 0,
       lock: 'lock',
       loginForm: {
-        username: 'admin',
-        password: '123456',
+        username: '',
+        password: '',
         captcha: '',
         captchaId: ''
       },

+ 4 - 3
web/src/view/superAdmin/dictionary/department.vue

@@ -132,7 +132,8 @@ export default {
         label: null,
         value: null,
         status: true,
-        sort: null
+        sort: null,
+        sysDictionaryID: 7
       },
       rules: {
         label: [
@@ -188,7 +189,7 @@ export default {
         value: null,
         status: true,
         sort: null,
-        sysDictionaryID: ''
+        sysDictionaryID: 7
       }
     },
     async deleteSysDictionaryDetail(row) {
@@ -206,7 +207,7 @@ export default {
       }
     },
     async enterDialog() {
-      this.formData.sysDictionaryID = Number(this.$route.params.id)
+      this.formData.sysDictionaryID = 7
       this.$refs['elForm'].validate(async valid => {
         if (!valid) return
         let res