|
@@ -18,90 +18,72 @@
|
|
<!-- </draggable>-->
|
|
<!-- </draggable>-->
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- </template>-->
|
|
<!-- </template>-->
|
|
- <draggable v-model="templateArray" :options="tplOptions" :clone="clonedata">
|
|
|
|
- <div v-for="item in templateArray" :class="'item-' + item.tpl_id" class="tpl-item">
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="24/item.tpl_id" v-for="size in item.tpl_id" :key="size" class="grid-content" :class="'bg-purple-'+size"></el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <span class="text-tpl">{{ templates[item.tpl_id].title }}</span>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-header height="40px" class="_fc-r-tabs">
|
|
|
|
+ <div >组件列表</div>
|
|
|
|
+ <!-- <div class="_fc-r-tab" v-if="!config || config.showFormConfig !== false" :class="{active: activeTab==='form' && !!activeRule}"-->
|
|
|
|
+ <!-- @click="activeTab='form'">表单配置-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ </el-header>
|
|
|
|
+ <el-row style="margin-top: 10px">
|
|
|
|
+ <draggable v-model="templateArray" :options="tplOptions" :clone="clonedata" >
|
|
|
|
+
|
|
|
|
+ <el-col :span="12" v-for="item in templateArray" class="draggableitem text-center" :class="'item-' + item.tpl_id" :key="item.tpl_id">
|
|
|
|
+ <div >
|
|
|
|
+ <div class="iconfont" style="font-size: 26px" :class="item.moduleIconClass"></div>
|
|
|
|
+ <span class="text-tpl">{{ templates[item.tpl_id].title }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+
|
|
|
|
+<!-- <div v-for="item in templateArray" :class="'item-' + item.tpl_id" class="tpl-item">-->
|
|
|
|
+<!-- <el-row>-->
|
|
|
|
+<!-- <el-col :span="24/item.tpl_id" v-for="size in item.tpl_id" :key="size" class="grid-content" :class="'bg-purple-'+size"></el-col>-->
|
|
|
|
+<!-- </el-row>-->
|
|
|
|
+<!-- <span class="text-tpl">{{ templates[item.tpl_id].title }}</span>-->
|
|
|
|
+<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
</draggable>
|
|
</draggable>
|
|
|
|
+ </el-row>
|
|
|
|
|
|
</el-aside>
|
|
</el-aside>
|
|
<el-container class="_fc-m">
|
|
<el-container class="_fc-m">
|
|
-<!-- <el-header class="_fc-m-tools" height="45">-->
|
|
|
|
-<!-- <slot name="handle"></slot>-->
|
|
|
|
-<!-- <el-button type="primary" icon="fc-icon icon-preview" plain round size="mini"-->
|
|
|
|
-<!-- @click="previewFc">预 览-->
|
|
|
|
-<!-- </el-button>-->
|
|
|
|
-<!-- <el-popconfirm-->
|
|
|
|
-<!-- title="清空后将不能恢复,确定要清空吗?"-->
|
|
|
|
-<!-- style="margin-left: 10px;"-->
|
|
|
|
-<!-- confirm-button-text="清空"-->
|
|
|
|
-<!-- cancel-button-text="取消"-->
|
|
|
|
-<!-- @confirm="clearDragRule"-->
|
|
|
|
-<!-- >-->
|
|
|
|
-<!-- <el-button slot="reference" type="danger" icon="fc-icon icon-delete" plain round size="mini">清 空-->
|
|
|
|
-<!-- </el-button>-->
|
|
|
|
-<!-- </el-popconfirm>-->
|
|
|
|
-
|
|
|
|
-<!-- </el-header>-->
|
|
|
|
- <el-main style="background: #F5F5F5;padding: 20px;">
|
|
|
|
- <div class="_fc-m-drag">
|
|
|
|
- <nest-draggable :tasks="abc" @add="addItem" @delete="deleteData">
|
|
|
|
|
|
+
|
|
|
|
+ <el-main style="background: #fff;padding: 0px;">
|
|
|
|
+ <el-header class="_fc-m-tools" height="45">
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" icon="fc-icon icon-preview" plain round size="mini"
|
|
|
|
+ @click="getDefaultBoardTitle">载入默认设计
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button type="danger" icon="fc-icon icon-preview" plain round size="mini"
|
|
|
|
+ @click="saveAsDefault">保存为默认设计
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" icon="fc-icon icon-preview" plain round size="mini"
|
|
|
|
+ @click="handleSaveFloor">保存设计
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button type="success" icon="fc-icon icon-preview" plain round size="mini"
|
|
|
|
+ @click="preview">预 览
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ </el-header>
|
|
|
|
+ <div class="_fc-m-drag" style="height: 90%;background: #eeeeee;padding: 10px;display: flex;flex-direction: column;">
|
|
|
|
+ <nest-draggable :tasks="floorList" :module-style="{'marginTop':'auto'}" :bind-data="boardBedsInfo" :show="show" :board-customer-items="boardItems" :statistic-data="partStatistic" @add="addItem" is-edit @delete="deleteData" @copy="copyData" @active="activeModule">
|
|
|
|
|
|
</nest-draggable>
|
|
</nest-draggable>
|
|
|
|
|
|
-<!-- <draggable v-model="abc" :options="floorOptions" class="tpl-list" @add="addItem">-->
|
|
|
|
-<!-- <div v-for="(item, index) in abc" :class="'item-' + item.tpl_id" class="floor-item">-->
|
|
|
|
-<!-- <nest-component :tpl-id="item.tpl_id"-->
|
|
|
|
-<!-- :data="JSON.parse(JSON.stringify(item))"-->
|
|
|
|
-<!-- ></nest-component>-->
|
|
|
|
-<!--<!– <component–>-->
|
|
|
|
-<!--<!– :is="templates[item.tpl_id]"–>-->
|
|
|
|
-<!--<!– :data="JSON.parse(JSON.stringify(item))"–>-->
|
|
|
|
-<!--<!– is-edit–>-->
|
|
|
|
-<!--<!– @edit-block="(...props) => { handleEditBlock(index, ...props) }"–>-->
|
|
|
|
-<!--<!– @edit-title="(...props) => { handleEditTitle(index, ...props) }"–>-->
|
|
|
|
-<!--<!– @edit-tags="(...props) => { handleEditTags(index, ...props) }"–>-->
|
|
|
|
-<!--<!– ></component>–>-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
-<!-- </draggable>-->
|
|
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</el-main>
|
|
</el-main>
|
|
</el-container>
|
|
</el-container>
|
|
<el-aside class="_fc-r" width="320px" >
|
|
<el-aside class="_fc-r" width="320px" >
|
|
<el-container style="height: 100%;">
|
|
<el-container style="height: 100%;">
|
|
-<!-- <el-header height="40px" class="_fc-r-tabs">-->
|
|
|
|
-<!-- <div class="_fc-r-tab" :class="{active: activeTab==='props'}" v-if="!!activeRule || (config && config.showFormConfig === false)"-->
|
|
|
|
-<!-- @click="activeTab='props'">组件配置-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
-<!-- <div class="_fc-r-tab" v-if="!config || config.showFormConfig !== false" :class="{active: activeTab==='form' && !!activeRule}"-->
|
|
|
|
-<!-- @click="activeTab='form'">表单配置-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
-<!-- </el-header>-->
|
|
|
|
-<!-- <ElMain v-show="activeTab==='form'" v-if="!config || config.showFormConfig !== false">-->
|
|
|
|
-<!-- <component :is="FormCreate" :rule="form.rule" :option="form.option"-->
|
|
|
|
-<!-- :value.sync="form.value.form"></component>-->
|
|
|
|
-<!-- </ElMain>-->
|
|
|
|
-<!-- <ElMain v-show="activeTab==='props'" style="padding: 0 20px;"-->
|
|
|
|
-<!-- :key="activeRule ? activeRule._id: ''">-->
|
|
|
|
-<!-- <div>-->
|
|
|
|
-<!-- <ElDivider v-if="showBaseRule">基础配置</ElDivider>-->
|
|
|
|
-<!-- <component :is="FormCreate" v-show="showBaseRule" v-model="baseForm.api" :rule="baseForm.rule"-->
|
|
|
|
-<!-- :option="baseForm.options"-->
|
|
|
|
-<!-- @change="baseChange"></component>-->
|
|
|
|
-<!-- <ElDivider>属性配置</ElDivider>-->
|
|
|
|
-<!-- <component :is="FormCreate" v-model="propsForm.api" :rule="propsForm.rule" :option="propsForm.options"-->
|
|
|
|
-<!-- @change="propChange" @removeField="propRemoveField"></component>-->
|
|
|
|
-<!-- <ElDivider v-if="showBaseRule">验证规则</ElDivider>-->
|
|
|
|
-<!-- <component :is="FormCreate" v-show="showBaseRule" v-model="validateForm.api" :rule="validateForm.rule"-->
|
|
|
|
-<!-- :option="validateForm.options"-->
|
|
|
|
-<!-- @update:value="validateChange"></component>-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
-<!-- </ElMain>-->
|
|
|
|
|
|
+ <el-header height="40px" class="_fc-r-tabs">
|
|
|
|
+ <div>组件配置</div>
|
|
|
|
+
|
|
|
|
+ </el-header>
|
|
|
|
+ <div class="text-center" style="color: #FF2E2E">{{ activeModuleTitle }}</div>
|
|
|
|
+ <module-config :module-config="modueConfigModel"></module-config>
|
|
|
|
+
|
|
</el-container>
|
|
</el-container>
|
|
</el-aside>
|
|
</el-aside>
|
|
<!-- <ElDialog :visible.sync="preview.state" width="800px" append-to-body>-->
|
|
<!-- <ElDialog :visible.sync="preview.state" width="800px" append-to-body>-->
|
|
@@ -109,6 +91,12 @@
|
|
<!-- </ElDialog>-->
|
|
<!-- </ElDialog>-->
|
|
</el-container>
|
|
</el-container>
|
|
</el-main>
|
|
</el-main>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="设计预览" fullscreen :visible.sync="previewVisible">
|
|
|
|
+
|
|
|
|
+ <nest-component :tasks="floorList" :bind-data="boardBedsInfo" :show="show" :board-customer-items="boardItems" :statistic-data="partStatistic"></nest-component>
|
|
|
|
+
|
|
|
|
+ </el-dialog>
|
|
</el-container>
|
|
</el-container>
|
|
|
|
|
|
|
|
|
|
@@ -128,10 +116,15 @@
|
|
import NestComponent from "./nest-component";
|
|
import NestComponent from "./nest-component";
|
|
import NestDraggable from "./nest-draggable";
|
|
import NestDraggable from "./nest-draggable";
|
|
import { nanoid } from 'nanoid'
|
|
import { nanoid } from 'nanoid'
|
|
|
|
+ import {deepClone} from '@/utils/Foundation'
|
|
|
|
+ import ModuleConfig from "./templates/moduleConfig";
|
|
|
|
+ import * as API_Board from '@/api/ncs_board'
|
|
|
|
+ import * as API_BoardItem from '@/api/ncs_board_item'
|
|
|
|
+ import * as API_BoardTitle from '@/api/ncs_board_title'
|
|
Vue.use(VueLazyload)
|
|
Vue.use(VueLazyload)
|
|
export default {
|
|
export default {
|
|
name: "infoboard-designer",
|
|
name: "infoboard-designer",
|
|
- components:{NestDraggable, NestComponent, TextDisplay, draggable},
|
|
|
|
|
|
+ components:{ModuleConfig, NestDraggable, NestComponent, TextDisplay, draggable},
|
|
provide() {
|
|
provide() {
|
|
return {
|
|
return {
|
|
fcx: {
|
|
fcx: {
|
|
@@ -139,20 +132,50 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async mounted(){
|
|
|
|
+ this.getBoardTitle()
|
|
|
|
+ this.getBoardBedItems()
|
|
|
|
+ this.getPartStatisticSummary()
|
|
|
|
+ this.boardItems = await API_BoardItem.getPartList(this.$store.getters.partId)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const _this = this
|
|
|
|
+ let index =0;
|
|
|
|
+ // setInterval(function () {
|
|
|
|
+ // index++
|
|
|
|
+ // _this.show=false
|
|
|
|
+ // _this.boardBedsInfo = {..._this.boardBedsInfoRaw,items:_this.boardBedsInfoRaw.items.slice((index-1)*5,index*5)}
|
|
|
|
+ // setTimeout(function () {
|
|
|
|
+ // _this.show=true
|
|
|
|
+ // },600)
|
|
|
|
+ //
|
|
|
|
+ // },5000)
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
|
|
|
|
return {
|
|
return {
|
|
templates,
|
|
templates,
|
|
templateArray:[...templateArray],
|
|
templateArray:[...templateArray],
|
|
- props:{
|
|
|
|
- type:'danger',
|
|
|
|
- size:'small',
|
|
|
|
- text:'sfdf'
|
|
|
|
- },
|
|
|
|
- abc:[],
|
|
|
|
|
|
+ previewVisible:false,
|
|
|
|
+ //看板标题
|
|
|
|
+ titleData:{},
|
|
|
|
+ //标题id
|
|
|
|
+ titleId:this.$route.params.id,
|
|
|
|
+ /** 看板床位数据**/
|
|
|
|
+ boardBedsInfo:{},
|
|
|
|
+ /** 看板床位原始数据**/
|
|
|
|
+ boardBedsInfoRaw:{},
|
|
|
|
+ /** 科室统计信息**/
|
|
|
|
+ partStatistic:{},
|
|
|
|
+ /** 当前激活的模块名称*/
|
|
|
|
+ activeModuleTitle:'',
|
|
|
|
+ /** 设计数据 **/
|
|
|
|
+ floorList:[],
|
|
|
|
+ boardItems:[],
|
|
tplOptions: {
|
|
tplOptions: {
|
|
group: { name: 'tplGroup', pull: 'clone', put: false },
|
|
group: { name: 'tplGroup', pull: 'clone', put: false },
|
|
- sort: false
|
|
|
|
|
|
+ sort: false,
|
|
|
|
+ handle: '.draggableitem'
|
|
},
|
|
},
|
|
tplOptions2: {
|
|
tplOptions2: {
|
|
group: { name: 'child', pull: 'clone', put: false },
|
|
group: { name: 'child', pull: 'clone', put: false },
|
|
@@ -164,80 +187,24 @@
|
|
sort: true,
|
|
sort: true,
|
|
handle: '.handle-move'
|
|
handle: '.handle-move'
|
|
},
|
|
},
|
|
-
|
|
|
|
- boardInfo: {
|
|
|
|
- header: {
|
|
|
|
- tpl_id: 4, //模板id
|
|
|
|
- tpl_box_style: {},//标题模块样式
|
|
|
|
- visible: true, //是否显示模块
|
|
|
|
- moduleStyle: {
|
|
|
|
- blockHeight: 60,
|
|
|
|
- background:'#0081ff'
|
|
|
|
- },
|
|
|
|
- columnList: [
|
|
|
|
- {
|
|
|
|
- label: '标题',
|
|
|
|
- content: '内容',
|
|
|
|
- labelColor: '#333333',
|
|
|
|
- labelBgColor: '#ffffff',
|
|
|
|
- labelTextSize: 22,
|
|
|
|
- labelAlign: 'right',
|
|
|
|
- labelWidth: 200,
|
|
|
|
- contentColor: '#333333',
|
|
|
|
-
|
|
|
|
- contentTextSize: 22,
|
|
|
|
- blockWidth: 8,
|
|
|
|
- boardItemHisKeyVal: ''
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '标题',
|
|
|
|
- content: '内容',
|
|
|
|
- contentColor: '#fff',
|
|
|
|
- contentTextSize: 22,
|
|
|
|
- contentAlign:'center',
|
|
|
|
- blockWidth: 10
|
|
|
|
- }
|
|
|
|
- ,
|
|
|
|
- {
|
|
|
|
- label: '标题',
|
|
|
|
- content: '内容',
|
|
|
|
- labelColor: '#333333',
|
|
|
|
- labelBgColor: '#ffffff',
|
|
|
|
- labelTextSize: 22,
|
|
|
|
- labelAlign: 'right',
|
|
|
|
- labelWidth: 200,
|
|
|
|
- contentColor: '#fff',
|
|
|
|
-
|
|
|
|
- contentTextSize: 22,
|
|
|
|
- blockWidth: 6,
|
|
|
|
- boardItemHisKeyVal: ''
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- body: {
|
|
|
|
- tpl_id: 5, //模板id
|
|
|
|
- },
|
|
|
|
- footer: {}
|
|
|
|
- }
|
|
|
|
|
|
+ show:true,
|
|
|
|
+ modueConfigModel:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ beforeRouteUpdate(to, from, next) {
|
|
|
|
+ this.titleId = to.params.id
|
|
|
|
+ next()
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ this.titleId = this.$route.params.id
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
- // 楼层模板盒子样式
|
|
|
|
- tplBoxStyle() {
|
|
|
|
- const { sidebar } = this.$store.getters
|
|
|
|
- let left = (sidebar.opened ? 210 : 60)
|
|
|
|
- left = this.tplBoxShow ? left : left - 300
|
|
|
|
- return {
|
|
|
|
- left: left + 'px'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
floorContainerHeight() {
|
|
floorContainerHeight() {
|
|
return this.mainAreaHeight
|
|
return this.mainAreaHeight
|
|
- },
|
|
|
|
- partInfo() {
|
|
|
|
- return this.$store.getters.organization
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
methods: {
|
|
methods: {
|
|
/** 保存发布 */
|
|
/** 保存发布 */
|
|
handleSaveFloor() {
|
|
handleSaveFloor() {
|
|
@@ -245,12 +212,17 @@
|
|
API_BoardTitle.update(this.titleData.id, this.titleData).then(() => this.$message.success('保存发布成功!'))
|
|
API_BoardTitle.update(this.titleData.id, this.titleData).then(() => this.$message.success('保存发布成功!'))
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ saveAsDefault() {
|
|
|
|
+ this.titleData.content_config = JSON.stringify(this.floorList)
|
|
|
|
+ API_BoardTitle.saveAsDefault(this.titleData.id, this.titleData).then(() => this.$message.success('保存成功!'))
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
clonedata(origin){
|
|
clonedata(origin){
|
|
const data = JSON.parse(JSON.stringify(origin))
|
|
const data = JSON.parse(JSON.stringify(origin))
|
|
if(data.unique===''||data.unique===undefined){
|
|
if(data.unique===''||data.unique===undefined){
|
|
data.unique=nanoid(10)
|
|
data.unique=nanoid(10)
|
|
}
|
|
}
|
|
- console.log('clone',data)
|
|
|
|
return data
|
|
return data
|
|
},
|
|
},
|
|
handleBoardItemSet(settingData) {
|
|
handleBoardItemSet(settingData) {
|
|
@@ -267,8 +239,8 @@
|
|
this.$set(this.floorList, index, blockdata)
|
|
this.$set(this.floorList, index, blockdata)
|
|
},
|
|
},
|
|
addItem(){
|
|
addItem(){
|
|
- console.log('abc',this.abc)
|
|
|
|
- console.log('templatearray',this.templateArray)
|
|
|
|
|
|
+
|
|
|
|
+ // console.log('templatearray',this.templateArray)
|
|
},
|
|
},
|
|
/** 编辑楼层区块 */
|
|
/** 编辑楼层区块 */
|
|
handleEditBlock(index, target, columnIndex) {
|
|
handleEditBlock(index, target, columnIndex) {
|
|
@@ -326,23 +298,9 @@
|
|
getBoardTitle() {
|
|
getBoardTitle() {
|
|
API_BoardTitle.get(this.titleId, {}).then(
|
|
API_BoardTitle.get(this.titleId, {}).then(
|
|
res => {
|
|
res => {
|
|
- console.log('res', res)
|
|
|
|
this.titleData = {...res}
|
|
this.titleData = {...res}
|
|
if (res.content_config !== null && res.content_config !== '') {
|
|
if (res.content_config !== null && res.content_config !== '') {
|
|
this.floorList = JSON.parse(res.content_config)
|
|
this.floorList = JSON.parse(res.content_config)
|
|
- this.floorList.forEach(item => {
|
|
|
|
- item.columnList.forEach(col => {
|
|
|
|
- if (col.boardItemHisKeyVal !== '') {
|
|
|
|
- console.log('col', this.boardItems)
|
|
|
|
- const boardItem = this.boardItems.filter(p => p.his_keyval === col.boardItemHisKeyVal)[0]
|
|
|
|
- console.log('boardItem', boardItem)
|
|
|
|
- if (boardItem !== null && boardItem !== undefined) {
|
|
|
|
- col.content = boardItem.area_content
|
|
|
|
- col.label = boardItem.area_label
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
} else {
|
|
} else {
|
|
this.floorList = []
|
|
this.floorList = []
|
|
}
|
|
}
|
|
@@ -351,23 +309,45 @@
|
|
this.$message.error(error.message)
|
|
this.$message.error(error.message)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ getDefaultBoardTitle() {
|
|
|
|
+ API_BoardTitle.getDefault(this.titleId, {}).then(
|
|
|
|
+ res => {
|
|
|
|
+ this.titleData = {...res,id:this.titleId,part_id:this.$store.getters.partId}
|
|
|
|
+ if (res.content_config !== null && res.content_config !== '') {
|
|
|
|
+ this.floorList = JSON.parse(res.content_config)
|
|
|
|
+ } else {
|
|
|
|
+ this.floorList = []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ).catch(error => {
|
|
|
|
+ this.$message.error(error.message)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
deleteData(unique){
|
|
deleteData(unique){
|
|
- this.deleteArrayData(this.abc,unique)
|
|
|
|
|
|
+ this.deleteArrayData(this.floorList,unique)
|
|
|
|
+
|
|
|
|
|
|
- console.log('data delete ')
|
|
|
|
},
|
|
},
|
|
|
|
+ copyData(unique){
|
|
|
|
+
|
|
|
|
+ this.copyArrayData(this.floorList,unique)
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ copyArrayData(data, id) {
|
|
|
|
|
|
- deleteArrayData(data, id) {
|
|
|
|
- let node = null
|
|
|
|
if (data.length > 0) {
|
|
if (data.length > 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
if (data[i].unique === id) {
|
|
if (data[i].unique === id) {
|
|
- node = data[i]
|
|
|
|
- data.splice(i,1)
|
|
|
|
|
|
+ let copydata = deepClone(data[i])
|
|
|
|
+ this.changeDataUnique(copydata)
|
|
|
|
+ data.splice(i+1,0,copydata)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (data[i].children && data[i].children.length > 0) {
|
|
if (data[i].children && data[i].children.length > 0) {
|
|
- this.deleteArrayData(data[i].children, id)
|
|
|
|
|
|
+ this.copyArrayData(data[i].children, id)
|
|
// if (subresult !== null) {
|
|
// if (subresult !== null) {
|
|
// node = subresult
|
|
// node = subresult
|
|
// break
|
|
// break
|
|
@@ -377,6 +357,81 @@
|
|
}
|
|
}
|
|
// delete node
|
|
// delete node
|
|
},
|
|
},
|
|
|
|
+ /**
|
|
|
|
+ * 修改数组元素unique,在复制节点时,需修改unique
|
|
|
|
+ * @param arr
|
|
|
|
+ */
|
|
|
|
+ changeDataUnique(node){
|
|
|
|
+
|
|
|
|
+ if (node.unique) {
|
|
|
|
+ node.unique=nanoid(10)
|
|
|
|
+
|
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
|
+ for (let i = 0; i < node.children.length; i++) {
|
|
|
|
+ this.changeDataUnique(node.children[i])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ deleteArrayData(data, id) {
|
|
|
|
+ if (data.length > 0) {
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ if (data[i].unique === id) {
|
|
|
|
+ data.splice(i,1)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (data[i].children && data[i].children.length > 0) {
|
|
|
|
+ this.deleteArrayData(data[i].children, id)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /** 树形结构中查找指定Id节点 */
|
|
|
|
+ findNodeById(data, id) {
|
|
|
|
+ let node = null
|
|
|
|
+ if (data.length > 0) {
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ if (data[i].unique === id) {
|
|
|
|
+ node = data[i]
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ if (data[i].children && data[i].children.length > 0) {
|
|
|
|
+ const subresult = this.findNodeById(data[i].children, id)
|
|
|
|
+ if (subresult !== null) {
|
|
|
|
+ node = subresult
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return node
|
|
|
|
+ },
|
|
|
|
+ activeModule(unique){
|
|
|
|
+ let node =this.findNodeById(this.floorList,unique)
|
|
|
|
+
|
|
|
|
+ this.modueConfigModel=node.moduleConfig
|
|
|
|
+ this.activeModuleTitle = this.templates[node.tpl_id].title
|
|
|
|
+ },
|
|
|
|
+ preview(){
|
|
|
|
+ this.previewVisible=true
|
|
|
|
+ },
|
|
|
|
+ getBoardBedItems(){
|
|
|
|
+ API_Board.getBedInfo(this.$store.getters.partId).then(res=>{
|
|
|
|
+
|
|
|
|
+ this.boardBedsInfoRaw={...res}
|
|
|
|
+ this.boardBedsInfo = {...res}
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getPartStatisticSummary(){
|
|
|
|
+ API_Board.getPartStatisticSummary(this.$store.getters.partId).then(res=>{
|
|
|
|
+ this.partStatistic = {...res}
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -624,5 +679,26 @@
|
|
/deep/ .el-scrollbar {
|
|
/deep/ .el-scrollbar {
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
+ ._fc-r-tabs{
|
|
|
|
+ background: #fff;
|
|
|
|
+ border-bottom: 1px solid #ececec;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height: 40px;
|
|
|
|
+ }
|
|
|
|
+ /deep/ .el-aside{
|
|
|
|
+ background: #fff;
|
|
|
|
+ padding: 0;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ ._fc-m-tools {
|
|
|
|
+ align-items: center;
|
|
|
|
+ border: 1px solid #ececec;
|
|
|
|
+ border-top: 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 40px;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ }
|
|
|
|
+ /deep/ .el-dialog__body{
|
|
|
|
+ padding:0;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|