Browse Source

个性导出设置页面条件开发+右侧操作列基础编辑删除开发

noToken
安虹睿 1 year ago
parent
commit
cb2a6182a0
  1. 2
      PC/InterFace.Dash/src/components/currenForm/index.vue
  2. 1
      PC/InterFace.Dash/src/components/umyTable/index.vue
  3. 15
      PC/InterFace.Dash/src/filters/status.js
  4. 47
      PC/InterFace.Dash/src/mixins/TableMixins.js
  5. 2
      PC/InterFace.Dash/src/mixins/newAndEdiDialogMixins.js
  6. 1
      PC/InterFace.Dash/src/store/getters.js
  7. 8
      PC/InterFace.Dash/src/store/modules/permission.js
  8. 4
      PC/InterFace.Dash/src/utils/index.js
  9. 212
      PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting copy.vue
  10. 132
      PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue

2
PC/InterFace.Dash/src/components/currenForm/index.vue

@ -171,7 +171,7 @@
>
<el-option
v-for="(op, index) in selectOptions(item.options) ||
searchOptions['options']"
item.userOptions"
:label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value"
:key="index"

1
PC/InterFace.Dash/src/components/umyTable/index.vue

@ -60,6 +60,7 @@
:key="indexButton"
type="text"
size="mini"
:style="{color:itemButton.color || '#409EFF'}"
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>

15
PC/InterFace.Dash/src/filters/status.js

@ -1445,6 +1445,21 @@ export function whetherOrNot(index, prop) {
}
return Enum(filter, index, prop)
}
export function whetherOrNotForNum(index, prop) {
let filter = {
1: {
label: "是",
value: 1,
background:"#31BB99",
},
0: {
label: "否",
value: 0,
background:"#EC5B28",
},
}
return Enum(filter, index, prop)
}
/**
* @returns {object} '基本状态'
*/

47
PC/InterFace.Dash/src/mixins/TableMixins.js

@ -57,6 +57,53 @@ export const tableMixins = {
}
},
methods: {
// 主表-右侧操作列基础按钮
buttonOperationList_rightBase(data){
return [{
label:'编辑',
name:'edit',
},{
label:'删除',
name:'delete',
color:'red'
}]
},
// 主表-右侧操作列基础按钮操作
buttonOperationClick_right(row,item){
// 编辑
if (item.name == "edit") {
this.formTitle = this.$route.meta.title + "编辑";
this.formReveal = false
this.theEvent = "edit"
const listAssign = (arr1, arr2) => {
Object.keys(arr1).forEach(item => {
arr1[item] = arr2[item]
})
}
listAssign(this.editFormData, row)
this.displayDialog.editDialog = true
}
// 删除
else if (item.name == "delete"){
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.Loading.tableLoading = true
let _url = this.URLOption_delete ? this.URLOption_delete : this.URLOption_base + '/delete-by-id'
postDelete(row.id, _url).then(res => {
this.$successMsg('删除成功!')
this.Loading.tableLoading = false
this.paging()
}).catch(err => {
this.Loading.tableLoading = false
})
}).catch(() => {
this.Loading.tableLoading = false
});
}
},
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
// initApiColumns(table,des,detailsTable,detailsPage){
// // 赋值表头数据

2
PC/InterFace.Dash/src/mixins/newAndEdiDialogMixins.js

@ -71,7 +71,7 @@ export const newAndEdiDialogMixins = {
break;
case false:
if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'}
postUpdate(this.editFormData, this.propsData.id, _url).then(res => {
postUpdate(this.editFormData, this.editFormData.id, _url).then(res => {
this.propsData = res
this.Loading.newAndEdiLoading = false
this.FormResult("success")

1
PC/InterFace.Dash/src/store/getters.js

@ -11,6 +11,7 @@ const getters = {
roles: state => state.user.roles,
currentUserInfo: state => state.user.userInfo,//当前用户信息
permission_routes: state => state.permission.routes,//接口获取的菜单
tablesName:state => state.permission.tablesName,//接口获取所有的表名
errorLogs: state => state.errorLog.logs,
dictionaries: state => state.dictionaries.dict,
enumList: state => state.definition.enumList,//接口获取的枚举

8
PC/InterFace.Dash/src/store/modules/permission.js

@ -62,13 +62,17 @@ export function filterAsyncRoutes(routes, roles) {
const state = {
routes: [],
addRoutes: []
addRoutes: [],
tablesName:null,//所有的表名
}
const mutations = {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
},
SET_TABLESNAME: (state, data) => {
state.tablesName = data
}
}
// todo-new:有token后使用generateRoutes,去掉下方一行代码
@ -177,6 +181,8 @@ const actions = {
_menuList.push(item.substring(item.indexOf('.') + 1,item.length))
}
}
// 存储所有的表名
commit('SET_TABLESNAME', _menuList)
// todo-new:接口获取 接口没有走配置文件
let _noShowMenus = null//不显示的菜单
_noShowMenus = localStorage.getItem('menuHiddenConfig').split(',')

4
PC/InterFace.Dash/src/utils/index.js

@ -561,8 +561,8 @@ export function createNewTabs (url) {
// faster-new
// 转义及读取api接口返回的表头信息
export function initFromApiColumnsLable (data) {
let _Dashboard = store.getters.columZHList
return _Dashboard ? _Dashboard[data] : null
let _list = store.getters.columZHList
return _list ? _list[data] : data
}
// 首字母转换 type='Lower'(小写,默认) Upper(大写)

212
PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting copy.vue

@ -0,0 +1,212 @@
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="apiColumns_Table"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
@buttonOperationClick_left="buttonOperationClick_left"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
:buttonOperationList_left="operationButtonsTable"
>
<!-- <div slot="tableTopSlot">
上方按钮插槽位置预留
</div>
<div slot="searchPrimarySlot">
普通初级搜索插槽位置预留
</div> -->
<!-- <template>表格内容插槽位置预留</template> -->
</tablePagination>
<!-- 新增与编辑 -->
<newAndEdiDialog
:loading="Loading.newAndEdiLoading"
:active="active"
:pageStatus="pageStatus"
:formReveal="formReveal"
:formTitle="formTitle"
:displayDialog="editDialog"
:FormData="formReveal ? CreateFormData : editFormData"
:Form="formReveal ? CreateForm : editForm"
:Options="editOptions"
:Handle="editHandle"
:Rules="formReveal ? editRules.cerateRule : editRules.editRule"
@FormSubmit="FormSubmit"
@close="FormClose"
@goBack="goBack"
></newAndEdiDialog>
<!-- 搜索按钮窗体组件 -->
<searchPage
ref="searchTable"
:tableLoading="Loading.autoTableLoading"
:advancedFilter="advancedFilter()"
:filterPageListParams="filterPageListParams"
:formTitle="searchTitle"
:displayDialog="displayDialog.AddNewDialog"
:searchTableData="searchData"
:searchTableColumns="searchColumns"
:searchTotalCount="searchTotalCount"
:supplierItemPage="searchPageListParams"
@handleSelectionChange="prepareFormData"
@SizeChange="searchAlterResultCount($event, searchPageListParams)"
@CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)"
@tableButtonClick="searchSubmit(arguments)"
></searchPage>
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用-->
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 -->
<importFile
:loading="Loading.importLoading"
:show="displayDialog.importDialog"
:disabledMethod = {method1:false,method2:false,method3:false}
:disabledIsAllowPartImport = {isAllowPartImport1:false,isAllowPartImport2:false}
isAllowPartImportValue="1"
@importClick="postImportMergeClick(arguments)"
@postImportDown="importDown"
></importFile>
<!--抽屉-->
<curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:dropdownData="dropdownData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:firstTabs="firstTabs"
:totalCount="totalCountDetails"
:currentPage="oldSkipCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer>
<!-- <curren-Drawer
:title="apiColumns_DesTions"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:dropdownData="dropdownData"
:propsData="propsData"
:tableLoading="tableLoading"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:firstTabs="firstTabs"
></curren-Drawer> -->
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { initFromApiColumnsLable } from '@/utils/index'
// import { getExportConfigList } from '@/api/wms-interface'
export default {
name: "ExportCustomUserSetting",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
computed: {
editDialog: {
get: function () {
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
},
data () {
const userInfo=this.$store.getters.currentUserInfo
return {
tableLoading:false,
//
currenButtonData: [
this.defaultAddBtn(),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
//
CreateFormData: {
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnName: null,
exportTableName: null,
},
//
editFormData: {
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnName: null,
exportTableName: null,
},
editOptions: {},
CreateForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label:initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
],
editRules: {
cerateRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
},
editRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
}
},
};
},
mounted () {
this.paging();
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>

132
PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue

@ -26,11 +26,13 @@
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
:buttonOperationList_left="operationButtonsTable"
:buttonOperationList_right="buttonOperationList_rightBase"
@buttonOperationClick_right="buttonOperationClick_right"
>
<!-- <div slot="tableTopSlot">
上方按钮插槽位置预留
</div>
<div slot="searchPrimarySlot">
</div> -->
<!-- <div slot="searchPrimarySlot">
普通初级搜索插槽位置预留
</div> -->
<!-- <template>表格内容插槽位置预留</template> -->
@ -51,6 +53,7 @@
@FormSubmit="FormSubmit"
@close="FormClose"
@goBack="goBack"
@changeSelect="changeSelect"
></newAndEdiDialog>
<!-- 搜索按钮窗体组件 -->
<searchPage
@ -89,8 +92,8 @@
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:Butttondata="[]"
:propsData="propsData"
:dropdownData="dropdownData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@ -119,20 +122,21 @@
:firstTabs="firstTabs"
></curren-Drawer> -->
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { initFromApiColumnsLable } from '@/utils/index'
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import { initFromApiColumnsLable,firstWordSizeChange } from '@/utils/index'
import { getPageList } from '@/api/wms-api'
// import { getExportConfigList } from '@/api/wms-interface'
// import { getExportConfigList } from '@/api/wms-interface'
export default {
export default {
name: "ExportCustomUserSetting",
mixins: [
tableMixins,
@ -146,6 +150,13 @@
computed: {
editDialog: {
get: function () {
//
if(this.formReveal){
if(this.CreateFormData.exportColumnName)this.CreateFormData.exportColumnNameArr = this.CreateFormData.exportColumnName.split(" ")
}else{
if(this.editFormData.exportColumnName)this.editFormData.exportColumnNameArr = this.editFormData.exportColumnName.split(" ")
if(this.editFormData.exportTableName){this.getColumList()}
}
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
@ -166,47 +177,114 @@
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnNameArr:null,
exportColumnName: null,
exportTableName: null,
},
//
editFormData: {
id:null,
customUserSetting: null,
exportUserName: userInfo.name,
exportUserId: userInfo.id,
exportColumnNameArr:null,
exportColumnName: null,
exportTableName: null,
},
editOptions: {},
CreateForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
// { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
// { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
// { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", options: "whetherOrNotForNum", colSpan: 12 },
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", userOptions: this.initTablesName(), colSpan: 12 },
{ type: "select", disabled:true, multiple:true, label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnNameArr", userOptions:null, colSpan: 12 },
],
editForm: [
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 },
{ type: "input", label:initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 },
{ type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 },
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", options: "whetherOrNotForNum", colSpan: 12 },
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", userOptions: this.initTablesName(), colSpan: 12 },
{ type: "select", multiple:true, label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnNameArr", userOptions:null, colSpan: 12 },
],
editRules: {
cerateRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnNameArr: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
},
editRule: {
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }],
exportColumnNameArr: [{ required: true, trigger: "blur", message: "不可为空" }],
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }],
}
},
columsList:[],
};
},
mounted () {
this.paging();
},
};
</script>
<style lang="scss" scoped>
methods:{
// /
initTablesName(){
let _names = this.$store.getters.tablesName
let tablesList = []
_names.forEach(item=>{
let _item = {
// label:initFromApiColumnsLable(item),
label:item,
value:item
}
tablesList.push(_item)
})
return tablesList
},
changeSelect(prop,val){
//
if(prop=='exportTableName'){
if(this.formReveal){
this.CreateForm[2].disabled = false
this.CreateFormData.exportColumnNameArr = []
}else{
this.editForm[2].disabled = false
this.editFormData.exportColumnNameArr = []
}
this.getColumList()
}
//
if(prop == 'exportColumnNameArr'){
let _val = val.join(' ')
if(this.formReveal){
this.CreateFormData.exportColumnName = _val
}else{
this.editFormData.exportColumnName = _val
}
}
},
getColumList(){
let val = this.formReveal ? this.CreateFormData.exportTableName : this.editFormData.exportTableName
getPageList(this.PageListParams, val+'/base').then(res=>{
let _column = res.items[0]
this.columsList = []
for(let item in _column){
if(item != 'detail' || item != 'details'){
let _item = {
// label:initFromApiColumnsLable(val+firstWordSizeChange(item,'Upper')),
label:item,
value:item
}
this.columsList.push(_item)
}
}
if(this.formReveal){
this.CreateForm[2].userOptions = this.columsList
}else{
this.editForm[2].userOptions = this.columsList
}
})
}
}
};
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>
</style>
Loading…
Cancel
Save