design.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <nc-component :data="data[index]" class="quick-navigation">
  2. <!-- 预览 -->
  3. <template slot="preview">
  4. <template v-if="nc.lazyLoad">
  5. <div class="quick-nav" :style="{
  6. backgroundColor: nc.componentBgColor,
  7. borderTopLeftRadius: (nc.componentAngle == 'round' ? nc.topAroundRadius + 'px' : 0),
  8. borderTopRightRadius: (nc.componentAngle == 'round' ? nc.topAroundRadius + 'px' : 0),
  9. borderBottomLeftRadius: (nc.componentAngle == 'round' ? nc.bottomAroundRadius + 'px' : 0),
  10. borderBottomRightRadius: (nc.componentAngle == 'round' ? nc.bottomAroundRadius + 'px' : 0),
  11. boxShadow: nc.ornament.type == 'shadow' ? ('0 0 5px ' + nc.ornament.color) : '',
  12. border: nc.ornament.type == 'stroke' ? '1px solid ' + nc.ornament.color : ''
  13. }">
  14. <div class="quick-nav-item" v-for="(item) in nc.list" :key="item.id" :style="{background : 'linear-gradient(to right,' + item.bgColorStart ? item.bgColorStart : '' + ',' + item.bgColorEnd ? item.bgColorEnd : '' + ')'}">
  15. <div class="quick-img" v-if="item.imageUrl || item.icon">
  16. <img v-if="item.iconType == 'img'" :src="changeImgUrl(item.imageUrl) || changeImgUrl('public/static/img/default_img/square.png')">
  17. <iconfont v-if="item.iconType == 'icon'" :icon="item.icon" :value="(item.style ? item.style : null)"></iconfont>
  18. </div>
  19. <span class="quick-text" :style="{color: item.textColor }">{{item.title}}</span>
  20. </div>
  21. </div>
  22. </template>
  23. </template>
  24. <!-- 内容编辑 -->
  25. <template slot="edit-content">
  26. <template v-if="nc.lazyLoad">
  27. <quick-nav-list></quick-nav-list>
  28. <div class="template-edit-title">
  29. <h3>快捷导航项</h3>
  30. <div class="quick-nav-list">
  31. <ul class="navigation-set-list">
  32. <li v-for="(item,previewIndex) in nc.list" :key="item.id">
  33. <div class="layui-form-item">
  34. <label class="layui-form-label sm">图片</label>
  35. <div class="layui-input-block">
  36. <quick-image-upload :data="{ data : item }" data-disabled="1"></quick-image-upload>
  37. </div>
  38. <div class="word-aux diy-word-aux">宽度自适应,高度20px</div>
  39. </div>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label sm">标题</label>
  42. <div class="layui-input-block">
  43. <input type="text" name='title' v-model="item.title" maxlength="20" class="layui-input" autocomplete="off" />
  44. </div>
  45. </div>
  46. <nc-link :data="{ field : item.link, label:'链接' }"></nc-link>
  47. <color :data="{ id : item.id, field : 'bgColorStart,bgColorEnd', label : '背景颜色', parent : item, defaultColor : '#FFFFFF,#FFFFFF' }"></color>
  48. <color :data="{ id : item.id, field : 'textColor', label : '文字颜色', parent : item, defaultColor : '#303133' }"></color>
  49. <i class="del" @click="nc.list.splice(previewIndex,1)" data-disabled="1">x</i>
  50. <div class="iconfont icontuodong"></div>
  51. </li>
  52. <div class="add-item text-color" @click="nc.tempData.methods.addNav()">
  53. <i>+</i>
  54. <span>添加一个快捷导航</span>
  55. </div>
  56. </ul>
  57. </div>
  58. </div>
  59. </template>
  60. </template>
  61. <!-- 样式编辑 -->
  62. <template slot="edit-style">
  63. <template v-if="nc.lazyLoad">
  64. <div class="template-edit-title">
  65. <h3>快捷导航</h3>
  66. <div class="layui-form-item tag-wrap">
  67. <label class="layui-form-label sm">样式</label>
  68. <div class="layui-input-block">
  69. <div v-for="(item,ornamentIndex) in nc.tempData.ornamentList" :key="ornamentIndex" @click="nc.ornament.type=item.type" :class="{ 'layui-unselect layui-form-radio' : true,'layui-form-radioed' : (nc.ornament.type==item.type) }">
  70. <i class="layui-anim layui-icon">{{ nc.ornament.type == item.type ? "&#xe643;" : "&#xe63f;" }}</i>
  71. <div>{{item.text}}</div>
  72. </div>
  73. </div>
  74. </div>
  75. <color v-if="nc.ornament.type != 'default'" :data="{ field : 'color', 'label' : '边框颜色', parent : 'ornament', defaultColor : '#EDEDED' }"></color>
  76. </div>
  77. </template>
  78. </template>
  79. <!-- 资源 -->
  80. <template slot="resource">
  81. <js>
  82. var quickNavResourcePath = "{$resource_path}"; // http路径
  83. var quickNavRelativePath = "{$relative_path}"; // 相对路径
  84. </js>
  85. <css src="{$resource_path}/css/design.css"></css>
  86. <js src="{$resource_path}/js/design.js"></js>
  87. </template>
  88. </nc-component>