psycho 6 năm trước cách đây
mục cha
commit
8af980b557

+ 1 - 1
TEAMModelOS/ClientApp/boot-app.js

@@ -1,4 +1,4 @@
-import './css/site.css'
+//import './css/site.css'
 import 'core-js/es6/promise'
 import 'core-js/es6/array'
 

+ 259 - 0
TEAMModelOS/ClientApp/common/SelectSchool.vue

@@ -0,0 +1,259 @@
+<template>
+    <div>
+        <div class="selection-component row">
+            <label class="selection-label">{{$t('formConfigP.school')+':'}}</label>
+            <Row style="width:90%;">
+                <Col :xs="18" :sm="6" :md="5" :lg="4">
+                <Select v-model="schoolInfo.country" class="my-select" :placeholder="$t('formConfigP.country')" @on-change="getSelctValue('country',$event)" :disabled="$i18n.locale.indexOf('en') != -1" >
+                    <Option v-for="item in countryData" :value="item" :key="item.sysAddID">{{ item.countryName }}</Option>
+                </Select>
+                </Col>
+                <Col :xs="18" :sm="6" :md="5" :lg="4">
+                <Select v-model="schoolInfo.province" v-if="schoolInfo.country.countryId != 'TW'" class="my-select" :placeholder="$t('formConfigP.province')" :disabled="checkCountry == 2 || $i18n.locale.indexOf('en') != -1" clearable="true" ref="province" @on-change="getSelctValue('province',$event)">
+                    <Option v-for="item in provinceData" :value="item" :key="item.sysAddID">{{ item.provinceName }}</Option>
+                </Select>
+                </Col>
+                <Col :xs="18" :sm="6" :md="5" :lg="4">
+                <Select v-model="schoolInfo.city" class="my-select" :placeholder="$t('formConfigP.city')" :disabled="checkCountry == 2 || $i18n.locale.indexOf('en') != -1" clearable="true" ref="city" @on-change="getSelctValue('city',$event)">
+                    <Option v-for="item in cityData" :value="item" :key="item.sysAddID">{{ item.cityName }}</Option>
+                </Select>
+                </Col>
+                <Col :xs="18" :sm="6" :md="5" :lg="12">
+                <Select v-model="schoolInfo.school" class="my-select" :placeholder="$t('formConfigP.school')" :disabled="checkCountry == 2 || $i18n.locale.indexOf('en') != -1" clearable="true" ref="school" @on-change="getSelctValue('school',$event)" filterable="true" :loading="loading" not-found-text="">
+                    <Option v-for="item in schoolData" :value="item" :key="item.sysAddID">{{ item.name }}</Option>
+                </Select>
+                </Col>
+            </Row>
+        </div>
+        <div class="selection-component ">
+            <label class="selection-label"></label>
+            <Row style="width:90%; margin-top:20px;" v-if="checkCountry == 2 || $i18n.locale.indexOf('en') != -1" >
+                <Col :xs="24" :sm="6" :md="5" :lg="6">
+                <Input v-model="schoolInfoInput.country" class="my-select" placeholder="country" style="width: 95%;" />
+                </Col>
+                <Col :xs="24" :sm="6" :md="5" :lg="6">
+
+                <Input v-model="schoolInfoInput.city" class="my-select" placeholder="city" style="width: 95%" />
+                </Col>
+                <Col :xs="24" :sm="6" :md="5" :lg="12">
+                <Input v-model="schoolInfoInput.school" class="my-select" placeholder="school" style="width: 90%;" @on-change="getInputValue"/>
+                </Col>
+            </Row>
+        </div>
+
+        
+    </div>
+</template>
+
+<script>
+    export default {
+        props: {
+            
+        },
+        data() {
+            return {
+                model: "",
+                zhCnData: [],
+                zhTwData: [],
+                enUsData: [],
+                schoolData: [],
+                schoolInfoInput: {
+                    country: '',
+                    province: '',
+                    city: '',
+                    school: '',
+                },
+                schoolInfo: {
+                    country: {},
+                    province: {},
+                    city: {},
+                    school: {},
+                },
+                loading: false
+            };
+        },
+        methods: {
+            getValue() {
+                this.$emit("get-value", [
+                    this.model,
+                    this.selections.field
+                ]);
+            },
+            getCountryInfo(data) {
+                let result = [];
+                let currentCountry = '';
+                for (let i = 0; i < data.length; i++) {
+                    if (currentCountry != data[i].countryName && data[i].countryName != null && data[i].provinceName == null && data[i].cityName == null) {
+                        currentCountry = data[i].countryName;
+                        result.push(data[i]);
+                    }
+                }
+                return result;
+            },
+            getProvinceInfo(data, country) {
+                let result = [];
+                let currentProvince = '';
+                for (let i = 0; i < data.length; i++) {
+                    if (currentProvince != data[i].provinceName && data[i].provinceName != null && data[i].countryId == country.countryId) {
+                        currentProvince = data[i].provinceName;
+                        result.push(data[i]);
+                    }
+                }
+                return result;
+            },
+            getCityInfo(data, province) {
+                let result = [];
+                let currentCity = '';
+                if (province != undefined) {
+                    for (let i = 0; i < data.length; i++) {
+                        if (currentCity != data[i].cityName && data[i].cityName != null && data[i].provinceId == province.provinceId) {
+                            currentCity = data[i].cityName;
+                            result.push(data[i]);
+                        }
+                    }
+                }
+                return result;
+            },
+            getSchoolInfo(CountryId, ProvinceId, CityId) {
+                let url = 'api/School/getSchool';
+                let requestData = {
+                    method: 'getSchool',
+                    params: {
+                        CountryId: CountryId,
+                        ProvinceId: ProvinceId,
+                        CityId: CityId
+                    }
+                }
+                this.loading = true;
+                this.$axios.post(url, requestData).then(
+                    (res) => {
+                        if (res.data.error == null) {
+                            if (res.data.result.data.length == 0) {
+                                alert("暂未收录此地区学校,请手动输入!");
+                            } else {
+                                this.schoolData = res.data.result.data;
+                            }
+                            
+                        } else {
+                            alert("服务器错误!");
+                        }
+                        this.loading = false;
+                    },
+                    (err) => {
+                        console.log(err);
+                        this.loading = false;
+                    }
+                )
+            },
+            getSelctValue(flag, value) {
+                if (flag == 'country') {
+                    this.$refs.school.clearSingleSelect();
+                    this.$refs.city.clearSingleSelect();
+                    this.$refs.province.clearSingleSelect();
+                } else if (flag == 'province') {
+                    this.$refs.school.clearSingleSelect();
+                    this.$refs.city.clearSingleSelect();
+                } else if (flag == 'city') {
+                    this.$refs.school.clearSingleSelect();
+                    this.getSchoolInfo(this.schoolInfo.country.countryId, this.schoolInfo.province.provinceId, this.schoolInfo.city.cityId);
+                } else if (flag == 'school') {
+                    this.schoolInfo['checkCountry'] = this.checkCountry;
+                    this.$emit("school-info", this.schoolInfo);        
+                }
+            },
+            getInputValue() {
+                this.schoolInfoInput['checkCountry'] = this.checkCountry;
+                this.$emit("school-info", this.schoolInfoInput);    
+            }
+        },
+        computed: {
+            countryData() {
+                let countryInfo = [];
+                if (this.$i18n.locale == 'zh-CN') {
+                    countryInfo = this.getCountryInfo(this.zhCnData);
+                    
+                } else if (this.$i18n.locale == 'zh-TW') {
+                    countryInfo = this.getCountryInfo(this.zhTwData);
+                } else if (this.$i18n.locale.indexOf('en') != -1) {
+                    countryInfo = this.getCountryInfo(this.enUsData);
+                }
+                return countryInfo;
+            },
+            provinceData() {
+                let provinceInfo = [];
+                if (this.$i18n.locale == 'zh-CN') {
+                    provinceInfo = this.getProvinceInfo(this.zhCnData, this.schoolInfo.country);
+                } else if (this.$i18n.locale == 'zh-TW') {
+                    provinceInfo = this.getProvinceInfo(this.zhTwData, this.schoolInfo.country);
+                } else if (this.$i18n.locale.indexOf('en') != -1) {
+                    provinceInfo = this.getProvinceInfo(this.enUsData, this.schoolInfo.country);
+                }
+                return provinceInfo;
+            },
+            cityData() {
+                let cityInfo = [];
+                if (this.$i18n.locale == 'zh-CN') {
+                    cityInfo = this.getCityInfo(this.zhCnData, this.schoolInfo.province);
+                } else if (this.$i18n.locale == 'zh-TW') {
+                    cityInfo = this.getCityInfo(this.zhTwData, this.schoolInfo.province);
+                } else if (this.$i18n.locale.indexOf('en') != -1) {
+                    cityInfo = this.getCityInfo(this.enUsData, this.schoolInfo.province);
+                }
+                return cityInfo;
+            },
+            checkCountry() {
+                if (this.schoolInfo.country.countryId == undefined) {
+                    return 0;
+                }
+                if (this.schoolInfo.country.countryId == 'CN' || this.schoolInfo.country.countryId == 'TW') {
+                    return 1;
+                } else {
+                    return 2;
+                }
+            }
+        },
+        mounted() {
+            let area = require("@/static/area.json");
+            for (let i = 0; i < area.length; i++) {
+                if (area[i].lang == 'en-us') {
+                    this.enUsData.push(area[i]);
+                } else if (area[i].lang == 'zh-tw') {
+                    this.zhTwData.push(area[i]);
+                } else if (area[i].lang == 'zh-cn') {
+                    this.zhCnData.push(area[i]);
+                }
+            }
+        }
+    };
+</script>
+
+<style scoped>
+    .selection-component {
+        width: 100%;
+        position: relative;
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+    }
+
+    .selection-label {
+        width: 120px;
+        font-size: 15px;
+        color: #67B6E5;
+    }
+    .my-select {
+        width:90%;
+    }
+    .my-select >>> .ivu-select-selection {
+        border: 1px solid #67B6E5;
+    }
+
+    .my-select >>> .ivu-select-selected-value {
+        color: #67B6E5;
+        font-size: 15px;
+    }
+        .my-select >>> .ivu-select-input {
+            color: #67B6E5;
+            font-size: 13px;
+        }
+</style>

+ 3 - 0
TEAMModelOS/ClientApp/locale/lang/zh-CN.js

@@ -1,3 +1,6 @@
 export default {
   test: '测试',
+  formConfigP: {
+    school:"国家"
+  }
 }

+ 4 - 1
TEAMModelOS/ClientApp/router/routes.js

@@ -34,5 +34,8 @@ export const routes = [
       },
     ]
   },
-
+  {
+  path: '/authorization',
+  component: resolve => require(['@/view/authorization.vue'], resolve), //路由懒加载
+  }
 ]

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
TEAMModelOS/ClientApp/static/area.json


+ 15 - 0
TEAMModelOS/ClientApp/utils/i18n.js

@@ -0,0 +1,15 @@
+import Vue from 'vue'
+import VueI18n from 'vue-i18n'
+Vue.use(VueI18n)
+
+// 以下为语言包单独设置的场景,单独设置时语言包需单独引入
+const messages = {
+  'zh_CN': require('@/locale/lang/zh'),   // 中文语言包
+  'en_US': require('@/locale/lang/en')    // 英文语言包
+}
+
+// 最后 export default,这一步肯定要写的。
+export default new VueI18n({
+  locale: 'en', // set locale 默认显示英文
+  messages: messages // set locale messages
+})

+ 48 - 0
TEAMModelOS/ClientApp/view/authorization.vue

@@ -0,0 +1,48 @@
+<template>
+  <div id="app">
+    <div class="main-content">
+      <SelectSchool></SelectSchool>
+    </div>
+  </div>
+</template>
+<script>
+  import SelectSchool from '@/common/SelectSchool.vue'
+  import animate from 'animate.css'
+  export default {
+    components: {
+      SelectSchool
+    },
+    data() {
+      return {
+        isLogin: false,
+        username: ""
+      }
+    },
+    create() {
+        this.isLogin = localStorage.getItem('username');
+    },
+    methods: {
+      
+    },
+    mounted() {
+    }
+  }
+</script>
+<style>
+  html, body, #app {
+    height: 100% !important;
+  }
+
+  .main-content {
+    position: relative;
+    width: 100%;
+    min-width: 1200px;
+    background: url("http://chq.dygl.pujiaoyun.cn/static/img/banner.jpg") center 100% no-repeat;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    padding-top: 150px;
+  }
+
+</style>

+ 4 - 0
TEAMModelOS/ClientApp/view/index.vue

@@ -4,6 +4,7 @@
       <img src="../assets/tmd_logo.png" class="logo animated fadeIn" />
       <Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleLogin('login')" v-show="!isLogin">登录</Button>
       <Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleLogin('regist')" v-show="!isLogin">注册</Button>
+      <Button type="primary" size="large" class="btn-login animated fadeIn" @click="handleAuth()">去授权</Button>
       <p v-show="isLogin" class="suc-text">欢迎登录醍摩豆 , {{username}}</p>
       <div v-show="isLogin" class="overlay-wrap center animated fadeIn">
         <div class="main-btn centerCol" @click="sa">
@@ -37,6 +38,9 @@
       sy() {
         this.$router.replace('/Syllabus')
       },
+      handleAuth() {
+        this.$router.replace('/authorization')
+      },
       //访问TW登录并回调
       handleLogin(types) {
         console.log(types);

+ 5 - 1
TEAMModelOS/TEAMModelOS.csproj

@@ -4,9 +4,13 @@
     <UserSecretsId>a25fbaf0-43f2-412e-a606-4a19c5766202</UserSecretsId>
   </PropertyGroup>
   <ItemGroup>
+    <Compile Remove="ClientApp\新文件夹\**" />
     <Compile Remove="Providers\**" />
+    <Content Remove="ClientApp\新文件夹\**" />
     <Content Remove="Providers\**" />
+    <EmbeddedResource Remove="ClientApp\新文件夹\**" />
     <EmbeddedResource Remove="Providers\**" />
+    <None Remove="ClientApp\新文件夹\**" />
     <None Remove="Providers\**" />
   </ItemGroup>
   <ItemGroup>
@@ -14,6 +18,7 @@
   </ItemGroup>
   <ItemGroup>
     <!-- Files not to show in IDE -->
+    <None Remove="ClientApp\utils\.editorconfig" />
     <None Remove="yarn.lock" />
 
     <!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
@@ -21,7 +26,6 @@
   <ItemGroup>
     <Folder Include="Models\" />
     <Folder Include="wwwroot\" />
-    <Folder Include="JwtRsaFile\" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\TEAMModelOS.Model\TEAMModelOS.Model.csproj" />