| @@ -7,50 +7,16 @@ | |||
| </template> | |||
| <script> | |||
| import { dictByName } from '@/api/dict.js'; | |||
| import { getToken } from '@/utils/auth'; | |||
| import { TokenKey } from '@/settings'; | |||
| export default { | |||
| name: 'App', | |||
| watch: { | |||
| $route() { | |||
| this.initDic(); | |||
| }, | |||
| }, | |||
| mounted() { | |||
| const script = document.createElement('script'); | |||
| script.type = 'text/javascript'; | |||
| script.src = 'https://s9.cnzz.com/z_stat.php?id=1280834206&web_id=1280834206'; | |||
| document.getElementsByTagName('head')[0].appendChild(script); | |||
| }, | |||
| created() { | |||
| this.initDic(); | |||
| }, | |||
| methods: { | |||
| initDic() { | |||
| if (!getToken(TokenKey)) { | |||
| return; | |||
| } | |||
| // 数据集类型 | |||
| dictByName('dataset_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.datasetType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 模型类别 | |||
| dictByName('model_category').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.modelType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 标签类型 | |||
| dictByName('label_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.labelType = res.dictDetails; | |||
| } | |||
| }); | |||
| }, | |||
| /** | |||
| * @description: 获取缩放值 | |||
| * @param { Void } | |||
| @@ -38,7 +38,7 @@ export const API_MODULE_NAME = { | |||
| // 登录、注册参数配置 | |||
| export const loginConfig = { | |||
| //allowRegister: process.env.NODE_ENV !== 'production', // 是否允许注册 | |||
| // allowRegister: process.env.NODE_ENV !== 'production', // 是否允许注册 | |||
| allowRegister: true, // 是否允许注册 | |||
| }; | |||
| @@ -77,9 +77,47 @@ export const atlasConfig = { | |||
| }; | |||
| // demo list | |||
| export const algList = []; | |||
| export const algList = [ | |||
| { | |||
| id: 10, | |||
| auxInfo: '健康状态', | |||
| }, | |||
| { | |||
| id: 11, | |||
| auxInfo: '安全预警', | |||
| }, | |||
| { | |||
| id: 12, | |||
| auxInfo: '异常检测', | |||
| }, | |||
| { | |||
| id: 13, | |||
| auxInfo: '其他', | |||
| }, | |||
| ]; | |||
| export const typeList = []; | |||
| export const typeList = [ | |||
| { | |||
| label: '车端数据', | |||
| value: 102, | |||
| code: 102, | |||
| }, | |||
| { | |||
| label: '桩端数据', | |||
| value: 101, | |||
| code: 101, | |||
| }, | |||
| { | |||
| label: '实验数据', | |||
| value: 105, | |||
| code: 105, | |||
| }, | |||
| { | |||
| label: '其他', | |||
| value: 106, | |||
| code: 106, | |||
| }, | |||
| ]; | |||
| // 根据 code 编码放回标注类型(数据集数据类型) | |||
| export const datasetTypeBy = (valueBy) => (value, key) => { | |||
| @@ -363,7 +363,6 @@ import EditDataset from './edit-dataset'; | |||
| import UploadDataFile from './upload-datafile'; | |||
| import '../style/list.scss'; | |||
| import { datasetTypeBy } from '@/config/index'; | |||
| import { dictByName } from '@/api/dict.js'; | |||
| const defaultForm = { | |||
| id: null, | |||
| @@ -157,7 +157,7 @@ import LoginPublic from '@/components/LoginPublic'; | |||
| import { loginConfig } from '@/config'; | |||
| import Privacy from './privacy.vue'; | |||
| import Agreement from './agreement.vue'; | |||
| import { dictByName } from '@/api/dict.js'; | |||
| export default { | |||
| name: 'Login', | |||
| components: { | |||
| @@ -269,6 +269,24 @@ export default { | |||
| .then(() => { | |||
| this.loading = false; | |||
| this.$router.push({ path: '/' }); | |||
| dictByName('dataset_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.datasetType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 模型类别 | |||
| dictByName('model_category').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.modelType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 标签类型 | |||
| dictByName('label_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.labelType = res.dictDetails; | |||
| } | |||
| }); | |||
| }) | |||
| .catch((err) => { | |||
| const msg = err.message; | |||