App.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  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. rechargeTitle:'在线充值线下使用有优惠',
  208. mainColor:'#fe0419',
  209. showSymbol:true,
  210. placeholderText:'点击输入充值金额',
  211. buttonName:'立即充值',
  212. showSubButton:true,
  213. subButtonName:'激活卡充值',
  214. fastRechargeList:['50','100','200','250','300']
  215. }
  216. }, {
  217. name: '优惠券',
  218. key: 'coupon',
  219. icon: 'l-youhuiquan.png',
  220. com: 'editorCoupon',
  221. setCom: 'settingCoupon',
  222. value: {
  223. couponObj:{}
  224. }
  225. }],
  226. view: [],
  227. type: '',
  228. propsData: {},
  229. isRight: false,
  230. materialVisible: false,
  231. pass: true,//校验
  232. id: null,
  233. libraryExtendId: null,
  234. viewTitle: '',
  235. bindId: null,
  236. bindType: null
  237. }
  238. },
  239. computed: {
  240. info() {
  241. return this.view[0]
  242. }
  243. },
  244. created() {
  245. var sid = this.getUrlParamValue('sid');
  246. sessionStorage.setItem('shiro.sesssion', sid)
  247. if (sid) {
  248. setCookie('shiro.sesssion', sid, 1)
  249. } else {
  250. setCookie('shiro.sesssion', "", -1);
  251. }
  252. // 编辑
  253. var id = this.getUrlParamValue('id');
  254. var bindId = this.getUrlParamValue('bindId');
  255. var bindType = this.getUrlParamValue('bindType');
  256. this.id = id
  257. this.bindId = bindId
  258. this.bindType = bindType
  259. if (id) {
  260. this.getMaterialLibrary(id)
  261. } else if (bindId) {
  262. this.getMaterialLibraryByBindId(bindId, bindType)
  263. }
  264. },
  265. methods: {
  266. // 关闭窗口
  267. closeOpenWindows() {
  268. window.open("about:blank", "_top").close();
  269. },
  270. getImage(url) {
  271. return require(url)
  272. },
  273. // 上传图片
  274. updataImage() {
  275. this.materialVisible = true
  276. },
  277. // 选择图片
  278. chooseImageHandle(val) {
  279. this.pic = val.url
  280. this.materialVisible = false
  281. },
  282. getUrlParamValue(name) {
  283. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  284. var r = window.location.search.substr(1).match(reg);
  285. if (r != null) return unescape(r[2]);
  286. return null;
  287. },
  288. // 编辑,根据id查询
  289. getMaterialLibrary(id) {
  290. service.get("/material/library/" + id).then((res) => {
  291. if (res.data.data) {
  292. this.pic = res.data.data.pic
  293. this.view = JSON.parse(res.data.data.libraryExtend.params)
  294. this.id = res.data.data.id
  295. this.libraryExtendId = res.data.data.libraryExtend.id
  296. this.viewTitle = res.data.data.title
  297. }
  298. }).catch(function () {
  299. });
  300. },
  301. getMaterialLibraryByBindId(bindId, bindType) {
  302. service.get(`/material/library/info?bindId=${bindId}&bindType=${bindType}`).then((res) => {
  303. if (res.data.data) {
  304. this.pic = res.data.data.pic
  305. this.view = JSON.parse(res.data.data.libraryExtend.params)
  306. this.id = res.data.data.id
  307. this.libraryExtendId = res.data.data.libraryExtend.id
  308. this.viewTitle = res.data.data.title
  309. }
  310. }).catch(() => {
  311. });
  312. },
  313. // index排序
  314. position() {
  315. let commonList = this.view.filter((item) => { return item.isHover != true })
  316. let hoverList = this.view.filter((item) => { return item.isHover == true })
  317. this.view = [...commonList, ...hoverList]
  318. this.view.forEach((item, index) => {
  319. item.index = index
  320. })
  321. },
  322. getHoverList() {
  323. return this.view.filter((item) => { return item.isHover == true })
  324. },
  325. clickType(val) {
  326. this.view.push(JSON.parse(JSON.stringify(val)))
  327. this.position()
  328. },
  329. deleteItem(e, index) {
  330. e.preventDefault()
  331. e.stopPropagation()
  332. this.view.splice(index, 1)
  333. this.isRight = false
  334. this.propsData = {}
  335. this.position()
  336. },
  337. selectType(val) {
  338. this.isRight = false
  339. this.propsData = val
  340. this.$nextTick(() => this.isRight = true)
  341. },
  342. closeRightTemplateHandle(val) {
  343. this.isRight = val
  344. },
  345. updataContent(val) {
  346. this.$set(this.view, val.index, JSON.parse(JSON.stringify(val)))
  347. // this.view.forEach(item => {
  348. // if(item.key==val.key&&item.index==val.index) item = JSON.parse(JSON.stringify(val))
  349. // });
  350. },
  351. lookJson() {
  352. this.$alert(JSON.stringify(this.view), 'JSON', {
  353. confirmButtonText: '确定'
  354. });
  355. },
  356. // 上移
  357. upItem(item) {
  358. if (item.index == 0) return
  359. if (this.view[item.index - 1].isHover) {
  360. this.swapArray(this.view, item.index - 2, item.index);
  361. } else {
  362. this.swapArray(this.view, item.index - 1, item.index);
  363. }
  364. this.$nextTick(() => {
  365. this.selectType(item);
  366. })
  367. },
  368. // 下移
  369. downItem(item) {
  370. if (item.index == this.view.length) return
  371. if (this.view[item.index + 1].isHover) {
  372. this.swapArray(this.view, item.index, item.index + 2);
  373. } else {
  374. this.swapArray(this.view, item.index, item.index + 1);
  375. }
  376. this.$nextTick(() => {
  377. this.selectType(item);
  378. })
  379. },
  380. //数组元素互换位置
  381. swapArray(arr, index1, index2) {
  382. arr[index1] = arr.splice(index2, 1, arr[index1])[0];
  383. this.position()
  384. return arr;
  385. },
  386. // 提交
  387. submit() {
  388. console.log(this.view)
  389. this.checkSubmit()
  390. if (this.pass) {
  391. let posObj = {
  392. pic: this.pic,
  393. libraryExtend: {
  394. params: JSON.stringify(this.view)
  395. },
  396. title: this.viewTitle,
  397. rootCode: 'brochure'
  398. }
  399. if (this.id) {
  400. posObj.id = this.id
  401. posObj.libraryExtend.id = this.libraryExtendId
  402. service.put("/material/library", posObj).then((res) => {
  403. this.$message.success('编辑成功')
  404. }).catch(function () {
  405. });
  406. }else {
  407. if (this.bindId) {
  408. posObj.bindId = this.bindId
  409. posObj.bindType = this.bindType
  410. }
  411. service.post("/material/library", posObj).then((res) => {
  412. if (res.data.data.code)
  413. this.$message.success('提交成功')
  414. }).catch(function () {
  415. });
  416. }
  417. } else {
  418. }
  419. },
  420. // 校验
  421. checkSubmit() {
  422. let that = this
  423. that.pass = true
  424. if (this.view.length == 0) {
  425. that.pass = false
  426. return this.$message.error("请添加组件");
  427. }
  428. if (!this.pic || this.pic == '') {
  429. that.pass = false
  430. return this.$message.error("请上传封面");
  431. }
  432. if (!this.viewTitle || this.viewTitle == '') {
  433. that.pass = false
  434. return this.$message.error("请填写标题");
  435. }
  436. this.view.forEach(item => {
  437. if (!that.pass) return
  438. switch (item.key) {
  439. case 'banner':
  440. {
  441. item.value.imageList.forEach((src) => {
  442. if (!src.src || src.src == '') {
  443. that.pass = false
  444. this.selectType(item)
  445. return this.$message.error("请选择banner图图片");
  446. }
  447. })
  448. }
  449. break;
  450. case 'images':
  451. {
  452. if (!item.value.src || item.value.src == '') {
  453. that.pass = false
  454. this.selectType(item)
  455. return this.$message.error("请选择图片");
  456. }
  457. }
  458. break;
  459. case 'text':
  460. {
  461. if (!item.value.content || item.value.content == '') {
  462. that.pass = false
  463. this.selectType(item)
  464. return this.$message.error("文本不能为空");
  465. }
  466. }
  467. break;
  468. case 'applicationForm':
  469. {
  470. if (item.value.title.isShow && (!item.value.title.value || item.value.title.value == '')) {
  471. that.pass = false
  472. this.selectType(item)
  473. return this.$message.error("已开启显示标题,标题不能为空");
  474. } else if (!item.value.database || item.value.database == '') {
  475. that.pass = false
  476. this.selectType(item)
  477. return this.$message.error("表单数据库名不能为空");
  478. } else if (!item.value.buttonName || item.value.buttonName == '') {
  479. that.pass = false
  480. this.selectType(item)
  481. return this.$message.error("表单按钮名称不能为空");
  482. } else if (item.value.formItemList) {
  483. item.value.formItemList.forEach(sitem => {
  484. if (!that.pass) return
  485. if (!sitem.label || sitem.label == '') {
  486. that.pass = false
  487. this.selectType(item)
  488. return this.$message.error("表单字段名不能为空");
  489. } else if (!sitem.databaseLabel || sitem.databaseLabel == '') {
  490. that.pass = false
  491. this.selectType(item)
  492. return this.$message.error("表单数据库字段名不能为空");
  493. } else if (sitem.type == 'select') {
  494. if (!sitem.option) {
  495. that.pass = false
  496. this.selectType(item)
  497. return this.$message.error("表单下拉框选项不能为空");
  498. } else {
  499. sitem.option.forEach(ssitem => {
  500. if (!ssitem.label || ssitem.label == '') {
  501. that.pass = false
  502. this.selectType(item)
  503. return this.$message.error("表单下拉框选项标签不能为空");
  504. } else if (!ssitem.value || ssitem.value == '') {
  505. that.pass = false
  506. this.selectType(item)
  507. return this.$message.error("表单下拉框选项值不能为空");
  508. }
  509. })
  510. }
  511. }
  512. })
  513. }
  514. }
  515. break;
  516. case 'customerService':
  517. {
  518. if (item.value.type == '') {
  519. that.pass = false
  520. this.selectType(item)
  521. return this.$message.error("请填写客服类型");
  522. } else if (item.value.type == 1) {
  523. if (!item.value.id || item.value.id == '') {
  524. that.pass = false
  525. this.selectType(item)
  526. return this.$message.error("请填写企业ID");
  527. } else if (!item.value.target || item.value.target == '') {
  528. that.pass = false
  529. this.selectType(item)
  530. return this.$message.error("请填写跳转地址");
  531. }
  532. } else if (item.value.type == 2) {
  533. if (!item.value.target || item.value.target == '') {
  534. that.pass = false
  535. this.selectType(item)
  536. return this.$message.error("请填写跳转地址");
  537. }
  538. }
  539. }
  540. break;
  541. case 'product':
  542. {
  543. if (!item.value.productList || item.value.productList.length == 0) {
  544. that.pass = false
  545. this.selectType(item)
  546. return this.$message.error("请选择商品");
  547. }
  548. }
  549. break;
  550. default:
  551. break;
  552. }
  553. })
  554. return that.pass
  555. }
  556. }
  557. }
  558. </script>
  559. <style scoped>
  560. #app {
  561. font-family: Avenir, Helvetica, Arial, sans-serif;
  562. -webkit-font-smoothing: antialiased;
  563. -moz-osx-font-smoothing: grayscale;
  564. text-align: center;
  565. color: #2c3e50;
  566. }
  567. .header {
  568. display: flex;
  569. width: 100%;
  570. height: 44px;
  571. background-color: #fff;
  572. align-items: center;
  573. justify-content: flex-end;
  574. }
  575. .tplName {
  576. display: flex;
  577. justify-content: center;
  578. align-items: center;
  579. height: 100%;
  580. flex: 1;
  581. }
  582. .tplName input {
  583. width: 199px;
  584. font-size: 16px;
  585. outline: none;
  586. border: 0;
  587. border-bottom: 1px solid #ddd;
  588. height: 30px;
  589. background-color: #fff;
  590. }
  591. .button-group {
  592. margin-right: 15px;
  593. position: absolute;
  594. }
  595. .decoration-edit {
  596. display: flex;
  597. align-items: center;
  598. justify-content: space-between;
  599. padding: 0 0 10px 0;
  600. background: #f7f8f9;
  601. height: calc(100vh - 70px);
  602. position: relative;
  603. }
  604. .decoration-edit .cover {
  605. padding: 10px 20px 10px 10px;
  606. height: 110px;
  607. }
  608. .decoration-edit .cover img {
  609. max-width: 100%;
  610. max-height: 100%;
  611. position: relative;
  612. top: 50%;
  613. left: 50%;
  614. transform: translate(-50%, -50%);
  615. }
  616. .decoration-edit .updataBtn {
  617. padding: 0px 30px 10px 20px;
  618. }
  619. .decoration-edit .l,
  620. .r {
  621. width: 380px;
  622. height: 100%;
  623. padding: 0 0 15px 0;
  624. background: #fff;
  625. overflow-y: auto;
  626. }
  627. .decoration-edit .l {
  628. width: 220px;
  629. margin-right: 160px;
  630. }
  631. .decoration-edit .l .title {
  632. position: relative;
  633. font-weight: bold;
  634. padding-left: 10px;
  635. margin-bottom: 20px;
  636. }
  637. .decoration-edit .l .title:before {
  638. content: "";
  639. position: absolute;
  640. top: 50%;
  641. left: 0;
  642. transform: translateY(-50%);
  643. width: 3px;
  644. height: 18px;
  645. background: #1890ff;
  646. opacity: 1;
  647. border-radius: 2px;
  648. }
  649. .nobackground {
  650. background: unset !important;
  651. }
  652. .decoration-edit .l::-webkit-scrollbar,
  653. .r::-webkit-scrollbar {
  654. width: 6px;
  655. }
  656. .decoration-edit .l::-webkit-scrollbar-thumb,
  657. .r::-webkit-scrollbar-thumb {
  658. background: #dbdbdb;
  659. }
  660. .decoration-edit .l::-webkit-scrollbar-track,
  661. .r::-webkit-scrollbar-track {
  662. background: #f6f6f6;
  663. }
  664. .decoration-edit .l ul {
  665. margin: 0;
  666. padding: 0;
  667. }
  668. .decoration-edit ul li {
  669. width: 80px;
  670. height: 80px;
  671. display: flex;
  672. justify-content: center;
  673. align-items: center;
  674. flex-direction: column;
  675. cursor: default;
  676. list-style: none;
  677. font-size: 14px;
  678. color: #666;
  679. float: left;
  680. margin: 0 10px;
  681. border-radius: 6px;
  682. transition: all .3s;
  683. cursor: pointer;
  684. }
  685. .decoration-edit ul li:hover {
  686. background: #efefef;
  687. }
  688. .decoration-edit ul span {
  689. display: block;
  690. font-size: 40px;
  691. margin-bottom: 8px;
  692. color: #999;
  693. }
  694. .decoration-edit ul img {
  695. display: block;
  696. width: 50px;
  697. margin-bottom: 8px;
  698. }
  699. ul p {
  700. display: block;
  701. margin: 0;
  702. font-size: 12px;
  703. }
  704. .decoration-edit .c {
  705. width: auto;
  706. /* max-width: 400px; */
  707. max-width: 370px;
  708. position: relative;
  709. flex: 1;
  710. }
  711. .decoration-edit .c .top-nav {
  712. position: absolute;
  713. top: 0;
  714. background: #fff;
  715. z-index: 999;
  716. transition: all .3s;
  717. }
  718. .decoration-edit .c .top-nav * {
  719. pointer-events: none;
  720. }
  721. /* .decoration-edit .top-nav:hover {
  722. transform: scale(0.95);
  723. border-radius: 10px;
  724. overflow: hidden;
  725. box-shadow: 0 0 10px #afafaf;
  726. } */
  727. .decoration-edit .top-nav .tit {
  728. position: absolute;
  729. left: 50%;
  730. bottom: 10px;
  731. transform: translateX(-50%);
  732. text-overflow: ellipsis;
  733. white-space: nowrap;
  734. overflow: hidden;
  735. max-width: 50%;
  736. }
  737. .decoration-edit .top-nav img {
  738. max-width: 100%;
  739. image-rendering: -moz-crisp-edges;
  740. image-rendering: -o-crisp-edges;
  741. image-rendering: -webkit-optimize-contrast;
  742. image-rendering: crisp-edges;
  743. -ms-interpolation-mode: nearest-neighbor;
  744. }
  745. .decoration-edit .view-content {
  746. /* width: 400px; */
  747. /* height: 700px; */
  748. width: 370px;
  749. height: 560px;
  750. background: #f5f5f5;
  751. overflow-y: auto;
  752. overflow-x: hidden;
  753. padding-top: 72px;
  754. box-shadow: 0 2px 6px #ccc;
  755. }
  756. .decoration-edit .view-content::-webkit-scrollbar {
  757. width: 6px;
  758. }
  759. .decoration-edit .view-content::-webkit-scrollbar-thumb {
  760. background: #dbdbdb;
  761. }
  762. .decoration-edit .view-content::-webkit-scrollbar-track {
  763. background: #f6f6f6;
  764. }
  765. .decoration-edit .view-content .item {
  766. transition: all .3s;
  767. background: #fff;
  768. }
  769. .decoration-edit .view-content .item:hover {
  770. transform: scale(0.95);
  771. border-radius: 10px;
  772. box-shadow: 0 0 10px #afafaf;
  773. }
  774. .decoration-edit .view-content .item:hover .el-icon-error {
  775. display: block;
  776. }
  777. .decoration-edit .view-content .item:hover .control-tool-bar {
  778. display: block;
  779. }
  780. .decoration-edit .view-content .item div {
  781. pointer-events: none;
  782. }
  783. .decoration-edit .view-content .item .wait {
  784. background: #deedff;
  785. height: 35px;
  786. text-align: center;
  787. line-height: 35px;
  788. font-size: 12px;
  789. color: #666;
  790. }
  791. .decoration-edit .view-content .item .el-icon-error {
  792. position: absolute;
  793. right: -10px;
  794. top: -6px;
  795. color: red;
  796. font-size: 25px;
  797. cursor: pointer;
  798. display: none;
  799. z-index: 9999;
  800. }
  801. .decoration-edit .view-content .item .control-tool-bar {
  802. position: absolute;
  803. top: 0;
  804. left: 50%;
  805. width: 66px;
  806. transform: translateX(-50%);
  807. z-index: 9998;
  808. pointer-events: unset;
  809. display: none;
  810. }
  811. .decoration-edit .view-content .item .control-tool-bar .ctrl-icon {
  812. width: 33px;
  813. height: 33px;
  814. margin-left: 0;
  815. margin-bottom: 2px;
  816. background-color: #fff;
  817. -webkit-box-shadow: 0 0 4px 2px rgb(0 0 0 / 10%);
  818. box-shadow: 0 0 4px 2px rgb(0 0 0 / 10%);
  819. border-radius: 4px;
  820. background-repeat: no-repeat;
  821. background-position: 50%;
  822. }
  823. .decoration-edit .view-content .item .control-tool-bar .icon-up {
  824. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1w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9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Psjmc8UAAADNSURBVHjaYvz//z8DLQATA43AwBtcV1c3B4hNiVXPSEwYAw2cBKRygfg1EMs3NTV9p9jFQEMroIaCgCgQH6U4KICGFgCpdjRhQ6D4cbKDAqg5CEitxaN3PTBIgkhyMdBQCwKGgkAgUN0Eog0GKo4CUseJjPx8oPo12CRYsIgJAfFeIP4AxFxA7IlFzRUgvg7EnGQnN6CLsClIBYbvHEpShSQOKQFK0zEzuel/GBdC1DaYBYc4DwOZGmHgMxC/A2JWNPGHVCk2R0bkAQQYAEdHPS1kdX1UAAAAAElFTkSuQmCC);
  825. }
  826. .decoration-edit .view-content .item .control-tool-bar .icon-up.is-disabled,
  827. .decoration-edit .view-content .item .control-tool-bar .icon-up.is-disabled:hover {
  828. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLj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3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCOEQyMTUwMTdENkUxMUVBODc0MkE4MTAxQTY0ODkxQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCOEQyMTUwMjdENkUxMUVBODc0MkE4MTAxQTY0ODkxQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqOiNT4AAADgSURBVHjaYvz//z8DLQATA40ACyEFdXV10kCqHYiFoULfgbirqanpFEUGA0ELEMeiiRkDsSKlQcFOqzD+QaQYfSJveBr8F4vYf2oY/J8cgxmxZWlgprgDTeO/gFgciPnQlIDEH0EdxgXMLJLEungrEMsDsSoWQ0GADYhVgFgJiK8QHRRAF+QDqQ4igukQUK0r0UGBFCTLgFQkDunzQEONyIo8oMYoILUPi9Q7ILYiOfKwuPw8kDJAKt20gJY+oEYGsUVimxIylGgXQ11tCqTkgIauJUY945CrmmhmMECAAQCTB0MOORfSxwAAAABJRU5ErkJggg==);
  832. }
  833. .decoration-edit .view-content .item .control-tool-bar .icon-down.is-disabled,
  834. .decoration-edit .view-content .item .control-tool-bar .icon-down.is-disabled:hover {
  835. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd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FWxGAoCbECsAsRKQHyF6KAAOiAfSHUQEUyHgGpdiQ4KpCBZBqQicUifBxpqRFbkATVGAal9WKTeAbEVRakCaLgzkLqAJAQq3YyB4j+okUFskdimQEMfkJXccIS3KZCSAxq6lhj1jEOuaqKZwQABBgC4Mzjx6VYCZQAAAABJRU5ErkJggg==);
  836. }
  837. .decoration-edit .view-content .item .control-tool-bar .ctrl-icon.is-disabled {
  838. background-color: #fff;
  839. }
  840. .decoration-edit .submit-btn {
  841. position: absolute;
  842. bottom: 30px;
  843. left: 50%;
  844. transform: translateX(-50%);
  845. }
  846. /* 悬浮组件 */
  847. .left-top {
  848. position: absolute;
  849. top: 100px;
  850. left: 20px;
  851. z-index: 200;
  852. }
  853. .right-bottom {
  854. position: absolute;
  855. bottom: 50px;
  856. right: 20px;
  857. z-index: 200;
  858. }
  859. </style>