diff --git a/.env.development b/.env.development index deb44ba..6600222 100644 --- a/.env.development +++ b/.env.development @@ -3,9 +3,9 @@ ENV = 'development' # EBTS/开发环境 #VUE_APP_BASE_API = '/dev-api' -VUE_APP_BASE_API = 'http://localhost:8096/dev-api' +#VUE_APP_BASE_API = 'http://localhost:8096/dev-api' SITE_TYPE = 'NEd5n92EMIpyyBslaNqsRgE' -#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api' +VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/index.js b/src/api/index.js index 3030a46..734844c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -31,3 +31,35 @@ export function getNode(data) { data:data }) } +// 查询测试列表 +export function getArticleList(data) { + return request({ + url: '/web/articlelist', + method: 'post', + data:data + }) +} + + +// 查询测试列表 +export function crumbs(id) { + return request({ + url: '/web/crumbs', + method: 'post', + data:{ + id:id + } + }) +} + + +// 查询测试列表 +export function banner(type) { + return request({ + url: '/web/banner', + method: 'post', + data:{ + type:type + } + }) +} diff --git a/src/main.js b/src/main.js index d99298c..39bc577 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import Vuex from 'vuex' import App from './App.vue' import router from './router' import i18n from './i18n/i18n' @@ -9,8 +10,31 @@ import 'element-ui/lib/theme-chalk/display.css'; Vue.config.productionTip = false Vue.use(ElementUI) +Vue.use(Vuex) +const store = new Vuex.Store({ + state: { + isEnglish: false, + menuList :{}, + }, + mutations: { + increment (state) { + state.count++ + } + }, + computed:{ + setEnglish(isEnglish){ + this.store.isEnglish = isEnglish + }, + }, + getters:{ + getEnglish(){ + return this.store.isEnglish + } + } +}) new Vue({ i18n, router, + store: store, render: h => h(App) }).$mount('#app') diff --git a/src/utils/ebts.js b/src/utils/ebts.js new file mode 100644 index 0000000..77f0641 --- /dev/null +++ b/src/utils/ebts.js @@ -0,0 +1,190 @@ +/** + * 通用js方法封装处理 + * Copyright (c) 2021 ebts + */ + +const baseURL = process.env.VUE_APP_BASE_API + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/'); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } +} + +// 添加日期范围 +export function addDateRange(params, dateRange) { + var search = params; + search.beginTime = ""; + search.endTime = ""; + if (null != dateRange && '' != dateRange) { + search.beginTime = dateRange[0]; + search.endTime = dateRange[1]; + } + return search; +} + +// 添加搜索创建时间日期范围 +export function addCreateDateRange(params, dateRange) { + var search = params; + let data = { + beginCreateTime: "", + endCreateTime: "", + }; + if (null != dateRange && '' != dateRange) { + data.beginCreateTime = dateRange[0]; + data.endCreateTime = dateRange[1]; + } + search.parameter = JSON.stringify(data) + return search; +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + try { + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].dictValue == ('' + value)) { + actions.push(datas[key].dictLabel); + return true; + } + }) + return actions.join(''); + }catch (e) { + console.log(e) + return null + } +} + +// 回显数据字典 +export function selectDictCode(datas, value) { + var actions = []; + Object.keys(datas).some((key) => { + if (datas[key].dictCode == ('' + value)) { + actions.push(datas[key].dictLabel); + return true; + } + }) + return actions.join(''); +} + +// 回显数据字典(字符串数组) +export function selectDictLabels(datas, value, separator) { + var actions = []; + var currentSeparator = undefined === separator ? "," : separator; + var temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + Object.keys(datas).some((key) => { + if (datas[key].dictValue == ('' + temp[val])) { + actions.push(datas[key].dictLabel + currentSeparator); + } + }) + }) + return actions.join('').substring(0, actions.join('').length - 1); +} + +// 通用下载方法 +export function download(fileName) { + window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; +} + +// 字符串格式化(%s ) +export function sprintf(str) { + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; +} + +// 转换字符串,undefined,null等转化为"" +export function praseStrEmpty(str) { + if (!str || str == "undefined" || str == "null") { + return ""; + } + return str; +} + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + * @param {*} rootId 根Id 默认 0 + */ +export function handleTree(data, id, parentId, children, rootId) { + try { + + id = id || 'id' + parentId = parentId || 'parentId' + children = children || 'children' + rootId = rootId || Math.min.apply(Math, data.map(item => { + return item[parentId] + })) || 0 + //对源数据深度克隆 + const cloneData = JSON.parse(JSON.stringify(data)) + //循环所有项 + const treeData = cloneData.filter(father => { + let branchArr = cloneData.filter(child => { + //返回每一项的子级数组 + return father[id] === child[parentId] + }); + branchArr.length > 0 ? father.children = branchArr : ''; + //返回第一层 + return father[parentId] === rootId; + }); + return treeData != '' ? treeData : data; + } catch (e) { + console.log(e) + return null; + } +} diff --git a/src/views/content/components/Introduction.vue b/src/views/content/components/Introduction.vue index 340a24d..6c22648 100644 --- a/src/views/content/components/Introduction.vue +++ b/src/views/content/components/Introduction.vue @@ -2,18 +2,10 @@
-
- 首页 - > - 学院概况 - > - 学院简介 -
{{value.title}}
-
@@ -24,9 +16,15 @@ export default { name: "Introduction", props: { value: { - type: String, - default: "", + type: Object, + default: { + title:"12", + content:"12" + }, }, + }, + data(){ + return{} } } diff --git a/src/views/content/components/dire_data.vue b/src/views/content/components/dire_data.vue new file mode 100644 index 0000000..9d0fbaa --- /dev/null +++ b/src/views/content/components/dire_data.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/views/content/components/list.vue b/src/views/content/components/list.vue new file mode 100644 index 0000000..b61b3db --- /dev/null +++ b/src/views/content/components/list.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/src/views/content/index.vue b/src/views/content/index.vue index 0f4af68..8b735c6 100644 --- a/src/views/content/index.vue +++ b/src/views/content/index.vue @@ -4,7 +4,12 @@
+ + + + +
@@ -25,7 +30,7 @@ {{ nav.title }} -
+
@@ -34,37 +39,28 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
+ 首页 + > + {{ crumbs.one.title }} + > + {{ crumbs.two.title }} +
+
+
+ + + + + + +
@@ -76,13 +72,18 @@ diff --git a/src/views/index/components/party_building_activities.vue b/src/views/index/components/party_building_activities.vue index 0daaa94..7066885 100644 --- a/src/views/index/components/party_building_activities.vue +++ b/src/views/index/components/party_building_activities.vue @@ -64,88 +64,25 @@
-
+
- +
-
喜报!信息学院师生在中国大学生计算机设计大赛中取得历史性突破!
-
- 为促进学生学业发展、给予2021年转专业同学有针对性的帮助,信息科学与技术学院于10月26日开展转专业同学分享交流会。信息科学与技术学院党委副书记马琼、本科生教学主管蒋燕老师… +
{{item.title}}
+
-
2021.11.10
-
- -
-
-
- - -
- -
-
- -
-
信息引领,勇于拼搏——信息科学与技术学院在全校教职工篮球赛获佳绩
-
- 为加强学院学风建设,提升学生英语能力,2021年10月25日晚,信息科学与技术学院组织开展英语四级备考指导会。本次指导会邀请学校外国语学院李捷老师担任主讲,信息学院2021级辅导… -
-
-
- -
2021.11.10
-
-
-
-
-
- - -
- -
-
- -
-
“学党史 担使命”一班一品牌,班班展风采——信息科学与技术学院2020-…
-
- 为普及国际化教育,提升学生对国际化认知,2021年10月25日晚,信息科学与技术学院开展了新生入学教育—国际化讲座。讲座特别邀请了学校国际合作与交流处马瑶和北京新东方教育科技公… -
-
-
- -
2021.11.10
-
-
-
-
-
- - -
- -
-
- -
-
“奋斗青春 梦想起航” 西南交通大学信息科学与技术学院2021级新生开学典礼
-
- 信息科学与技术学院于2021年10月21日在九里校区J4318、J4319开展了面向2021级研究生的职业生涯规划入学专题教育。本次活动特别邀请到了西南交通大学党委学生工作部副部长、GCDF… -
-
-
- -
2021.11.10
+
{{getTitme(item.publishTime)}}
+
@@ -154,12 +91,36 @@ diff --git a/src/views/index/components/scientific_research_trends.vue b/src/views/index/components/scientific_research_trends.vue index 62a150b..4bf6e80 100644 --- a/src/views/index/components/scientific_research_trends.vue +++ b/src/views/index/components/scientific_research_trends.vue @@ -30,141 +30,31 @@ - + - + + + + + + + + + + + - 科研院关于组织申报国家重点研发计划 + {{ item.title }} -
2021.10.10
+
{{ parseTime(item.publishTime) }}
+
-
+
+
- - - - - 科技部关于发布国家重点研发计划“科 - -
2021.10.22
-
-
-
-
-
-
-
- - - - - - 关于征集适宜向“一带一路”国家转移的… - -
2021.10.21
-
-
-
-
-
-
- - - - - 西南交通大学关于2021年度国家自然 - -
2021.10.07
-
-
-
-
-
-
-
- - - - - - 关于召开2021年度国家自然科学基金项… - -
2021.10.11
-
-
-
-
-
-
- - - - - 关于2021年度四川省科技奖励提名工作… - -
2021.10.30
-
-
-
-
-
-
-
- - - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
-
-
-
- - - - - 国家自然科学基金委员会中德科学中心… - -
2021.10.26
-
-
-
-
-
-
-
- - - - - - 关于征集适宜向“一带一路”国家转移的… - -
2021.10.23
-
-
-
-
-
-
- - - - 科研院关于组织申报国家重点研发计划 - -
2021.08.06
-
-
-
@@ -198,85 +88,20 @@ - + - 《成都市经济和信息化局关于更新完善… + {{item.title}} -
2021.10.01
+
{{ parseTime(item.publishTime) }}
-
+
+
- - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
-
-
-
-
- - - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
-
-
-
- - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
-
-
-
-
- - - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
-
-
-
- - - - - 《成都市经济和信息化局关于更新完善… - -
2021.10.01
-
-
-
@@ -299,13 +124,45 @@ @@ -419,7 +276,7 @@ export default { } } -@media screen and (min-width: 1100px) and (max-width: 1400px) { +@media screen and (min-width: 1100px) and (max-width: 1400px) { .scientific_context_text { padding-left: 2rem !important; @@ -430,7 +287,7 @@ export default { .academia_context_text { padding-left: 2rem !important; - .time{ + .time { margin-left: 2rem !important; } } diff --git a/src/views/index/components/slideshow_card.vue b/src/views/index/components/slideshow_card.vue index 542c5a3..70ca53b 100644 --- a/src/views/index/components/slideshow_card.vue +++ b/src/views/index/components/slideshow_card.vue @@ -1,71 +1,14 @@