Browse Source

更新 登陆语言刷新操作

master
[li_she] 4 years ago
parent
commit
1a30736631
  1. 15
      package-lock.json
  2. 3
      package.json
  3. 6
      src/assets/scss/global.scss
  4. 156
      src/element-ui/index.js
  5. 3
      src/main.js
  6. 4
      src/views/common/home.vue
  7. 2
      src/views/common/login.vue
  8. 6
      src/views/main-navbar-update-language.vue
  9. 6
      src/views/modules/factory/tblbasedata.vue
  10. 2
      src/views/modules/purchaseorder/procurementReview.vue
  11. 2
      src/views/modules/sys/language/common.vue
  12. 45
      src/views/modules/sys/log.vue
  13. 5
      src/views/modules/sys/user-add-or-update.vue

15
package-lock.json

@ -3545,6 +3545,11 @@
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
"decimal.js": {
"version": "10.3.1",
"resolved": "https://r.cnpmjs.org/decimal.js/download/decimal.js-10.3.1.tgz",
"integrity": "sha1-2MOkRKnGd0umDKatcmHDqU/V54M="
},
"decode-uri-component": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
@ -16349,6 +16354,11 @@
"safe-buffer": "^5.1.2"
}
},
"pubsub-js": {
"version": "1.9.3",
"resolved": "https://r.cnpmjs.org/pubsub-js/download/pubsub-js-1.9.3.tgz",
"integrity": "sha1-Z07qTVaNBALgUnzbEOKqt7VWIdI="
},
"pump": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
@ -19470,6 +19480,11 @@
"integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
"dev": true
},
"vue-i18n": {
"version": "8.25.0",
"resolved": "https://r.cnpmjs.org/vue-i18n/download/vue-i18n-8.25.0.tgz",
"integrity": "sha1-EDfZKV+ihFojC3cd5HNIHtss/Ew="
},
"vue-jest": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/vue-jest/-/vue-jest-1.0.2.tgz",

3
package.json

@ -17,6 +17,7 @@
"axios": "0.17.1",
"babel-plugin-component": "0.10.1",
"babel-polyfill": "6.26.0",
"decimal.js": "^10.3.1",
"element-ui": "2.8.2",
"file-saver": "^2.0.5",
"gulp": "4.0.2",
@ -27,10 +28,12 @@
"lodash": "4.17.5",
"node-sass": "4.13.1",
"npm": "^6.9.0",
"pubsub-js": "^1.9.3",
"sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3",
"vue": "2.5.16",
"vue-cookie": "1.1.4",
"vue-i18n": "^8.25.0",
"vue-json-excel": "^0.3.0",
"vue-router": "3.0.1",
"vuex": "3.0.1",

6
src/assets/scss/global.scss

@ -105,6 +105,7 @@
display: inline-block;
text-align: left;
padding: 0px 0 0px;
}
/* el-form-item 间距 end*/
@ -122,4 +123,9 @@
}
/* el-form-item 间距 end*/
/* 提示消息 start */
.el-message{
margin-top: 20%;
}
/* end */

156
src/element-ui/index.js

@ -1,13 +1,6 @@
/**
* UI组件, 统一使用饿了么桌面端组件库(https://github.com/ElemeFE/element)
*
* 使用:
* 1. 项目中需要的组件进行释放(解开注释)
*
* 注意:
* 1. 打包只会包含释放(解开注释)的组件, 减少打包文件大小
*/
import Vue from 'vue'
import Vue from 'vue';
import Element from 'element-ui';
Vue.use(Element, { size: 'small', zIndex: 1000 });
import {
Pagination,
Dialog,
@ -76,81 +69,80 @@ import {
MessageBox,
Message,
Notification
} from 'element-ui'
} from 'element-ui';
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Autocomplete)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(OptionGroup)
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(DatePicker)
Vue.use(TimeSelect)
Vue.use(TimePicker)
Vue.use(Popover)
Vue.use(Tooltip)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Alert)
Vue.use(Slider)
Vue.use(Icon)
Vue.use(Row)
Vue.use(Col)
Vue.use(Upload)
Vue.use(Progress)
Vue.use(Badge)
Vue.use(Card)
Vue.use(Rate)
Vue.use(Steps)
Vue.use(Step)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.use(Cascader)
Vue.use(ColorPicker)
Vue.use(Transfer)
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(Footer)
Vue.use(Pagination);
Vue.use(Dialog);
Vue.use(Autocomplete);
Vue.use(Dropdown);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Menu);
Vue.use(Submenu);
Vue.use(MenuItem);
Vue.use(MenuItemGroup);
Vue.use(Input);
Vue.use(InputNumber);
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(RadioButton);
Vue.use(Checkbox);
Vue.use(CheckboxButton);
Vue.use(CheckboxGroup);
Vue.use(Switch);
Vue.use(Select);
Vue.use(Option);
Vue.use(OptionGroup);
Vue.use(Button);
Vue.use(ButtonGroup);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(DatePicker);
Vue.use(TimeSelect);
Vue.use(TimePicker);
Vue.use(Popover);
Vue.use(Tooltip);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Tag);
Vue.use(Tree);
Vue.use(Alert);
Vue.use(Slider);
Vue.use(Icon);
Vue.use(Row);
Vue.use(Col);
Vue.use(Upload);
Vue.use(Progress);
Vue.use(Badge);
Vue.use(Card);
Vue.use(Rate);
Vue.use(Steps);
Vue.use(Step);
Vue.use(Carousel);
Vue.use(CarouselItem);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Cascader);
Vue.use(ColorPicker);
Vue.use(Container);
Vue.use(Header);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Footer);
Vue.use(Loading.directive)
Vue.use(Loading.directive);
Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$notify = Notification
Vue.prototype.$message = Message
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
Vue.prototype.$ELEMENT = { size: 'medium' }

3
src/main.js

@ -15,9 +15,8 @@ import i18n from '@/i18n/i18n'
import './directives'
import decimalUtil from '@/utils/decimalUtil.js'
Vue.component('downloadExcel', JsonExcel)
Vue.component('downloadExcel', JsonExcel)
Vue.use(VueCookie)
Vue.config.productionTip = false

4
src/views/common/home.vue

@ -17,8 +17,8 @@
languageRefresh(){
let bool = localStorage.getItem('refresh')
if (bool == '0'){
this.$router.go(0);
localStorage.setItem('refresh','1')
// this.$router.go(0);
// localStorage.setItem('refresh','1')
}
}
},

2
src/views/common/login.vue

@ -4,6 +4,7 @@
<div class="site-content">
<div class="login-main">
<h3 class="login-title">用户登陆</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
@ -26,6 +27,7 @@
export default {
data () {
return {
src: 'http://192.168.1.83/upload/ifs.png',
dataForm: {
userName: '',
password: '',

6
src/views/main-navbar-update-language.vue

@ -27,6 +27,7 @@
<script>
import {updateUserLanguage} from '@/api/user.js'
import PubSub from 'pubsub-js'
export default {
data() {
@ -65,7 +66,10 @@
dataFormSubmit() {
updateUserLanguage(this.dataForm).then(({data}) => {
if (data.code == 0) {
this.$router.replace({name: 'login'})
language: localStorage.setItem('locale',this.dataForm.languageDefault)
this.$router.go(0);
// PubSub.publish('search',this.dataForm.languageDefault )
// this.$router.replace({name: 'login'})
}
})
}

6
src/views/modules/factory/tblbasedata.vue

@ -83,7 +83,9 @@ import {
} from "@/api/table.js"
import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFavorite.js'
import AddOrUpdate from './tblbasedata-add-or-update'
export default {
data () {
return {
queryData:{
@ -350,7 +352,8 @@ import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFa
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
addOrUpdateVisible: false,
}
},
components: {
@ -366,6 +369,7 @@ import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFa
this.getDataList()
},
methods: {
//
addOrUpdateBase(){

2
src/views/modules/purchaseorder/procurementReview.vue

@ -123,7 +123,7 @@
<el-dialog title="申请单审核" :visible.sync="setUp.reviewFlag" width="520px" :close-on-click-modal="false"
v-drag>
<el-steps :active="active" style="margin: 40px">
<el-step v-for=" (item,index) in reviewStepList" :title="item.userName"></el-step>
<el-step v-for=" (item,index) in reviewStepList" :key="index" :title="item.userName"></el-step>
</el-steps>

2
src/views/modules/sys/language/common.vue

@ -474,7 +474,7 @@ import column from "../../common/column";
printReport(){
this.decimalUtil.sub(100,50)
alert( this.$store.state.user.site)
alert( this.decimalUtil.sub(100,50))
alert( this.decimalUtil.sub(100,50))
//
// const LODOP = getLodop()
// if (LODOP) {

45
src/views/modules/sys/log.vue

@ -11,7 +11,9 @@
<el-table
:data="dataList"
:height="tableHeight"
ref="wt_table"
@mouseenter.native="mouseEnter"
@mouseleave.native="mouseLeave"
border
v-loading="dataListLoading"
style="width: 100%">
@ -84,6 +86,7 @@
</template>
<script>
let rolltimer = '' //
export default {
data () {
return {
@ -96,11 +99,16 @@
totalPage: 0,
dataListLoading: false,
selectionDataList: [],
tableHeight: 0
tableHeight: 0,
//
refreshTime: 5,
rollTime: 5,
rollPx: 1,
}
},
created () {
this.getDataList()
this.autoRoll()
},
mounted() {
this.$nextTick(() => {
@ -109,6 +117,38 @@
})
},
methods: {
//
mouseEnter(time) {
//
this.autoRoll(true)
},
//
mouseLeave() {
//
this.autoRoll()
},
//
autoRoll(stop) {
if (stop) {
clearInterval(rolltimer)
return
}
// DOM
const table = this.$refs.wt_table
// div
const divData = table.bodyWrapper
//
rolltimer = setInterval(() => {
//
divData.scrollTop = this.decimalUtil.add(Number(divData.scrollTop),Number(this.rollPx))
// (+=)
if (divData.clientHeight + divData.scrollTop >= divData.scrollHeight) {
// table
divData.scrollTop = 0
}
}, this.rollTime * 10)
},
//
getDataList () {
this.dataListLoading = true
@ -124,6 +164,7 @@
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0

5
src/views/modules/sys/user-add-or-update.vue

@ -62,7 +62,7 @@
</el-form-item>
</el-form>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer" class="dialog-footer" >
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
@ -99,6 +99,7 @@ export default {
}
},
methods: {
//
getLanguageList() {
let queryLanguage = {}
@ -106,6 +107,7 @@ export default {
this.languageList = data.rows
})
},
//
factoryList() {
getFactory().then(({data}) => {
@ -133,6 +135,7 @@ export default {
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userName = data.user.username
this.dataForm.salt = data.user.salt

Loading…
Cancel
Save