seniorDetail.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <headerBar
  3. title="主图与详情高级配置"
  4. />
  5. <div class="image-config">
  6. <div class="config-card">
  7. <!-- 图片抠图与货号图生成 -->
  8. <div class="section">
  9. <div class="section-title">
  10. <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
  11. 图片抠图与货号图生成
  12. </div>
  13. <div class="section-content">
  14. <div v-if="showTips" class="instruction-out flex top left">
  15. <img style="fill: #000" src="@/assets/images/xinxi.svg" />
  16. <ol class="instruction-list">
  17. <li>请在下方确认图片拍摄过程中的顺序,确保所有拍摄的图片的顺序一致。</li>
  18. <li>使用中英文语号分隔。</li>
  19. <li>图片的名称不能随意修改,否则无法正常生成详情页。</li>
  20. <li>现有图片名称有:俯视、侧视、后视、鞋底、内里</li>
  21. </ol>
  22. <el-icon @click="showTips = false" class="close-icon">
  23. <Close />
  24. </el-icon>
  25. </div>
  26. <!-- 货号文件夹 -->
  27. <div class="form-item">
  28. <div class="label">货号文件夹:</div>
  29. <div class="folder-warp">
  30. <div class="folder-input">
  31. <el-input style="width: 60%;" v-model="folderPath" type="textarea" :rows="2" readonly placeholder="请选择货号文件夹" />
  32. <el-button class="check-button" type="primary" @click="selectFolder">
  33. <img src="@/assets/images/Photography/wenjian.png" style="width: 14px; " />
  34. 选择目标文件夹</el-button>
  35. </div>
  36. <div class="hint">
  37. <el-icon>
  38. <Warning />
  39. </el-icon> <text>选择货号的上级文件夹</text>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- 抠图模式 -->
  44. <div class="form-item">
  45. <div class="label">抠图模式:</div>
  46. <el-radio-group v-model="reportMode">
  47. <el-radio label="normal">普通模式</el-radio>
  48. <el-radio label="optimized">精细化扣图</el-radio>
  49. </el-radio-group>
  50. </div>
  51. </div>
  52. </div>
  53. <el-divider />
  54. <!-- 详情高级配置 -->
  55. <div class="section">
  56. <div class="section-title">
  57. <img src="@/assets/images/Photography/zhuangshi.png" style="width: 32px; height: 32px;" />
  58. 详情高级配置
  59. </div>
  60. <div class="section-content">
  61. <!-- 图片顺序 -->
  62. <div class="form-item">
  63. <div class="label">图片顺序:</div>
  64. <el-input v-model="imageOrder" placeholder="请输入图片顺序" class="specific-page-input">
  65. <template #append>
  66. <el-button class="explain-btn" link type="primary">说明</el-button>
  67. </template>
  68. </el-input>
  69. </div>
  70. <!-- 同款检验 -->
  71. <div class="form-item">
  72. <div class="label">同款检验:</div>
  73. <el-checkbox v-model="checkSimilar">同款下货号必须齐全</el-checkbox>
  74. </div>
  75. <!-- 可指定页面独修改 -->
  76. <div class="form-item">
  77. <div class="label">可指定页面独修改:</div>
  78. <el-input v-model="specificPage" placeholder="请输入入需要单独修改的页面,示例:4:1 (需修改模版的编号:第一张)"
  79. class="specific-page-input">
  80. <template #append>
  81. <el-button class="explain-btn" link type="primary">说明</el-button>
  82. </template>
  83. </el-input>
  84. </div>
  85. </div>
  86. </div>
  87. <!-- 底部按钮 -->
  88. <div class="footer">
  89. <el-button class="button--primary1 footer-button" type="primary" @click="saveConfig">保存配置</el-button>
  90. <el-button class="button--primary1 footer-button" type="primary" @click="startProcess">开始处理</el-button>
  91. </div>
  92. </div>
  93. <loading-dialog v-model="dialogVisible" :progress="progress" :message="message" :show-button="showButton"
  94. @button-click="handleComplete" />
  95. </div>
  96. </template>
  97. <script setup lang="ts">
  98. import headerBar from '@/components/header-bar/index.vue'
  99. import { ref } from 'vue'
  100. import { Close, Warning } from '@element-plus/icons-vue'
  101. import LoadingDialog from '@/views/Photography/components/LoadingDialog.vue'
  102. import client from "@/stores/modules/client";
  103. import icpList from '@/utils/ipc'
  104. const clientStore = client();
  105. const showTips = ref(true)
  106. const folderPath = ref('') //货号文件夹
  107. const reportMode = ref('normal') // 抠图模式
  108. const imageOrder = ref('俯视、侧视、后跟、鞋底、内里、组合、组合2、组合3') // 图片顺序
  109. const checkSimilar = ref(false) // 同款检验
  110. const specificPage = ref('') // 可指定页面独修改
  111. const dialogVisible = ref(false)
  112. const progress = ref(0)
  113. const message = ref('正在为您处理,请稍后')
  114. const showButton = ref(true)
  115. const saveConfig = () => {
  116. const params = {
  117. folderPath: folderPath.value,
  118. reportMode: reportMode.value,
  119. imageOrder: imageOrder.value,
  120. checkSimilar: checkSimilar.value,
  121. specificPage: specificPage.value
  122. }
  123. console.log("%c Line:139 🥕 params", "color:#93c0a4", params);
  124. // 保存配置逻辑
  125. console.log('保存配置')
  126. }
  127. const startProcess = () => {
  128. dialogVisible.value = true
  129. progress.value = 0
  130. showButton.value = true
  131. // 模拟进度更新
  132. const interval = setInterval(() => {
  133. if (progress.value < 100) {
  134. progress.value += 10
  135. } else {
  136. clearInterval(interval)
  137. message.value = '全部处理完毕'
  138. showButton.value = false
  139. }
  140. }, 500)
  141. }
  142. const handleComplete = () => {
  143. dialogVisible.value = false
  144. // 这里可以添加打开目录的逻辑
  145. console.log('打开目录')
  146. }
  147. const selectFolder = () => {
  148. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  149. clientStore.ipc.send(icpList.utils.openDirectory);
  150. clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
  151. folderPath.value = result
  152. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  153. })
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. .image-config {
  158. .config-card {
  159. background: #EAECED;
  160. padding: 20px;
  161. overflow-x: hidden;
  162. height: calc(100vh - 30px);
  163. .card-header {
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. .header-icons {
  168. display: flex;
  169. gap: 8px;
  170. }
  171. }
  172. }
  173. .section {
  174. margin-bottom: 24px;
  175. .section-title {
  176. display: flex;
  177. align-items: center;
  178. gap: 8px;
  179. font-weight: bold;
  180. margin-bottom: 16px;
  181. color: #474747;
  182. }
  183. .section-content {
  184. padding-left: 16px;
  185. }
  186. }
  187. .instruction-out {
  188. background: #EAF3FF;
  189. border-radius: 4px;
  190. border: 1px solid #CBE1FF;
  191. padding: 10px 20px;
  192. width: 80%;
  193. position: relative;
  194. .instruction-list {
  195. margin: 0px 0 0 10px;
  196. padding-left: 20px;
  197. padding-right: 40px;
  198. width: 100%;
  199. li {
  200. margin-bottom: 4px;
  201. text-align: left;
  202. font-size: 14px;
  203. }
  204. }
  205. .close-icon {
  206. position: absolute;
  207. top: 12px;
  208. right: 19px;
  209. }
  210. }
  211. .form-item {
  212. margin: 16px 0;
  213. display: flex;
  214. .label {
  215. min-width: 120px;
  216. margin-right: 12px;
  217. }
  218. .folder-warp {
  219. width: 100%;
  220. display: flex;
  221. flex-direction: column;
  222. .folder-input {
  223. flex: 1;
  224. display: flex;
  225. align-items: center;
  226. .check-button {
  227. background: #DFE2E3;
  228. border-radius: 6px;
  229. padding: 6px 12px;
  230. color: #2957FF;
  231. margin-left: 20px;
  232. }
  233. }
  234. }
  235. .hint {
  236. text-align: left;
  237. color: #999;
  238. margin-top: 6px;
  239. font-size: 14px;
  240. color: #FF4C00;
  241. font-style: normal;
  242. }
  243. .specific-page-input {
  244. flex: 1;
  245. }
  246. }
  247. .image-order {
  248. flex: 1;
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. }
  253. .footer {
  254. display: flex;
  255. justify-content: center;
  256. margin-top: 24px;
  257. .footer-button{
  258. padding: 10px 20px;
  259. }
  260. }
  261. }
  262. .explain-btn {
  263. padding-left: 20px;
  264. padding-right: 20px;
  265. color: #2957FF !important;
  266. }
  267. </style>