| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776 |
- <template>
- <div
- class="f_box"
- :style="{
- background: stype2 == 2 ? '#fff' : '',
- padding: stype2 == 2 ? '10px' : '',
- }"
- v-loading="delLoading"
- >
- <!-- <div class="f_box_top" >
- <div class="f_box_top_left">
- <div class="f_box_top_title">
- 所有文件夹
- </div>
- </div>
- </div> -->
- <div class="f_box_top">
- <div class="f_box_top_left">
- <el-select
- style="margin-right: 10px; width: 100px"
- v-loading="tagLoading1"
- v-model="check1"
- :placeholder="lang.subject"
- clearable
- filterable
- collapse-tags
- @change="serchFile()"
- >
- <el-option
- v-for="(item, index) in tagData1"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-select
- style="margin-right: 10px; width: 100px"
- v-loading="tagLoading2"
- v-model="check2"
- :placeholder="lang.grade"
- clearable
- filterable
- @change="serchFile()"
- >
- <el-option
- v-for="(item, index) in tagData2"
- :key="index"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-select
- v-if="pid.split('/')[0] == '0'"
- style="width: 100px"
- v-loading="tagLoading3"
- v-model="check3"
- :placeholder="lang.customize"
- clearable
- filterable
- @change="serchFile()"
- >
- <el-option
- v-for="(item, index) in tagData3"
- :key="index"
- :label="item.name"
- :value="item.name"
- ></el-option>
- </el-select>
- <el-select
- v-if="pid.split('/')[0] == '1'"
- style="width: 120px"
- v-loading="isLoading"
- v-model="user"
- :placeholder="lang.owner"
- clearable
- filterable
- @change="serchFile()"
- >
- <el-option
- v-for="(item, index) in userArray"
- :key="index"
- :label="item.username"
- :value="item.userid"
- ></el-option>
- </el-select>
- </div>
- <div class="f_box_top_right">
- <div>
- <div
- class="left"
- style="display: flex; justify-content: flex-end; padding: 10px 16px"
- >
- <span
- class="list"
- :class="{ active: stype2 == 1 }"
- @click="checkStype2(1)"
- ></span>
- <span
- class="table"
- :class="{ active: stype2 == 2 }"
- @click="checkStype2(2)"
- ></span>
- </div>
- </div>
- <div class="input">
- <div class="serch"></div>
- <input
- type="text"
- v-model="fileName"
- :placeholder="lang.search"
- @input="debouncedSearch"
- />
- </div>
- <div class="f_box_top_right">
- <el-button
- v-if="pid.split('/')[0] == '0'"
- type="primary"
- style="background-color: #3370ff; height: 38px"
- size="small"
- @click="openAdd"
- icon="el-icon-plus"
- >{{ lang.newFolder }}</el-button
- >
- <el-button
- style="height: 38px; margin-right: 12px; background: #f56c6c"
- type="danger"
- v-if="checkArray.length && stype2 == 2"
- size="small"
- @click="deleteFolder"
- >{{ lang.delete }}</el-button
- >
- <span
- v-if="checkArray.length && stype2 == 2"
- style="
- margin-right: 10px;
- color: #b0b0b0;
- font-size: 14px;
- flex-shrink: 0;
- "
- >{{ lang.selectedFolders }}{{ checkArray.length
- }}{{ lang.piece }}</span
- >
- </div>
- </div>
- </div>
- <div
- class="none_box"
- v-if="fileArray.length == 0"
- v-loading.body="isLoading && showBool"
- >
- {{ lang.noFolder }}
- </div>
- <div
- class="f_box_file_list"
- v-else-if="stype == '2' && fileArray.length"
- v-loading.body="isLoading && showBool"
- >
- <!-- 切换样式 -->
- <!-- :style="{'grid-template-columns': `repeat(${lisTnum}, 1fr)`}" -->
- <div v-if="stype2 == 1" class="listBlockS">
- <div
- class="listBlock"
- @click="editFile(item.id, item.folderid)"
- v-for="(item, index) in fileArray"
- :key="index"
- >
- <div class="listBlockTit">
- <div class="listBlockTit">
- <img
- style="width: 28px; height: 28px"
- src="../../../assets/listfolder2.svg"
- alt=""
- />
- <div
- class="listBlockTitZ"
- style="margin-left: 5px; color: #111824"
- >
- {{ item.name }}
- </div>
- </div>
- </div>
- <div class="listDetail">
- <span v-if="!item.detail">{{ lang.noDesc }}~</span>
- <div class="listDetail2" v-else>
- {{ item.detail }}
- </div>
- </div>
- <div class="listBlockTit">
- <div class="owerCon">
- <div
- style="display: flex; align-items: center; margin-right: 14px"
- >
- <img src="../../../assets/owerlogo.png" alt="" />
- <div class="perName">{{ item.username }}</div>
- </div>
- <div
- style="
- display: flex;
- align-items: center;
- margin-right: 10px;
- flex-shrink: 0;
- "
- >
- <img
- v-if="item.juri == 1"
- style="width: 13px"
- src="../../../assets/siyou1.svg"
- alt=""
- />
- <img
- v-if="item.juri == 2"
- style="width: 13px"
- src="../../../assets/siyou2.svg"
- alt=""
- />
- <img
- v-if="item.juri == 3"
- style="width: 13px"
- src="../../../assets/siyou3.svg"
- alt=""
- />
- {{ getJuri(item.juri) }}
- </div>
- <div class="listTag">
- {{ item.subTagName }}
- </div>
- </div>
- <div>
- <el-popover
- placement="bottom-start"
- trigger="hover"
- popper-class="custom-popover"
- visible-arrow
- width="100px"
- >
- <div class="BtnHP">
- <div class="BtnHPDel">
- <!-- <el-button
- @click="editFile(item.id, item.folderid)"
- size="small"
- type="text"
- @mouseover="isHover = true"
- @mouseleave="isHover = false"
- > -->
- <div
- class="btnBh"
- @click="editFile(item.id, item.folderid)"
- @mouseover="isHover = true"
- @mouseleave="isHover = false"
- >
- <img :src="isHover ? look2 : look1" />
- <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{
- lang.view
- }}</span>
- </div>
- <!-- </el-button
- > -->
- <!-- <el-button
- @click="copyFolder(item)"
- size="small"
- type="text"
- v-if="item.isMo == '2'"
- > -->
- <div
- class="btnBh"
- v-if="item.isMo == '2'"
- @click="copyFolder(item)"
- @mouseover="isHover2 = true"
- @mouseleave="isHover2 = false"
- >
- <img :src="isHover2 ? copy1 : copy2" alt="" />
- <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{
- lang.copy
- }}</span>
- </div>
- <!-- </el-button > -->
- </div>
- <div
- v-if="item.userid == userid && item.isMo == '2'"
- style="
- background-color: #e7e7e7;
- width: 100%;
- height: 0.5px;
- margin: 5px 0;
- "
- ></div>
- <div class="BtnHPDel1">
- <!-- <el-button
- @click="deleteFile(item.id, item.folderid)"
- size="small"
- type="text"
- style="color: #DE4C41;"
- v-if="item.userid == userid && item.isMo == '2'"
- > -->
- <div
- class="btnBh2"
- @click="deleteFile(item.id, item.folderid, 1)"
- v-if="item.userid == userid && item.isMo == '2'"
- >
- <img src="../../../assets/listdel.svg" alt="" />
- <span style="color: #de4c41">{{ lang.delete }}</span>
- </div>
- <!-- </el-button
- > -->
- </div>
- </div>
- <el-button
- slot="reference"
- class="BtnH"
- style="border: none; padding: 5px"
- >
- <i class="el-icon-more"></i>
- </el-button>
- </el-popover>
- </div>
- </div>
- </div>
- </div>
- <div v-else class="list_file_box" v-loading.body="isLoading && showBool">
- <el-table
- ref="myTable"
- :data="fileArray"
- border
- style="width: 100%"
- @selection-change="handleSelectionChange"
- max-height="800px"
- :row-key="(row) => row.id"
- >
- <el-table-column
- type="selection"
- width="50px"
- :reserve-selection="true"
- :selectable="isSelectable"
- ></el-table-column>
- <el-table-column
- prop="name"
- :label="lang.folderName"
- show-overflow-tooltip
- min-width="15"
- ></el-table-column>
- <el-table-column
- prop="detail"
- :label="lang.description"
- show-overflow-tooltip
- min-width="20"
- ></el-table-column>
- <el-table-column
- prop="fileCount"
- :label="lang.fileNumber"
- width="120px"
- ></el-table-column>
- <el-table-column
- prop="username"
- :label="lang.owner"
- show-overflow-tooltip
- width="120"
- ></el-table-column>
- <el-table-column
- :label="lang.tag"
- show-overflow-tooltip
- min-width="10"
- >
- <template slot-scope="scope">
- {{ getTag(scope.row) }}
- </template>
- </el-table-column>
- <el-table-column :label="lang.publicPermissions" width="120px">
- <template slot-scope="scope">
- {{ getJuri(scope.row.juri) }}
- </template>
- </el-table-column>
- <el-table-column
- prop="time"
- :label="lang.editTime"
- min-width="15"
- ></el-table-column>
- <el-table-column align="center" width="100px">
- <template slot-scope="scope">
- <div>
- <el-popover
- placement="bottom-start"
- trigger="hover"
- popper-class="custom-popover"
- visible-arrow
- width="100px"
- >
- <div class="BtnHP">
- <div class="BtnHPDel">
- <div
- class="btnBh"
- @click="editFile(scope.row.id, scope.row.folderid)"
- @mouseover="isHover = true"
- @mouseleave="isHover = false"
- >
- <img :src="isHover ? look2 : look1" />
- <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{
- lang.view
- }}</span>
- </div>
- <!-- <el-button
- @click="editFile(scope.row.id, scope.row.folderid)"
- size="small"
- type="text"
- >查看</el-button
- > -->
- <div
- class="btnBh"
- v-if="scope.row.isMo == '2'"
- @click="copyFolder(scope.row)"
- @mouseover="isHover2 = true"
- @mouseleave="isHover2 = false"
- >
- <img :src="isHover2 ? copy1 : copy2" alt="" />
- <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{
- lang.copy
- }}</span>
- </div>
- <!-- <el-button
- @click="copyFolder(scope.row)"
- size="small"
- type="text"
- v-if="scope.row.isMo == '2'"
- >复制</el-button
- > -->
- </div>
- <div
- v-if="scope.row.userid == userid && scope.row.isMo == '2'"
- style="
- background-color: #e7e7e7;
- width: 100%;
- height: 0.5px;
- margin: 5px 0;
- "
- ></div>
- <div class="BtnHPDel1">
- <div
- class="btnBh2"
- @click="deleteFile(scope.row.id, scope.row.folderid)"
- v-if="
- scope.row.userid == userid && scope.row.isMo == '2'
- "
- >
- <img src="../../../assets/listdel.svg" alt="" />
- <span style="color: #de4c41">{{ lang.delete }}</span>
- </div>
- <!-- <el-button
- @click="deleteFile(scope.row.id, scope.row.folderid)"
- size="small"
- type="text"
- style="color: #DE4C41;"
- v-if="scope.row.userid == userid && scope.row.isMo == '2'"
- >删除</el-button
- > -->
- </div>
- </div>
- <el-button
- slot="reference"
- class="BtnH"
- style="border: none; background: none; padding: 5px"
- >
- <i class="el-icon-more"></i>
- </el-button>
- </el-popover>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="paginationArea">
- <span>{{ lang.a_total_of_x_items.replace('${x}',total) }}</span>
- <el-pagination
- class="pageBox"
- style="margin-top: 10px"
- layout="prev, pager, next, slot"
- :page-size="limit"
- :total="total"
- @current-change="handleCurrentChange"
- :page-sizes="[10, 20, 50, 100]"
- >
- <el-select
- v-model="limit"
- @change="handleSizeChange"
- class="file_mySelect"
- >
- <el-option
- v-for="item in [10, 20, 50, 100]"
- :key="item"
- :label="item"
- :value="item"
- ></el-option>
- </el-select>
- </el-pagination>
- </div>
- </div>
- <el-dialog
- :title="lang.newFolder"
- :visible.sync="moveBox"
- width="550px"
- style="border-radius: 8px"
- @close="moveBox = false"
- class="canEditCss"
- >
- <div class="canEditTit" slot="title">
- <img src="../../../assets/listfolder2.svg" alt="" />
- <span>{{ lang.newFolder }}</span>
- </div>
- <div>
- <el-input
- v-model="folderName"
- :placeholder="lang.knowledgeName"
- ></el-input>
- <el-input
- v-model="folderDescription"
- type="textarea"
- rows="4"
- resize="none"
- :placeholder="lang.knowledgeDesc"
- style="margin-top: 10px"
- ></el-input>
- </div>
- <span slot="footer">
- <el-button @click="moveBox = false">{{ lang.cancel }}</el-button>
- <el-button type="primary" @click="createFolder(2)" v-loading="addLoading">{{
- lang.confirm
- }}</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import officeImg from "../../../assets/icon/sourceFile/office.png";
- import pdfImg from "../../../assets/icon/sourceFile/pdf.png";
- import videoImg from "../../../assets/icon/sourceFile/video.png";
- import otherImg from "../../../assets/icon/sourceFile/other.png";
- import checkImg from "../../../assets/icon/sourceFile/check.png";
- import checkIsImg from "../../../assets/icon/sourceFile/check_is.png";
- import wVideo from "../test/file/wVideo.vue";
- import wpdf from "../test/file/wPdf2.vue";
- import wOffice from "../test/file/wOffice.vue";
- // 导入SVG组件
- import look1 from "../../../assets/look1.svg";
- import look2 from "../../../assets/look2.svg";
- import copy2 from "../../../assets/copy2.svg";
- import copy1 from "../../../assets/copy1.svg";
- import JSZip from "jszip";
- import FileSaver from "file-saver";
- import _ from "lodash";
- const getFile = (url) => {
- return new Promise((resolve, reject) => {
- var credentials = {
- accessKeyId: "AKIATLPEDU37QV5CHLMH",
- secretAccessKey: "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",
- }; //秘钥形式的登录上传
- window.AWS.config.update(credentials);
- window.AWS.config.region = "cn-northwest-1"; //设置区域
- let url2 = url;
- let _url2 = "";
- if (
- url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
- ) {
- _url2 = url2.split(
- "https://view.officeapps.live.com/op/view.aspx?src="
- )[1];
- } else {
- _url2 = url2;
- }
- var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
- let name = decodeURIComponent(
- _url2
- .split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
- .replace(/\+/g, " ")
- );
- var params = {
- Bucket: "ccrb",
- Key: name,
- };
- s3.getObject(params, function (err, data) {
- if (err) {
- console.log(err, err.stack);
- resolve({ data: 1 });
- } else {
- resolve({ data: data.Body });
- console.log(data);
- } // sxuccessful response
- });
- // axios({
- });
- };
- export default {
- components: {
- wVideo,
- wpdf,
- wOffice,
- },
- props: {
- userid: {
- type: String,
- },
- typeArray: {
- type: Array,
- },
- pid: {
- type: String,
- },
- type: {
- type: String,
- },
- showBool: {
- type: Boolean,
- default: false,
- },
- },
- watch: {
- pid: {
- immediate: true,
- deep: true,
- handler(newValue, oldValue) {
- this.fileArray = [];
- this.checkArray = [];
- this.fileName = "";
- this.page = 1;
- this.getData();
- this.getTagArray(1);
- this.getTagArray(2);
- this.getTagArray(3);
- },
- },
- },
- data() {
- return {
- look1: look1,
- look2: look2,
- copy2: copy2,
- copy1: copy1,
- isHover: false,
- isHover2: false,
- delLoading: false,
- isLoading: false,
- proVisible: false,
- stype: 2,
- fileArray: [],
- officeImg: officeImg,
- pdfImg: pdfImg,
- videoImg: videoImg,
- otherImg: otherImg,
- checkImg: checkImg,
- checkIsImg: checkIsImg,
- checkArray: [],
- checkArray2: [],
- dialogVisiblePdf: false,
- dialogVisibleVideo: false,
- dialogVisibleOffice: false,
- wurl: "",
- moveBox: false,
- checkTypeArray: [],
- moveChild: "",
- fileName: "",
- folderName: "",
- folderDescription: "",
- page: 1,
- total: 0,
- limit: 20,
- tagLoading1: false,
- tagLoading2: false,
- tagLoading3: false,
- tagData1: [],
- tagData2: [],
- tagData3: [],
- check1: [],
- check2: [],
- check3: [],
- stype2: 1,
- userArray: [],
- user: "",
- addLoading: false,
- };
- },
- computed: {
- lisTnum() {
- if (this.fileArray.length >= 9 || this.fileArray.length > 2) {
- return 4;
- } else if (this.fileArray.length <= 2) {
- return 2;
- } else if (this.fileArray.length <= 1) {
- return 1;
- }
- },
- retrunType() {
- return function (item) {
- if (item.type == 1) {
- return this.lang.office;
- } else if (item.type == 2) {
- return this.lang.video;
- } else if (item.type == 3) {
- return this.lang.img;
- } else if (item.type == 4) {
- return this.lang.pdf;
- } else if (item.type == 5) {
- return this.lang.other;
- }
- };
- },
- getJuri() {
- return function (juri) {
- if (juri == 1) {
- return this.lang.private;
- } else if (juri == 2) {
- return this.lang.organization;
- } else if (juri == 3) {
- return this.lang.public;
- }
- };
- },
- getTag() {
- return function (row) {
- const tags = [row.classTagName, row.subTagName, row.tag]
- .filter((tag) => tag) // 过滤掉空值
- .flatMap((tag) => tag.split(",")); // 展开并分割
- return tags.length ? tags.join(",") : "-";
- };
- },
- },
- methods: {
- checkStype2(type) {
- if (this.stype2 != type) {
- this.checkArray = [];
- this.stype2 = type;
- }
- },
- getTagArray(type) {
- const tagLoadings = [
- this.tagLoading1,
- this.tagLoading2,
- this.tagLoading3,
- ];
- tagLoadings[type - 1] = true;
- let params = {
- type: type,
- uid: this.userid,
- };
- this.ajax
- .post(this.$store.state.api + "getKnowledgeTag", [params])
- .then((res) => {
- tagLoadings[type - 1] = false;
- let _data = res.data[0];
- _data.forEach((i) => {
- if (this.lang.lang == "en" && i.com) {
- i.name = i.com;
- } else if (this.lang.lang == "hk" && i.hk) {
- i.name = i.hk;
- }
- });
- this[`tagData${type}`] = _data;
- const checkKey = `check${type}`;
- // this[checkKey] = this[checkKey].filter(tag =>
- // this[`tagData${type}`].some(item => item.id === tag)
- // );
- })
- .catch((err) => {
- tagLoadings[type - 1] = false;
- console.error(err);
- });
- },
- handleCurrentChange(val) {
- this.page = val;
- this.getData();
- },
- handleSizeChange(val) {
- this.page = 1;
- this.limit = val;
- this.getData();
- },
- getData() {
- let type = this.pid.split("/");
- let id = this.userid;
- this.isLoading = true;
- let params = {
- uid: id,
- n: this.fileName.trim(),
- sub: this.check1,
- class: this.check2,
- tag: type[0] == "0" ? this.check3 : this.user,
- page: this.page,
- num: this.limit,
- };
- if(!type[0] == "0"){
- params.juri2 = this.lang.lang == 'hk' ? 2 : this.lang.lang == 'en' ? 3 : 1;
- }
- this.ajax
- .post(
- this.$store.state.fileApi +
- (type[0] == "0" ? "getFolderPage3" : "getFolderPageOpen2"),
- [params]
- )
- .then((res) => {
- this.isLoading = false;
- this.total = res.data[0].length ? res.data[0][0].num : 0;
- let _fileArray = res.data[0];
- _fileArray.forEach((i) => {
- if (i.isMo == '1') {
- i.name = this.lang.defaultFolder;
- i.detail = this.lang.defaultFolderDesc;
- }
- if (this.lang.lang == "en" && i.subTagNameCom) {
- i.subTagName = i.subTagNameCom;
- } else if (this.lang.lang == "hk" && i.subTagNameHk) {
- i.subTagName = i.subTagNameHk;
- }
- });
- this.fileArray = _fileArray;
- if (type[0] == "0" && res.data[1].length == 0) {
- this.folderName = this.lang.defaultFolder;
- this.folderDescription = this.lang.defaultFolderDesc;
- this.createFolder(1);
- }
- if (res.data[2].length != 0) {
- this.userArray = res.data[2];
- }
- this.$parent.getData();
- this.$forceUpdate();
- })
- .catch((err) => {
- this.isLoading = false;
- console.error(err);
- });
- },
- debouncedSearch() {
- clearTimeout(this.debounceTimeout);
- this.debounceTimeout = setTimeout(() => {
- this.serchFile();
- }, 300);
- },
- serchFile() {
- this.page = 1;
- this.getData();
- },
- handleSelectionChange(selectedRows) {
- this.checkArray = selectedRows.map((row) => row.id);
- this.checkArray2 = selectedRows.map((row) => ({
- id: row.id,
- folderid: row.folderid,
- }));
- },
- deleteFile(id, folderid, val) {
- this.$confirm(this.lang.confirmDelete, this.lang.prompt, {
- confirmButtonText: this.lang.confirm,
- cancelButtonText: this.lang.cancel,
- type: "warning",
- })
- .then(() => {
- this.delLoading = true;
- let params = [{ ids: id, folderids: folderid }];
- this.ajax
- .post(this.$store.state.fileApi + "deleteFolder", params)
- .then((res) => {
- this.delLoading = false;
- this.$message({
- message: this.lang.deleteSuccess,
- type: "success",
- });
- this.checkArray = [];
- this.checkArray2 = [];
- if (val != 1) {
- this.$refs.myTable.clearSelection();
- }
- this.getData();
- })
- .catch((err) => {
- this.delLoading = false;
- this.$message.error(this.lang.deleteFail);
- console.error(err);
- });
- })
- .catch(() => {});
- },
- copyFolder(data) {
- this.isLoading = true;
- let params = [
- {
- n: data.name,
- fd: data.detail,
- uid: this.userid,
- folderid: data.folderid,
- },
- ];
- this.ajax
- .post(this.$store.state.fileApi + "copyFolder", params)
- .then((res) => {
- this.isLoading = false;
- this.$message({
- message: this.lang.copySuccess,
- type: "success",
- });
- this.getData();
- })
- .catch((err) => {
- this.isLoading = false;
- this.$message.error(this.lang.copyFail);
- console.error(err);
- });
- },
- deleteFolder() {
- if (!this.checkArray.length) {
- this.$message.warning(this.lang.selectDeFolder);
- return;
- }
- let array = this.checkArray2.map((item) => item.id);
- let array2 = this.checkArray2.map((item) => item.folderid);
- this.deleteFile(array.join(","), array2.join(","));
- },
- checkMoveChild(item) {
- this.moveChild = item;
- },
- openAdd() {
- this.folderName = "";
- this.folderDescription = "";
- this.moveBox = true;
- },
- createFolder: _.debounce(function(im) {
- if (!this.folderName) {
- this.$message.error(this.lang.folderNameMust);
- return;
- }
- if (this.addLoading) {
- return;
- }
- this.addLoading = true;
- let params = [
- {
- n: this.folderName,
- fd: this.folderDescription,
- uid: this.userid,
- im: im ? im : 2,
- },
- ];
- this.ajax
- .post(this.$store.state.fileApi + "addFolder", params)
- .then((res) => {
- this.moveBox = false;
- this.addLoading = false;
- this.$message({
- message: this.lang.createSuccess,
- type: "success",
- });
- this.getData();
- })
- .catch((err) => {
- this.addLoading = false;
- this.$message.error(this.lang.createFail);
- console.error(err);
- });
- }, 500),
- editFile(id, folderid) {
- console.log(id);
- let array = [this.pid.split("/")[0], id];
- this.$emit("checkType", array.join("/"), folderid);
- },
- isSelectable(row) {
- return row.isMo == "2" && row.userid == this.userid;
- },
- },
- mounted() {
- // this.getData();
- },
- };
- </script>
- <style scoped>
- .listBlockS {
- display: grid;
- font-family: PingFang;
- gap: 20px;
- grid-template-columns: repeat(4, 1fr);
- -webkit-box-align: stretch;
- align-items: stretch;
- }
- .listBlock {
- flex: 1;
- min-width: 250px;
- user-select: none;
- height: 150px;
- cursor: pointer;
- box-sizing: border-box;
- border: 1px solid #dfe2ea;
- /* margin-top: 1.25rem; */
- border-radius: 0.75rem;
- background-color: #fff;
- box-shadow: 0px 4px 4px 0px rgba(19, 51, 107, 0.05),
- 0px 0px 1px 0px rgba(19, 51, 107, 0.08);
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- padding: 20px 20px 12px;
- }
- .listBlock:hover {
- border-color: #94b5ff;
- box-shadow: 0px 1px 2px 0px rgba(19, 51, 107, 0.1),
- 0px 0px 1px 0px rgba(19, 51, 107, 0.15);
- }
- .listBlockTit {
- display: flex;
- font-size: 16px;
- justify-content: space-between;
- align-items: center;
- overflow: hidden;
- }
- .listBlockTitZ {
- min-width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .owerCon {
- display: flex;
- align-items: center;
- font-size: 12px;
- color: #667085;
- width: 80%;
- }
- .owerCon img {
- width: 16px;
- margin-right: 5px;
- }
- .listDetail {
- /* height: 100%; */
- height: 45px;
- font-size: 12.8px;
- color: #667085;
- padding: 12px 0;
- }
- .listDetail2 {
- -webkit-line-clamp: 2;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .f_box {
- width: 100%;
- /* height: 100%; */
- height: calc(100% - 58px);
- margin-top: 16px;
- border-radius: 8px;
- padding-bottom: 0 !important;
- box-sizing: border-box;
- position: relative;
- overflow: auto;
- }
- .f_box_top {
- display: flex;
- align-items: center;
- padding: 0;
- width: 100%;
- box-sizing: border-box;
- padding-bottom: 0;
- }
- .f_box_top_left {
- display: flex;
- align-items: center;
- }
- .f_box_top_title {
- /* font-size: 16px; */
- color: rgba(8, 13, 30, 0.9);
- font-size: 20px;
- font-style: normal;
- font-weight: 500;
- /* line-height: 32px; */
- /* font-weight: bold; */
- }
- .f_box_top .btn {
- display: flex;
- cursor: pointer;
- align-items: center;
- height: 30px;
- padding: 0 8px;
- background: rgb(0, 97, 255);
- color: #fff;
- box-sizing: border-box;
- border-radius: 4px;
- font-size: 14px;
- align-items: center;
- }
- .f_box_top .btn2 {
- display: flex;
- cursor: pointer;
- align-items: center;
- height: 30px;
- padding: 0 8px;
- background: #fff;
- color: rgb(0, 97, 255);
- border: 1px solid rgb(0, 97, 255);
- box-sizing: border-box;
- border-radius: 4px;
- font-size: 14px;
- align-items: center;
- }
- .f_box_top .delBtn {
- background: rgb(255, 0, 13);
- }
- .f_box_top .btn + .btn2,
- .f_box_top .btn + .btn,
- .f_box_top .btn2 + .btn2,
- .f_box_top .btn2 + .delBtn {
- margin-left: 15px;
- }
- .f_box_top_right {
- margin-left: auto;
- /* max-width: calc(100% - 280px); */
- overflow: hidden;
- display: flex;
- align-items: center;
- }
- .f_box_top_right >>> .el-icon-plus:before {
- font-size: 14px;
- font-weight: 600;
- /* vertical-align: middle; */
- }
- .f_box_top_right >>> .el-button {
- height: 35px !important;
- font-size: 12.8px;
- background-color: #3370ff;
- border-radius: 6px;
- margin-left: 12px;
- }
- .f_box_top_right >>> .el-button--primary:focus,
- .f_box_top_right >>> .el-button--primary:hover {
- filter: brightness(120%);
- }
- .f_box_top_right > .input {
- position: relative;
- height: 40px;
- display: flex;
- align-items: center;
- }
- .f_box_top_right > .input > input {
- width: 100%;
- height: 100%;
- border: 1px solid #dcdfe6;
- border-radius: 5px;
- padding: 0 15px 0 45px;
- box-sizing: border-box;
- font-size: 14px;
- width: 250px;
- height: 36px;
- font-size: 12.8px;
- border-radius: 6px;
- outline: none;
- }
- .f_box_top_right > .input > .serch {
- content: "";
- display: block;
- width: 20px;
- height: 20px;
- background-image: url("../../../assets/icon/sourceFile/search.png");
- background-size: 100% 100%;
- position: absolute;
- left: 13px;
- top: 50%;
- transform: translateY(-50%);
- cursor: pointer;
- }
- .f_box_top_right > .tab {
- height: 30px;
- width: 80px;
- margin-left: 15px;
- background: #e7e7e7;
- border: 2px solid #d9d9d9;
- border-radius: 5px;
- box-sizing: border-box;
- overflow: hidden;
- display: flex;
- align-items: center;
- }
- .f_box_top_right > .tab > .table,
- .f_box_top_right > .tab > .list {
- width: 50%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- }
- .f_box_top_right > .tab > .list::before {
- content: "";
- display: block;
- width: 20px;
- height: 20px;
- background-image: url("../../../assets/icon/sourceFile/list.png");
- background-size: 100% 100%;
- }
- .f_box_top_right > .tab > .list.active,
- .f_box_top_right > .tab > .table.active {
- background: #fff;
- }
- .f_box_top_right > .tab > .table::before {
- content: "";
- display: block;
- width: 20px;
- height: 20px;
- background-image: url("../../../assets/icon/sourceFile/table.png");
- background-size: 100% 100%;
- }
- .mask {
- /* background-color: rgb(0 0 0 / 30%); */
- /* position: fixed; */
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 90;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .progressBox {
- width: 300px;
- height: 150px;
- background: #fff;
- border-radius: 10px;
- box-shadow: 0 0 6px 1px #bfbfbf;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- color: #6c6c6c;
- }
- .progressBox >>> .el-progress-bar__outer {
- background-color: #d1dfff !important;
- }
- .progressBox .lbox {
- height: 50px;
- font-size: 19px;
- display: flex;
- align-items: center;
- color: #747474;
- }
- .progressBox .lbox img {
- width: 40px;
- margin-right: 20px;
- }
- .closeCss {
- position: absolute;
- top: 8px;
- right: 8px;
- cursor: pointer;
- width: 20px;
- height: 20px;
- }
- .closeCss > img {
- width: 100%;
- height: 100%;
- }
- .f_box_file_square {
- height: calc(100% - 55px);
- overflow: auto;
- width: 100%;
- padding: 55px;
- box-sizing: border-box;
- display: flex;
- flex-wrap: wrap;
- align-content: flex-start;
- position: relative;
- }
- .f_box_file_square > .f_box_file {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 160px;
- height: 160px;
- cursor: pointer;
- margin: 0 36px 36px 0;
- border-radius: 20px;
- position: relative;
- }
- .f_box_file_square > .f_box_file:hover {
- background: #f0f2f5;
- }
- .f_box_file_square > .f_box_file:hover > .check {
- display: block;
- }
- .f_box_file_square > .f_box_file.check {
- background: #e0eafb;
- }
- .f_box_file_square > .f_box_file.check > .check {
- display: block;
- }
- .f_box_file_square > .f_box_file > .check {
- position: absolute;
- left: 15px;
- top: 15px;
- width: 16px;
- height: 16px;
- background-size: 100%;
- display: none;
- }
- .f_box_file_square > .f_box_file > .check > img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .f_box_file_square > .f_box_file > img {
- width: 90px;
- height: 90px;
- object-fit: cover;
- }
- .f_box_file_square > .f_box_file > .name {
- white-space: nowrap;
- font-size: 14px;
- max-width: 80%;
- overflow: hidden;
- margin: 4px auto 0;
- text-overflow: ellipsis;
- text-align: center;
- }
- .f_box_file_list {
- /* height: calc(100% - 55px); */
- /* overflow: auto; */
- width: 100%;
- padding: 10px 0;
- padding-top: 0;
- margin-top: 10px;
- border-radius: 8px;
- box-sizing: border-box;
- }
- .f_box_file_allCheck {
- display: flex;
- align-items: center;
- position: absolute;
- font-size: 14px;
- top: 20px;
- left: 10px;
- cursor: pointer;
- }
- .f_box_file_allCheck > img {
- width: 16px;
- height: 16px;
- object-fit: cover;
- margin-right: 5px;
- }
- .canEditCss >>> .el-dialog__body {
- padding: 10px 20px;
- }
- .canEditCss >>> .el-dialog__header {
- background-color: rgb(251, 251, 252);
- border-radius: 8px 8px 0 0;
- font-family: Pingfang;
- border-bottom: 0.5px rgb(244, 246, 248) solid;
- }
- .canEditCss >>> .el-dialog {
- border-radius: 8px;
- width: 500px !important;
- }
- .type_nav_box {
- }
- .type_nav_box > .nav {
- height: 40px;
- border-radius: 5px;
- cursor: pointer;
- display: flex;
- align-items: center;
- width: 100%;
- padding: 0 10px;
- box-sizing: border-box;
- margin-bottom: 10px;
- font-size: 16px;
- color: #000;
- }
- .type_nav_box > .nav > .down {
- min-width: 14px;
- height: 14px;
- background-image: url("../../../assets/icon/sourceFile/icon_arrow.png");
- background-size: 100% 100%;
- margin-right: 10px;
- transition: all 0.3s;
- transform: rotate(-90deg);
- }
- .type_nav_box > .nav.active > .down {
- transform: rotate(0deg);
- }
- .type_nav_box > .nav > .file {
- min-width: 18px;
- height: 18px;
- background-image: url("../../../assets/icon/sourceFile/file.png");
- background-size: 100% 100%;
- margin-right: 10px;
- }
- .type_nav_box > .nav > .name {
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .type_nav_box > .child {
- }
- .type_nav_box > .child > .nav {
- height: 40px;
- border-radius: 5px;
- cursor: pointer;
- display: flex;
- align-items: center;
- width: 100%;
- padding: 0 10px 0 50px;
- box-sizing: border-box;
- margin-bottom: 10px;
- font-size: 16px;
- color: #000;
- }
- .type_nav_box > .child > .nav.active {
- background: #e0eafb;
- }
- .type_nav_box > .child > .nav > .file {
- min-width: 18px;
- height: 18px;
- background-image: url("../../../assets/icon/sourceFile/file.png");
- background-size: 100% 100%;
- margin-right: 10px;
- }
- .type_nav_box > .child > .nav > .name {
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .none_box {
- height: calc(100% - 55px);
- overflow: auto;
- width: 100%;
- padding: 10px;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .list_file_box {
- width: 100%;
- }
- .list_file_box >>> .el-table {
- border-radius: 10px !important;
- overflow: hidden !important;
- }
- .list_file_box >>> table th {
- border: none !important;
- background-color: #f2f3f6 !important; /* 浅灰色背景 */
- color: #00000099 !important;
- }
- .list_file_box >>> table tr td {
- border: none !important;
- border-bottom: 1px solid #ebeef5 !important;
- }
- .list_file_box >>> table tr {
- border: 1px #000 solid !important;
- }
- .list_file_box >>> .el-table__header-wrapper {
- margin-bottom: 10px !important;
- }
- .list_file_box >>> .el-table__row {
- border: 1px #ccc solid;
- }
- .list_file_box >>> table tr td:nth-child(1) {
- border-radius: 10px 0 0 10px !important;
- }
- .list_file_box >>> table tr td:nth-last-child(1) {
- border-radius: 0 10px 10px 0 !important;
- }
- .list_file_box >>> table tr th:nth-child(1) {
- border-radius: 10px 0 0 10px;
- }
- .list_file_box >>> table tr th:nth-last-child(2) {
- border-radius: 0 10px 10px 0 !important;
- }
- .list_file_box >>> .el-table::before {
- background-color: #fff;
- }
- .list_file_box >>> .el-table--border::after {
- background-color: #fff;
- }
- .list_file_box >>> .el-table--border {
- border: none;
- border-bottom: 1px solid #ebeef5;
- }
- .BtnH >>> .el-button {
- padding: 5px !important;
- width: 30px !important;
- color: #4c5567;
- }
- .BtnH >>> .el-button:focus,
- .BtnH >>> .el-button:hover {
- background: #e8ebf0 !important;
- color: #487fff !important;
- }
- .BtnH >>> .el-button--small,
- .el-button--small.is-round {
- border: none;
- padding: 0;
- }
- .BtnHP {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .BtnHP >>> .el-button:focus,
- .BtnHP >>> .el-button:hover {
- background-color: #487fff;
- }
- .BtnHP >>> .el-popper .popper__arrow,
- .el-popper .popper__arrow::after {
- display: none;
- }
- .BtnHP >>> .el-button--text {
- color: #667095;
- }
- .BtnHP img {
- width: 16px;
- }
- /* 删除 */
- .BtnHPDel1 {
- display: flex;
- flex-direction: column;
- justify-content: center;
- color: #de4c41 !important;
- }
- .BtnHPDel1 >>> .el-button:focus,
- .BtnHPDel1 >>> .el-button:hover {
- background: #fbeae8;
- color: #de4c41 !important;
- }
- /* .BtnHPDel1{
- display: flex;
- flex-direction: column;
- justify-content: center;
- } */
- .BtnHPDel {
- display: flex;
- flex-direction: column;
- flex-wrap: wrap;
- justify-content: center;
- }
- .BtnHPDel >>> .el-button + .el-button {
- padding: 0;
- }
- .BtnHPDel >>> .el-button:focus,
- .BtnHPDel >>> .el-button:hover {
- background: #e8ebf0 !important;
- }
- /* .BtnHPDel >>> .el-button:hover .lookHp{
- } */
- .lookHp2 {
- color: #6c6c6c;
- }
- .lookHp2 {
- color: #487fff;
- }
- .left {
- display: flex;
- align-items: center;
- margin-left: auto;
- }
- .left > span {
- height: 25px;
- width: 25px;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 5px;
- cursor: pointer;
- }
- .left > span + span {
- margin-left: 10px;
- }
- .left > span.active {
- background: #e0eafb;
- }
- .left > span::before {
- content: "";
- width: 12px;
- height: 12px;
- background-size: 100% 100%;
- }
- .left > span.list::before {
- background-image: url("../../../assets/test_list.png");
- }
- .left > span.table::before {
- background-image: url("../../../assets/test_table.png");
- }
- .left > span.table.active::before {
- background-image: url("../../../assets/test_table_active.png");
- }
- .left > span.list.active::before {
- background-image: url("../../../assets/test_list_active.png");
- }
- .pageBox {
- display: flex;
- }
- .pageBox >>> .el-pagination__total {
- margin-right: auto;
- }
- .btnBh:hover {
- background: #f0f4ff;
- }
- .btnBh img {
- margin-right: 5px;
- width: 17px;
- }
- .btnBh2 img {
- width: 17px;
- margin-right: 5px;
- padding: 1.5px;
- box-sizing: border-box;
- }
- .btnBh2:hover {
- background: #fbeae8;
- }
- .listTag {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .f_box_file_list >>> .el-table-column--selection .cell {
- display: flex !important;
- align-items: center !important;
- }
- .perName {
- flex-shrink: 0;
- min-width: 30px;
- max-width: 47px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .btnBh2 {
- display: flex;
- /* align-items: center; */
- cursor: pointer;
- padding: 5px 8px;
- border-radius: 6px;
- box-sizing: border-box;
- }
- .btnBh {
- display: flex;
- cursor: pointer;
- border-radius: 6px;
- padding: 5px 8px;
- }
- .canEditTit {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .canEditTit img {
- width: 25px;
- margin-right: 10px;
- }
- .paginationArea{
- width: 100%;
- height: auto;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .paginationArea>span{
- font-size: 13px;
- color: #606266;
- }
- </style>
- <style>
- .custom-popover {
- min-width: 70px !important;
- width: auto !important;
- padding: 8px 6px;
- border-radius: 8px;
- }
- /* .custom-popover2 {
- min-width: 18px !important;
- width: auto !important;
- padding: 8px;
- top: 414px !important;
- text-align: center;
- } */
- </style>
|