my_form.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. <template>
  2. <view>
  3. <view class="requiredFieldOnly-head" v-if="requiredFieldOnly">
  4. <view class="label">
  5. 基本信息
  6. </view>
  7. <view class="content">
  8. 仅显示必填信息<text style="padding: 0 2.5px;" /> <u-switch activeColor="#C40C24" v-model="unShowAll" />
  9. </view>
  10. </view>
  11. <slot name="head" />
  12. <block v-for="(item, index) in list " :key="item.key">
  13. <block v-if="item.isMust || !unShowAll">
  14. <!-- 文本输入 -->
  15. <view class="input-box" v-if="item.type == 'text'"
  16. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
  17. @click="focusLabel = item.label">
  18. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  19. <view class="label">
  20. <text class="must" v-if="item.isMust">*</text>
  21. {{ item.label }}:
  22. </view>
  23. <view class="content-box">
  24. <view class="content">
  25. <input v-if="item.inputmode == 'number'" type="number" :disabled="item.disabled"
  26. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  27. :focus="focusLabel == item.label" :placeholder="item.placeholder || '请填写' + item.label"
  28. :value="item.value" :style="{ width: item.value ? '220px' : '240px' }"
  29. @input="onInput($event, index)" :maxlength="item.maxlength || '499'"
  30. confirm-type="done" />
  31. <input v-else-if="item.inputmode == 'digit'" type="digit" :disabled="item.disabled"
  32. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  33. :focus="focusLabel == item.label" :placeholder="item.placeholder || '请填写' + item.label"
  34. :value="item.value" :style="{ width: item.value ? '220px' : '240px' }"
  35. @input="onInput($event, index)" :maxlength="item.maxlength || '499'"
  36. confirm-type="done" />
  37. <textarea v-else :disabled="item.disabled"
  38. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;"
  39. auto-height type="text" :focus="focusLabel == item.label"
  40. :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
  41. :style="{ width: item.value ? '220px' : '240px' }" @input="onInput($event, index)"
  42. :maxlength="item.maxlength || '499'" confirm-type="done" />
  43. <icon v-if="item.value && !item.disabled" class="icon" type="clear" size="3.733vw"
  44. @click="onClearInput(index)" />
  45. </view>
  46. <view v-if="item.errText" class="err-text">
  47. <icon class="icon" color="#E3041F" type="clear" size="2.733vw" />
  48. {{ item.errText }}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 文本域 -->
  54. <view class="textarea-box" v-else-if="item.type == 'textarea'">
  55. <textarea class="textarea" :class="item.unBorBot ? '' : 'borBot'" :disabled="item.disabled"
  56. placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;" type="text"
  57. :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
  58. @input="onInput($event, index)" :maxlength="item.maxlength || '499'" confirm-type="done" />
  59. </view>
  60. <!-- 自定义选项分类 -->
  61. <view class="custom-class-box" v-else-if="item.type == 'customClass'"
  62. :style="{ marginTop: tovw(item.marginTop || 0) }">
  63. <view class="head">
  64. <view class="label">
  65. <text class="must" style="color: #E3041F;" v-if="item.isMust">*</text>
  66. {{ item.label }}
  67. </view>
  68. <view class="state">
  69. {{ item.isMultipleChoice ? '可多选' : '仅单选' }}
  70. </view>
  71. </view>
  72. <view class="options">
  73. <view class="option"
  74. :class="item.isMultipleChoice ? (item.value.includes(option.value) ? 'active' : '') : (item.value == option.value ? 'active' : '')"
  75. v-for=" option in item.list " :key="option.value" hover-class="navigator-hover"
  76. @click="changOptions(option.value, index)">
  77. {{ option.remarks }}
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 选择所在地区 -->
  82. <picker class="region" @change="selectRegion($event, index)" mode='region' :disabled="item.disabled"
  83. :value="item.value" v-else-if="item.type == 'region'"
  84. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
  85. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  86. <view class="label">
  87. <text class="must" v-if="item.isMust">*</text>
  88. {{ item.label }}:
  89. </view>
  90. <view class="content-box">
  91. <view class="value" v-if="item.value.length">
  92. {{ item.value.join(",") }}
  93. </view>
  94. <view v-else class="placeholder" hover-class="none">
  95. {{ item.placeholder || '请选择' + item.label }}
  96. </view>
  97. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  98. </view>
  99. </view>
  100. </picker>
  101. <!-- 日期 -->
  102. <picker class="region" @change="selectRegion($event, index)" mode='date' :disabled="item.disabled"
  103. :value="item.value" v-else-if="item.type == 'date'"
  104. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
  105. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  106. <view class="label">
  107. <text class="must" v-if="item.isMust">*</text>
  108. {{ item.label }}:
  109. </view>
  110. <view class="content-box">
  111. <view class="value" v-if="item.value">
  112. {{ item.value }}
  113. </view>
  114. <view v-else class="placeholder" hover-class="none">
  115. {{ item.placeholder || '请选择' + item.label }}
  116. </view>
  117. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  118. </view>
  119. </view>
  120. </picker>
  121. <!-- 上传附件 -->
  122. <view class="custom-class-box" v-else-if="item.type == 'upload'"
  123. :style="{ marginTop: tovw(item.marginTop || 0) }">
  124. <view class="head">
  125. <view class="label">
  126. <text class="must" v-if="item.isMust">*</text>
  127. {{ item.label }}
  128. </view>
  129. <view class="state">
  130. {{ item.placeholder }}
  131. </view>
  132. </view>
  133. <view class="content">
  134. <view class="file-box" v-for="file in item.value" :key="file.attachmentid">
  135. <image class="image" v-if="file.fileType == 'image'" :src="file.url" mode="aspectFill"
  136. lazy-load="true" @click="previewImg(file)" />
  137. <video v-else-if="file.fileType == 'video'" class="video" :poster="file.subfiles[0].url"
  138. :src="file.url" />
  139. <image class="delete" @click.stop="deleteFile(file, index)"
  140. src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404241713944430197B47af9b2f.png"
  141. mode="widthFix" />
  142. </view>
  143. <My_upload v-if="item.allowUpload" :showLoading="false" :maxCount="item.maxCount || 99"
  144. :accept="item.accept" @uploadCallback="uploadCallback($event, index)"
  145. @onLoading="onUploadLoading($event, index)">
  146. <view class="upload-box"
  147. v-if="item.maxCount ? item.value.length != item.maxCount : item.value.length != 99"
  148. hover-class="navigator-hover">
  149. <u-loading-icon v-if="item.loading" />
  150. <text v-else class="iconfont icon-xiazai" />
  151. <text style="margin-left: 5px;">上传</text>
  152. </view>
  153. </My_upload>
  154. </view>
  155. </view>
  156. <!-- 开关 -->
  157. <view class="region" v-else-if="item.type == 'switch'">
  158. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  159. <view class="label">
  160. <text class="must" v-if="item.isMust">*</text>
  161. {{ item.label }}:
  162. </view>
  163. <view class="content-box">
  164. <view />
  165. <u-switch activeColor="#70D95D" v-model="item.value" :disabled="item.disabled"
  166. @change="switchChange($event, index)" />
  167. </view>
  168. </view>
  169. </view>
  170. <!-- 性别 -->
  171. <view class="region" v-else-if="item.type == 'sex'">
  172. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  173. <view class="label">
  174. <text class="must" v-if="item.isMust">*</text>
  175. {{ item.label }}:
  176. </view>
  177. <u-radio-group v-model="item.value" placement="row" @change="groupChange($event, index)">
  178. <u-radio :customStyle="{ marginRight: tovw(60) }" label="男" name="男" />
  179. <u-radio label="女" name="女" />
  180. </u-radio-group>
  181. </view>
  182. </view>
  183. <!-- 单选 -->
  184. <view class="region" v-else-if="item.type == 'radio'">
  185. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  186. <view class="label">
  187. <text class="must" v-if="item.isMust">*</text>
  188. {{ item.label }}:
  189. </view>
  190. <u-radio-group v-model="item.value" :placement="item.placement || 'row'"
  191. @change="groupChange($event, index)">
  192. <u-radio v-for="option in item.options"
  193. :customStyle="{ marginRight: tovw(option.marginRight || item.marginRight || 0), marginTop: tovw(option.marginTop || item.marginTop || 0) }"
  194. :key="option.label" :label="option.label" :name="option.name" />
  195. </u-radio-group>
  196. </view>
  197. </view>
  198. <!-- 路由选择器 -->
  199. <view class="region" v-else-if="item.type == 'route'"
  200. :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
  201. @click="item.disabled ? '' : toRoute(item, index)">
  202. <view class="box" :class="item.unBorBot ? '' : 'borBot'">
  203. <view class="label">
  204. <text class="must" v-if="item.isMust">*</text>
  205. {{ item.label }}:
  206. </view>
  207. <view class="content-box">
  208. <view class="value" v-if="item.showValue.length">
  209. {{ item.showValue.join(",") }}
  210. </view>
  211. <view v-else class="placeholder" hover-class="none">
  212. {{ item.placeholder || '请选择' + item.label }}
  213. </view>
  214. <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
  215. </view>
  216. </view>
  217. </view>
  218. <!-- 标签 -->
  219. <view class="tag-box custom-class-box " v-else-if="item.type == 'tag'"
  220. :style="{ marginTop: tovw(item.marginTop || 0) }">
  221. <text class="label">{{ item.label }}</text>
  222. <view class="tag-list">
  223. <view class="tag" v-for="tag in item.value" :key="tag">
  224. <text>{{tag}}</text>
  225. <view @click="delTag(tag,index)" class="del">x</view>
  226. </view>
  227. <view>
  228. <u-modal :title="item.label" :show="showTagModal" style="flex: 0 !important;" confirmColor='#C30D23' ref="uModal" showCancelButton :asyncClose="false"
  229. @confirm="addTagSend(index)" @cancel="showTagModal = false">
  230. <view class="slot-content">
  231. <view v-if="item.errText" class="err-text" style="margin-bottom: 10px;">
  232. <icon class="icon" color="#E3041F" type="clear" size="2.733vw" />
  233. {{ item.errText }}
  234. </view>
  235. <u--input :focus="showUModal" @input="onTagInput($event, index)" :placeholder="item.placeholder || '请输入'" v-model="tagValue" border="bottom" clearable />
  236. </view>
  237. </u-modal>
  238. <view class="add-tag" @click="showTagModal=true">+ 添加</view>
  239. </view>
  240. </view>
  241. </view>
  242. </block>
  243. </block>
  244. </view>
  245. </template>
  246. <script>
  247. import { formattedFiles, viewImage } from "../utils/settleFiles.js"
  248. export default {
  249. name: "my_form",
  250. props: {
  251. form: {
  252. type: Array,
  253. default: []
  254. },
  255. isUncomplete: {
  256. type: Function
  257. },
  258. onUploading: {
  259. type: Function
  260. },
  261. requiredFieldOnly: {
  262. type: Boolean
  263. },
  264. isShowAll: {
  265. type: Function
  266. },
  267. interrupt: {
  268. type: Function
  269. }
  270. },
  271. data() {
  272. return {
  273. list: [],
  274. focusLabel: "",
  275. unShowAll: false,
  276. showTagModal:false,
  277. tagValue:''
  278. }
  279. },
  280. watch: {
  281. form: {
  282. handler: function (newVal) {
  283. if (newVal) {
  284. this.list = JSON.parse(JSON.stringify(newVal));
  285. setTimeout(() => {
  286. this.verify()
  287. }, 200);
  288. }
  289. },
  290. immediate: true,
  291. },
  292. unShowAll: function (newVal) {
  293. this.$emit("isShowAll", newVal)
  294. }
  295. },
  296. async created() {
  297. /* let list = [{
  298. key: "name",
  299. type: "text",
  300. label: "标题",
  301. isMust: true,//是否必填
  302. value: "",
  303. inputmode:"", //https://uniapp.dcloud.net.cn/component/input.html#type
  304. marginTop: 10,
  305. verify:[],
  306. }, {
  307. key: "Class",
  308. type: "customClass",
  309. label: "标题",
  310. isMust: false,//是否必填
  311. isMultipleChoice: true,//是否多选
  312. value: [],// 多选[] 单选 ""
  313. isMust: true,//是否必填
  314. list: await this.getCustomClass('picturespace'),
  315. marginTop: 10
  316. },{
  317. key: "attachmentids",
  318. type: "upload",
  319. label: "图片/视频",
  320. accept:"all",
  321. placeholder: "可上传多个视频或图片",
  322. ownertable: "temporary",
  323. ownerid: 999,
  324. usetype: 'default',
  325. allowUpload: true,
  326. allowDelete: true,
  327. value:[],
  328. marginTop: 10
  329. }, {
  330. key: "region",
  331. type: "region",
  332. label: "所在地区",
  333. isMust: true,//是否必填
  334. value: [],
  335. }, {
  336. key: "address",
  337. type: "textarea",
  338. label: "详细地址",
  339. isMust: true,//是否必填
  340. value: '',
  341. }, {
  342. key: "isdefault",
  343. type: "switch",
  344. label: "设为默认地址",
  345. isMust: false,//是否必填
  346. value: false,
  347. isNum: true,
  348. unBorBot: true
  349. }] */
  350. },
  351. methods: {
  352. delTag (tag,index) {
  353. let item = this.list[index];
  354. console.log(tag);
  355. item.value.splice(item.value.indexOf(tag),1)
  356. this.$set(this.list[index], 'value', item.value)
  357. },
  358. addTagSend (index) {
  359. let item = this.list[index]
  360. if (!item.errText) {
  361. item.value.push(this.tagValue)
  362. this.$set(this.list[index], 'value', item.value)
  363. this.tagValue = ''
  364. this.showTagModal = false
  365. }
  366. },
  367. toRoute(item, index) {
  368. uni.navigateTo({
  369. url: item.path
  370. });
  371. this.$Http.routeSelected = function (selected) {
  372. this.$emit('interrupt', item, selected, index)
  373. delete this.$Http.routeSelected;
  374. }.bind(this)
  375. },
  376. onTagInput(e, index) {
  377. let item = this.list[index];
  378. item.errText = "";
  379. if (item.verify && item.verify.length && this.tagValue != '') {
  380. let err = item.verify.find(r => !new RegExp(r.reg).test(this.tagValue));
  381. if (err) this.$set(this.list[index], 'errText', err.errText)
  382. }
  383. this.verify()
  384. },
  385. onInput(e, index) {
  386. let item = this.list[index];
  387. item.errText = "";
  388. this.$set(this.list[index], 'value', e.detail.value)
  389. if (item.verify && item.verify.length && item.value != '') {
  390. let err = item.verify.find(r => !new RegExp(r.reg).test(item.value));
  391. if (err) this.$set(this.list[index], 'errText', err.errText)
  392. }
  393. this.verify()
  394. },
  395. setItem(index, item, back = false) {
  396. this.$set(this.list, index, item)
  397. this.verify()
  398. if (back) uni.navigateBack();
  399. },
  400. setValue(index, value, back = false) {
  401. this.$set(this.list[index], 'value', value)
  402. this.verify()
  403. if (back) uni.navigateBack();
  404. },
  405. onClearInput(index) {
  406. let item = this.list[index];
  407. item.errText = ''
  408. this.$set(this.list[index], 'value', '')
  409. this.verify()
  410. },
  411. switchChange(e, index) {
  412. this.$set(this.list[index], 'value', e)
  413. this.verify()
  414. },
  415. changOptions(value, index) {
  416. let item = this.list[index];
  417. if (item.isMultipleChoice) {
  418. let i = -1;
  419. try {
  420. i = item.value.findIndex(v => v == value)
  421. } catch (error) {
  422. }
  423. if (i == -1) {
  424. item.value.push(value)
  425. } else {
  426. item.value.splice(i, 1)
  427. }
  428. this.$set(this.list[index], 'value', item.value)
  429. } else {
  430. this.$set(this.list[index], 'value', value)
  431. }
  432. this.verify()
  433. },
  434. verify() {
  435. let list = this.list.filter(v => v.isMust);
  436. let Uncomplete = false;
  437. if (list.length) Uncomplete = list.some(v => {
  438. let res = false;
  439. if (v.type == 'customClass') {
  440. if (v.isMultipleChoice) {
  441. res = v.value.length == 0;
  442. } else {
  443. res = v.value == "";
  444. }
  445. } else if (v.type == 'upload') {
  446. res = v.value.length == 0;
  447. } else if (v.type == 'text') {
  448. res = v.value == "";
  449. if (v.errText) res = true;
  450. } else if (v.type == 'route') {
  451. res = v.showValue.length == 0;
  452. } else {
  453. res = v.value == "";
  454. }
  455. return res
  456. })
  457. if (!Uncomplete) Uncomplete = this.list.filter(v => !v.isMust).some(v => v.errText);
  458. this.$emit("isUncomplete", Uncomplete)
  459. },
  460. previewImg(item) {
  461. viewImage(item.url)
  462. },
  463. uploadCallback(attachmentids, index) {
  464. let item = this.list[index];
  465. this.$Http.basic({
  466. "classname": "system.attachment.Attachment",
  467. "method": "createFileLink",
  468. "content": {
  469. ownertable: item.ownertable,
  470. ownerid: item.ownerid,
  471. usetype: item.usetype,
  472. attachmentids
  473. }
  474. }).then(res => {
  475. console.log('绑定附件', res)
  476. if (this.cutoff(res.msg)) return;
  477. res.data = formattedFiles(res.data)
  478. item.value.push(res.data[0]);
  479. //临时文件
  480. if (res.data[0].ownertable == "temporary") try {
  481. item.temporarys.push(attachmentids[0])
  482. } catch (error) {
  483. item.temporarys = [attachmentids[0]]
  484. }
  485. this.$set(this.list[index], 'value', item.value)
  486. this.verify()
  487. })
  488. },
  489. deleteFiles() {
  490. this.list.forEach(v => {
  491. if (v.type == 'upload') {
  492. let linksids = v.value.filter(v => v.ownertable == "temporary").map(v => v.linksid)
  493. if (linksids.length) this.$Http.basic({
  494. "classname": "system.attachment.Attachment",
  495. "method": "deleteFileLink",
  496. "content": {
  497. linksids
  498. }
  499. }).then(res => {
  500. console.log("处理删除附件", res)
  501. if (this.cutoff(res.msg)) return;
  502. });
  503. }
  504. });
  505. },
  506. onUploadLoading(e, index) {
  507. this.$set(this.list[index], 'loading', e)
  508. this.$emit("onUploading", e)
  509. },
  510. groupChange(e, index) {
  511. this.$set(this.list[index], 'loading', e)
  512. this.verify()
  513. },
  514. selectRegion({ detail }, index) {
  515. this.$set(this.list[index], 'value', detail.value)
  516. this.verify()
  517. },
  518. deleteFile(flie, index) {
  519. let item = this.list[index];
  520. item.value = item.value.filter(v => v.attachmentid != flie.attachmentid)
  521. //临时文件
  522. if (flie.ownertable == "temporary") {
  523. item.temporarys = item.temporarys.filter(v => v != flie.attachmentid)
  524. this.$Http.basic({
  525. "classname": "system.attachment.Attachment",
  526. "method": "deleteFileLink",
  527. "content": {
  528. linksids: [flie.linksid]
  529. }
  530. }).then(res => {
  531. console.log("处理删除附件", res)
  532. if (this.cutoff(res.msg)) return;
  533. });
  534. } else {
  535. try {
  536. item.linksids.push(flie.linksid)
  537. } catch (error) {
  538. item.linksids = [flie.linksid]
  539. }
  540. }
  541. this.$set(this.list[index], 'value', item.value)
  542. this.verify()
  543. },
  544. submit() {
  545. return new Promise((resolve, reject) => {
  546. let res = {};
  547. this.list.forEach(v => {
  548. if (v.type == 'upload') {
  549. res.files = {
  550. temporarys: [],
  551. linksids: [],
  552. }
  553. try {
  554. res.files.temporarys = v.temporarys || []
  555. } catch (error) {
  556. }
  557. try {
  558. res.files.linksids = v.linksids || []
  559. } catch (error) {
  560. }
  561. } else if (v.type == 'region') {
  562. if (v.value.length) {
  563. res.province = v.value[0];
  564. res.city = v.value[1];
  565. res.county = v.value[2];
  566. } else {
  567. res.province = ''
  568. res.city = ''
  569. res.county = ''
  570. }
  571. } else if (v.type == 'switch') {
  572. if (v.isNum) {
  573. res[v.key] = v.value ? 1 : 0;
  574. } else {
  575. res[v.key] = v.value;
  576. }
  577. } else if (v.type == 'route') {
  578. if (v.isRadio) {
  579. const routeValue = typeof v.value.length == 'number' ? v.value.length ? v.value[0] : '' : v.value || {}
  580. if (v.keys) {
  581. v.keys.forEach(e => {
  582. res[e] = routeValue ? routeValue[e] || '' : ''
  583. })
  584. } else {
  585. res[v.key] = {
  586. name: v.showValue[0] || '',
  587. value: routeValue
  588. };
  589. }
  590. } else {
  591. res[v.key] = {
  592. name: v.showValue || [],
  593. value: v.value || []
  594. };;
  595. }
  596. } else {
  597. try {
  598. res[v.key] = v.value.trim();
  599. } catch (error) {
  600. res[v.key] = v.value;
  601. }
  602. }
  603. })
  604. resolve(res)
  605. })
  606. }
  607. },
  608. }
  609. </script>
  610. <style lang="scss">
  611. .requiredFieldOnly-head {
  612. display: flex;
  613. align-items: center;
  614. justify-content: space-between;
  615. width: 100vw;
  616. height: 45px;
  617. background: #F7F7F7;
  618. padding: 0 10px;
  619. box-sizing: border-box;
  620. .label {
  621. font-family: PingFang SC, PingFang SC;
  622. font-weight: bold;
  623. font-size: 15px;
  624. color: #333333;
  625. line-height: 22px;
  626. }
  627. .content {
  628. display: flex;
  629. align-items: center;
  630. font-family: PingFang SC, PingFang SC;
  631. font-size: 14px;
  632. color: #999999;
  633. }
  634. }
  635. .borBot {
  636. border-bottom: 1px #DDDDDD solid;
  637. }
  638. .custom-class-box {
  639. width: 100%;
  640. background: #fff;
  641. padding: 15px 0 15px 10px;
  642. box-sizing: border-box;
  643. .head {
  644. width: 355px;
  645. height: 20px;
  646. display: flex;
  647. justify-content: space-between;
  648. align-items: flex-end;
  649. .label {
  650. font-size: 14px;
  651. color: #333333;
  652. line-height: 20px;
  653. }
  654. .state {
  655. font-family: Source Han Sans SC, Source Han Sans SC;
  656. font-size: 12px;
  657. color: #999999;
  658. }
  659. }
  660. .options {
  661. display: flex;
  662. flex-wrap: wrap;
  663. .option {
  664. padding: 6px 10px;
  665. text-align: center;
  666. min-width: 81px;
  667. font-family: PingFang SC, PingFang SC;
  668. font-size: 14px;
  669. color: #333333;
  670. border-radius: 5px;
  671. background: #F2F2F2;
  672. margin-top: 10px;
  673. margin-right: 10px;
  674. box-sizing: border-box;
  675. }
  676. .active {
  677. background: #C30D23;
  678. color: #fff;
  679. }
  680. }
  681. .content {
  682. .file-box {
  683. position: relative;
  684. width: 355px;
  685. height: 240px;
  686. margin-top: 10px;
  687. .video,
  688. .image {
  689. width: 355px;
  690. height: 240px;
  691. border-radius: 5px;
  692. }
  693. .delete {
  694. position: absolute;
  695. width: 30px;
  696. top: 0;
  697. right: 0;
  698. z-index: 1;
  699. }
  700. }
  701. .upload-box {
  702. display: flex;
  703. justify-content: center;
  704. align-items: center;
  705. width: 355px;
  706. height: 45px;
  707. background: #FFFFFF;
  708. border-radius: 5px;
  709. border: 1px dashed #C30D23;
  710. font-family: Source Han Sans SC, Source Han Sans SC;
  711. font-size: 14px;
  712. color: #C30D23;
  713. margin-top: 10px;
  714. }
  715. }
  716. }
  717. .textarea-box {
  718. width: 100%;
  719. .textarea {
  720. width: 355px;
  721. height: 160px;
  722. padding: 15px 10px;
  723. box-sizing: border-box;
  724. margin: 0 auto;
  725. }
  726. }
  727. .input-box {
  728. width: 100vw;
  729. background: #fff;
  730. box-sizing: border-box;
  731. padding-left: 10px;
  732. .box {
  733. display: flex;
  734. width: 100%;
  735. min-height: 54.4px;
  736. padding: 15px 0;
  737. box-sizing: border-box;
  738. align-items: center;
  739. }
  740. .label {
  741. width: 100px;
  742. margin-right: 10px;
  743. line-height: 20px;
  744. font-family: Source Han Sans SC, Source Han Sans SC;
  745. font-size: 14px;
  746. color: #666666;
  747. flex-shrink: 0;
  748. .must {
  749. color: #E3041F;
  750. margin-right: 5px;
  751. }
  752. }
  753. .content-box {
  754. padding-right: 10px;
  755. .content {
  756. flex: 1;
  757. display: flex;
  758. align-items: center;
  759. box-sizing: border-box;
  760. .icon {
  761. padding: 5px;
  762. }
  763. }
  764. .err-text {
  765. font-size: 12px;
  766. color: #E3041F;
  767. margin-bottom: -12px;
  768. .icon {
  769. margin-right: 2px;
  770. }
  771. }
  772. }
  773. }
  774. .region {
  775. width: 100vw;
  776. background: #fff;
  777. box-sizing: border-box;
  778. padding: 15px 0 0 10px;
  779. .box {
  780. display: flex;
  781. padding-bottom: 15px;
  782. padding-right: 10px;
  783. box-sizing: border-box;
  784. .label {
  785. width: 100px;
  786. margin-right: 10px;
  787. line-height: 20px;
  788. font-family: Source Han Sans SC, Source Han Sans SC;
  789. font-size: 14px;
  790. color: #666666;
  791. flex-shrink: 0;
  792. .must {
  793. color: #E3041F;
  794. margin-right: 5px;
  795. }
  796. }
  797. .content-box {
  798. flex: 1;
  799. display: flex;
  800. align-items: center;
  801. justify-content: space-between;
  802. height: 20px;
  803. line-height: 20px;
  804. .placeholder {
  805. font-family: Source Han Sans SC, Source Han Sans SC;
  806. font-size: 14px;
  807. color: #BBBBBB;
  808. }
  809. }
  810. }
  811. }
  812. .tag-box {
  813. .label {
  814. width: 100px;
  815. margin-right: 10px;
  816. line-height: 20px;
  817. font-family: Source Han Sans SC, Source Han Sans SC;
  818. font-size: 14px;
  819. color: #666666;
  820. flex-shrink: 0;
  821. .must {
  822. color: #E3041F;
  823. margin-right: 5px;
  824. }
  825. }
  826. .tag-list{
  827. display: flex;
  828. align-content: center;
  829. align-items: center;
  830. flex-wrap: wrap;
  831. font-family: PingFang SC, PingFang SC;
  832. margin-top:10px;
  833. .err-text {
  834. font-size: 12px;
  835. color: #E3041F;
  836. margin-bottom: -12px;
  837. .icon {
  838. margin-right: 2px;
  839. }
  840. }
  841. .tag {
  842. padding: 6px 10px;
  843. background: #F2F2F2;
  844. border-radius: 5px 5px 5px 5px;
  845. margin-right: 10px;
  846. margin-bottom: 10px;
  847. font-weight: 400;
  848. font-size: 14px;
  849. color: #333333;
  850. display: flex;
  851. align-items: center;
  852. align-content: center;
  853. text-align:center;
  854. &:last-child {
  855. margin-right: 0 !important;
  856. }
  857. .del {
  858. margin-left: 10px;
  859. padding: 2px;
  860. }
  861. }
  862. .add-tag {
  863. border-radius: 5px 5px 5px 5px;
  864. border: 1px dashed #C30D23;
  865. padding: 6px 20px;
  866. color:#C30D23;
  867. font-weight: 400;
  868. margin-bottom:10px;
  869. font-size: 14px;
  870. }
  871. }
  872. }
  873. </style>