| | |
| | | import { Message } from "element-ui"; |
| | | import store from "@/store"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | import router from "../router" |
| | | // create an axios instance |
| | | const service = axios.create({ |
| | | baseURL: BASE_URL, // apiçbase_url |
| | |
| | | config.headers["token"] = token; |
| | | } |
| | | |
| | | if (config.url.indexOf("logout") != -1 && config.url.indexOf("login") != -1) { |
| | | var expire = JSON.parse(window.localStorage.getItem("LFToken")).expire; |
| | | var timeire = new Date().getTime(); |
| | | if (timeire >= expire) { |
| | | |
| | | this.$router.push("logout") |
| | | } |
| | | } |
| | | |
| | | |
| | | //å è½½loading |
| | | store.commit("UPDATE_API_COUNT", "add"); |
| | |
| | | } |
| | | ); service.interceptors.response.use( |
| | | (response) => { |
| | | if (window.localStorage.getItem("LFToken") != null) { |
| | | var expire = JSON.parse(window.localStorage.getItem("LFToken")).expire; |
| | | var timeire = new Date().getTime(); |
| | | if (timeire >= expire) { |
| | | |
| | | router.push('/login') |
| | | localStorage.removeItem("LFToken"); |
| | | } |
| | | } |
| | | |
| | | store.commit("UPDATE_API_COUNT", "sub"); |
| | | //console.log(response) |
| | | //è¿åå æResponeType===Blob ,åå¼å¤ç |
| | |
| | | label: 'ä¸å¡æ°æ®', |
| | | value: 'BS', |
| | | children: [], |
| | | }, { |
| | | id: 3, |
| | | tabDesc: 'å
æ°æ®', |
| | | label: 'å
æ°æ®', |
| | | value: 'MD', |
| | | children: [], |
| | | }, |
| | | ], |
| | | tableAttach: [], |
| | |
| | | var val; |
| | | |
| | | if (this.formSql.type == "long" || this.formSql.type == "integer") { |
| | | |
| | | val = parseInt(this.formSql.value); |
| | | } else if (this.formSql.type == 'double') { |
| | | |
| | |
| | | old_dirDat: [], //elæ æ°æ®(æå¨å) |
| | | newData: [], //æå¨ååå§æ°æ® |
| | | itemdetail: {}, |
| | | itemaName: null, |
| | | backUpData: '', |
| | | formLabelWidth: '150px', |
| | | delChildID: '', |
| | |
| | | this.oriData = res.result; |
| | | this.newData = res.result; |
| | | this.dirList = this.treeData(res.result); |
| | | // this.$nextTick(() => { |
| | | |
| | | if (this.itemdetail.id != null) { |
| | | // this.expandData=[15] |
| | | // this.$refs.tree.setCurrentKey(15); |
| | | |
| | | // }); |
| | | if (this.itemaName != null) { |
| | | this.$nextTick(() => { |
| | | |
| | | // this.expandData=[1] |
| | | // this.$refs.tree.setCurrentKey(this.itemdetail.id); |
| | | // document.getElementById(this.itemdetail.id).click(); |
| | | this.expandData = [this.itemaName] |
| | | this.$refs.tree.setCurrentKey(this.itemaName); |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | if (res == 1) {//æ°å¢å级 |
| | | id = this.itemdetail.pid; |
| | | orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes) |
| | | |
| | | lever = this.itemdetail.level; |
| | | } else if (res == 2) {//æ°å¢å级 |
| | | id = this.itemdetail.id; |
| | | orderNum = this.getMaxOrderNum(this.newNode.childNodes) |
| | | |
| | | lever = this.itemdetail.level + 1; |
| | | } |
| | | |
| | |
| | | .then((res) => { |
| | | setTimeout(() => { |
| | | this.fullscreenLoading = false; |
| | | |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: 'æ·»å æå', |
| | | type: 'success', |
| | | }); |
| | | |
| | | this.itemaName = res.result; |
| | | this.itemdetail = {}; |
| | | this.ruleForm = {}; |
| | | this.dialogFormVisible = false; |
| | |
| | | }); |
| | | }, |
| | | remove(node, data) { |
| | | this.itemaName =node.parent.data.id; |
| | | |
| | | this.$confirm('æ¤æä½å°å é¤è¯¥èç¹, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | |
| | | message: 'å 餿å!', |
| | | }); |
| | | this.itemdetail = {}; |
| | | |
| | | this.getDirTree(); |
| | | } else if (res[0].code == 200) { |
| | | this.$message.error('å 餿åï¼ä½ç½®è°æ´å¤±è´¥'); |
| | |
| | | }, |
| | | handleNodeClick(data, node) { |
| | | // console.log(data); |
| | | |
| | | this.newNode = node; |
| | | this.backUpData = JSON.stringify(data); |
| | | this.itemdetail = JSON.parse(JSON.stringify(data)); |
| | |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | <el-dialog |
| | | :close-on-click-modal="false" |
| | | title="ä¸ä¼ è¿åº¦" |
| | | :visible.sync="jindudialogVisible" |
| | | width="30%"> |
| | | <div> |
| | | <div> |
| | | æä»¶ä¼ è¾è¿åº¦ï¼ |
| | | </div> |
| | | <div> |
| | | <el-progress :percentage="jindutiao" :format="format"></el-progress> |
| | | </div> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | download: false, |
| | | |
| | | }, |
| | | jindutiao: 0, |
| | | jindudialogVisible: false, |
| | | jindutiaoname: [] |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | const that = this |
| | | that.jindudialogVisible = true |
| | | let listval = [] |
| | | formData.forEach((key, val) => { |
| | | listval.push({ |
| | | name: val |
| | | }) |
| | | }) |
| | | that.$set(this, 'jindutiaoname', listval) |
| | | that.$set(this, 'jindutiao', 0) |
| | | this.loading = true; |
| | | $.ajax(BASE_URL + "/dataUpload/uploadFiles?token=" + token + "&path=" + this.formInline.path, { |
| | | type: "post", |
| | |
| | | return this.$message.error('æ°æ®ä¸ä¼ 失败'); |
| | | } |
| | | this.getFileLength(); |
| | | this.$set(this, 'jindutiao', 100) |
| | | this.$message({ |
| | | message: 'ä¸ä¼ æå', |
| | | type: 'success' |
| | |
| | | error: (rs) => { |
| | | this.loading = false; |
| | | this.$message.error('æ°æ®ä¸ä¼ 失败'); |
| | | }, |
| | | xhr: function () { |
| | | var myXhr = $.ajaxSettings.xhr(); |
| | | if (myXhr.upload) { //æ£æ¥upload屿§æ¯å¦åå¨ |
| | | myXhr.upload.addEventListener('progress', that.progressHandlingFunction, false); //ç»å®progressäºä»¶çåè°å½æ° |
| | | } |
| | | return myXhr; //xhr对象è¿åç»jQueryä½¿ç¨ |
| | | } |
| | | }); |
| | | }, |
| | | progressHandlingFunction(event) { |
| | | var loaded = event.loaded;//å·²ä¸ä¼ |
| | | var loaded = Math.floor(100 * (event.loaded / event.total) - 1); //计ç®å·²ç»ä¸ä¼ çç¾åæ¯ |
| | | $("#prog").html(loaded + "%"); //åºç¨å°æ¾ç¤ºUIï¼å¯æ ¹æ®èªå·±éè¦ä¿®æ¹ |
| | | this.jindutiao = loaded |
| | | this.$set(this, 'jindutiao', loaded) |
| | | }, |
| | | format(percentage) { |
| | | return percentage === 100 ? 'ä¸ä¼ 宿¯' : `${percentage}%`; |
| | | }, |
| | | //è·åæä»¶ä¸ä¼ è·¯å¾ |
| | | async getFilePath() { |
| | | const res = await dataUploadSelectPath(); |