Browse Source

收藏夹+demo

master
ruanqi 2 years ago
parent
commit
d1fd3eb678
  1. 32
      src/utils/damo.js
  2. 80
      src/utils/refreshTableColumn.js
  3. 2
      src/views/main-navbar.vue
  4. 2
      src/views/modules/project/demo.vue
  5. 207
      src/views/modules/project/projectInfo/demo.vue
  6. 409
      src/views/modules/project/projectInfo/projectInfo.vue

32
src/utils/damo.js

@ -0,0 +1,32 @@
// import {
// getTableDefaultListLanguage,
// getTableUserListLanguage,
// } from "@/api/table.js"
//
//
//
//
// async function getTableUserColumn2(queryTableUser,tableId, columnList) {
// queryTableUser.tableId=tableId
// await getTableUserListLanguage(queryTableUser).then(({data}) => {
// if (data.rows.length > 0) {
//
// columnList = data.rows
//
// } else {
//
// getTableDefaultListLanguage(queryTableUser).then(({data}) => {
// if (data.rows.length > 0) {
//
// columnList = data.rows
//
// } else {
//
// }
// })
// }
// })
//
// }
//
// export default {getTableUserColumn2}

80
src/utils/refreshTableColumn.js

@ -0,0 +1,80 @@
// import {
// getTableDefaultListLanguage,
// getTableUserListLanguage,
// } from "@/api/table.js"
//
//
// const refreshTableColumn = {
// methods: {
// async getTableUserColumn2(tableId, columnList) {
// debugger
// let queryTableUser = {
// userId: this.$store.state.user.name,
// functionId: this.$route.meta.menuId,
// tableId: tableId,
// status: true,
// languageCode: this.$i18n.locale
// }
// await getTableUserListLanguage(queryTableUser).then(({data}) => {
// if (data.rows.length > 0) {
//
// columnList = data.rows
//
// } else {
// let queryTable= {
// functionId: this.$route.meta.menuId,
// tableId: tableId,
// languageCode: this.$i18n.locale
// }
// getTableDefaultListLanguage(queryTable).then(({data}) => {
// if (!data.rows.length == 0) {
//
// columnList = data.rows
//
// } else {
//
// }
// })
// }
// })
//
// },
// }
// }
//
// export default refreshTableColumn
import {
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
async function getTableUserColumn2(queryTableUser,tableId, columnList) {
queryTableUser.tableId=tableId
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
this.columnList = data.rows
} else {
getTableDefaultListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
this.columnList = data.rows
} else {
}
})
}
})
}
export default {getTableUserColumn2}

2
src/views/main-navbar.vue

@ -352,7 +352,7 @@ export default {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: 'cn'
languageCode: this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {

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

@ -28,7 +28,7 @@
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>

207
src/views/modules/project/projectInfo/demo.vue

@ -1,207 +0,0 @@
<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>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
<a type="text" size="small" @click="deleteHandle(scope.row.id)">删除</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
name: "null",
data() {
return {
//
favorite: false,
//
visible: false,
queryTable: {
functionId: this.$route.meta.menuId,
tableId: "mainTable",
languageCode: this.$i18n.locale
},
// table
queryTableUser: {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: "mainTable",
status: true,
languageCode: this.$i18n.locale
},
//
height: 200,
dataList:[],
dataListLoading: false,
columnList: [
{
userId: this.$store.state.user.name,
functionId: 104001001,
serialNumber: '104001001Table3OrderNo',
tableId: "104001001Table3",
tableName: "生产订单数据获取表",
columnProp: "orderNo",
headerAlign: "center",
align: "left",
columnLabel: "订单号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
}
},
watch: {
// $route: {
// handler: function (val, oldVal) {
// this.$router.onReady(() => {
// if (this.$route.query.order) {
// this.modelData.orderNo = this.$route.query.order
// this.modelData.site = this.$route.query.site
// this.modelData.user = this.$route.query.user
// if (this.modelData.orderNo) {
// this.tableHanddle(this.modelData)
// }
// }
// })
// },
// //
// deep: true
// },
// updateData: {
// deep: true,
// handler: function (newV, oldV) {
// this.updateData.projectID = this.updateData.projectID.toUpperCase();
// this.updateData.oriSOOrderNo = this.updateData.oriSOOrderNo.toUpperCase();
// this.updateData.orderType = this.updateData.orderType.toUpperCase();
// }
// }
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
},
methods: {
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnList1 = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList(tableId, columnId) {
this.queryTable.tableId = tableId
let queryTable= {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnList1 = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true
}
})
},
//
},
created() {
this.getTableUserColumn(this.queryTable.functionId+'table',1)
}
}
</script>
<style scoped>
</style>

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

@ -0,0 +1,409 @@
<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>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
<a type="text" size="small" @click="deleteHandle(scope.row.id)">删除</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
name: "null",
data() {
return {
height: 200,
dataList:[],
dataListLoading: false,
columnList: [
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1ProjectId',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "projectId",
headerAlign: "center",
align: "left",
columnLabel: "项目号",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1ProjectType',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "projectType",
headerAlign: "center",
align: "left",
columnLabel: "项目类型",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1ProjectName',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "projectName",
headerAlign: "center",
align: "left",
columnLabel: "项目名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1Status',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "status",
headerAlign: "center",
align: "left",
columnLabel: "项目状态",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1Priority',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "priority",
headerAlign: "center",
align: "left",
columnLabel: "优先级",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 40
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1ProjectManagerId',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "projectManagerId",
headerAlign: "center",
align: "left",
columnLabel: "项目负责人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1ProjectSource',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "projectSource",
headerAlign: "center",
align: "left",
columnLabel: "项目来源",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1CustomerId',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "customerId",
headerAlign: "center",
align: "left",
columnLabel: "客户代码",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1CustomerName',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "customerName",
headerAlign: "center",
align: "left",
columnLabel: "客户名称",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1CreateDate',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "createDate",
headerAlign: "center",
align: "left",
columnLabel: "创建时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1CreateBy',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "createBy",
headerAlign: "center",
align: "left",
columnLabel: "创建人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1UpdateDate',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "updateDate",
headerAlign: "center",
align: "left",
columnLabel: "修改时间",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table1UpdateBy',
tableId: "101002001Table1",
tableName: "项目信息主表",
columnProp: "updateBy",
headerAlign: "center",
align: "left",
columnLabel: "修改人",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
],
}
},
watch: {
// $route: {
// handler: function (val, oldVal) {
// this.$router.onReady(() => {
// if (this.$route.query.order) {
// this.modelData.orderNo = this.$route.query.order
// this.modelData.site = this.$route.query.site
// this.modelData.user = this.$route.query.user
// if (this.modelData.orderNo) {
// this.tableHanddle(this.modelData)
// }
// }
// })
// },
// //
// deep: true
// },
// updateData: {
// deep: true,
// handler: function (newV, oldV) {
// this.updateData.projectID = this.updateData.projectID.toUpperCase();
// this.updateData.oriSOOrderNo = this.updateData.oriSOOrderNo.toUpperCase();
// this.updateData.orderType = this.updateData.orderType.toUpperCase();
// }
// }
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
},
methods: {
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnList1 = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList(tableId, columnId) {
this.queryTable.tableId = tableId
let queryTable= {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnList1 = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true
}
})
},
//
},
created() {
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save