addComponent.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <template>
  2. <div class="style-information-component">
  3. <el-form-item label="商品图片" />
  4. <div class="upload-wrap">
  5. <el-upload
  6. ref="upImagesFiles"
  7. list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove"
  8. :headers="headers" :data="dataObj" :file-list="form.imgs" :limit="20"
  9. :on-success="handleImageSuccess"
  10. :action="action"
  11. :before-upload="changeFiles"
  12. >
  13. <i slot="default" class="el-icon-plus" />
  14. <div slot="file" slot-scope="{ file }">
  15. <img v-if="!isVideo(file.imgPath)" class="el-upload-list__item-thumbnail" :src="file.imgPath">
  16. <video
  17. v-else class="el-upload-list__item-thumbnail" style="width: 148px;height: 148px;"
  18. :src="file.imgPath"
  19. ></video>
  20. <span class="el-upload-list__item-actions">
  21. <span
  22. v-if="!isVideo(file.imgPath)" class="el-upload-list__item-preview"
  23. @click="handlePictureCardPreview(file)"
  24. >
  25. <i class="el-icon-zoom-in" />
  26. </span>
  27. <span @click="playVideo(file.imgPath)">
  28. <i class="el-icon-video-play"></i>
  29. </span>
  30. <span class="el-upload-list__item-delete" @click="handleRemove(file)">
  31. <i class="el-icon-delete" />
  32. </span>
  33. </span>
  34. </div>
  35. </el-upload>
  36. </div>
  37. <el-form-item label="款式设置">
  38. <el-radio-group v-model="form.attrStyle">
  39. <el-radio :label="0">单款式</el-radio>
  40. <el-radio :label="1">多款式</el-radio>
  41. </el-radio-group>
  42. </el-form-item>
  43. <div class="style-container">
  44. <div v-if="form.attrStyle === 0" class="single-style">
  45. <el-table :data="skuList" style="width: 100%" :header-cell-style="{ background: '#EEF3FF', color: '#333333' }">
  46. <el-table-column label="规格">
  47. <template slot-scope="scope">
  48. <el-input v-model="singleStyle.skuValue" :sss="scope" maxlength="20" />
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="售价">
  52. <template slot-scope="scope">
  53. <el-input-number
  54. v-model="scope.row.price" :controls="false" :max="999999999" :min="0"
  55. :precision="2"
  56. :step="0.01" style="width: auto;"
  57. />
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="原价">
  61. <template slot-scope="scope">
  62. <el-input-number
  63. v-model="scope.row.originalPrice" :controls="false" :max="999999999" :min="0"
  64. :precision="2" :step="0.01" style="width: auto;"
  65. />
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="库存">
  69. <template slot-scope="scope">
  70. <el-input-number
  71. v-model="scope.row.stockNumber" :controls="false" :max="999999999" :min="0"
  72. :precision="0" style="width: auto;"
  73. />
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="重量(KG)">
  77. <template slot-scope="scope">
  78. <el-input-number
  79. v-model="scope.row.weight" :controls="false" :max="999" :min="0"
  80. :precision="2"
  81. :step="0.01" style="width: auto;"
  82. />
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="代金卷最大抵扣额度(一般设置全额抵扣)">
  86. <template slot-scope="scope">
  87. <el-input-number v-model="scope.row.voucherPrice" :controls="false" :min="0" :precision="6" :step="0.01" style="width: auto;" />
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="商品绑定的代金卷">
  91. <template slot-scope="scope">
  92. <el-select v-model="scope.row.voucherId" placeholder="请选择商品绑定的代金卷">
  93. <el-option v-for="item in voucherList" :key="item.id" :label="item.voucherName" :value="item.id">
  94. </el-option>
  95. </el-select>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="国际条码">
  99. <template slot-scope="scope">
  100. <el-input v-model="scope.row.sku" maxlength="20" />
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. </div>
  105. <div v-else class="multiple-styles">
  106. <div v-for="(skuAttr, index) in form.skuAttrList" :key="index" class="sku-attr-list">
  107. <el-form-item label="规格名">
  108. <el-input v-model="skuAttr.skuName" maxlength="20" />
  109. <i v-if="index != 0" class="el-icon-close delImg" @click="delSkuAttrList(index)" />
  110. <el-checkbox v-if="index === 0" v-model="skuAttr.needImg" style="margin-left: 20px;">需要配图</el-checkbox>
  111. </el-form-item>
  112. <el-form-item label="规格值">
  113. <div class="attr-value-list">
  114. <div v-for="(sku, index1) in skuAttr.values" :key="index + '-' + index1" class="main-diagram m-8">
  115. <!-- 去除了长度限制 -->
  116. <el-input v-model="sku.skuValue" />
  117. <i v-if="index === 0 && index1 === 0" />
  118. <i v-else class="el-icon-close delImg" @click="delValue(index, index1)" />
  119. <div v-if="skuAttr.needImg && index === 0" class="upload-wrap diagram-upload">
  120. <div class="span-wrap">
  121. <el-upload
  122. list-type="picture-card" :show-file-list="false" :on-preview="handlePictureCardPreview"
  123. :on-remove="handleRemove" :headers="headers" :data="dataObj" :file-list="[ sku ]"
  124. :multiple="false"
  125. :on-success="handleImageSuccess1" :action="action"
  126. >
  127. <i v-if="!sku.image" slot="trigger" class="el-icon-plus" />
  128. <div v-else class="attr-value-img">
  129. <img class="attr-thumbnail" :src="sku.image">
  130. </div>
  131. </el-upload>
  132. <div v-if="sku.image" class="attr-actions">
  133. <span class="attr-preview" @click="handlePictureCardPreview({ imgPath: sku.image })">
  134. <i class="el-icon-zoom-in" />
  135. </span>
  136. <span class="attr-delete" @click="handleRemove1(sku)">
  137. <i class="el-icon-delete" />
  138. </span>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <el-button type="text" style="margin-left: 10px;" @click="addAttrValue(index)">添加</el-button>
  144. </div>
  145. </el-form-item>
  146. </div>
  147. <el-button class="add-attr-btn" type="primary" @click="addSkuAttrList">添加规格</el-button>
  148. <el-table :data="skuList" style="width: 100%" :header-cell-style="{ background: '#EEF3FF', color: '#333333' }">
  149. <el-table-column v-for="(skuAttr, index) in skuAttrName" :key="index" :label="skuAttr.skuName">
  150. <template slot-scope="scope">
  151. {{ scope.row.skuAttrCodeDTOList && scope.row.skuAttrCodeDTOList[index] | attrValueFilter(form.skuAttrList) }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="售价">
  155. <template slot-scope="scope">
  156. <el-input-number
  157. v-model="scope.row.price" :controls="false" :max="999999999" :min="0"
  158. :precision="2"
  159. :step="0.01" style="width: auto;"
  160. />
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="原价">
  164. <template slot-scope="scope">
  165. <el-input-number
  166. v-model="scope.row.originalPrice" :controls="false" :max="999999999" :min="0"
  167. :precision="2" :step="0.01" style="width: auto;"
  168. />
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="库存">
  172. <template slot-scope="scope">
  173. <el-input-number
  174. v-model="scope.row.stockNumber" :controls="false" :max="999999999" :min="0"
  175. :precision="0" style="width: auto;"
  176. />
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="重量(KG)">
  180. <template slot-scope="scope">
  181. <el-input-number
  182. v-model="scope.row.weight" :controls="false" :max="999" :min="0"
  183. :precision="6"
  184. :step="0.01" style="width: auto;"
  185. />
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="代金卷最大抵扣额度(一般设置全额抵扣)">
  189. <template #header="scope">
  190. <div>代金卷最大抵扣额度(一般设置全额抵扣)<el-button type="warning" size="mini" @click="$emit('syncVoucherPrice')">同步售价</el-button></div>
  191. </template>
  192. <template slot-scope="scope">
  193. <el-input-number v-model="scope.row.voucherPrice" :controls="false" :min="0" :precision="6" :step="0.01" style="width: auto;" />
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="商品绑定的代金卷">
  197. <template #header="scope">
  198. <div>
  199. 商品绑定的代金卷
  200. <el-dropdown size="mini" split-button type="primary" @command="(e) => $emit('syncVoucherId', e)">
  201. 统一选择
  202. <el-dropdown-menu slot="dropdown">
  203. <el-dropdown-item v-for="item in voucherList" :key="item.id" :command="item.id">{{ item.voucherName }}</el-dropdown-item>
  204. </el-dropdown-menu>
  205. </el-dropdown>
  206. </div>
  207. </template>
  208. <template slot-scope="scope">
  209. <el-select v-model="scope.row.voucherId" placeholder="请选择商品绑定的代金卷">
  210. <el-option v-for="item in voucherList" :key="item.id" :label="item.voucherName" :value="item.id">
  211. </el-option>
  212. </el-select>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="国际条码">
  216. <template slot-scope="scope">
  217. <el-input v-model="scope.row.sku" maxlength="20" />
  218. </template>
  219. </el-table-column>
  220. <!-- <el-table-column label="操作">
  221. <template slot-scope="scope">
  222. <el-button type="text" @click="delAttrValue(scope.row,scope.$index,scope.row,scope)">删除</el-button>
  223. </template>
  224. </el-table-column> -->
  225. </el-table>
  226. </div>
  227. </div>
  228. <el-dialog
  229. :append-to-body="true" :visible.sync="dialogVisible" class="check-image-dialog" title="查看图片"
  230. center="center"
  231. >
  232. <img width="100%" :src="dialogImageUrl" alt>
  233. </el-dialog>
  234. <el-dialog
  235. width="30%" :append-to-body="true" :visible.sync="previewVideoVisible" class="check-image-dialog"
  236. title="预览视频" center="center"
  237. >
  238. <div style="display: flex; align-items: center; justify-content: center;">
  239. <video controls autoplay muted style="width: 400px; height: 400px;" :src="dialogVideoUrl"></video>
  240. </div>
  241. </el-dialog>
  242. </div>
  243. </template>
  244. <script>
  245. import { uploadUrl } from '@/utils/request'
  246. import { getToken } from '@/utils/auth'
  247. import { isVideo } from '@/utils/index'
  248. export default {
  249. // eslint-disable-next-line vue/match-component-file-name, vue/component-definition-name-casing
  250. name: 'addComponent',
  251. filters: {
  252. attrValueFilter(map, list) {
  253. const hasChilds =
  254. list &&
  255. list.filter((skuAttr) => {
  256. const hasChild = skuAttr.values.some((attr) => attr.skuValue)
  257. return skuAttr.skuName && hasChild
  258. })
  259. if (!map) {
  260. return ''
  261. }
  262. const { code, valueCode } = map
  263. let codeStr = ''
  264. // eslint-disable-next-line array-callback-return
  265. hasChilds.map((item) => {
  266. const { values } = item
  267. values &&
  268. values.some((attr) => {
  269. const isSome = item.code === code && attr.valueCode === valueCode
  270. if (isSome) {
  271. codeStr = attr.skuValue
  272. }
  273. return isSome
  274. })
  275. })
  276. return codeStr
  277. }
  278. },
  279. props: {
  280. form: {
  281. type: Object,
  282. default() {
  283. return {}
  284. }
  285. },
  286. voucherList: {
  287. type: Array,
  288. // eslint-disable-next-line vue/require-valid-default-prop
  289. default: []
  290. }
  291. },
  292. data() {
  293. return {
  294. dialogImageUrl: '',
  295. dialogVideoUrl: '',
  296. dialogVisible: false,
  297. previewVideoVisible: false,
  298. headers: {
  299. 'Authorization-business': getToken(),
  300. 'tenant': 'MDAwMA=='
  301. },
  302. action: uploadUrl,
  303. dataObj: {
  304. folderId: 1
  305. },
  306. fileList: [],
  307. // 记录当前是哪里增加或者删除的
  308. idx: null
  309. }
  310. },
  311. computed: {
  312. skuAttrName() {
  313. return (
  314. this.form.skuAttrList &&
  315. this.form.skuAttrList.filter((skuAttr) => {
  316. const hasChilds = skuAttr.values.some((attr) => attr.skuValue)
  317. return skuAttr.skuName && hasChilds
  318. })
  319. )
  320. },
  321. singleStyle() {
  322. if (this.form.skuAttrList && this.form.skuAttrList[0]) {
  323. return this.form.skuAttrList && this.form.skuAttrList[0].values[0]
  324. }
  325. return {
  326. skuValue: ''
  327. }
  328. },
  329. skuList() {
  330. // console.log(this.form)
  331. if (this.form.attrStyle === 0) {
  332. return this.form.skuList.slice(0, 1)
  333. }
  334. return this.form.skuList
  335. }
  336. },
  337. watch: {
  338. 'form.skuAttrList': {
  339. handler(newVal, oldVal) {
  340. // 判断是否有规格值
  341. const hasChilds =
  342. this.form.skuAttrList &&
  343. this.form.skuAttrList.filter((skuAttr) => {
  344. const hasChild = skuAttr.values.some((attr) => attr.skuValue)
  345. return skuAttr.skuName && hasChild
  346. })
  347. // console.log(hasChilds);
  348. if (this.form.attrStyle === 1 && hasChilds.length) {
  349. this.skuFormat()
  350. }
  351. },
  352. deep: true
  353. },
  354. 'form.skuList': {
  355. handler(newVal, oldVal) {
  356. // console.log(newVal)
  357. // console.log(oldVal)
  358. // 修复因为添加规格导致的价格归零的问题
  359. oldVal.forEach((item, index) => {
  360. // newVal[index] = Object.assign(item, newVal[index])
  361. for (const key in newVal[index]) {
  362. if (item[key]) {
  363. newVal[index][key] = item[key]
  364. }
  365. }
  366. })
  367. // console.log(newVal)
  368. },
  369. deep: true
  370. }
  371. },
  372. methods: {
  373. isVideo,
  374. playVideo(url) {
  375. this.dialogVideoUrl = url
  376. this.previewVideoVisible = true
  377. },
  378. handleImageSuccess(response) {
  379. const url = response.data.url
  380. // eslint-disable-next-line vue/no-mutating-props
  381. this.form.imgs.push({
  382. imgPath: url
  383. })
  384. },
  385. // 移除图片
  386. handleRemove(file) {
  387. const { imgPath } = file
  388. // eslint-disable-next-line vue/no-mutating-props
  389. this.form.imgs = this.form.imgs.filter((item) => item.imgPath !== imgPath)
  390. },
  391. handleRemove1(file) {
  392. file.image = ''
  393. },
  394. handlePictureCardPreview(file) {
  395. this.dialogImageUrl = file.imgPath
  396. this.dialogVisible = true
  397. },
  398. handleImageSuccess1(response, file, fileList) {
  399. const url = response.data.url
  400. fileList[0].image = url
  401. },
  402. addAttrValue(index) {
  403. // eslint-disable-next-line vue/no-mutating-props
  404. this.form.skuAttrList[index].values.push({
  405. skuId: '',
  406. valueCode: '',
  407. skuValue: '',
  408. image: ''
  409. })
  410. if (this.idx == index) {
  411. this.form.deletes.splice(this.form.deletes.length - 1, 1)
  412. }
  413. // console.log(JSON.parse(JSON.stringify(this.form)))
  414. console.log(this.form.skuAttrList[index])
  415. },
  416. addSkuAttrList() {
  417. // eslint-disable-next-line vue/no-mutating-props
  418. this.form.skuAttrList.push({
  419. code: '',
  420. skuName: '',
  421. values: [
  422. {
  423. skuValue: '',
  424. valueCode: '',
  425. image: '',
  426. isDelete: 0,
  427. sortOrder: 0
  428. }
  429. ],
  430. isDelete: 0,
  431. needImg: 0,
  432. sortOrder: 0
  433. })
  434. // console.log(this.form.skuAttrList)
  435. },
  436. // 删除规格值
  437. delValue(index, index1) {
  438. if (index1 < this.form.skuAttrList[index].values.length - 1) return
  439. this.idx = index
  440. const newList = JSON.parse(JSON.stringify(this.form.skuAttrList[index]))
  441. const valueObj = {
  442. code: newList.code,
  443. skuId: newList.skuId,
  444. valueCode: newList.values[index1].valueCode
  445. }
  446. // eslint-disable-next-line vue/no-mutating-props
  447. this.form.deletes.push(valueObj)
  448. console.log(this.form.deletes, '删除')
  449. // console.log(this.valueObj)
  450. this.form.skuAttrList[index].values.splice(index1, 1)
  451. // console.log(this.form.skuAttrList[index].values);
  452. },
  453. // 删除规格名
  454. delSkuAttrList(index) {
  455. const newList = JSON.parse(JSON.stringify(this.form.skuAttrList[index]))
  456. newList.values.forEach((item) => {
  457. const valueObj = {
  458. code: newList.code,
  459. skuId: newList.skuId,
  460. valueCode: ''
  461. }
  462. valueObj.valueCode = item.valueCode
  463. // eslint-disable-next-line vue/no-mutating-props
  464. this.form.deletes.push(valueObj)
  465. })
  466. // eslint-disable-next-line vue/no-mutating-props
  467. this.form.skuAttrList.splice(index, 1)
  468. },
  469. delAttrValue1(row, index, arr) { },
  470. skuFormat() {
  471. const skuListArray = []
  472. const result = {
  473. originalPrice: 0,
  474. price: 0,
  475. productId: '',
  476. skuAttrCodeDTOList: [
  477. {
  478. code: '',
  479. valueCode: ''
  480. }
  481. ],
  482. skuId: '',
  483. skuImage: '',
  484. stockNumber: 0,
  485. voucherId: 0,
  486. voucherPrice: 0,
  487. weight: 0
  488. }
  489. const doExchange = (arr, depth) => {
  490. const map = {
  491. arr: []
  492. }
  493. for (var i = 0; i < arr[depth].length; i++) {
  494. map.arr.push(arr[depth][i])
  495. const { code, valueCode, attrId } = arr[depth][i]
  496. result.skuAttrCodeDTOList[depth] = {
  497. code,
  498. valueCode,
  499. attrId
  500. }
  501. if (depth !== arr.length - 1) {
  502. doExchange(arr, depth + 1)
  503. } else {
  504. skuListArray.push(JSON.parse(JSON.stringify(result)))
  505. }
  506. }
  507. }
  508. // this.form.skuList = skuListArray
  509. // 获取规格值的所有组合
  510. const values = []
  511. // eslint-disable-next-line array-callback-return
  512. this.form.skuAttrList.map((skuItem, index) => {
  513. const attrList = []
  514. skuItem.code = skuItem.code || 'attr_code_' + index
  515. const { code } = skuItem
  516. skuItem.values &&
  517. // eslint-disable-next-line array-callback-return
  518. skuItem.values.map((attrItem, index1) => {
  519. attrItem.valueCode = skuItem.valueCode || code + '_value_' + index1
  520. const skuId = attrItem.skuId
  521. const attrId = attrItem.attrId
  522. if (attrItem.skuValue) {
  523. attrList.push({
  524. skuId,
  525. attrId,
  526. code,
  527. valueCode: attrItem.valueCode
  528. })
  529. }
  530. })
  531. if (attrList.length) {
  532. values.push(attrList)
  533. }
  534. })
  535. // 相互组合
  536. if (values.length) {
  537. doExchange(values, 0)
  538. }
  539. // console.log(this.form.skuList)
  540. // eslint-disable-next-line vue/no-mutating-props
  541. this.form.skuList = skuListArray.map((sku1) => {
  542. const { skuAttrList, skuAttrCodeDTOList } = sku1
  543. const skuAttrList1 = skuAttrCodeDTOList || skuAttrList
  544. const skuMap = this.form.skuList.filter((sku2) => {
  545. const skuAttrList2 = sku2.skuAttrList
  546. sku2.skuAttrCodeDTOList = skuAttrList2
  547. if (!skuAttrList2) return false
  548. const ids = []
  549. skuAttrList1.filter((item) => ids.push(item.id))
  550. const result = skuAttrList2.every((item) => ids.indexOf(item.attrValueId) !== -1)
  551. return result
  552. })
  553. let selectMap = sku1
  554. if (skuMap && skuMap.length) {
  555. selectMap = JSON.parse(JSON.stringify(skuMap[0]))
  556. selectMap.skuAttrCodeDTOList = skuAttrCodeDTOList
  557. }
  558. return selectMap
  559. })
  560. },
  561. changeFiles(file, fileList) {
  562. // console.log(file)
  563. // console.log(fileList)
  564. // eslint-disable-next-line prefer-const
  565. let uid = file.uid
  566. const isLt =
  567. file.size / 1024 / 5 >= 1 && file.size / 1024 / 1024 / 5 <= 1
  568. if (!isLt) {
  569. // this.$refs.upImagesFiles.abort()
  570. this.$message.error('上传文件大小不得小于5KB,不得大于5MB!')
  571. return false
  572. }
  573. // console.log(fileList)
  574. }
  575. }
  576. }
  577. </script>
  578. <style lang="scss" scoped>
  579. @import url("../../../styles/elDialog.scss");
  580. .style-information-component {
  581. width: 100%;
  582. min-height: 300px;
  583. padding: 24px;
  584. background-color: rgb(255, 255, 255);
  585. .el-form-item {
  586. margin-bottom: 10px;
  587. }
  588. .attr-value-list {
  589. display: flex;
  590. flex-wrap: wrap;
  591. .main-diagram {
  592. position: relative;
  593. width: 180px;
  594. .span-wrap {
  595. position: relative;
  596. display: inline-block;
  597. margin-top: 10px;
  598. .attr-actions {
  599. line-height: 100px;
  600. position: absolute;
  601. width: 100%;
  602. height: 100%;
  603. left: 0;
  604. top: 0;
  605. cursor: default;
  606. text-align: center;
  607. color: #fff;
  608. opacity: 0;
  609. font-size: 20px;
  610. background-color: rgba(0, 0, 0, 0.5);
  611. -webkit-transition: opacity 0.3s;
  612. transition: opacity 0.3s;
  613. z-index: 1;
  614. &:hover {
  615. opacity: 1;
  616. .attr-preview {
  617. display: inline-block;
  618. }
  619. i {
  620. color: #fff;
  621. font-size: 20px;
  622. }
  623. }
  624. }
  625. .attr-preview {
  626. display: none;
  627. cursor: pointer;
  628. font-size: 20px;
  629. color: #fff;
  630. }
  631. .attr-delete {
  632. margin-left: 15px;
  633. color: #fff;
  634. }
  635. }
  636. .attr-value-img {
  637. width: 100%;
  638. height: 100%;
  639. img {
  640. width: 100%;
  641. height: 100%;
  642. object-fit: contain;
  643. }
  644. }
  645. }
  646. }
  647. .m-8 {
  648. margin-right: 8px;
  649. }
  650. .upload-btn {
  651. box-sizing: border-box;
  652. display: flex;
  653. align-items: center;
  654. justify-content: center;
  655. width: 100%;
  656. height: 110px;
  657. cursor: pointer;
  658. border: 2px dashed #2e60f8;
  659. border-radius: 2px;
  660. background-color: #f8f9fb;
  661. text-align: center;
  662. font-size: 20px;
  663. color: #2e60f8;
  664. i {
  665. color: #2e60f8;
  666. font-size: 20px;
  667. }
  668. .upload-title {
  669. margin-left: 10px;
  670. font-size: 14px;
  671. }
  672. }
  673. .upload-wrap {
  674. margin-bottom: 25px;
  675. .el-upload-list__item {
  676. transition: none !important;
  677. }
  678. .el-upload,
  679. .el-upload-list__item {
  680. width: 100px;
  681. height: 100px;
  682. line-height: 100px;
  683. }
  684. .el-progress,
  685. .el-progress-circle {
  686. width: 80px !important;
  687. height: 80px !important;
  688. }
  689. }
  690. .sku-attr-list {
  691. .el-input {
  692. width: 180px;
  693. }
  694. }
  695. .single-style {
  696. .el-input {
  697. max-width: 180px;
  698. }
  699. }
  700. .add-attr-btn {
  701. margin-bottom: 25px;
  702. }
  703. .check-image-dialog {
  704. .el-dialog {
  705. margin-top: 25px;
  706. .el-dialog__body {
  707. img {
  708. max-width: 100%;
  709. max-height: 100%;
  710. height: 500px;
  711. object-fit: contain;
  712. }
  713. }
  714. }
  715. }
  716. .delImg {
  717. position: absolute;
  718. top: 12px;
  719. margin-left: -24px
  720. }
  721. .delImg:hover {
  722. border-radius: 50%;
  723. color: #ffffff;
  724. background: #2e60f8;
  725. cursor: pointer;
  726. }
  727. }
  728. </style>