diff --git a/epmet-oper-web/src/js/columns/productConfig/footBar.js b/epmet-oper-web/src/js/columns/productConfig/footBar.js index 7706114..e397a71 100644 --- a/epmet-oper-web/src/js/columns/productConfig/footBar.js +++ b/epmet-oper-web/src/js/columns/productConfig/footBar.js @@ -53,9 +53,10 @@ export default { fixed: false, block: true, width: 100, - tableType: 'image', - imgWidth: '40px', - imgHeight: '40px' + tableType: 'bcImage', + bcColor:'#e3271c', + imgWidth: '20px', + imgHeight: '25px' }, { key: 'display', @@ -122,6 +123,18 @@ export default { imgWidth: '40px', imgHeight: '40px' }, + { + key: 'floatIconPath', + title: '浮起图标', + display: ['formA', 'formU', 'table', 'model'], + fixed: false, + block: true, + width: 100, + tableType: 'bcImage', + bcColor:'#e3271c', + imgWidth: '20px', + imgHeight: '25px' + }, { key: 'display', title: '状态', diff --git a/epmet-oper-web/src/views/components/CTableNoPage.vue b/epmet-oper-web/src/views/components/CTableNoPage.vue index 86720f1..a3f193c 100644 --- a/epmet-oper-web/src/views/components/CTableNoPage.vue +++ b/epmet-oper-web/src/views/components/CTableNoPage.vue @@ -68,6 +68,29 @@ + + + + + + + + + + - diff --git a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue index 4b7d6bf..3057a23 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue @@ -171,11 +171,8 @@ export default { RoleAuth }, activated () { - if (this.showType === 'footbar') { - this.$nextTick(() => { - this.$refs['ref_footbarlist'].doLayout() // 解决表格错位 - }) - } else if (this.showType === 'list') { + + if (this.showType === 'list') { this.$nextTick(() => { this.$refs['ref_customertable'].doLayout() // 解决表格错位 }) @@ -240,6 +237,9 @@ export default { showFootbar (customerId, customerName) { this.showType = 'footbar' this.$refs['ref_footbarlist'].initData(customerId, customerName) + this.$nextTick(() => { + this.$refs['ref_footbarlist'].doLayout() // 解决表格错位 + }) }, // most配置 showMost (customerId, customerName) { diff --git a/epmet-oper-web/src/views/modules/customer/customize/FootbarEdit.vue b/epmet-oper-web/src/views/modules/customer/customize/FootbarEdit.vue deleted file mode 100644 index 92c973f..0000000 --- a/epmet-oper-web/src/views/modules/customer/customize/FootbarEdit.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - {{dataForm.defaultName}} - - - - - - - - - - {{dataForm.defaultPageTitle}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('cancel') }} - {{ $t('confirm') }} - - - - - - - diff --git a/epmet-oper-web/src/views/modules/customer/customize/FootbarList.vue b/epmet-oper-web/src/views/modules/customer/customize/FootbarList.vue deleted file mode 100644 index 7e9e250..0000000 --- a/epmet-oper-web/src/views/modules/customer/customize/FootbarList.vue +++ /dev/null @@ -1,332 +0,0 @@ - - - - - {{customerName}} - 取消返回 - 自定义初始化 - - - - - - - - - - - - - - - - - - - - - - - diff --git a/epmet-oper-web/src/views/modules/customer/customize/StartPage copy.vue b/epmet-oper-web/src/views/modules/customer/customize/StartPage copy.vue deleted file mode 100644 index 02122bb..0000000 --- a/epmet-oper-web/src/views/modules/customer/customize/StartPage copy.vue +++ /dev/null @@ -1,290 +0,0 @@ - - - - - {{customerName}} - 取消返回 - 自定义初始化 - - - - - - - - diff --git a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault.vue b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault111.vue similarity index 100% rename from epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault.vue rename to epmet-oper-web/src/views/modules/productConfig/footbar/FootbarDefault111.vue diff --git a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue index a75e1af..58aca2b 100644 --- a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue +++ b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarEdit.vue @@ -296,9 +296,6 @@ export default { this.endLoading() this.dataForm = data - this.dataForm.floatIconPath = "" - console.log(this.dataForm) - }, (rspMsg, data) => { this.endLoading() @@ -370,7 +367,7 @@ export default { type: 'success', message: '保存成功' }) - this.$emit('editDiaOK') + this.$emit('dialogOk') this.visible = false }, (rspMsg, data) => { diff --git a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue index 884d61a..4a18de3 100644 --- a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue +++ b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarList.vue @@ -9,7 +9,7 @@ @click="diaCancel">取消返回 自定义初始化 + @click="syncShow">同步默认配置 + @dialogOk="dialogOk"> + + + + @@ -80,6 +91,7 @@ import CDialog from '@c/CDialog' import CTable from '@c/CTableNoPage' import Edit from './FootbarEdit' import Mode from './FootbarMode' +import Sync from './FootbarSync' import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 @@ -198,7 +210,7 @@ export default { } }, components: { - CDialog, CTable, Edit, Mode + CDialog, CTable, Edit, Mode, Sync }, async mounted () { @@ -210,10 +222,8 @@ export default { await this.loadResiTableData() } else if (this.showFrom === 'customize') {//自定义配置 - } - }, computed: { tableHeight () { @@ -221,6 +231,7 @@ export default { }, ...mapGetters(['clientHeight', 'env']) }, + methods: { doLayout () { @@ -257,6 +268,7 @@ export default { if (tab.name === 'resi') { this.loadResiTableData() // 获取表格数据 } + this.doLayout() // 解决表格错位 }, // 加载列表数据 async loadWorkTableData () { @@ -264,8 +276,6 @@ export default { this.footbarList = this.$refs['table_work'].getTableData() this.loadFootbarList(this.footbarList) await this.loadMode() - console.log("footbarList", this.footbarList) - }, // 加载列表数据 async loadResiTableData () { @@ -274,7 +284,7 @@ export default { this.footbarList = this.$refs['table_resi'].getTableData() this.loadFootbarList(this.footbarList) await this.loadMode() - console.log("footbarList", this.footbarList) + }, @@ -300,7 +310,7 @@ export default { async loadMode () { this.startLoading() // const url = "http://yapi.elinkservice.cn/mock/102/data/aggregator/app/footbarpattern" - const url = "/data/aggregator/app/footbarpattern" + const url = "/oper/crm/customer/footbarpattern" const params = { customerId: this.customerId, @@ -311,12 +321,27 @@ export default { if (data) { this.showMode = data.pattern + } } else { this.$message.error(msg) } this.endLoading() }, + + //调用组件保存模式 + saveMode () { + if (this.activeName === 'gov') { + this.$refs['mode_work'].saveToMode1() + } else if (this.activeName === 'resi') { + this.$refs['mode_resi'].saveToMode1() + } + + }, + // 同步 + syncShow () { + this.$refs['ref_sync'].init(this.customerId, this.activeName, this.footbarList) + }, // 新增 addShow () { this.$refs['ref_edit'].init('', 'A', this.activeName, this.showFrom) @@ -330,6 +355,7 @@ export default { changeState (row, index) { const h = this.$createElement let message = '' + if (this.showMode == "float" && this.showFootbarList.length % 2 !== 0) {//奇数变偶数,给与文字提示 message = h('div', [ h('p', this.text1), h('p', this.text2), h('p', '确认隐藏?') @@ -355,7 +381,11 @@ export default { } window.app.ajax.post(url, param, (data, rspMsg) => { - this.$message.success('操作成功' + rspMsg) + this.$message.success('隐藏成功') + if (this.showMode == "float") { + this.saveMode() + } + this.refresh() }, (rspMsg, data) => { @@ -440,7 +470,7 @@ export default { } window.app.ajax.post(url, param, (data, rspMsg) => { - this.$message.success('初始化成功' + rspMsg) + this.$message.success('初始化成功') this.refresh() }, (rspMsg, data) => { @@ -477,7 +507,10 @@ export default { } window.app.ajax.post(url, param, (data, rspMsg) => { - this.$message.success('删除成功' + rspMsg) + this.$message.success('删除成功') + if (this.showMode == "float") { + this.saveMode() + } this.refresh() }, (rspMsg, data) => { @@ -492,16 +525,9 @@ export default { diaCancel () { this.$emit('cancleBack') }, - editDiaOK () { + dialogOk () { this.refresh() }, - editDiaCancel () { - - }, - - async renderSelData () { // 渲染下拉框/单选框/复选框等数据 - - }, // 开启加载动画 startLoading () { diff --git a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue index b808d10..be5dbaa 100644 --- a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue +++ b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarMode.vue @@ -72,6 +72,18 @@ export default { type: String, default: "flat" }, + customerId: { + type: String, + default: "default" + }, + customerId: { + type: String, + default: "default" + }, + appType: { + type: String, + default: "resi" + }, }, data () { @@ -84,31 +96,27 @@ export default { created () { // this.queryFunctionList() }, - computed: { - diaTop () { - - return this.resolution === 'small' ? '30px' : '100px' - }, - ...mapGetters(['clientHeight', 'resolution']), - }, watch: { - // footbarList: {//深度监听,可监听到对象、数组的变化 - // handler (val, oldVal) { - // this.loadFootbarList(val) - // // console.log("b.c: ", val, oldVal); - // }, - // deep: true //true 深度监听 - // } + showMode (val, oldval) { + console.log(val, oldval) + this.mode = val + + } }, + methods: { //切换模式到2 - changeToMode2 () { if (this.showFootbarList.length % 2 === 0) {//偶数 this.$message.error("当前Footbar数量为偶数,无法切换到模式2") this.mode = "flat" } }, + //切换到模式1并保存 + saveToMode1 () { + this.mode = "flat" + this.saveMode() + }, loadFormData () { // const url = 'https://nei.netease.com/api/apimock-v2/e3b1d0eb88e905f6c7ee559b2d6bb7ad/oper/customize/customerfootbar/footbardetail' const url = '/oper/customize/customerfootbar/footbardetail' @@ -136,14 +144,13 @@ export default { const params = { customerId: this.customerId, - appType: this.activeName + appType: this.appType, + pattern: this.mode } const { data, code, msg } = await requestPost(url, params) if (code === 0) { - - if (data) { - this.showMode = data.pattern - } + this.$message.success("模式保存成功") + this.$emit('refresh') } else { this.$message.error(msg) } diff --git a/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarSync.vue b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarSync.vue new file mode 100644 index 0000000..82cca3e --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/footbar/FootbarSync.vue @@ -0,0 +1,204 @@ + + + + + + + 同步列表(客户已有的Footbar同部为默认配置) + + + + + + + + + + + + + + + + 采集列表(客户的Footbar同部为默认配置) + + + + + + + + + + + + + + + + + {{ $t('cancel') }} + {{ $t('confirm') }} + + + + + + +