Skip to content

Commit

Permalink
解决界面查询框可拖动时无法操作控件的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
pattazl committed Feb 16, 2024
1 parent f8b5936 commit fb14cb9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
7 changes: 4 additions & 3 deletions ui-helper/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,13 @@ function winResize(chartArr) {
var isDragging = false;
var offset = { x: 0, y: 0 };
function addDragFixedSelect() {
var myDiv = document.querySelector('#fixedDiv') as HTMLElement;
if (myDiv == null) {
var mySpan = document.querySelector('#fixedSpan') as HTMLElement;
var myDiv = document.querySelector('.fixedSelect>div:first-child>div:first-child') as HTMLElement;
if (mySpan == null || myDiv == null) {
setTimeout(addExtListener, 1000)
return;
}
myDiv.addEventListener('mousedown', function (event: any) {
mySpan.addEventListener('mousedown', function (event: any) {
isDragging = true;
offset.x = event.offsetX;
offset.y = event.offsetY;
Expand Down
4 changes: 2 additions & 2 deletions ui-helper/src/components/dataui/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</n-anchor>
</div>
<n-space vertical class="fixedSelect">
<n-space style="font-size:16px" id="fixedDiv" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'">
{{ contentText.intro112 }}
<n-space style="font-size:16px" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'">
<span id="fixedSpan">{{ contentText.intro112 }}</span>
<n-date-picker type="date" v-model:value="beginDate" :is-date-disabled="dateDisabled"
@update:value="handleUpdateValue" />
<n-switch :round="false" :rail-style="railStyle" v-model:value="showEndDate" @update:value="endDate = beginDate">
Expand Down
4 changes: 2 additions & 2 deletions ui-helper/src/components/dataui/Statistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</n-anchor>
</div>
<n-space vertical class="fixedSelect">
<n-space style="font-size:16px" id="fixedDiv" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'">
{{ contentText.intro112 }}
<n-space style="font-size:16px" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'">
<span id="fixedSpan">{{ contentText.intro112 }}</span>
<n-date-picker type="date" v-model:value="beginDate" :is-date-disabled="dateDisabled" />
{{ contentText.intro93 }}
<n-date-picker type="date" v-model:value="endDate" :is-date-disabled="dateDisabled" />
Expand Down
4 changes: 2 additions & 2 deletions ui-helper/src/components/dataui/Today.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</n-anchor>
</div>
<n-space vertical class="fixedSelect">
<n-space style="font-size:16px" id="fixedDiv" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'" v-if="beginDate != 0">
{{ contentText.intro92 }}
<n-space style="font-size:16px" :class="store.myTheme == 'dark' ? 'mydark' : 'mylight'" v-if="beginDate != 0">
<span id="fixedSpan">{{ contentText.intro92 }}</span>
<n-select v-model:value="beginDate" :options="historyDate" @update:value="handleUpdateValue" /> {{
contentText.intro93 }}
<n-select v-model:value="endDate" :options="historyDate" @update:value="handleUpdateValue" />
Expand Down
11 changes: 7 additions & 4 deletions ui-helper/src/res/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
}

.fixedSelect>div:first-child>div:first-child {
cursor:move;
position: fixed;
margin-left: 0px;
padding: 5px;
z-index: 1000;
/* background-color: aliceblue; */
/* background-color: aliceblue; */
}

#fixedSpan {
cursor: move;
}

.fixedSelect>div:nth-child(2)>div:first-child {
Expand All @@ -25,6 +28,6 @@
}

.mydark {
background-color: #333
/* dark 主题的背景色 #333;*/
background-color: #333
/* dark 主题的背景色 #333;*/
}
6 changes: 3 additions & 3 deletions ui-helper/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* @version 配置显示在登录页面的前端版本,格式为 v.主版本号.次版本号.日期.小版本序号 v1.0.190827.1
*/
// 对于发布版 YYMMDD 和 verNo 会在Webpack中自动替换为真实的日期和版本序号,如下格式不能随便改,参考vue.config.js的代码
const replaceYYMMDD = '240215';
const replaceVerNo = '1';
const mainVersion = ' v1.30';
const replaceYYMMDD = '240216';
const replaceVerNo = '0';
const mainVersion = ' v1.31';
const strVersion = mainVersion+'.'+replaceYYMMDD+'.'+replaceVerNo; // 可以支持旧版浏览器
//export default strVersion
export {strVersion};

0 comments on commit fb14cb9

Please sign in to comment.