Browse Source

收藏夹+demo

master
ruanqi 2 years ago
parent
commit
a1c20e9034
  1. 4
      src/store/modules/user.js
  2. 33
      src/views/common/login.vue
  3. 22
      src/views/main-navbar.vue
  4. 12
      src/views/main.vue
  5. 128
      src/views/modules/project/demo.vue
  6. 136
      src/views/modules/project/projectInfo/projectInfo.vue

4
src/store/modules/user.js

@ -9,6 +9,7 @@ export default {
userDev: false,
multiLanguage: '',
authControl: '',
userSite: 0,
},
mutations: {
updateId (state, id) {
@ -23,6 +24,9 @@ export default {
updateSite (state,site){
state.site = site
},
updateUserSite (state,userSite){
state.userSite = userSite
},
updateUserDisplay (state,userDisplay){
state.userDisplay = userDisplay
},

33
src/views/common/login.vue

@ -6,6 +6,18 @@
<h3 class="login-title">用户登陆</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form-item>
<el-select v-model="dataForm.site" style="width: 230px"
placeholder="请选择工厂">
<el-option
v-for="(item,index) in siteList"
:key="index"
:label="item.siteID+' - '+item.siteName"
:value="item.siteID"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
</el-form-item>
@ -25,6 +37,9 @@
<script>
import { getUUID } from '@/utils'
import {getConfigParams} from '@/api/sysConfig.js'
import {
getSiteData,
} from "@/api/base/site.js"
export default {
data () {
return {
@ -33,8 +48,10 @@
userName: '',
password: '',
uuid: '',
captcha: ''
captcha: '',
site:''
},
siteList:[],
dataRule: {
userName: [
{ required: true, message: '帐号不能为空', trigger: 'blur' }
@ -66,8 +83,18 @@
},
created () {
this.userName();
this.getSiteData();
},
methods: {
getSiteData(){
let data={};
getSiteData(data).then(({data}) => {
this.siteList = data.rows
if(this.siteList.length>0){
this.dataForm.site=this.siteList[0].siteID
}
})
},
//
userName(){
this.dataForm.userName = localStorage.getItem('userName')
@ -82,7 +109,8 @@
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid
'uuid': this.dataForm.uuid,
'site': this.dataForm.site,
})
}).then(({data}) => {
if (data && data.code === 0) {
@ -92,6 +120,7 @@
localStorage.setItem('locale', data.language)
localStorage.setItem('refresh', "0")
localStorage.setItem('userName', this.dataForm.userName)
localStorage.setItem('accessSite', this.dataForm.site)
this.getConfigParams()
} else {
this.$message.error(data.msg)

22
src/views/main-navbar.vue

@ -21,6 +21,9 @@
<el-menu
class="site-navbar__menu site-navbar__menu--right"
mode="horizontal">
<el-menu-item class="site-navbar__avatar" index="2">
<span>{{siteNow}}</span>
</el-menu-item>
<el-menu-item class="site-navbar__avatar" index="0">
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
@ -97,11 +100,14 @@ import {
} from "@/api/sysLanguage.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {
getSiteData,
} from "@/api/base/site.js"
export default {
inject: ['refresh'],
data() {
return {
siteNow:'',
favorite: false,
route:this.$route.meta.menuId,
visible: false,
@ -393,11 +399,23 @@ export default {
}
},
getNowSite(){
let data={};
getSiteData(data).then(({data}) => {
if(data.rows.length>0){
for (let i = 0; i <data.rows.length ; i++) {
if(data.rows[i].siteID==this.$store.state.user.site){
this.siteNow="当前工厂:"+data.rows[i].siteID+" - "+data.rows[i].siteName
}
}
}
})
}
},
created() {
this.getLanguageList()
this.getFunctionButtonList()
this. getNowSite()
}
}
</script>

12
src/views/main.vue

@ -80,6 +80,14 @@
this.$store.commit('user/updateSite', val)
}
},
userSite: {
get() {
return this.$store.state.user.userSite
},
set(val) {
this.$store.commit('user/updateUserSite', val)
}
},
languageDefault: {
get() {
return this.$store.state.user.languageDefault
@ -122,9 +130,9 @@
this.loading = false
this.userId = data.user.userId
this.userName = data.user.username
this.site = data.user.site
this.userSite = data.user.site
this.languageDefault = data.user.languageDefault
this.site = data.user.site
this.site =localStorage.getItem("accessSite")
this.userDisplay = data.user.userDisplay
}
})

128
src/views/modules/project/demo.vue

@ -1,7 +1,13 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 33px">查询</el-button>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1031,3)"><a herf="#">工厂编码</a></span>
<el-input v-model="searchData.site" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top: 33px">查询</el-button>
</el-form-item>
</el-form>
<el-table
@ -14,6 +20,7 @@
header-align="center"
align="center"
width="150"
fixed="right"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
@ -38,6 +45,17 @@
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -47,15 +65,30 @@
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import Chooselist from '@/views/modules/common/Chooselist'
import { } from "@/api/table.js"
export default {
name: "null",
data() {
return {
searchData:{
page: 1,
limit: 10,
},
height: 200,
dataList:[],
dataListLoading: false,
// start
exportData: [],
exportName: "项目清单" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["项目清单"],
exportFooter: [],
exportList:[],
tagNo:'',
tagNo2:'',
pageIndex: 1,
pageSize: 100,
totalPage: 0,
columnList1: [
{
userId: this.$store.state.user.name,
@ -111,6 +144,95 @@
})
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo2 = type
this.$nextTick(() => {
let strVal = ''
if (val === 26) {
if(type==1) {
strVal = this.saveHeaderData.operatorId
}else if(type==2){
strVal = this.saveHeaderData.operatorId2
}else {
strVal = this.searchData.operatorName
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 26) {
if(this.tagNo2==1) {
this.saveHeaderData.operatorId = val.OperatorID
this.saveHeaderData.operatorName = val.OperatorName
}else if(this.tagNo2==2){
this.saveHeaderData.operatorId2 = val.OperatorID
this.saveHeaderData.operatorIdName2 = val.OperatorName
}else {
this.searchData.operatorName = val.OperatorName
}
}
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await eamWorkPlanSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
search () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
eamWorkPlanSearch(this.searchData).then(({data}) => {
if (data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {

136
src/views/modules/project/projectInfo/projectInfo.vue

@ -1,7 +1,13 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 33px">查询</el-button>
<el-form-item >
<span slot="label" style="" @click="getBaseList(1031,3)"><a herf="#">工厂编码</a></span>
<el-input v-model="searchData.site" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top: 33px">查询</el-button>
</el-form-item>
</el-form>
<el-table
@ -14,6 +20,7 @@
header-align="center"
align="center"
width="150"
fixed="right"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
@ -38,6 +45,17 @@
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 1000]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -47,17 +65,34 @@
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import Chooselist from '@/views/modules/common/Chooselist'
import { } from "@/api/table.js"
export default {
components: {
Chooselist
},
name: "null",
data() {
return {
searchData:{
page: 1,
limit: 10,
},
height: 200,
dataList:[],
dataListLoading: false,
// start
exportData: [],
exportName: "项目清单" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["项目清单"],
exportFooter: [],
exportList:[],
tagNo:'',
tagNo2:'',
pageIndex: 1,
pageSize: 100,
totalPage: 0,
// end
columnList1: [
{
userId: this.$store.state.user.name,
@ -330,6 +365,95 @@
})
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo2 = type
this.$nextTick(() => {
let strVal = ''
if (val === 26) {
if(type==1) {
strVal = this.saveHeaderData.operatorId
}else if(type==2){
strVal = this.saveHeaderData.operatorId2
}else {
strVal = this.searchData.operatorName
}
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
if (this.tagNo === 26) {
if(this.tagNo2==1) {
this.saveHeaderData.operatorId = val.OperatorID
this.saveHeaderData.operatorName = val.OperatorName
}else if(this.tagNo2==2){
this.saveHeaderData.operatorId2 = val.OperatorID
this.saveHeaderData.operatorIdName2 = val.OperatorName
}else {
this.searchData.operatorName = val.OperatorName
}
}
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await eamWorkPlanSearch(this.searchData).then(({data}) => {
this.exportList= data.page.list;
})
return this.exportList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
},
fields() {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
//
search () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
eamWorkPlanSearch(this.searchData).then(({data}) => {
if (data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
@ -389,7 +513,7 @@
// break;
}
} else {
// this.showDefault = true
// this.showDefault = true.
}
})

Loading…
Cancel
Save