Browse Source

收藏夹+demo

master
ruanqi 2 years ago
parent
commit
5e3f623cdc
  1. 1
      src/main.js
  2. 32
      src/utils/damo.js
  3. 80
      src/utils/refreshTableColumn.js
  4. 28
      src/views/modules/project/demo.vue
  5. 9
      src/views/modules/project/projectInfo/projectInfo.vue

1
src/main.js

@ -37,7 +37,6 @@ Vue.prototype.decimalUtil = decimalUtil // 计算
Vue.prototype.dayjs = dayjs //时间格式化插件 2021-11-02 Vue.prototype.dayjs = dayjs //时间格式化插件 2021-11-02
Vue.prototype.debounce = debounce // 防抖 Vue.prototype.debounce = debounce // 防抖
Vue.prototype.throttle = throttle // 限流 Vue.prototype.throttle = throttle // 限流
// 保存整站vuex本地储存初始状态 // 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state) window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

32
src/utils/damo.js

@ -1,32 +0,0 @@
// 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

@ -1,80 +0,0 @@
// 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}

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

@ -53,28 +53,10 @@
name: "null", name: "null",
data() { data() {
return { 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, height: 200,
dataList:[], dataList:[],
dataListLoading: false, dataListLoading: false,
columnList: [
columnList1: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 104001001, functionId: 104001001,
@ -174,16 +156,16 @@
if (!data.rows.length == 0) { if (!data.rows.length == 0) {
switch (columnId) { switch (columnId) {
case 1: case 1:
this.columnList = data.rows
this.columnList1 = data.rows
break; break;
// case 2: // case 2:
// this.columnList1 = data.rows
// this.columnList2 = data.rows
// break; // break;
// case 3: // case 3:
// this.columnList2 = data.rows
// this.columnList3 = data.rows
// break; // break;
// case 4: // case 4:
// this.columnList3 = data.rows
// this.columnList4 = data.rows
// break; // break;
} }
} else { } else {

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

@ -21,7 +21,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="(item,index) in columnList" :key="index"
v-for="(item,index) in columnList1" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
:prop="item.columnProp" :prop="item.columnProp"
:header-align="item.headerAlign" :header-align="item.headerAlign"
@ -58,7 +58,7 @@
dataList:[], dataList:[],
dataListLoading: false, dataListLoading: false,
columnList: [
columnList1: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 101002001, functionId: 101002001,
@ -344,7 +344,7 @@
//this.columnList = [] //this.columnList = []
switch (columnId) { switch (columnId) {
case 1: case 1:
this.columnList = data.rows
this.columnList1 = data.rows
break; break;
// case 2: // case 2:
// this.columnList1 = data.rows // this.columnList1 = data.rows
@ -376,7 +376,7 @@
if (!data.rows.length == 0) { if (!data.rows.length == 0) {
switch (columnId) { switch (columnId) {
case 1: case 1:
this.columnList = data.rows
this.columnList1 = data.rows
break; break;
// case 2: // case 2:
// this.columnList1 = data.rows // this.columnList1 = data.rows
@ -400,6 +400,7 @@
}, },
created() { created() {
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
} }
} }
</script> </script>

Loading…
Cancel
Save