Commit 1fdb0129acea216e290d720711aca9b97552161e

Authored by ww
1 parent e9df5b99

fix: 修复批量操作后发布/取消发布未变更

... ... @@ -6,15 +6,8 @@
6 6 </template>
7 7 <div class="list-content">
8 8 <div class="list-content-img" @click="editHandle()">
9   - <n-image
10   - object-fit="fill"
11   - height="180"
12   - width="350"
13   - preview-disabled
14   - :src="requestImag(cardData.imageUrl)"
15   - :alt="cardData.name"
16   - :fallback-src="requireErrorImg()"
17   - ></n-image>
  9 + <n-image object-fit="fill" height="180" width="350" preview-disabled :src="requestImag(cardData.imageUrl)"
  10 + :alt="cardData.name" :fallback-src="requireErrorImg()"></n-image>
18 11 </div>
19 12 </div>
20 13 <template #action>
... ... @@ -29,16 +22,8 @@
29 22 </span>
30 23 </n-button>
31 24 </n-text>
32   - <n-input
33   - v-else
34   - ref="inputInstRef"
35   - size="small"
36   - type="text"
37   - maxlength="16"
38   - show-count
39   - v-model:value.trim="title"
40   - @blur="handleBlur"
41   - ></n-input>
  25 + <n-input v-else ref="inputInstRef" size="small" type="text" maxlength="16" show-count
  26 + v-model:value.trim="title" @blur="handleBlur"></n-input>
42 27 </template>
43 28 {{ cardData.name || cardData.id }}
44 29 </n-tooltip>
... ... @@ -48,23 +33,25 @@
48 33 <div class="go-flex-items-center list-footer-ri">
49 34 <n-space>
50 35 <n-text>
51   - <n-badge
52   - class="go-animation-twinkle"
53   - dot
54   - :color="cardData.state === 1 ? '#34c749' : '#fcbc40'"
55   - ></n-badge>
  36 + <n-badge class="go-animation-twinkle" dot
  37 + :color="cardData.state === 1 ? '#34c749' : '#fcbc40'"></n-badge>
56 38 {{ cardData.state === 1 ? $t('project.release') : $t('project.unreleased') }}
57 39 </n-text>
58 40
59 41 <template v-for="item in fnBtnList" :key="item.key">
60 42 <template v-if="item.key === 'select'">
61   - <n-dropdown
62   - trigger="hover"
63   - placement="bottom"
64   - :options="selectOptions"
65   - :show-arrow="true"
66   - @select="handleSelect"
67   - >
  43 + <n-dropdown trigger="hover" placement="bottom" :options="[
  44 + {
  45 + label: cardData?.state ? renderLang('global.r_unpublish') : renderLang('global.r_publish'),
  46 + key: 'release',
  47 + icon: renderIcon(SendIcon)
  48 + },
  49 + {
  50 + label: renderLang('global.r_delete'),
  51 + key: 'delete',
  52 + icon: renderIcon(TrashIcon)
  53 + }
  54 + ]" :show-arrow="true" @select="handleSelect">
68 55 <n-button size="small">
69 56 <template #icon>
70 57 <component :is="item.icon"></component>
... ... @@ -133,19 +120,6 @@ const fnBtnList = reactive([
133 120 }
134 121 ])
135 122
136   -const selectOptions = ref([
137   - {
138   - label: props.cardData?.state ? renderLang('global.r_unpublish') : renderLang('global.r_publish'),
139   - key: 'release',
140   - icon: renderIcon(SendIcon)
141   - },
142   - {
143   - label: renderLang('global.r_delete'),
144   - key: 'delete',
145   - icon: renderIcon(TrashIcon)
146   - }
147   -])
148   -
149 123 const handleSelect = (key: string) => {
150 124 switch (key) {
151 125 case 'delete':
... ... @@ -200,17 +174,20 @@ const requestImag = (imageUrl: string | undefined) => {
200 174
201 175 <style lang="scss" scoped>
202 176 $contentHeight: 180px;
  177 +
203 178 @include go('items-list-card') {
204 179 position: relative;
205 180 border-radius: $--border-radius-base;
206 181 border: 1px solid rgba(0, 0, 0, 0);
207 182 @extend .go-transition;
  183 +
208 184 // &:hover {
209 185 // @include hover-border-color('hover-border-color');
210 186 // }
211 187 .list-content {
212 188 cursor: pointer;
213 189 border-radius: $--border-radius-base;
  190 +
214 191 // @include background-image('background-point');
215 192 // @extend .go-point-bg;
216 193 &-top {
... ... @@ -219,10 +196,12 @@ $contentHeight: 180px;
219 196 left: 10px;
220 197 height: 22px;
221 198 }
  199 +
222 200 &-img {
223 201 height: $contentHeight;
224 202 @extend .go-flex-center;
225 203 @extend .go-border-radius;
  204 +
226 205 @include deep() {
227 206 img {
228 207 @extend .go-border-radius;
... ... @@ -230,14 +209,17 @@ $contentHeight: 180px;
230 209 }
231 210 }
232 211 }
  212 +
233 213 .list-footer {
234 214 flex-wrap: nowrap;
235 215 justify-content: space-between;
236 216 line-height: 30px;
  217 +
237 218 &-ri {
238 219 justify-content: flex-end;
239 220 min-width: 180px;
240 221 }
  222 +
241 223 .list-footer-button {
242 224 display: flex;
243 225 // justify-content: flex-start;
... ...