Merge branch 'master' of https://gitee.com/lolicode/scui into v2

This commit is contained in:
shijing 2023-03-09 12:27:05 +08:00
commit 3b2482e492
59 changed files with 927 additions and 651 deletions

View File

@ -1,6 +1,6 @@
{
"name": "scui",
"version": "1.6.3",
"version": "1.6.9",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@ -8,41 +8,41 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@element-plus/icons-vue": "2.0.4",
"@element-plus/icons-vue": "2.0.10",
"@tinymce/tinymce-vue": "5.0.0",
"axios": "0.27.2",
"axios": "1.3.4",
"codemirror": "5.65.5",
"core-js": "3.22.8",
"cropperjs": "1.5.12",
"core-js": "3.29.0",
"cropperjs": "1.5.13",
"crypto-js": "4.1.1",
"d3": "^7.6.1",
"dagre": "^0.8.5",
"dagre-d3": "^0.6.4",
"echarts": "5.3.2",
"element-plus": "2.2.3",
"json-editor-vue3": "^1.0.6",
"xlsx": "^0.18.5",
"echarts": "5.4.1",
"element-plus": "2.2.32",
"nprogress": "0.2.0",
"qrcodejs2": "0.0.2",
"sortablejs": "1.15.0",
"tinymce": "^6.3.1",
"vue": "3.2.36",
"vue-i18n": "9.1.10",
"vue-router": "4.0.15",
"tinymce": "6.3.2",
"vue": "3.2.47",
"vue-i18n": "9.2.2",
"vue-router": "4.1.6",
"vuedraggable": "4.0.3",
"vuex": "4.0.2",
"xgplayer": "2.31.6",
"xgplayer-hls": "2.5.2",
"xlsx": "^0.18.5"
"vuex": "4.1.0",
"xgplayer": "2.32.2",
"xgplayer-hls": "2.5.2"
},
"devDependencies": {
"@babel/core": "7.18.2",
"@babel/eslint-parser": "7.18.2",
"@vue/cli-plugin-babel": "5.0.4",
"@vue/cli-plugin-eslint": "5.0.4",
"@vue/cli-service": "5.0.4",
"eslint": "8.17.0",
"eslint-plugin-vue": "9.1.0",
"sass": "1.37.5",
"@babel/core": "7.21.00",
"@babel/eslint-parser": "7.19.1",
"@vue/cli-plugin-babel": "5.0.8",
"@vue/cli-plugin-eslint": "5.0.8",
"@vue/cli-service": "5.0.8",
"eslint": "8.35.0",
"eslint-plugin-vue": "9.9.0",
"sass": "1.58.3",
"sass-loader": "10.1.1"
},
"eslintConfig": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,5 +1,5 @@
<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>
</el-config-provider>
</template>
@ -12,7 +12,6 @@
data() {
return {
config: {
locale: this.$i18n.messages[this.$i18n.locale].el,
size: "default",
zIndex: 2000,
button: {
@ -21,6 +20,11 @@
}
}
},
computed: {
locale(){
return this.$i18n.messages[this.$i18n.locale].el
},
},
created() {
//
const app_color = this.$CONFIG.COLOR || this.$TOOL.data.get('APP_COLOR')

View File

@ -378,5 +378,14 @@ export default {
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);
}
}
}
}

View File

@ -1,10 +1,10 @@
<!--
* @Descripttion: scContextmenuItem组件
* @version: 1.2
* @version: 1.3
* @Author: sakuya
* @Date: 2021年7月23日16:29:36
* @LastEditors: sakuya
* @LastEditTime: 20222月8日15:51:07
* @LastEditTime: 202211月23日10:09:54
-->
<template>
@ -50,6 +50,9 @@
if(!menu){
return false
}
if(this.disabled){
return false
}
menu.style.display = 'inline-block'
var rect = menu.getBoundingClientRect()
var menuX = rect.left

View File

@ -59,6 +59,10 @@
templates: {
type: Array,
default: () => []
},
options: {
type: Object,
default: () => {}
}
},
data() {
@ -72,6 +76,7 @@
statusbar: true,
plugins: this.plugins,
toolbar: this.toolbar,
toolbar_mode: 'sliding',
font_size_formats: '12px 14px 16px 18px 22px 24px 36px 72px',
height: this.height,
placeholder: this.placeholder,
@ -85,6 +90,7 @@
quickbars_insert_toolbar: false,
image_caption: true,
image_advtab: true,
convert_urls: false,
images_upload_handler: function(blobInfo) {
return new Promise((resolve, reject) => {
const data = new FormData();
@ -100,8 +106,20 @@
editor.on('init', function() {
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
}

View File

@ -2,11 +2,11 @@
<template>
<el-table ref="table" :data="columnData" row-key="prop" style="width: 100%" border>
<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 prop="label" label="列名">
<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>
</el-table-column>
<el-table-column prop="hide" label="显示" width="60">

View File

@ -1,10 +1,10 @@
<!--
* @Descripttion: 文件导出
* @version: 1.0
* @version: 1.1
* @Author: sakuya
* @Date: 2022年5月24日16:20:12
* @LastEditors:
* @LastEditTime:
* @LastEditors: sakuya
* @LastEditTime: 2022年6月13日17:32:05
-->
<template>
@ -30,12 +30,13 @@
</el-form-item>
<slot name="form" :formData="formData"></slot>
</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 label="列设置" v-if="columnData.length>0" lazy>
<columnSet :column="columnData"></columnSet>
</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-item v-for=" (val, key) in data" :key="key" :label="key">{{val}}</el-descriptions-item>
</el-descriptions>
@ -59,6 +60,8 @@
fileName: { type: String, default: "" },
fileTypes: { type: Array, default: () => ['xlsx'] },
data: { type: Object, default: () => {} },
showData: { type: Boolean, default: false },
async: { type: Boolean, default: false },
column: { type: Array, default: () => [] },
blob: { type: Boolean, default: false },
progress: { type: Boolean, default: true }
@ -72,7 +75,8 @@
},
columnData: [],
downLoading: false,
downLoadProgress: 0
downLoadProgress: 0,
asyncLoading: false
}
},
watch:{
@ -104,7 +108,9 @@
column: this.columnData.filter(n => !n.hide).map(n => n.prop).join(",")
}
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)
}else{
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){
let arr = []
for (var k in obj) {

View File

@ -1,10 +1,10 @@
<!--
* @Descripttion: 过滤器V2
* @version: 2.5
* @version: 2.6
* @Author: sakuya
* @Date: 2021年7月30日14:48:41
* @LastEditors: sakuya
* @LastEditTime: 2022年5月13日21:15:44
* @LastEditTime: 2023年2月7日09:46:45
-->
<template>
@ -39,10 +39,10 @@
</colgroup>
<tr v-for="(item,index) in filter" :key="index">
<td>
<el-tag>{{index+1}}</el-tag>
<el-tag :disable-transitions="true">{{index+1}}</el-tag>
</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>
</td>
<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=='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>
<!-- 标签 -->
@ -116,6 +118,7 @@
showOperator: { type: Boolean, default: true },
options: { type: Object, default: () => {} }
},
emits: ['filterChange'],
data() {
return {
drawer: false,
@ -155,11 +158,13 @@
},
//
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('无过滤项');
return false
}
const filterNum = this.fields[this.filter.length] || this.fields[0]
const filterNum = filterArr[0]
this.filter.push({
field: filterNum,
operator: filterNum.operator || 'include',
@ -195,6 +200,9 @@
},
//
async remoteMethod(query, item){
if(!item.field.extend.request) {
return false;
}
if(query !== ''){
item.selectLoading = true;
try {

View File

@ -9,7 +9,7 @@
<template>
<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>
</template>
@ -18,7 +18,8 @@
export default {
props: {
options: { type: Array, default: () => [] }
options: { type: Array, default: () => [] },
filter: { type: Array, default: () => [] }
},
data() {
return {
@ -45,6 +46,13 @@
if(isopen){
this.optionsList = this.optionsList_
}
},
isDisabled(key){
if(this.filter.find(item => item.field.value == key && !item.field.repeat)){
return true
}else{
return false
}
}
}
}

View File

@ -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>
<div class="sc-form-table">
<el-table :data="data" ref="table" :key="toggleIndex" border stripe>
<div class="sc-form-table" ref="scFormTable">
<el-table :data="data" ref="table" border stripe>
<el-table-column type="index" width="50" fixed="left">
<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 #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>
<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>
</template>
</el-table-column>
<el-table-column label="" width="58" v-if="dragSort">
<el-table-column label="" width="50" v-if="dragSort">
<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>
</el-table-column>
<slot></slot>
@ -33,12 +42,13 @@
modelValue: { type: Array, default: () => [] },
addTemplate: { type: Object, 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(){
return {
data: [],
toggleIndex: 0
data: []
}
},
mounted(){
@ -67,12 +77,17 @@
animation: 300,
ghostClass: "ghost",
onEnd({ newIndex, oldIndex }) {
const tableData = _this.data
const currRow = tableData.splice(oldIndex, 1)[0]
tableData.splice(newIndex, 0, currRow)
_this.toggleIndex += 1
_this.data.splice(newIndex, 0, _this.data.splice(oldIndex, 1)[0])
const newArray = _this.data.slice(0)
const tmpHeight = _this.$refs.scFormTable.offsetHeight
_this.$refs.scFormTable.style.setProperty('height', tmpHeight + 'px')
_this.data = []
_this.$nextTick(() => {
_this.rowDrop()
_this.data = newArray
_this.$nextTick(() => {
_this.$refs.scFormTable.style.removeProperty('height')
})
})
}
})
@ -83,6 +98,15 @@
},
rowDel(row, index){
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 span {display: inline-block;}
.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 button {display: inline-block;}
.sc-form-table .hover-row .sc-form-table-handle-delete span {display: none;}
.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>

View File

@ -1,19 +1,25 @@
<!--
* @Descripttion: 图标选择器组件
* @version: 1.4
* @version: 2.0
* @Author: sakuya
* @Date: 2021年7月27日10:02:46
* @LastEditors: sakuya
* @LastEditTime: 20225月14日19:49:42
* @LastEditTime: 20226月6日13:48:49
-->
<template>
<div class="sc-icon-select">
<el-input v-model="defaultValue" :prefix-icon="defaultValue||'none'" :placeholder="placeholder" :clearable="clearable" :disabled="disabled">
<template #append><el-button icon="el-icon-more-filled" @click="open"></el-button></template>
</el-input>
<el-dialog title="图标选择器" v-model="dialogVisible" :width="780" destroy-on-close>
<el-tabs style="margin-top: -30px;">
<div class="sc-icon-select__wrapper" :class="{'hasValue':value}" @click="open">
<el-input :prefix-icon="value||'el-icon-plus'" v-model="value" :disabled="disabled" readonly></el-input>
</div>
<el-dialog title="图标选择器" v-model="dialogVisible" :width="760" destroy-on-close append-to-body>
<div class="sc-icon-select__dialog" style="margin: -20px 0 -10px 0;">
<el-form :rules="{}">
<el-form-item prop="searchText">
<el-input class="sc-icon-select__search-input" prefix-icon="el-icon-search" v-model="searchText" placeholder="搜索" size="large" clearable/>
</el-form-item>
</el-form>
<el-tabs>
<el-tab-pane v-for="item in data" :key="item.name" lazy>
<template #label>
{{item.name}} <el-tag size="small" type="info">{{item.icons.length}}</el-tag>
@ -21,6 +27,7 @@
<div class="sc-icon-select__list">
<el-scrollbar>
<ul @click="selectIcon">
<el-empty v-if="item.icons.length==0" :image-size="100" description="未查询到相关图标" />
<li v-for="icon in item.icons" :key="icon">
<span :data-icon="icon"></span>
<el-icon><component :is="icon" /></el-icon>
@ -30,6 +37,11 @@
</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>
</div>
</template>
@ -40,27 +52,29 @@
export default {
props: {
modelValue: { type: String, default: "" },
placeholder: { type: String, default: "请输入或者选择图标" },
clearable: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
},
data() {
return {
defaultValue: '',
value: "",
dialogVisible: false,
data: []
data: [],
searchText: ""
}
},
watch:{
modelValue(val){
this.defaultValue = val
this.value = val
},
defaultValue(val){
value(val){
this.$emit('update:modelValue', val)
},
searchText(val){
this.search(val)
}
},
mounted() {
this.defaultValue = this.modelValue
this.value = this.modelValue
this.data.push(...config.icons)
},
methods: {
@ -74,25 +88,41 @@
if(e.target.tagName != 'SPAN'){
return false
}
this.defaultValue = e.target.dataset.icon
this.value = e.target.dataset.icon
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>
<style scoped>
.sc-icon-select {display: inline-block;}
.sc-icon-select__list {height:360px;overflow: auto;}
.sc-icon-select__list ul {}
.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__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;background: #fff;display: flex;justify-content: center;align-items: center;border-radius: 4px;}
.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;}
.sc-icon-select {display: inline-flex;}
.sc-icon-select__wrapper {cursor: pointer;display: inline-flex;}
.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__wrapper:deep(.el-input__inner) {flex-grow:0;width: 0;}
.sc-icon-select__wrapper:deep(.el-input__icon) {margin: 0;font-size: 16px;}
.sc-icon-select__wrapper.hasValue:deep(.el-input__icon) {color: var(--el-text-color-regular);}
.dark .sc-icon-select__list li {box-shadow: 0 0 0 1px #333;;}
.dark .sc-icon-select__list li:hover {box-shadow: 0 0 1px 4px rgba(64,158,255,1);}
.dark .sc-icon-select__list li i {background: var(--el-bg-color);}
.sc-icon-select__list {height:270px;overflow: auto;}
.sc-icon-select__list ul {}
.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>

View File

@ -1,10 +1,10 @@
<!--
* @Descripttion: 异步选择器
* @version: 1.0
* @version: 1.1
* @Author: sakuya
* @Date: 2021年8月3日15:53:37
* @LastEditors:
* @LastEditTime:
* @LastEditors: sakuya
* @LastEditTime: 2023年2月23日15:17:24
-->
<template>
@ -13,7 +13,7 @@
<el-icon class="is-loading"><el-icon-loading /></el-icon>
</div>
<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>
</el-option>
</el-select>
@ -27,6 +27,7 @@
props: {
apiObj: { type: Object, default: () => {} },
dic: { type: String, default: "" },
objValueType: { type: Boolean, default: false },
params: { type: Object, default: () => ({}) }
},
data() {
@ -40,7 +41,7 @@
},
created() {
//options
if(this.$attrs.modelValue && this.$attrs.modelValue.length > 0){
if(this.hasValue()){
this.initloading = true
this.getRemoteData()
}
@ -66,6 +67,16 @@
this.options = response.data
this.loading = 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
}
}
}
}

View File

@ -42,7 +42,8 @@
watch:{
data(val) {
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() {
//
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: {

View File

@ -1,14 +1,14 @@
<!--
* @Descripttion: 表格选择器组件
* @version: 1.2
* @version: 1.3
* @Author: sakuya
* @Date: 2021年6月10日10:04:07
* @LastEditors: sakuya
* @LastEditTime: 20222月28日09:39:03
* @LastEditTime: 20226月6日21:50:36
-->
<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>
<div class="sc-table-select__table" :style="{width: tableWidth+'px'}" v-loading="loading">
<div class="sc-table-select__header">
@ -38,7 +38,12 @@
apiObj: { type: Object, default: () => {} },
params: { type: Object, default: () => {} },
placeholder: { type: String, default: "请选择" },
size: { type: String, default: "default" },
clearable: { 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 },
tableWidth: {type: Number, default: 400},
mode: { type: String, default: "popover" },
@ -119,7 +124,7 @@
var setrow = this.tableData.filter(item => item[this.defaultProps.value]===this.defaultValue[this.defaultProps.value] )
this.$refs.table.setCurrentRow(setrow[0]);
}
this.$refs.table.$el.querySelector('.el-table__body-wrapper').scrollTop = 0
this.$refs.table.setScrollTop(0)
})
},
//

View File

@ -7,7 +7,7 @@
:name="name"
:data="data"
:http-request="request"
:file-list="defaultFileList"
v-model:file-list="defaultFileList"
:show-file-list="showFileList"
:drag="drag"
:accept="accept"
@ -34,7 +34,7 @@
export default {
props: {
modelValue: { type: String, default: "" },
modelValue: { type: [String, Array], default: "" },
tip: { type: String, default: "" },
action: { type: String, default: "" },
apiObj: { type: Object, default: () => {} },
@ -58,22 +58,29 @@
},
watch:{
modelValue(val){
if(Array.isArray(val)){
if (JSON.stringify(val) != JSON.stringify(this.formatArr(this.defaultFileList))) {
this.defaultFileList = val
this.value = val
}
}else{
if (val != this.toStr(this.defaultFileList)) {
this.defaultFileList = this.toArr(val)
this.value = val
}
}
},
defaultFileList: {
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)
},
deep: true
}
},
mounted() {
this.defaultFileList = Array.isArray(this.modelValue) ? this.modelValue : this.toArr(this.modelValue)
this.value = this.modelValue
this.defaultFileList = this.toArr(this.modelValue)
},
methods: {
//
@ -90,12 +97,25 @@
})
}
})
return _arr;
return _arr
},
//
toStr(arr){
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){
const maxSize = file.size / 1024 / 1024 < this.maxSize;
if (!maxSize) {

View File

@ -150,7 +150,10 @@
this.$refs.uploader.clearFiles()
})
},
change(file){
change(file,files){
if(files.length > 1){
files.splice(0, 1)
}
if(this.cropper && file.status=='ready'){
const acceptIncludes = ["image/gif", "image/jpeg", "image/png"].includes(file.raw.type)
if(!acceptIncludes){

View File

@ -7,7 +7,7 @@
:name="name"
:data="data"
:http-request="request"
:file-list="defaultFileList"
v-model:file-list="defaultFileList"
:show-file-list="showFileList"
:accept="accept"
:multiple="multiple"
@ -51,7 +51,7 @@
export default {
props: {
modelValue: { type: String, default: "" },
modelValue: { type: [String, Array], default: "" },
tip: { type: String, default: "" },
action: { type: String, default: "" },
apiObj: { type: Object, default: () => {} },
@ -75,14 +75,21 @@
},
watch:{
modelValue(val){
if(Array.isArray(val)){
if (JSON.stringify(val) != JSON.stringify(this.formatArr(this.defaultFileList))) {
this.defaultFileList = val
this.value = val
}
}else{
if (val != this.toStr(this.defaultFileList)) {
this.defaultFileList = this.toArr(val)
this.value = val
}
}
},
defaultFileList: {
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)
},
deep: true
@ -94,8 +101,8 @@
}
},
mounted() {
this.defaultFileList = Array.isArray(this.modelValue) ? this.modelValue : this.toArr(this.modelValue)
this.value = this.modelValue
this.defaultFileList = this.toArr(this.modelValue)
if(!this.disabled && this.draggable){
this.rowDrop()
}
@ -121,6 +128,19 @@
toStr(arr){
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(){
const _this = this

View File

@ -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(.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-enter-spinner) {width: 50px;height: 50px;}
</style>

View File

@ -6,10 +6,10 @@ const DEFAULT_CONFIG = {
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,
@ -76,10 +76,15 @@ function get_api_url(){
}
return 'http://' + window.location.host + '/api'
}
//合并业务配置
import MY_CONFIG from "./myConfig"
Object.assign(DEFAULT_CONFIG, MY_CONFIG)
// 如果生产模式就合并动态的APP_CONFIG
// public/config.js
if (process.env.NODE_ENV === 'production') {
Object.assign(DEFAULT_CONFIG, APP_CONFIG)
}
module.exports = DEFAULT_CONFIG
export default DEFAULT_CONFIG

10
src/config/myConfig.js Normal file
View File

@ -0,0 +1,10 @@
//业务配置
//会合并至this.$CONFIG
//生产模式 public/config.js 同名key会覆盖这里的配置从而实现打包后的热更新
//为避免和SCUI框架配置混淆建议添加前缀 MY_
//全局可使用 this.$CONFIG.MY_KEY 访问
export default {
//是否显示第三方授权登录
MY_SHOW_LOGIN_OAUTH: true
}

View File

@ -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 {
mounted (el, binding) {
const { value } = binding
if(Array.isArray(value)){
let ishas = false;
value.forEach(item => {
if(permission(item)){
ishas = true;
if(permissionAll()){
return
}
})
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);
}
}
}
};

24
src/directives/auths.js Normal file
View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -8,12 +8,14 @@
<el-icon v-if="navMenu.meta&&navMenu.meta.icon"><component :is="navMenu.meta.icon || 'el-icon-menu'"/></el-icon>
<template #title>
<span>{{navMenu.meta.title}}</span>
<span v-if="navMenu.meta.tag" class="menu-tag">{{navMenu.meta.tag}}</span>
</template>
</el-menu-item>
<el-sub-menu v-else :index="navMenu.path">
<template #title>
<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 v-if="navMenu.meta.tag" class="menu-tag">{{navMenu.meta.tag}}</span>
</template>
<NavMenu :navMenus="navMenu.children"></NavMenu>
</el-sub-menu>

View File

@ -73,6 +73,10 @@
this.$TOOL.data.set("APP_LANG", val);
},
colorPrimary(val){
if(!val){
val = '#409EFF'
this.colorPrimary = '#409EFF'
}
document.documentElement.style.setProperty('--el-color-primary', val);
for (let i = 1; i <= 9; i++) {
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(val,i/10));

View File

@ -1,6 +1,5 @@
<template>
<div class="adminui-tags">
<el-tooltip v-model:visible="tipVisible" placement="bottom-end" effect="light">
<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)">
<router-link :to="tag">
@ -9,13 +8,6 @@
</router-link>
</li>
</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>
<transition name="el-zoom-in-top">
@ -43,7 +35,6 @@
left: 0,
top: 0,
tagList: this.$store.state.viewTags.viewTags,
tipVisible: false,
tipDisplayed: false
}
},
@ -60,17 +51,24 @@
targetTag.scrollIntoView()
//
if(!this.tipDisplayed){
this.tipVisible = true
this.$msgbox({
type: 'warning',
center: true,
title: '提示',
message: '当前标签数量过多,可通过鼠标滚轴滚动标签栏。关闭标签数量可减少系统性能消耗。',
confirmButtonText: '知道了'
})
this.tipDisplayed = true
}
}
})
},
contextMenuVisible(value) {
var _this = this;
var cm = function(e){
let sp = document.getElementById("contextmenu");
const cm = (e) => {
const sp = document.getElementById("contextmenu");
if (sp && !sp.contains(e.target)) {
_this.closeMenu()
this.closeMenu()
}
}
if (value) {
@ -126,13 +124,14 @@
},
//tag
closeSelectedTag(tag, autoPushLatestView=true) {
const nowTagIndex = this.tagList.findIndex(item => item.fullPath == tag.fullPath)
this.$store.commit("removeViewTags", tag)
this.$store.commit("removeIframeList", tag)
this.$store.commit("removeKeepLive", tag.name)
if (autoPushLatestView && this.isActive(tag)) {
const latestView = this.tagList.slice(-1)[0]
if (latestView) {
this.$router.push(latestView)
const leftView = this.tagList[nowTagIndex - 1]
if (leftView) {
this.$router.push(leftView)
} else {
this.$router.push('/')
}
@ -161,23 +160,23 @@
},
//TAB
refreshTab() {
var nowTag = this.contextMenuItem;
this.contextMenuVisible = false
const nowTag = this.contextMenuItem;
//
if(this.$route.fullPath != nowTag.fullPath){
if (this.$route.fullPath !== nowTag.fullPath) {
this.$router.push({
path: nowTag.fullPath,
query: nowTag.query
})
}
this.$store.commit("refreshIframe", nowTag)
var _this = this;
setTimeout(function() {
_this.$store.commit("removeKeepLive", nowTag.name)
_this.$store.commit("setRouteShow", false)
_this.$nextTick(() => {
_this.$store.commit("pushKeepLive",nowTag.name)
_this.$store.commit("setRouteShow", true)
setTimeout(() => {
this.$store.commit("removeKeepLive", nowTag.name)
this.$store.commit("setRouteShow", false)
this.$nextTick(() => {
this.$store.commit("pushKeepLive", nowTag.name)
this.$store.commit("setRouteShow", true)
})
}, 0);
},
@ -249,10 +248,6 @@
}
scrollDiv.scrollLeft += step;
}
},
hideTip(){
this.tipVisible = false
this.tipDisplayed = true
}
}
}

View File

@ -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>

View File

@ -2,7 +2,7 @@
<div class="adminui-topbar">
<div class="left-panel">
<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" >
<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>

View File

@ -187,6 +187,8 @@
<el-drawer title="布局实时演示" v-model="settingDialog" :size="400" append-to-body destroy-on-close>
<setting></setting>
</el-drawer>
<auto-exit></auto-exit>
</template>
<script>
@ -197,6 +199,7 @@
import userbar from './components/userbar.vue';
import setting from './components/setting.vue';
import iframeView from './components/iframeView.vue';
import autoExit from './other/autoExit.js';
export default {
name: 'index',
@ -207,7 +210,8 @@
NavMenu,
userbar,
setting,
iframeView
iframeView,
autoExit
},
data() {
return {

View File

@ -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
})
}
}
}
}

View File

@ -1,3 +1,4 @@
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
@ -6,7 +7,6 @@ import ehsui from './ehs'
import i18n from './locales'
import router from './router'
import store from './store'
import { createApp } from 'vue'
import App from './App.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

View File

@ -27,6 +27,8 @@ import scTrend from './components/scMini/scTrend'
import scFire from './components/scOpl/scFire'
import auth from './directives/auth'
import auths from './directives/auths'
import authsAll from './directives/authsAll'
import role from './directives/role'
import time from './directives/time'
import copy from './directives/copy'
@ -68,10 +70,12 @@ export default {
app.component('scFire', scFire);
//注册全局指令
app.directive('auth', auth);
app.directive('role', role);
app.directive('time', time);
app.directive('copy', copy);
app.directive('auth', auth)
app.directive('auths', auths)
app.directive('auths-all', authsAll)
app.directive('role', role)
app.directive('time', time)
app.directive('copy', copy)
//统一注册el-icon图标
for(let icon in elIcons){

View File

@ -1,13 +1,20 @@
import router from '@/router'
export default {
state: {
viewTags: []
},
mutations: {
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 isName = route.name
if(!target && isName){
if(backPathIndex == -1){
state.viewTags.push(route)
}else{
state.viewTags.splice(backPathIndex+1, 0, route)
}
}
},
removeViewTags(state, route){

View File

@ -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:hover {color: var(--el-color-primary);}
.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;}

View File

@ -27,6 +27,11 @@ html.dark {
.adminui-main {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-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);}

View File

@ -263,6 +263,9 @@
background-color: var(--el-color-primary) !important;
}
/* 全部禁用el-tag动画 */
.el-tag {transition: all 0s !important;}
/* 覆盖tinymce样式 */
.sceditor .tox-tinymce {
border: 1px solid #DCDFE6;

View File

@ -1,5 +1,37 @@
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) {
let permissions = tool.data.get("PERMISSIONS");
if (permissions.indexOf('superuser')>-1){

View File

@ -31,6 +31,9 @@ axios.interceptors.request.use(
}
);
//FIX 多个API同时401时疯狂弹窗BUG
let MessageBox_401_show = false
// HTTP response 拦截器
axios.interceptors.response.use(
(response) => {
@ -108,9 +111,9 @@ axios.interceptors.response.use(
var http = {
/** get
* @param {接口地址} url
* @param {请求参数} params
* @param {参数} config
* @param {string} url 接口地址
* @param {object} params 请求参数
* @param {object} config 参数
*/
get: function(url, params={}, config={}) {
return new Promise((resolve, reject) => {
@ -128,9 +131,9 @@ var http = {
},
/** post
* @param {接口地址} url
* @param {请求参数} data
* @param {参数} config
* @param {string} url 接口地址
* @param {object} data 请求参数
* @param {object} config 参数
*/
post: function(url, data={}, config={}) {
return new Promise((resolve, reject) => {
@ -148,9 +151,9 @@ var http = {
},
/** put
* @param {接口地址} url
* @param {请求参数} data
* @param {参数} config
* @param {string} url 接口地址
* @param {object} data 请求参数
* @param {object} config 参数
*/
put: function(url, data={}, config={}) {
return new Promise((resolve, reject) => {
@ -168,9 +171,9 @@ var http = {
},
/** patch
* @param {接口地址} url
* @param {请求参数} data
* @param {参数} config
* @param {string} url 接口地址
* @param {object} data 请求参数
* @param {object} config 参数
*/
patch: function(url, data={}, config={}) {
return new Promise((resolve, reject) => {
@ -188,9 +191,9 @@ var http = {
},
/** delete
* @param {接口地址} url
* @param {请求参数} data
* @param {参数} config
* @param {string} url 接口地址
* @param {object} data 请求参数
* @param {object} config 参数
*/
delete: function(url, data={}, config={}) {
return new Promise((resolve, reject) => {
@ -208,8 +211,8 @@ var http = {
},
/** jsonp
* @param {接口地址} url
* @param {JSONP回调函数名称} name
* @param {string} url 接口地址
* @param {string} name JSONP回调函数名称
*/
jsonp: function(url, name='jsonp'){
return new Promise((resolve) => {

View File

@ -131,7 +131,8 @@
return allCompsList
},
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(){
return this.grid.copmsList.reduce(function(a, b){return a.concat(b)})

View File

@ -1,5 +1,5 @@
<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-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
<template #prepend>+86</template>

View File

@ -114,6 +114,7 @@ import passwordForm from './components/passwordForm'
this.$TOOL.data.remove("USER_INFO")
this.$TOOL.data.remove("MENU")
this.$TOOL.data.remove("PERMISSIONS")
this.$TOOL.data.remove("DASHBOARDGRID")
this.$TOOL.data.remove("grid")
this.$store.commit("clearViewTags")
this.$store.commit("clearKeepLive")

View File

@ -2,8 +2,12 @@
<el-main>
<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.no','user.add']" type="primary">v-auth="['user.no','user.add']"</el-button>
<el-alert title="v-auth指令 是$AUTH的语法糖, 原先需要使用v-if来判断是否有权限, 使用指令将减少代码冗余. 并且支持传入数组,有一项满足就判断有权限" style="margin-top: 20px;"></el-alert>
<el-button v-auths="['user.no','user.add']" type="primary">v-auths="['user.no','user.add']"</el-button>
<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 shadow="never" header="v-role 角色权限控制" style="margin-top: 15px;">
<el-button v-role="'admin'" type="primary">v-role="'admin'"</el-button>

View File

@ -40,7 +40,7 @@
//
var BMapGL = await loadJS(`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${ak}&callback=BMapGLinit`, "BMapGL", "BMapGLinit")
//BMapGLLibcallback3
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')
@ -51,48 +51,6 @@
poiText: 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)
}
}
}

View File

@ -324,6 +324,7 @@
</script>
<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 .code {font-size: 12px;color: #999;}
.custom-tree-node .do {display: none;}

View File

@ -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">
<template #default="{node, data}">
<span class="custom-tree-node el-tree-node__label">
<span class="custom-tree-node">
<span class="label">
{{ node.label }}
</span>
<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>
</template>
@ -153,7 +153,8 @@
</script>
<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 .el-tag {margin-left: 5px;}
.custom-tree-node .do {display: none;}

View File

@ -53,6 +53,12 @@
<el-checkbox v-model="form.meta.hiddenBreadcrumb">隐藏面包屑</el-checkbox>
<div class="el-form-item-msg">菜单不显示在导航中但用户依然可以访问例如详情页</div>
</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-button type="primary" @click="save" :loading="loading"> </el-button>
</el-form-item>
@ -103,7 +109,9 @@
icon: "",
active: "",
color: "",
type: "menu"
type: "menu",
fullpage: false,
tag: "",
},
apiList: []
},

View File

@ -28,6 +28,11 @@
</el-form-item>
</el-form>
</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-form label-width="100px" label-position="left">
<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: {
dataType :"1",
list: [],
@ -91,6 +108,7 @@
mounted() {
this.getMenu()
this.getDept()
this.getGrid()
},
methods: {
open(){
@ -132,6 +150,36 @@
let filterKeys = this.data.checked.filter(key => this.$refs.dept.getNode(key).isLeaf)
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: "关于项目"
}
]
}
}
}

View File

@ -38,7 +38,7 @@
<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>
</el-drawer>

View File

@ -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>

View File

@ -13,6 +13,7 @@
<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 | \
image media table template preview | code selectall'</el-descriptions-item>
<el-descriptions-item label="options">支持tinymce的其他配置项</el-descriptions-item>
</el-descriptions>
</el-card>
</el-main>

View File

@ -133,9 +133,10 @@
]
},
{
label: '开关',
label: '开关(可重复)',
value: 'switch',
type: 'switch',
repeat: true,
operator: '='
},
{
@ -158,6 +159,16 @@
label: '日期范围',
value: 'date2',
type: 'daterange'
},
{
label: '自定义日期',
value: 'date3',
type: 'customDate',
placeholder: '请选择月份',
extend: {
dateType: 'month',
valueFormat: 'YYYY-MM'
}
}
]
}

View File

@ -8,7 +8,7 @@
<el-input v-model="form.title"></el-input>
</el-form-item>
<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">
<template #default="scope">
<el-time-select v-model="scope.row.time"></el-time-select>
@ -44,6 +44,10 @@
</el-form-item>
</el-form>
</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>
</template>
@ -108,6 +112,19 @@
},
resetForm(){
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)
}
}
}

View File

@ -13,7 +13,7 @@
<el-card shadow="never">
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="100px">
<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-button type="primary" @click="submitForm">保存</el-button>
@ -36,7 +36,7 @@
data() {
return {
form: {
icon: ''
icon: 'el-icon-apple'
},
rules: {
icon: [

View File

@ -40,7 +40,12 @@
<el-col :lg="12">
<el-card shadow="never" header="导出">
<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}">
<el-button type="primary" icon="sc-icon-download" @click="open">导出(blob文件流)</el-button>
</template>
@ -59,6 +64,8 @@
<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="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="fileTypes">Array 可选择文件类型默认为['xlsx']组件将数组第一项当做已选项</el-descriptions-item>
<el-descriptions-item label="column">Array 列配置请求文件时将添加column为key的参数值为prop逗号","分割的字符串</el-descriptions-item>

View File

@ -18,7 +18,7 @@
</el-card>
<div style="height:15px"></div>
<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}">
<el-form :inline="true" :model="form">
<el-form-item>

View File

@ -6,6 +6,12 @@
</sc-upload-file>
</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="图片卡片示例(已开启拖拽排序)">
<sc-upload-multiple v-model="fileurl2" draggable :limit="3" tip="最多上传3个文件,单个文件不要超过10M,请上传图像格式文件"></sc-upload-multiple>
</el-card>
@ -69,6 +75,16 @@
data() {
return {
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",
fileurl2: "img/auth_banner.jpg,img/avatar3.gif",
fileurl3: "img/auth_banner.jpg",

View File

@ -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>
&lt;!&ndash;如果state_.retreat为可退回则显示撤回按钮 state_.type==1处于草稿状态 &ndash;&gt;
<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>
-->

View File

@ -11,7 +11,8 @@ module.exports = defineConfig({
//开发服务,build后的生产模式还需nginx代理
devServer: {
open: true, //运行后自动打开浏览器
allowedHosts: 'all',
open: false, //运行后自动打开浏览器
port: process.env.VUE_APP_PORT, //挂载端口
proxy: {
'/api': {