Browse Source

页面优化

master
zhanyunjiu 3 years ago
parent
commit
c4c1a1bd76
  1. 3
      src/main.js
  2. 2
      src/views/farm/cropRecord/index.vue
  3. 30
      src/views/farm/logMsg/index.vue
  4. 2
      src/views/farm/workHour/index.vue

3
src/main.js

@ -65,6 +65,9 @@ import DocAlert from '@/components/DocAlert'
// 头部标签插件
import VueMeta from 'vue-meta'
//去除谷歌浏览器 scroll-blocking 警告
import 'default-passive-events'
Vue.use(VueAreaLinkage);
Vue.use(directive)
Vue.use(plugins)

2
src/views/farm/cropRecord/index.vue

@ -42,7 +42,7 @@
<el-table-column label="序列号" align="center" prop="id" />
<el-table-column label="作物名" align="center" prop="resourceType" >
<template slot-scope="scope">
<span> {{cropList.find(t=>t.id == scope.row.cropId ).name}} </span>
<span v-if="scope.row.cropId"> {{cropList.find(t=>t.id == scope.row.cropId ).name}} </span>
</template>
</el-table-column>
<el-table-column label="出入库" align="center" prop="type" />

30
src/views/farm/logMsg/index.vue

@ -26,10 +26,10 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['farm:log-msg:create']">新增</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['farm:log-msg:export']">导出</el-button>
@ -41,8 +41,14 @@
<el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" />
<el-table-column label="类型" align="center" prop="type" />
<el-table-column label="操作" align="center" prop="operation" />
<el-table-column label="标题" align="center" prop="title" />
<el-table-column label="用户id" align="center" prop="userId" />
<el-table-column label="任务内容" align="center" prop="msg" />
<el-table-column label="用户" align="center" prop="userId">
<template slot-scope="scope">
<span>{{ userConver(scope.row.userId)}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -86,6 +92,7 @@
<script>
import { createLogMsg, updateLogMsg, deleteLogMsg, getLogMsg, getLogMsgPage, exportLogMsgExcel } from "@/api/farm/logMsg";
import {listUser} from "@/api/system/user";
export default {
name: "LogMsg",
@ -120,7 +127,9 @@ export default {
form: {},
//
rules: {
}
},
systemUserList:[]
};
},
created() {
@ -138,8 +147,17 @@ export default {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
this.getSysUserList();
});
},
getSysUserList(){
listUser({
pageNo:1,
pageSize:200
}).then(res=>{
this.systemUserList = res.data.list;
})
},
/** 取消按钮 */
cancel() {
this.open = false;
@ -230,6 +248,10 @@ export default {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
userConver(userId){
let sa = this.systemUserList.filter(user => user.id == userId)[0];
return sa == undefined ? userId : sa.nickname;
}
}
};

2
src/views/farm/workHour/index.vue

@ -43,7 +43,7 @@
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="员工名" align="center" prop="userId" >
<template slot-scope="scope">
<span>{{userConvert(scope.row.userId)}}</span>
<span v-if="scope.row.userId">{{userConvert(scope.row.userId)}}</span>
</template>
</el-table-column>
<el-table-column label="项目名" align="center" prop="projectId" >

Loading…
Cancel
Save