eslint; 收入合同
This commit is contained in:
@@ -104,11 +104,11 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "HelloWorld",
|
||||
name: 'HelloWorld',
|
||||
props: {
|
||||
msg: String,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
|
||||
@@ -155,65 +155,65 @@ const logisticsInfoList = [
|
||||
postPerson: '李四',
|
||||
postTime: '2021年10月21',
|
||||
emsOrSF: 'EMS',
|
||||
postNo: "123456"
|
||||
postNo: '123456'
|
||||
}
|
||||
]
|
||||
const columns = [
|
||||
{
|
||||
title: '开票人',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '金额(元)',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '票号',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '项目',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '邮寄人',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '快递',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
},
|
||||
{
|
||||
title: '快递单号',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: 'piaoNo',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: "center",
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
scopedSlots: {customRender: 'action'}
|
||||
},
|
||||
]
|
||||
export default {
|
||||
name: "ProjectDetailModal",
|
||||
name: 'ProjectDetailModal',
|
||||
data() {
|
||||
return {
|
||||
description: "项目详情模态框",
|
||||
description: '项目详情模态框',
|
||||
width: 800,
|
||||
visible: false,
|
||||
title: "项目信息",
|
||||
title: '项目信息',
|
||||
// 当前项目id
|
||||
currentProjectId: '',
|
||||
// 基本信息
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
* 查看物流
|
||||
* */
|
||||
lookLogistics() {
|
||||
window.open("http://www.api.kuaidi100.com", "_blank")
|
||||
window.open('http://www.api.kuaidi100.com', '_blank')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row>
|
||||
@@ -27,17 +27,17 @@
|
||||
</div>
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
|
||||
@change="handleTableChange"
|
||||
class="j-table-force-nowrap">
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio'}"
|
||||
@change="handleTableChange"
|
||||
class="j-table-force-nowrap">
|
||||
<template slot="htmlSlot" slot-scope="text">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
@@ -51,7 +51,7 @@
|
||||
<j-ellipsis @click.native="uploadFile(record.chargeNoticeFileId)" style="color:#219AFF;cursor: pointer"
|
||||
:value="text" :length="20"/>
|
||||
</template>
|
||||
<template slot="text" slot-scope="text,record">
|
||||
<template slot="text" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="30"></j-ellipsis>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
url: {
|
||||
list: '/company/payCompanyManagement/list',
|
||||
list: '/company/payCompanyManagement/list'
|
||||
},
|
||||
selectedCompany: {},
|
||||
selectedRowKeys: [],
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<contact-management-module ref="contactForm"
|
||||
is-company-disabled
|
||||
:selected-company="selectedCompany"
|
||||
v-on="$listeners">
|
||||
@ok="addContactsOk">
|
||||
</contact-management-module>
|
||||
</div>
|
||||
</template>
|
||||
@@ -59,6 +59,7 @@ export default {
|
||||
return {
|
||||
contactsList: [], // 该企业下联系人列表
|
||||
isFirstOpen: true, // 编辑状态下是否为第一次打开
|
||||
contactId: this.value
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -114,11 +115,16 @@ export default {
|
||||
}
|
||||
this.$message.warn('请先选择来款企业再为该企业新建联系人')
|
||||
},
|
||||
addContactsOk(id) {
|
||||
this.getContactsList()
|
||||
this.$emit('change', id)
|
||||
this.$emit('ok')
|
||||
},
|
||||
// 下拉框的搜索
|
||||
filterOption(input, option) {
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
);
|
||||
)
|
||||
},
|
||||
handleDropdownOpen() {
|
||||
if (this.isFirstOpen && this.initContacts && this.initContacts.hasOwnProperty('id')) {
|
||||
@@ -143,5 +149,6 @@ export default {
|
||||
.form-btn {
|
||||
padding-top: 1px;
|
||||
padding-left: 8px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
filterOption(input, option) {
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
);
|
||||
)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: "JDictSelectTag",
|
||||
name: 'JDictSelectTag',
|
||||
props: {
|
||||
dictCode: String,
|
||||
placeholder: String,
|
||||
@@ -37,7 +37,7 @@
|
||||
data() {
|
||||
return {
|
||||
dictOptions: [],
|
||||
tagType:""
|
||||
tagType:''
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@@ -50,8 +50,8 @@
|
||||
},
|
||||
created() {
|
||||
// console.log(this.dictCode);
|
||||
if(!this.type || this.type==="list"){
|
||||
this.tagType = "select"
|
||||
if(!this.type || this.type==='list'){
|
||||
this.tagType = 'select'
|
||||
}else{
|
||||
this.tagType = this.type
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
getValueSting(){
|
||||
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||
// 当有null或“” placeholder不显示
|
||||
return this.value != null ? this.value.toString() : undefined;
|
||||
return this.value != null ? this.value.toString() : undefined
|
||||
// update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||
},
|
||||
},
|
||||
@@ -70,7 +70,7 @@
|
||||
initDictData() {
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(this.dictCode)){
|
||||
this.dictOptions = getDictItemsFromCache(this.dictCode);
|
||||
this.dictOptions = getDictItemsFromCache(this.dictCode)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -78,22 +78,22 @@
|
||||
ajaxGetDictItems(this.dictCode, null).then((res) => {
|
||||
if (res.success) {
|
||||
// console.log(res.result);
|
||||
this.dictOptions = res.result;
|
||||
this.dictOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
handleInput(e) {
|
||||
let val;
|
||||
if(this.tagType=="radio"){
|
||||
let val
|
||||
if(this.tagType=='radio'){
|
||||
val = e.target.value
|
||||
}else{
|
||||
val = e
|
||||
}
|
||||
|
||||
if(this.triggerChange){
|
||||
this.$emit('change', val);
|
||||
this.$emit('change', val)
|
||||
}else{
|
||||
this.$emit('input', val);
|
||||
this.$emit('input', val)
|
||||
}
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
|
||||
@@ -14,18 +14,18 @@ import {getAction} from '@/api/manage'
|
||||
*/
|
||||
export async function initDictOptions(dictCode) {
|
||||
if (!dictCode) {
|
||||
return '字典Code不能为空!';
|
||||
return '字典Code不能为空!'
|
||||
}
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(dictCode)){
|
||||
let res = {}
|
||||
res.result = getDictItemsFromCache(dictCode);
|
||||
res.success = true;
|
||||
return res;
|
||||
res.result = getDictItemsFromCache(dictCode)
|
||||
res.success = true
|
||||
return res
|
||||
}
|
||||
//获取字典数组
|
||||
let res = await ajaxGetDictItems(dictCode);
|
||||
return res;
|
||||
let res = await ajaxGetDictItems(dictCode)
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,25 +80,25 @@ export function filterMultiDictText(dictOptions, text) {
|
||||
}
|
||||
|
||||
if(!text || text=='null' || !dictOptions || dictOptions.length==0){
|
||||
return ""
|
||||
return ''
|
||||
}
|
||||
let re = "";
|
||||
let re = ''
|
||||
text = text.toString()
|
||||
let arr = text.split(",")
|
||||
let arr = text.split(',')
|
||||
dictOptions.forEach(function (option) {
|
||||
if(option){
|
||||
for(let i=0;i<arr.length;i++){
|
||||
if (arr[i] === option.value) {
|
||||
re += option.text+",";
|
||||
break;
|
||||
re += option.text+','
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(re==""){
|
||||
return text;
|
||||
})
|
||||
if(re==''){
|
||||
return text
|
||||
}
|
||||
return re.substring(0,re.length-1);
|
||||
return re.substring(0,re.length-1)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,16 +108,16 @@ export function filterMultiDictText(dictOptions, text) {
|
||||
*/
|
||||
export function filterDictTextByCache(dictCode, key) {
|
||||
if(key==null ||key.length==0){
|
||||
return;
|
||||
return
|
||||
}
|
||||
if (!dictCode) {
|
||||
return '字典Code不能为空!';
|
||||
return '字典Code不能为空!'
|
||||
}
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(dictCode)){
|
||||
let item = getDictItemsFromCache(dictCode).filter(t => t["value"] == key)
|
||||
let item = getDictItemsFromCache(dictCode).filter(t => t['value'] == key)
|
||||
if(item && item.length>0){
|
||||
return item[0]["text"]
|
||||
return item[0]['text']
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export async function getDictItems(dictCode, params) {
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(dictCode)){
|
||||
let desformDictItems = getDictItemsFromCache(dictCode).map(item => ({...item, label: item.text}))
|
||||
return desformDictItems;
|
||||
return desformDictItems
|
||||
}
|
||||
|
||||
//缓存中没有,就请求后台
|
||||
|
||||
@@ -51,13 +51,13 @@
|
||||
data() {
|
||||
return {
|
||||
dictOptions: [],
|
||||
tagType:"",
|
||||
tagType:'',
|
||||
arrayValue:!this.value?[]:this.value.split(this.spliter)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(!this.type || this.type==="list_multi"){
|
||||
this.tagType = "select"
|
||||
if(!this.type || this.type==='list_multi'){
|
||||
this.tagType = 'select'
|
||||
}else{
|
||||
this.tagType = this.type
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
},
|
||||
watch:{
|
||||
options: function(val){
|
||||
this.setCurrentDictOptions(val);
|
||||
this.setCurrentDictOptions(val)
|
||||
},
|
||||
dictCode:{
|
||||
immediate:true,
|
||||
@@ -96,14 +96,14 @@
|
||||
//根据字典Code, 初始化字典数组
|
||||
ajaxGetDictItems(this.dictCode, null).then((res) => {
|
||||
if (res.success) {
|
||||
this.dictOptions = res.result;
|
||||
this.dictOptions = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
onChange (selectedValue) {
|
||||
this.$emit('change', selectedValue.join(this.spliter));
|
||||
this.$emit('change', selectedValue.join(this.spliter))
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
this.dictOptions = dictOptions
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<script>
|
||||
import { ajaxGetDictItems,getDictItemsFromCache } from '@/api/api'
|
||||
import debounce from 'lodash/debounce';
|
||||
import debounce from 'lodash/debounce'
|
||||
import { getAction } from '../../api/manage'
|
||||
|
||||
export default {
|
||||
@@ -53,7 +53,7 @@
|
||||
async: Boolean,
|
||||
placeholder:{
|
||||
type:String,
|
||||
default:"请选择",
|
||||
default:'请选择',
|
||||
required:false
|
||||
},
|
||||
popContainer:{
|
||||
@@ -68,8 +68,8 @@
|
||||
}
|
||||
},
|
||||
data(){
|
||||
this.loadData = debounce(this.loadData, 800);//消抖
|
||||
this.lastLoad = 0;
|
||||
this.loadData = debounce(this.loadData, 800)//消抖
|
||||
this.lastLoad = 0
|
||||
return {
|
||||
loading:false,
|
||||
selectedValue:[],
|
||||
@@ -78,10 +78,10 @@
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.initDictData();
|
||||
this.initDictData()
|
||||
},
|
||||
watch:{
|
||||
"value":{
|
||||
'value':{
|
||||
immediate:true,
|
||||
handler(val){
|
||||
if(!val){
|
||||
@@ -96,7 +96,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"dict":{
|
||||
'dict':{
|
||||
handler(){
|
||||
this.initDictData()
|
||||
}
|
||||
@@ -114,7 +114,7 @@
|
||||
initSelectValue(){
|
||||
if(this.async){
|
||||
if(!this.selectedAsyncValue || !this.selectedAsyncValue.key || this.selectedAsyncValue.key!=this.value){
|
||||
console.log("这才请求后台")
|
||||
console.log('这才请求后台')
|
||||
getAction(`/sys/dict/loadDictItem/${this.dict}`,{key:this.value}).then(res=>{
|
||||
if(res.success){
|
||||
let obj = {
|
||||
@@ -130,7 +130,7 @@
|
||||
}
|
||||
},
|
||||
loadData(value){
|
||||
console.log("数据加载",value)
|
||||
console.log('数据加载',value)
|
||||
this.lastLoad +=1
|
||||
const currentLoad = this.lastLoad
|
||||
this.options = []
|
||||
@@ -143,7 +143,7 @@
|
||||
return
|
||||
}
|
||||
this.options = res.result
|
||||
console.log("我是第一个",res)
|
||||
console.log('我是第一个',res)
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
@@ -167,16 +167,16 @@
|
||||
}else{
|
||||
dictStr = this.dict
|
||||
}
|
||||
if (this.dict.indexOf(",") == -1) {
|
||||
if (this.dict.indexOf(',') == -1) {
|
||||
//优先从缓存中读取字典配置
|
||||
if (getDictItemsFromCache(this.dictCode)) {
|
||||
this.options = getDictItemsFromCache(this.dictCode);
|
||||
this.options = getDictItemsFromCache(this.dictCode)
|
||||
return
|
||||
}
|
||||
}
|
||||
ajaxGetDictItems(dictStr, null).then((res) => {
|
||||
if (res.success) {
|
||||
this.options = res.result;
|
||||
this.options = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -198,7 +198,7 @@
|
||||
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
},
|
||||
handleChange (selectedValue) {
|
||||
console.log("selectedValue",selectedValue)
|
||||
console.log('selectedValue',selectedValue)
|
||||
this.selectedValue = selectedValue
|
||||
this.callback()
|
||||
},
|
||||
@@ -211,13 +211,13 @@
|
||||
this.selectedAsyncValue = null
|
||||
this.selectedValue = null
|
||||
this.options = null
|
||||
this.loadData("")
|
||||
this.loadData('')
|
||||
}
|
||||
this.callback()
|
||||
//update-end-author:scott date:20201222 for:【搜索】搜索查询组件,删除条件,默认下拉还是上次的缓存数据,不好 JT-191
|
||||
},
|
||||
callback(){
|
||||
this.$emit('change', this.selectedValue);
|
||||
this.$emit('change', this.selectedValue)
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
this.options = dictOptions
|
||||
|
||||
@@ -5,9 +5,9 @@ import { filterMultiDictText,filterDictText,initDictOptions,filterDictTextByCach
|
||||
|
||||
export default {
|
||||
install: function (Vue) {
|
||||
Vue.component('JDictSelectTag',JDictSelectTag);
|
||||
Vue.component('JMultiSelectTag',JMultiSelectTag);
|
||||
Vue.component('JSearchSelectTag',JSearchSelectTag);
|
||||
Vue.component('JDictSelectTag',JDictSelectTag)
|
||||
Vue.component('JMultiSelectTag',JMultiSelectTag)
|
||||
Vue.component('JSearchSelectTag',JSearchSelectTag)
|
||||
Vue.prototype.$initDictOptions = (dictCode) => initDictOptions(dictCode)
|
||||
Vue.prototype.$filterMultiDictText = (dictOptions, text) => filterMultiDictText(dictOptions, text)
|
||||
Vue.prototype.$filterDictText = (dictOptions, text) => filterDictText(dictOptions, text)
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-form :form="form">
|
||||
<a-row v-for="(item, index) in installmentList" :key="index">
|
||||
<a-col :xxl="4" :xl="8" :sm="12">
|
||||
<a-form-item :label="`${index + 1}阶段`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入名称"
|
||||
v-decorator="['installmentList['+index+'].phaseName',validatorRules.phaseName]"
|
||||
:maxLength='50'
|
||||
v-bind="$attrs"
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="4" :xl="8" :sm="12">
|
||||
<a-form-item :label="`${index + 1}阶段应收`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入金额"
|
||||
v-decorator="['installmentList['+index+'].accountsReceivableAmount',validatorRules.accountsReceivableAmount]"
|
||||
:maxLength='50'
|
||||
v-bind="$attrs"
|
||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="5" :xl="8" :sm="12">
|
||||
<a-form-item :label="`${index + 1}阶段应收时间`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择应收时间"
|
||||
style="width: 100%;"
|
||||
v-decorator="['installmentList['+index+'].accountsReceivableTime']"
|
||||
:trigger-change="true"
|
||||
v-bind="$attrs"
|
||||
date-format="YYYY-MM-DD"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="4" :xl="8" :sm="12">
|
||||
<a-form-item :label="`${index + 1}阶段实收`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="请输入金额"
|
||||
v-decorator="['installmentList['+index+'].paidAmount',validatorRules.paidAmount]"
|
||||
:maxLength='50'
|
||||
v-bind="$attrs"
|
||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="5" :xl="8" :sm="12">
|
||||
<a-form-item :label="`${index + 1}阶段实收时间`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择实收时间"
|
||||
style="width: 100%;"
|
||||
v-decorator="['installmentList['+index+'].paidTime',validatorRules.paidTime]"
|
||||
:trigger-change="true"
|
||||
v-bind="$attrs"
|
||||
date-format="YYYY-MM-DD"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xxl="2" :xl="8" :sm="12" class="operator-btn">
|
||||
<a-button icon="plus" @click="addInstallmentItem" v-bind="$attrs"></a-button>
|
||||
<a-button icon="minus" @click="deleteInstallmentItem(index)"
|
||||
v-bind="$attrs"
|
||||
:disabled="installmentList.length === 1">
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JDate from '../tools/JDate'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
name: 'InstallmentForm',
|
||||
components: { JDate },
|
||||
data() {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 9 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 15 }
|
||||
},
|
||||
validatorRules: {
|
||||
phaseName: {
|
||||
rules: [{ required: true, message: '请输入名称'}],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
accountsReceivableAmount: {
|
||||
rules: [{ required: true, message: '请输入金额'}],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
paidAmount: {
|
||||
rules: [{ required: true, message: '请输入金额'}],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
paidTime: {
|
||||
rules: [{ required: true, message: '请选择实收时间'}],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
index: 1,
|
||||
installmentList: [],
|
||||
defaultFormData: {
|
||||
phaseName: null,
|
||||
accountsReceivableAmount: null,
|
||||
accountsReceivableTime: undefined,
|
||||
paidAmount: null,
|
||||
paidTime: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化分期信息列表
|
||||
* @param record
|
||||
*/
|
||||
initInstallmentList(record) {
|
||||
// 判断是否为编辑
|
||||
if (record.installmentList && record.installmentList.length > 0) {
|
||||
this.installmentList = record.installmentList
|
||||
} else {
|
||||
record.installmentList = [this.defaultFormData]
|
||||
}
|
||||
this.model = Object({}, record)
|
||||
this.installmentList = record.installmentList
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'installmentList'))
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 添加一个分期信息
|
||||
*/
|
||||
addInstallmentItem() {
|
||||
this.installmentList.push(this.defaultFormData)
|
||||
},
|
||||
deleteInstallmentItem(index) {
|
||||
this.installmentList.splice(index, 1)
|
||||
},
|
||||
handleSave() {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.$emit('ok', values)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.operator-btn {
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.ant-btn {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import JCronModal from "./modal/JCronModal";
|
||||
import JCronModal from './modal/JCronModal'
|
||||
export default {
|
||||
name: 'JCron',
|
||||
components: {
|
||||
@@ -32,11 +32,11 @@
|
||||
},
|
||||
methods:{
|
||||
openModal(){
|
||||
this.$refs.innerVueCron.show();
|
||||
this.$refs.innerVueCron.show()
|
||||
},
|
||||
handleOK(val){
|
||||
this.cron = val;
|
||||
this.$emit("change", this.cron);
|
||||
this.cron = val
|
||||
this.$emit('change', this.cron)
|
||||
//this.$emit("change", Object.assign({}, this.cron));
|
||||
},
|
||||
handleEmpty(){
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
},
|
||||
data () {
|
||||
let dateStr = this.value;
|
||||
let dateStr = this.value
|
||||
return {
|
||||
yearShowOne:false, //控制年份模态框的显示与否
|
||||
year:'', // mode==“year” 专用
|
||||
@@ -107,12 +107,12 @@
|
||||
computed: {
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
delete result.change
|
||||
return result
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -131,7 +131,7 @@
|
||||
methods: {
|
||||
moment,
|
||||
handleDateChange(mom,dateStr){
|
||||
this.$emit('change', dateStr);
|
||||
this.$emit('change', dateStr)
|
||||
},
|
||||
handleMonthChange(mom,dateStr){
|
||||
this.$emit('change',dateStr)
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log("我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用")
|
||||
console.log('我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -31,36 +31,36 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
const uidGenerator=()=>{
|
||||
return '-'+parseInt(Math.random()*10000+1,10);
|
||||
return '-'+parseInt(Math.random()*10000+1,10)
|
||||
}
|
||||
export default {
|
||||
name: 'JImageUpload',
|
||||
data(){
|
||||
return {
|
||||
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
uploadAction:window._CONFIG['domianURL']+'/sys/common/upload',
|
||||
uploadLoading:false,
|
||||
picUrl:false,
|
||||
headers:{},
|
||||
fileList: [],
|
||||
previewImage:"",
|
||||
previewImage:'',
|
||||
}
|
||||
},
|
||||
props:{
|
||||
text:{
|
||||
type:String,
|
||||
required:false,
|
||||
default:"上传"
|
||||
default:'上传'
|
||||
},
|
||||
/*这个属性用于控制文件上传的业务路径*/
|
||||
bizPath:{
|
||||
type:String,
|
||||
required:false,
|
||||
default:"temp"
|
||||
default:'temp'
|
||||
},
|
||||
value:{
|
||||
type:[String,Array],
|
||||
@@ -87,12 +87,12 @@
|
||||
computed: {
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
delete result.change
|
||||
return result
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@@ -104,7 +104,7 @@
|
||||
this.initFileList(val)
|
||||
}
|
||||
if(!val || val.length==0){
|
||||
this.picUrl = false;
|
||||
this.picUrl = false
|
||||
}
|
||||
},
|
||||
//立刻执行handler
|
||||
@@ -112,17 +112,17 @@
|
||||
}
|
||||
},
|
||||
created(){
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.headers = {"X-Access-Token":token}
|
||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.headers = {'X-Access-Token':token}
|
||||
},
|
||||
methods:{
|
||||
initFileList(paths){
|
||||
if(!paths || paths.length === 0){
|
||||
this.fileList = [];
|
||||
return;
|
||||
this.fileList = []
|
||||
return
|
||||
}
|
||||
this.picUrl = true;
|
||||
let arr = paths.split(",")
|
||||
this.picUrl = true
|
||||
let arr = paths.split(',')
|
||||
for(var a=0;a<arr.length;a++){
|
||||
this.fileList.forEach((item)=>{
|
||||
if (item.url === arr[a]){
|
||||
@@ -133,33 +133,33 @@
|
||||
}
|
||||
},
|
||||
beforeUpload: function(file){
|
||||
var fileType = file.type;
|
||||
var fileType = file.type
|
||||
if(fileType.indexOf('image')<0){
|
||||
this.$message.warning('请上传图片');
|
||||
return false;
|
||||
this.$message.warning('请上传图片')
|
||||
return false
|
||||
}
|
||||
},
|
||||
handleChange(info) {
|
||||
this.picUrl = false;
|
||||
this.picUrl = false
|
||||
let fileList = info.fileList
|
||||
//update-begin-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
|
||||
if(this.number>0 && this.isMultiple){
|
||||
fileList = fileList.slice(-this.number);
|
||||
fileList = fileList.slice(-this.number)
|
||||
}
|
||||
//update-end-author:wangshuai date:20201022 for:LOWCOD-969 判断number是否大于0和是否多选,返回选定的元素。
|
||||
if(info.file.status==='done'){
|
||||
if(info.file.response.success){
|
||||
this.picUrl = true;
|
||||
this.picUrl = true
|
||||
fileList = fileList.map((file) => {
|
||||
if (file.response) {
|
||||
file.url = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`;
|
||||
file.url = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`
|
||||
}
|
||||
return file;
|
||||
});
|
||||
return file
|
||||
})
|
||||
}
|
||||
//this.$message.success(`${info.file.name} 上传成功!`);
|
||||
}else if (info.file.status === 'error') {
|
||||
this.$message.error(`${info.file.name} 上传失败.`);
|
||||
this.$message.error(`${info.file.name} 上传失败.`)
|
||||
}else if(info.file.status === 'removed'){
|
||||
this.handleDelete(info.file)
|
||||
}
|
||||
@@ -188,7 +188,7 @@
|
||||
if(!uploadFiles || uploadFiles.length==0){
|
||||
path = ''
|
||||
}
|
||||
let arr = [];
|
||||
let arr = []
|
||||
if(!this.isMultiple){
|
||||
arr.push(uploadFiles[uploadFiles.length-1].url)
|
||||
}else{
|
||||
@@ -197,22 +197,22 @@
|
||||
if(uploadFiles[a].status === 'done' ) {
|
||||
arr.push(uploadFiles[a].url)
|
||||
}else{
|
||||
return;
|
||||
return
|
||||
}
|
||||
// update-end-author:taoyan date:20200819 for:【开源问题z】上传图片组件 LOWCOD-783
|
||||
}
|
||||
}
|
||||
if(arr.length>0){
|
||||
path = arr.join(",")
|
||||
path = arr.join(',')
|
||||
}
|
||||
this.$emit('change', path);
|
||||
this.$emit('change', path)
|
||||
},
|
||||
handleDelete(file){
|
||||
//如有需要新增 删除逻辑
|
||||
},
|
||||
handleCancel() {
|
||||
this.close();
|
||||
this.previewVisible = false;
|
||||
this.close()
|
||||
this.previewVisible = false
|
||||
},
|
||||
close () {
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
import { Input } from 'ant-design-vue'
|
||||
|
||||
const JINPUT_QUERY_LIKE = 'like';
|
||||
const JINPUT_QUERY_NE = 'ne';
|
||||
const JINPUT_QUERY_GE = 'ge'; //大于等于
|
||||
const JINPUT_QUERY_LE = 'le'; //小于等于
|
||||
const JINPUT_QUERY_LIKE = 'like'
|
||||
const JINPUT_QUERY_NE = 'ne'
|
||||
const JINPUT_QUERY_GE = 'ge' //大于等于
|
||||
const JINPUT_QUERY_LE = 'le' //小于等于
|
||||
|
||||
export default {
|
||||
name: 'JInput',
|
||||
@@ -48,19 +48,19 @@
|
||||
computed: {
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
delete result.change
|
||||
return result
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value:{
|
||||
immediate:true,
|
||||
handler:function(){
|
||||
this.initVal();
|
||||
this.initVal()
|
||||
}
|
||||
},
|
||||
// 当 type 变化的时候重新计算值
|
||||
@@ -77,19 +77,19 @@
|
||||
switch (this.type) {
|
||||
case JINPUT_QUERY_LIKE:
|
||||
//修复路由传参的值传送到jinput框被前后各截取了一位 #1336
|
||||
if(text.indexOf("*") != -1){
|
||||
text = text.substring(1,text.length-1);
|
||||
if(text.indexOf('*') != -1){
|
||||
text = text.substring(1,text.length-1)
|
||||
}
|
||||
break;
|
||||
break
|
||||
case JINPUT_QUERY_NE:
|
||||
text = text.substring(1);
|
||||
break;
|
||||
text = text.substring(1)
|
||||
break
|
||||
case JINPUT_QUERY_GE:
|
||||
text = text.substring(2);
|
||||
break;
|
||||
text = text.substring(2)
|
||||
break
|
||||
case JINPUT_QUERY_LE:
|
||||
text = text.substring(2);
|
||||
break;
|
||||
text = text.substring(2)
|
||||
break
|
||||
default:
|
||||
}
|
||||
this.inputVal = text
|
||||
@@ -102,20 +102,20 @@
|
||||
}
|
||||
switch (this.type) {
|
||||
case JINPUT_QUERY_LIKE:
|
||||
text = "*"+text+"*";
|
||||
break;
|
||||
text = '*'+text+'*'
|
||||
break
|
||||
case JINPUT_QUERY_NE:
|
||||
text = "!"+text;
|
||||
break;
|
||||
text = '!'+text
|
||||
break
|
||||
case JINPUT_QUERY_GE:
|
||||
text = ">="+text;
|
||||
break;
|
||||
text = '>='+text
|
||||
break
|
||||
case JINPUT_QUERY_LE:
|
||||
text = "<="+text;
|
||||
break;
|
||||
text = '<='+text
|
||||
break
|
||||
default:
|
||||
}
|
||||
this.$emit('change', text);
|
||||
this.$emit('change', text)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
|
||||
@@ -107,11 +107,11 @@
|
||||
return {
|
||||
treeValue: null, // 选中的数据
|
||||
treeData:[],// 渲染树的数组
|
||||
url:"/sys/dict/loadTreeData",
|
||||
url:'/sys/dict/loadTreeData',
|
||||
view:'/sys/dict/loadDictItem/',
|
||||
tableName:"",
|
||||
text:"",
|
||||
code:"",
|
||||
tableName:'',
|
||||
text:'',
|
||||
code:'',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -131,12 +131,12 @@
|
||||
},
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
delete result.change
|
||||
return result
|
||||
}
|
||||
},
|
||||
created(){
|
||||
@@ -151,7 +151,7 @@
|
||||
},
|
||||
methods: {
|
||||
loadItemByCode(){
|
||||
if( !this.value || this.value == "0" ){
|
||||
if( !this.value || this.value == '0' ){
|
||||
this.treeValue = null
|
||||
}else{
|
||||
getAction(`${this.view}${this.dict}`,{key:this.value}).then(res=>{
|
||||
@@ -160,7 +160,7 @@
|
||||
this.treeValue = values // v-model接收的是string || string[]
|
||||
//将节点名称显示在选择框上
|
||||
this.treeValue = res.result[0]
|
||||
this.onLoadTriggleChange(res.result[0]);
|
||||
this.onLoadTriggleChange(res.result[0])
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -172,7 +172,7 @@
|
||||
}
|
||||
},
|
||||
initDictInfo(){ //取出父组件传过来的code,text,tableName
|
||||
let arr = this.dict.split(",")
|
||||
let arr = this.dict.split(',')
|
||||
this.tableName = arr[0]
|
||||
this.text = arr[1]
|
||||
this.code = arr[2]
|
||||
@@ -253,7 +253,7 @@
|
||||
}
|
||||
this.treeData = [...res.result]
|
||||
}else{
|
||||
console.log("数根节点查询结果-else",res)
|
||||
console.log('数根节点查询结果-else',res)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
@@ -276,7 +276,7 @@
|
||||
/*
|
||||
* 使用$listeners向上暴露事件---和$emit一起使用出现的问题:change事件会执行两遍
|
||||
* 解决办法:改变选中时提交的事件名*/
|
||||
this.$emit('change', '');
|
||||
this.$emit('change', '')
|
||||
this.treeValue = null
|
||||
} else if (value instanceof Array) {
|
||||
//多选
|
||||
@@ -295,18 +295,18 @@
|
||||
let myCondition = this.condition
|
||||
return new Promise((resolve,reject)=>{
|
||||
if(!myCondition){
|
||||
resolve();
|
||||
resolve()
|
||||
}else{
|
||||
try {
|
||||
let test=JSON.parse(myCondition);
|
||||
let test=JSON.parse(myCondition)
|
||||
if(typeof test == 'object' && test){
|
||||
resolve()
|
||||
}else{
|
||||
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
|
||||
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
|
||||
reject()
|
||||
}
|
||||
} catch(e) {
|
||||
this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
|
||||
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
|
||||
reject()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,22 +31,22 @@
|
||||
<script>
|
||||
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { getFileAccessHttpUrl } from '@/api/manage';
|
||||
import { getFileInfo } from '@/api/api';
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||
import { getFileInfo } from '@/api/api'
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
const FILE_TYPE_ALL = "all"
|
||||
const FILE_TYPE_IMG = "image"
|
||||
const FILE_TYPE_TXT = "file"
|
||||
const FILE_TYPE_ALL = 'all'
|
||||
const FILE_TYPE_IMG = 'image'
|
||||
const FILE_TYPE_TXT = 'file'
|
||||
const uidGenerator=()=>{
|
||||
return '-'+parseInt(Math.random()*10000+1,10);
|
||||
return '-'+parseInt(Math.random()*10000+1,10)
|
||||
}
|
||||
export default {
|
||||
name: 'JUpload',
|
||||
data(){
|
||||
return {
|
||||
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
uploadAction:window._CONFIG['domianURL']+'/sys/common/upload',
|
||||
headers:{},
|
||||
fileList: [],
|
||||
newFileList: [],
|
||||
@@ -57,7 +57,7 @@
|
||||
text: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "点击上传"
|
||||
default: '点击上传'
|
||||
},
|
||||
fileType: {
|
||||
type: String,
|
||||
@@ -68,7 +68,7 @@
|
||||
bizPath: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: "temp"
|
||||
default: 'temp'
|
||||
},
|
||||
value: {
|
||||
type: [String, Array],
|
||||
@@ -127,7 +127,7 @@
|
||||
if(this.returnUrl){
|
||||
this.initFileList(val.join(','))
|
||||
}else{
|
||||
this.initFileListArr(val);
|
||||
this.initFileListArr(val)
|
||||
}
|
||||
} else {
|
||||
this.initFileList(val)
|
||||
@@ -138,12 +138,12 @@
|
||||
computed:{
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
const vm = this;
|
||||
const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
)
|
||||
delete result.change;
|
||||
return result;
|
||||
delete result.change
|
||||
return result
|
||||
},
|
||||
isImageComp(){
|
||||
return this.fileType === FILE_TYPE_IMG
|
||||
@@ -153,17 +153,17 @@
|
||||
},
|
||||
},
|
||||
created(){
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||
//---------------------------- begin 图片左右换位置 -------------------------------------
|
||||
this.headers = {"X-Access-Token":token};
|
||||
this.containerId = 'container-ty-'+new Date().getTime();
|
||||
this.headers = {'X-Access-Token':token}
|
||||
this.containerId = 'container-ty-'+new Date().getTime()
|
||||
//---------------------------- end 图片左右换位置 -------------------------------------
|
||||
},
|
||||
methods:{
|
||||
initFileListArr(val){
|
||||
if(!val || val.length==0){
|
||||
this.fileList = [];
|
||||
return;
|
||||
this.fileList = []
|
||||
return
|
||||
}
|
||||
for(var a=0;a<val.length;a++){
|
||||
this.fileList.forEach((item)=>{
|
||||
@@ -176,10 +176,10 @@
|
||||
},
|
||||
async initFileList(paths){
|
||||
if(!paths || paths.length === 0){
|
||||
this.fileList = [];
|
||||
return;
|
||||
this.fileList = []
|
||||
return
|
||||
}
|
||||
let arr = paths.split(",")
|
||||
let arr = paths.split(',')
|
||||
// 返回路径的时候,对路径进行操作,取出所属id
|
||||
if(!this.returnId && arr.length > 0) {
|
||||
const newArr = []
|
||||
@@ -216,20 +216,20 @@
|
||||
if(!uploadFiles || uploadFiles.length==0){
|
||||
path = ''
|
||||
}
|
||||
let arr = [];
|
||||
let arr = []
|
||||
// 如果returnid为true 只返回id
|
||||
if(this.returnId){
|
||||
for(var a=0;a<uploadFiles.length;a++){
|
||||
if(uploadFiles[a].status === 'done' ) {
|
||||
arr.push(uploadFiles[a].response.result.id)
|
||||
}else{
|
||||
return;
|
||||
return
|
||||
}
|
||||
}
|
||||
if(arr.length>0){
|
||||
fileIds = arr.join(",")
|
||||
fileIds = arr.join(',')
|
||||
}
|
||||
this.$emit('change', fileIds);
|
||||
this.$emit('change', fileIds)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -237,22 +237,22 @@
|
||||
if(uploadFiles[a].status === 'done' ) {
|
||||
arr.push(uploadFiles[a].url)
|
||||
}else{
|
||||
return;
|
||||
return
|
||||
}
|
||||
}
|
||||
if(arr.length>0){
|
||||
path = arr.join(",")
|
||||
path = arr.join(',')
|
||||
}
|
||||
this.$emit('change', path);
|
||||
this.$emit('change', path)
|
||||
},
|
||||
beforeUpload(file){
|
||||
this.uploadGoOn=true
|
||||
var fileType = file.type;
|
||||
var fileType = file.type
|
||||
if(this.fileType===FILE_TYPE_IMG){
|
||||
if(fileType.indexOf('image')<0){
|
||||
this.$message.warning('请上传图片');
|
||||
this.$message.warning('请上传图片')
|
||||
this.uploadGoOn=false
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
}
|
||||
//TODO 扩展功能验证文件大小
|
||||
@@ -260,25 +260,25 @@
|
||||
},
|
||||
handleChange(info) {
|
||||
if(!info.file.status && this.uploadGoOn === false){
|
||||
info.fileList.pop();
|
||||
info.fileList.pop()
|
||||
}
|
||||
let fileList = info.fileList
|
||||
if(info.file.status==='done'){
|
||||
if(this.number>0){
|
||||
fileList = fileList.slice(-this.number);
|
||||
fileList = fileList.slice(-this.number)
|
||||
}
|
||||
if(info.file.response.success){
|
||||
fileList = fileList.map((file) => {
|
||||
if (file.response) {
|
||||
// let reUrl = `${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.response.result.fileName}`;
|
||||
file.url = getFileAccessHttpUrl(file.response.result.id);
|
||||
file.url = getFileAccessHttpUrl(file.response.result.id)
|
||||
}
|
||||
return file;
|
||||
});
|
||||
return file
|
||||
})
|
||||
}
|
||||
//this.$message.success(`${info.file.name} 上传成功!`);
|
||||
}else if (info.file.status === 'error') {
|
||||
this.$message.error(`${info.file.name} 上传失败.`);
|
||||
this.$message.error(`${info.file.name} 上传失败.`)
|
||||
}else if(info.file.status === 'removed'){
|
||||
this.handleDelete(info.file)
|
||||
}
|
||||
@@ -289,7 +289,7 @@
|
||||
this.handlePathChange()
|
||||
}else{
|
||||
//returnUrl为false时返回文件名称、文件路径及文件大小
|
||||
this.newFileList = [];
|
||||
this.newFileList = []
|
||||
for(var a=0;a<fileList.length;a++){
|
||||
// update-begin-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||
if(fileList[a].status === 'done' ) {
|
||||
@@ -297,14 +297,14 @@
|
||||
fileName:fileList[a].name,
|
||||
filePath:fileList[a].url,
|
||||
fileSize:fileList[a].size
|
||||
};
|
||||
this.newFileList.push(fileJson);
|
||||
}
|
||||
this.newFileList.push(fileJson)
|
||||
}else{
|
||||
return;
|
||||
return
|
||||
}
|
||||
// update-end-author:lvdandan date:20200603 for:【TESTA-514】【开源issue】多个文件同时上传时,控制台报错
|
||||
}
|
||||
this.$emit('change', this.newFileList);
|
||||
this.$emit('change', this.newFileList)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import JModal from "./JModal";
|
||||
import JInput from "./JInput.vue";
|
||||
import JModal from './JModal'
|
||||
import JInput from './JInput.vue'
|
||||
import JEllipsis from './JEllipsis.vue'
|
||||
|
||||
export default {
|
||||
install(Vue) {
|
||||
Vue.component(JModal.name, JModal);
|
||||
Vue.component("JInput", JInput);
|
||||
Vue.component(JModal.name, JModal)
|
||||
Vue.component('JInput', JInput)
|
||||
Vue.component('JEllipsis', JEllipsis)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getFileAccessHttpUrl } from '@/api/manage';
|
||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||
|
||||
const getFileName=(path)=>{
|
||||
if(path.lastIndexOf("\\")>=0){
|
||||
let reg=new RegExp("\\\\","g");
|
||||
path = path.replace(reg,"/");
|
||||
if(path.lastIndexOf('\\')>=0){
|
||||
let reg=new RegExp('\\\\','g')
|
||||
path = path.replace(reg,'/')
|
||||
}
|
||||
return path.substring(path.lastIndexOf("/")+1);
|
||||
return path.substring(path.lastIndexOf('/')+1)
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -76,11 +76,11 @@
|
||||
},
|
||||
methods:{
|
||||
handleChange(value){
|
||||
this.filePath = value;
|
||||
this.filePath = value
|
||||
},
|
||||
show(id,value,flag){
|
||||
this.id = id;
|
||||
this.filePath = value;
|
||||
this.id = id
|
||||
this.filePath = value
|
||||
this.visible=true
|
||||
if(flag === 'img'){
|
||||
this.fileType = 'image'
|
||||
@@ -91,10 +91,10 @@
|
||||
},
|
||||
ok(){
|
||||
if(!this.filePath){
|
||||
this.$message.error("未上传任何文件")
|
||||
return false;
|
||||
this.$message.error('未上传任何文件')
|
||||
return false
|
||||
}
|
||||
let arr = this.filePath.split(",")
|
||||
let arr = this.filePath.split(',')
|
||||
let obj = {
|
||||
name:getFileName(arr[0]),
|
||||
url:getFileAccessHttpUrl(arr[0]),
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
immediate:true,
|
||||
handler:function(){
|
||||
if(this.value && this.value.length>0){
|
||||
this.inputContent = this.value;
|
||||
this.inputContent = this.value
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -335,184 +335,184 @@
|
||||
},
|
||||
computed: {
|
||||
modalWidth(){
|
||||
return 608;
|
||||
return 608
|
||||
},
|
||||
secondsText() {
|
||||
let seconds = '';
|
||||
let cronEvery=this.result.second.cronEvery||'';
|
||||
let seconds = ''
|
||||
let cronEvery=this.result.second.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
seconds = '*';
|
||||
break;
|
||||
seconds = '*'
|
||||
break
|
||||
case '2':
|
||||
seconds = this.result.second.incrementStart+'/'+this.result.second.incrementIncrement;
|
||||
break;
|
||||
seconds = this.result.second.incrementStart+'/'+this.result.second.incrementIncrement
|
||||
break
|
||||
case '3':
|
||||
this.result.second.specificSpecific.map(val=> {seconds += val+','});
|
||||
seconds = seconds.slice(0, -1);
|
||||
break;
|
||||
this.result.second.specificSpecific.map(val=> {seconds += val+','})
|
||||
seconds = seconds.slice(0, -1)
|
||||
break
|
||||
case '4':
|
||||
seconds = this.result.second.rangeStart+'-'+this.result.second.rangeEnd;
|
||||
break;
|
||||
seconds = this.result.second.rangeStart+'-'+this.result.second.rangeEnd
|
||||
break
|
||||
}
|
||||
return seconds;
|
||||
return seconds
|
||||
},
|
||||
minutesText() {
|
||||
let minutes = '';
|
||||
let cronEvery=this.result.minute.cronEvery||'';
|
||||
let minutes = ''
|
||||
let cronEvery=this.result.minute.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
minutes = '*';
|
||||
break;
|
||||
minutes = '*'
|
||||
break
|
||||
case '2':
|
||||
minutes = this.result.minute.incrementStart+'/'+this.result.minute.incrementIncrement;
|
||||
break;
|
||||
minutes = this.result.minute.incrementStart+'/'+this.result.minute.incrementIncrement
|
||||
break
|
||||
case '3':
|
||||
this.result.minute.specificSpecific.map(val=> {
|
||||
minutes += val+','
|
||||
});
|
||||
minutes = minutes.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
minutes = minutes.slice(0, -1)
|
||||
break
|
||||
case '4':
|
||||
minutes = this.result.minute.rangeStart+'-'+this.result.minute.rangeEnd;
|
||||
break;
|
||||
minutes = this.result.minute.rangeStart+'-'+this.result.minute.rangeEnd
|
||||
break
|
||||
}
|
||||
return minutes;
|
||||
return minutes
|
||||
},
|
||||
hoursText() {
|
||||
let hours = '';
|
||||
let cronEvery=this.result.hour.cronEvery||'';
|
||||
let hours = ''
|
||||
let cronEvery=this.result.hour.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
hours = '*';
|
||||
break;
|
||||
hours = '*'
|
||||
break
|
||||
case '2':
|
||||
hours = this.result.hour.incrementStart+'/'+this.result.hour.incrementIncrement;
|
||||
break;
|
||||
hours = this.result.hour.incrementStart+'/'+this.result.hour.incrementIncrement
|
||||
break
|
||||
case '3':
|
||||
this.result.hour.specificSpecific.map(val=> {
|
||||
hours += val+','
|
||||
});
|
||||
hours = hours.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
hours = hours.slice(0, -1)
|
||||
break
|
||||
case '4':
|
||||
hours = this.result.hour.rangeStart+'-'+this.result.hour.rangeEnd;
|
||||
break;
|
||||
hours = this.result.hour.rangeStart+'-'+this.result.hour.rangeEnd
|
||||
break
|
||||
}
|
||||
return hours;
|
||||
return hours
|
||||
},
|
||||
daysText() {
|
||||
let days='';
|
||||
let cronEvery=this.result.day.cronEvery||'';
|
||||
let days=''
|
||||
let cronEvery=this.result.day.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
break;
|
||||
break
|
||||
case '2':
|
||||
case '4':
|
||||
case '11':
|
||||
days = '?';
|
||||
break;
|
||||
days = '?'
|
||||
break
|
||||
case '3':
|
||||
days = this.result.day.incrementStart+'/'+this.result.day.incrementIncrement;
|
||||
break;
|
||||
days = this.result.day.incrementStart+'/'+this.result.day.incrementIncrement
|
||||
break
|
||||
case '5':
|
||||
this.result.day.specificSpecific.map(val=> {
|
||||
days += val+','
|
||||
});
|
||||
days = days.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
days = days.slice(0, -1)
|
||||
break
|
||||
case '6':
|
||||
days = "L";
|
||||
break;
|
||||
days = 'L'
|
||||
break
|
||||
case '7':
|
||||
days = "LW";
|
||||
break;
|
||||
days = 'LW'
|
||||
break
|
||||
case '8':
|
||||
days = this.result.day.cronLastSpecificDomDay + 'L';
|
||||
break;
|
||||
days = this.result.day.cronLastSpecificDomDay + 'L'
|
||||
break
|
||||
case '9':
|
||||
days = 'L-' + this.result.day.cronDaysBeforeEomMinus;
|
||||
break;
|
||||
days = 'L-' + this.result.day.cronDaysBeforeEomMinus
|
||||
break
|
||||
case '10':
|
||||
days = this.result.day.cronDaysNearestWeekday+"W";
|
||||
days = this.result.day.cronDaysNearestWeekday+'W'
|
||||
break
|
||||
}
|
||||
return days;
|
||||
return days
|
||||
},
|
||||
weeksText() {
|
||||
let weeks = '';
|
||||
let cronEvery=this.result.day.cronEvery||'';
|
||||
let weeks = ''
|
||||
let cronEvery=this.result.day.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
weeks = '?';
|
||||
break;
|
||||
weeks = '?'
|
||||
break
|
||||
case '2':
|
||||
weeks = this.result.week.incrementStart+'/'+this.result.week.incrementIncrement;
|
||||
break;
|
||||
weeks = this.result.week.incrementStart+'/'+this.result.week.incrementIncrement
|
||||
break
|
||||
case '4':
|
||||
this.result.week.specificSpecific.map(val=> {
|
||||
weeks += val+','
|
||||
});
|
||||
weeks = weeks.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
weeks = weeks.slice(0, -1)
|
||||
break
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '10':
|
||||
weeks = "?";
|
||||
break;
|
||||
weeks = '?'
|
||||
break
|
||||
case '11':
|
||||
weeks = this.result.week.cronNthDayDay+"#"+this.result.week.cronNthDayNth;
|
||||
break;
|
||||
weeks = this.result.week.cronNthDayDay+'#'+this.result.week.cronNthDayNth
|
||||
break
|
||||
}
|
||||
return weeks;
|
||||
return weeks
|
||||
},
|
||||
monthsText() {
|
||||
let months = '';
|
||||
let cronEvery=this.result.month.cronEvery||'';
|
||||
let months = ''
|
||||
let cronEvery=this.result.month.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
months = '*';
|
||||
break;
|
||||
months = '*'
|
||||
break
|
||||
case '2':
|
||||
months = this.result.month.incrementStart+'/'+this.result.month.incrementIncrement;
|
||||
break;
|
||||
months = this.result.month.incrementStart+'/'+this.result.month.incrementIncrement
|
||||
break
|
||||
case '3':
|
||||
this.result.month.specificSpecific.map(val=> {
|
||||
months += val+','
|
||||
});
|
||||
months = months.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
months = months.slice(0, -1)
|
||||
break
|
||||
case '4':
|
||||
months = this.result.month.rangeStart+'-'+this.result.month.rangeEnd;
|
||||
break;
|
||||
months = this.result.month.rangeStart+'-'+this.result.month.rangeEnd
|
||||
break
|
||||
}
|
||||
return months;
|
||||
return months
|
||||
},
|
||||
yearsText() {
|
||||
let years = '';
|
||||
let cronEvery=this.result.year.cronEvery||'';
|
||||
let years = ''
|
||||
let cronEvery=this.result.year.cronEvery||''
|
||||
switch (cronEvery.toString()){
|
||||
case '1':
|
||||
years = '*';
|
||||
break;
|
||||
years = '*'
|
||||
break
|
||||
case '2':
|
||||
years = this.result.year.incrementStart+'/'+this.result.year.incrementIncrement;
|
||||
break;
|
||||
years = this.result.year.incrementStart+'/'+this.result.year.incrementIncrement
|
||||
break
|
||||
case '3':
|
||||
this.result.year.specificSpecific.map(val=> {
|
||||
years += val+','
|
||||
});
|
||||
years = years.slice(0, -1);
|
||||
break;
|
||||
})
|
||||
years = years.slice(0, -1)
|
||||
break
|
||||
case '4':
|
||||
years = this.result.year.rangeStart+'-'+this.result.year.rangeEnd;
|
||||
break;
|
||||
years = this.result.year.rangeStart+'-'+this.result.year.rangeEnd
|
||||
break
|
||||
}
|
||||
return years;
|
||||
return years
|
||||
},
|
||||
cron(){
|
||||
return `${this.secondsText||'*'} ${this.minutesText||'*'} ${this.hoursText||'*'} ${this.daysText||'*'} ${this.monthsText||'*'} ${this.weeksText||'?'} ${this.yearsText||'*'}`
|
||||
@@ -531,25 +531,25 @@
|
||||
// //this.result = clone(this.defaultValue);
|
||||
// this.result = JSON.parse(JSON.stringify(this.defaultValue));
|
||||
// }
|
||||
let label = this.data;
|
||||
let label = this.data
|
||||
if(label){
|
||||
this.secondsReverseExp(label)
|
||||
this.minutesReverseExp(label);
|
||||
this.hoursReverseExp(label);
|
||||
this.daysReverseExp(label);
|
||||
this.daysReverseExp(label);
|
||||
this.monthsReverseExp(label);
|
||||
this.yearReverseExp(label);
|
||||
JSON.parse(JSON.stringify(label));
|
||||
this.minutesReverseExp(label)
|
||||
this.hoursReverseExp(label)
|
||||
this.daysReverseExp(label)
|
||||
this.daysReverseExp(label)
|
||||
this.monthsReverseExp(label)
|
||||
this.yearReverseExp(label)
|
||||
JSON.parse(JSON.stringify(label))
|
||||
}else {
|
||||
this.result = JSON.parse(JSON.stringify(this.defaultValue));
|
||||
this.result = JSON.parse(JSON.stringify(this.defaultValue))
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(){
|
||||
this.visible = true;
|
||||
this.visible = true
|
||||
// console.log('secondsReverseExp',this.secondsReverseExp(this.data));
|
||||
// console.log('minutesReverseExp',this.minutesReverseExp(this.data));
|
||||
// console.log('hoursReverseExp',this.hoursReverseExp(this.data));
|
||||
@@ -559,15 +559,15 @@
|
||||
|
||||
},
|
||||
handleSubmit(){
|
||||
this.$emit('ok',this.cron);
|
||||
this.close();
|
||||
this.visible = false;
|
||||
this.$emit('ok',this.cron)
|
||||
this.close()
|
||||
this.visible = false
|
||||
},
|
||||
close(){
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
},
|
||||
secondsReverseExp(seconds) {
|
||||
let val = seconds.split(" ")[0];
|
||||
let val = seconds.split(' ')[0]
|
||||
//alert(val);
|
||||
let second = {
|
||||
cronEvery:'',
|
||||
@@ -576,32 +576,32 @@
|
||||
rangeStart:1,
|
||||
rangeEnd:0,
|
||||
specificSpecific:[]
|
||||
};
|
||||
}
|
||||
switch (true) {
|
||||
case val.includes('*'):
|
||||
second.cronEvery = '1';
|
||||
break;
|
||||
second.cronEvery = '1'
|
||||
break
|
||||
case val.includes('/'):
|
||||
second.cronEvery = '2';
|
||||
second.incrementStart = val.split('/')[0];
|
||||
second.incrementIncrement = val.split('/')[1];
|
||||
break;
|
||||
second.cronEvery = '2'
|
||||
second.incrementStart = val.split('/')[0]
|
||||
second.incrementIncrement = val.split('/')[1]
|
||||
break
|
||||
case val.includes(','):
|
||||
second.cronEvery = '3';
|
||||
second.specificSpecific = val.split(',').map(Number).sort();
|
||||
break;
|
||||
second.cronEvery = '3'
|
||||
second.specificSpecific = val.split(',').map(Number).sort()
|
||||
break
|
||||
case val.includes('-'):
|
||||
second.cronEvery = '4';
|
||||
second.rangeStart = val.split('-')[0];
|
||||
second.rangeEnd = val.split('-')[1];
|
||||
break;
|
||||
second.cronEvery = '4'
|
||||
second.rangeStart = val.split('-')[0]
|
||||
second.rangeEnd = val.split('-')[1]
|
||||
break
|
||||
default:
|
||||
second.cronEvery = '1';
|
||||
second.cronEvery = '1'
|
||||
}
|
||||
this.result.second = second;
|
||||
this.result.second = second
|
||||
},
|
||||
minutesReverseExp(minutes) {
|
||||
let val = minutes.split(" ")[1];
|
||||
let val = minutes.split(' ')[1]
|
||||
let minute = {
|
||||
cronEvery:'',
|
||||
incrementStart:3,
|
||||
@@ -612,29 +612,29 @@
|
||||
}
|
||||
switch (true) {
|
||||
case val.includes('*'):
|
||||
minute.cronEvery = '1';
|
||||
break;
|
||||
minute.cronEvery = '1'
|
||||
break
|
||||
case val.includes('/'):
|
||||
minute.cronEvery = '2';
|
||||
minute.incrementStart = val.split('/')[0];
|
||||
minute.incrementIncrement = val.split('/')[1];
|
||||
break;
|
||||
minute.cronEvery = '2'
|
||||
minute.incrementStart = val.split('/')[0]
|
||||
minute.incrementIncrement = val.split('/')[1]
|
||||
break
|
||||
case val.includes(','):
|
||||
minute.cronEvery = '3';
|
||||
minute.specificSpecific = val.split(',').map(Number).sort();
|
||||
break;
|
||||
minute.cronEvery = '3'
|
||||
minute.specificSpecific = val.split(',').map(Number).sort()
|
||||
break
|
||||
case val.includes('-'):
|
||||
minute.cronEvery = '4';
|
||||
minute.rangeStart = val.split('-')[0];
|
||||
minute.rangeEnd = val.split('-')[1];
|
||||
break;
|
||||
minute.cronEvery = '4'
|
||||
minute.rangeStart = val.split('-')[0]
|
||||
minute.rangeEnd = val.split('-')[1]
|
||||
break
|
||||
default:
|
||||
minute.cronEvery = '1';
|
||||
minute.cronEvery = '1'
|
||||
}
|
||||
this.result.minute = minute;
|
||||
this.result.minute = minute
|
||||
},
|
||||
hoursReverseExp(hours) {
|
||||
let val = hours.split(" ")[2];
|
||||
let val = hours.split(' ')[2]
|
||||
let hour ={
|
||||
cronEvery:'',
|
||||
incrementStart:3,
|
||||
@@ -642,33 +642,33 @@
|
||||
rangeStart:1,
|
||||
rangeEnd:'0',
|
||||
specificSpecific:[],
|
||||
};
|
||||
}
|
||||
switch (true) {
|
||||
case val.includes('*'):
|
||||
hour.cronEvery = '1';
|
||||
break;
|
||||
hour.cronEvery = '1'
|
||||
break
|
||||
case val.includes('/'):
|
||||
hour.cronEvery = '2';
|
||||
hour.incrementStart = val.split('/')[0];
|
||||
hour.incrementIncrement = val.split('/')[1];
|
||||
break;
|
||||
hour.cronEvery = '2'
|
||||
hour.incrementStart = val.split('/')[0]
|
||||
hour.incrementIncrement = val.split('/')[1]
|
||||
break
|
||||
case val.includes(','):
|
||||
hour.cronEvery = '3';
|
||||
hour.specificSpecific = val.split(',').map(Number).sort();
|
||||
break;
|
||||
hour.cronEvery = '3'
|
||||
hour.specificSpecific = val.split(',').map(Number).sort()
|
||||
break
|
||||
case val.includes('-'):
|
||||
hour.cronEvery = '4';
|
||||
hour.rangeStart = val.split('-')[0];
|
||||
hour.rangeEnd = val.split('-')[1];
|
||||
break;
|
||||
hour.cronEvery = '4'
|
||||
hour.rangeStart = val.split('-')[0]
|
||||
hour.rangeEnd = val.split('-')[1]
|
||||
break
|
||||
default:
|
||||
hour.cronEvery = '1';
|
||||
hour.cronEvery = '1'
|
||||
}
|
||||
this.result.hour = hour;
|
||||
this.result.hour = hour
|
||||
},
|
||||
daysReverseExp(cron) {
|
||||
let days = cron.split(" ")[3];
|
||||
let weeks = cron.split(" ")[5];
|
||||
let days = cron.split(' ')[3]
|
||||
let weeks = cron.split(' ')[5]
|
||||
let day ={
|
||||
cronEvery:'',
|
||||
incrementStart:1,
|
||||
@@ -679,7 +679,7 @@
|
||||
cronLastSpecificDomDay:1,
|
||||
cronDaysBeforeEomMinus:1,
|
||||
cronDaysNearestWeekday:1,
|
||||
};
|
||||
}
|
||||
let week = {
|
||||
cronEvery:'',
|
||||
incrementStart:1,
|
||||
@@ -687,80 +687,80 @@
|
||||
specificSpecific:[],
|
||||
cronNthDayDay:1,
|
||||
cronNthDayNth:'1',
|
||||
};
|
||||
}
|
||||
if (!days.includes('?')) {
|
||||
switch (true) {
|
||||
case days.includes('*'):
|
||||
day.cronEvery = '1';
|
||||
break;
|
||||
day.cronEvery = '1'
|
||||
break
|
||||
case days.includes('?'):
|
||||
// 2、4、11
|
||||
break;
|
||||
break
|
||||
case days.includes('/'):
|
||||
day.cronEvery = '3';
|
||||
day.incrementStart = days.split('/')[0];
|
||||
day.incrementIncrement = days.split('/')[1];
|
||||
break;
|
||||
day.cronEvery = '3'
|
||||
day.incrementStart = days.split('/')[0]
|
||||
day.incrementIncrement = days.split('/')[1]
|
||||
break
|
||||
case days.includes(','):
|
||||
day.cronEvery = '5';
|
||||
day.specificSpecific = days.split(',').map(Number).sort();
|
||||
day.cronEvery = '5'
|
||||
day.specificSpecific = days.split(',').map(Number).sort()
|
||||
// day.specificSpecific.forEach(function (value, index) {
|
||||
// day.specificSpecific[index] = value -1;
|
||||
// });
|
||||
break;
|
||||
break
|
||||
case days.includes('LW'):
|
||||
day.cronEvery = '7';
|
||||
break;
|
||||
day.cronEvery = '7'
|
||||
break
|
||||
case days.includes('L-'):
|
||||
day.cronEvery = '9';
|
||||
day.cronDaysBeforeEomMinus = days.split('L-')[1];
|
||||
break;
|
||||
day.cronEvery = '9'
|
||||
day.cronDaysBeforeEomMinus = days.split('L-')[1]
|
||||
break
|
||||
case days.includes('L'):
|
||||
|
||||
//alert(days);
|
||||
if(days.len == 1){
|
||||
day.cronEvery = '6';
|
||||
day.cronLastSpecificDomDay = '1';
|
||||
day.cronEvery = '6'
|
||||
day.cronLastSpecificDomDay = '1'
|
||||
}
|
||||
else
|
||||
{
|
||||
day.cronEvery = '8';
|
||||
day.cronLastSpecificDomDay = Number(days.split('L')[0]);
|
||||
day.cronEvery = '8'
|
||||
day.cronLastSpecificDomDay = Number(days.split('L')[0])
|
||||
}
|
||||
break;
|
||||
break
|
||||
case days.includes('W'):
|
||||
day.cronEvery = '10';
|
||||
day.cronDaysNearestWeekday = days.split('W')[0];
|
||||
break;
|
||||
day.cronEvery = '10'
|
||||
day.cronDaysNearestWeekday = days.split('W')[0]
|
||||
break
|
||||
default:
|
||||
day.cronEvery = '1';
|
||||
day.cronEvery = '1'
|
||||
}
|
||||
}else {
|
||||
switch (true){
|
||||
case weeks.includes('/'):
|
||||
day.cronEvery = '2';
|
||||
week.incrementStart = weeks.split("/")[0];
|
||||
week.incrementIncrement = weeks.split("/")[1];
|
||||
break;
|
||||
day.cronEvery = '2'
|
||||
week.incrementStart = weeks.split('/')[0]
|
||||
week.incrementIncrement = weeks.split('/')[1]
|
||||
break
|
||||
case weeks.includes(','):
|
||||
day.cronEvery = '4';
|
||||
week.specificSpecific = weeks.split(',').map(Number).sort();
|
||||
break;
|
||||
day.cronEvery = '4'
|
||||
week.specificSpecific = weeks.split(',').map(Number).sort()
|
||||
break
|
||||
case '#':
|
||||
day.cronEvery = '11';
|
||||
week.cronNthDayDay = weeks.split("#")[0];
|
||||
week.cronNthDayNth = weeks.split("#")[1];
|
||||
break;
|
||||
day.cronEvery = '11'
|
||||
week.cronNthDayDay = weeks.split('#')[0]
|
||||
week.cronNthDayNth = weeks.split('#')[1]
|
||||
break
|
||||
default:
|
||||
day.cronEvery = '1';
|
||||
week.cronEvery = '1';
|
||||
day.cronEvery = '1'
|
||||
week.cronEvery = '1'
|
||||
}
|
||||
}
|
||||
this.result.day = day;
|
||||
this.result.week = week;
|
||||
this.result.day = day
|
||||
this.result.week = week
|
||||
},
|
||||
monthsReverseExp(cron) {
|
||||
let months = cron.split(" ")[4];
|
||||
let months = cron.split(' ')[4]
|
||||
let month = {
|
||||
cronEvery:'',
|
||||
incrementStart:3,
|
||||
@@ -768,32 +768,32 @@
|
||||
rangeStart:1,
|
||||
rangeEnd:1,
|
||||
specificSpecific:[],
|
||||
};
|
||||
}
|
||||
switch (true){
|
||||
case months.includes('*'):
|
||||
month.cronEvery = '1';
|
||||
break;
|
||||
month.cronEvery = '1'
|
||||
break
|
||||
case months.includes('/'):
|
||||
month.cronEvery = '2';
|
||||
month.incrementStart = months.split('/')[0];
|
||||
month.incrementIncrement = months.split('/')[1];
|
||||
break;
|
||||
month.cronEvery = '2'
|
||||
month.incrementStart = months.split('/')[0]
|
||||
month.incrementIncrement = months.split('/')[1]
|
||||
break
|
||||
case months.includes(','):
|
||||
month.cronEvery = '3';
|
||||
month.specificSpecific = months.split(',').map(Number).sort();
|
||||
break;
|
||||
month.cronEvery = '3'
|
||||
month.specificSpecific = months.split(',').map(Number).sort()
|
||||
break
|
||||
case months.includes('-'):
|
||||
month.cronEvery = '4';
|
||||
month.rangeStart = months.split('-')[0];
|
||||
month.rangeEnd = months.split('-')[1];
|
||||
break;
|
||||
month.cronEvery = '4'
|
||||
month.rangeStart = months.split('-')[0]
|
||||
month.rangeEnd = months.split('-')[1]
|
||||
break
|
||||
default:
|
||||
month.cronEvery = '1';
|
||||
month.cronEvery = '1'
|
||||
}
|
||||
this.result.month = month;
|
||||
this.result.month = month
|
||||
},
|
||||
yearReverseExp(cron) {
|
||||
let years = cron.split(" ")[6];
|
||||
let years = cron.split(' ')[6]
|
||||
let year = {
|
||||
cronEvery:'',
|
||||
incrementStart:3,
|
||||
@@ -801,29 +801,29 @@
|
||||
rangeStart:2019,
|
||||
rangeEnd:2019,
|
||||
specificSpecific:[],
|
||||
};
|
||||
}
|
||||
switch (true){
|
||||
case years.includes('*'):
|
||||
year.cronEvery = '1';
|
||||
break;
|
||||
year.cronEvery = '1'
|
||||
break
|
||||
case years.includes('/'):
|
||||
year.cronEvery = '2';
|
||||
year.incrementStart = years.split('/')[0];
|
||||
year.incrementIncrement = years.split('/')[1];
|
||||
break;
|
||||
year.cronEvery = '2'
|
||||
year.incrementStart = years.split('/')[0]
|
||||
year.incrementIncrement = years.split('/')[1]
|
||||
break
|
||||
case years.includes(','):
|
||||
year.cronEvery = '3';
|
||||
year.specificSpecific = years.split(',').map(Number).sort();
|
||||
break;
|
||||
year.cronEvery = '3'
|
||||
year.specificSpecific = years.split(',').map(Number).sort()
|
||||
break
|
||||
case years.includes('-'):
|
||||
year.cronEvery = '4';
|
||||
year.rangeStart = years.split('-')[0];
|
||||
year.rangeEnd = years.split('-')[1];
|
||||
break;
|
||||
year.cronEvery = '4'
|
||||
year.rangeStart = years.split('-')[0]
|
||||
year.rangeEnd = years.split('-')[1]
|
||||
break
|
||||
default:
|
||||
year.cronEvery = '1';
|
||||
year.cronEvery = '1'
|
||||
}
|
||||
this.result.year = year;
|
||||
this.result.year = year
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import GlobalLayout from '@/components/page/GlobalLayout'
|
||||
|
||||
export default {
|
||||
name: "BasicLayout",
|
||||
name: 'BasicLayout',
|
||||
components: {
|
||||
GlobalLayout
|
||||
},
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: "IframePageContent",
|
||||
name: 'IframePageContent',
|
||||
inject:['closeCurrent'],
|
||||
data () {
|
||||
return {
|
||||
url: "",
|
||||
id:""
|
||||
url: '',
|
||||
id:''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.goUrl();
|
||||
this.goUrl()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -34,19 +34,19 @@
|
||||
let id = this.$route.path
|
||||
this.id = id
|
||||
//url = "http://www.baidu.com"
|
||||
console.log("------url------"+url)
|
||||
console.log('------url------'+url)
|
||||
if (url !== null && url !== undefined) {
|
||||
this.url = url;
|
||||
this.url = url
|
||||
/*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
||||
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
|
||||
this.closeCurrent();
|
||||
this.closeCurrent()
|
||||
//外部url加入token
|
||||
let tokenStr = "${token}";
|
||||
let tokenStr = '${token}'
|
||||
if(url.indexOf(tokenStr)!=-1){
|
||||
let token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.url = url.replace(tokenStr,token);
|
||||
let token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.url = url.replace(tokenStr,token)
|
||||
}
|
||||
window.open(this.url);
|
||||
window.open(this.url)
|
||||
}
|
||||
/*update_end author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import RouteView from './RouteView'
|
||||
|
||||
export default {
|
||||
name: "PageContent",
|
||||
name: 'PageContent',
|
||||
components: {
|
||||
RouteView,
|
||||
PageLayout
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
|
||||
import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: "RouteView",
|
||||
name: 'RouteView',
|
||||
computed: {
|
||||
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||
includedComponents() {
|
||||
@@ -24,10 +24,10 @@
|
||||
cacheRouterArray.push(this.$route.meta.componentName)
|
||||
// cacheRouterArray.push("OnlCgformHeadList")
|
||||
Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
|
||||
return cacheRouterArray;
|
||||
return cacheRouterArray
|
||||
}
|
||||
}
|
||||
return includedRouters;
|
||||
return includedRouters
|
||||
},
|
||||
//update-end--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||
keepAlive () {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
import { triggerWindowResizeEvent } from '@/utils/util'
|
||||
const indexKey = '/dashboard/analysis'
|
||||
import Vue from 'vue'
|
||||
import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
|
||||
import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'TabLayout',
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
// update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题
|
||||
changeTitle(title) {
|
||||
let projectTitle = "Jero-Boot 企业级快速开发平台"
|
||||
let projectTitle = 'Jero-Boot 企业级快速开发平台'
|
||||
// 首页特殊处理
|
||||
if (this.$route.path === indexKey) {
|
||||
document.title = projectTitle
|
||||
@@ -206,7 +206,7 @@
|
||||
this.$message.warning('这是最后一页,不能再关闭了啦')
|
||||
return
|
||||
}
|
||||
console.log("this.pageList ",this.pageList );
|
||||
console.log('this.pageList ',this.pageList )
|
||||
let removeRoute = this.pageList.filter(item => item.fullPath == key)
|
||||
this.pageList = this.pageList.filter(item => item.fullPath !== key)
|
||||
let index = this.linkList.indexOf(key)
|
||||
@@ -219,8 +219,8 @@
|
||||
let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
|
||||
if (removeRoute && removeRoute[0]) {
|
||||
let componentName = removeRoute[0].meta.componentName
|
||||
console.log("key: ", key);
|
||||
console.log("componentName: ", componentName);
|
||||
console.log('key: ', key)
|
||||
console.log('componentName: ', componentName)
|
||||
if(cacheRouterArray.includes(componentName)){
|
||||
cacheRouterArray.splice(cacheRouterArray.findIndex(item => item === componentName), 1)
|
||||
Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
|
||||
@@ -266,7 +266,7 @@
|
||||
},
|
||||
/* update_begin author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
|
||||
closeCurrent(){
|
||||
this.remove(this.activePage);
|
||||
this.remove(this.activePage)
|
||||
},
|
||||
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
|
||||
closeOthers(pageKey) {
|
||||
@@ -324,7 +324,7 @@
|
||||
//update-begin-author:taoyan date:20191008 for:路由刷新
|
||||
routeReload(){
|
||||
this.reloadFlag = false
|
||||
let ToggleMultipage = "ToggleMultipage"
|
||||
let ToggleMultipage = 'ToggleMultipage'
|
||||
this.$store.dispatch(ToggleMultipage,false)
|
||||
this.$nextTick(()=>{
|
||||
this.$store.dispatch(ToggleMultipage,true)
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RouteView from "@/components/layouts/RouteView"
|
||||
import RouteView from '@/components/layouts/RouteView'
|
||||
import { mixinDevice } from '@/utils/mixin.js'
|
||||
|
||||
export default {
|
||||
name: "UserLayout",
|
||||
name: 'UserLayout',
|
||||
components: { RouteView },
|
||||
mixins: [mixinDevice],
|
||||
data () {
|
||||
@@ -53,27 +53,27 @@
|
||||
}
|
||||
// 判断当前设备
|
||||
function isMobile() {
|
||||
var userAgentInfo = navigator.userAgent;
|
||||
var userAgentInfo = navigator.userAgent
|
||||
|
||||
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||
var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
|
||||
|
||||
var mobile_flag = false;
|
||||
var mobile_flag = false
|
||||
|
||||
//根据userAgent判断是否是手机
|
||||
for (var v = 0; v < mobileAgents.length; v++) {
|
||||
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
|
||||
mobile_flag = true;
|
||||
break;
|
||||
mobile_flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
var screen_width = window.screen.width;
|
||||
var screen_height = window.screen.height;
|
||||
var screen_width = window.screen.width
|
||||
var screen_height = window.screen.height
|
||||
|
||||
//根据屏幕分辨率判断是否是手机
|
||||
if (screen_width < 500 && screen_height < 800) {
|
||||
mobile_flag = true;
|
||||
mobile_flag = true
|
||||
}
|
||||
return mobile_flag;
|
||||
return mobile_flag
|
||||
}
|
||||
</script>
|
||||
<style lang="less" >
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ALayoutSider from "ant-design-vue/es/layout/Sider"
|
||||
import ALayoutSider from 'ant-design-vue/es/layout/Sider'
|
||||
import Logo from '../tools/Logo'
|
||||
import SMenu from './index'
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
|
||||
export default {
|
||||
name: "SideMenu",
|
||||
name: 'SideMenu',
|
||||
components: { ALayoutSider, Logo, SMenu },
|
||||
mixins: [mixin, mixinDevice],
|
||||
props: {
|
||||
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
})
|
||||
}
|
||||
//update-begin-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
|
||||
if(!this.selectedKeys || this.selectedKeys[0].indexOf(":")<0){
|
||||
if(!this.selectedKeys || this.selectedKeys[0].indexOf(':')<0){
|
||||
this.collapsed ? (this.cachedOpenKeys = openKeys) : (this.openKeys = openKeys)
|
||||
}
|
||||
//update-end-author:taoyan date:20190510 for:online表单菜单点击展开的一级目录不对
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "LayoutFooter"
|
||||
name: 'LayoutFooter'
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@
|
||||
import Breadcrumb from '@/components/tools/Breadcrumb'
|
||||
|
||||
export default {
|
||||
name: "PageHeader",
|
||||
name: 'PageHeader',
|
||||
components: {
|
||||
"s-breadcrumb": Breadcrumb
|
||||
's-breadcrumb': Breadcrumb
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
import PageHeader from './PageHeader'
|
||||
|
||||
export default {
|
||||
name: "LayoutContent",
|
||||
name: 'LayoutContent',
|
||||
components: {
|
||||
PageHeader
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "HeaderNotice",
|
||||
name: 'HeaderNotice',
|
||||
props: {
|
||||
tabs: {
|
||||
type: Array,
|
||||
|
||||
@@ -169,12 +169,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DetailList from "@/components/tools/DetailList";
|
||||
import SettingItem from "@/components/setting/SettingItem";
|
||||
import config from "@/defaultSettings";
|
||||
import { updateTheme, updateColorWeak, colorList } from "@/components/tools/setting";
|
||||
import { mixin, mixinDevice } from "@/utils/mixin.js";
|
||||
import { triggerWindowResizeEvent } from "@/utils/util";
|
||||
import DetailList from '@/components/tools/DetailList'
|
||||
import SettingItem from '@/components/setting/SettingItem'
|
||||
import config from '@/defaultSettings'
|
||||
import { updateTheme, updateColorWeak, colorList } from '@/components/tools/setting'
|
||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||
import { triggerWindowResizeEvent } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -187,71 +187,71 @@ export default {
|
||||
visible: false,
|
||||
colorList,
|
||||
dataFixSiderbar: false
|
||||
};
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 当主题色不是默认色时,才进行主题编译
|
||||
if (this.primaryColor !== config.primaryColor) {
|
||||
updateTheme(this.primaryColor);
|
||||
updateTheme(this.primaryColor)
|
||||
}
|
||||
if (this.colorWeak !== config.colorWeak) {
|
||||
updateColorWeak(this.colorWeak);
|
||||
updateColorWeak(this.colorWeak)
|
||||
}
|
||||
if (this.multipage !== config.multipage) {
|
||||
this.$store.dispatch("ToggleMultipage", this.multipage);
|
||||
this.$store.dispatch('ToggleMultipage', this.multipage)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showDrawer() {
|
||||
this.visible = true;
|
||||
this.visible = true
|
||||
},
|
||||
onClose() {
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
},
|
||||
toggle() {
|
||||
this.visible = !this.visible;
|
||||
this.visible = !this.visible
|
||||
},
|
||||
onColorWeak(checked) {
|
||||
this.$store.dispatch("ToggleWeak", checked);
|
||||
updateColorWeak(checked);
|
||||
this.$store.dispatch('ToggleWeak', checked)
|
||||
updateColorWeak(checked)
|
||||
},
|
||||
onMultipageWeak(checked) {
|
||||
this.$store.dispatch("ToggleMultipage", checked);
|
||||
this.$store.dispatch('ToggleMultipage', checked)
|
||||
},
|
||||
handleMenuTheme(theme) {
|
||||
this.$store.dispatch("ToggleTheme", theme);
|
||||
this.$store.dispatch('ToggleTheme', theme)
|
||||
},
|
||||
handleLayout(mode) {
|
||||
this.$store.dispatch("ToggleLayoutMode", mode);
|
||||
this.$store.dispatch('ToggleLayoutMode', mode)
|
||||
// 因为顶部菜单不能固定左侧菜单栏,所以强制关闭
|
||||
this.handleFixSiderbar(false);
|
||||
this.handleFixSiderbar(false)
|
||||
// 触发窗口resize事件
|
||||
triggerWindowResizeEvent();
|
||||
triggerWindowResizeEvent()
|
||||
},
|
||||
handleContentWidthChange(type) {
|
||||
this.$store.dispatch("ToggleContentWidth", type);
|
||||
this.$store.dispatch('ToggleContentWidth', type)
|
||||
},
|
||||
changeColor(color) {
|
||||
if (this.primaryColor !== color) {
|
||||
this.$store.dispatch("ToggleColor", color);
|
||||
updateTheme(color);
|
||||
this.$store.dispatch('ToggleColor', color)
|
||||
updateTheme(color)
|
||||
}
|
||||
},
|
||||
handleFixedHeader(fixed) {
|
||||
this.$store.dispatch("ToggleFixedHeader", fixed);
|
||||
this.$store.dispatch('ToggleFixedHeader', fixed)
|
||||
},
|
||||
handleFixedHeaderHidden(autoHidden) {
|
||||
this.$store.dispatch("ToggleFixedHeaderHidden", autoHidden);
|
||||
this.$store.dispatch('ToggleFixedHeaderHidden', autoHidden)
|
||||
},
|
||||
handleFixSiderbar(fixed) {
|
||||
if (this.layoutMode === "topmenu") {
|
||||
fixed = false;
|
||||
if (this.layoutMode === 'topmenu') {
|
||||
fixed = false
|
||||
}
|
||||
this.dataFixSiderbar = fixed;
|
||||
this.$store.dispatch("ToggleFixSiderbar", fixed);
|
||||
this.dataFixSiderbar = fixed
|
||||
this.$store.dispatch('ToggleFixSiderbar', fixed)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SettingItem",
|
||||
name: 'SettingItem',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
|
||||
@@ -43,14 +43,14 @@
|
||||
import { getAction,putAction } from '@/api/manage'
|
||||
import Vue from 'vue'
|
||||
import store from '@/store/'
|
||||
import { USER_INFO } from "@/store/mutation-types"
|
||||
import { USER_INFO } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'DepartSelect',
|
||||
props:{
|
||||
title:{
|
||||
type:String,
|
||||
default:"部门选择",
|
||||
default:'部门选择',
|
||||
required:false
|
||||
},
|
||||
closable:{
|
||||
@@ -60,7 +60,7 @@
|
||||
},
|
||||
username:{
|
||||
type:String,
|
||||
default:"",
|
||||
default:'',
|
||||
required:false
|
||||
}
|
||||
},
|
||||
@@ -76,9 +76,9 @@
|
||||
currTitle:this.title,
|
||||
visible:false,
|
||||
departList:[],
|
||||
departSelected:"",
|
||||
validate_status:"",
|
||||
currDepartName:"",
|
||||
departSelected:'',
|
||||
validate_status:'',
|
||||
currDepartName:'',
|
||||
}
|
||||
},
|
||||
created(){
|
||||
@@ -87,7 +87,7 @@
|
||||
methods:{
|
||||
loadDepartList(){
|
||||
return new Promise(resolve => {
|
||||
let url = "/sys/user/getCurrentUserDeparts"
|
||||
let url = '/sys/user/getCurrentUserDeparts'
|
||||
this.currDepartName=''
|
||||
getAction(url).then(res=>{
|
||||
if(res.success){
|
||||
@@ -104,7 +104,7 @@
|
||||
this.departSelected = orgCode
|
||||
this.departList = departs
|
||||
if(this.currDepartName){
|
||||
this.currTitle ="部门切换(当前部门 : "+this.currDepartName+")"
|
||||
this.currTitle ='部门切换(当前部门 : '+this.currDepartName+')'
|
||||
}
|
||||
|
||||
}
|
||||
@@ -124,11 +124,11 @@
|
||||
orgCode:this.departSelected,
|
||||
username:this.username
|
||||
}
|
||||
putAction("/sys/selectDepart",obj).then(res=>{
|
||||
putAction('/sys/selectDepart',obj).then(res=>{
|
||||
if(res.success){
|
||||
const userInfo = res.result.userInfo;
|
||||
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);
|
||||
store.commit('SET_INFO', userInfo);
|
||||
const userInfo = res.result.userInfo
|
||||
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
||||
store.commit('SET_INFO', userInfo)
|
||||
//console.log("---切换组织机构---userInfo-------",store.getters.userInfo.orgCode);
|
||||
this.departClear()
|
||||
}
|
||||
@@ -139,17 +139,17 @@
|
||||
this.loadDepartList().then(()=>{
|
||||
this.visible=true
|
||||
if(!this.departList || this.departList.length<=0){
|
||||
this.$message.warning("您尚未设置部门信息!")
|
||||
this.$message.warning('您尚未设置部门信息!')
|
||||
this.departClear()
|
||||
}
|
||||
})
|
||||
},
|
||||
departClear(){
|
||||
this.departList=[]
|
||||
this.departSelected=""
|
||||
this.departSelected=''
|
||||
this.visible=false
|
||||
this.validate_status=''
|
||||
this.currDepartName=""
|
||||
this.currDepartName=''
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "DetailList",
|
||||
name: 'DetailList',
|
||||
Item: Item,
|
||||
components: {
|
||||
Col
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
|
||||
export default {
|
||||
name: "HeaderNotice",
|
||||
name: 'HeaderNotice',
|
||||
components: {
|
||||
DynamicNotice,
|
||||
// ShowAnnouncement,
|
||||
@@ -93,17 +93,17 @@
|
||||
return {
|
||||
loadding: false,
|
||||
url:{
|
||||
listCementByUser:"/sys/annountCement/listByUser",
|
||||
editCementSend:"/sys/sysAnnouncementSend/editByAnntIdAndUserId",
|
||||
queryById:"/sys/annountCement/queryById",
|
||||
listCementByUser:'/sys/annountCement/listByUser',
|
||||
editCementSend:'/sys/sysAnnouncementSend/editByAnntIdAndUserId',
|
||||
queryById:'/sys/annountCement/queryById',
|
||||
},
|
||||
hovered: false,
|
||||
announcement1:[],
|
||||
announcement2:[],
|
||||
msg1Count:"0",
|
||||
msg2Count:"0",
|
||||
msg1Title:"通知(0)",
|
||||
msg2Title:"",
|
||||
msg1Count:'0',
|
||||
msg2Count:'0',
|
||||
msg1Title:'通知(0)',
|
||||
msg2Title:'',
|
||||
stopTimer:false,
|
||||
websock: null,
|
||||
lockReconnect:false,
|
||||
@@ -114,26 +114,26 @@
|
||||
},
|
||||
computed:{
|
||||
msgTotal () {
|
||||
return parseInt(this.msg1Count)+parseInt(this.msg2Count);
|
||||
return parseInt(this.msg1Count)+parseInt(this.msg2Count)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadData();
|
||||
this.loadData()
|
||||
//this.timerFun();
|
||||
this.initWebSocket();
|
||||
this.initWebSocket()
|
||||
// this.heartCheckFun();
|
||||
},
|
||||
destroyed: function () { // 离开页面生命周期函数
|
||||
this.websocketOnclose();
|
||||
this.websocketOnclose()
|
||||
},
|
||||
methods: {
|
||||
timerFun() {
|
||||
this.stopTimer = false;
|
||||
this.stopTimer = false
|
||||
let myTimer = setInterval(()=>{
|
||||
// 停止定时器
|
||||
if (this.stopTimer == true) {
|
||||
clearInterval(myTimer);
|
||||
return;
|
||||
clearInterval(myTimer)
|
||||
return
|
||||
}
|
||||
this.loadData()
|
||||
},6000)
|
||||
@@ -143,21 +143,21 @@
|
||||
// 获取系统消息
|
||||
getAction(this.url.listCementByUser).then((res) => {
|
||||
if (res.success) {
|
||||
this.announcement1 = res.result.anntMsgList;
|
||||
this.msg1Count = res.result.anntMsgTotal;
|
||||
this.msg1Title = "通知(" + res.result.anntMsgTotal + ")";
|
||||
this.announcement2 = res.result.sysMsgList;
|
||||
this.msg2Count = res.result.sysMsgTotal;
|
||||
this.msg2Title = "系统消息(" + res.result.sysMsgTotal + ")";
|
||||
this.announcement1 = res.result.anntMsgList
|
||||
this.msg1Count = res.result.anntMsgTotal
|
||||
this.msg1Title = '通知(' + res.result.anntMsgTotal + ')'
|
||||
this.announcement2 = res.result.sysMsgList
|
||||
this.msg2Count = res.result.sysMsgTotal
|
||||
this.msg2Title = '系统消息(' + res.result.sysMsgTotal + ')'
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log("系统消息通知异常",error);//这行打印permissionName is undefined
|
||||
this.stopTimer = true;
|
||||
console.log("清理timer");
|
||||
});
|
||||
console.log('系统消息通知异常',error)//这行打印permissionName is undefined
|
||||
this.stopTimer = true
|
||||
console.log('清理timer')
|
||||
})
|
||||
} catch (err) {
|
||||
this.stopTimer = true;
|
||||
console.log("通知异常",err);
|
||||
this.stopTimer = true
|
||||
console.log('通知异常',err)
|
||||
}
|
||||
},
|
||||
fetchNotice () {
|
||||
@@ -173,14 +173,14 @@
|
||||
showAnnouncement(record){
|
||||
putAction(this.url.editCementSend,{anntId:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
this.loadData();
|
||||
this.loadData()
|
||||
}
|
||||
});
|
||||
this.hovered = false;
|
||||
})
|
||||
this.hovered = false
|
||||
if(record.openType==='component'){
|
||||
this.openPath = record.openPage;
|
||||
this.formData = {id:record.busId};
|
||||
this.$refs.showDynamNotice.detail(record.openPage);
|
||||
this.openPath = record.openPage
|
||||
this.formData = {id:record.busId}
|
||||
this.$refs.showDynamNotice.detail(record.openPage)
|
||||
}else{
|
||||
// this.$refs.ShowAnnouncement.detail(record);
|
||||
}
|
||||
@@ -188,65 +188,65 @@
|
||||
toMyAnnouncement(){
|
||||
this.$router.push({
|
||||
path: '/isps/userAnnouncement'
|
||||
});
|
||||
})
|
||||
},
|
||||
modalFormOk(){
|
||||
},
|
||||
handleHoverChange (visible) {
|
||||
this.hovered = visible;
|
||||
this.hovered = visible
|
||||
},
|
||||
|
||||
initWebSocket: function () {
|
||||
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
||||
var userId = store.getters.userInfo.id;
|
||||
var url = window._CONFIG['domianWebSocketURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
|
||||
var userId = store.getters.userInfo.id
|
||||
var url = window._CONFIG['domianWebSocketURL'].replace('https://','wss://').replace('http://','ws://')+'/websocket/'+userId
|
||||
//console.log(url);
|
||||
this.websock = new WebSocket(url);
|
||||
this.websock.onopen = this.websocketOnopen;
|
||||
this.websock.onerror = this.websocketOnerror;
|
||||
this.websock.onmessage = this.websocketOnmessage;
|
||||
this.websock.onclose = this.websocketOnclose;
|
||||
this.websock = new WebSocket(url)
|
||||
this.websock.onopen = this.websocketOnopen
|
||||
this.websock.onerror = this.websocketOnerror
|
||||
this.websock.onmessage = this.websocketOnmessage
|
||||
this.websock.onclose = this.websocketOnclose
|
||||
},
|
||||
websocketOnopen: function () {
|
||||
console.log("WebSocket连接成功");
|
||||
console.log('WebSocket连接成功')
|
||||
//心跳检测重置
|
||||
//this.heartCheck.reset().start();
|
||||
},
|
||||
websocketOnerror: function (e) {
|
||||
console.log("WebSocket连接发生错误");
|
||||
this.reconnect();
|
||||
console.log('WebSocket连接发生错误')
|
||||
this.reconnect()
|
||||
},
|
||||
websocketOnmessage: function (e) {
|
||||
console.log("-----接收消息-------",e.data);
|
||||
var data = eval("(" + e.data + ")"); //解析对象
|
||||
if(data.cmd == "topic"){
|
||||
console.log('-----接收消息-------',e.data)
|
||||
var data = eval('(' + e.data + ')') //解析对象
|
||||
if(data.cmd == 'topic'){
|
||||
//系统通知
|
||||
this.loadData();
|
||||
}else if(data.cmd == "user"){
|
||||
this.loadData()
|
||||
}else if(data.cmd == 'user'){
|
||||
//用户消息
|
||||
this.loadData();
|
||||
this.loadData()
|
||||
}
|
||||
//心跳检测重置
|
||||
//this.heartCheck.reset().start();
|
||||
},
|
||||
websocketOnclose: function (e) {
|
||||
console.log("connection closed (" + e + ")");
|
||||
console.log('connection closed (' + e + ')')
|
||||
if(e){
|
||||
console.log("connection closed (" + e.code + ")");
|
||||
console.log('connection closed (' + e.code + ')')
|
||||
}
|
||||
this.reconnect();
|
||||
this.reconnect()
|
||||
},
|
||||
websocketSend(text) { // 数据发送
|
||||
try {
|
||||
this.websock.send(text);
|
||||
this.websock.send(text)
|
||||
} catch (err) {
|
||||
console.log("send failed (" + err.code + ")");
|
||||
console.log('send failed (' + err.code + ')')
|
||||
}
|
||||
},
|
||||
|
||||
openNotification (data) {
|
||||
var text = data.msgTxt;
|
||||
const key = `open${Date.now()}`;
|
||||
var text = data.msgTxt
|
||||
const key = `open${Date.now()}`
|
||||
this.$notification.open({
|
||||
message: '消息提醒',
|
||||
placement:'bottomRight',
|
||||
@@ -263,39 +263,39 @@
|
||||
}
|
||||
}, '查看详情')
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
reconnect() {
|
||||
var that = this;
|
||||
if(that.lockReconnect) return;
|
||||
that.lockReconnect = true;
|
||||
var that = this
|
||||
if(that.lockReconnect) return
|
||||
that.lockReconnect = true
|
||||
//没连接上会一直重连,设置延迟避免请求过多
|
||||
setTimeout(function () {
|
||||
console.info("尝试重连...");
|
||||
that.initWebSocket();
|
||||
that.lockReconnect = false;
|
||||
}, 5000);
|
||||
console.info('尝试重连...')
|
||||
that.initWebSocket()
|
||||
that.lockReconnect = false
|
||||
}, 5000)
|
||||
},
|
||||
heartCheckFun(){
|
||||
var that = this;
|
||||
var that = this
|
||||
//心跳检测,每20s心跳一次
|
||||
that.heartCheck = {
|
||||
timeout: 20000,
|
||||
timeoutObj: null,
|
||||
serverTimeoutObj: null,
|
||||
reset: function(){
|
||||
clearTimeout(this.timeoutObj);
|
||||
clearTimeout(this.timeoutObj)
|
||||
//clearTimeout(this.serverTimeoutObj);
|
||||
return this;
|
||||
return this
|
||||
},
|
||||
start: function(){
|
||||
var self = this;
|
||||
var self = this
|
||||
this.timeoutObj = setTimeout(function(){
|
||||
//这里发送一个心跳,后端收到后,返回一个心跳消息,
|
||||
//onmessage拿到返回的心跳就说明连接正常
|
||||
that.websocketSend("HeartBeat");
|
||||
console.info("客户端发送心跳");
|
||||
that.websocketSend('HeartBeat')
|
||||
console.info('客户端发送心跳')
|
||||
//self.serverTimeoutObj = setTimeout(function(){//如果超过一定时间还没重置,说明后端主动断开了
|
||||
// that.websock.close();//如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
|
||||
//}, self.timeout)
|
||||
@@ -306,12 +306,12 @@
|
||||
|
||||
|
||||
showDetail(key,data){
|
||||
this.$notification.close(key);
|
||||
var id = data.msgId;
|
||||
this.$notification.close(key)
|
||||
var id = data.msgId
|
||||
getAction(this.url.queryById,{id:id}).then((res) => {
|
||||
if (res.success) {
|
||||
var record = res.result;
|
||||
this.showAnnouncement(record);
|
||||
var record = res.result
|
||||
this.showAnnouncement(record)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SysAnnouncementModal",
|
||||
name: 'SysAnnouncementModal',
|
||||
components: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"通知消息",
|
||||
title:'通知消息',
|
||||
record: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
@@ -43,9 +43,9 @@
|
||||
switchFullscreen: true,
|
||||
loading: false,
|
||||
bodyStyle:{
|
||||
padding: "0",
|
||||
height:(window.innerHeight*0.8)+"px",
|
||||
"overflow-y":"auto",
|
||||
padding: '0',
|
||||
height:(window.innerHeight*0.8)+'px',
|
||||
'overflow-y':'auto',
|
||||
|
||||
},
|
||||
modelStyle:{
|
||||
@@ -59,11 +59,11 @@
|
||||
},
|
||||
methods: {
|
||||
detail (record) {
|
||||
this.visible = true;
|
||||
this.record = record;
|
||||
this.visible = true
|
||||
this.record = record
|
||||
},
|
||||
handleCancel () {
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
},
|
||||
/** 切换全屏显示 */
|
||||
handleClickToggleFullScreen() {
|
||||
@@ -79,7 +79,7 @@
|
||||
},
|
||||
toHandle(){
|
||||
if(this.record.openType==='url'){
|
||||
this.visible = false;
|
||||
this.visible = false
|
||||
//链接跳转
|
||||
this.$router.push({path: this.record.openPage})
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import half from '../../assets/imgs/half.png'
|
||||
import error from '../../assets/imgs/error.png'
|
||||
|
||||
export default {
|
||||
name: "StatusSlot",
|
||||
name: 'StatusSlot',
|
||||
props: {
|
||||
/*
|
||||
* 表格行对象
|
||||
|
||||
@@ -63,16 +63,16 @@
|
||||
<script>
|
||||
import HeaderNotice from './HeaderNotice'
|
||||
import UserPassword from './UserPassword'
|
||||
import SettingDrawer from "@/components/setting/SettingDrawer";
|
||||
import SettingDrawer from '@/components/setting/SettingDrawer'
|
||||
import DepartSelect from './DepartSelect'
|
||||
import { mapActions, mapGetters,mapState } from 'vuex'
|
||||
import { mixinDevice } from '@/utils/mixin.js'
|
||||
import { getFileAccessHttpUrl,getAction } from "@/api/manage"
|
||||
import { getFileAccessHttpUrl,getAction } from '@/api/manage'
|
||||
import Vue from 'vue'
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: "UserMenu",
|
||||
name: 'UserMenu',
|
||||
mixins: [mixinDevice],
|
||||
data(){
|
||||
return{
|
||||
@@ -139,8 +139,8 @@
|
||||
this.shows = false
|
||||
},
|
||||
/* update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
...mapActions(["Logout"]),
|
||||
...mapGetters(["nickname", "avatar","userInfo"]),
|
||||
...mapActions(['Logout']),
|
||||
...mapGetters(['nickname', 'avatar','userInfo']),
|
||||
getAvatar(){
|
||||
return getFileAccessHttpUrl(this.avatar())
|
||||
},
|
||||
@@ -153,7 +153,7 @@
|
||||
onOk() {
|
||||
return that.Logout({}).then(() => {
|
||||
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
that.$router.push({ path: '/user/login' });
|
||||
that.$router.push({ path: '/user/login' })
|
||||
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
//window.location.reload()
|
||||
}).catch(err => {
|
||||
@@ -165,7 +165,7 @@
|
||||
},
|
||||
onCancel() {
|
||||
},
|
||||
});
|
||||
})
|
||||
},
|
||||
updatePassword(){
|
||||
let username = this.userInfo().username
|
||||
@@ -180,7 +180,7 @@
|
||||
/* update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
searchMenus(arr,menus){
|
||||
for(let i of menus){
|
||||
if(!i.hidden && "layouts/RouteView"!==i.component){
|
||||
if(!i.hidden && 'layouts/RouteView'!==i.component){
|
||||
arr.push(i)
|
||||
}
|
||||
if(i.children&& i.children.length>0){
|
||||
@@ -205,20 +205,20 @@
|
||||
/*update_end author:zhaoxin date:20191129 for: 做头部菜单栏导航*/
|
||||
/*update_begin author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||
clearCache(){
|
||||
getAction("sys/dict/refleshCache").then((res) => {
|
||||
getAction('sys/dict/refleshCache').then((res) => {
|
||||
if (res.success) {
|
||||
//重新加载缓存
|
||||
getAction("sys/dict/queryAllDictItems").then((res) => {
|
||||
getAction('sys/dict/queryAllDictItems').then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
})
|
||||
this.$message.success("刷新缓存完成!");
|
||||
this.$message.success('刷新缓存完成!')
|
||||
}
|
||||
}).catch(e=>{
|
||||
this.$message.warn("刷新缓存失败!");
|
||||
console.log("刷新失败",e)
|
||||
this.$message.warn('刷新缓存失败!')
|
||||
console.log('刷新失败',e)
|
||||
})
|
||||
}
|
||||
/*update_end author:liushaoqian date:20200507 for: 刷新缓存*/
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
import { putAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: "UserPassword",
|
||||
name: 'UserPassword',
|
||||
data () {
|
||||
return {
|
||||
title:"修改密码",
|
||||
title:'修改密码',
|
||||
modalWidth:800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
@@ -81,63 +81,63 @@
|
||||
},
|
||||
|
||||
form:this.$form.createForm(this),
|
||||
url: "sys/user/updatePassword",
|
||||
username:"",
|
||||
url: 'sys/user/updatePassword',
|
||||
username:'',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(uname){
|
||||
if(!uname){
|
||||
this.$message.warning("当前系统无登录用户!");
|
||||
this.$message.warning('当前系统无登录用户!')
|
||||
return
|
||||
}else{
|
||||
this.username = uname
|
||||
this.form.resetFields();
|
||||
this.visible = true;
|
||||
this.form.resetFields()
|
||||
this.visible = true
|
||||
}
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
this.disableSubmit = false;
|
||||
this.selectedRole = [];
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
this.disableSubmit = false
|
||||
this.selectedRole = []
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
that.confirmLoading = true
|
||||
let params = Object.assign({username:this.username},values)
|
||||
console.log("修改密码提交数据",params)
|
||||
console.log('修改密码提交数据',params)
|
||||
putAction(this.url,params).then((res)=>{
|
||||
if(res.success){
|
||||
console.log(res)
|
||||
that.$message.success(res.message);
|
||||
that.close();
|
||||
that.$message.success(res.message)
|
||||
that.close()
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.confirmLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
validateToNextPassword (rule, value, callback) {
|
||||
const form = this.form;
|
||||
const form = this.form
|
||||
if (value && this.confirmDirty) {
|
||||
form.validateFields(['confirm'], { force: true })
|
||||
}
|
||||
callback();
|
||||
callback()
|
||||
},
|
||||
compareToFirstPassword (rule, value, callback) {
|
||||
const form = this.form;
|
||||
const form = this.form
|
||||
if (value && value !== form.getFieldValue('password')) {
|
||||
callback('两次输入的密码不一样!');
|
||||
callback('两次输入的密码不一样!')
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { message } from 'ant-design-vue/es'
|
||||
// import defaultSettings from '../defaultSettings';
|
||||
|
||||
let lessNodesAppended;
|
||||
let lessNodesAppended
|
||||
|
||||
const colorList = [
|
||||
{
|
||||
@@ -28,7 +28,7 @@ const colorList = [
|
||||
{
|
||||
key: '酱紫', color: '#722ED1',
|
||||
},
|
||||
];
|
||||
]
|
||||
|
||||
const updateTheme = primaryColor => {
|
||||
// Don't compile less in production!
|
||||
@@ -37,33 +37,33 @@ const updateTheme = primaryColor => {
|
||||
} */
|
||||
// Determine if the component is remounted
|
||||
if (!primaryColor) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
const hideMessage = message.loading('正在编译主题!', 0);
|
||||
const hideMessage = message.loading('正在编译主题!', 0)
|
||||
console.info(`正在编译主题!`)
|
||||
function buildIt() {
|
||||
// 正确的判定less是否已经加载less.modifyVars可用
|
||||
if (!window.less || !window.less.modifyVars) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
// less.modifyVars可用
|
||||
window.less.modifyVars({
|
||||
'@primary-color': primaryColor,
|
||||
})
|
||||
.then(() => {
|
||||
hideMessage();
|
||||
hideMessage()
|
||||
})
|
||||
.catch(() => {
|
||||
message.error('Failed to update theme');
|
||||
hideMessage();
|
||||
});
|
||||
message.error('Failed to update theme')
|
||||
hideMessage()
|
||||
})
|
||||
}
|
||||
if (!lessNodesAppended) {
|
||||
// insert less.js and color.less
|
||||
const lessStyleNode = document.createElement('link');
|
||||
const lessConfigNode = document.createElement('script');
|
||||
const lessScriptNode = document.createElement('script');
|
||||
lessStyleNode.setAttribute('rel', 'stylesheet/less');
|
||||
const lessStyleNode = document.createElement('link')
|
||||
const lessConfigNode = document.createElement('script')
|
||||
const lessScriptNode = document.createElement('script')
|
||||
lessStyleNode.setAttribute('rel', 'stylesheet/less')
|
||||
lessStyleNode.setAttribute('href', __webpack_public_path__ + 'color.less')
|
||||
lessConfigNode.innerHTML = `
|
||||
window.less = {
|
||||
@@ -71,25 +71,25 @@ const updateTheme = primaryColor => {
|
||||
env: 'production',
|
||||
javascriptEnabled: true
|
||||
};
|
||||
`;
|
||||
lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js';
|
||||
lessScriptNode.async = true;
|
||||
`
|
||||
lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js'
|
||||
lessScriptNode.async = true
|
||||
lessScriptNode.onload = () => {
|
||||
buildIt();
|
||||
lessScriptNode.onload = null;
|
||||
};
|
||||
document.body.appendChild(lessStyleNode);
|
||||
document.body.appendChild(lessConfigNode);
|
||||
document.body.appendChild(lessScriptNode);
|
||||
lessNodesAppended = true;
|
||||
buildIt()
|
||||
lessScriptNode.onload = null
|
||||
}
|
||||
document.body.appendChild(lessStyleNode)
|
||||
document.body.appendChild(lessConfigNode)
|
||||
document.body.appendChild(lessScriptNode)
|
||||
lessNodesAppended = true
|
||||
} else {
|
||||
buildIt();
|
||||
buildIt()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const updateColorWeak = colorWeak => {
|
||||
// document.body.className = colorWeak ? 'colorWeak' : '';
|
||||
colorWeak ? document.body.classList.add('colorWeak') : document.body.classList.remove('colorWeak')
|
||||
};
|
||||
}
|
||||
|
||||
export { updateTheme, colorList, updateColorWeak }
|
||||
Reference in New Issue
Block a user