App.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. <template>
  2. <div>
  3. <div class="header">
  4. <!-- <img src="/statics/image/loginLogo.png" class="logo" alt="华讯时代" style="height: 26px;width: 184px"/> -->
  5. <div class="tplName">
  6. <label>
  7. <input v-model="viewTitle" placeholder="请输入标题名称" type="text" />
  8. </label>
  9. <i class="el-icon-edit"></i>
  10. </div>
  11. <div class="button-group">
  12. <!-- <el-button type="primary" @click="previewAdvert" size="mini">预览</el-button>-->
  13. <!-- <el-button type="primary" @click="lookJson" size="mini">查看JSON</el-button> -->
  14. <el-button type="primary" @click="submit" size="mini">提交页面</el-button>
  15. <el-button size="mini" @click="closeOpenWindows">关闭</el-button>
  16. </div>
  17. <div class="editor">
  18. </div>
  19. </div>
  20. <section class="decoration-edit">
  21. <section class="l">
  22. <div class="title">封面图片</div>
  23. <div>
  24. <div class="cover">
  25. <img v-if="pic" :src="pic" />
  26. <img v-else src="@/assets/images/defaultimg.jpg" />
  27. </div>
  28. <!-- 上传图片 -->
  29. <div class="updataBtn">
  30. <el-button style="width:100%" type="primary" size="mini" @click="updataImage">上传封面</el-button>
  31. </div>
  32. </div>
  33. <ul>
  34. <div class="title">组件选择</div>
  35. <li v-for="(val, index) in typeList" :key="index + 1" @click="clickType(val)">
  36. <img :src="require('./assets/images/' + val.icon)">
  37. <!-- <img src="./assets/images/l-kefu.png"> -->
  38. <!-- <span :class="val.icon"></span> -->
  39. <p>{{ val.name }}</p>
  40. </li>
  41. </ul>
  42. </section>
  43. <section class="c">
  44. <div class="top-nav">
  45. <img src="./assets/images/topNavBlack.png">
  46. <span class="tit">{{ viewTitle }}</span>
  47. </div>
  48. <div class="view-content">
  49. <div v-for="(item, index) in view" :key="index">
  50. <div v-if="!item.isHover" :data-index="index" :key="index" class="item" @click="selectType(item)">
  51. <component :is="item.com" :data="item" :key="index + '_'"></component>
  52. <i @click="deleteItem($event, index)" class="el-icon-error"></i>
  53. <div class="control-tool-bar">
  54. <el-tooltip class="item" effect="light" content="上移" placement="bottom">
  55. <el-button class="ctrl-icon icon-up" type="text" size="small" @click.stop="upItem(item)"
  56. :disabled="index == 0"></el-button>
  57. </el-tooltip>
  58. <el-tooltip class="item" effect="light" content="下移" placement="bottom">
  59. <el-button class="ctrl-icon icon-down" type="text" size="small" @click.stop="downItem(item)"
  60. :disabled="index == view.length - getHoverList().length - 1"></el-button>
  61. </el-tooltip>
  62. </div>
  63. </div>
  64. <div v-if="item.isHover" :data-index="index" :key="index" class="item nobackground" :class="item.position"
  65. :style="'width:' + (item.width ? item.width : 100) + 'px;height:' + (item.height ? item.height : 100) + 'px;'"
  66. @click="selectType(item)">
  67. <component :is="item.com" :data="item" :key="index + '_'"></component>
  68. <i @click="deleteItem($event, index)" class="el-icon-error"></i>
  69. </div>
  70. </div>
  71. </div>
  72. </section>
  73. <section class="r" :class="isRight ? '' : 'nobackground'">
  74. <component v-if="isRight" :is="propsData.setCom" :data="propsData"
  75. @closeRightTemplateHandle="closeRightTemplateHandle" @updataContent="updataContent"></component>
  76. </section>
  77. <!-- <div class="submit-btn">
  78. <el-button @click="submit">提交页面</el-button>
  79. </div> -->
  80. </section>
  81. <materialManage v-if="materialVisible" :on-success="chooseImageHandle" :file-type="1" item-or-src="item">
  82. </materialManage>
  83. </div>
  84. </template>
  85. <script>
  86. import service from './utlis/axios'
  87. import { setCookie, getCookie, clearCookie } from '@/utlis/utli'
  88. import materialManage from './components/materialManage.vue'
  89. import editorImage from '@/components/View/editorImage'
  90. import settingImage from '@/components/setting/settingImage'
  91. import editorBanner from '@/components/View/editorBanner'
  92. import settingBanner from '@/components/setting/settingBanner'
  93. import editorText from '@/components/View/editorText'
  94. import settingText from '@/components/setting/settingText'
  95. import editorApplicationForm from '@/components/View/editorApplicationForm'
  96. import settingApplicationForm from '@/components/setting/settingApplicationForm'
  97. import editorCustomerService from '@/components/View/editorCustomerService'
  98. import settingCustomerService from '@/components/setting/settingCustomerService'
  99. import editorProduct from '@/components/View/editorProduct'
  100. import settingProduct from '@/components/setting/settingProduct'
  101. import editorRecharge from '@/components/View/editorRecharge'
  102. import settingRecharge from '@/components/setting/settingRecharge'
  103. import editorCoupon from '@/components/View/editorCoupon'
  104. import settingCoupon from '@/components/setting/settingCoupon'
  105. export default {
  106. components: {
  107. editorImage,
  108. editorBanner,
  109. settingImage,
  110. settingBanner,
  111. editorText,
  112. settingText,
  113. editorApplicationForm,
  114. settingApplicationForm,
  115. editorCustomerService,
  116. settingCustomerService,
  117. editorProduct,
  118. settingProduct,
  119. editorRecharge,
  120. settingRecharge,
  121. editorCoupon,
  122. settingCoupon,
  123. materialManage
  124. },
  125. data() {
  126. return {
  127. pic: '',//封面
  128. typeList: [
  129. {
  130. name: '轮播图',
  131. key: 'banner',
  132. icon: 'l-lunbo.png',
  133. com: 'editorBanner',
  134. setCom: 'settingBanner',
  135. value: {
  136. imageList: [{ src: '' }]
  137. }
  138. }, {
  139. name: '图片',
  140. key: 'images',
  141. icon: 'l-tupian.png',
  142. com: 'editorImage',
  143. setCom: 'settingImage',
  144. value: {
  145. src: ''
  146. }
  147. }, {
  148. name: '文本',
  149. key: 'text',
  150. icon: 'l-wenbeng.png',
  151. com: 'editorText',
  152. setCom: 'settingText',
  153. value: {
  154. content: '',
  155. isTitle: false
  156. }
  157. }, {
  158. name: '报名表',
  159. key: 'applicationForm',
  160. icon: 'l-baomingbiao.png',
  161. com: 'editorApplicationForm',
  162. setCom: 'settingApplicationForm',
  163. value: {
  164. title: { value: '报名表', isShow: true },
  165. database: '',
  166. formItemList: [{
  167. label: '', databaseLabel: '', type: 1, required: true,dataType:''
  168. }, {
  169. label: '', databaseLabel: '', type: 1, required: true,dataType:''
  170. }, {
  171. label: '', databaseLabel: '', type: 5, required: true,dataType:'', option: [{ label: '', value: '' }, { label: '', value: '' }]
  172. }],
  173. buttonName: ''
  174. }
  175. }, {
  176. name: '客服',
  177. key: 'customerService',
  178. icon: 'l-kefu.png',
  179. com: 'editorCustomerService',
  180. setCom: 'settingCustomerService',
  181. isHover: true,
  182. position: 'right-bottom',//left-top
  183. width: '70',
  184. height: '70',
  185. value: {
  186. type: '',
  187. text: ''
  188. }
  189. }, {
  190. name: '商品',
  191. key: 'product',
  192. icon: 'l-shangping.png',
  193. com: 'editorProduct',
  194. setCom: 'settingProduct',
  195. value: {
  196. layoutNum: 1,
  197. productList: [],
  198. showOriginalPrice: false
  199. }
  200. }, {
  201. name: '充值',
  202. key: 'recharge',
  203. icon: 'l-chongzhi.png',
  204. com: 'editorRecharge',
  205. setCom: 'settingRecharge',
  206. value: {
  207. mainColor:'#fe0419',
  208. showSymbol:true,
  209. placeholderText:'点击输入充值金额',
  210. buttonName:'立即充值',
  211. showSubButton:true,
  212. subButtonName:'激活卡充值'
  213. }
  214. }, {
  215. name: '优惠券',
  216. key: 'coupon',
  217. icon: 'l-youhuiquan.png',
  218. com: 'editorCoupon',
  219. setCom: 'settingCoupon',
  220. value: {
  221. couponObj:{}
  222. }
  223. }],
  224. view: [],
  225. type: '',
  226. propsData: {},
  227. isRight: false,
  228. materialVisible: false,
  229. pass: true,//校验
  230. id: null,
  231. libraryExtendId: null,
  232. viewTitle: '',
  233. bindId: null,
  234. bindType: null
  235. }
  236. },
  237. computed: {
  238. info() {
  239. return this.view[0]
  240. }
  241. },
  242. created() {
  243. var sid = this.getUrlParamValue('sid');
  244. sessionStorage.setItem('shiro.sesssion', sid)
  245. if (sid) {
  246. setCookie('shiro.sesssion', sid, 1)
  247. } else {
  248. setCookie('shiro.sesssion', "", -1);
  249. }
  250. // 编辑
  251. var id = this.getUrlParamValue('id');
  252. var bindId = this.getUrlParamValue('bindId');
  253. var bindType = this.getUrlParamValue('bindType');
  254. this.id = id
  255. this.bindId = bindId
  256. this.bindType = bindType
  257. if (id) {
  258. this.getMaterialLibrary(id)
  259. } else if (bindId) {
  260. this.getMaterialLibraryByBindId(bindId, bindType)
  261. }
  262. },
  263. methods: {
  264. // 关闭窗口
  265. closeOpenWindows() {
  266. window.open("about:blank", "_top").close();
  267. },
  268. getImage(url) {
  269. return require(url)
  270. },
  271. // 上传图片
  272. updataImage() {
  273. this.materialVisible = true
  274. },
  275. // 选择图片
  276. chooseImageHandle(val) {
  277. this.pic = val.url
  278. this.materialVisible = false
  279. },
  280. getUrlParamValue(name) {
  281. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  282. var r = window.location.search.substr(1).match(reg);
  283. if (r != null) return unescape(r[2]);
  284. return null;
  285. },
  286. // 编辑,根据id查询
  287. getMaterialLibrary(id) {
  288. service.get("/material/library/" + id).then((res) => {
  289. if (res.data.data) {
  290. this.pic = res.data.data.pic
  291. this.view = JSON.parse(res.data.data.libraryExtend.params)
  292. this.id = res.data.data.id
  293. this.libraryExtendId = res.data.data.libraryExtend.id
  294. this.viewTitle = res.data.data.title
  295. }
  296. }).catch(function () {
  297. });
  298. },
  299. getMaterialLibraryByBindId(bindId, bindType) {
  300. service.get(`/material/library/info?bindId=${bindId}&bindType=${bindType}`).then((res) => {
  301. if (res.data.data) {
  302. this.pic = res.data.data.pic
  303. this.view = JSON.parse(res.data.data.libraryExtend.params)
  304. this.id = res.data.data.id
  305. this.libraryExtendId = res.data.data.libraryExtend.id
  306. this.viewTitle = res.data.data.title
  307. }
  308. }).catch(() => {
  309. });
  310. },
  311. // index排序
  312. position() {
  313. let commonList = this.view.filter((item) => { return item.isHover != true })
  314. let hoverList = this.view.filter((item) => { return item.isHover == true })
  315. this.view = [...commonList, ...hoverList]
  316. this.view.forEach((item, index) => {
  317. item.index = index
  318. })
  319. },
  320. getHoverList() {
  321. return this.view.filter((item) => { return item.isHover == true })
  322. },
  323. clickType(val) {
  324. this.view.push(JSON.parse(JSON.stringify(val)))
  325. this.position()
  326. },
  327. deleteItem(e, index) {
  328. e.preventDefault()
  329. e.stopPropagation()
  330. this.view.splice(index, 1)
  331. this.isRight = false
  332. this.propsData = {}
  333. this.position()
  334. },
  335. selectType(val) {
  336. this.isRight = false
  337. this.propsData = val
  338. this.$nextTick(() => this.isRight = true)
  339. },
  340. closeRightTemplateHandle(val) {
  341. this.isRight = val
  342. },
  343. updataContent(val) {
  344. this.$set(this.view, val.index, JSON.parse(JSON.stringify(val)))
  345. // this.view.forEach(item => {
  346. // if(item.key==val.key&&item.index==val.index) item = JSON.parse(JSON.stringify(val))
  347. // });
  348. },
  349. lookJson() {
  350. this.$alert(JSON.stringify(this.view), 'JSON', {
  351. confirmButtonText: '确定'
  352. });
  353. },
  354. // 上移
  355. upItem(item) {
  356. if (item.index == 0) return
  357. if (this.view[item.index - 1].isHover) {
  358. this.swapArray(this.view, item.index - 2, item.index);
  359. } else {
  360. this.swapArray(this.view, item.index - 1, item.index);
  361. }
  362. this.$nextTick(() => {
  363. this.selectType(item);
  364. })
  365. },
  366. // 下移
  367. downItem(item) {
  368. if (item.index == this.view.length) return
  369. if (this.view[item.index + 1].isHover) {
  370. this.swapArray(this.view, item.index, item.index + 2);
  371. } else {
  372. this.swapArray(this.view, item.index, item.index + 1);
  373. }
  374. this.$nextTick(() => {
  375. this.selectType(item);
  376. })
  377. },
  378. //数组元素互换位置
  379. swapArray(arr, index1, index2) {
  380. arr[index1] = arr.splice(index2, 1, arr[index1])[0];
  381. this.position()
  382. return arr;
  383. },
  384. // 提交
  385. submit() {
  386. console.log(this.view)
  387. this.checkSubmit()
  388. if (this.pass) {
  389. let posObj = {
  390. pic: this.pic,
  391. libraryExtend: {
  392. params: JSON.stringify(this.view)
  393. },
  394. title: this.viewTitle,
  395. rootCode: 'brochure'
  396. }
  397. if (this.id) {
  398. posObj.id = this.id
  399. posObj.libraryExtend.id = this.libraryExtendId
  400. service.put("/material/library", posObj).then((res) => {
  401. this.$message.success('编辑成功')
  402. }).catch(function () {
  403. });
  404. }else {
  405. if (this.bindId) {
  406. posObj.bindId = this.bindId
  407. posObj.bindType = this.bindType
  408. }
  409. service.post("/material/library", posObj).then((res) => {
  410. if (res.data.data.code)
  411. this.$message.success('提交成功')
  412. }).catch(function () {
  413. });
  414. }
  415. } else {
  416. }
  417. },
  418. // 校验
  419. checkSubmit() {
  420. let that = this
  421. that.pass = true
  422. if (this.view.length == 0) {
  423. that.pass = false
  424. return this.$message.error("请添加组件");
  425. }
  426. if (!this.pic || this.pic == '') {
  427. that.pass = false
  428. return this.$message.error("请上传封面");
  429. }
  430. if (!this.viewTitle || this.viewTitle == '') {
  431. that.pass = false
  432. return this.$message.error("请填写标题");
  433. }
  434. this.view.forEach(item => {
  435. if (!that.pass) return
  436. switch (item.key) {
  437. case 'banner':
  438. {
  439. item.value.imageList.forEach((src) => {
  440. if (!src.src || src.src == '') {
  441. that.pass = false
  442. this.selectType(item)
  443. return this.$message.error("请选择banner图图片");
  444. }
  445. })
  446. }
  447. break;
  448. case 'images':
  449. {
  450. if (!item.value.src || item.value.src == '') {
  451. that.pass = false
  452. this.selectType(item)
  453. return this.$message.error("请选择图片");
  454. }
  455. }
  456. break;
  457. case 'text':
  458. {
  459. if (!item.value.content || item.value.content == '') {
  460. that.pass = false
  461. this.selectType(item)
  462. return this.$message.error("文本不能为空");
  463. }
  464. }
  465. break;
  466. case 'applicationForm':
  467. {
  468. if (item.value.title.isShow && (!item.value.title.value || item.value.title.value == '')) {
  469. that.pass = false
  470. this.selectType(item)
  471. return this.$message.error("已开启显示标题,标题不能为空");
  472. } else if (!item.value.database || item.value.database == '') {
  473. that.pass = false
  474. this.selectType(item)
  475. return this.$message.error("表单数据库名不能为空");
  476. } else if (!item.value.buttonName || item.value.buttonName == '') {
  477. that.pass = false
  478. this.selectType(item)
  479. return this.$message.error("表单按钮名称不能为空");
  480. } else if (item.value.formItemList) {
  481. item.value.formItemList.forEach(sitem => {
  482. if (!that.pass) return
  483. if (!sitem.label || sitem.label == '') {
  484. that.pass = false
  485. this.selectType(item)
  486. return this.$message.error("表单字段名不能为空");
  487. } else if (!sitem.databaseLabel || sitem.databaseLabel == '') {
  488. that.pass = false
  489. this.selectType(item)
  490. return this.$message.error("表单数据库字段名不能为空");
  491. } else if (sitem.type == 'select') {
  492. if (!sitem.option) {
  493. that.pass = false
  494. this.selectType(item)
  495. return this.$message.error("表单下拉框选项不能为空");
  496. } else {
  497. sitem.option.forEach(ssitem => {
  498. if (!ssitem.label || ssitem.label == '') {
  499. that.pass = false
  500. this.selectType(item)
  501. return this.$message.error("表单下拉框选项标签不能为空");
  502. } else if (!ssitem.value || ssitem.value == '') {
  503. that.pass = false
  504. this.selectType(item)
  505. return this.$message.error("表单下拉框选项值不能为空");
  506. }
  507. })
  508. }
  509. }
  510. })
  511. }
  512. }
  513. break;
  514. case 'customerService':
  515. {
  516. if (item.value.type == '') {
  517. that.pass = false
  518. this.selectType(item)
  519. return this.$message.error("请填写客服类型");
  520. } else if (item.value.type == 1) {
  521. if (!item.value.id || item.value.id == '') {
  522. that.pass = false
  523. this.selectType(item)
  524. return this.$message.error("请填写企业ID");
  525. } else if (!item.value.target || item.value.target == '') {
  526. that.pass = false
  527. this.selectType(item)
  528. return this.$message.error("请填写跳转地址");
  529. }
  530. } else if (item.value.type == 2) {
  531. if (!item.value.target || item.value.target == '') {
  532. that.pass = false
  533. this.selectType(item)
  534. return this.$message.error("请填写跳转地址");
  535. }
  536. }
  537. }
  538. break;
  539. case 'product':
  540. {
  541. if (!item.value.productList || item.value.productList.length == 0) {
  542. that.pass = false
  543. this.selectType(item)
  544. return this.$message.error("请选择商品");
  545. }
  546. }
  547. break;
  548. default:
  549. break;
  550. }
  551. })
  552. return that.pass
  553. }
  554. }
  555. }
  556. </script>
  557. <style scoped>
  558. #app {
  559. font-family: Avenir, Helvetica, Arial, sans-serif;
  560. -webkit-font-smoothing: antialiased;
  561. -moz-osx-font-smoothing: grayscale;
  562. text-align: center;
  563. color: #2c3e50;
  564. }
  565. .header {
  566. display: flex;
  567. width: 100%;
  568. height: 44px;
  569. background-color: #fff;
  570. align-items: center;
  571. justify-content: flex-end;
  572. }
  573. .tplName {
  574. display: flex;
  575. justify-content: center;
  576. align-items: center;
  577. height: 100%;
  578. flex: 1;
  579. }
  580. .tplName input {
  581. width: 199px;
  582. font-size: 16px;
  583. outline: none;
  584. border: 0;
  585. border-bottom: 1px solid #ddd;
  586. height: 30px;
  587. background-color: #fff;
  588. }
  589. .button-group {
  590. margin-right: 15px;
  591. position: absolute;
  592. }
  593. .decoration-edit {
  594. display: flex;
  595. align-items: center;
  596. justify-content: space-between;
  597. padding: 0 0 10px 0;
  598. background: #f7f8f9;
  599. height: calc(100vh - 70px);
  600. position: relative;
  601. }
  602. .decoration-edit .cover {
  603. padding: 10px 20px 10px 10px;
  604. height: 110px;
  605. }
  606. .decoration-edit .cover img {
  607. max-width: 100%;
  608. max-height: 100%;
  609. position: relative;
  610. top: 50%;
  611. left: 50%;
  612. transform: translate(-50%, -50%);
  613. }
  614. .decoration-edit .updataBtn {
  615. padding: 0px 30px 10px 20px;
  616. }
  617. .decoration-edit .l,
  618. .r {
  619. width: 380px;
  620. height: 100%;
  621. padding: 0 0 15px 0;
  622. background: #fff;
  623. overflow-y: auto;
  624. }
  625. .decoration-edit .l {
  626. width: 220px;
  627. margin-right: 160px;
  628. }
  629. .decoration-edit .l .title {
  630. position: relative;
  631. font-weight: bold;
  632. padding-left: 10px;
  633. margin-bottom: 20px;
  634. }
  635. .decoration-edit .l .title:before {
  636. content: "";
  637. position: absolute;
  638. top: 50%;
  639. left: 0;
  640. transform: translateY(-50%);
  641. width: 3px;
  642. height: 18px;
  643. background: #1890ff;
  644. opacity: 1;
  645. border-radius: 2px;
  646. }
  647. .nobackground {
  648. background: unset !important;
  649. }
  650. .decoration-edit .l::-webkit-scrollbar,
  651. .r::-webkit-scrollbar {
  652. width: 6px;
  653. }
  654. .decoration-edit .l::-webkit-scrollbar-thumb,
  655. .r::-webkit-scrollbar-thumb {
  656. background: #dbdbdb;
  657. }
  658. .decoration-edit .l::-webkit-scrollbar-track,
  659. .r::-webkit-scrollbar-track {
  660. background: #f6f6f6;
  661. }
  662. .decoration-edit .l ul {
  663. margin: 0;
  664. padding: 0;
  665. }
  666. .decoration-edit ul li {
  667. width: 80px;
  668. height: 80px;
  669. display: flex;
  670. justify-content: center;
  671. align-items: center;
  672. flex-direction: column;
  673. cursor: default;
  674. list-style: none;
  675. font-size: 14px;
  676. color: #666;
  677. float: left;
  678. margin: 0 10px;
  679. border-radius: 6px;
  680. transition: all .3s;
  681. cursor: pointer;
  682. }
  683. .decoration-edit ul li:hover {
  684. background: #efefef;
  685. }
  686. .decoration-edit ul span {
  687. display: block;
  688. font-size: 40px;
  689. margin-bottom: 8px;
  690. color: #999;
  691. }
  692. .decoration-edit ul img {
  693. display: block;
  694. width: 50px;
  695. margin-bottom: 8px;
  696. }
  697. ul p {
  698. display: block;
  699. margin: 0;
  700. font-size: 12px;
  701. }
  702. .decoration-edit .c {
  703. width: auto;
  704. /* max-width: 400px; */
  705. max-width: 370px;
  706. position: relative;
  707. flex: 1;
  708. }
  709. .decoration-edit .c .top-nav {
  710. position: absolute;
  711. top: 0;
  712. background: #fff;
  713. z-index: 999;
  714. transition: all .3s;
  715. }
  716. .decoration-edit .c .top-nav * {
  717. pointer-events: none;
  718. }
  719. /* .decoration-edit .top-nav:hover {
  720. transform: scale(0.95);
  721. border-radius: 10px;
  722. overflow: hidden;
  723. box-shadow: 0 0 10px #afafaf;
  724. } */
  725. .decoration-edit .top-nav .tit {
  726. position: absolute;
  727. left: 50%;
  728. bottom: 10px;
  729. transform: translateX(-50%);
  730. text-overflow: ellipsis;
  731. white-space: nowrap;
  732. overflow: hidden;
  733. max-width: 50%;
  734. }
  735. .decoration-edit .top-nav img {
  736. max-width: 100%;
  737. image-rendering: -moz-crisp-edges;
  738. image-rendering: -o-crisp-edges;
  739. image-rendering: -webkit-optimize-contrast;
  740. image-rendering: crisp-edges;
  741. -ms-interpolation-mode: nearest-neighbor;
  742. }
  743. .decoration-edit .view-content {
  744. /* width: 400px; */
  745. /* height: 700px; */
  746. width: 370px;
  747. height: 560px;
  748. background: #f5f5f5;
  749. overflow-y: auto;
  750. overflow-x: hidden;
  751. padding-top: 72px;
  752. box-shadow: 0 2px 6px #ccc;
  753. }
  754. .decoration-edit .view-content::-webkit-scrollbar {
  755. width: 6px;
  756. }
  757. .decoration-edit .view-content::-webkit-scrollbar-thumb {
  758. background: #dbdbdb;
  759. }
  760. .decoration-edit .view-content::-webkit-scrollbar-track {
  761. background: #f6f6f6;
  762. }
  763. .decoration-edit .view-content .item {
  764. transition: all .3s;
  765. background: #fff;
  766. }
  767. .decoration-edit .view-content .item:hover {
  768. transform: scale(0.95);
  769. border-radius: 10px;
  770. box-shadow: 0 0 10px #afafaf;
  771. }
  772. .decoration-edit .view-content .item:hover .el-icon-error {
  773. display: block;
  774. }
  775. .decoration-edit .view-content .item:hover .control-tool-bar {
  776. display: block;
  777. }
  778. .decoration-edit .view-content .item div {
  779. pointer-events: none;
  780. }
  781. .decoration-edit .view-content .item .wait {
  782. background: #deedff;
  783. height: 35px;
  784. text-align: center;
  785. line-height: 35px;
  786. font-size: 12px;
  787. color: #666;
  788. }
  789. .decoration-edit .view-content .item .el-icon-error {
  790. position: absolute;
  791. right: -10px;
  792. top: -6px;
  793. color: red;
  794. font-size: 25px;
  795. cursor: pointer;
  796. display: none;
  797. z-index: 9999;
  798. }
  799. .decoration-edit .view-content .item .control-tool-bar {
  800. position: absolute;
  801. top: 0;
  802. left: 50%;
  803. width: 66px;
  804. transform: translateX(-50%);
  805. z-index: 9998;
  806. pointer-events: unset;
  807. display: none;
  808. }
  809. .decoration-edit .view-content .item .control-tool-bar .ctrl-icon {
  810. width: 33px;
  811. height: 33px;
  812. margin-left: 0;
  813. margin-bottom: 2px;
  814. background-color: #fff;
  815. -webkit-box-shadow: 0 0 4px 2px rgb(0 0 0 / 10%);
  816. box-shadow: 0 0 4px 2px rgb(0 0 0 / 10%);
  817. border-radius: 4px;
  818. background-repeat: no-repeat;
  819. background-position: 50%;
  820. }
  821. .decoration-edit .view-content .item .control-tool-bar .icon-up {
  822. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6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Psjmc8UAAADNSURBVHjaYvz//z8DLQATA43AwBtcV1c3B4hNiVXPSEwYAw2cBKRygfg1EMs3NTV9p9jFQEMroIaCgCgQH6U4KICGFgCpdjRhQ6D4cbKDAqg5CEitxaN3PTBIgkhyMdBQCwKGgkAgUN0Eog0GKo4CUseJjPx8oPo12CRYsIgJAfFeIP4AxFxA7IlFzRUgvg7EnGQnN6CLsClIBYbvHEpShSQOKQFK0zEzuel/GBdC1DaYBYc4DwOZGmHgMxC/A2JWNPGHVCk2R0bkAQQYAEdHPS1kdX1UAAAAAElFTkSuQmCC);
  823. }
  824. .decoration-edit .view-content .item .control-tool-bar .icon-up.is-disabled,
  825. .decoration-edit .view-content .item .control-tool-bar .icon-up.is-disabled:hover {
  826. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo1ZjA2NzFlZS0yODUwLWMyNDMtYWQzNS00YzEzY2I2ZDFhZmIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTVCRUE4NDI3RDZFMTFFQTg3NDJBODEwMUE2NDg5MUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTVCRUE4NDE3RDZFMTFFQTg3NDJBODEwMUE2NDg5MUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4YWNlODEyNi1kZWFkLTQzNDYtOGRhOC00MmFlMDYxMmI0ZGYiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpiMzgxMjliYS02OTNiLTJmNDgtOThhZS1mYzkxMGE4ZGYzZTAiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5lL4zAAAAAzUlEQVR42mL8//8/Ay0AEwONwMAb/Pz58zlAbEqsekZiwhho4CQglQvEr4FYXlJS8jvFLgYaWgE1FAREgfgoxUEBNLQASLWjCRsCxY+THRRAzUFAai0eveuBQRJEkouBhloQMBQEAoHqJhBtMFBxFJA6TmTk5wPVr8EmwYJFTAiI9wLxByDmAmJPLGquAPF1IOYkO7kBXYRNQSowfOdQkiokcUgJUJqOmclN/8O4EKK2wSw4xHkYyNQIA5+B+B0Qs6KJP6RKsTkyIg8gwABPpUl7JDE4ewAAAABJRU5ErkJggg==);
  827. }
  828. .decoration-edit .view-content .item .control-tool-bar .icon-down {
  829. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAW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UVBODc0MkE4MTAxQTY0ODkxQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCOEQyMTUwMjdENkUxMUVBODc0MkE4MTAxQTY0ODkxQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqOiNT4AAADgSURBVHjaYvz//z8DLQATA40ACyEFdXV10kCqHYiFoULfgbirqanpFEUGA0ELEMeiiRkDsSKlQcFOqzD+QaQYfSJveBr8F4vYf2oY/J8cgxmxZWlgprgDTeO/gFgciPnQlIDEH0EdxgXMLJLEungrEMsDsSoWQ0GADYhVgFgJiK8QHRRAF+QDqQ4igukQUK0r0UGBFCTLgFQkDunzQEONyIo8oMYoILUPi9Q7ILYiOfKwuPw8kDJAKt20gJY+oEYGsUVimxIylGgXQ11tCqTkgIauJUY945CrmmhmMECAAQCTB0MOORfSxwAAAABJRU5ErkJggg==);
  830. }
  831. .decoration-edit .view-content .item .control-tool-bar .icon-down.is-disabled,
  832. .decoration-edit .view-content .item .control-tool-bar .icon-down.is-disabled:hover {
  833. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPH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UifBxpqRFbkATVGAal9WKTeAbEVRakCaLgzkLqAJAQq3YyB4j+okUFskdimQEMfkJXccIS3KZCSAxq6lhj1jEOuaqKZwQABBgC4Mzjx6VYCZQAAAABJRU5ErkJggg==);
  834. }
  835. .decoration-edit .view-content .item .control-tool-bar .ctrl-icon.is-disabled {
  836. background-color: #fff;
  837. }
  838. .decoration-edit .submit-btn {
  839. position: absolute;
  840. bottom: 30px;
  841. left: 50%;
  842. transform: translateX(-50%);
  843. }
  844. /* 悬浮组件 */
  845. .left-top {
  846. position: absolute;
  847. top: 100px;
  848. left: 20px;
  849. z-index: 200;
  850. }
  851. .right-bottom {
  852. position: absolute;
  853. bottom: 50px;
  854. right: 20px;
  855. z-index: 200;
  856. }
  857. </style>