@nebulars/sseengine 1.3.90 → 1.3.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebulars/sseengine",
3
3
  "description": "An engine for sse",
4
- "version": "1.3.90",
4
+ "version": "1.3.94",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
7
  "dev": "forage serve --name sseengine",
@@ -85,7 +85,7 @@
85
85
 
86
86
  <div class="fqa-enter-presets">
87
87
  <template v-if="sseengine.presets?.length" v-for="(param, index) in sseengine.presets">
88
- <fqa-selection class="fqa-enter-selection" v-bind="param" v-if="param.field_name === 'data_sources'" v-model="[sseengine.options || []][param.field_name]" :label="false" />
88
+ <fqa-selection class="fqa-enter-selection" v-bind="param" v-if="param.field_name === 'data_sources'" v-model="(sseengine.options || [])[param.field_name]" :label="false" />
89
89
  </template>
90
90
  </div>
91
91
  </a-space>
@@ -15,17 +15,17 @@
15
15
  </style>
16
16
 
17
17
  <template>
18
- <a-space :size="24" class="fqa-feedback" :class="{ notouch: sseengine.mode === 'snap' }">
18
+ <a-space :size="24" class="fqa-feedback" :class="{ notouch: sseengine.mode === 'snap' || sseengine.editable }">
19
19
  <template v-if="visible">
20
20
  <a-space class="fqa-feedback-space" :size="4" @click="copy">
21
21
  <fqa-icon icon="CopyOutlined" :size="18" cursor="pointer" />
22
22
  <span>复制</span>
23
23
  </a-space>
24
- <a-space class="fqa-feedback-space" :size="4" @click="share" v-if="!app.mobile">
24
+ <a-space class="fqa-feedback-space" :size="4" @click="share" v-if="!app.mobile && app.online">
25
25
  <fqa-icon icon="ShareAltOutlined" :size="18" cursor="pointer" />
26
26
  <span>分享</span>
27
27
  </a-space>
28
- <a-space class="fqa-feedback-space" :size="4" :data-download="id" v-if="!app.mobile">
28
+ <a-space class="fqa-feedback-space" :size="4" :data-download="id" v-if="!app.mobile && app.online">
29
29
  <a-dropdown :getPopupContainer="e => e.closest('[data-download]')">
30
30
  <div>
31
31
  <fqa-icon icon="DownloadOutlined" :size="18" cursor="pointer" />
@@ -30,7 +30,7 @@
30
30
 
31
31
  <template>
32
32
  <div class="fqa-flip" :class="{ freeze }">
33
- <a-space class="fqa-flip-controller" :class="{ notouch: sseengine.mode === 'snap' }">
33
+ <a-space class="fqa-flip-controller" :class="{ notouch: sseengine.mode === 'snap' || sseengine.editable }">
34
34
  <fqa-icon :class="{ 'fqa-flip-prev': true, 'fqa-flip-disabled': active <= min }" icon="LeftOutlined" @click="prev" />
35
35
  <div class="fqa-flip-pagination">{{ active }} / {{ max }}</div>
36
36
  <fqa-icon :class="{ 'fqa-flip-next': true, 'fqa-flip-disabled': active >= max }" icon="RightOutlined" @click="next" />
@@ -85,7 +85,7 @@
85
85
 
86
86
  <!-- Editable -->
87
87
  <div class="fqa-query-editable" v-if="editable && !sseengine.produce">
88
- <a-textarea class="fqa-query-input" :auto-size="{ minRows: 3, maxRows: 10 }" v-model:value="origin" @press-enter="e => enterHandler(e, item)" />
88
+ <a-textarea class="fqa-query-input" data-editable="true" :auto-size="{ minRows: 3, maxRows: 10 }" v-model:value="origin" @press-enter="e => enterHandler(e, item)" />
89
89
  <a-space class="fqa-query-bunny">
90
90
  <fqa-button class="fqa-query-cancel" :width="80" :instance="20" :radius="40" hover="#e7e8e9" @click="e => cancelHandler(e, item)">{{ $t('global.cancel') }}</fqa-button>
91
91
  <fqa-button class="fqa-query-send" :width="80" :instance="20" :radius="40" color="#fdfeff" @click="e => submitHandler(e, item)">{{ $t('global.send') }}</fqa-button>
@@ -138,6 +138,12 @@ export default {
138
138
 
139
139
  inject: ['updateActive'],
140
140
 
141
+ computed: {
142
+ noEditable() {
143
+ return this.$util.$('[data-editable]').length <= 1;
144
+ },
145
+ },
146
+
141
147
  methods: {
142
148
  async copySuccess(e) {
143
149
  this.copied = true;
@@ -154,7 +160,9 @@ export default {
154
160
  async cancelHandler(e) {
155
161
  this.origin = '';
156
162
  this.editable = false;
157
- await this.$store.dispatch('sseengine/STATE_UPDATE', { editable: false });
163
+ if (this.noEditable) {
164
+ await this.$store.dispatch('sseengine/STATE_UPDATE', { editable: false });
165
+ }
158
166
  },
159
167
 
160
168
  async submitHandler(e, item) {