seniorDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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" v-log="{ describe: { action: '点击关闭高级配置提示' } }">
  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" v-log="{ describe: { action: '选择货号文件夹' } }">
  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" v-log="{ describe: { action: '点击图片顺序说明' } }">说明</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" v-log="{ describe: { action: '点击指定页面说明' } }">说明</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" v-log="{ describe: { action: '点击保存高级配置' } }">保存配置</el-button>
  90. <el-button class="button--primary1 footer-button" type="primary" @click="startProcess" v-log="{ describe: { action: '点击开始处理高级配置' } }">开始处理</el-button>
  91. </div>
  92. </div>
  93. <loading-dialog v-model="loadingDialogVisible" :progress="progress" :message="message" :show-button="showButton"
  94. @button-click="handleComplete" />
  95. </div>
  96. </template>
  97. <script setup lang="ts">
  98. /*高级配置 已废弃*/
  99. import headerBar from '@/components/header-bar/index.vue'
  100. import { ref } from 'vue'
  101. import { Close, Warning } from '@element-plus/icons-vue'
  102. import LoadingDialog from '@/views/Photography/components/LoadingDialog.vue'
  103. import client from "@/stores/modules/client";
  104. import icpList from '@/utils/ipc'
  105. const clientStore = client();
  106. const showTips = ref(true)
  107. const folderPath = ref('') //货号文件夹
  108. const reportMode = ref('normal') // 抠图模式
  109. const imageOrder = ref('俯视、侧视、后跟、鞋底、内里、组合、组合2、组合3') // 图片顺序
  110. const checkSimilar = ref(false) // 同款检验
  111. const specificPage = ref('') // 可指定页面独修改
  112. const loadingDialogVisible = ref(false)
  113. const progress = ref(0)
  114. const message = ref('正在为您处理,请稍后')
  115. const showButton = ref(true)
  116. const saveConfig = () => {
  117. const params = {
  118. folderPath: folderPath.value,
  119. reportMode: reportMode.value,
  120. imageOrder: imageOrder.value,
  121. checkSimilar: checkSimilar.value,
  122. specificPage: specificPage.value
  123. }
  124. console.log("%c Line:139 🥕 params", "color:#93c0a4", params);
  125. // 保存配置逻辑
  126. console.log('保存配置')
  127. }
  128. const startProcess = () => {
  129. loadingDialogVisible.value = true
  130. progress.value = 0
  131. showButton.value = true
  132. // 模拟进度更新
  133. const interval = setInterval(() => {
  134. if (progress.value < 100) {
  135. // progress.value += 10
  136. progress.value = Math.min(progress.value + 10, 100)
  137. } else {
  138. clearInterval(interval)
  139. message.value = '全部处理完毕'
  140. showButton.value = false
  141. }
  142. }, 500)
  143. }
  144. const handleComplete = () => {
  145. loadingDialogVisible.value = false
  146. // 这里可以添加打开目录的逻辑
  147. console.log('打开目录')
  148. }
  149. const selectFolder = () => {
  150. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  151. clientStore.ipc.send(icpList.utils.openDirectory);
  152. clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
  153. folderPath.value = result
  154. clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
  155. })
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. .image-config {
  160. .config-card {
  161. background: #EAECED;
  162. padding: 20px;
  163. overflow-x: hidden;
  164. height: calc(100vh - 30px);
  165. .card-header {
  166. display: flex;
  167. justify-content: space-between;
  168. align-items: center;
  169. .header-icons {
  170. display: flex;
  171. gap: 8px;
  172. }
  173. }
  174. }
  175. .section {
  176. margin-bottom: 24px;
  177. .section-title {
  178. display: flex;
  179. align-items: center;
  180. gap: 8px;
  181. font-weight: bold;
  182. margin-bottom: 16px;
  183. color: #474747;
  184. }
  185. .section-content {
  186. padding-left: 16px;
  187. }
  188. }
  189. .instruction-out {
  190. background: #EAF3FF;
  191. border-radius: 4px;
  192. border: 1px solid #CBE1FF;
  193. padding: 10px 20px;
  194. width: 80%;
  195. position: relative;
  196. .instruction-list {
  197. margin: 0px 0 0 10px;
  198. padding-left: 20px;
  199. padding-right: 40px;
  200. width: 100%;
  201. li {
  202. margin-bottom: 4px;
  203. text-align: left;
  204. font-size: 14px;
  205. }
  206. }
  207. .close-icon {
  208. position: absolute;
  209. top: 12px;
  210. right: 19px;
  211. }
  212. }
  213. .form-item {
  214. margin: 16px 0;
  215. display: flex;
  216. .label {
  217. min-width: 120px;
  218. margin-right: 12px;
  219. }
  220. .folder-warp {
  221. width: 100%;
  222. display: flex;
  223. flex-direction: column;
  224. .folder-input {
  225. flex: 1;
  226. display: flex;
  227. align-items: center;
  228. .check-button {
  229. background: #DFE2E3;
  230. border-radius: 6px;
  231. padding: 6px 12px;
  232. color: #2957FF;
  233. margin-left: 20px;
  234. }
  235. }
  236. }
  237. .hint {
  238. text-align: left;
  239. color: #999;
  240. margin-top: 6px;
  241. font-size: 14px;
  242. color: #FF4C00;
  243. font-style: normal;
  244. }
  245. .specific-page-input {
  246. flex: 1;
  247. }
  248. }
  249. .image-order {
  250. flex: 1;
  251. display: flex;
  252. justify-content: space-between;
  253. align-items: center;
  254. }
  255. .footer {
  256. display: flex;
  257. justify-content: center;
  258. margin-top: 24px;
  259. .footer-button{
  260. padding: 10px 20px;
  261. }
  262. }
  263. }
  264. .explain-btn {
  265. padding-left: 20px;
  266. padding-right: 20px;
  267. color: #2957FF !important;
  268. }
  269. </style>