From ffd044cf75ae896187b938e91dbd8fb83abd3615 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 28 三月 2023 20:58:11 +0800 Subject: [PATCH] 2023-03-28 --- public/options.json | 12 +++--- src/tabviews/zshare/mutilform/index.jsx | 28 ++++++++++++++ src/templates/zshare/modalform/index.jsx | 3 + src/views/appmanage/index.jsx | 33 ++++++++++------ src/templates/zshare/formconfig.jsx | 14 +++++++ 5 files changed, 72 insertions(+), 18 deletions(-) diff --git a/public/options.json b/public/options.json index 4e405d0..428c496 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", + "appId": "202108312122504607B107A83F55B40C98CCF", + "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "", - "lineColor": "", + "lineColor": "red", "filter": "false", - "defaultApp": "mk", + "defaultApp": "retail_pad", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -17,6 +17,6 @@ "transfer": "false", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "http://demo.mk9h.cn", + "service": "erp_new/" } \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index a1ea659..0f0de54 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -175,6 +175,19 @@ if (item.empty === 'hidden' && item.oriOptions.length === 0) { item.hidden = true } + if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { + let selectKeys = item.initval + if (item.multiple === 'true') { + selectKeys = selectKeys ? selectKeys.split(',') : [] + item.options = item.options.filter(item => selectKeys.includes(item.$value)) + } else { + item.options = item.options.filter(item => selectKeys === item.$value) + } + item.oriOptions = fromJS(item.options).toJS() + if (item.options.length === 0) { + item.hidden = true + } + } } let newval = '$empty' @@ -824,6 +837,21 @@ if (item.empty === 'hidden' && item.oriOptions.length > 0) { item.hidden = false } + if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { + let selectKeys = item.initval + if (item.multiple === 'true') { + selectKeys = selectKeys ? selectKeys.split(',') : [] + item.options = item.options.filter(item => selectKeys.includes(item.$value)) + } else { + item.options = item.options.filter(item => selectKeys === item.$value) + } + item.oriOptions = fromJS(item.options).toJS() + if (item.options.length === 0) { + item.hidden = true + } else { + item.hidden = false + } + } } return item diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 635f5a6..df317c7 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3369,6 +3369,20 @@ }] }, { + type: 'radio', + key: 'unchecked', + label: '鏈�変腑椤�', + initVal: card.unchecked || 'show', + tooltip: '濡傛灉娌℃湁閫変腑椤癸紝璇ヨ〃鍗曞皢琚殣钘忋��', + options: [{ + value: 'show', + text: '鏄剧ず' + }, { + value: 'hidden', + text: '闅愯棌' + }] + }, + { type: 'color', key: 'backgroundColor', label: '鑳屾櫙鑹�', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 84fd387..26f37bd 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -230,6 +230,9 @@ if (sessionStorage.getItem('appType') === 'mob') { shows.push('hidelabel') } + if (this.record.readonly === 'true' && this.record.hidden !== 'true') { + shows.push('unchecked') + } } else if (['date', 'datemonth', 'datetime'].includes(type)) { reOptions.initval = dateOptions[type] reTypes.initval = 'select' diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index a54a3b7..ff500da 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -508,15 +508,24 @@ let _href = window.location.href.split('#')[0] + 'app_record' let record = localStorage.getItem(_href) record = record ? JSON.parse(record) : null - - if (record) { - if (record.activeId) { - let index = applist.findIndex(item => item.ID === record.activeId) - if (index === -1) { - localStorage.setItem(_href, JSON.stringify({preId: '', activeId: ''})) - } else if (index !== 0) { - applist.unshift(...applist.splice(index, 1)) + + if (record && record.dates) { + let ids = applist.map(item => item.ID) + let reset = false + + Object.keys(record.dates).forEach(key => { + if (!ids.includes(key)) { + delete record.dates[key] + reset = true } + }) + + applist.sort((a, b) => { + return (record.dates[b.ID] || 0) - (record.dates[a.ID] || 0) + }) + + if (reset) { + localStorage.setItem(_href, JSON.stringify(record)) } } } @@ -698,11 +707,11 @@ let record = localStorage.getItem(_href) record = record ? JSON.parse(record) : null - if (!record) { - localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: ''})) + if (!record || !record.dates) { + localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {[selectApp.ID]: new Date().getTime()}})) } else { - if (record.preId === selectApp.ID) { - localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID})) + if (record.preId === selectApp.ID || record.activeId === selectApp.ID) { + localStorage.setItem(_href, JSON.stringify({preId: selectApp.ID, activeId: selectApp.ID, dates: {...record.dates, [selectApp.ID]: new Date().getTime()}})) } else { localStorage.setItem(_href, JSON.stringify({...record, preId: selectApp.ID})) } -- Gitblit v1.8.0