|
@@ -0,0 +1,806 @@
|
|
|
+<template>
|
|
|
+ <div class="classify" id="auxiliaryFindRange">
|
|
|
+ <div class="fixed-top-group">
|
|
|
+ <div
|
|
|
+ class="classify-list"
|
|
|
+ v-for="(item, index) in newWordsList"
|
|
|
+ :key="'top-1' + index"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ style="display: none"
|
|
|
+ class="classify-title flex-r-c sb"
|
|
|
+ @click="goThisTop(index)"
|
|
|
+ :data-diy-sticky-mapping="'sticky-' + index"
|
|
|
+ >
|
|
|
+ <div class="flex-r-c">
|
|
|
+ <span class="title-text">{{ item.s_item }}</span>
|
|
|
+ <span
|
|
|
+ class="icon-edit"
|
|
|
+ @click="editClassFn(item.s_item, index)"
|
|
|
+ ></span>
|
|
|
+ <span
|
|
|
+ class="icon-delete"
|
|
|
+ @click="deleteClassFn(item, index)"
|
|
|
+ ></span>
|
|
|
+ </div>
|
|
|
+ <div class="flex-r-c right">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="add-classfily"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="addNewKeyword(item, index)"
|
|
|
+ >新增关键词组</el-button
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="flex-r-c center list-item-opened"
|
|
|
+ @click="slideToggle(item)"
|
|
|
+ >
|
|
|
+ <span>{{ item.opened ? '收起' : '展开' }}</span>
|
|
|
+ <i
|
|
|
+ :class="item.opened ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="classify-list"
|
|
|
+ v-for="(item, index) in newWordsList"
|
|
|
+ :key="'1' + index"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="classify-title flex-r-c sb"
|
|
|
+ :data-diy-sticky-origin="'sticky-' + index"
|
|
|
+ >
|
|
|
+ <div class="flex-r-c">
|
|
|
+ <span class="title-text">{{ item.s_item }}</span>
|
|
|
+ <span
|
|
|
+ class="icon-edit"
|
|
|
+ @click="editClassFn(item.s_item, index)"
|
|
|
+ ></span>
|
|
|
+ <span class="icon-delete" @click="deleteClassFn(item, index)"></span>
|
|
|
+ </div>
|
|
|
+ <div class="flex-r-c right">
|
|
|
+ <div
|
|
|
+ class="flex-r-c center list-item-opened"
|
|
|
+ @click="slideToggle(item)"
|
|
|
+ >
|
|
|
+ <span>{{ item.opened ? '收起' : '展开' }}</span>
|
|
|
+ <i
|
|
|
+ :class="item.opened ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-collapse-transition>
|
|
|
+ <div class="classify-content" v-show="item.opened">
|
|
|
+ <div
|
|
|
+ class="add-words-box"
|
|
|
+ @click="addNewKeyword(item, index)"
|
|
|
+ v-if="!item.showForm"
|
|
|
+ key="add"
|
|
|
+ >
|
|
|
+ +新增关键词组
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%" v-else key="add2">
|
|
|
+ <Edit
|
|
|
+ :getPushCount="getPushCount"
|
|
|
+ :getRecommend="getRecommend"
|
|
|
+ :datas="newWordsList"
|
|
|
+ :className="item.s_item"
|
|
|
+ title="新增"
|
|
|
+ :classIndex="index"
|
|
|
+ :keyIndex="item.a_key.length"
|
|
|
+ @closeForm="onCloseForm"
|
|
|
+ @update="getUpdateKey"
|
|
|
+ >
|
|
|
+ </Edit>
|
|
|
+ </div>
|
|
|
+ <div v-for="(v, i) in item.a_key" :key="'2' + i" style="width: 100%">
|
|
|
+ <Edit
|
|
|
+ :datas="newWordsList"
|
|
|
+ title="修改"
|
|
|
+ :className="item.s_item"
|
|
|
+ :keywords="v"
|
|
|
+ :classIndex="index"
|
|
|
+ :keyIndex="i"
|
|
|
+ @closeForm="onCloseForm"
|
|
|
+ @update="getUpdateKey"
|
|
|
+ v-if="v.showForm"
|
|
|
+ key="edit"
|
|
|
+ >
|
|
|
+ </Edit>
|
|
|
+ <div class="words-list" v-else key="edit2">
|
|
|
+ <div class="list-left yellow-box" v-if="v.matchway">模糊</div>
|
|
|
+ <div class="list-left blue-box" v-else>精准</div>
|
|
|
+ <div class="list-middle">
|
|
|
+ <div class="list-keywords" v-if="v.appendkey" key="append">
|
|
|
+ {{ v.key.join(' ') + ' ' + v.appendkey.join(' ') }}
|
|
|
+ </div>
|
|
|
+ <div class="list-keywords" v-else key="append2">
|
|
|
+ {{ v.key.join(' ') }}
|
|
|
+ </div>
|
|
|
+ <p class="list-notkey" v-if="v.notkey && v.notkey.length > 0">
|
|
|
+ 排除词: {{ v.notkey.join(' ') }}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="list-right">
|
|
|
+ <span
|
|
|
+ class="icon-edit"
|
|
|
+ @click="editKeyFn(item, v, index, i)"
|
|
|
+ ></span>
|
|
|
+ <span class="icon-delete" @click="deleteKeyFn(index, i)"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-collapse-transition>
|
|
|
+ </div>
|
|
|
+ <!-- 修改分类dialog -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="sub-dialog small-dialog"
|
|
|
+ :visible.sync="dialog.editClass"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :show-close="false"
|
|
|
+ center
|
|
|
+ width="460px"
|
|
|
+ >
|
|
|
+ <KeyCard
|
|
|
+ @onCancel="dialog.editClass = false"
|
|
|
+ @onConfirm="confirmEditClassFn"
|
|
|
+ >
|
|
|
+ <div slot="header">修改关键词分类</div>
|
|
|
+ <div class="class-edit-content">
|
|
|
+ <div class="item">
|
|
|
+ <div class="item-label">关键词分类:</div>
|
|
|
+ <div class="item-value">
|
|
|
+ <el-input
|
|
|
+ class="custom-long-input"
|
|
|
+ v-model.trim="props.className"
|
|
|
+ maxlength="20"
|
|
|
+ placeholder="请输入关键词分类"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </KeyCard>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 删除分类dialog -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="sub-dialog small-dialog"
|
|
|
+ :visible.sync="dialog.delClass"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :show-close="false"
|
|
|
+ center
|
|
|
+ top="30vh"
|
|
|
+ width="380px"
|
|
|
+ >
|
|
|
+ <div class="delete-class">
|
|
|
+ <div class="delete-class-header">删除关键词分类</div>
|
|
|
+ <div class="delete-class-content">{{ props.className }}</div>
|
|
|
+ <div class="delete-class-footer">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="confirm"
|
|
|
+ @click="confirmDeleteClassFn"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ <el-button class="cancel" @click="dialog.delClass = false"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 删除关键词dialog -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="sub-dialog small-dialog"
|
|
|
+ :visible.sync="dialog.delKey"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :show-close="false"
|
|
|
+ top="30vh"
|
|
|
+ center
|
|
|
+ width="380px"
|
|
|
+ >
|
|
|
+ <div class="delete-class">
|
|
|
+ <div class="delete-class-header">删除关键词组</div>
|
|
|
+ <div class="delete-class-content">确定删除该关键词组吗?</div>
|
|
|
+ <div class="delete-class-footer">
|
|
|
+ <el-button type="primary" class="confirm" @click="confirmDeleteKeyFn"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
+ <el-button class="cancel" @click="dialog.delKey = false"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 删除分类dialog -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="small-dialog"
|
|
|
+ title="删除关键词分类"
|
|
|
+ :visible.sync="dialog.notDelClass"
|
|
|
+ width="380px"
|
|
|
+ center
|
|
|
+ :show-close="false"
|
|
|
+ >
|
|
|
+ <p class="dialog-text">
|
|
|
+ 该关键词分类下存在关键词组,无法删除,请先删除该分类下的关键词组
|
|
|
+ </p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button
|
|
|
+ class="know-btn"
|
|
|
+ type="primary"
|
|
|
+ @click="dialog.notDelClass = false"
|
|
|
+ >我知道了</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 关键词添加超限提示 -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="small-dialog"
|
|
|
+ title="新增关键词组"
|
|
|
+ :visible.sync="dialog.limit"
|
|
|
+ width="380px"
|
|
|
+ center
|
|
|
+ :show-close="false"
|
|
|
+ >
|
|
|
+ <p class="dialog-text">您的关键词组数量已达300组,无法继续添加</p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button class="know-btn" type="primary" @click="dialog.limit = false"
|
|
|
+ >我知道了</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { Tooltip, Dialog, Input, Button } from 'element-ui'
|
|
|
+import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'
|
|
|
+import KeyCard from './selector-card.vue'
|
|
|
+import Edit from './keywords-edit.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'keywords-list',
|
|
|
+ components: {
|
|
|
+ [Tooltip.name]: Tooltip,
|
|
|
+ [Dialog.name]: Dialog,
|
|
|
+ [Input.name]: Input,
|
|
|
+ [Button.name]: Button,
|
|
|
+ KeyCard,
|
|
|
+ Edit,
|
|
|
+ [CollapseTransition.name]: CollapseTransition
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ getPushCount: Function,
|
|
|
+ getRecommend: Function,
|
|
|
+ list: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ maxCount: Number
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dialog: {
|
|
|
+ editClass: false, // 修改分类弹框
|
|
|
+ delClass: false, // 删除分类弹框
|
|
|
+ editKey: false, // 修改关键词弹框
|
|
|
+ delKey: false, // 删除关键词
|
|
|
+ notDelClass: false, // 不能删除分类弹框
|
|
|
+ limit: false // 关键词设置超出上限弹框
|
|
|
+ },
|
|
|
+ // 传给dialog子组件的数据
|
|
|
+ props: {
|
|
|
+ ways: '', // 编辑还是新增
|
|
|
+ classIndex: null, // 分类下标
|
|
|
+ className: '', // 分类名
|
|
|
+ keyIndex: null, // 关键词下标
|
|
|
+ key: [], // 关键词
|
|
|
+ notkey: [], // 排除词
|
|
|
+ appendkey: [] // 附加词
|
|
|
+ },
|
|
|
+ newWordsList: this.list // 将父组件传来的数据赋值给该变量,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // list: function (newVal) {
|
|
|
+ // if (newVal) {
|
|
|
+ // const oldList = JSON.parse(JSON.stringify(this.newWordsList))
|
|
|
+ // this.newWordsList = newVal
|
|
|
+ // this.formatDataList(oldList)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.formatDataList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getUpdateKey(params) {
|
|
|
+ const { state, classIndex, data, keyIndex } = params
|
|
|
+ const list = this.newWordsList
|
|
|
+ list.forEach((v, index) => {
|
|
|
+ if (index === classIndex) {
|
|
|
+ if (v.a_key) {
|
|
|
+ if (state === 'edit') {
|
|
|
+ v.a_key.forEach((s, j) => {
|
|
|
+ if (keyIndex === j) {
|
|
|
+ for (const key in data) {
|
|
|
+ s[key] = data[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ v.a_key.push(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(list, 'update-list')
|
|
|
+ this.$emit('update', list)
|
|
|
+ },
|
|
|
+ // 当前分类下有无正在编辑的
|
|
|
+ getItemCurEdit(item) {
|
|
|
+ const s = item.a_key.some((v) => {
|
|
|
+ return v.showForm
|
|
|
+ })
|
|
|
+ return s || item.showForm
|
|
|
+ },
|
|
|
+ slideToggle(item) {
|
|
|
+ const s = this.getItemCurEdit(item)
|
|
|
+ if (item.opened) {
|
|
|
+ if (s) return this.$toast('收起失败,请先保存或取消正在操作的关键词组')
|
|
|
+ }
|
|
|
+ item.opened = !item.opened
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ goThisTop(index) {
|
|
|
+ const goTop =
|
|
|
+ $(
|
|
|
+ '#auxiliaryFindRange *[data-diy-sticky-origin="sticky-' + index + '"]'
|
|
|
+ ).offset().top -
|
|
|
+ $('#public-nav').outerHeight() -
|
|
|
+ 20
|
|
|
+ $(window).scrollTop(goTop)
|
|
|
+ },
|
|
|
+ sortData(arr) {
|
|
|
+ return arr.sort((a, b) => {
|
|
|
+ return b.updatetime - a.updatetime
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 处理数据 添加showForm字段
|
|
|
+ formatDataList(oldData) {
|
|
|
+ const lists = this.newWordsList
|
|
|
+ this.sortData(lists)
|
|
|
+ lists.forEach((v, index) => {
|
|
|
+ if (v) {
|
|
|
+ if (
|
|
|
+ !(typeof v.opened === 'string' || typeof v.opened === 'boolean')
|
|
|
+ ) {
|
|
|
+ v.opened = true
|
|
|
+ // TODO 生成索引缓存结果减少遍历优化性能
|
|
|
+ if (oldData && Array.isArray(oldData)) {
|
|
|
+ const findResult = oldData.filter((s) => s.s_item === v.s_item)
|
|
|
+ if (
|
|
|
+ findResult.length &&
|
|
|
+ Object.prototype.hasOwnProperty.call(findResult[0], 'opened')
|
|
|
+ ) {
|
|
|
+ v.opened = findResult[0].opened
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (v.a_key && v.a_key.length > 0) {
|
|
|
+ this.sortData(v.a_key)
|
|
|
+ } else {
|
|
|
+ v.a_key = []
|
|
|
+ // if (lists.length === 1) {
|
|
|
+ // v.showForm = true
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.newWordsList = lists
|
|
|
+ },
|
|
|
+ // 打开修改关键词分类弹框
|
|
|
+ editClassFn(name, index) {
|
|
|
+ const t = this.getCurEdit()
|
|
|
+ if (t) return this.$toast('请先保存或取消正在操作的关键词组')
|
|
|
+ this.dialog.editClass = true
|
|
|
+ this.props.className = name
|
|
|
+ this.props.classIndex = index
|
|
|
+ },
|
|
|
+ // 确认修改分类
|
|
|
+ confirmEditClassFn() {
|
|
|
+ const data = this.newWordsList
|
|
|
+ const classArr = this.getClassArray()
|
|
|
+ if (classArr.indexOf(this.props.className) > -1) {
|
|
|
+ return this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '分类名不能重复'
|
|
|
+ })
|
|
|
+ } else if (this.props.className === '') {
|
|
|
+ return this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '分类名不能为空'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ data.forEach((v, i) => {
|
|
|
+ if (this.props.classIndex === i) {
|
|
|
+ v.s_item = this.props.className
|
|
|
+ v.updatetime = parseInt(Date.now() / 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dialog.editClass = false
|
|
|
+ this.$emit('update', data)
|
|
|
+ this.$forceUpdate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 新增关键词 打开编辑表单
|
|
|
+ addNewKeyword(item, index) {
|
|
|
+ const t = this.getCurEdit()
|
|
|
+ if (t) return this.$toast('请先保存或取消正在操作的关键词组')
|
|
|
+ const isCan = this.getIsAdd()
|
|
|
+ if (isCan) {
|
|
|
+ this.dialog.limit = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.showForm = true
|
|
|
+ item.opened = true
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ // 打开删除关键词分类弹框
|
|
|
+ deleteClassFn(item, index) {
|
|
|
+ if (item.a_key && item.a_key.length > 0) {
|
|
|
+ this.dialog.notDelClass = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.props.classIndex = null
|
|
|
+ this.dialog.delClass = true
|
|
|
+ this.props.className = item.s_item
|
|
|
+ this.props.classIndex = index
|
|
|
+ },
|
|
|
+ // 确认删除分类
|
|
|
+ confirmDeleteClassFn() {
|
|
|
+ const list = this.newWordsList
|
|
|
+ list.splice(this.props.classIndex, 1)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dialog.delClass = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 编辑单个关键词
|
|
|
+ editKeyFn(item, v, index, i) {
|
|
|
+ const t = this.getCurEdit()
|
|
|
+ if (t) return this.$toast('请先保存或取消正在操作的关键词组')
|
|
|
+ this.clearPropsData()
|
|
|
+ this.props.className = item.s_item
|
|
|
+ this.props.key = v.key
|
|
|
+ this.props.notkey = v.notkey
|
|
|
+ this.props.appendkey = v.appendkey
|
|
|
+ this.props.keyIndex = i
|
|
|
+ this.props.classIndex = index
|
|
|
+ v.showForm = true
|
|
|
+ },
|
|
|
+ // 打开删除关键词dialog
|
|
|
+ deleteKeyFn(index, i) {
|
|
|
+ this.props.classIndex = index
|
|
|
+ this.props.keyIndex = i
|
|
|
+ this.dialog.delKey = true
|
|
|
+ },
|
|
|
+ // 确定删除关键词组
|
|
|
+ confirmDeleteKeyFn() {
|
|
|
+ const data = this.newWordsList
|
|
|
+ console.log(data, this.props.classIndex, this.props.keyIndex)
|
|
|
+ data[this.props.classIndex].a_key.splice(this.props.keyIndex, 1)
|
|
|
+ this.dialog.delKey = false
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ // 清空传值
|
|
|
+ clearPropsData() {
|
|
|
+ this.props.className = ''
|
|
|
+ this.props.classIndex = null
|
|
|
+ this.props.key = []
|
|
|
+ this.props.notkey = []
|
|
|
+ this.props.appendkey = []
|
|
|
+ },
|
|
|
+ // 获取所有分类名 用户判断添加分类是否重复
|
|
|
+ getClassArray() {
|
|
|
+ const data = this.newWordsList
|
|
|
+ const classArr = []
|
|
|
+ data.forEach((v) => {
|
|
|
+ if (v.s_item) {
|
|
|
+ classArr.push(v.s_item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return classArr
|
|
|
+ },
|
|
|
+ // 添加了多少组关键词
|
|
|
+ addTotalCount() {
|
|
|
+ let count = 0
|
|
|
+ const data = this.newWordsList
|
|
|
+ data.forEach((v) => {
|
|
|
+ if (v && v.a_key) {
|
|
|
+ count += v.a_key.length
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return count
|
|
|
+ },
|
|
|
+ // 判断是否超限
|
|
|
+ getIsAdd() {
|
|
|
+ const len = this.addTotalCount()
|
|
|
+ if (len >= this.maxCount) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onCloseForm(data) {
|
|
|
+ if (!data) return
|
|
|
+ if (data.keywords) {
|
|
|
+ data.keywords.showForm = false
|
|
|
+ this.$forceUpdate()
|
|
|
+ } else {
|
|
|
+ this.newWordsList[data.classIndex].showForm = false
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ this.formatDataList()
|
|
|
+ },
|
|
|
+ // 查询有无正在编辑的表单
|
|
|
+ getCurEdit() {
|
|
|
+ const list = this.newWordsList
|
|
|
+ let t
|
|
|
+ const s = list.some((v) => {
|
|
|
+ if (v.a_key) {
|
|
|
+ t = v.a_key.some((s) => {
|
|
|
+ return s.showForm
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return v.showForm || t
|
|
|
+ })
|
|
|
+ return s
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.fixed-top-group {
|
|
|
+ position: fixed;
|
|
|
+ width: 1080px;
|
|
|
+ top: 0;
|
|
|
+ left: 50%;
|
|
|
+ z-index: 99;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ @media only screen and (max-width: 1200px) {
|
|
|
+ background-color: red;
|
|
|
+ transform: unset;
|
|
|
+ left: 60px;
|
|
|
+ }
|
|
|
+ .classify-list {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .classify-list .classify-title {
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+ background: #fff;
|
|
|
+ padding: 9px 32px;
|
|
|
+ margin: 0;
|
|
|
+ box-shadow: 0px 0px 28px 0px rgba(0, 0, 0, 0.16);
|
|
|
+ }
|
|
|
+}
|
|
|
+.classify-list {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ // border-radius: 8px;
|
|
|
+ .list-item-opened {
|
|
|
+ font-size: 14px;
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei-Regular;
|
|
|
+ font-weight: 400;
|
|
|
+ text-align: left;
|
|
|
+ color: #686868;
|
|
|
+ text-shadow: 0px 0px 28px 0px rgba(0, 0, 0, 0.16);
|
|
|
+ cursor: pointer;
|
|
|
+ i {
|
|
|
+ color: #aaaaaa;
|
|
|
+ margin-left: 7px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .add-classfily {
|
|
|
+ line-height: 22px;
|
|
|
+ background-color: transparent;
|
|
|
+ border: 1px solid #2cb7ca;
|
|
|
+ border-radius: 6px;
|
|
|
+ text-align: center;
|
|
|
+ color: #2cb7ca;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor: pointer;
|
|
|
+ padding: 4px 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ & + .list-item-opened {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .classify-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 9px 0;
|
|
|
+ .title-text {
|
|
|
+ font-size: 16px;
|
|
|
+ color: #1d1d1d;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .icon-edit,
|
|
|
+ .icon-delete {
|
|
|
+ display: inline-block;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center center;
|
|
|
+ cursor: pointer;
|
|
|
+ &::before {
|
|
|
+ content: '' !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .icon-edit {
|
|
|
+ margin: 0 10px;
|
|
|
+ background-image: url('../../assets/images/icon/icon-edit.png');
|
|
|
+ background-size: contain;
|
|
|
+ }
|
|
|
+ .icon-delete {
|
|
|
+ background-image: url('../../assets/images/icon/icon-delete.png');
|
|
|
+ background-size: contain;
|
|
|
+ }
|
|
|
+ .classify-content {
|
|
|
+ .edit-form {
|
|
|
+ margin-top: 0;
|
|
|
+ }
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ .add-words-box {
|
|
|
+ width: 100%;
|
|
|
+ height: 38px;
|
|
|
+ line-height: 38px;
|
|
|
+ border: 1px dashed #2cb7ca;
|
|
|
+ border-radius: 6px;
|
|
|
+ color: #2cb7ca;
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .words-list {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 12px 16px;
|
|
|
+ margin-top: 24px;
|
|
|
+ border: 1px solid #ececec;
|
|
|
+ border-radius: 8px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .list-left {
|
|
|
+ width: 40px;
|
|
|
+ height: 22px;
|
|
|
+ line-height: 22px;
|
|
|
+ margin-right: 12px;
|
|
|
+ font-size: 12px;
|
|
|
+ text-align: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .yellow-box {
|
|
|
+ border: 1px solid #ff9f40;
|
|
|
+ color: #ff9f40;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .blue-box {
|
|
|
+ border: 1px solid #2cb7ca;
|
|
|
+ color: #2cb7ca;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .list-middle {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .list-keywords {
|
|
|
+ color: #1d1d1d;
|
|
|
+ line-height: 22px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .list-addkey,
|
|
|
+ .list-notkey {
|
|
|
+ color: #686868;
|
|
|
+ line-height: 20px;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ .list-right {
|
|
|
+ margin-left: 15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list {
|
|
|
+ padding-top: 10px;
|
|
|
+ margin-right: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ width: 160px;
|
|
|
+ height: 80px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &:hover .list-edit {
|
|
|
+ transform: scaleY(1);
|
|
|
+ transition: transform 0.1s;
|
|
|
+ }
|
|
|
+ &:hover .list-box {
|
|
|
+ border: 1px solid #2cb7ca;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ :list:nth-child(6n) {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ .list-box {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ padding: 10px 10px 10px 16px;
|
|
|
+ border: 1px solid #ececec;
|
|
|
+ border-radius: 9px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .list-edit {
|
|
|
+ transform: scaleY(0);
|
|
|
+ transition: transform 0.1s;
|
|
|
+ position: absolute;
|
|
|
+ top: -40px;
|
|
|
+ left: 50%;
|
|
|
+ margin-left: -22px;
|
|
|
+ padding: 10px;
|
|
|
+ color: #fff;
|
|
|
+ background: #1d1d1d;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ .tri-down {
|
|
|
+ position: absolute;
|
|
|
+ bottom: -6px;
|
|
|
+ left: 50%;
|
|
|
+ margin-left: -5px;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-left: 6px solid transparent;
|
|
|
+ border-right: 6px solid transparent;
|
|
|
+ border-top: 6px solid #1d1d1d;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list-value {
|
|
|
+ width: 124px;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #000;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ p {
|
|
|
+ @extend .list-value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .list-icon {
|
|
|
+ @extend .icon-delete;
|
|
|
+ width: 12px;
|
|
|
+ height: 12px;
|
|
|
+ }
|
|
|
+ .words-add {
|
|
|
+ width: 162px;
|
|
|
+ height: 80px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 24px;
|
|
|
+ border: 1px solid #ececec;
|
|
|
+ margin: 10px 0 0 0;
|
|
|
+ border-radius: 9px;
|
|
|
+ color: #c4c4c4;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|