Merge branch 'master' of https://gitee.com/lolicode/scui into v2
This commit is contained in:
commit
3b2482e492
46
package.json
46
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "scui",
|
"name": "scui",
|
||||||
"version": "1.6.3",
|
"version": "1.6.9",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
|
@ -8,41 +8,41 @@
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "2.0.4",
|
"@element-plus/icons-vue": "2.0.10",
|
||||||
"@tinymce/tinymce-vue": "5.0.0",
|
"@tinymce/tinymce-vue": "5.0.0",
|
||||||
"axios": "0.27.2",
|
"axios": "1.3.4",
|
||||||
"codemirror": "5.65.5",
|
"codemirror": "5.65.5",
|
||||||
"core-js": "3.22.8",
|
"core-js": "3.29.0",
|
||||||
"cropperjs": "1.5.12",
|
"cropperjs": "1.5.13",
|
||||||
"crypto-js": "4.1.1",
|
"crypto-js": "4.1.1",
|
||||||
"d3": "^7.6.1",
|
"d3": "^7.6.1",
|
||||||
"dagre": "^0.8.5",
|
"dagre": "^0.8.5",
|
||||||
"dagre-d3": "^0.6.4",
|
"dagre-d3": "^0.6.4",
|
||||||
"echarts": "5.3.2",
|
|
||||||
"element-plus": "2.2.3",
|
|
||||||
"json-editor-vue3": "^1.0.6",
|
"json-editor-vue3": "^1.0.6",
|
||||||
|
"xlsx": "^0.18.5",
|
||||||
|
"echarts": "5.4.1",
|
||||||
|
"element-plus": "2.2.32",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"qrcodejs2": "0.0.2",
|
"qrcodejs2": "0.0.2",
|
||||||
"sortablejs": "1.15.0",
|
"sortablejs": "1.15.0",
|
||||||
"tinymce": "^6.3.1",
|
"tinymce": "6.3.2",
|
||||||
"vue": "3.2.36",
|
"vue": "3.2.47",
|
||||||
"vue-i18n": "9.1.10",
|
"vue-i18n": "9.2.2",
|
||||||
"vue-router": "4.0.15",
|
"vue-router": "4.1.6",
|
||||||
"vuedraggable": "4.0.3",
|
"vuedraggable": "4.0.3",
|
||||||
"vuex": "4.0.2",
|
"vuex": "4.1.0",
|
||||||
"xgplayer": "2.31.6",
|
"xgplayer": "2.32.2",
|
||||||
"xgplayer-hls": "2.5.2",
|
"xgplayer-hls": "2.5.2"
|
||||||
"xlsx": "^0.18.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "7.18.2",
|
"@babel/core": "7.21.00",
|
||||||
"@babel/eslint-parser": "7.18.2",
|
"@babel/eslint-parser": "7.19.1",
|
||||||
"@vue/cli-plugin-babel": "5.0.4",
|
"@vue/cli-plugin-babel": "5.0.8",
|
||||||
"@vue/cli-plugin-eslint": "5.0.4",
|
"@vue/cli-plugin-eslint": "5.0.8",
|
||||||
"@vue/cli-service": "5.0.4",
|
"@vue/cli-service": "5.0.8",
|
||||||
"eslint": "8.17.0",
|
"eslint": "8.35.0",
|
||||||
"eslint-plugin-vue": "9.1.0",
|
"eslint-plugin-vue": "9.9.0",
|
||||||
"sass": "1.37.5",
|
"sass": "1.58.3",
|
||||||
"sass-loader": "10.1.1"
|
"sass-loader": "10.1.1"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="config.locale" :size="config.size" :zIndex="config.zIndex" :button="config.button">
|
<el-config-provider :locale="locale" :size="config.size" :zIndex="config.zIndex" :button="config.button">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config: {
|
config: {
|
||||||
locale: this.$i18n.messages[this.$i18n.locale].el,
|
|
||||||
size: "default",
|
size: "default",
|
||||||
zIndex: 2000,
|
zIndex: 2000,
|
||||||
button: {
|
button: {
|
||||||
|
|
@ -21,6 +20,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
locale(){
|
||||||
|
return this.$i18n.messages[this.$i18n.locale].el
|
||||||
|
},
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
//设置主题颜色
|
//设置主题颜色
|
||||||
const app_color = this.$CONFIG.COLOR || this.$TOOL.data.get('APP_COLOR')
|
const app_color = this.$CONFIG.COLOR || this.$TOOL.data.get('APP_COLOR')
|
||||||
|
|
|
||||||
|
|
@ -378,5 +378,14 @@ export default {
|
||||||
return await http.delete(`${config.API_URL}/system/user_post/${id}/`);
|
return await http.delete(`${config.API_URL}/system/user_post/${id}/`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tasks: {
|
||||||
|
list: {
|
||||||
|
url: `${config.API_URL}/system/tasks/list`,
|
||||||
|
name: "系统任务管理",
|
||||||
|
get: async function(params){
|
||||||
|
return await http.get(this.url, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: scContextmenuItem组件
|
* @Descripttion: scContextmenuItem组件
|
||||||
* @version: 1.2
|
* @version: 1.3
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2021年7月23日16:29:36
|
* @Date: 2021年7月23日16:29:36
|
||||||
* @LastEditors: sakuya
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime: 2022年2月8日15:51:07
|
* @LastEditTime: 2022年11月23日10:09:54
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -50,6 +50,9 @@
|
||||||
if(!menu){
|
if(!menu){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if(this.disabled){
|
||||||
|
return false
|
||||||
|
}
|
||||||
menu.style.display = 'inline-block'
|
menu.style.display = 'inline-block'
|
||||||
var rect = menu.getBoundingClientRect()
|
var rect = menu.getBoundingClientRect()
|
||||||
var menuX = rect.left
|
var menuX = rect.left
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@
|
||||||
templates: {
|
templates: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -72,6 +76,7 @@
|
||||||
statusbar: true,
|
statusbar: true,
|
||||||
plugins: this.plugins,
|
plugins: this.plugins,
|
||||||
toolbar: this.toolbar,
|
toolbar: this.toolbar,
|
||||||
|
toolbar_mode: 'sliding',
|
||||||
font_size_formats: '12px 14px 16px 18px 22px 24px 36px 72px',
|
font_size_formats: '12px 14px 16px 18px 22px 24px 36px 72px',
|
||||||
height: this.height,
|
height: this.height,
|
||||||
placeholder: this.placeholder,
|
placeholder: this.placeholder,
|
||||||
|
|
@ -85,6 +90,7 @@
|
||||||
quickbars_insert_toolbar: false,
|
quickbars_insert_toolbar: false,
|
||||||
image_caption: true,
|
image_caption: true,
|
||||||
image_advtab: true,
|
image_advtab: true,
|
||||||
|
convert_urls: false,
|
||||||
images_upload_handler: function(blobInfo) {
|
images_upload_handler: function(blobInfo) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const data = new FormData();
|
const data = new FormData();
|
||||||
|
|
@ -100,8 +106,20 @@
|
||||||
editor.on('init', function() {
|
editor.on('init', function() {
|
||||||
this.getBody().style.fontSize = '14px';
|
this.getBody().style.fontSize = '14px';
|
||||||
})
|
})
|
||||||
|
editor.on('OpenWindow', function(e) {
|
||||||
}
|
//FIX 编辑器在el-drawer中,编辑器的弹框无法获得焦点
|
||||||
|
var D = document.querySelector('.el-drawer.open')
|
||||||
|
var E = e.target.editorContainer
|
||||||
|
if(D && D.contains(E)){
|
||||||
|
var nowDA = document.activeElement
|
||||||
|
setTimeout(()=>{
|
||||||
|
document.activeElement.blur()
|
||||||
|
nowDA.focus()
|
||||||
|
},0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
...this.options
|
||||||
},
|
},
|
||||||
contentValue: this.modelValue
|
contentValue: this.modelValue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table ref="table" :data="columnData" row-key="prop" style="width: 100%" border>
|
<el-table ref="table" :data="columnData" row-key="prop" style="width: 100%" border>
|
||||||
<el-table-column prop="" label="排序" width="60">
|
<el-table-column prop="" label="排序" width="60">
|
||||||
<el-tag class="move" style="cursor: move;"><el-icon style="cursor: move;"><el-icon-d-caret/></el-icon></el-tag>
|
<el-tag disable-transitions class="move" style="cursor: move;"><el-icon style="cursor: move;"><el-icon-d-caret/></el-icon></el-tag>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="label" label="列名">
|
<el-table-column prop="label" label="列名">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag round :effect="scope.row.hide?'light':'dark'" :type="scope.row.hide?'info':''">{{ scope.row.label }}</el-tag>
|
<el-tag round disable-transitions :effect="scope.row.hide?'light':'dark'" :type="scope.row.hide?'info':''">{{ scope.row.label }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="hide" label="显示" width="60">
|
<el-table-column prop="hide" label="显示" width="60">
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: 文件导出
|
* @Descripttion: 文件导出
|
||||||
* @version: 1.0
|
* @version: 1.1
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2022年5月24日16:20:12
|
* @Date: 2022年5月24日16:20:12
|
||||||
* @LastEditors:
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime:
|
* @LastEditTime: 2022年6月13日17:32:05
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -30,12 +30,13 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="form" :formData="formData"></slot>
|
<slot name="form" :formData="formData"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-button type="primary" size="large" icon="el-icon-download" style="width: 100%;" @click="download">下 载</el-button>
|
<el-button v-if="async" type="primary" size="large" icon="el-icon-plus" style="width: 100%;" @click="download" :loading="asyncLoading">发起导出任务</el-button>
|
||||||
|
<el-button v-else type="primary" size="large" icon="el-icon-download" style="width: 100%;" @click="download">下 载</el-button>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="列设置" v-if="columnData.length>0" lazy>
|
<el-tab-pane label="列设置" v-if="columnData.length>0" lazy>
|
||||||
<columnSet :column="columnData"></columnSet>
|
<columnSet :column="columnData"></columnSet>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="其他参数" v-if="data" lazy>
|
<el-tab-pane label="其他参数" v-if="data && showData" lazy>
|
||||||
<el-descriptions :column="1" border size="small">
|
<el-descriptions :column="1" border size="small">
|
||||||
<el-descriptions-item v-for=" (val, key) in data" :key="key" :label="key">{{val}}</el-descriptions-item>
|
<el-descriptions-item v-for=" (val, key) in data" :key="key" :label="key">{{val}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
@ -59,6 +60,8 @@
|
||||||
fileName: { type: String, default: "" },
|
fileName: { type: String, default: "" },
|
||||||
fileTypes: { type: Array, default: () => ['xlsx'] },
|
fileTypes: { type: Array, default: () => ['xlsx'] },
|
||||||
data: { type: Object, default: () => {} },
|
data: { type: Object, default: () => {} },
|
||||||
|
showData: { type: Boolean, default: false },
|
||||||
|
async: { type: Boolean, default: false },
|
||||||
column: { type: Array, default: () => [] },
|
column: { type: Array, default: () => [] },
|
||||||
blob: { type: Boolean, default: false },
|
blob: { type: Boolean, default: false },
|
||||||
progress: { type: Boolean, default: true }
|
progress: { type: Boolean, default: true }
|
||||||
|
|
@ -72,7 +75,8 @@
|
||||||
},
|
},
|
||||||
columnData: [],
|
columnData: [],
|
||||||
downLoading: false,
|
downLoading: false,
|
||||||
downLoadProgress: 0
|
downLoadProgress: 0,
|
||||||
|
asyncLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
|
@ -104,7 +108,9 @@
|
||||||
column: this.columnData.filter(n => !n.hide).map(n => n.prop).join(",")
|
column: this.columnData.filter(n => !n.hide).map(n => n.prop).join(",")
|
||||||
}
|
}
|
||||||
let assignData = {...this.data, ...this.formData, ...columnArr}
|
let assignData = {...this.data, ...this.formData, ...columnArr}
|
||||||
if(this.blob){
|
if(this.async){
|
||||||
|
this.asyncDownload(this.apiObj, this.formData.fileName, assignData)
|
||||||
|
}else if(this.blob){
|
||||||
this.downloadFile(this.apiObj, this.formData.fileName, assignData)
|
this.downloadFile(this.apiObj, this.formData.fileName, assignData)
|
||||||
}else{
|
}else{
|
||||||
this.linkFile(this.apiObj.url, this.formData.fileName, assignData)
|
this.linkFile(this.apiObj.url, this.formData.fileName, assignData)
|
||||||
|
|
@ -152,6 +158,30 @@
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
asyncDownload(apiObj, fileName, data={}){
|
||||||
|
this.asyncLoading = true
|
||||||
|
apiObj.get(data).then(res => {
|
||||||
|
this.asyncLoading = false
|
||||||
|
if(res.code == 200){
|
||||||
|
this.dialog = false
|
||||||
|
this.$msgbox({
|
||||||
|
title: "成功发起任务",
|
||||||
|
message: `<div><img style="height:200px" src="img/tasks-example.png"/></div><p>已成功发起导出任务,您可以操作其他事务</p><p>稍后可在 <b>任务中心</b> 查看执行结果</p>`,
|
||||||
|
type: "success",
|
||||||
|
confirmButtonText: "知道了",
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
center: true
|
||||||
|
}).catch(() => {})
|
||||||
|
}else{
|
||||||
|
this.$alert(res.message || "未知错误", "发起任务失败", {
|
||||||
|
type: "error",
|
||||||
|
center: true
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.asyncLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
toQueryString(obj){
|
toQueryString(obj){
|
||||||
let arr = []
|
let arr = []
|
||||||
for (var k in obj) {
|
for (var k in obj) {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: 过滤器V2
|
* @Descripttion: 过滤器V2
|
||||||
* @version: 2.5
|
* @version: 2.6
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2021年7月30日14:48:41
|
* @Date: 2021年7月30日14:48:41
|
||||||
* @LastEditors: sakuya
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime: 2022年5月13日21:15:44
|
* @LastEditTime: 2023年2月7日09:46:45
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -39,10 +39,10 @@
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<tr v-for="(item,index) in filter" :key="index">
|
<tr v-for="(item,index) in filter" :key="index">
|
||||||
<td>
|
<td>
|
||||||
<el-tag>{{index+1}}</el-tag>
|
<el-tag :disable-transitions="true">{{index+1}}</el-tag>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<py-select v-model="item.field" :options="fields" placeholder="过滤字段" filterable @change="fieldChange(item)">
|
<py-select v-model="item.field" :options="fields" :filter="filter" placeholder="过滤字段" filterable @change="fieldChange(item)">
|
||||||
</py-select>
|
</py-select>
|
||||||
</td>
|
</td>
|
||||||
<td v-if="showOperator">
|
<td v-if="showOperator">
|
||||||
|
|
@ -66,6 +66,8 @@
|
||||||
<el-date-picker v-if="item.field.type=='datetime'" v-model="item.value" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="item.field.placeholder||'请选择日期'" style="width: 100%;"></el-date-picker>
|
<el-date-picker v-if="item.field.type=='datetime'" v-model="item.value" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" :placeholder="item.field.placeholder||'请选择日期'" style="width: 100%;"></el-date-picker>
|
||||||
<!-- 日期时间范围 -->
|
<!-- 日期时间范围 -->
|
||||||
<el-date-picker v-if="item.field.type=='datetimerange'" v-model="item.value" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;"></el-date-picker>
|
<el-date-picker v-if="item.field.type=='datetimerange'" v-model="item.value" type="datetimerange" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;"></el-date-picker>
|
||||||
|
<!-- 自定义日期 -->
|
||||||
|
<el-date-picker v-if="item.field.type=='customDate'" v-model="item.value" :type="item.field.extend.dateType||'date'" :value-format="item.field.extend.valueFormat" :placeholder="item.field.placeholder||'请选择'" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 100%;"></el-date-picker>
|
||||||
<!-- 开关 -->
|
<!-- 开关 -->
|
||||||
<el-switch v-if="item.field.type=='switch'" v-model="item.value" active-value="1" inactive-value="0"></el-switch>
|
<el-switch v-if="item.field.type=='switch'" v-model="item.value" active-value="1" inactive-value="0"></el-switch>
|
||||||
<!-- 标签 -->
|
<!-- 标签 -->
|
||||||
|
|
@ -116,6 +118,7 @@
|
||||||
showOperator: { type: Boolean, default: true },
|
showOperator: { type: Boolean, default: true },
|
||||||
options: { type: Object, default: () => {} }
|
options: { type: Object, default: () => {} }
|
||||||
},
|
},
|
||||||
|
emits: ['filterChange'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
drawer: false,
|
drawer: false,
|
||||||
|
|
@ -155,11 +158,13 @@
|
||||||
},
|
},
|
||||||
//增加过滤项
|
//增加过滤项
|
||||||
addFilter(){
|
addFilter(){
|
||||||
if(this.fields.length<=0){
|
//下一组新增过滤
|
||||||
|
var filterArr = this.fields.filter(field => !this.filter.some(item => field.value == item.field.value && !item.field.repeat))
|
||||||
|
if(this.fields.length<=0 || filterArr.length<=0){
|
||||||
this.$message.warning('无过滤项');
|
this.$message.warning('无过滤项');
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const filterNum = this.fields[this.filter.length] || this.fields[0]
|
const filterNum = filterArr[0]
|
||||||
this.filter.push({
|
this.filter.push({
|
||||||
field: filterNum,
|
field: filterNum,
|
||||||
operator: filterNum.operator || 'include',
|
operator: filterNum.operator || 'include',
|
||||||
|
|
@ -195,6 +200,9 @@
|
||||||
},
|
},
|
||||||
//下拉框显示事件处理异步搜索
|
//下拉框显示事件处理异步搜索
|
||||||
async remoteMethod(query, item){
|
async remoteMethod(query, item){
|
||||||
|
if(!item.field.extend.request) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(query !== ''){
|
if(query !== ''){
|
||||||
item.selectLoading = true;
|
item.selectLoading = true;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-select v-bind="$attrs" :filter-method="filterMethod" @visible-change="visibleChange">
|
<el-select v-bind="$attrs" :filter-method="filterMethod" @visible-change="visibleChange">
|
||||||
<el-option v-for="field in optionsList" :key="field.value" :label="field.label" :value="field"></el-option>
|
<el-option v-for="field in optionsList" :key="field.value" :label="field.label" :value="field" :disabled="isDisabled(field.value)"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -18,7 +18,8 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
options: { type: Array, default: () => [] }
|
options: { type: Array, default: () => [] },
|
||||||
|
filter: { type: Array, default: () => [] }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -45,6 +46,13 @@
|
||||||
if(isopen){
|
if(isopen){
|
||||||
this.optionsList = this.optionsList_
|
this.optionsList = this.optionsList_
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
isDisabled(key){
|
||||||
|
if(this.filter.find(item => item.field.value == key && !item.field.repeat)){
|
||||||
|
return true
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,29 @@
|
||||||
|
<!--
|
||||||
|
* @Descripttion: 表单表格
|
||||||
|
* @version: 1.3
|
||||||
|
* @Author: sakuya
|
||||||
|
* @Date: 2023年2月9日12:32:26
|
||||||
|
* @LastEditors: sakuya
|
||||||
|
* @LastEditTime: 2023年2月17日10:41:47
|
||||||
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="sc-form-table">
|
<div class="sc-form-table" ref="scFormTable">
|
||||||
<el-table :data="data" ref="table" :key="toggleIndex" border stripe>
|
<el-table :data="data" ref="table" border stripe>
|
||||||
<el-table-column type="index" width="50" fixed="left">
|
<el-table-column type="index" width="50" fixed="left">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>
|
<el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="sc-form-table-handle">
|
<div :class="['sc-form-table-handle', {'sc-form-table-handle-delete':!hideDelete}]">
|
||||||
<span>{{scope.$index + 1}}</span>
|
<span>{{scope.$index + 1}}</span>
|
||||||
<el-button type="danger" icon="el-icon-delete" size="small" plain circle @click="rowDel(scope.row, scope.$index)"></el-button>
|
<el-button v-if="!hideDelete" type="danger" icon="el-icon-delete" size="small" plain circle @click="rowDel(scope.row, scope.$index)"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="" width="58" v-if="dragSort">
|
<el-table-column label="" width="50" v-if="dragSort">
|
||||||
<template #default>
|
<template #default>
|
||||||
<el-tag class="move" style="cursor: move;"><el-icon-d-caret style="width: 1em; height: 1em;"/></el-tag>
|
<div class="move" style="cursor: move;"><el-icon-d-caret style="width: 1em; height: 1em;"/></div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|
@ -33,12 +42,13 @@
|
||||||
modelValue: { type: Array, default: () => [] },
|
modelValue: { type: Array, default: () => [] },
|
||||||
addTemplate: { type: Object, default: () => {} },
|
addTemplate: { type: Object, default: () => {} },
|
||||||
placeholder: { type: String, default: "暂无数据" },
|
placeholder: { type: String, default: "暂无数据" },
|
||||||
dragSort: { type: Boolean, default: false }
|
dragSort: { type: Boolean, default: false },
|
||||||
|
hideAdd: { type: Boolean, default: false },
|
||||||
|
hideDelete: { type: Boolean, default: false }
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
data: [],
|
data: []
|
||||||
toggleIndex: 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
|
@ -67,12 +77,17 @@
|
||||||
animation: 300,
|
animation: 300,
|
||||||
ghostClass: "ghost",
|
ghostClass: "ghost",
|
||||||
onEnd({ newIndex, oldIndex }) {
|
onEnd({ newIndex, oldIndex }) {
|
||||||
const tableData = _this.data
|
_this.data.splice(newIndex, 0, _this.data.splice(oldIndex, 1)[0])
|
||||||
const currRow = tableData.splice(oldIndex, 1)[0]
|
const newArray = _this.data.slice(0)
|
||||||
tableData.splice(newIndex, 0, currRow)
|
const tmpHeight = _this.$refs.scFormTable.offsetHeight
|
||||||
_this.toggleIndex += 1
|
_this.$refs.scFormTable.style.setProperty('height', tmpHeight + 'px')
|
||||||
|
_this.data = []
|
||||||
_this.$nextTick(() => {
|
_this.$nextTick(() => {
|
||||||
_this.rowDrop()
|
_this.data = newArray
|
||||||
|
_this.$nextTick(() => {
|
||||||
|
_this.$refs.scFormTable.style.removeProperty('height')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -83,6 +98,15 @@
|
||||||
},
|
},
|
||||||
rowDel(row, index){
|
rowDel(row, index){
|
||||||
this.data.splice(index, 1)
|
this.data.splice(index, 1)
|
||||||
|
},
|
||||||
|
//插入行
|
||||||
|
pushRow(row){
|
||||||
|
const temp = row || JSON.parse(JSON.stringify(this.addTemplate))
|
||||||
|
this.data.push(temp)
|
||||||
|
},
|
||||||
|
//根据index删除
|
||||||
|
deleteRow(index){
|
||||||
|
this.data.splice(index, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +117,7 @@
|
||||||
.sc-form-table .sc-form-table-handle {text-align: center;}
|
.sc-form-table .sc-form-table-handle {text-align: center;}
|
||||||
.sc-form-table .sc-form-table-handle span {display: inline-block;}
|
.sc-form-table .sc-form-table-handle span {display: inline-block;}
|
||||||
.sc-form-table .sc-form-table-handle button {display: none;}
|
.sc-form-table .sc-form-table-handle button {display: none;}
|
||||||
.sc-form-table .hover-row .sc-form-table-handle span {display: none;}
|
.sc-form-table .hover-row .sc-form-table-handle-delete span {display: none;}
|
||||||
.sc-form-table .hover-row .sc-form-table-handle button {display: inline-block;}
|
.sc-form-table .hover-row .sc-form-table-handle-delete button {display: inline-block;}
|
||||||
|
.sc-form-table .move {text-align: center;font-size: 14px;margin-top: 3px;}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,47 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: 图标选择器组件
|
* @Descripttion: 图标选择器组件
|
||||||
* @version: 1.4
|
* @version: 2.0
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2021年7月27日10:02:46
|
* @Date: 2021年7月27日10:02:46
|
||||||
* @LastEditors: sakuya
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime: 2022年5月14日19:49:42
|
* @LastEditTime: 2022年6月6日13:48:49
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="sc-icon-select">
|
<div class="sc-icon-select">
|
||||||
<el-input v-model="defaultValue" :prefix-icon="defaultValue||'none'" :placeholder="placeholder" :clearable="clearable" :disabled="disabled">
|
<div class="sc-icon-select__wrapper" :class="{'hasValue':value}" @click="open">
|
||||||
<template #append><el-button icon="el-icon-more-filled" @click="open"></el-button></template>
|
<el-input :prefix-icon="value||'el-icon-plus'" v-model="value" :disabled="disabled" readonly></el-input>
|
||||||
</el-input>
|
</div>
|
||||||
<el-dialog title="图标选择器" v-model="dialogVisible" :width="780" destroy-on-close>
|
<el-dialog title="图标选择器" v-model="dialogVisible" :width="760" destroy-on-close append-to-body>
|
||||||
<el-tabs style="margin-top: -30px;">
|
<div class="sc-icon-select__dialog" style="margin: -20px 0 -10px 0;">
|
||||||
<el-tab-pane v-for="item in data" :key="item.name" lazy>
|
<el-form :rules="{}">
|
||||||
<template #label>
|
<el-form-item prop="searchText">
|
||||||
{{item.name}} <el-tag size="small" type="info">{{item.icons.length}}</el-tag>
|
<el-input class="sc-icon-select__search-input" prefix-icon="el-icon-search" v-model="searchText" placeholder="搜索" size="large" clearable/>
|
||||||
</template>
|
</el-form-item>
|
||||||
<div class="sc-icon-select__list">
|
</el-form>
|
||||||
<el-scrollbar>
|
<el-tabs>
|
||||||
<ul @click="selectIcon">
|
<el-tab-pane v-for="item in data" :key="item.name" lazy>
|
||||||
<li v-for="icon in item.icons" :key="icon">
|
<template #label>
|
||||||
<span :data-icon="icon"></span>
|
{{item.name}} <el-tag size="small" type="info">{{item.icons.length}}</el-tag>
|
||||||
<el-icon><component :is="icon" /></el-icon>
|
</template>
|
||||||
</li>
|
<div class="sc-icon-select__list">
|
||||||
</ul>
|
<el-scrollbar>
|
||||||
</el-scrollbar>
|
<ul @click="selectIcon">
|
||||||
</div>
|
<el-empty v-if="item.icons.length==0" :image-size="100" description="未查询到相关图标" />
|
||||||
</el-tab-pane>
|
<li v-for="icon in item.icons" :key="icon">
|
||||||
</el-tabs>
|
<span :data-icon="icon"></span>
|
||||||
|
<el-icon><component :is="icon" /></el-icon>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="clear" text>清除</el-button>
|
||||||
|
<el-button @click="dialogVisible=false">取消</el-button>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -40,27 +52,29 @@
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: { type: String, default: "" },
|
modelValue: { type: String, default: "" },
|
||||||
placeholder: { type: String, default: "请输入或者选择图标" },
|
|
||||||
clearable: { type: Boolean, default: false },
|
|
||||||
disabled: { type: Boolean, default: false },
|
disabled: { type: Boolean, default: false },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
defaultValue: '',
|
value: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
data: []
|
data: [],
|
||||||
|
searchText: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
modelValue(val){
|
modelValue(val){
|
||||||
this.defaultValue = val
|
this.value = val
|
||||||
},
|
},
|
||||||
defaultValue(val){
|
value(val){
|
||||||
this.$emit('update:modelValue', val)
|
this.$emit('update:modelValue', val)
|
||||||
|
},
|
||||||
|
searchText(val){
|
||||||
|
this.search(val)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.defaultValue = this.modelValue
|
this.value = this.modelValue
|
||||||
this.data.push(...config.icons)
|
this.data.push(...config.icons)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -74,25 +88,41 @@
|
||||||
if(e.target.tagName != 'SPAN'){
|
if(e.target.tagName != 'SPAN'){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.defaultValue = e.target.dataset.icon
|
this.value = e.target.dataset.icon
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$emit('update:modelValue', this.defaultValue);
|
},
|
||||||
|
clear(){
|
||||||
|
this.value = ""
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
search(text){
|
||||||
|
if(text){
|
||||||
|
const filterData = JSON.parse(JSON.stringify(config.icons))
|
||||||
|
filterData.forEach(t => {
|
||||||
|
t.icons = t.icons.filter(n => n.includes(text))
|
||||||
|
})
|
||||||
|
this.data = filterData
|
||||||
|
}else{
|
||||||
|
this.data = JSON.parse(JSON.stringify(config.icons))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.sc-icon-select {display: inline-block;}
|
.sc-icon-select {display: inline-flex;}
|
||||||
.sc-icon-select__list {height:360px;overflow: auto;}
|
.sc-icon-select__wrapper {cursor: pointer;display: inline-flex;}
|
||||||
.sc-icon-select__list ul {}
|
.sc-icon-select__wrapper:deep(.el-input__wrapper).is-focus {box-shadow: 0 0 0 1px var(--el-input-hover-border-color) inset;}
|
||||||
.sc-icon-select__list li {display: inline-block;width:80px;height:80px;margin:5px;vertical-align: top;box-shadow: 0 0 0 1px #eee;transition: all 0.1s;border-radius: 4px;position: relative;}
|
.sc-icon-select__wrapper:deep(.el-input__inner) {flex-grow:0;width: 0;}
|
||||||
.sc-icon-select__list li span {position: absolute;top:0;left:0;right:0;bottom:0;z-index: 1;cursor: pointer;}
|
.sc-icon-select__wrapper:deep(.el-input__icon) {margin: 0;font-size: 16px;}
|
||||||
.sc-icon-select__list li i {display: inline-block;width: 100%;height:100%;font-size: 26px;color: #6d7882;background: #fff;display: flex;justify-content: center;align-items: center;border-radius: 4px;}
|
.sc-icon-select__wrapper.hasValue:deep(.el-input__icon) {color: var(--el-text-color-regular);}
|
||||||
.sc-icon-select__list li:hover {box-shadow: 0 0 1px 4px rgba(64,158,255,1);}
|
|
||||||
.sc-icon-select__list li:hover i {color: #409EFF;}
|
|
||||||
|
|
||||||
.dark .sc-icon-select__list li {box-shadow: 0 0 0 1px #333;;}
|
.sc-icon-select__list {height:270px;overflow: auto;}
|
||||||
.dark .sc-icon-select__list li:hover {box-shadow: 0 0 1px 4px rgba(64,158,255,1);}
|
.sc-icon-select__list ul {}
|
||||||
.dark .sc-icon-select__list li i {background: var(--el-bg-color);}
|
.sc-icon-select__list li {display: inline-block;width:80px;height:80px;margin:5px;vertical-align: top;transition: all 0.1s;border-radius: 4px;position: relative;}
|
||||||
|
.sc-icon-select__list li span {position: absolute;top:0;left:0;right:0;bottom:0;z-index: 1;cursor: pointer;}
|
||||||
|
.sc-icon-select__list li i {display: inline-block;width: 100%;height:100%;font-size: 26px;color: #6d7882;display: flex;justify-content: center;align-items: center;border-radius: 4px;}
|
||||||
|
.sc-icon-select__list li:hover {box-shadow: 0 0 1px 4px var(--el-color-primary);background: var(--el-color-primary-light-9);}
|
||||||
|
.sc-icon-select__list li:hover i {color: var(--el-color-primary);}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: 异步选择器
|
* @Descripttion: 异步选择器
|
||||||
* @version: 1.0
|
* @version: 1.1
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2021年8月3日15:53:37
|
* @Date: 2021年8月3日15:53:37
|
||||||
* @LastEditors:
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime:
|
* @LastEditTime: 2023年2月23日15:17:24
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<el-icon class="is-loading"><el-icon-loading /></el-icon>
|
<el-icon class="is-loading"><el-icon-loading /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<el-select v-bind="$attrs" :loading="loading" @visible-change="visibleChange">
|
<el-select v-bind="$attrs" :loading="loading" @visible-change="visibleChange">
|
||||||
<el-option v-for="item in options" :key="item[props.value]" :label="item[props.label]" :value="item[props.value]">
|
<el-option v-for="item in options" :key="item[props.value]" :label="item[props.label]" :value="objValueType ? item : item[props.value]">
|
||||||
<slot name="option" :data="item"></slot>
|
<slot name="option" :data="item"></slot>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
props: {
|
props: {
|
||||||
apiObj: { type: Object, default: () => {} },
|
apiObj: { type: Object, default: () => {} },
|
||||||
dic: { type: String, default: "" },
|
dic: { type: String, default: "" },
|
||||||
|
objValueType: { type: Boolean, default: false },
|
||||||
params: { type: Object, default: () => ({}) }
|
params: { type: Object, default: () => ({}) }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -40,7 +41,7 @@
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
//如果有默认值就去请求接口获取options
|
//如果有默认值就去请求接口获取options
|
||||||
if(this.$attrs.modelValue && this.$attrs.modelValue.length > 0){
|
if(this.hasValue()){
|
||||||
this.initloading = true
|
this.initloading = true
|
||||||
this.getRemoteData()
|
this.getRemoteData()
|
||||||
}
|
}
|
||||||
|
|
@ -66,6 +67,16 @@
|
||||||
this.options = response.data
|
this.options = response.data
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.initloading = false
|
this.initloading = false
|
||||||
|
},
|
||||||
|
//判断是否有回显默认值
|
||||||
|
hasValue(){
|
||||||
|
if(Array.isArray(this.$attrs.modelValue) && this.$attrs.modelValue.length <= 0){
|
||||||
|
return false
|
||||||
|
}else if(this.$attrs.modelValue){
|
||||||
|
return true
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@
|
||||||
watch:{
|
watch:{
|
||||||
data(val) {
|
data(val) {
|
||||||
val.forEach(item => {
|
val.forEach(item => {
|
||||||
this.selected[item.key] = this.selectedValues[item.key] || [item.options[0].value]
|
this.selected[item.key] = this.selectedValues[item.key] ||
|
||||||
|
(Array.isArray(item.options) && item.options.length) ? [item.options[0].value] : []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -58,7 +59,8 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
//默认赋值
|
//默认赋值
|
||||||
this.data.forEach(item => {
|
this.data.forEach(item => {
|
||||||
this.selected[item.key] = this.selectedValues[item.key] || [item.options[0].value]
|
this.selected[item.key] = this.selectedValues[item.key] ||
|
||||||
|
(Array.isArray(item.options) && item.options.length) ? [item.options[0].value] : []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<!--
|
<!--
|
||||||
* @Descripttion: 表格选择器组件
|
* @Descripttion: 表格选择器组件
|
||||||
* @version: 1.2
|
* @version: 1.3
|
||||||
* @Author: sakuya
|
* @Author: sakuya
|
||||||
* @Date: 2021年6月10日10:04:07
|
* @Date: 2021年6月10日10:04:07
|
||||||
* @LastEditors: sakuya
|
* @LastEditors: sakuya
|
||||||
* @LastEditTime: 2022年2月28日09:39:03
|
* @LastEditTime: 2022年6月6日21:50:36
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-select ref="select" v-model="defaultValue" clearable :multiple="multiple" filterable :placeholder="placeholder" :disabled="disabled" :filter-method="filterMethod" @remove-tag="removeTag" @visible-change="visibleChange" @clear="clear">
|
<el-select ref="select" v-model="defaultValue" :size="size" :clearable="clearable" :multiple="multiple" :collapse-tags="collapseTags" :collapse-tags-tooltip="collapseTagsTooltip" :filterable="filterable" :placeholder="placeholder" :disabled="disabled" :filter-method="filterMethod" @remove-tag="removeTag" @visible-change="visibleChange" @clear="clear">
|
||||||
<template #empty>
|
<template #empty>
|
||||||
<div class="sc-table-select__table" :style="{width: tableWidth+'px'}" v-loading="loading">
|
<div class="sc-table-select__table" :style="{width: tableWidth+'px'}" v-loading="loading">
|
||||||
<div class="sc-table-select__header">
|
<div class="sc-table-select__header">
|
||||||
|
|
@ -38,7 +38,12 @@
|
||||||
apiObj: { type: Object, default: () => {} },
|
apiObj: { type: Object, default: () => {} },
|
||||||
params: { type: Object, default: () => {} },
|
params: { type: Object, default: () => {} },
|
||||||
placeholder: { type: String, default: "请选择" },
|
placeholder: { type: String, default: "请选择" },
|
||||||
|
size: { type: String, default: "default" },
|
||||||
|
clearable: { type: Boolean, default: false },
|
||||||
multiple: { type: Boolean, default: false },
|
multiple: { type: Boolean, default: false },
|
||||||
|
filterable: { type: Boolean, default: false },
|
||||||
|
collapseTags: { type: Boolean, default: false },
|
||||||
|
collapseTagsTooltip: { type: Boolean, default: false },
|
||||||
disabled: { type: Boolean, default: false },
|
disabled: { type: Boolean, default: false },
|
||||||
tableWidth: {type: Number, default: 400},
|
tableWidth: {type: Number, default: 400},
|
||||||
mode: { type: String, default: "popover" },
|
mode: { type: String, default: "popover" },
|
||||||
|
|
@ -119,7 +124,7 @@
|
||||||
var setrow = this.tableData.filter(item => item[this.defaultProps.value]===this.defaultValue[this.defaultProps.value] )
|
var setrow = this.tableData.filter(item => item[this.defaultProps.value]===this.defaultValue[this.defaultProps.value] )
|
||||||
this.$refs.table.setCurrentRow(setrow[0]);
|
this.$refs.table.setCurrentRow(setrow[0]);
|
||||||
}
|
}
|
||||||
this.$refs.table.$el.querySelector('.el-table__body-wrapper').scrollTop = 0
|
this.$refs.table.setScrollTop(0)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//插糟表单提交
|
//插糟表单提交
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:name="name"
|
:name="name"
|
||||||
:data="data"
|
:data="data"
|
||||||
:http-request="request"
|
:http-request="request"
|
||||||
:file-list="defaultFileList"
|
v-model:file-list="defaultFileList"
|
||||||
:show-file-list="showFileList"
|
:show-file-list="showFileList"
|
||||||
:drag="drag"
|
:drag="drag"
|
||||||
:accept="accept"
|
:accept="accept"
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: { type: String, default: "" },
|
modelValue: { type: [String, Array], default: "" },
|
||||||
tip: { type: String, default: "" },
|
tip: { type: String, default: "" },
|
||||||
action: { type: String, default: "" },
|
action: { type: String, default: "" },
|
||||||
apiObj: { type: Object, default: () => {} },
|
apiObj: { type: Object, default: () => {} },
|
||||||
|
|
@ -58,22 +58,29 @@
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
modelValue(val){
|
modelValue(val){
|
||||||
if (val != this.toStr(this.defaultFileList)) {
|
if(Array.isArray(val)){
|
||||||
this.defaultFileList = this.toArr(val)
|
if (JSON.stringify(val) != JSON.stringify(this.formatArr(this.defaultFileList))) {
|
||||||
this.value = val
|
this.defaultFileList = val
|
||||||
|
this.value = val
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (val != this.toStr(this.defaultFileList)) {
|
||||||
|
this.defaultFileList = this.toArr(val)
|
||||||
|
this.value = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultFileList: {
|
defaultFileList: {
|
||||||
handler(val){
|
handler(val){
|
||||||
this.$emit('update:modelValue', this.toStr(val))
|
this.$emit('update:modelValue', Array.isArray(this.modelValue) ? this.formatArr(val) : this.toStr(val))
|
||||||
this.value = this.toStr(val)
|
this.value = this.toStr(val)
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.defaultFileList = Array.isArray(this.modelValue) ? this.modelValue : this.toArr(this.modelValue)
|
||||||
this.value = this.modelValue
|
this.value = this.modelValue
|
||||||
this.defaultFileList = this.toArr(this.modelValue)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//默认值转换为数组
|
//默认值转换为数组
|
||||||
|
|
@ -90,12 +97,25 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return _arr;
|
return _arr
|
||||||
},
|
},
|
||||||
//数组转换为原始值
|
//数组转换为原始值
|
||||||
toStr(arr){
|
toStr(arr){
|
||||||
return arr.map(v => v.url).join(",")
|
return arr.map(v => v.url).join(",")
|
||||||
},
|
},
|
||||||
|
//格式化数组值
|
||||||
|
formatArr(arr){
|
||||||
|
var _arr = []
|
||||||
|
arr.forEach(item => {
|
||||||
|
if(item){
|
||||||
|
_arr.push({
|
||||||
|
name: item.name,
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return _arr
|
||||||
|
},
|
||||||
before(file){
|
before(file){
|
||||||
const maxSize = file.size / 1024 / 1024 < this.maxSize;
|
const maxSize = file.size / 1024 / 1024 < this.maxSize;
|
||||||
if (!maxSize) {
|
if (!maxSize) {
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,10 @@
|
||||||
this.$refs.uploader.clearFiles()
|
this.$refs.uploader.clearFiles()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
change(file){
|
change(file,files){
|
||||||
|
if(files.length > 1){
|
||||||
|
files.splice(0, 1)
|
||||||
|
}
|
||||||
if(this.cropper && file.status=='ready'){
|
if(this.cropper && file.status=='ready'){
|
||||||
const acceptIncludes = ["image/gif", "image/jpeg", "image/png"].includes(file.raw.type)
|
const acceptIncludes = ["image/gif", "image/jpeg", "image/png"].includes(file.raw.type)
|
||||||
if(!acceptIncludes){
|
if(!acceptIncludes){
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
:name="name"
|
:name="name"
|
||||||
:data="data"
|
:data="data"
|
||||||
:http-request="request"
|
:http-request="request"
|
||||||
:file-list="defaultFileList"
|
v-model:file-list="defaultFileList"
|
||||||
:show-file-list="showFileList"
|
:show-file-list="showFileList"
|
||||||
:accept="accept"
|
:accept="accept"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelValue: { type: String, default: "" },
|
modelValue: { type: [String, Array], default: "" },
|
||||||
tip: { type: String, default: "" },
|
tip: { type: String, default: "" },
|
||||||
action: { type: String, default: "" },
|
action: { type: String, default: "" },
|
||||||
apiObj: { type: Object, default: () => {} },
|
apiObj: { type: Object, default: () => {} },
|
||||||
|
|
@ -75,14 +75,21 @@
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
modelValue(val){
|
modelValue(val){
|
||||||
if (val != this.toStr(this.defaultFileList)) {
|
if(Array.isArray(val)){
|
||||||
this.defaultFileList = this.toArr(val)
|
if (JSON.stringify(val) != JSON.stringify(this.formatArr(this.defaultFileList))) {
|
||||||
this.value = val
|
this.defaultFileList = val
|
||||||
|
this.value = val
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (val != this.toStr(this.defaultFileList)) {
|
||||||
|
this.defaultFileList = this.toArr(val)
|
||||||
|
this.value = val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultFileList: {
|
defaultFileList: {
|
||||||
handler(val){
|
handler(val){
|
||||||
this.$emit('update:modelValue', this.toStr(val))
|
this.$emit('update:modelValue', Array.isArray(this.modelValue) ? this.formatArr(val) : this.toStr(val))
|
||||||
this.value = this.toStr(val)
|
this.value = this.toStr(val)
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
|
|
@ -94,8 +101,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.defaultFileList = Array.isArray(this.modelValue) ? this.modelValue : this.toArr(this.modelValue)
|
||||||
this.value = this.modelValue
|
this.value = this.modelValue
|
||||||
this.defaultFileList = this.toArr(this.modelValue)
|
|
||||||
if(!this.disabled && this.draggable){
|
if(!this.disabled && this.draggable){
|
||||||
this.rowDrop()
|
this.rowDrop()
|
||||||
}
|
}
|
||||||
|
|
@ -121,6 +128,19 @@
|
||||||
toStr(arr){
|
toStr(arr){
|
||||||
return arr.map(v => v.url).join(",")
|
return arr.map(v => v.url).join(",")
|
||||||
},
|
},
|
||||||
|
//格式化数组值
|
||||||
|
formatArr(arr){
|
||||||
|
var _arr = []
|
||||||
|
arr.forEach(item => {
|
||||||
|
if(item){
|
||||||
|
_arr.push({
|
||||||
|
name: item.name,
|
||||||
|
url: item.url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return _arr
|
||||||
|
},
|
||||||
//拖拽
|
//拖拽
|
||||||
rowDrop(){
|
rowDrop(){
|
||||||
const _this = this
|
const _this = this
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,5 @@
|
||||||
.sc-video:deep(.danmu) > * {color: #fff;font-size:20px;font-weight:bold;text-shadow:1px 1px 0 #000,-1px -1px 0 #000,-1px 1px 0 #000,1px -1px 0 #000;}
|
.sc-video:deep(.danmu) > * {color: #fff;font-size:20px;font-weight:bold;text-shadow:1px 1px 0 #000,-1px -1px 0 #000,-1px 1px 0 #000,1px -1px 0 #000;}
|
||||||
.sc-video:deep(.xgplayer-controls) {background-image: linear-gradient(180deg, transparent, rgba(0,0,0,0.3));}
|
.sc-video:deep(.xgplayer-controls) {background-image: linear-gradient(180deg, transparent, rgba(0,0,0,0.3));}
|
||||||
.sc-video:deep(.xgplayer-progress-tip) {border:0;color: #fff;background: rgba(0,0,0,.5);line-height: 25px;padding: 0 10px;border-radius: 25px;}
|
.sc-video:deep(.xgplayer-progress-tip) {border:0;color: #fff;background: rgba(0,0,0,.5);line-height: 25px;padding: 0 10px;border-radius: 25px;}
|
||||||
|
.sc-video:deep(.xgplayer-enter-spinner) {width: 50px;height: 50px;}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ const DEFAULT_CONFIG = {
|
||||||
DASHBOARD_URL: "/dashboard",
|
DASHBOARD_URL: "/dashboard",
|
||||||
|
|
||||||
//版本号
|
//版本号
|
||||||
APP_VER: "1.0",
|
APP_VER: "1.6.9",
|
||||||
|
|
||||||
//内核版本号
|
//内核版本号
|
||||||
CORE_VER: "1.6.3",
|
CORE_VER: "1.6.9",
|
||||||
|
|
||||||
//接口地址
|
//接口地址
|
||||||
// API_URL: process.env.NODE_ENV === 'development' && process.env.VUE_APP_PROXY === 'false' ? "/api" : process.env.VUE_APP_API_BASEURL,
|
// API_URL: process.env.NODE_ENV === 'development' && process.env.VUE_APP_PROXY === 'false' ? "/api" : process.env.VUE_APP_API_BASEURL,
|
||||||
|
|
@ -76,10 +76,15 @@ function get_api_url(){
|
||||||
}
|
}
|
||||||
return 'http://' + window.location.host + '/api'
|
return 'http://' + window.location.host + '/api'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//合并业务配置
|
||||||
|
import MY_CONFIG from "./myConfig"
|
||||||
|
Object.assign(DEFAULT_CONFIG, MY_CONFIG)
|
||||||
|
|
||||||
// 如果生产模式,就合并动态的APP_CONFIG
|
// 如果生产模式,就合并动态的APP_CONFIG
|
||||||
// public/config.js
|
// public/config.js
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
Object.assign(DEFAULT_CONFIG, APP_CONFIG)
|
Object.assign(DEFAULT_CONFIG, APP_CONFIG)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = DEFAULT_CONFIG
|
export default DEFAULT_CONFIG
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
//业务配置
|
||||||
|
//会合并至this.$CONFIG
|
||||||
|
//生产模式 public/config.js 同名key会覆盖这里的配置从而实现打包后的热更新
|
||||||
|
//为避免和SCUI框架配置混淆建议添加前缀 MY_
|
||||||
|
//全局可使用 this.$CONFIG.MY_KEY 访问
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//是否显示第三方授权登录
|
||||||
|
MY_SHOW_LOGIN_OAUTH: true
|
||||||
|
}
|
||||||
|
|
@ -1,22 +1,18 @@
|
||||||
import { permission } from '@/utils/permission'
|
import { permissionAll } from '@/utils/permission'
|
||||||
|
import tool from '@/utils/tool';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户权限指令
|
||||||
|
* @directive 单个权限验证(v-auth="'xxx'")
|
||||||
|
* @directive 多个权限验证,满足一个则显示(v-auths="['xxx','xxx']")
|
||||||
|
* @directive 多个权限验证,全部满足则显示(v-auths-all="['xxx','xxx']")
|
||||||
|
*/
|
||||||
export default {
|
export default {
|
||||||
mounted(el, binding) {
|
mounted (el, binding) {
|
||||||
const { value } = binding
|
if(permissionAll()){
|
||||||
if(Array.isArray(value)){
|
return
|
||||||
let ishas = false;
|
|
||||||
value.forEach(item => {
|
|
||||||
if(permission(item)){
|
|
||||||
ishas = true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (!ishas){
|
|
||||||
el.parentNode.removeChild(el)
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(!permission(value)){
|
|
||||||
el.parentNode.removeChild(el);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
let permissions = tool.data.get("PERMISSIONS");
|
||||||
|
if (!permissions.some((v) => v === binding.value)) el.parentNode.removeChild(el);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { permissionAll } from '@/utils/permission'
|
||||||
|
import tool from '@/utils/tool';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户权限指令
|
||||||
|
* @directive 单个权限验证(v-auth="'xxx'")
|
||||||
|
* @directive 多个权限验证,满足一个则显示(v-auths="['xxx','xxx']")
|
||||||
|
* @directive 多个权限验证,全部满足则显示(v-auths-all="['xxx','xxx']")
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
mounted (el, binding) {
|
||||||
|
if(permissionAll()){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let permissions = tool.data.get("PERMISSIONS");
|
||||||
|
let flag = false;
|
||||||
|
permissions.map((val) => {
|
||||||
|
binding.value.map((v) => {
|
||||||
|
if (val === v) flag = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (!flag) el.parentNode.removeChild(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { permissionAll, judementSameArr } from '@/utils/permission'
|
||||||
|
import tool from '@/utils/tool';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户权限指令
|
||||||
|
* @directive 单个权限验证(v-auth="'xxx'")
|
||||||
|
* @directive 多个权限验证,满足一个则显示(v-auths="['xxx','xxx']")
|
||||||
|
* @directive 多个权限验证,全部满足则显示(v-auths-all="['xxx','xxx']")
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
mounted (el, binding) {
|
||||||
|
if(permissionAll()){
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let permissions = tool.data.get("PERMISSIONS");
|
||||||
|
const flag = judementSameArr(binding.value, permissions);
|
||||||
|
if (!flag) el.parentNode.removeChild(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,12 +8,14 @@
|
||||||
<el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon>
|
<el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon>
|
||||||
<template #title>
|
<template #title>
|
||||||
<span>{{navMenu.meta.title}}</span>
|
<span>{{navMenu.meta.title}}</span>
|
||||||
|
<span v-if="navMenu.meta.tag" class="menu-tag">{{navMenu.meta.tag}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-sub-menu v-else :index="navMenu.path">
|
<el-sub-menu v-else :index="navMenu.path">
|
||||||
<template #title>
|
<template #title>
|
||||||
<el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon>
|
<el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon>
|
||||||
<span>{{navMenu.meta.title}}</span>
|
<span>{{navMenu.meta.title}}</span>
|
||||||
|
<span v-if="navMenu.meta.tag" class="menu-tag">{{navMenu.meta.tag}}</span>
|
||||||
</template>
|
</template>
|
||||||
<NavMenu :navMenus="navMenu.children"></NavMenu>
|
<NavMenu :navMenus="navMenu.children"></NavMenu>
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,10 @@
|
||||||
this.$TOOL.data.set("APP_LANG", val);
|
this.$TOOL.data.set("APP_LANG", val);
|
||||||
},
|
},
|
||||||
colorPrimary(val){
|
colorPrimary(val){
|
||||||
|
if(!val){
|
||||||
|
val = '#409EFF'
|
||||||
|
this.colorPrimary = '#409EFF'
|
||||||
|
}
|
||||||
document.documentElement.style.setProperty('--el-color-primary', val);
|
document.documentElement.style.setProperty('--el-color-primary', val);
|
||||||
for (let i = 1; i <= 9; i++) {
|
for (let i = 1; i <= 9; i++) {
|
||||||
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(val,i/10));
|
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(val,i/10));
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="adminui-tags">
|
<div class="adminui-tags">
|
||||||
<el-tooltip v-model:visible="tipVisible" placement="bottom-end" effect="light">
|
<ul ref="tags">
|
||||||
<ul ref="tags">
|
<li v-for="tag in tagList" v-bind:key="tag" :class="[isActive(tag)?'active':'',tag.meta.affix?'affix':'' ]" @contextmenu.prevent="openContextMenu($event, tag)">
|
||||||
<li v-for="tag in tagList" v-bind:key="tag" :class="[isActive(tag)?'active':'',tag.meta.affix?'affix':'' ]" @contextmenu.prevent="openContextMenu($event, tag)">
|
<router-link :to="tag">
|
||||||
<router-link :to="tag">
|
<span>{{ tag.meta.title }}</span>
|
||||||
<span>{{ tag.meta.title }}</span>
|
<el-icon v-if="!tag.meta.affix" @click.prevent.stop='closeSelectedTag(tag)'><el-icon-close/></el-icon>
|
||||||
<el-icon v-if="!tag.meta.affix" @click.prevent.stop='closeSelectedTag(tag)'><el-icon-close/></el-icon>
|
</router-link>
|
||||||
</router-link>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
|
||||||
<template #content>
|
|
||||||
<div class="tags-tip">
|
|
||||||
<p>当前标签过多,可通过鼠标滚轴滚动</p>
|
|
||||||
<el-button size="small" type="primary" plain @click="hideTip">知道了</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<transition name="el-zoom-in-top">
|
<transition name="el-zoom-in-top">
|
||||||
|
|
@ -43,7 +35,6 @@
|
||||||
left: 0,
|
left: 0,
|
||||||
top: 0,
|
top: 0,
|
||||||
tagList: this.$store.state.viewTags.viewTags,
|
tagList: this.$store.state.viewTags.viewTags,
|
||||||
tipVisible: false,
|
|
||||||
tipDisplayed: false
|
tipDisplayed: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -60,23 +51,30 @@
|
||||||
targetTag.scrollIntoView()
|
targetTag.scrollIntoView()
|
||||||
//显示提示
|
//显示提示
|
||||||
if(!this.tipDisplayed){
|
if(!this.tipDisplayed){
|
||||||
this.tipVisible = true
|
this.$msgbox({
|
||||||
|
type: 'warning',
|
||||||
|
center: true,
|
||||||
|
title: '提示',
|
||||||
|
message: '当前标签数量过多,可通过鼠标滚轴滚动标签栏。关闭标签数量可减少系统性能消耗。',
|
||||||
|
confirmButtonText: '知道了'
|
||||||
|
})
|
||||||
|
this.tipDisplayed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
contextMenuVisible(value) {
|
contextMenuVisible(value) {
|
||||||
var _this = this;
|
const cm = (e) => {
|
||||||
var cm = function(e){
|
const sp = document.getElementById("contextmenu");
|
||||||
let sp = document.getElementById("contextmenu");
|
if (sp && !sp.contains(e.target)) {
|
||||||
if(sp&&!sp.contains(e.target)){
|
this.closeMenu()
|
||||||
_this.closeMenu()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.addEventListener('click', e=>cm(e))
|
document.body.addEventListener('click', e => cm(e))
|
||||||
}else{
|
} else {
|
||||||
document.body.removeEventListener('click', e=>cm(e))
|
document.body.removeEventListener('click', e => cm(e))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -126,13 +124,14 @@
|
||||||
},
|
},
|
||||||
//关闭tag
|
//关闭tag
|
||||||
closeSelectedTag(tag, autoPushLatestView=true) {
|
closeSelectedTag(tag, autoPushLatestView=true) {
|
||||||
|
const nowTagIndex = this.tagList.findIndex(item => item.fullPath == tag.fullPath)
|
||||||
this.$store.commit("removeViewTags", tag)
|
this.$store.commit("removeViewTags", tag)
|
||||||
this.$store.commit("removeIframeList", tag)
|
this.$store.commit("removeIframeList", tag)
|
||||||
this.$store.commit("removeKeepLive", tag.name)
|
this.$store.commit("removeKeepLive", tag.name)
|
||||||
if (autoPushLatestView && this.isActive(tag)) {
|
if (autoPushLatestView && this.isActive(tag)) {
|
||||||
const latestView = this.tagList.slice(-1)[0]
|
const leftView = this.tagList[nowTagIndex - 1]
|
||||||
if (latestView) {
|
if (leftView) {
|
||||||
this.$router.push(latestView)
|
this.$router.push(leftView)
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/')
|
this.$router.push('/')
|
||||||
}
|
}
|
||||||
|
|
@ -160,24 +159,24 @@
|
||||||
this.contextMenuVisible = false
|
this.contextMenuVisible = false
|
||||||
},
|
},
|
||||||
//TAB 刷新
|
//TAB 刷新
|
||||||
refreshTab(){
|
refreshTab() {
|
||||||
var nowTag = this.contextMenuItem;
|
|
||||||
this.contextMenuVisible = false
|
this.contextMenuVisible = false
|
||||||
|
const nowTag = this.contextMenuItem;
|
||||||
//判断是否当前路由,否的话跳转
|
//判断是否当前路由,否的话跳转
|
||||||
if(this.$route.fullPath != nowTag.fullPath){
|
if (this.$route.fullPath !== nowTag.fullPath) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: nowTag.fullPath,
|
path: nowTag.fullPath,
|
||||||
query: nowTag.query
|
query: nowTag.query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$store.commit("refreshIframe", nowTag)
|
this.$store.commit("refreshIframe", nowTag)
|
||||||
var _this = this;
|
setTimeout(() => {
|
||||||
setTimeout(function() {
|
this.$store.commit("removeKeepLive", nowTag.name)
|
||||||
_this.$store.commit("removeKeepLive", nowTag.name)
|
this.$store.commit("setRouteShow", false)
|
||||||
_this.$store.commit("setRouteShow", false)
|
this.$nextTick(() => {
|
||||||
_this.$nextTick(() => {
|
this.$store.commit("pushKeepLive", nowTag.name)
|
||||||
_this.$store.commit("pushKeepLive",nowTag.name)
|
this.$store.commit("setRouteShow", true)
|
||||||
_this.$store.commit("setRouteShow", true)
|
|
||||||
})
|
})
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
|
|
@ -249,10 +248,6 @@
|
||||||
}
|
}
|
||||||
scrollDiv.scrollLeft += step;
|
scrollDiv.scrollLeft += step;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
hideTip(){
|
|
||||||
this.tipVisible = false
|
|
||||||
this.tipDisplayed = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<template>
|
||||||
|
<el-container v-loading="loading">
|
||||||
|
<el-main>
|
||||||
|
<el-empty v-if="tasks.length==0" :image-size="120" >
|
||||||
|
<template #description>
|
||||||
|
<h2>没有正在执行的任务</h2>
|
||||||
|
</template>
|
||||||
|
<p style="font-size: 14px;color: #999;line-height: 1.5;margin: 0 40px;">在处理耗时过久的任务时为了不阻碍正在处理的工作,可在任务中心进行异步执行。</p>
|
||||||
|
</el-empty>
|
||||||
|
<el-card v-for="task in tasks" :key="task.id" shadow="hover" class="user-bar-tasks-item">
|
||||||
|
<div class="user-bar-tasks-item-body">
|
||||||
|
<div class="taskIcon">
|
||||||
|
<el-icon v-if="task.type=='export'" :size="20"><el-icon-paperclip /></el-icon>
|
||||||
|
<el-icon v-if="task.type=='report'" :size="20"><el-icon-dataAnalysis /></el-icon>
|
||||||
|
</div>
|
||||||
|
<div class="taskMain">
|
||||||
|
<div class="title">
|
||||||
|
<h2>{{ task.taskName }}</h2>
|
||||||
|
<p><span v-time.tip="task.createDate"></span> 创建</p>
|
||||||
|
</div>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="state">
|
||||||
|
<el-tag type="info" v-if="task.state=='0'">执行中</el-tag>
|
||||||
|
<el-tag v-if="task.state=='1'">完成</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="handler">
|
||||||
|
<el-button v-if="task.state=='1'" type="primary" circle icon="el-icon-download" @click="download(task)"></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-main>
|
||||||
|
<el-footer style="padding:10px;text-align: right;">
|
||||||
|
<el-button circle icon="el-icon-refresh" @click="refresh"></el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
tasks: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getData(){
|
||||||
|
this.loading = true
|
||||||
|
var res = await this.$API.system.tasks.list.get()
|
||||||
|
this.tasks = res.data
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
refresh(){
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
download(row){
|
||||||
|
let a = document.createElement("a")
|
||||||
|
a.style = "display: none"
|
||||||
|
a.target = "_blank"
|
||||||
|
a.href = row.result
|
||||||
|
document.body.appendChild(a)
|
||||||
|
a.click()
|
||||||
|
document.body.removeChild(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.user-bar-tasks-item {margin-bottom: 10px;}
|
||||||
|
.user-bar-tasks-item:hover {border-color: var(--el-color-primary);}
|
||||||
|
.user-bar-tasks-item-body {display: flex;}
|
||||||
|
.user-bar-tasks-item-body .taskIcon {width: 45px;height: 45px;background: var(--el-color-primary-light-9);margin-right: 20px;display: flex;justify-content:center;align-items: center;color: var(--el-color-primary);border-radius:20px;}
|
||||||
|
.user-bar-tasks-item-body .taskMain {flex: 1;}
|
||||||
|
.user-bar-tasks-item-body .title h2 {font-size: 15px;}
|
||||||
|
.user-bar-tasks-item-body .title p {font-size: 12px;color: #999;margin-top: 5px;}
|
||||||
|
.user-bar-tasks-item-body .bottom {display: flex;justify-content: space-between;align-items: center;padding-top: 20px;}
|
||||||
|
</style>
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="adminui-topbar">
|
<div class="adminui-topbar">
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-breadcrumb separator-icon="el-icon-arrow-right" class="hidden-sm-and-down">
|
<el-breadcrumb separator-icon="el-icon-arrow-right" class="hidden-sm-and-down">
|
||||||
<transition-group name="breadcrumb" mode="out-in">
|
<transition-group name="breadcrumb">
|
||||||
<template v-for="item in breadList" :key="item.title" >
|
<template v-for="item in breadList" :key="item.title" >
|
||||||
<el-breadcrumb-item v-if="item.path!='/' && !item.meta.hiddenBreadcrumb" :key="item.meta.title"><el-icon class="icon" v-if="item.meta.icon"><component :is="item.meta.icon" /></el-icon>{{item.meta.title}}</el-breadcrumb-item>
|
<el-breadcrumb-item v-if="item.path!='/' && !item.meta.hiddenBreadcrumb" :key="item.meta.title"><el-icon class="icon" v-if="item.meta.icon"><component :is="item.meta.icon" /></el-icon>{{item.meta.title}}</el-breadcrumb-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,8 @@
|
||||||
<el-drawer title="布局实时演示" v-model="settingDialog" :size="400" append-to-body destroy-on-close>
|
<el-drawer title="布局实时演示" v-model="settingDialog" :size="400" append-to-body destroy-on-close>
|
||||||
<setting></setting>
|
<setting></setting>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
<auto-exit></auto-exit>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -197,6 +199,7 @@
|
||||||
import userbar from './components/userbar.vue';
|
import userbar from './components/userbar.vue';
|
||||||
import setting from './components/setting.vue';
|
import setting from './components/setting.vue';
|
||||||
import iframeView from './components/iframeView.vue';
|
import iframeView from './components/iframeView.vue';
|
||||||
|
import autoExit from './other/autoExit.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'index',
|
name: 'index',
|
||||||
|
|
@ -207,7 +210,8 @@
|
||||||
NavMenu,
|
NavMenu,
|
||||||
userbar,
|
userbar,
|
||||||
setting,
|
setting,
|
||||||
iframeView
|
iframeView,
|
||||||
|
autoExit
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
export default {
|
||||||
|
render() {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
logoutCount: this.$TOOL.data.get('AUTO_EXIT')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if(this.logoutCount){
|
||||||
|
this.setNewAutoExitTime()
|
||||||
|
document.onclick = () => {
|
||||||
|
this.setNewAutoExitTime()
|
||||||
|
}
|
||||||
|
document.onmousemove = () => {
|
||||||
|
this.setNewAutoExitTime()
|
||||||
|
}
|
||||||
|
document.onkeydown = () => {
|
||||||
|
this.setNewAutoExitTime()
|
||||||
|
}
|
||||||
|
document.onscroll = () => {
|
||||||
|
this.setNewAutoExitTime()
|
||||||
|
}
|
||||||
|
window.autoExitTimer = window.setInterval(this.autoExitfun, 1000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
if(this.logoutCount){
|
||||||
|
clearInterval(window.autoExitTimer)
|
||||||
|
window.autoExitTimer = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setNewAutoExitTime(){
|
||||||
|
window.autoExitTime = new Date().getTime()
|
||||||
|
},
|
||||||
|
autoExitfun(){
|
||||||
|
if(new Date().getTime() - window.autoExitTime > this.logoutCount * 60 * 1000){
|
||||||
|
clearInterval(window.autoExitTimer)
|
||||||
|
window.autoExitTimer = null
|
||||||
|
this.$router.replace({path: '/login'})
|
||||||
|
this.$alert("用户长时间无操作,为保证账户安全,系统已自动登出。", "提示", {
|
||||||
|
type: 'warning',
|
||||||
|
center: true,
|
||||||
|
roundButton: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { createApp } from 'vue'
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
import 'element-plus/theme-chalk/display.css'
|
import 'element-plus/theme-chalk/display.css'
|
||||||
|
|
@ -6,7 +7,6 @@ import ehsui from './ehs'
|
||||||
import i18n from './locales'
|
import i18n from './locales'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import { createApp } from 'vue'
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||||
|
|
||||||
|
|
|
||||||
12
src/scui.js
12
src/scui.js
|
|
@ -27,6 +27,8 @@ import scTrend from './components/scMini/scTrend'
|
||||||
import scFire from './components/scOpl/scFire'
|
import scFire from './components/scOpl/scFire'
|
||||||
|
|
||||||
import auth from './directives/auth'
|
import auth from './directives/auth'
|
||||||
|
import auths from './directives/auths'
|
||||||
|
import authsAll from './directives/authsAll'
|
||||||
import role from './directives/role'
|
import role from './directives/role'
|
||||||
import time from './directives/time'
|
import time from './directives/time'
|
||||||
import copy from './directives/copy'
|
import copy from './directives/copy'
|
||||||
|
|
@ -68,10 +70,12 @@ export default {
|
||||||
app.component('scFire', scFire);
|
app.component('scFire', scFire);
|
||||||
|
|
||||||
//注册全局指令
|
//注册全局指令
|
||||||
app.directive('auth', auth);
|
app.directive('auth', auth)
|
||||||
app.directive('role', role);
|
app.directive('auths', auths)
|
||||||
app.directive('time', time);
|
app.directive('auths-all', authsAll)
|
||||||
app.directive('copy', copy);
|
app.directive('role', role)
|
||||||
|
app.directive('time', time)
|
||||||
|
app.directive('copy', copy)
|
||||||
|
|
||||||
//统一注册el-icon图标
|
//统一注册el-icon图标
|
||||||
for(let icon in elIcons){
|
for(let icon in elIcons){
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,20 @@
|
||||||
|
import router from '@/router'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
state: {
|
state: {
|
||||||
viewTags: []
|
viewTags: []
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
pushViewTags(state, route){
|
pushViewTags(state, route){
|
||||||
|
let backPathIndex = state.viewTags.findIndex(item => item.fullPath == router.options.history.state.back)
|
||||||
let target = state.viewTags.find((item) => item.fullPath === route.fullPath)
|
let target = state.viewTags.find((item) => item.fullPath === route.fullPath)
|
||||||
let isName = route.name
|
let isName = route.name
|
||||||
if(!target && isName){
|
if(!target && isName){
|
||||||
state.viewTags.push(route)
|
if(backPathIndex == -1){
|
||||||
|
state.viewTags.push(route)
|
||||||
|
}else{
|
||||||
|
state.viewTags.splice(backPathIndex+1, 0, route)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeViewTags(state, route){
|
removeViewTags(state, route){
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo
|
||||||
.adminui-side-bottom i {font-size: 16px;}
|
.adminui-side-bottom i {font-size: 16px;}
|
||||||
.adminui-side-bottom:hover {color: var(--el-color-primary);}
|
.adminui-side-bottom:hover {color: var(--el-color-primary);}
|
||||||
.aminui-side.isCollapse {width: 65px;}
|
.aminui-side.isCollapse {width: 65px;}
|
||||||
|
.el-menu .menu-tag {position: absolute;height: 18px;line-height: 18px;background: var(--el-color-danger);font-size: 12px;color: #fff;right: 20px;border-radius:18px;padding:0 6px;}
|
||||||
|
.el-menu .el-sub-menu__title .menu-tag {right: 40px;}
|
||||||
|
.el-menu--horizontal > li .menu-tag {display: none;}
|
||||||
|
|
||||||
/* 右侧内容 */
|
/* 右侧内容 */
|
||||||
.aminui-body {flex: 1;display: flex;flex-flow: column;}
|
.aminui-body {flex: 1;display: flex;flex-flow: column;}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,11 @@ html.dark {
|
||||||
.adminui-main {background: var(--el-bg-color);}
|
.adminui-main {background: var(--el-bg-color);}
|
||||||
.drawerBG {background: var(--el-bg-color);}
|
.drawerBG {background: var(--el-bg-color);}
|
||||||
.adminui-header-menu .el-menu {--el-menu-bg-color:var(--el-bg-color-overlay) !important;--el-menu-hover-bg-color: #171819 !important;}
|
.adminui-header-menu .el-menu {--el-menu-bg-color:var(--el-bg-color-overlay) !important;--el-menu-hover-bg-color: #171819 !important;}
|
||||||
|
.adminui-header-menu .el-menu .el-sub-menu__title {background-color:transparent !important;}
|
||||||
|
|
||||||
|
//全局滚动条样式
|
||||||
|
::-webkit-scrollbar-thumb {background-color: rgba(163, 166, 173, 0.3);}
|
||||||
|
::-webkit-scrollbar-thumb:hover {background-color: rgba(163, 166, 173, 0.5);}
|
||||||
|
|
||||||
//组件
|
//组件
|
||||||
.el-header, .el-main.nopadding, .el-footer {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
.el-header, .el-main.nopadding, .el-footer {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,9 @@
|
||||||
background-color: var(--el-color-primary) !important;
|
background-color: var(--el-color-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 全部禁用el-tag动画 */
|
||||||
|
.el-tag {transition: all 0s !important;}
|
||||||
|
|
||||||
/* 覆盖tinymce样式 */
|
/* 覆盖tinymce样式 */
|
||||||
.sceditor .tox-tinymce {
|
.sceditor .tox-tinymce {
|
||||||
border: 1px solid #DCDFE6;
|
border: 1px solid #DCDFE6;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,37 @@
|
||||||
import tool from '@/utils/tool';
|
import tool from '@/utils/tool';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否含有不限分类,有则表示全部允许通过
|
||||||
|
*/
|
||||||
|
export function permissionAll() {
|
||||||
|
const allPermissions = "*/*/*"
|
||||||
|
let permissions = tool.data.get("PERMISSIONS");
|
||||||
|
return permissions.includes(allPermissions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比对两组数据是否一致
|
||||||
|
* @param news
|
||||||
|
* @param old
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export function judementSameArr(news, old) {
|
||||||
|
// console.log(news)
|
||||||
|
// console.log(old)
|
||||||
|
let count = 0;
|
||||||
|
const leng = news.length;
|
||||||
|
for (let i in news) {
|
||||||
|
for (let j in old) {
|
||||||
|
if (news[i] === old[j]) {
|
||||||
|
count++;
|
||||||
|
// console.log(news[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log('相同的数量', count)
|
||||||
|
return count === leng;
|
||||||
|
}
|
||||||
|
|
||||||
export function permission(data) {
|
export function permission(data) {
|
||||||
let permissions = tool.data.get("PERMISSIONS");
|
let permissions = tool.data.get("PERMISSIONS");
|
||||||
if (permissions.indexOf('superuser')>-1){
|
if (permissions.indexOf('superuser')>-1){
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ axios.interceptors.request.use(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//FIX 多个API同时401时疯狂弹窗BUG
|
||||||
|
let MessageBox_401_show = false
|
||||||
|
|
||||||
// HTTP response 拦截器
|
// HTTP response 拦截器
|
||||||
axios.interceptors.response.use(
|
axios.interceptors.response.use(
|
||||||
(response) => {
|
(response) => {
|
||||||
|
|
@ -108,9 +111,9 @@ axios.interceptors.response.use(
|
||||||
var http = {
|
var http = {
|
||||||
|
|
||||||
/** get 请求
|
/** get 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {请求参数} params
|
* @param {object} params 请求参数
|
||||||
* @param {参数} config
|
* @param {object} config 参数
|
||||||
*/
|
*/
|
||||||
get: function(url, params={}, config={}) {
|
get: function(url, params={}, config={}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -128,9 +131,9 @@ var http = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/** post 请求
|
/** post 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {请求参数} data
|
* @param {object} data 请求参数
|
||||||
* @param {参数} config
|
* @param {object} config 参数
|
||||||
*/
|
*/
|
||||||
post: function(url, data={}, config={}) {
|
post: function(url, data={}, config={}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -148,9 +151,9 @@ var http = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/** put 请求
|
/** put 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {请求参数} data
|
* @param {object} data 请求参数
|
||||||
* @param {参数} config
|
* @param {object} config 参数
|
||||||
*/
|
*/
|
||||||
put: function(url, data={}, config={}) {
|
put: function(url, data={}, config={}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -168,9 +171,9 @@ var http = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/** patch 请求
|
/** patch 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {请求参数} data
|
* @param {object} data 请求参数
|
||||||
* @param {参数} config
|
* @param {object} config 参数
|
||||||
*/
|
*/
|
||||||
patch: function(url, data={}, config={}) {
|
patch: function(url, data={}, config={}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -188,9 +191,9 @@ var http = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/** delete 请求
|
/** delete 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {请求参数} data
|
* @param {object} data 请求参数
|
||||||
* @param {参数} config
|
* @param {object} config 参数
|
||||||
*/
|
*/
|
||||||
delete: function(url, data={}, config={}) {
|
delete: function(url, data={}, config={}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
@ -208,8 +211,8 @@ var http = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/** jsonp 请求
|
/** jsonp 请求
|
||||||
* @param {接口地址} url
|
* @param {string} url 接口地址
|
||||||
* @param {JSONP回调函数名称} name
|
* @param {string} name JSONP回调函数名称
|
||||||
*/
|
*/
|
||||||
jsonp: function(url, name='jsonp'){
|
jsonp: function(url, name='jsonp'){
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,8 @@
|
||||||
return allCompsList
|
return allCompsList
|
||||||
},
|
},
|
||||||
myCompsList(){
|
myCompsList(){
|
||||||
return this.allCompsList.filter(item => !item.disabled )
|
var myGrid = this.$TOOL.data.get("DASHBOARDGRID")
|
||||||
|
return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key))
|
||||||
},
|
},
|
||||||
nowCompsList(){
|
nowCompsList(){
|
||||||
return this.grid.copmsList.reduce(function(a, b){return a.concat(b)})
|
return this.grid.copmsList.reduce(function(a, b){return a.concat(b)})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
|
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
|
||||||
<el-form-item prop="phone">
|
<el-form-item prop="phone">
|
||||||
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
|
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
|
||||||
<template #prepend>+86</template>
|
<template #prepend>+86</template>
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ import passwordForm from './components/passwordForm'
|
||||||
this.$TOOL.data.remove("USER_INFO")
|
this.$TOOL.data.remove("USER_INFO")
|
||||||
this.$TOOL.data.remove("MENU")
|
this.$TOOL.data.remove("MENU")
|
||||||
this.$TOOL.data.remove("PERMISSIONS")
|
this.$TOOL.data.remove("PERMISSIONS")
|
||||||
|
this.$TOOL.data.remove("DASHBOARDGRID")
|
||||||
this.$TOOL.data.remove("grid")
|
this.$TOOL.data.remove("grid")
|
||||||
this.$store.commit("clearViewTags")
|
this.$store.commit("clearViewTags")
|
||||||
this.$store.commit("clearKeepLive")
|
this.$store.commit("clearKeepLive")
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,12 @@
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-card shadow="never" header="v-auth 高精度权限控制">
|
<el-card shadow="never" header="v-auth 高精度权限控制">
|
||||||
<el-button v-auth="'user.add'" type="primary">v-auth="'user.add'"</el-button>
|
<el-button v-auth="'user.add'" type="primary">v-auth="'user.add'"</el-button>
|
||||||
<el-button v-auth="['user.no','user.add']" type="primary">v-auth="['user.no','user.add']"</el-button>
|
<el-button v-auths="['user.no','user.add']" type="primary">v-auths="['user.no','user.add']"</el-button>
|
||||||
<el-alert title="v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 使用指令将减少代码冗余. 并且支持传入数组,有一项满足就判断有权限" style="margin-top: 20px;"></el-alert>
|
<el-button v-auths-all="['list.add','user.add']" type="primary">v-auths-all="['list.add','user.add']"</el-button>
|
||||||
|
|
||||||
|
<el-alert title="v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 判断单项权限,如果满足就判断有权限" style="margin-top: 20px;"></el-alert>
|
||||||
|
<el-alert title="v-auths指令 传入数组,有一项满足就判断有权限" style="margin-top: 20px;"></el-alert>
|
||||||
|
<el-alert title="v-auths-all指令 传入数组,必须全满足才有权限,比如user.no没有这个权限,加到这里的话就表示不全部满足" style="margin-top: 20px;"></el-alert>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card shadow="never" header="v-role 角色权限控制" style="margin-top: 15px;">
|
<el-card shadow="never" header="v-role 角色权限控制" style="margin-top: 15px;">
|
||||||
<el-button v-role="'admin'" type="primary">v-role="'admin'"</el-button>
|
<el-button v-role="'admin'" type="primary">v-role="'admin'"</el-button>
|
||||||
|
|
@ -34,20 +38,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'directive',
|
name: 'directive',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
time1: new Date(),
|
time1: new Date(),
|
||||||
time2: new Date().setMinutes(new Date().getMinutes()-1),
|
time2: new Date().setMinutes(new Date().getMinutes()-1),
|
||||||
time3: new Date().setMinutes(new Date().getMinutes()-120),
|
time3: new Date().setMinutes(new Date().getMinutes()-120),
|
||||||
copyText: '测试复制内容'
|
copyText: '测试复制内容'
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
// ╭───这两个字符串要一致───╮
|
// ╭───这两个字符串要一致───╮
|
||||||
var BMapGL = await loadJS(`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${ak}&callback=BMapGLinit`, "BMapGL", "BMapGLinit")
|
var BMapGL = await loadJS(`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${ak}&callback=BMapGLinit`, "BMapGL", "BMapGLinit")
|
||||||
//像BMapGLLib就没有callback,无需第3个参数
|
//像BMapGLLib就没有callback,无需第3个参数
|
||||||
var BMapGLLib = await loadJS("//api.map.baidu.com/library/LuShu/gl/src/LuShu_min.js", "BMapGLLib")
|
//var BMapGLLib = await loadJS("//api.map.baidu.com/library/LuShu/gl/src/LuShu_min.js", "BMapGLLib")
|
||||||
|
|
||||||
|
|
||||||
var map = new BMapGL.Map('container')
|
var map = new BMapGL.Map('container')
|
||||||
|
|
@ -51,48 +51,6 @@
|
||||||
poiText: false,
|
poiText: false,
|
||||||
poiIcon: false
|
poiIcon: false
|
||||||
})
|
})
|
||||||
|
|
||||||
var path = [{
|
|
||||||
'lng': 116.297611,
|
|
||||||
'lat': 40.047363
|
|
||||||
}, {
|
|
||||||
'lng': 116.302839,
|
|
||||||
'lat': 40.048219
|
|
||||||
}, {
|
|
||||||
'lng': 116.308301,
|
|
||||||
'lat': 40.050566
|
|
||||||
}, {
|
|
||||||
'lng': 116.305732,
|
|
||||||
'lat': 40.054957
|
|
||||||
}, {
|
|
||||||
'lng': 116.304754,
|
|
||||||
'lat': 40.057953
|
|
||||||
}, {
|
|
||||||
'lng': 116.306487,
|
|
||||||
'lat': 40.058312
|
|
||||||
}, {
|
|
||||||
'lng': 116.307223,
|
|
||||||
'lat': 40.056379
|
|
||||||
}];
|
|
||||||
var point = [];
|
|
||||||
for (var i = 0; i < path.length; i++) {
|
|
||||||
point.push(new BMapGL.Point(path[i].lng, path[i].lat));
|
|
||||||
}
|
|
||||||
var pl = new BMapGL.Polyline(point, {
|
|
||||||
strokeColor: "blue",
|
|
||||||
strokeWeight: 10,
|
|
||||||
strokeOpacity: 0.5
|
|
||||||
});
|
|
||||||
map.addOverlay(pl);
|
|
||||||
var lushu = new BMapGLLib.LuShu(map, pl.getPath(), {
|
|
||||||
autoCenter: true,
|
|
||||||
icon : new BMapGL.Icon('img/logo.png', new BMapGL.Size(30,30)),
|
|
||||||
speed: 30,
|
|
||||||
enableRotation: true
|
|
||||||
});
|
|
||||||
setTimeout(()=>{
|
|
||||||
lushu.start()
|
|
||||||
},1000)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.menu:deep(.el-tree-node__label) {display: flex;flex: 1;height:100%;}
|
||||||
.custom-tree-node {display: flex;flex: 1;align-items: center;justify-content: space-between;font-size: 14px;padding-right: 24px;height:100%;}
|
.custom-tree-node {display: flex;flex: 1;align-items: center;justify-content: space-between;font-size: 14px;padding-right: 24px;height:100%;}
|
||||||
.custom-tree-node .code {font-size: 12px;color: #999;}
|
.custom-tree-node .code {font-size: 12px;color: #999;}
|
||||||
.custom-tree-node .do {display: none;}
|
.custom-tree-node .do {display: none;}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
<el-tree ref="menu" class="menu" node-key="id" :data="menuList" :props="menuProps" draggable highlight-current :expand-on-click-node="false" check-strictly show-checkbox :filter-node-method="menuFilterNode" @node-click="menuClick" @node-drop="nodeDrop">
|
<el-tree ref="menu" class="menu" node-key="id" :data="menuList" :props="menuProps" draggable highlight-current :expand-on-click-node="false" check-strictly show-checkbox :filter-node-method="menuFilterNode" @node-click="menuClick" @node-drop="nodeDrop">
|
||||||
|
|
||||||
<template #default="{node, data}">
|
<template #default="{node, data}">
|
||||||
<span class="custom-tree-node el-tree-node__label">
|
<span class="custom-tree-node">
|
||||||
<span class="label">
|
<span class="label">
|
||||||
{{ node.label }}
|
{{ node.label }}
|
||||||
</span>
|
</span>
|
||||||
<span class="do">
|
<span class="do">
|
||||||
<el-icon @click.stop="add(node, data)"><el-icon-plus /></el-icon>
|
<el-button icon="el-icon-plus" size="small" @click.stop="add(node, data)"></el-button>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -153,7 +153,8 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.custom-tree-node {display: flex;flex: 1;align-items: center;justify-content: space-between;font-size: 14px;padding-right: 24px;height:100%;}
|
.menu:deep(.el-tree-node__label) {display: flex;flex: 1;height:100%;}
|
||||||
|
.custom-tree-node {display: flex;flex: 1;align-items: center;justify-content: space-between;font-size: 14px;height:100%;padding-right:24px;}
|
||||||
.custom-tree-node .label {display: flex;align-items: center;;height: 100%;}
|
.custom-tree-node .label {display: flex;align-items: center;;height: 100%;}
|
||||||
.custom-tree-node .label .el-tag {margin-left: 5px;}
|
.custom-tree-node .label .el-tag {margin-left: 5px;}
|
||||||
.custom-tree-node .do {display: none;}
|
.custom-tree-node .do {display: none;}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@
|
||||||
<el-checkbox v-model="form.meta.hiddenBreadcrumb">隐藏面包屑</el-checkbox>
|
<el-checkbox v-model="form.meta.hiddenBreadcrumb">隐藏面包屑</el-checkbox>
|
||||||
<div class="el-form-item-msg">菜单不显示在导航中,但用户依然可以访问,例如详情页</div>
|
<div class="el-form-item-msg">菜单不显示在导航中,但用户依然可以访问,例如详情页</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="整页路由" prop="fullpage">
|
||||||
|
<el-switch v-model="form.meta.fullpage" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="标签" prop="tag">
|
||||||
|
<el-input v-model="form.meta.tag" clearable placeholder=""></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="save" :loading="loading">保 存</el-button>
|
<el-button type="primary" @click="save" :loading="loading">保 存</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -103,7 +109,9 @@
|
||||||
icon: "",
|
icon: "",
|
||||||
active: "",
|
active: "",
|
||||||
color: "",
|
color: "",
|
||||||
type: "menu"
|
type: "menu",
|
||||||
|
fullpage: false,
|
||||||
|
tag: "",
|
||||||
},
|
},
|
||||||
apiList: []
|
apiList: []
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,11 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="控制台模块">
|
||||||
|
<div class="treeMain">
|
||||||
|
<el-tree ref="grid" node-key="key" :data="grid.list" :props="grid.props" :default-checked-keys="grid.checked" show-checkbox></el-tree>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="控制台">
|
<el-tab-pane label="控制台">
|
||||||
<el-form label-width="100px" label-position="left">
|
<el-form label-width="100px" label-position="left">
|
||||||
<el-form-item label="控制台视图">
|
<el-form-item label="控制台视图">
|
||||||
|
|
@ -65,6 +70,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
grid: {
|
||||||
|
list: [],
|
||||||
|
checked: ["welcome", "ver", "time", "progress", "echarts", "about"],
|
||||||
|
props: {
|
||||||
|
label: (data)=>{
|
||||||
|
return data.title
|
||||||
|
},
|
||||||
|
disabled: (data)=>{
|
||||||
|
return data.isFixed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
dataType :"1",
|
dataType :"1",
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -91,6 +108,7 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getMenu()
|
this.getMenu()
|
||||||
this.getDept()
|
this.getDept()
|
||||||
|
this.getGrid()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(){
|
open(){
|
||||||
|
|
@ -132,6 +150,36 @@
|
||||||
let filterKeys = this.data.checked.filter(key => this.$refs.dept.getNode(key).isLeaf)
|
let filterKeys = this.data.checked.filter(key => this.$refs.dept.getNode(key).isLeaf)
|
||||||
this.$refs.dept.setCheckedKeys(filterKeys, true)
|
this.$refs.dept.setCheckedKeys(filterKeys, true)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getGrid(){
|
||||||
|
this.grid.list = [
|
||||||
|
{
|
||||||
|
key: "welcome",
|
||||||
|
title: "欢迎",
|
||||||
|
isFixed: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "ver",
|
||||||
|
title: "版本信息",
|
||||||
|
isFixed: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "time",
|
||||||
|
title: "时钟"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "progress",
|
||||||
|
title: "进度环"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "echarts",
|
||||||
|
title: "实时收入"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "about",
|
||||||
|
title: "关于项目"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
||||||
|
|
||||||
<el-drawer v-model="dialog.info" :size="800" title="详细" custom-class="drawerBG" direction="rtl" destroy-on-close>
|
<el-drawer v-model="dialog.info" :size="800" title="详细" direction="rtl" destroy-on-close>
|
||||||
<info ref="infoDialog"></info>
|
<info ref="infoDialog"></info>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<template>
|
||||||
|
<el-card shadow="never" header="修改密码">
|
||||||
|
<el-alert title="密码更新成功后,您将被重定向到登录页面,您可以使用新密码重新登录。" type="info" show-icon style="margin-bottom: 15px;"/>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" style="margin-top:20px;">
|
||||||
|
<el-form-item label="当前密码" prop="userPassword">
|
||||||
|
<el-input v-model="form.userPassword" type="password" show-password placeholder="请输入当前密码"></el-input>
|
||||||
|
<div class="el-form-item-msg">必须提供当前登录用户密码才能进行更改</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="新密码" prop="newPassword">
|
||||||
|
<el-input v-model="form.newPassword" type="password" show-password placeholder="请输入新密码"></el-input>
|
||||||
|
<sc-password-strength v-model="form.newPassword"></sc-password-strength>
|
||||||
|
<div class="el-form-item-msg">请输入包含英文、数字的8位以上密码</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="确认新密码" prop="confirmNewPassword">
|
||||||
|
<el-input v-model="form.confirmNewPassword" type="password" show-password placeholder="请再次输入新密码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="save">保存密码</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import scPasswordStrength from '@/components/scPasswordStrength'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
scPasswordStrength
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
userPassword: "",
|
||||||
|
newPassword: "",
|
||||||
|
confirmNewPassword: ""
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
userPassword: [
|
||||||
|
{ required: true, message: '请输入当前密码'}
|
||||||
|
],
|
||||||
|
newPassword: [
|
||||||
|
{ required: true, message: '请输入新密码'}
|
||||||
|
],
|
||||||
|
confirmNewPassword: [
|
||||||
|
{ required: true, message: '请再次输入新密码'},
|
||||||
|
{validator: (rule, value, callback) => {
|
||||||
|
if (value !== this.form.newPassword) {
|
||||||
|
callback(new Error('两次输入密码不一致'));
|
||||||
|
}else{
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
save(){
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.$alert("密码修改成功,是否跳转至登录页使用新密码登录", "修改成功", {
|
||||||
|
type: 'success',
|
||||||
|
center: true
|
||||||
|
}).then(() => {
|
||||||
|
this.$router.replace({
|
||||||
|
path: '/login'
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
<el-descriptions-item label="toolbar">自定义工具栏,使用"|"竖杠分割,使用"\"斜杠分组,默认:'undo redo | forecolor backcolor bold italic underline strikethrough link | blocks fontfamily fontsize | \
|
<el-descriptions-item label="toolbar">自定义工具栏,使用"|"竖杠分割,使用"\"斜杠分组,默认:'undo redo | forecolor backcolor bold italic underline strikethrough link | blocks fontfamily fontsize | \
|
||||||
alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | pagebreak | \
|
alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | pagebreak | \
|
||||||
image media table template preview | code selectall'</el-descriptions-item>
|
image media table template preview | code selectall'</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="options">支持tinymce的其他配置项</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-main>
|
</el-main>
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,10 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '开关',
|
label: '开关(可重复)',
|
||||||
value: 'switch',
|
value: 'switch',
|
||||||
type: 'switch',
|
type: 'switch',
|
||||||
|
repeat: true,
|
||||||
operator: '='
|
operator: '='
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -158,6 +159,16 @@
|
||||||
label: '日期范围',
|
label: '日期范围',
|
||||||
value: 'date2',
|
value: 'date2',
|
||||||
type: 'daterange'
|
type: 'daterange'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '自定义日期',
|
||||||
|
value: 'date3',
|
||||||
|
type: 'customDate',
|
||||||
|
placeholder: '请选择月份',
|
||||||
|
extend: {
|
||||||
|
dateType: 'month',
|
||||||
|
valueFormat: 'YYYY-MM'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<el-input v-model="form.title"></el-input>
|
<el-input v-model="form.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表格" prop="list">
|
<el-form-item label="表格" prop="list">
|
||||||
<sc-form-table v-model="form.list" :addTemplate="addTemplate" drag-sort placeholder="暂无数据">
|
<sc-form-table ref="table" v-model="form.list" :addTemplate="addTemplate" drag-sort placeholder="暂无数据">
|
||||||
<el-table-column prop="time" label="时间" width="180">
|
<el-table-column prop="time" label="时间" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-time-select v-model="scope.row.time"></el-time-select>
|
<el-time-select v-model="scope.row.time"></el-time-select>
|
||||||
|
|
@ -44,6 +44,10 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card shadow="never" header="方法" style="margin-top: 15px;">
|
||||||
|
<el-button type="primary" @click="pushRow">外部插入行</el-button>
|
||||||
|
<el-button type="primary" @click="deleteRow">外部删除第一行</el-button>
|
||||||
|
</el-card>
|
||||||
</el-main>
|
</el-main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -108,6 +112,19 @@
|
||||||
},
|
},
|
||||||
resetForm(){
|
resetForm(){
|
||||||
this.$refs.ruleForm.resetFields();
|
this.$refs.ruleForm.resetFields();
|
||||||
|
},
|
||||||
|
pushRow(){
|
||||||
|
const data = {
|
||||||
|
time: '18:00',
|
||||||
|
type: '1',
|
||||||
|
val: '0',
|
||||||
|
open: true,
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
this.$refs.table.pushRow(data)
|
||||||
|
},
|
||||||
|
deleteRow(){
|
||||||
|
this.$refs.table.deleteRow(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="图标" prop="icon">
|
<el-form-item label="图标" prop="icon">
|
||||||
<sc-icon-select v-model="form.icon" clearable :disabled="disabled"></sc-icon-select>
|
<sc-icon-select v-model="form.icon" :disabled="disabled"></sc-icon-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="submitForm">保存</el-button>
|
<el-button type="primary" @click="submitForm">保存</el-button>
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
icon: ''
|
icon: 'el-icon-apple'
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
icon: [
|
icon: [
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,12 @@
|
||||||
<el-col :lg="12">
|
<el-col :lg="12">
|
||||||
<el-card shadow="never" header="导出">
|
<el-card shadow="never" header="导出">
|
||||||
<sc-file-export :apiObj="$API.common.exportFile"></sc-file-export>
|
<sc-file-export :apiObj="$API.common.exportFile"></sc-file-export>
|
||||||
<sc-file-export :apiObj="$API.common.exportFile" blob fileName="人员列表" :data="{otherData:'demo'}" :column="column" :fileTypes="['xlsx','docx','pdf']">
|
<sc-file-export :apiObj="$API.common.exportFile" fileName="人员列表(异步)" async>
|
||||||
|
<template #default="{open}">
|
||||||
|
<el-button type="primary" icon="sc-icon-download" @click="open">导出(异步)</el-button>
|
||||||
|
</template>
|
||||||
|
</sc-file-export>
|
||||||
|
<sc-file-export :apiObj="$API.common.exportFile" blob fileName="人员列表" :data="{otherData:'demo'}" showData :column="column" :fileTypes="['xlsx','docx','pdf']">
|
||||||
<template #default="{open}">
|
<template #default="{open}">
|
||||||
<el-button type="primary" icon="sc-icon-download" @click="open">导出(blob文件流)</el-button>
|
<el-button type="primary" icon="sc-icon-download" @click="open">导出(blob文件流)</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -59,6 +64,8 @@
|
||||||
<el-descriptions :column="1" border size="small" style="margin-top: 15px;">
|
<el-descriptions :column="1" border size="small" style="margin-top: 15px;">
|
||||||
<el-descriptions-item label="apiObj" :width="200">Object 文件导出接口对象,通过apiObj.url请求文件</el-descriptions-item>
|
<el-descriptions-item label="apiObj" :width="200">Object 文件导出接口对象,通过apiObj.url请求文件</el-descriptions-item>
|
||||||
<el-descriptions-item label="data">Object 上传时附带的额外参数(可为数据表格的过滤项)</el-descriptions-item>
|
<el-descriptions-item label="data">Object 上传时附带的额外参数(可为数据表格的过滤项)</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="showData">Boolean 是否显示附带的额外参数</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="async">Boolean 是否异步导出文件</el-descriptions-item>
|
||||||
<el-descriptions-item label="fileName">String 下载文件名称,默认为当前时间戳</el-descriptions-item>
|
<el-descriptions-item label="fileName">String 下载文件名称,默认为当前时间戳</el-descriptions-item>
|
||||||
<el-descriptions-item label="fileTypes">Array 可选择文件类型,默认为['xlsx'],组件将数组第一项当做已选项</el-descriptions-item>
|
<el-descriptions-item label="fileTypes">Array 可选择文件类型,默认为['xlsx'],组件将数组第一项当做已选项</el-descriptions-item>
|
||||||
<el-descriptions-item label="column">Array 列配置,请求文件时将添加column为key的参数,值为prop逗号","分割的字符串</el-descriptions-item>
|
<el-descriptions-item label="column">Array 列配置,请求文件时将添加column为key的参数,值为prop逗号","分割的字符串</el-descriptions-item>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
<div style="height:15px"></div>
|
<div style="height:15px"></div>
|
||||||
<el-card shadow="never" header="多选">
|
<el-card shadow="never" header="多选">
|
||||||
<sc-table-select v-model="value" :apiObj="apiObj" :table-width="700" multiple :props="props" @change="change">
|
<sc-table-select v-model="value" :apiObj="apiObj" :table-width="700" multiple clearable collapse-tags collapse-tags-tooltip :props="props" @change="change">
|
||||||
<template #header="{form, submit}">
|
<template #header="{form, submit}">
|
||||||
<el-form :inline="true" :model="form">
|
<el-form :inline="true" :model="form">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,12 @@
|
||||||
</sc-upload-file>
|
</sc-upload-file>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" header="文件示例(值为对象数组,适合保存原始文件名)">
|
||||||
|
<sc-upload-file v-model="fileurlArr" :limit="3" tip="最多上传3个文件,单个文件不要超过10M,请上传xlsx/docx格式文件">
|
||||||
|
<el-button type="primary" icon="el-icon-upload">上传附件</el-button>
|
||||||
|
</sc-upload-file>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" header="图片卡片示例(已开启拖拽排序)">
|
<el-card shadow="never" header="图片卡片示例(已开启拖拽排序)">
|
||||||
<sc-upload-multiple v-model="fileurl2" draggable :limit="3" tip="最多上传3个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
<sc-upload-multiple v-model="fileurl2" draggable :limit="3" tip="最多上传3个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
@ -69,6 +75,16 @@
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uploadApi: this.$API.common.upload,
|
uploadApi: this.$API.common.upload,
|
||||||
|
fileurlArr: [
|
||||||
|
{
|
||||||
|
name: '销售合同模板.xlsx',
|
||||||
|
url: 'http://www.scuiadmin.com/files/220000198611262243.xlsx'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '企业员工联系方式.xlsx',
|
||||||
|
url: 'http://www.scuiadmin.com/files/350000201004261875.xlsx',
|
||||||
|
}
|
||||||
|
],
|
||||||
fileurl: "http://www.scuiadmin.com/files/220000198611262243.xlsx,http://www.scuiadmin.com/files/350000201004261875.xlsx",
|
fileurl: "http://www.scuiadmin.com/files/220000198611262243.xlsx,http://www.scuiadmin.com/files/350000201004261875.xlsx",
|
||||||
fileurl2: "img/auth_banner.jpg,img/avatar3.gif",
|
fileurl2: "img/auth_banner.jpg,img/avatar3.gif",
|
||||||
fileurl3: "img/auth_banner.jpg",
|
fileurl3: "img/auth_banner.jpg",
|
||||||
|
|
|
||||||
|
|
@ -1,326 +0,0 @@
|
||||||
<!--
|
|
||||||
<template>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
|
|
||||||
</div>
|
|
||||||
<div class="right-panel">
|
|
||||||
<div class="right-panel-search">
|
|
||||||
<el-input v-model="search.keyword" placeholder="工单名称" clearable></el-input>
|
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<el-tabs v-model="pageForm.category" type="card" @tab-click="handleClick">
|
|
||||||
<el-tab-pane label="待处理" name="duty"></el-tab-pane>
|
|
||||||
<el-tab-pane label="我处理" name="worked"></el-tab-pane>
|
|
||||||
<el-tab-pane label="我发起" name="owner"></el-tab-pane>
|
|
||||||
<el-tab-pane label="抄送我" name="cc"></el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<el-table
|
|
||||||
v-loading="listLoading"
|
|
||||||
:data="list"
|
|
||||||
fit
|
|
||||||
stripe
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-table-column label="工单标题" min-width="100" prop="title">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="当前状态" min-width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tag>{{states[scope.row.act_state]}}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="进行状态" min-width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.state_.type==0">{{scope.row.state_.name}}中</span>
|
|
||||||
<span v-else>已{{scope.row.state_.name}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="类型" min-width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
{{scope.row.workflow_.name}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" min-width="100" prop="create_time">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-link
|
|
||||||
v-if="scope.row.state_.distribute_type===1&&scope.row.participant_type===2"
|
|
||||||
type="danger"
|
|
||||||
@click="handleGetTicket(scope)"
|
|
||||||
>
|
|
||||||
接单
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
v-if="(scope.row.act_state===1||scope.row.act_state===3)&&scope.row.participant_type!==2&&scope.row.state_.type===0"
|
|
||||||
type="primary"
|
|
||||||
@click="handleDetail(scope)"
|
|
||||||
>
|
|
||||||
处理
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
v-if="scope.row.state_.type===1&&userId===1"
|
|
||||||
type="danger"
|
|
||||||
@click="handleClose(scope,'2')"
|
|
||||||
>
|
|
||||||
关闭
|
|
||||||
</el-link>
|
|
||||||
<!–如果state_.retreat为可退回,则显示撤回按钮 state_.type==1处于草稿状态 –>
|
|
||||||
<el-link
|
|
||||||
v-if="scope.row.state_.enable_retreat&&userId===scope.row.create_by&&scope.row.state_.type!==1"
|
|
||||||
type="danger"
|
|
||||||
@click="handleClose(scope,'1')"
|
|
||||||
>
|
|
||||||
撤回
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
type="primary"
|
|
||||||
@click="handleShow(scope)"
|
|
||||||
>
|
|
||||||
详情
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
type="success"
|
|
||||||
@click="handleDelete(scope)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
type="success"
|
|
||||||
@click="handlePicture(scope)"
|
|
||||||
>
|
|
||||||
查看流程图
|
|
||||||
</el-link>
|
|
||||||
<el-link
|
|
||||||
type="success"
|
|
||||||
@click="handleLogs(scope)"
|
|
||||||
>
|
|
||||||
工单日志
|
|
||||||
</el-link>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
background
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
:current-page.sync="pageForm.page"
|
|
||||||
:page-size="100"
|
|
||||||
layout="prev, pager, next, jumper"
|
|
||||||
:total="10">
|
|
||||||
</el-pagination>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
<el-dialog title="新增工单" v-model="limitedVisible" :width="600">
|
|
||||||
<el-form :model="addForm" :rules="rules" ref="addForm" label-width="100px" label-position="left">
|
|
||||||
<el-form-item label="名称" prop="name">
|
|
||||||
<el-input v-model="addForm.title" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="工作流" prop="workflow">
|
|
||||||
<el-select v-model="addForm.workflow" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
|
||||||
<el-button type="primary" :loading="isSaving" @click="submitHandle()">保 存</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'ticket',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
pageForm: {
|
|
||||||
page: 1,
|
|
||||||
page_size: 20,
|
|
||||||
workflow: '',
|
|
||||||
category: 'duty',
|
|
||||||
},
|
|
||||||
list:[
|
|
||||||
{id: 191,
|
|
||||||
title: "单片冷加工玻璃的重审",
|
|
||||||
sn: "hb_202201040002",
|
|
||||||
workflow: 5,
|
|
||||||
workflow_: {id: 5, name: "不合格品审理单"},
|
|
||||||
state: 20,
|
|
||||||
state_: {id: 20, name: "检验员确认", type: 0, distribute_type: 1, enable_retreat: false},
|
|
||||||
act_state: 1,
|
|
||||||
create_time: "2022-01-04 13:26:49",
|
|
||||||
update_time: "2022-01-04 13:26:49",
|
|
||||||
participant_type: 1,
|
|
||||||
create_by: 1
|
|
||||||
},
|
|
||||||
],//工单列表
|
|
||||||
options:[],//工作流
|
|
||||||
search: {
|
|
||||||
keyword: null
|
|
||||||
},
|
|
||||||
isSaving: false,
|
|
||||||
listLoading: false,
|
|
||||||
limitedVisible : false,
|
|
||||||
//表单数据
|
|
||||||
addForm: {
|
|
||||||
title: "",
|
|
||||||
workflow: "",
|
|
||||||
},
|
|
||||||
//验证规则
|
|
||||||
rules: {
|
|
||||||
title: [
|
|
||||||
{required: true, message: '请输入工单名称'}
|
|
||||||
],
|
|
||||||
workflow: [
|
|
||||||
{required: true, message: '请选择工单所属工作流'}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
logs: [
|
|
||||||
{
|
|
||||||
content: 'sssss 创建了物流记录 1',
|
|
||||||
timestamp: '2018-04-17'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: 'sssss 维护了客户信息',
|
|
||||||
timestamp: '2018-04-15'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: 'sssss 创建订单',
|
|
||||||
timestamp: '2018-04-15'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.getList();
|
|
||||||
// this.getWorkFlow();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleClick(tab, event) {
|
|
||||||
console.log(tab, event);
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/*//加载树数据
|
|
||||||
async getGroup() {
|
|
||||||
var res = await this.$API.system.dept.get({page: 0});
|
|
||||||
let postList = res;
|
|
||||||
let posts = [];
|
|
||||||
postList.forEach(item => {
|
|
||||||
let obj = new Object();
|
|
||||||
obj.id = item.id;
|
|
||||||
obj.name = item.name;
|
|
||||||
obj.parentId = item.parent;
|
|
||||||
obj.label=item.name;
|
|
||||||
posts.push(obj)
|
|
||||||
});
|
|
||||||
let obj = posts.reduce((res, v) => (res[v.id] = v , res), {});//Object
|
|
||||||
let arr = [];
|
|
||||||
// debugger;
|
|
||||||
console.log(obj);
|
|
||||||
for (let item of posts) {
|
|
||||||
debugger;
|
|
||||||
if (item.parentId == null) {
|
|
||||||
arr.push(item);
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
let parent = obj[item.parentId];
|
|
||||||
parent.children = parent.children ? parent.children : [];
|
|
||||||
parent.children.push(item);
|
|
||||||
}
|
|
||||||
this.menu.list = arr;
|
|
||||||
},*/
|
|
||||||
//获取订单列表
|
|
||||||
getList(){
|
|
||||||
var res = this.$API.wf.ticketList.get(this.pageForm);
|
|
||||||
// this.list = res.results;
|
|
||||||
},
|
|
||||||
async getWorkFlow(){
|
|
||||||
var res = await this.$API.wf.workflowList.get({page:0});
|
|
||||||
this.options = res;
|
|
||||||
console.log(this.options);
|
|
||||||
debugger;
|
|
||||||
},
|
|
||||||
//添加订单
|
|
||||||
handleAdd(){
|
|
||||||
this.limitedVisible = true;
|
|
||||||
},
|
|
||||||
//订单撤回
|
|
||||||
handleClose(){
|
|
||||||
},
|
|
||||||
//订单处理
|
|
||||||
handleDetail(){
|
|
||||||
},
|
|
||||||
//订单详情
|
|
||||||
handleShow(){
|
|
||||||
},
|
|
||||||
//订单流程图
|
|
||||||
handlePicture(){
|
|
||||||
},
|
|
||||||
//订单日志
|
|
||||||
handleLogs(){
|
|
||||||
},
|
|
||||||
//提交订单
|
|
||||||
submitHandle(){
|
|
||||||
debugger;
|
|
||||||
let that = this;
|
|
||||||
debugger;
|
|
||||||
this.addForm.perms = this.menu.checked;
|
|
||||||
this.$refs.addForm.validate( (valid) => {
|
|
||||||
debugger;
|
|
||||||
if (valid) {
|
|
||||||
this.isSaveing = true;
|
|
||||||
var res= this.$API.system.ticketAdd.post(that.addForm);
|
|
||||||
this.isSaveing = false;
|
|
||||||
this.limitedVisible = false;
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
console.log(res);
|
|
||||||
debugger;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//查看订单详情
|
|
||||||
handlePicture(row){
|
|
||||||
this.limitedVisible = true;
|
|
||||||
this.addForm.id=row.id;
|
|
||||||
this.addForm.name=row.name;
|
|
||||||
this.addForm.code=row.code;
|
|
||||||
this.addForm.description=row.description;
|
|
||||||
},
|
|
||||||
//接单
|
|
||||||
handleGetTicket(){},
|
|
||||||
//删除订单
|
|
||||||
async handleDelete(row){
|
|
||||||
var id = row.id;
|
|
||||||
var res = await this.$API.system.roleDel.delete(id);
|
|
||||||
if(res.err_msg){
|
|
||||||
this.$message.error(res.err_msg)
|
|
||||||
}else{
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
this.$message.success("删除成功")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//搜索
|
|
||||||
handleQuery(){
|
|
||||||
|
|
||||||
},
|
|
||||||
currentPage(){},
|
|
||||||
//本地更新数据
|
|
||||||
handleSaveSuccess(){
|
|
||||||
this.$refs.table.refresh()
|
|
||||||
},
|
|
||||||
handleCurrentChange(){},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.treeMain {height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
|
||||||
</style>
|
|
||||||
-->
|
|
||||||
|
|
@ -11,7 +11,8 @@ module.exports = defineConfig({
|
||||||
|
|
||||||
//开发服务,build后的生产模式还需nginx代理
|
//开发服务,build后的生产模式还需nginx代理
|
||||||
devServer: {
|
devServer: {
|
||||||
open: true, //运行后自动打开浏览器
|
allowedHosts: 'all',
|
||||||
|
open: false, //运行后自动打开浏览器
|
||||||
port: process.env.VUE_APP_PORT, //挂载端口
|
port: process.env.VUE_APP_PORT, //挂载端口
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue