12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295 |
- <template>
- <div
- class="mychart_container"
- id="mychart_container"
- >
- <span
- class="slide-icon slide-right"
- @click="slideHandle"
- v-show="isSlideLeft"
- >
- <i class="el-icon-d-arrow-right"></i>
- </span>
- <div class="main-left left" id="left" v-show="!isSlideLeft">
- <span class="slide-icon slide-left" @click="slideHandle">
- <i class="el-icon-d-arrow-left"></i>
- </span>
- <span class="move-btn resize" v-drag id="resize"></span>
- <div class="left-top">
- <span v-permission="permissionBtn.myETAPermission.myChart_selectChart"
- class="add-cont" @click="chooseChartHandle">
- <img
- :src="$icons.choose_blue"
- alt=""
- style="width: 14px; height: 14px"
- />
- <!-- 选择图表 -->{{$t('MyEtaPage.choose_chart_btn')}}
- </span>
- <el-select
- v-model="search_txt"
- v-loadMore="searchLoad"
- :filterable="!search_txt"
- remote
- clearable
- :placeholder="$t('Chart.search_chart_placeholder')"
- style="width: 100%; margin-top: 20px"
- :remote-method="searchHandle"
- @click.native="inputFocusHandle"
- >
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- <el-option
- v-for="item in searchOptions"
- :key="item.MyChartId"
- :label="chart_lang==='en'?(item.ChartNameEn||item.ChartName):item.ChartName"
- :value="item.MyChartId"
- >
- </el-option>
- </el-select>
- </div>
- <div class="left-bottom">
- <div class="public-classify" v-if="publicClassifyList.length">
- <h3
- @click="expandPublic = !expandPublic"
- class="classify-type"
- >
- <!-- 公共图库 -->{{$t('MyEtaPage.tab_public')}}
- <span><i :class="{'el-icon-arrow-down':!expandPublic,'el-icon-arrow-up':expandPublic}"></i></span>
- </h3>
-
- <div class="tree-wrap" v-show="expandPublic">
- <el-tree
- ref="catalogTree"
- class="catalog-tree other-tree"
- empty-text="暂无图库"
- :data="publicClassifyList"
- node-key="nodeKeyId"
- :expand-on-click-node="false"
- @current-change="(data,node)=>{nodeChange(data,node)}"
- >
- <div class="custom-tree-node" slot-scope="{ data,node }">
- <span class="tree-label">{{ data.name }}</span>
- <div class="right-item right-item-box" >
- <el-dropdown @command="handleCommand" trigger="click" v-if="isShowDropPublic&&data.MyChartClassifyId">
- <span class="el-dropdown-link">
- <i class="el-icon-more" style="font-size: 16px;transform: rotate(90deg);cursor: pointer"/>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item :command="{key:'copy'}" :disabled="select_classify_userid === roleId"><!-- 复制 -->{{$t('MyEtaPage.option_op_copy')}}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- </el-tree>
- </div>
- </div>
- <div class="classify" v-if="classifyList.length">
- <h3 class="classify-type"><!-- 我的图库 -->{{$t('MyEtaPage.tab_my')}}</h3>
- <draggable
- v-model="classifyList"
- class="classify-ul"
- animation="300"
- tag="ul"
- @start="menuDragStart"
- @update="menuDragenter"
- @end="menuDragOver"
- >
- <li
- :class="[
- 'classify-item',
- { 'act': item.MyChartClassifyId === select_classify && item.fromPublic === ispublic },
- ]"
- v-for="item in classifyList"
- :key="item.MyChartClassifyId"
- @click="chooseClassify(item)"
- >
- <div>
- <img
- src="~@/assets/img/data_m/move_ico.png"
- alt=""
- class="move"
- style="width: 14px; height: 14px;margin-right: 5px;"
- />
- {{ item.MyChartClassifyName }}
- </div>
- <div class="right-item right-item-box">
- <el-dropdown v-if="isShowGroupBtn"
- style="margin-right: 10px" @command="handleCommand" trigger="click">
- <span class="el-dropdown-link el-dropdown-link-img">
- <img src="~@/assets/img/chart_m/Group.png" v-if="item.IsPublic === 0">
- <img src="~@/assets/img/chart_m/User.png" v-else>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- :command="{key:'own',IsCompanyPublic:undefined,item}"
- :class="item.IsPublic === 0 ? 'el-dropdown-menu-item-chat-act' : ''"
- class="el-dropdown-menu-item-chat"
- >
- <img v-if="item.IsPublic === 0" src="~@/assets/img/chart_m/Group_act.png">
- <img v-else src="~@/assets/img/chart_m/Group.png">
- <!-- 仅自己可见 -->{{$t('MyEtaPage.option_view_person')}}</el-dropdown-item>
- <el-dropdown-item
- :command="{key:'public',IsCompanyPublic:undefined,item}"
- :class="item.IsPublic === 1 ? 'el-dropdown-menu-item-chat-act' : ''"
- class="el-dropdown-menu-item-chat"
- >
- <img v-if="item.IsPublic === 1" src="~@/assets/img/chart_m/User_act.png">
- <img v-else src="~@/assets/img/chart_m/User.png">
- <!-- 所有人可见 -->{{$t('MyEtaPage.option_view_all')}}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown @command="handleCommand" trigger="click" v-if="isShowDropMine">
- <span class="el-dropdown-link">
- <i class="el-icon-more" style="font-size: 16px;transform: rotate(90deg);cursor: pointer"/>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-if="permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_rename')"
- :command="{key:'edit'}"><!-- 重命名 -->{{$t('MyEtaPage.option_op_rename')}}</el-dropdown-item>
- <el-dropdown-item v-if="permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_delete')"
- :command="{key:'del'}"><!-- 删除 -->{{$t('Table.delete_btn')}}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </li>
- </draggable>
- </div>
- <div class="noclassify" @click="addClassify" v-permission="permissionBtn.myETAPermission.myChart_classifyOpt_edit">
- <img
- src="~@/assets/img/set_m/add_ico.png"
- alt=""
- style="width: 16px; height: 16px; margin-right: 10px"
- />
- <span><!-- 添加我的分类 -->{{$t('MyEtaPage.add_myclassify_btn')}}</span>
- </div>
- </div>
- </div>
- <div
- class="main-right right"
- id="right"
- :style="isSlideLeft ? 'width:100%' : ``"
- >
- <div class="chart-public-cont" v-if="haveData">
-
- <div class="cont-top">
- <span>{{$t('Chart.total_chart_show',{limit:total})}}</span>
- <span v-if="ispublic === 1"><!-- 分享人 -->{{$t('MyEtaPage.label_share_user')}}: {{ RealName }}</span>
- </div>
- <div
- class="chart-public-list"
- :infinite-scroll-disabled="!haveMove"
- v-infinite-scroll="loadMove"
- infinite-scroll-distance='1'
- infinite-scroll-delay="200"
- >
- <draggable
- v-model="chartList"
- class="drag-cont"
- animation="300"
- @start="dragStartHandler"
- @update="dragenter"
- @end="dragOverHandler"
- :disabled="ispublic===1"
- >
- <el-col
- :span="6"
- v-for="chart in chartList"
- :key="chart.ChartInfoId"
- style="margin-bottom: 20px; padding-right: 20px;min-width: 270px;"
- >
- <el-card class="public-chart-item">
- <div slot="header" class="item-top">
- <span class="text_oneLine" :style="{'padding-left':chart.IsEnChart?'24px':''}">{{ chart_lang === 'en' ? (chart.ChartNameEn||chart.ChartName) : chart.ChartName }}</span>
- <img
- v-if="ispublic === 0"
- src="~@/assets/img/data_m/move_ico.png"
- alt=""
- class="move"
- style="width: 14px; height: 14px"
- />
- </div>
- <img
- :src="([1,11].includes(chart.Source)&&!chart.HaveOperaAuth) ? $icons.lock_big : chart.ChartImage"
- alt=""
- class="chart-img"
- @click="viewChartDetail(chart)"
- />
- <div class="item-bottom">
- <span class="last-time"
- ><!-- 创建时间 -->{{$t('Chart.list_chart_time')}}: {{ chart.CreateTime.slice(0,10) }}</span
- >
- <div v-if="select_classify_userid === roleId">
- <span v-permission="permissionBtn.myETAPermission.myChart_move"
- class="join_txt" @click="removeMyChart(chart)">
- <i
- class="el-icon-remove-outline"
- style="font-size: 14px"
- ></i>
- <!-- 移出 -->{{$t('Chart.chart_remove_btn')}}
- </span>
- </div>
- </div>
- </el-card>
- </el-col>
- </draggable>
- </div>
- </div>
- <div v-else class="nodata">
- <span v-if="ispublic === 1" class="sharer"><!-- 分享人 -->{{$t('MyEtaPage.label_share_user')}}: {{ RealName }}</span>
- <tableNoData :text="$t('Common.no_chart_msg')"/>
- </div>
- </div>
- <choose-chart
- :isOpenChoose="isChoose"
- @cancel="isChoose = false"
- @addSuccess="addChartBack"
- />
- <pub-dialog
- :isShow="isClassifyDia"
- :title="dia_title"
- :keysArr="dialogKeyArrs"
- :formData="formData"
- :formRules="addRules"
- :selectArr="selectArr"
- @cancel="isClassifyDia = false"
- @ensureCallBack="addClassifyBack"
- />
- <!-- 图表详情弹窗 -->
- <chart-detail
- :isOpenDetail="isOpenDetail"
- :select_classify="select_classify"
- :chart_code="chart_code"
- :allChart="chartArrParams"
- :classifyUserId="select_classify_userid"
- @close="chartCallBack"
- @remove="removeCallBack"
- />
- <!-- 删除确认弹窗 -->
- <ClassifyDeleteCheck
- :hintDialogShow="hintDialogShow"
- :detailArr="detailArr"
- @close="hintDialogShow=false"
- />
- </div>
- </template>
- <script>
- import draggable from 'vuedraggable';
- import { mychartInterface } from '@/api/api.js';
- import pubDialog from '@/components/pubDialog.vue';
- import chooseChart from './components/chooseChart.vue';
- import chartDetail from './components/chartDetailDia.vue';
- import ClassifyDeleteCheck from './components/classifyDeleteCheck.vue';
- export default {
- name: '',
- components: {
- chooseChart,
- pubDialog,
- draggable,
- chartDetail,
- ClassifyDeleteCheck
- },
- directives: {
- drag(el, bindings) {
- el.onmousedown = function (e) {
- var init = e.clientX;
- var box = $('#mychart_container')[0];
- let total_wid = box.offsetWidth;
- var left = $('#left')[0];
- var right = $('#right')[0];
- var initWidth = left.offsetWidth;
- document.onmousemove = function (e) {
- var end = e.clientX;
- if (end > 310) {
- var newWidth = end - init + initWidth;
- right.style.width = total_wid - newWidth + 'px';
- left.style.width = newWidth + 'px';
- } else {
- end = 350;
- // 最小宽度300
- left.style.width = 300 + 'px';
- }
- };
- document.onmouseup = function () {
- document.onmousemove = document.onmouseup = null;
- e.releaseCapture && e.releaseCapture();
- };
- e.setCapture && e.setCapture();
- return false;
- };
- },
- },
- data() {
- return {
- expandPublic:false,
- RealName:'',
- haveData: true,
- isSlideLeft: false, //收起分类
- search_txt: '',
- searchOptions: [],
- select_classify: 0,
- classifyList: [],
- total: 0,
- page_no: 1,
- page_size: 1200,
- chartList: [], //列表
- isRightClick: false, //右击弹窗
- rightClick_classify: '', //右击的分类
- rightActionArr: [
- {
- title: '编辑',
- key: 'edit',
- },
- {
- title: '删除',
- key: 'del',
- },
- ],
- startIndex: '', //初始位置id
- preIndex: '', //结束位置上一个id
- nextIndex: '', //结束位置下一个id
- /* 选择图表弹窗 */
- isChoose: false,
- /* 添加分类 */
- isClassifyDia: false,
- dia_title: '新增分类',
- dialogKeyArrs: [], //form key
- selectArr: [], //select data
- formData: {
- name: '',
- },
- addRules: {
- name: [
- { required: true, message: /* '分类名称不能为空' */this.$t('Edb.Valids.common_msg',{label: this.$t('MyEtaPage.label_classify_name')}), trigger: 'blur' },
- ],
- classify: [
- { required: true, message: /* '复制分类不能为空' */this.$t('Edb.Valids.common_msg',{label: this.$t('MyEtaPage.label_classify_name')}), trigger: 'blur' },
- ]
- }, //添加分类规则
- move_id: '', //移动到 当前选中图表
- /* 图表详情弹窗 */
- isOpenDetail: false,
- chart_code: '',//图表code
- chartArrParams: [],//当前选择分类下的所有图表
- startMenuIndex: '', //初始位置id
- preMenuIndex: '', //结束位置上一个id
- nextMenuIndex: '', //结束位置下一个id
- publicClassifyList: [],//公共分类
- ispublic: '',//选中的是公共还是own
- select_classify_userid: 0,//选中图表的创建人id
- haveMove: false,
- hintDialogShow:false,
- detailArr:[]
- };
- },
- computed: {
- /* 登录角色id */
- roleId() {
- let id = Number(localStorage.getItem('AdminId'));
- return id;
- },
- //是否显示公共图库的下拉按钮
- isShowDropPublic(){
- return this.permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_copy')
- },
- //是否显示我的图库的下拉按钮
- isShowDropMine(){
- return this.permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_rename')
- || this.permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_delete')
- },
- //是否显示可见权限
- isShowGroupBtn(){
- return this.permissionBtn.isShowBtn('myETAPermission','myChart_classifyOpt_show')
- },
- //语言版本
- chart_lang() {
- return this.$store.state.lang
- }
- },
- watch: {
- // 左侧选中分类
- select_classify(newval) {
- if (newval) {
- this.page_no = 1;
- this.chartList = [];
- this.getChartList();
- }
- },
- /* */
- search_txt(newval) {
- if (newval) {
- const obj = this.searchOptions.find(
- (item) => item.MyChartId === newval
- );
- //所属分类列表 单个高亮左侧
- let classify_arr = obj.MyChartClassifyId.split(',');
- this.page_no = 1;
- this.select_classify = 0;
- if (classify_arr.length === 1) this.select_classify = Number(classify_arr[0]);
- this.getChartList();
- }
- },
- //页码
- page_no() {
- this.getChartList();
- },
- },
- methods: {
- /* 获取分类列表 */
- getClassify() {
- mychartInterface.classifyList().then((res) => {
- if (res.Ret !== 200) return;
- this.classifyList = res.Data ? res.Data.List.map(item => ({
- ...item,
- fromPublic: 0
- })) : [];
- if (!this.classifyList.length) this.haveData = false;
- this.select_classify =
- this.select_classify ||
- (this.classifyList.length
- ? this.classifyList[0].MyChartClassifyId
- : 0);
- this.ispublic = this.ispublic ||
- (this.classifyList.length
- ? this.classifyList[0].fromPublic
- : '');
- this.select_classify_userid = this.select_classify_userid || (this.classifyList.length
- ? this.classifyList[0].AdminId
- : 0);
- });
- },
- /* 获取公用分类 */
- getPublicClassify() {
- mychartInterface.publicClassify().then((res) => {
- if(res.Ret !== 200) return;
- this.publicClassifyList = res.Data?res.Data.List||[]:[]
- this.publicClassifyList = this.publicClassifyList.map(list=>{
- list.name = list.MenuName
- list.nodeKeyId = 'list' + list.MenuAdminId
- if(list.Items){
- list.children = list.Items.map(item=>{
- return {
- ...item,
- ...{
- nodeKeyId:'item'+ item.MyChartClassifyId,
- name:item.MyChartClassifyName
- }
- }
- })
- }
- return list
- })
- })
- },
- /* 获取图表 MyChartId用于具体搜索和MyChartClassifyId互斥*/
- getChartList() {
- mychartInterface
- .myList({
- PageSize: this.page_size,
- CurrentIndex: this.page_no,
- MyChartClassifyId: this.select_classify || 0,
- MyChartId: this.search_txt || 0,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.haveData = res.Data ? true : false;
- this.haveMove = res.Data
- ? this.page_no < res.Data.Paging.Pages
- : false;
- this.chartList = res.Data
- ? this.page_no === 1
- ? res.Data.List
- : [...this.chartList, ...res.Data.List]
- : [];
- this.total = res.Data ? res.Data.Paging.Totals : 0;
- });
- },
- /* 加载下页 */
- loadMove() {
- this.page_no++;
- },
- /* 搜索 */
- searchHandle(query) {
- this.search_page = 1;
- this.current_search = query;
- this.searchApi(this.current_search)
- },
- searchApi(query,page=1) {
- if(!query) {
- this.searchOptions = [];
- return
- }
- /* 查找列表 */
- mychartInterface
- .mychartSearchByEs({
- Keyword: query,
- CurrentIndex: page
- })
- .then((res) => {
- if (res.Ret !== 200) return
- const { List,Paging } = res.Data;
- this.search_have_more = page < Paging.Pages;
- this.searchOptions = page === 1 ? List : [...this.searchOptions,...List];
- });
- },
- /* 聚焦获取当前检索 */
- inputFocusHandle(e) {
- this.search_page = 1;
- this.current_search = e.target.value;
- if(this.current_search) {
- this.searchApi(this.current_search)
- }else {
- this.searchOptions = [];
- }
- },
- searchLoad() {
- if(!this.search_have_more) return;
- this.searchApi(this.current_search,++this.search_page);
- },
- nodeChange(data,node){
- if(node.level===1){
- this.select_classify = 0
- this.haveData = false
- this.total = 0
- this.page_no = 1
- this.chartList = []
- this.ispublic=''
- return
- }
- this.RealName = data.RealName
- this.chooseClassify({
- MyChartClassifyId:data.MyChartClassifyId,
- fromPublic:1,
- AdminId:data.AdminId
- })
- },
- /* 切换分类 */
- chooseClassify({MyChartClassifyId,fromPublic,AdminId}) {
- if(fromPublic!==1){
- this.$refs.catalogTree&&this.$refs.catalogTree.setCurrentKey(null)
- }
- this.select_classify = MyChartClassifyId;
- this.ispublic = fromPublic;
- this.select_classify_userid = AdminId;
- this.search_txt = '';
- },
- /* 选择图表添加 */
- chooseChartHandle() {
- this.isChoose = true;
- },
- /* 图表添加完成 */
- addChartBack() {
- this.isChoose = false;
- this.getClassify();
- this.getChartList();
- },
- /* 添加分类 */
- addClassify() {
- this.dia_title = /* '新增分类' */this.$t('MyEtaPage.label_add_classify');
- this.dialogKeyArrs = [
- {
- label: /* '分类名称' */this.$t('MyEtaPage.label_classify_name'),
- prop: 'name',
- type: 'input',
- maxlen: 10,
- placeholder: /* '请输入分类名称' */this.$t('MyEtaPage.ph_classify'),
- },
- ];
- this.formData = {
- name: '',
- };
- this.isClassifyDia = true;
- },
- /* 添加分类回调 */
- addClassifyBack(params, title) {
- title === this.$t('MyEtaPage.label_add_classify') &&
- mychartInterface
- .addClassify({
- MyChartClassifyName: params.name,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.$message.success(/* '新增成功' */this.$t('MsgPrompt.add_msg'));
- this.isClassifyDia = false;
- this.getClassify();
- });
- title === this.$t('MyEtaPage.label_rename_classify') &&
- mychartInterface
- .editClassify({
- MyChartClassifyName: params.name,
- MyChartClassifyId: this.select_classify,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.$message.success(/* '编辑成功' */this.$t('MsgPrompt.edit_msg'));
- this.isClassifyDia = false;
- this.getClassify();
- this.getPublicClassify();
- });
- title === this.$t('MyEtaPage.label_copy_classify') &&
- mychartInterface
- .copyMyChart({
- ChartInfoId: this.move_id,
- MyChartClassifyId: params.classify,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.$message.success(/* '复制成功' */this.$t('MsgPrompt.copy_success_msg'));
- this.isClassifyDia = false;
- this.resetStatus();
- this.getClassify();
- this.getChartList();
- });
- },
- resetStatus() {
- this.search_txt = '';
- },
- /*重命名分类 */
- editClassify({ MyChartClassifyName }) {
- this.isClassifyDia = true;
- this.formData = {
- name: MyChartClassifyName,
- };
- this.dialogKeyArrs = [
- {
- label: /* '分类名称' */this.$t('MyEtaPage.label_classify_name'),
- prop: 'name',
- type: 'input',
- maxlen: 10,
- placeholder: /* '请输入分类名称' */this.$t('MyEtaPage.ph_classify'),
- },
- ];
- this.dia_title = /* '重命名分类' */this.$t('MyEtaPage.label_rename_classify');
- },
- /* 操作 */
- handleCommand({key,IsCompanyPublic,item}) {
- console.log({key,IsCompanyPublic,item});
- key === 'copy' && mychartInterface.copyclassify({
- MyChartClassifyId: this.select_classify
- }).then(res => {
- if(res.Ret !== 200) return;
- this.$message.success(/* '复制成功' */this.$t('MsgPrompt.copy_success_msg'));
- this.getClassify();
- });
- ['edit','del'].includes(key) && this.dealAction(key);
- ['own', 'public'].includes(key) && mychartInterface.setPublic({
- IsPublic: key === 'own' ? 0 : 1,
- MyChartClassifyId: this.select_classify
- }).then(res => {
- if(res.Ret !== 200) return;
- this.$message.success(/* '设置成功' */this.$t('MsgPrompt.set_success_msg'));
- if(key === 'own'){
- item.IsPublic=0
- item.IsCompanyPublic=0
- }else{
- item.IsPublic=1
- }
- })
- key==='auth' && mychartInterface.setClassifyAuthToUser({
- MyChartClassifyId:this.select_classify,
- IsCompanyPublic:IsCompanyPublic
- }).then(res=>{
- if(res.Ret !== 200) return;
- this.$message.success(/* '操作成功' */this.$t('MsgPrompt.operate_success_msg'));
- item.IsCompanyPublic=IsCompanyPublic
- })
-
- },
- /* 编辑 删除*/
- dealAction(key) {
- key === 'del' && this.handleDeleteClassify()
- const obj = this.classifyList.find(
- (x) => x.MyChartClassifyId === this.select_classify
- );
- key === 'edit' && this.editClassify(obj);
- },
- async handleDeleteClassify(){
- const res = await mychartInterface.getFrameNode({
- MyChartClassifyId:this.select_classify
- })
- if(res.Ret!==200) return
- this.detailArr = res.Data||[]
- if(this.detailArr.length){
- this.hintDialogShow = true
- return
- }
- this.$confirm(
- /* '若删除该分类,则分类下关联的所有图表将被全部删除, 是否继续?' */this.$t('Chart.OptMsg.del_classify_chart_msg'),
- /* '提示' */this.$t('Dialog.warn_tit'),
- {
- type: 'warning',
- }
- )
- .then(() => {
- mychartInterface
- .delClassify({
- MyChartClassifyId: this.select_classify,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.$message.success(/* '删除成功' */ this.$t('MsgPrompt.delete_msg'));
- this.getClassify();
- this.getPublicClassify();
- });
- })
- .catch(() => {});
-
- },
- /* 拖动开始 记录位置 */
- dragStartHandler({ oldIndex }) {
- this.startIndex = this.chartList[oldIndex].MyChartId;
- },
- /* 拖动结束 替换 */
- dragOverHandler() {
- mychartInterface
- .move({
- MyChartId: this.startIndex,
- MyChartClassifyId: this.select_classify,
- PrevMyChartId: this.preIndex || 0,
- NextMyChartId: this.nextIndex || 0,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- });
- },
- /* 拖动时 获取移动后的上一个位置id 若移到第一位则取0 获取后一个id 若是最后一个取0*/
- dragenter({ newIndex }) {
- console.log(newIndex)
- this.preIndex = newIndex > 0 ? this.chartList[newIndex - 1].MyChartId : 0;
- this.nextIndex = newIndex === this.chartList.length - 1 ? 0 : this.chartList[newIndex + 1].MyChartId
- },
- /* 拖动开始 记录位置 */
- menuDragStart({ oldIndex }) {
- this.startMenuIndex = this.classifyList[oldIndex].MyChartClassifyId;
- },
- /* 拖动结束 替换 */
- menuDragOver() {
- mychartInterface.moveClassify({
- MyChartClassifyId: this.startMenuIndex,
- NextClassifyId: this.nextMenuIndex || 0,
- PrevClassifyId: this.preMenuIndex || 0,
- }).then(res => {
- if(res.Ret !== 200) return;
- })
- },
- /* 拖动时 获取移动后的上一个位置id 若移到第一位则取0 获取后一个id 若是最后一个取0*/
- menuDragenter({ newIndex }) {
-
- this.preMenuIndex = newIndex > 0 ? this.classifyList[newIndex - 1].MyChartClassifyId : 0;
- this.nextMenuIndex = newIndex === this.classifyList.length - 1 ? 0 : this.classifyList[newIndex + 1].MyChartClassifyId
- },
- /* 向左收起/展开 */
- slideHandle() {
- this.isSlideLeft = !this.isSlideLeft;
- },
- /* 页码改变 */
- handleCurrentChange(page) {
- this.page_no = page;
- },
- /* 进入图库详情 */
- async viewChartDetail({ UniqueCode }) {
- this.chart_code = UniqueCode;
- // 获取当前分类下的所有图表 取code
- const allcharts = (this.select_classify || this.search_txt) ? await mychartInterface
- .myList({
- PageSize: 1000000,
- CurrentIndex: 1,
- MyChartClassifyId: this.select_classify || 0,
- MyChartId: this.search_txt || 0,
- }) : [];
- this.chartArrParams = allcharts.Data.List && allcharts.Data.List.length ? allcharts.Data.List.map(item => item.UniqueCode) : [];
- this.isOpenDetail = true;
- },
- chartCallBack() {
- this.page_no = 1;
- this.isOpenDetail = false;
- this.getChartList();
- },
- // 弹窗内移出删除图标后回调
- removeCallBack(code) {
- this.chartArrParams.splice(this.chartArrParams.findIndex(item => item === code), 1)
- },
- /* 移出我的图库 */
- removeMyChart({ MyChartId }) {
- if (!this.select_classify)
- return this.$message.warning(
- '当前图表所属多个分类,请选中具体分类移出'
- );
- mychartInterface
- .del({
- MyChartId,
- MyChartClassifyId: this.select_classify,
- })
- .then((res) => {
- if (res.Ret !== 200) return;
- this.$message.success(/* '移出成功' */this.$t('MsgPrompt.move_out_msg'));
- this.page_no = 1;
- this.getChartList();
- });
- },
- /* 移动到 打开分类弹窗 */
- async moveMychart(id) {
- this.dia_title = /* '复制图表分类' */ this.$t('MyEtaPage.label_copy_classify');
- this.move_id = id;
- this.dialogKeyArrs = [
- {
- label: /* '复制到' */ this.$t('MyEtaPage.label_copy_to'),
- prop: 'classify',
- type: 'select',
- placeholder: /* '请选择目录' */ this.$t('MyEtaPage.ph_menu'),
- multiple: true,
- },
- ];
- this.formData = {
- classify: [],
- };
- //获取当前图表所属分类并过滤
- const { Data } = await mychartInterface.getChartInClassify({ChartInfoId: id });
- this.selectArr = this.classifyList
- .map((item) => ({
- name: item.MyChartClassifyName,
- value: item.MyChartClassifyId,
- }))
- .filter((x) => !Data.includes(x.value));
- this.isClassifyDia = true;
- },
- },
- mounted() {
- if(this.$route.query.id) {
- this.select_classify = Number(this.$route.query.id)
- this.ispublic = 1
- }else {
- this.select_classify = sessionStorage.getItem('myChartOpt')
- ? Number(sessionStorage.getItem('myChartOpt'))
- : 0;
- this.ispublic=sessionStorage.getItem('myChartIspublic')? Number(sessionStorage.getItem('myChartIspublic')): '';
- }
- //从图库框架跳转来的
- if(this.$route.query.frameId){
- this.select_classify = Number(this.$route.query.frameId)
- this.ispublic = ''
- }
- this.getClassify();
- this.getPublicClassify();
- },
- };
- </script>
- <style lang="scss">
- @import "../chartFrame_manage/css/customTree.scss";
- .mychart_container {
- position: relative;
- .right-item-box {
- display:flex;
- align-items: center;
- img {
- width: 16px;
- }
- .el-dropdown-link-img {
- width: 18px;
- cursor: pointer;
- }
- }
- .right-content {
- position: fixed;
- left: 40%;
- top: 20%;
- background: #fff;
- padding: 6px 0;
- border: 1px solid #999;
- box-shadow: 0 1px 4px #999;
- z-index: 2;
- li {
- padding: 5px 60px;
- margin: 5px 0;
- color: #333;
- &:hover {
- background: #ddd;
- cursor: pointer;
- }
- }
- }
- .flip-list-move {
- transition: transform 0.4s;
- }
- .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
- background-color: #409eff !important;
- border-color: #409eff;
- }
- .el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner {
- background-color: #409eff !important;
- border-color: #409eff;
- }
- .el-card .el-card__header {
- padding: 14px 20px;
- }
- .slide-icon {
- padding: 20px 0;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
- border-radius: 5px;
- cursor: pointer;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- z-index: 99;
- &:hover {
- background-color: rgba(0, 0, 0, 0.05);
- }
- &.slide-left {
- right: 0;
- }
- &.slide-right {
- left: -30px;
- }
- }
- .el-icon-refresh {
- font-size: 17px;
- margin-left: 5px;
- cursor: pointer;
- }
- display: flex;
- div::-webkit-scrollbar {
- width: 5px !important;
- }
- .main-left {
- width: 300px;
- min-width: 300px;
- background: #fff;
- margin-right: 20px;
- border: 1px solid #ececec;
- border-radius: 4px;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
- min-height: calc(100vh - 113px);
- overflow: hidden;
- position: relative;
- box-sizing: border-box;
- .left-top {
- padding: 30px 20px 15px;
- .add-cont {
- cursor: pointer;
- font-size: 15px;
- color: #409eff;
- }
- }
- .left-bottom {
- padding: 15px 0 30px;
- overflow: auto;
- max-height: calc(100vh - 290px);
- position: relative;
- margin-right: 20px;
- .classify-item {
- padding: 10px 30px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- &.act {
- background: #e0eefd;
- color: #409eff;
- }
- }
- .classify-type {
- margin-bottom: 8px;
- padding-left: 15px;
- }
- .public-classify {
- margin-bottom: 20px;
- .tree-wrap{
- padding:15px;
- }
- }
- }
- .noclassify {
- margin: 50px 0;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #409eff;
- font-size: 16px;
- cursor: pointer;
- }
- .move-btn {
- height: 100%;
- width: 4px;
- position: absolute;
- right: 0px;
- top: 0;
- z-index: 99;
- &:hover {
- cursor: col-resize;
- }
- }
- }
- .main-right {
- width: 80%;
- position: relative;
- .mx-datepicker {
- width: 220px !important;
- }
- .nodata {
- height: calc(100vh - 240px);
- text-align: center;
- font-size: 16px;
- color: #666;
- .sharer {
- color: #333;
- font-size: 14px;
- position: absolute;
- right: 0;
- top: 0;
- }
- }
- /* =================== */
- .chart-min-cont {
- background: #fff;
- border: 1px solid #ececec;
- height: calc(100vh - 118px);
- overflow: auto;
- border-radius: 4px;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
- .cont-top {
- padding: 12px 30px;
- border-bottom: 1px solid #ececec;
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
- .top-left {
- .year-btn {
- font-size: 14px;
- margin-right: 5px;
- margin-bottom: 5px;
- }
- .btn-sty {
- font-size: 16px;
- padding: 10px;
- border: 1px solid #409eff;
- }
- }
- .top-right {
- .span-item {
- font-size: 16px;
- color: #409eff;
- cursor: pointer;
- &:hover {
- text-decoration: underline;
- }
- .el-icon-collection,
- .el-icon-document-copy {
- color: #409eff;
- }
- }
- }
- }
- .cont-bottom {
- padding: 30px;
- .el-input__inner {
- height: 27px;
- line-height: 27px;
- padding: 0 4px;
- }
- .el-input-number .el-input__inner {
- padding: 0 34px 0 4px;
- }
- .el-color-picker--mini .el-color-picker__trigger {
- width: 60px;
- height: 25px;
- padding: 0;
- }
- .el-color-picker--mini .el-color-picker__mask {
- width: 60px;
- height: 25px;
- }
- .el-table__expanded-cell {
- padding: 20px 26px;
- }
- .highcharts-range-selector-group {
- display: none;
- .highcharts-input-group {
- display: none;
- }
- }
- .highcharts-axis-title {
- display: block;
- }
- .calendar-cont {
- display: block;
- margin: 10px auto 0;
- text-align: center;
- }
- /* =================== */
- .chart-show-cont {
- margin-bottom: 15px;
- padding: 0 120px 20px;
- position: relative;
- .chart-title {
- font-size: 16px;
- font-weight: normal;
- text-align: center;
- margin-bottom: 10px;
- }
- .chart-author {
- font-size: 14px;
- color: #333;
- position: absolute;
- bottom: 20px;
- right: 38px;
- }
- .chartWrapper {
- position: relative;
- .range-cont {
- position: absolute;
- top: 13%;
- .min-data-input {
- width: 70px;
- display: block;
- margin-top: 354px;
- }
- &.left {
- left: -80px;
- }
- &.right {
- right: -80px;
- }
- }
- }
- }
- .options-cont {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- }
- }
- }
- }
- .drawImg {
- position: absolute;
- top: -999px;
- z-index: -100;
- }
- /* ===================== */
- .chart-public-cont {
- color: #333;
- .el-card .el-card__header,
- .el-card__body {
- padding: 10px;
- }
- .cont-top {
- display: flex;
- justify-content: space-between;
- }
- .chart-public-list {
- margin-top: 10px;
- height: calc(100vh - 143px);
- overflow: hidden;
- overflow-y: auto;
- .drag-cont {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- }
- .dragShdow {
- box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
- opacity: 0.5;
- }
- .public-chart-item {
- .item-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 16px;
- font-weight: 600;
- position: relative;
- }
- .chart-img {
- width: 100%;
- height: 230px;
- object-fit: fill !important;
- cursor: pointer;
- }
- .item-bottom {
- margin-top: 10px;
- display: flex;
- justify-content: space-between;
- color: #666;
- font-size: 12px;
- .join_txt {
- color: #f00;
- cursor: pointer;
- &.move_txt {
- color: #409eff;
- }
- }
- }
- }
- }
- }
- }
- .el-dropdown-menu-item-chat {
- display: flex !important;
- align-items: center !important;
- img {
- width: 16px;
- margin-right: 8px;
- }
- &:hover {
- background-color: #F5F7FA !important;
- color: #606266 !important;
- }
- }
- .el-dropdown-menu .el-dropdown-menu-item-chat-act {
- color: #66b1ff !important;
- }
- </style>
|