1、本地build报错,部分资源依赖、资源包错误修复
@ -30,6 +30,7 @@
|
||||
"animate.css": "4.1.1",
|
||||
"await-to-js": "3.0.0",
|
||||
"axios": "1.8.4",
|
||||
"dayjs": "^1.11.10",
|
||||
"crypto-js": "4.2.0",
|
||||
"echarts": "5.6.0",
|
||||
"element-plus": "2.9.8",
|
||||
@ -42,12 +43,14 @@
|
||||
"pinia": "3.0.2",
|
||||
"screenfull": "6.0.2",
|
||||
"vue": "3.5.13",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-cropper": "1.1.1",
|
||||
"vue-i18n": "11.1.3",
|
||||
"vue-json-pretty": "2.4.0",
|
||||
"vue-router": "4.5.0",
|
||||
"vue-types": "6.0.0",
|
||||
"vxe-table": "4.13.7"
|
||||
"vxe-table": "4.13.7",
|
||||
"qs": "^6.10.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify/json": "^2.2.276",
|
||||
|
42
src/api/im.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'qs';
|
||||
const baseURL = 'https://demos.trtc.tencent-cloud.com';
|
||||
// const baseURL = 'https://demos3w.trtc.tencent-cloud.com';
|
||||
const ENV = 'prod';
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: `${baseURL}/${ENV}`,
|
||||
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
});
|
||||
|
||||
export async function getSmsVerifyCode(data: { appId: any }) {
|
||||
const options = buildOptions(data, '/base/v1/auth_users/user_verify_by_picture', 'GET');
|
||||
return instance(options);
|
||||
}
|
||||
|
||||
export async function loginSystemByVerifyCode(loginInfo: any) {
|
||||
const options = buildOptions(loginInfo, '/base/v1/auth_users/user_login_code');
|
||||
return instance(options);
|
||||
}
|
||||
|
||||
export async function loginSystemByToken(data: any) {
|
||||
const options = buildOptions(data, '/base/v1/auth_users/user_login_token');
|
||||
return instance(options);
|
||||
}
|
||||
|
||||
export async function cancellation(data: any) {
|
||||
const options = buildOptions(data, '/base/v1/auth_users/user_delete');
|
||||
return instance(options);
|
||||
}
|
||||
function buildOptions(data: any, url: string, method?: string) {
|
||||
const options: any = {
|
||||
method: method || 'POST',
|
||||
url,
|
||||
};
|
||||
if (options.method === 'GET') {
|
||||
options.params = data;
|
||||
} else {
|
||||
options.data = qs.stringify(data);
|
||||
}
|
||||
return options;
|
||||
}
|
@ -26,7 +26,12 @@ export function getConfigKey(configKey: string): AxiosPromise<string> {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function getConfigKey2(configKey) {
|
||||
return request({
|
||||
url: '/sys/config/configKey2/' + configKey,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
// 新增参数配置
|
||||
export function addConfig(data: ConfigForm) {
|
||||
return request({
|
||||
@ -44,7 +49,13 @@ export function updateConfig(data: ConfigForm) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
export function addOrUpdate(data) {
|
||||
return request({
|
||||
url: '/sys/config/addOrUpdate',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 修改参数配置
|
||||
export function updateConfigByKey(key: string, value: any) {
|
||||
return request({
|
||||
|
161
src/components/Crontab/day.vue
Normal file
@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<el-form size="small">
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
日,允许的通配符[, - * ? / L W]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
不指定
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min="1" :max="30" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> 日
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
从
|
||||
<el-input-number v-model='average01' :min="1" :max="30" /> 号开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="31 - average01 || 1" /> 日执行一次
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="5">
|
||||
每月
|
||||
<el-input-number v-model='workday' :min="1" :max="31" /> 号最近的那个工作日
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="6">
|
||||
本月最后一天
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="7">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="item in 31" :key="item" :value="item">{{item}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 1,
|
||||
workday: 1,
|
||||
cycle01: 1,
|
||||
cycle02: 2,
|
||||
average01: 1,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-day',
|
||||
props: ['check', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
('day rachange');
|
||||
if (this.radioValue !== 2 && this.cron.week !== '?') {
|
||||
this.$emit('update', 'week', '?', 'day')
|
||||
}
|
||||
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'day', '*');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'day', '?');
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'day', this.cycleTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'day', this.averageTotal);
|
||||
break;
|
||||
case 5:
|
||||
this.$emit('update', 'day', this.workday + 'W');
|
||||
break;
|
||||
case 6:
|
||||
this.$emit('update', 'day', 'L');
|
||||
break;
|
||||
case 7:
|
||||
this.$emit('update', 'day', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
('day rachange end');
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'day', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'day', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// 最近工作日值变化时
|
||||
workdayChange() {
|
||||
if (this.radioValue == '5') {
|
||||
this.$emit('update', 'day', this.workdayCheck + 'W');
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '7') {
|
||||
this.$emit('update', 'day', this.checkboxString);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'workdayCheck': 'workdayChange',
|
||||
'checkboxString': 'checkboxChange',
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, 1, 30)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 31, 31)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, 1, 30)
|
||||
const average02 = this.checkNum(this.average02, 1, 31 - average01 || 0)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算工作日格式
|
||||
workdayCheck: function () {
|
||||
const workday = this.checkNum(this.workday, 1, 31)
|
||||
return workday;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
114
src/components/Crontab/hour.vue
Normal file
@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<el-form size="small">
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
小时,允许的通配符[, - * /]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min="0" :max="22" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
从
|
||||
<el-input-number v-model='average01' :min="0" :max="22" /> 小时开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="23 - average01 || 0" /> 小时执行一次
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="item in 24" :key="item" :value="item-1">{{item-1}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 1,
|
||||
cycle01: 0,
|
||||
cycle02: 1,
|
||||
average01: 0,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-hour',
|
||||
props: ['check', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'hour', '*')
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'hour', this.cycleTotal);
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'hour', this.averageTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'hour', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '2') {
|
||||
this.$emit('update', 'hour', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'hour', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'hour', this.checkboxString);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'checkboxString': 'checkboxChange'
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, 0, 22)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, 0, 22)
|
||||
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
430
src/components/Crontab/index.vue
Normal file
@ -0,0 +1,430 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="秒" v-if="shouldHide('second')">
|
||||
<CrontabSecond
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronsecond"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="分钟" v-if="shouldHide('min')">
|
||||
<CrontabMin
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronmin"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="小时" v-if="shouldHide('hour')">
|
||||
<CrontabHour
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronhour"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="日" v-if="shouldHide('day')">
|
||||
<CrontabDay
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronday"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="月" v-if="shouldHide('month')">
|
||||
<CrontabMonth
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronmonth"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="周" v-if="shouldHide('week')">
|
||||
<CrontabWeek
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronweek"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="年" v-if="shouldHide('year')">
|
||||
<CrontabYear
|
||||
@update="updateCrontabValue"
|
||||
:check="checkNumber"
|
||||
:cron="crontabValueObj"
|
||||
ref="cronyear"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div class="popup-main">
|
||||
<div class="popup-result">
|
||||
<p class="title">时间表达式</p>
|
||||
<table>
|
||||
<thead>
|
||||
<th v-for="item of tabTitles" width="40" :key="item">{{item}}</th>
|
||||
<th>Cron 表达式</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<td>
|
||||
<span>{{crontabValueObj.second}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.min}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.hour}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.day}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.month}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.week}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueObj.year}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span>{{crontabValueString}}</span>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<CrontabResult :ex="crontabValueString"></CrontabResult>
|
||||
|
||||
<div class="pop_btn">
|
||||
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
|
||||
<el-button size="small" type="warning" @click="clearCron">重置</el-button>
|
||||
<el-button size="small" @click="hidePopup">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CrontabSecond from "./second.vue";
|
||||
import CrontabMin from "./min.vue";
|
||||
import CrontabHour from "./hour.vue";
|
||||
import CrontabDay from "./day.vue";
|
||||
import CrontabMonth from "./month.vue";
|
||||
import CrontabWeek from "./week.vue";
|
||||
import CrontabYear from "./year.vue";
|
||||
import CrontabResult from "./result.vue";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabTitles: ["秒", "分钟", "小时", "日", "月", "周", "年"],
|
||||
tabActive: 0,
|
||||
myindex: 0,
|
||||
crontabValueObj: {
|
||||
second: "*",
|
||||
min: "*",
|
||||
hour: "*",
|
||||
day: "*",
|
||||
month: "*",
|
||||
week: "?",
|
||||
year: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
name: "vcrontab",
|
||||
props: ["expression", "hideComponent"],
|
||||
methods: {
|
||||
shouldHide(key) {
|
||||
if (this.hideComponent && this.hideComponent.includes(key)) return false;
|
||||
return true;
|
||||
},
|
||||
resolveExp() {
|
||||
// 反解析 表达式
|
||||
if (this.expression) {
|
||||
let arr = this.expression.split(" ");
|
||||
if (arr.length >= 6) {
|
||||
//6 位以上是合法表达式
|
||||
let obj = {
|
||||
second: arr[0],
|
||||
min: arr[1],
|
||||
hour: arr[2],
|
||||
day: arr[3],
|
||||
month: arr[4],
|
||||
week: arr[5],
|
||||
year: arr[6] ? arr[6] : "",
|
||||
};
|
||||
this.crontabValueObj = {
|
||||
...obj,
|
||||
};
|
||||
for (let i in obj) {
|
||||
if (obj[i]) this.changeRadio(i, obj[i]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有传入的表达式 则还原
|
||||
this.clearCron();
|
||||
}
|
||||
},
|
||||
// tab切换值
|
||||
tabCheck(index) {
|
||||
this.tabActive = index;
|
||||
},
|
||||
// 由子组件触发,更改表达式组成的字段值
|
||||
updateCrontabValue(name, value, from) {
|
||||
"updateCrontabValue", name, value, from;
|
||||
this.crontabValueObj[name] = value;
|
||||
if (from && from !== name) {
|
||||
console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
|
||||
this.changeRadio(name, value);
|
||||
}
|
||||
},
|
||||
// 赋值到组件
|
||||
changeRadio(name, value) {
|
||||
let arr = ["second", "min", "hour", "month"],
|
||||
refName = "cron" + name,
|
||||
insValue;
|
||||
|
||||
if (!this.$refs[refName]) return;
|
||||
|
||||
if (arr.includes(name)) {
|
||||
if (value === "*") {
|
||||
insValue = 1;
|
||||
} else if (value.indexOf("-") > -1) {
|
||||
let indexArr = value.split("-");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].cycle01 = 0)
|
||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
||||
this.$refs[refName].cycle02 = indexArr[1];
|
||||
insValue = 2;
|
||||
} else if (value.indexOf("/") > -1) {
|
||||
let indexArr = value.split("/");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].average01 = 0)
|
||||
: (this.$refs[refName].average01 = indexArr[0]);
|
||||
this.$refs[refName].average02 = indexArr[1];
|
||||
insValue = 3;
|
||||
} else {
|
||||
insValue = 4;
|
||||
this.$refs[refName].checkboxList = value.split(",");
|
||||
}
|
||||
} else if (name == "day") {
|
||||
if (value === "*") {
|
||||
insValue = 1;
|
||||
} else if (value == "?") {
|
||||
insValue = 2;
|
||||
} else if (value.indexOf("-") > -1) {
|
||||
let indexArr = value.split("-");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].cycle01 = 0)
|
||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
||||
this.$refs[refName].cycle02 = indexArr[1];
|
||||
insValue = 3;
|
||||
} else if (value.indexOf("/") > -1) {
|
||||
let indexArr = value.split("/");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].average01 = 0)
|
||||
: (this.$refs[refName].average01 = indexArr[0]);
|
||||
this.$refs[refName].average02 = indexArr[1];
|
||||
insValue = 4;
|
||||
} else if (value.indexOf("W") > -1) {
|
||||
let indexArr = value.split("W");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].workday = 0)
|
||||
: (this.$refs[refName].workday = indexArr[0]);
|
||||
insValue = 5;
|
||||
} else if (value === "L") {
|
||||
insValue = 6;
|
||||
} else {
|
||||
this.$refs[refName].checkboxList = value.split(",");
|
||||
insValue = 7;
|
||||
}
|
||||
} else if (name == "week") {
|
||||
if (value === "*") {
|
||||
insValue = 1;
|
||||
} else if (value == "?") {
|
||||
insValue = 2;
|
||||
} else if (value.indexOf("-") > -1) {
|
||||
let indexArr = value.split("-");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].cycle01 = 0)
|
||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
||||
this.$refs[refName].cycle02 = indexArr[1];
|
||||
insValue = 3;
|
||||
} else if (value.indexOf("#") > -1) {
|
||||
let indexArr = value.split("#");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].average01 = 1)
|
||||
: (this.$refs[refName].average01 = indexArr[0]);
|
||||
this.$refs[refName].average02 = indexArr[1];
|
||||
insValue = 4;
|
||||
} else if (value.indexOf("L") > -1) {
|
||||
let indexArr = value.split("L");
|
||||
isNaN(indexArr[0])
|
||||
? (this.$refs[refName].weekday = 1)
|
||||
: (this.$refs[refName].weekday = indexArr[0]);
|
||||
insValue = 5;
|
||||
} else {
|
||||
this.$refs[refName].checkboxList = value.split(",");
|
||||
insValue = 6;
|
||||
}
|
||||
} else if (name == "year") {
|
||||
if (value == "") {
|
||||
insValue = 1;
|
||||
} else if (value == "*") {
|
||||
insValue = 2;
|
||||
} else if (value.indexOf("-") > -1) {
|
||||
insValue = 3;
|
||||
} else if (value.indexOf("/") > -1) {
|
||||
insValue = 4;
|
||||
} else {
|
||||
this.$refs[refName].checkboxList = value.split(",");
|
||||
insValue = 5;
|
||||
}
|
||||
}
|
||||
this.$refs[refName].radioValue = insValue;
|
||||
},
|
||||
// 表单选项的子组件校验数字格式(通过-props传递)
|
||||
checkNumber(value, minLimit, maxLimit) {
|
||||
// 检查必须为整数
|
||||
value = Math.floor(value);
|
||||
if (value < minLimit) {
|
||||
value = minLimit;
|
||||
} else if (value > maxLimit) {
|
||||
value = maxLimit;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
// 隐藏弹窗
|
||||
hidePopup() {
|
||||
this.$emit("hide");
|
||||
},
|
||||
// 填充表达式
|
||||
submitFill() {
|
||||
this.$emit("fill", this.crontabValueString);
|
||||
this.hidePopup();
|
||||
},
|
||||
clearCron() {
|
||||
// 还原选择项
|
||||
("准备还原");
|
||||
this.crontabValueObj = {
|
||||
second: "*",
|
||||
min: "*",
|
||||
hour: "*",
|
||||
day: "*",
|
||||
month: "*",
|
||||
week: "?",
|
||||
year: "",
|
||||
};
|
||||
for (let j in this.crontabValueObj) {
|
||||
this.changeRadio(j, this.crontabValueObj[j]);
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
crontabValueString: function() {
|
||||
let obj = this.crontabValueObj;
|
||||
let str =
|
||||
obj.second +
|
||||
" " +
|
||||
obj.min +
|
||||
" " +
|
||||
obj.hour +
|
||||
" " +
|
||||
obj.day +
|
||||
" " +
|
||||
obj.month +
|
||||
" " +
|
||||
obj.week +
|
||||
(obj.year == "" ? "" : " " + obj.year);
|
||||
return str;
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CrontabSecond,
|
||||
CrontabMin,
|
||||
CrontabHour,
|
||||
CrontabDay,
|
||||
CrontabMonth,
|
||||
CrontabWeek,
|
||||
CrontabYear,
|
||||
CrontabResult,
|
||||
},
|
||||
watch: {
|
||||
expression: "resolveExp",
|
||||
hideComponent(value) {
|
||||
// 隐藏部分组件
|
||||
},
|
||||
},
|
||||
mounted: function() {
|
||||
this.resolveExp();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.pop_btn {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.popup-main {
|
||||
position: relative;
|
||||
margin: 10px auto;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-title {
|
||||
overflow: hidden;
|
||||
line-height: 34px;
|
||||
padding-top: 6px;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.popup-result {
|
||||
box-sizing: border-box;
|
||||
line-height: 24px;
|
||||
margin: 25px auto;
|
||||
padding: 15px 10px 10px;
|
||||
border: 1px solid #ccc;
|
||||
position: relative;
|
||||
}
|
||||
.popup-result .title {
|
||||
position: absolute;
|
||||
top: -28px;
|
||||
left: 50%;
|
||||
width: 140px;
|
||||
font-size: 14px;
|
||||
margin-left: -70px;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
}
|
||||
.popup-result table {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.popup-result table span {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-family: arial;
|
||||
line-height: 30px;
|
||||
height: 30px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e8e8e8;
|
||||
}
|
||||
.popup-result-scroll {
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 10em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
116
src/components/Crontab/min.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<el-form size="small">
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
分钟,允许的通配符[, - * /]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
从
|
||||
<el-input-number v-model='average01' :min="0" :max="58" /> 分钟开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="59 - average01 || 0" /> 分钟执行一次
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 1,
|
||||
cycle01: 1,
|
||||
cycle02: 2,
|
||||
average01: 0,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-min',
|
||||
props: ['check', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'min', '*', 'min');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'min', this.cycleTotal, 'min');
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'min', this.averageTotal, 'min');
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'min', this.checkboxString, 'min');
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '2') {
|
||||
this.$emit('update', 'min', this.cycleTotal, 'min');
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'min', this.averageTotal, 'min');
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'min', this.checkboxString, 'min');
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'checkboxString': 'checkboxChange',
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, 0, 58)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, 0, 58)
|
||||
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
114
src/components/Crontab/month.vue
Normal file
@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<el-form size='small'>
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
月,允许的通配符[, - * /]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min="1" :max="11" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
从
|
||||
<el-input-number v-model='average01' :min="1" :max="11" /> 月开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="12 - average01 || 0" /> 月月执行一次
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 1,
|
||||
cycle01: 1,
|
||||
cycle02: 2,
|
||||
average01: 1,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-month',
|
||||
props: ['check', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'month', '*');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'month', this.cycleTotal);
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'month', this.averageTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'month', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '2') {
|
||||
this.$emit('update', 'month', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'month', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'month', this.checkboxString);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'checkboxString': 'checkboxChange'
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, 1, 11)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, 1, 11)
|
||||
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
559
src/components/Crontab/result.vue
Normal file
@ -0,0 +1,559 @@
|
||||
<template>
|
||||
<div class="popup-result">
|
||||
<p class="title">最近5次运行时间</p>
|
||||
<ul class="popup-result-scroll">
|
||||
<template v-if='isShow'>
|
||||
<li v-for='item in resultList' :key="item">{{item}}</li>
|
||||
</template>
|
||||
<li v-else>计算结果中...</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dayRule: '',
|
||||
dayRuleSup: '',
|
||||
dateArr: [],
|
||||
resultList: [],
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
name: 'crontab-result',
|
||||
methods: {
|
||||
// 表达式值变化时,开始去计算结果
|
||||
expressionChange() {
|
||||
|
||||
// 计算开始-隐藏结果
|
||||
this.isShow = false;
|
||||
// 获取规则数组[0秒、1分、2时、3日、4月、5星期、6年]
|
||||
let ruleArr = this.$options.propsData.ex.split(' ');
|
||||
// 用于记录进入循环的次数
|
||||
let nums = 0;
|
||||
// 用于暂时存符号时间规则结果的数组
|
||||
let resultArr = [];
|
||||
// 获取当前时间精确至[年、月、日、时、分、秒]
|
||||
let nTime = new Date();
|
||||
let nYear = nTime.getFullYear();
|
||||
let nMonth = nTime.getMonth() + 1;
|
||||
let nDay = nTime.getDate();
|
||||
let nHour = nTime.getHours();
|
||||
let nMin = nTime.getMinutes();
|
||||
let nSecond = nTime.getSeconds();
|
||||
// 根据规则获取到近100年可能年数组、月数组等等
|
||||
this.getSecondArr(ruleArr[0]);
|
||||
this.getMinArr(ruleArr[1]);
|
||||
this.getHourArr(ruleArr[2]);
|
||||
this.getDayArr(ruleArr[3]);
|
||||
this.getMonthArr(ruleArr[4]);
|
||||
this.getWeekArr(ruleArr[5]);
|
||||
this.getYearArr(ruleArr[6], nYear);
|
||||
// 将获取到的数组赋值-方便使用
|
||||
let sDate = this.dateArr[0];
|
||||
let mDate = this.dateArr[1];
|
||||
let hDate = this.dateArr[2];
|
||||
let DDate = this.dateArr[3];
|
||||
let MDate = this.dateArr[4];
|
||||
let YDate = this.dateArr[5];
|
||||
// 获取当前时间在数组中的索引
|
||||
let sIdx = this.getIndex(sDate, nSecond);
|
||||
let mIdx = this.getIndex(mDate, nMin);
|
||||
let hIdx = this.getIndex(hDate, nHour);
|
||||
let DIdx = this.getIndex(DDate, nDay);
|
||||
let MIdx = this.getIndex(MDate, nMonth);
|
||||
let YIdx = this.getIndex(YDate, nYear);
|
||||
// 重置月日时分秒的函数(后面用的比较多)
|
||||
const resetSecond = function () {
|
||||
sIdx = 0;
|
||||
nSecond = sDate[sIdx]
|
||||
}
|
||||
const resetMin = function () {
|
||||
mIdx = 0;
|
||||
nMin = mDate[mIdx]
|
||||
resetSecond();
|
||||
}
|
||||
const resetHour = function () {
|
||||
hIdx = 0;
|
||||
nHour = hDate[hIdx]
|
||||
resetMin();
|
||||
}
|
||||
const resetDay = function () {
|
||||
DIdx = 0;
|
||||
nDay = DDate[DIdx]
|
||||
resetHour();
|
||||
}
|
||||
const resetMonth = function () {
|
||||
MIdx = 0;
|
||||
nMonth = MDate[MIdx]
|
||||
resetDay();
|
||||
}
|
||||
// 如果当前年份不为数组中当前值
|
||||
if (nYear !== YDate[YIdx]) {
|
||||
resetMonth();
|
||||
}
|
||||
// 如果当前月份不为数组中当前值
|
||||
if (nMonth !== MDate[MIdx]) {
|
||||
resetDay();
|
||||
}
|
||||
// 如果当前“日”不为数组中当前值
|
||||
if (nDay !== DDate[DIdx]) {
|
||||
resetHour();
|
||||
}
|
||||
// 如果当前“时”不为数组中当前值
|
||||
if (nHour !== hDate[hIdx]) {
|
||||
resetMin();
|
||||
}
|
||||
// 如果当前“分”不为数组中当前值
|
||||
if (nMin !== mDate[mIdx]) {
|
||||
resetSecond();
|
||||
}
|
||||
|
||||
// 循环年份数组
|
||||
goYear: for (let Yi = YIdx; Yi < YDate.length; Yi++) {
|
||||
let YY = YDate[Yi];
|
||||
// 如果到达最大值时
|
||||
if (nMonth > MDate[MDate.length - 1]) {
|
||||
resetMonth();
|
||||
continue;
|
||||
}
|
||||
// 循环月份数组
|
||||
goMonth: for (let Mi = MIdx; Mi < MDate.length; Mi++) {
|
||||
// 赋值、方便后面运算
|
||||
let MM = MDate[Mi];
|
||||
MM = MM < 10 ? '0' + MM : MM;
|
||||
// 如果到达最大值时
|
||||
if (nDay > DDate[DDate.length - 1]) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// 循环日期数组
|
||||
goDay: for (let Di = DIdx; Di < DDate.length; Di++) {
|
||||
// 赋值、方便后面运算
|
||||
let DD = DDate[Di];
|
||||
let thisDD = DD < 10 ? '0' + DD : DD;
|
||||
|
||||
// 如果到达最大值时
|
||||
if (nHour > hDate[hDate.length - 1]) {
|
||||
resetHour();
|
||||
if (Di == DDate.length - 1) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue goMonth;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// 判断日期的合法性,不合法的话也是跳出当前循环
|
||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && this.dayRule !== 'workDay' && this.dayRule !== 'lastWeek' && this.dayRule !== 'lastDay') {
|
||||
resetDay();
|
||||
continue goMonth;
|
||||
}
|
||||
// 如果日期规则中有值时
|
||||
if (this.dayRule == 'lastDay') {
|
||||
// 如果不是合法日期则需要将前将日期调到合法日期即月末最后一天
|
||||
|
||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
DD--;
|
||||
|
||||
thisDD = DD < 10 ? '0' + DD : DD;
|
||||
}
|
||||
}
|
||||
} else if (this.dayRule == 'workDay') {
|
||||
// 校验并调整如果是2月30号这种日期传进来时需调整至正常月底
|
||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
DD--;
|
||||
thisDD = DD < 10 ? '0' + DD : DD;
|
||||
}
|
||||
}
|
||||
// 获取达到条件的日期是星期X
|
||||
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
|
||||
// 当星期日时
|
||||
if (thisWeek == 1) {
|
||||
// 先找下一个日,并判断是否为月底
|
||||
DD++;
|
||||
thisDD = DD < 10 ? '0' + DD : DD;
|
||||
// 判断下一日已经不是合法日期
|
||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
DD -= 3;
|
||||
}
|
||||
} else if (thisWeek == 7) {
|
||||
// 当星期6时只需判断不是1号就可进行操作
|
||||
if (this.dayRuleSup !== 1) {
|
||||
DD--;
|
||||
} else {
|
||||
DD += 2;
|
||||
}
|
||||
}
|
||||
} else if (this.dayRule == 'weekDay') {
|
||||
// 如果指定了是星期几
|
||||
// 获取当前日期是属于星期几
|
||||
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
|
||||
// 校验当前星期是否在星期池(dayRuleSup)中
|
||||
if (this.dayRuleSup.indexOf(thisWeek) < 0) {
|
||||
// 如果到达最大值时
|
||||
if (Di == DDate.length - 1) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue goMonth;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} else if (this.dayRule == 'assWeek') {
|
||||
// 如果指定了是第几周的星期几
|
||||
// 获取每月1号是属于星期几
|
||||
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
|
||||
if (this.dayRuleSup[1] >= thisWeek) {
|
||||
DD = (this.dayRuleSup[0] - 1) * 7 + this.dayRuleSup[1] - thisWeek + 1;
|
||||
} else {
|
||||
DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1;
|
||||
}
|
||||
} else if (this.dayRule == 'lastWeek') {
|
||||
// 如果指定了每月最后一个星期几
|
||||
// 校验并调整如果是2月30号这种日期传进来时需调整至正常月底
|
||||
if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
|
||||
DD--;
|
||||
thisDD = DD < 10 ? '0' + DD : DD;
|
||||
}
|
||||
}
|
||||
// 获取月末最后一天是星期几
|
||||
let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
|
||||
// 找到要求中最近的那个星期几
|
||||
if (this.dayRuleSup < thisWeek) {
|
||||
DD -= thisWeek - this.dayRuleSup;
|
||||
} else if (this.dayRuleSup > thisWeek) {
|
||||
DD -= 7 - (this.dayRuleSup - thisWeek)
|
||||
}
|
||||
}
|
||||
// 判断时间值是否小于10置换成“05”这种格式
|
||||
DD = DD < 10 ? '0' + DD : DD;
|
||||
|
||||
// 循环“时”数组
|
||||
goHour: for (let hi = hIdx; hi < hDate.length; hi++) {
|
||||
let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi]
|
||||
|
||||
// 如果到达最大值时
|
||||
if (nMin > mDate[mDate.length - 1]) {
|
||||
resetMin();
|
||||
if (hi == hDate.length - 1) {
|
||||
resetHour();
|
||||
if (Di == DDate.length - 1) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue goMonth;
|
||||
}
|
||||
continue goDay;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// 循环"分"数组
|
||||
goMin: for (let mi = mIdx; mi < mDate.length; mi++) {
|
||||
let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi];
|
||||
|
||||
// 如果到达最大值时
|
||||
if (nSecond > sDate[sDate.length - 1]) {
|
||||
resetSecond();
|
||||
if (mi == mDate.length - 1) {
|
||||
resetMin();
|
||||
if (hi == hDate.length - 1) {
|
||||
resetHour();
|
||||
if (Di == DDate.length - 1) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue goMonth;
|
||||
}
|
||||
continue goDay;
|
||||
}
|
||||
continue goHour;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// 循环"秒"数组
|
||||
goSecond: for (let si = sIdx; si <= sDate.length - 1; si++) {
|
||||
let ss = sDate[si] < 10 ? '0' + sDate[si] : sDate[si];
|
||||
// 添加当前时间(时间合法性在日期循环时已经判断)
|
||||
if (MM !== '00' && DD !== '00') {
|
||||
resultArr.push(YY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss)
|
||||
nums++;
|
||||
}
|
||||
// 如果条数满了就退出循环
|
||||
if (nums == 5) break goYear;
|
||||
// 如果到达最大值时
|
||||
if (si == sDate.length - 1) {
|
||||
resetSecond();
|
||||
if (mi == mDate.length - 1) {
|
||||
resetMin();
|
||||
if (hi == hDate.length - 1) {
|
||||
resetHour();
|
||||
if (Di == DDate.length - 1) {
|
||||
resetDay();
|
||||
if (Mi == MDate.length - 1) {
|
||||
resetMonth();
|
||||
continue goYear;
|
||||
}
|
||||
continue goMonth;
|
||||
}
|
||||
continue goDay;
|
||||
}
|
||||
continue goHour;
|
||||
}
|
||||
continue goMin;
|
||||
}
|
||||
} //goSecond
|
||||
} //goMin
|
||||
}//goHour
|
||||
}//goDay
|
||||
}//goMonth
|
||||
}
|
||||
// 判断100年内的结果条数
|
||||
if (resultArr.length == 0) {
|
||||
this.resultList = ['没有达到条件的结果!'];
|
||||
} else {
|
||||
this.resultList = resultArr;
|
||||
if (resultArr.length !== 5) {
|
||||
this.resultList.push('最近100年内只有上面' + resultArr.length + '条结果!')
|
||||
}
|
||||
}
|
||||
// 计算完成-显示结果
|
||||
this.isShow = true;
|
||||
|
||||
|
||||
},
|
||||
// 用于计算某位数字在数组中的索引
|
||||
getIndex(arr, value) {
|
||||
if (value <= arr[0] || value > arr[arr.length - 1]) {
|
||||
return 0;
|
||||
} else {
|
||||
for (let i = 0; i < arr.length - 1; i++) {
|
||||
if (value > arr[i] && value <= arr[i + 1]) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取"年"数组
|
||||
getYearArr(rule, year) {
|
||||
this.dateArr[5] = this.getOrderArr(year, year + 100);
|
||||
if (rule !== undefined) {
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[5] = this.getCycleArr(rule, year + 100, false)
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[5] = this.getAverageArr(rule, year + 100)
|
||||
} else if (rule !== '*') {
|
||||
this.dateArr[5] = this.getAssignArr(rule)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取"月"数组
|
||||
getMonthArr(rule) {
|
||||
this.dateArr[4] = this.getOrderArr(1, 12);
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[4] = this.getCycleArr(rule, 12, false)
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[4] = this.getAverageArr(rule, 12)
|
||||
} else if (rule !== '*') {
|
||||
this.dateArr[4] = this.getAssignArr(rule)
|
||||
}
|
||||
},
|
||||
// 获取"日"数组-主要为日期规则
|
||||
getWeekArr(rule) {
|
||||
// 只有当日期规则的两个值均为“”时则表达日期是有选项的
|
||||
if (this.dayRule == '' && this.dayRuleSup == '') {
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dayRule = 'weekDay';
|
||||
this.dayRuleSup = this.getCycleArr(rule, 7, false)
|
||||
} else if (rule.indexOf('#') >= 0) {
|
||||
this.dayRule = 'assWeek';
|
||||
let matchRule = rule.match(/[0-9]{1}/g);
|
||||
this.dayRuleSup = [Number(matchRule[1]), Number(matchRule[0])];
|
||||
this.dateArr[3] = [1];
|
||||
if (this.dayRuleSup[1] == 7) {
|
||||
this.dayRuleSup[1] = 0;
|
||||
}
|
||||
} else if (rule.indexOf('L') >= 0) {
|
||||
this.dayRule = 'lastWeek';
|
||||
this.dayRuleSup = Number(rule.match(/[0-9]{1,2}/g)[0]);
|
||||
this.dateArr[3] = [31];
|
||||
if (this.dayRuleSup == 7) {
|
||||
this.dayRuleSup = 0;
|
||||
}
|
||||
} else if (rule !== '*' && rule !== '?') {
|
||||
this.dayRule = 'weekDay';
|
||||
this.dayRuleSup = this.getAssignArr(rule)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取"日"数组-少量为日期规则
|
||||
getDayArr(rule) {
|
||||
this.dateArr[3] = this.getOrderArr(1, 31);
|
||||
this.dayRule = '';
|
||||
this.dayRuleSup = '';
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[3] = this.getCycleArr(rule, 31, false)
|
||||
this.dayRuleSup = 'null';
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[3] = this.getAverageArr(rule, 31)
|
||||
this.dayRuleSup = 'null';
|
||||
} else if (rule.indexOf('W') >= 0) {
|
||||
this.dayRule = 'workDay';
|
||||
this.dayRuleSup = Number(rule.match(/[0-9]{1,2}/g)[0]);
|
||||
this.dateArr[3] = [this.dayRuleSup];
|
||||
} else if (rule.indexOf('L') >= 0) {
|
||||
this.dayRule = 'lastDay';
|
||||
this.dayRuleSup = 'null';
|
||||
this.dateArr[3] = [31];
|
||||
} else if (rule !== '*' && rule !== '?') {
|
||||
this.dateArr[3] = this.getAssignArr(rule)
|
||||
this.dayRuleSup = 'null';
|
||||
} else if (rule == '*') {
|
||||
this.dayRuleSup = 'null';
|
||||
}
|
||||
},
|
||||
// 获取"时"数组
|
||||
getHourArr(rule) {
|
||||
this.dateArr[2] = this.getOrderArr(0, 23);
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[2] = this.getCycleArr(rule, 24, true)
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[2] = this.getAverageArr(rule, 23)
|
||||
} else if (rule !== '*') {
|
||||
this.dateArr[2] = this.getAssignArr(rule)
|
||||
}
|
||||
},
|
||||
// 获取"分"数组
|
||||
getMinArr(rule) {
|
||||
this.dateArr[1] = this.getOrderArr(0, 59);
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[1] = this.getCycleArr(rule, 60, true)
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[1] = this.getAverageArr(rule, 59)
|
||||
} else if (rule !== '*') {
|
||||
this.dateArr[1] = this.getAssignArr(rule)
|
||||
}
|
||||
},
|
||||
// 获取"秒"数组
|
||||
getSecondArr(rule) {
|
||||
this.dateArr[0] = this.getOrderArr(0, 59);
|
||||
if (rule.indexOf('-') >= 0) {
|
||||
this.dateArr[0] = this.getCycleArr(rule, 60, true)
|
||||
} else if (rule.indexOf('/') >= 0) {
|
||||
this.dateArr[0] = this.getAverageArr(rule, 59)
|
||||
} else if (rule !== '*') {
|
||||
this.dateArr[0] = this.getAssignArr(rule)
|
||||
}
|
||||
},
|
||||
// 根据传进来的min-max返回一个顺序的数组
|
||||
getOrderArr(min, max) {
|
||||
let arr = [];
|
||||
for (let i = min; i <= max; i++) {
|
||||
arr.push(i);
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 根据规则中指定的零散值返回一个数组
|
||||
getAssignArr(rule) {
|
||||
let arr = [];
|
||||
let assiginArr = rule.split(',');
|
||||
for (let i = 0; i < assiginArr.length; i++) {
|
||||
arr[i] = Number(assiginArr[i])
|
||||
}
|
||||
arr.sort(this.compare)
|
||||
return arr;
|
||||
},
|
||||
// 根据一定算术规则计算返回一个数组
|
||||
getAverageArr(rule, limit) {
|
||||
let arr = [];
|
||||
let agArr = rule.split('/');
|
||||
let min = Number(agArr[0]);
|
||||
let step = Number(agArr[1]);
|
||||
while (min <= limit) {
|
||||
arr.push(min);
|
||||
min += step;
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 根据规则返回一个具有周期性的数组
|
||||
getCycleArr(rule, limit, status) {
|
||||
// status--表示是否从0开始(则从1开始)
|
||||
let arr = [];
|
||||
let cycleArr = rule.split('-');
|
||||
let min = Number(cycleArr[0]);
|
||||
let max = Number(cycleArr[1]);
|
||||
if (min > max) {
|
||||
max += limit;
|
||||
}
|
||||
for (let i = min; i <= max; i++) {
|
||||
let add = 0;
|
||||
if (status == false && i % limit == 0) {
|
||||
add = limit;
|
||||
}
|
||||
arr.push(Math.round(i % limit + add))
|
||||
}
|
||||
arr.sort(this.compare)
|
||||
return arr;
|
||||
},
|
||||
// 比较数字大小(用于Array.sort)
|
||||
compare(value1, value2) {
|
||||
if (value2 - value1 > 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
// 格式化日期格式如:2017-9-19 18:04:33
|
||||
formatDate(value, type) {
|
||||
// 计算日期相关值
|
||||
let time = typeof value == 'number' ? new Date(value) : value;
|
||||
let Y = time.getFullYear();
|
||||
let M = time.getMonth() + 1;
|
||||
let D = time.getDate();
|
||||
let h = time.getHours();
|
||||
let m = time.getMinutes();
|
||||
let s = time.getSeconds();
|
||||
let week = time.getDay();
|
||||
// 如果传递了type的话
|
||||
if (type == undefined) {
|
||||
return Y + '-' + (M < 10 ? '0' + M : M) + '-' + (D < 10 ? '0' + D : D) + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
} else if (type == 'week') {
|
||||
// 在quartz中 1为星期日
|
||||
return week + 1;
|
||||
}
|
||||
},
|
||||
// 检查日期是否存在
|
||||
checkDate(value) {
|
||||
let time = new Date(value);
|
||||
let format = this.formatDate(time)
|
||||
return value === format;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'ex': 'expressionChange'
|
||||
},
|
||||
props: ['ex'],
|
||||
mounted: function () {
|
||||
// 初始化 获取一次结果
|
||||
this.expressionChange();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
117
src/components/Crontab/second.vue
Normal file
@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<el-form size="small">
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
秒,允许的通配符[, - * /]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 秒
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
从
|
||||
<el-input-number v-model='average01' :min="0" :max="58" /> 秒开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="59 - average01 || 0" /> 秒执行一次
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 1,
|
||||
cycle01: 1,
|
||||
cycle02: 2,
|
||||
average01: 0,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-second',
|
||||
props: ['check', 'radioParent'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'second', '*', 'second');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'second', this.cycleTotal);
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'second', this.averageTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'second', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '2') {
|
||||
this.$emit('update', 'second', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'second', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'second', this.checkboxString);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'checkboxString': 'checkboxChange',
|
||||
radioParent() {
|
||||
this.radioValue = this.radioParent
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, 0, 58)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, 0, 58)
|
||||
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
202
src/components/Crontab/week.vue
Normal file
@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<el-form size='small'>
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="1">
|
||||
周,允许的通配符[, - * ? / L #]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="2">
|
||||
不指定
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="3">
|
||||
周期从星期
|
||||
<el-select clearable v-model="cycle01">
|
||||
<el-option
|
||||
v-for="(item,index) of weekList"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
:disabled="item.key === 1"
|
||||
>{{item.value}}</el-option>
|
||||
</el-select>
|
||||
-
|
||||
<el-select clearable v-model="cycle02">
|
||||
<el-option
|
||||
v-for="(item,index) of weekList"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.key"
|
||||
:disabled="item.key < cycle01 && item.key !== 1"
|
||||
>{{item.value}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="4">
|
||||
第
|
||||
<el-input-number v-model='average01' :min="1" :max="4" /> 周的星期
|
||||
<el-select clearable v-model="average02">
|
||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{item.value}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="5">
|
||||
本月最后一个星期
|
||||
<el-select clearable v-model="weekday">
|
||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{item.value}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model='radioValue' :label="6">
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="String(item.key)">{{item.value}}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioValue: 2,
|
||||
weekday: 2,
|
||||
cycle01: 2,
|
||||
cycle02: 3,
|
||||
average01: 1,
|
||||
average02: 2,
|
||||
checkboxList: [],
|
||||
weekList: [
|
||||
{
|
||||
key: 2,
|
||||
value: '星期一'
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
value: '星期二'
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
value: '星期三'
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
value: '星期四'
|
||||
},
|
||||
{
|
||||
key: 6,
|
||||
value: '星期五'
|
||||
},
|
||||
{
|
||||
key: 7,
|
||||
value: '星期六'
|
||||
},
|
||||
{
|
||||
key: 1,
|
||||
value: '星期日'
|
||||
}
|
||||
],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-week',
|
||||
props: ['check', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
if (this.radioValue !== 2 && this.cron.day !== '?') {
|
||||
this.$emit('update', 'day', '?', 'week');
|
||||
}
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'week', '*');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'week', '?');
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'week', this.cycleTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'week', this.averageTotal);
|
||||
break;
|
||||
case 5:
|
||||
this.$emit('update', 'week', this.weekdayCheck + 'L');
|
||||
break;
|
||||
case 6:
|
||||
this.$emit('update', 'week', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'week', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'week', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// 最近工作日值变化时
|
||||
weekdayChange() {
|
||||
if (this.radioValue == '5') {
|
||||
this.$emit('update', 'week', this.weekday + 'L');
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '6') {
|
||||
this.$emit('update', 'week', this.checkboxString);
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'weekdayCheck': 'weekdayChange',
|
||||
'checkboxString': 'checkboxChange',
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
this.cycle01 = this.checkNum(this.cycle01, 1, 7)
|
||||
this.cycle02 = this.checkNum(this.cycle02, 1, 7)
|
||||
return this.cycle01 + '-' + this.cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
this.average01 = this.checkNum(this.average01, 1, 4)
|
||||
this.average02 = this.checkNum(this.average02, 1, 7)
|
||||
return this.average02 + '#' + this.average01;
|
||||
},
|
||||
// 最近的工作日(格式)
|
||||
weekdayCheck: function () {
|
||||
this.weekday = this.checkNum(this.weekday, 1, 7)
|
||||
return this.weekday;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str == '' ? '*' : str;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
131
src/components/Crontab/year.vue
Normal file
@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<el-form size="small">
|
||||
<el-form-item>
|
||||
<el-radio :label="1" v-model='radioValue'>
|
||||
不填,允许的通配符[, - * /]
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio :label="2" v-model='radioValue'>
|
||||
每年
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio :label="3" v-model='radioValue'>
|
||||
周期从
|
||||
<el-input-number v-model='cycle01' :min='fullYear' :max="2098" /> -
|
||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099" />
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio :label="4" v-model='radioValue'>
|
||||
从
|
||||
<el-input-number v-model='average01' :min='fullYear' :max="2098"/> 年开始,每
|
||||
<el-input-number v-model='average02' :min="1" :max="2099 - average01 || fullYear" /> 年执行一次
|
||||
</el-radio>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio :label="5" v-model='radioValue'>
|
||||
指定
|
||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple>
|
||||
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fullYear: 0,
|
||||
radioValue: 1,
|
||||
cycle01: 0,
|
||||
cycle02: 0,
|
||||
average01: 0,
|
||||
average02: 1,
|
||||
checkboxList: [],
|
||||
checkNum: this.$options.propsData.check
|
||||
}
|
||||
},
|
||||
name: 'crontab-year',
|
||||
props: ['check', 'month', 'cron'],
|
||||
methods: {
|
||||
// 单选按钮值变化时
|
||||
radioChange() {
|
||||
switch (this.radioValue) {
|
||||
case 1:
|
||||
this.$emit('update', 'year', '');
|
||||
break;
|
||||
case 2:
|
||||
this.$emit('update', 'year', '*');
|
||||
break;
|
||||
case 3:
|
||||
this.$emit('update', 'year', this.cycleTotal);
|
||||
break;
|
||||
case 4:
|
||||
this.$emit('update', 'year', this.averageTotal);
|
||||
break;
|
||||
case 5:
|
||||
this.$emit('update', 'year', this.checkboxString);
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 周期两个值变化时
|
||||
cycleChange() {
|
||||
if (this.radioValue == '3') {
|
||||
this.$emit('update', 'year', this.cycleTotal);
|
||||
}
|
||||
},
|
||||
// 平均两个值变化时
|
||||
averageChange() {
|
||||
if (this.radioValue == '4') {
|
||||
this.$emit('update', 'year', this.averageTotal);
|
||||
}
|
||||
},
|
||||
// checkbox值变化时
|
||||
checkboxChange() {
|
||||
if (this.radioValue == '5') {
|
||||
this.$emit('update', 'year', this.checkboxString);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'radioValue': 'radioChange',
|
||||
'cycleTotal': 'cycleChange',
|
||||
'averageTotal': 'averageChange',
|
||||
'checkboxString': 'checkboxChange'
|
||||
},
|
||||
computed: {
|
||||
// 计算两个周期值
|
||||
cycleTotal: function () {
|
||||
const cycle01 = this.checkNum(this.cycle01, this.fullYear, 2098)
|
||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : this.fullYear + 1, 2099)
|
||||
return cycle01 + '-' + cycle02;
|
||||
},
|
||||
// 计算平均用到的值
|
||||
averageTotal: function () {
|
||||
const average01 = this.checkNum(this.average01, this.fullYear, 2098)
|
||||
const average02 = this.checkNum(this.average02, 1, 2099 - average01 || this.fullYear)
|
||||
return average01 + '/' + average02;
|
||||
},
|
||||
// 计算勾选的checkbox值合集
|
||||
checkboxString: function () {
|
||||
let str = this.checkboxList.join();
|
||||
return str;
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
// 仅获取当前年份
|
||||
this.fullYear = Number(new Date().getFullYear());
|
||||
this.cycle01 = this.fullYear
|
||||
this.average01 = this.fullYear
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,27 +0,0 @@
|
||||
const getters = {
|
||||
sidebar: (state) => state.app.sidebar,
|
||||
size: (state) => state.app.size,
|
||||
device: (state) => state.app.device,
|
||||
|
||||
visitedViews: (state) => state.tagsView.visitedViews,
|
||||
cachedViews: (state) => state.tagsView.cachedViews,
|
||||
|
||||
token: (state) => state.user.token,
|
||||
avatar: (state) => state.user.avatar,
|
||||
name: (state) => state.user.name,
|
||||
userId: (state) => state.user.userId,
|
||||
introduction: (state) => state.user.introduction,
|
||||
roles: (state) => state.user.roles,
|
||||
permissions: (state) => state.user.permissions,
|
||||
|
||||
permission_routes: (state) => state.permission.routes,
|
||||
topbarRouters: (state) => state.permission.topbarRouters,
|
||||
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||
|
||||
dictMap: (state) => state.dict.dictMap,
|
||||
productCategories: (state) => state.mall.productCategories,
|
||||
areaSelect: (state) => state.mall.areaSelect,
|
||||
brandList: (state) => state.mall.brandList
|
||||
};
|
||||
export default getters;
|
@ -2,31 +2,13 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="活动id" prop="couponActivityId">
|
||||
<el-input
|
||||
v-model="queryParams.couponActivityId"
|
||||
placeholder="请输入活动id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.couponActivityId" placeholder="请输入活动id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="memberId">
|
||||
<el-input
|
||||
v-model="queryParams.memberId"
|
||||
placeholder="请输入用户id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.memberId" placeholder="请输入用户id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入活动名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.title" placeholder="请输入活动名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用范围 1全场通用 2指定商品可用 3指定商品不可用" prop="useScope">
|
||||
<el-input
|
||||
@ -47,32 +29,14 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠券金额" prop="couponAmount">
|
||||
<el-input
|
||||
v-model="queryParams.couponAmount"
|
||||
placeholder="请输入优惠券金额"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.couponAmount" placeholder="请输入优惠券金额" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最低消费金额" prop="minAmount">
|
||||
<el-input
|
||||
v-model="queryParams.minAmount"
|
||||
placeholder="请输入最低消费金额"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.minAmount" placeholder="请输入最低消费金额" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<template v-if="showMoreCondition">
|
||||
<el-form-item label="要兑换的积分" prop="useIntegral">
|
||||
<el-input
|
||||
v-model="queryParams.useIntegral"
|
||||
placeholder="请输入要兑换的积分"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.useIntegral" placeholder="请输入要兑换的积分" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="1免费兑换 2积分兑换" prop="couponType">
|
||||
<el-select v-model="queryParams.couponType" placeholder="请选择1免费兑换 2积分兑换" clearable size="small">
|
||||
@ -86,7 +50,8 @@
|
||||
v-model="queryParams.beginTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择券开始时间">
|
||||
placeholder="选择券开始时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="券结束时间" prop="endTime">
|
||||
@ -96,7 +61,8 @@
|
||||
v-model="queryParams.endTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择券结束时间">
|
||||
placeholder="选择券结束时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="0未使用 1已使用" prop="useStatus">
|
||||
@ -105,13 +71,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.orderId" placeholder="请输入订单id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用时间" prop="useTime">
|
||||
<el-date-picker
|
||||
@ -120,28 +80,26 @@
|
||||
v-model="queryParams.useTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择使用时间">
|
||||
placeholder="选择使用时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
|
||||
<el-button
|
||||
:icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
||||
size="mini"
|
||||
@click="showMoreCondition = !showMoreCondition"
|
||||
>{{ showMoreCondition ? '收起条件' : '展开条件' }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['act:memberCoupon:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['act:memberCoupon:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -157,38 +115,28 @@
|
||||
<el-table-column label="要兑换的积分" prop="useIntegral" />
|
||||
<el-table-column label="1免费兑换 2积分兑换" prop="couponType" />
|
||||
<el-table-column label="券开始时间" prop="beginTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.beginTime, '') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="券结束时间" prop="endTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="0未使用 1已使用" prop="useStatus" />
|
||||
<el-table-column label="订单id" prop="orderId" />
|
||||
<el-table-column label="使用时间" prop="useTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.useTime, '') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['act:memberCoupon:edit']"
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['act:memberCoupon:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['act:memberCoupon:remove']"
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['act:memberCoupon:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
@ -196,16 +144,11 @@
|
||||
</el-table>
|
||||
|
||||
<InBody v-show="total > 0">
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</InBody>
|
||||
|
||||
<!-- 添加或修改用户领券记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="活动id" prop="couponActivityId">
|
||||
<el-input v-model="form.couponActivityId" placeholder="请输入活动id" />
|
||||
@ -237,19 +180,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="券开始时间" prop="beginTime">
|
||||
<el-date-picker clearable size="small"
|
||||
<el-date-picker
|
||||
clearable
|
||||
size="small"
|
||||
v-model="form.beginTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择券开始时间">
|
||||
placeholder="选择券开始时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="券结束时间" prop="endTime">
|
||||
<el-date-picker clearable size="small"
|
||||
<el-date-picker
|
||||
clearable
|
||||
size="small"
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择券结束时间">
|
||||
placeholder="选择券结束时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="0未使用 1已使用">
|
||||
@ -261,34 +210,25 @@
|
||||
<el-input v-model="form.orderId" placeholder="请输入订单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用时间" prop="useTime">
|
||||
<el-date-picker clearable size="small"
|
||||
v-model="form.useTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择使用时间">
|
||||
<el-date-picker clearable size="small" v-model="form.useTime" type="datetime" value-format="yyyy-MM-ddTHH:mm:ss" placeholder="选择使用时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addMemberCoupon,
|
||||
delMemberCoupon,
|
||||
exportMemberCoupon,
|
||||
getMemberCoupon,
|
||||
listMemberCoupon,
|
||||
updateMemberCoupon
|
||||
} from "@/api/act/memberCoupon";
|
||||
import { addMemberCoupon, delMemberCoupon, exportMemberCoupon, getMemberCoupon, listMemberCoupon, updateMemberCoupon } from '@/api/act/memberCoupon';
|
||||
|
||||
export default {
|
||||
name: "MemberCoupon",
|
||||
name: 'MemberCoupon',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -308,7 +248,7 @@ export default {
|
||||
// 用户领券记录表格数据
|
||||
MemberCouponList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -328,36 +268,20 @@ export default {
|
||||
endTime: null,
|
||||
useStatus: null,
|
||||
orderId: null,
|
||||
useTime: null,
|
||||
useTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
couponActivityId: [
|
||||
{ required: true, message: "活动id不能为空", trigger: "blur" }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: "活动名称不能为空", trigger: "blur" }
|
||||
],
|
||||
useScope: [
|
||||
{ required: true, message: "使用范围 1全场通用 2指定商品可用 3指定商品不可用不能为空", trigger: "blur" }
|
||||
],
|
||||
couponAmount: [
|
||||
{ required: true, message: "优惠券金额不能为空", trigger: "blur" }
|
||||
],
|
||||
couponType: [
|
||||
{ required: true, message: "1免费兑换 2积分兑换不能为空", trigger: "change" }
|
||||
],
|
||||
beginTime: [
|
||||
{ required: true, message: "券开始时间不能为空", trigger: "blur" }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: "券结束时间不能为空", trigger: "blur" }
|
||||
],
|
||||
useStatus: [
|
||||
{ required: true, message: "0未使用 1已使用不能为空", trigger: "blur" }
|
||||
],
|
||||
couponActivityId: [{ required: true, message: '活动id不能为空', trigger: 'blur' }],
|
||||
title: [{ required: true, message: '活动名称不能为空', trigger: 'blur' }],
|
||||
useScope: [{ required: true, message: '使用范围 1全场通用 2指定商品可用 3指定商品不可用不能为空', trigger: 'blur' }],
|
||||
couponAmount: [{ required: true, message: '优惠券金额不能为空', trigger: 'blur' }],
|
||||
couponType: [{ required: true, message: '1免费兑换 2积分兑换不能为空', trigger: 'change' }],
|
||||
beginTime: [{ required: true, message: '券开始时间不能为空', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '券结束时间不能为空', trigger: 'blur' }],
|
||||
useStatus: [{ required: true, message: '0未使用 1已使用不能为空', trigger: 'blur' }]
|
||||
},
|
||||
showMoreCondition: false
|
||||
};
|
||||
@ -372,8 +296,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listMemberCoupon(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listMemberCoupon(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.MemberCouponList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -404,7 +328,7 @@ export default {
|
||||
useTime: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -413,44 +337,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加用户领券记录";
|
||||
this.title = '添加用户领券记录';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getMemberCoupon(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getMemberCoupon(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改用户领券记录";
|
||||
this.title = '修改用户领券记录';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateMemberCoupon(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateMemberCoupon(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMemberCoupon(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addMemberCoupon(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -461,23 +385,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除用户领券记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除用户领券记录编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMemberCoupon(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有用户领券记录数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有用户领券记录数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportMemberCoupon(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,11 +3,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
import * as echarts from 'echarts';
|
||||
import 'echarts/theme/macarons'; // echarts theme
|
||||
import resize from './mixins/resize';
|
||||
|
||||
const animationDuration = 6000
|
||||
const animationDuration = 6000;
|
||||
|
||||
export default {
|
||||
mixins: [resize],
|
||||
@ -28,28 +28,29 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
this.initChart();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
beforeUnmount() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
this.chart.dispose();
|
||||
this.chart = null;
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$el, 'macarons')
|
||||
this.chart = echarts.init(this.$el, 'macarons');
|
||||
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
@ -60,43 +61,51 @@ export default {
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [{
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
}],
|
||||
yAxis: [{
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
}],
|
||||
series: [{
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: 'pageA',
|
||||
type: 'bar',
|
||||
stack: 'vistors',
|
||||
barWidth: '60%',
|
||||
data: [79, 52, 200, 334, 390, 330, 220],
|
||||
animationDuration
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: 'pageB',
|
||||
type: 'bar',
|
||||
stack: 'vistors',
|
||||
barWidth: '60%',
|
||||
data: [80, 52, 200, 334, 390, 330, 220],
|
||||
animationDuration
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: 'pageC',
|
||||
type: 'bar',
|
||||
stack: 'vistors',
|
||||
barWidth: '60%',
|
||||
data: [30, 52, 200, 334, 390, 330, 220],
|
||||
animationDuration
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
<script>
|
||||
|
||||
import {orderStatistics} from "@/api/statistics";
|
||||
import echarts from 'echarts'
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts'
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import resize from './mixins/resize'
|
||||
|
||||
|
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 969 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
41
src/views/im/assets/image/adv-background.svg
Normal file
@ -0,0 +1,41 @@
|
||||
<svg width="232" height="72" viewBox="0 0 232 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0_12_66883" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0"
|
||||
width="232" height="72">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M0 4C0 1.79086 1.79086 0 4 0L228 0C230.209 0 232 1.79086 232 4V68C232 70.2091 230.209 72 228 72H4C1.79086 72 0 70.2091 0 68V4Z"
|
||||
fill="white" style="fill:white;fill:white;fill-opacity:1;" />
|
||||
</mask>
|
||||
<g mask="url(#mask0_12_66883)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M11.0001 19.4285C11.0001 15.3284 14.3239 12 18.424 12C22.5241 12 25.8479 15.3284 25.8479 19.4285C25.8479 23.5287 22.5241 26.8571 18.424 26.8571C14.3239 26.8571 11.0001 23.5287 11.0001 19.4285ZM25.8478 53.5361C25.8478 57.6363 22.524 60.9601 18.4239 60.9601C14.3238 60.9601 11 57.6363 11 53.5361V36.7114C11 32.6113 14.3238 29.2875 18.4239 29.2875C22.524 29.2875 25.8478 32.6113 25.8478 36.7114V53.5361ZM77.8672 59.9647C74.3164 62.016 69.7765 60.7995 67.7271 57.2476L56.3033 37.4486L45.1079 57.2172C43.0546 60.8429 38.4299 62.0818 34.839 59.9682C31.3292 57.9024 30.1236 53.4023 32.1305 49.8585L49.7493 18.7476C51.8026 15.1218 56.4273 13.883 60.0182 15.9966C61.2926 16.7467 62.2633 17.8178 62.8866 19.0475L66.0031 24.5456L80.5857 49.8191C82.6351 53.371 81.418 57.9133 77.8672 59.9647ZM95.0556 57.066C97.109 60.6917 101.734 61.9306 105.325 59.817C108.834 57.7512 110.04 53.2511 108.033 49.7074L90.4143 18.5964C88.3609 14.9707 83.7363 13.7318 80.1454 15.8454C78.8711 16.5954 77.9006 17.6663 77.2772 18.8958L71.7783 28.5969C73.904 26.338 77.5844 26.6727 79.2694 29.2781L79.6668 29.8927L95.0556 57.066Z"
|
||||
fill="url(#paint0_linear_12_66883)" style="" />
|
||||
</g>
|
||||
<g filter="url(#filter0_b_12_66883)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M0 4C0 1.79086 1.79086 0 4 0L228 0C230.209 0 232 1.79086 232 4V68C232 70.2091 230.209 72 228 72H4C1.79086 72 0 70.2091 0 68V4Z"
|
||||
fill="url(#paint1_linear_12_66883)" fill-opacity="0.5" style="" />
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_b_12_66883" x="-1.35914" y="-1.35914" width="234.718" height="74.7183"
|
||||
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="0.67957" />
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_12_66883" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_12_66883" result="shape" />
|
||||
</filter>
|
||||
<linearGradient id="paint0_linear_12_66883" x1="5.19355" y1="42.1342" x2="39.8324" y2="91.0797"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#D4E7FF"
|
||||
style="stop-color:#D4E7FF;stop-color:color(display-p3 0.8298 0.9061 1.0000);stop-opacity:1;" />
|
||||
<stop offset="1" stop-color="#AACCFF"
|
||||
style="stop-color:#AACCFF;stop-color:color(display-p3 0.6675 0.7981 1.0000);stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_12_66883" x1="31.8498" y1="0" x2="31.8498" y2="52.2312"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="white" style="stop-color:white;stop-color:white;stop-opacity:1;" />
|
||||
<stop offset="1" stop-color="#F5F9FF"
|
||||
style="stop-color:#F5F9FF;stop-color:color(display-p3 0.9596 0.9771 1.0000);stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
19
src/views/im/assets/image/adv-bg.svg
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="401px" height="41px" viewBox="0 0 401 41" version="1.1">
|
||||
<title>矩形</title>
|
||||
<defs>
|
||||
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="linearGradient-1">
|
||||
<stop stop-color="#35E7FF" offset="0%"></stop>
|
||||
<stop stop-color="#3E60FF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="web" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="登录" transform="translate(-270.000000, -505.000000)" fill="url(#linearGradient-1)">
|
||||
<g id="编组-3" transform="translate(266.400000, 332.400000)">
|
||||
<g id="编组-6" transform="translate(3.600000, 172.800000)">
|
||||
<rect id="矩形" x="0" y="0" width="400.8" height="40.8" rx="4.8"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 886 B |
BIN
src/views/im/assets/image/create-group.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
24
src/views/im/assets/image/h5/adv-im.svg
Normal file
@ -0,0 +1,24 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 232 72" class="design-iconfont">
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="72.5432672%" id="3m7u4ef0gc">
|
||||
<stop stop-color="#FFF" offset="0%"/>
|
||||
<stop stop-color="#F5F9FF" offset="100%"/>
|
||||
</linearGradient>
|
||||
<linearGradient x1="-2.96386364%" y1="50%" x2="100%" y2="50%" id="1t3m9qcp9d">
|
||||
<stop stop-color="#CEE3FF" offset="0%"/>
|
||||
<stop stop-color="#B5D2FF" offset="100%"/>
|
||||
</linearGradient>
|
||||
<path d="M4,0 L228,0 C230.209139,-4.05812251e-16 232,1.790861 232,4 L232,68 C232,70.209139 230.209139,72 228,72 L4,72 C1.790861,72 2.705415e-16,70.209139 0,68 L0,4 C-2.705415e-16,1.790861 1.790861,4.05812251e-16 4,0 Z" id="noxzn0gwva"/>
|
||||
<path d="M4,0 L228,0 C230.209139,-4.05812251e-16 232,1.790861 232,4 L232,68 C232,70.209139 230.209139,72 228,72 L4,72 C1.790861,72 2.705415e-16,70.209139 0,68 L0,4 C-2.705415e-16,1.790861 1.790861,4.05812251e-16 4,0 Z" id="1xc15s665b"/>
|
||||
<filter x="-1.5%" y="-3.1%" width="103.1%" height="106.1%" filterUnits="objectBoundingBox" id="183q9jim4e">
|
||||
<feGaussianBlur stdDeviation=".5" in="SourceGraphic"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<mask id="uaaxxy4ytf" fill="#fff">
|
||||
<use xlink:href="#1xc15s665b"/>
|
||||
</mask>
|
||||
<use fill-opacity=".5" fill="url(#3m7u4ef0gc)" xlink:href="#1xc15s665b"/>
|
||||
<path d="M18.5006766,29 C22.643186,29 26.0013533,32.3581673 26.0013533,36.5006766 L26.0013533,53.4993234 C26.0013533,57.6418327 22.643186,61 18.5006766,61 C14.3581673,61 11,57.6418327 11,53.4993234 L11,36.5006766 C11,32.3581673 14.3581673,29 18.5006766,29 Z M59.4587876,15.9438886 C59.4985795,15.9663688 59.5381591,15.9892228 59.5775211,16.0124475 C60.1577643,16.3548079 60.675775,16.7627669 61.1275574,17.2214095 C61.8771751,17.7979547 62.52949,18.5281053 63.0321514,19.3985444 L63.0321514,19.3985444 L80.5770893,49.7804325 C80.5773303,49.7808499 80.5775713,49.7812673 80.5778122,49.7816847 L80.7016313,50.0048019 C82.5751102,53.5194926 81.3362448,57.9128548 77.8604228,59.9191702 C74.3097528,61.9686893 69.7699204,60.7522449 67.7197096,57.2019743 L67.7197096,57.2019743 L56.152,37.171 L44.7832626,57.2957598 C42.8033952,60.8002981 38.3574059,62.036288 34.8528676,60.0564205 C34.8130121,60.0339044 34.7733696,60.0110132 34.7339454,59.9877502 C31.1820613,57.8918876 29.9621789,53.3380143 31.9907466,49.7472716 L49.5280914,18.7046339 C51.5080186,15.1999891 55.9541428,13.9639613 59.4587876,15.9438886 Z M80.5518583,15.9438886 C84.0565032,13.9639613 88.5026273,15.1999891 90.4825546,18.7046339 L90.4825546,18.7046339 L108.019899,49.7472716 C110.048467,53.3380143 108.828585,57.8918876 105.276701,59.9877502 C105.237276,60.0110132 105.197634,60.0339044 105.157778,60.0564205 C101.65324,62.036288 97.2072508,60.8002981 95.2273833,57.2957598 L95.2273833,57.2957598 L79.856,30.0869675 L79.4556434,29.4665594 C79.2460305,29.1416441 78.9975059,28.8435556 78.715593,28.5789189 C76.8040822,26.7845495 73.7998728,26.8795114 72.0055034,28.7910221 L72.0055034,28.7910221 L77.8023001,18.5393367 L77.8125611,18.5959107 C78.4392122,17.5640516 79.3220837,16.6679942 80.4331248,16.0124475 C80.4724868,15.9892228 80.5120664,15.9663688 80.5518583,15.9438886 Z M18.5013533,12 C22.6434889,12 26.0013533,15.3578644 26.0013533,19.5 C26.0013533,23.6421356 22.6434889,27 18.5013533,27 L18.5,27 C14.3578644,27 11,23.6421356 11,19.5 C11,15.3578644 14.3578644,12 18.5,12 L18.5013533,12 Z" fill="url(#1t3m9qcp9d)" opacity=".5" filter="url(#183q9jim4e)" mask="url(#uaaxxy4ytf)"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.5 KiB |
31
src/views/im/assets/image/h5/adv-more.svg
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="230px" height="70px" viewBox="0 0 230 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>编组</title>
|
||||
<defs>
|
||||
<path d="M4,0 L226,0 C228.209139,-4.05812251e-16 230,1.790861 230,4 L230,66 C230,68.209139 228.209139,70 226,70 L4,70 C1.790861,70 2.705415e-16,68.209139 0,66 L0,4 C-2.705415e-16,1.790861 1.790861,4.05812251e-16 4,0 Z" id="path-1"></path>
|
||||
<linearGradient x1="0%" y1="3.17377732%" x2="115.312974%" y2="115.99274%" id="linearGradient-3">
|
||||
<stop stop-color="#D4E7FF" offset="0%"></stop>
|
||||
<stop stop-color="#A9CBFF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="72.5432672%" id="linearGradient-4">
|
||||
<stop stop-color="#FFFFFF" offset="0%"></stop>
|
||||
<stop stop-color="#F5F9FF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<path d="M4,0 L226,0 C228.209139,-4.05812251e-16 230,1.790861 230,4 L230,66 C230,68.209139 228.209139,70 226,70 L4,70 C1.790861,70 2.705415e-16,68.209139 0,66 L0,4 C-2.705415e-16,1.790861 1.790861,4.05812251e-16 4,0 Z" id="path-5"></path>
|
||||
</defs>
|
||||
<g id="new" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="广告位" transform="translate(-318.000000, -123.000000)">
|
||||
<g id="编组" transform="translate(318.000000, 123.000000)">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<g id="v"></g>
|
||||
<path d="M36.5081967,9.93488869 L36.5081967,32.4576271 L67,32.4576271 L67,5 L36.5081967,9.93488869 Z M36.5081967,60.1481125 L67,65 L67,37.5423729 L36.5081967,37.5423729 L36.5081967,60.1481125 Z M5,31.440678 L29.3934426,31.440678 L29.3934426,10.0847458 L5,14.1901801 L5,31.440678 Z M5,55.8947745 L29.3934426,59.9152542 L29.3934426,38.559322 L5,38.559322 L5,55.8947745 Z" id="形状" fill="url(#linearGradient-3)" mask="url(#mask-2)"></path>
|
||||
<mask id="mask-6" fill="white">
|
||||
<use xlink:href="#path-5"></use>
|
||||
</mask>
|
||||
<use id="v" fill-opacity="0.5" fill="url(#linearGradient-4)" xlink:href="#path-5"></use>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
BIN
src/views/im/assets/image/h5/login-bg.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
src/views/im/assets/image/login-background.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
9
src/views/im/assets/image/logo.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 69 38" class="design-iconfont">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 7.00285C1 4.23985 3.23985 2 6.00285 2C8.76585 2 11.0057 4.23985 11.0057 7.00285C11.0057 9.76585 8.76585 12.0057 6.00285 12.0057C3.23985 12.0057 1 9.76585 1 7.00285ZM11.006 29.9706C11.006 32.7336 8.7661 34.9735 6.0031 34.9735C3.2401 34.9735 1.00025 32.7336 1.00025 29.9706V18.646C1.00025 15.883 3.2401 13.6431 6.0031 13.6431C8.7661 13.6431 11.006 15.883 11.006 18.646V29.9706ZM46.0605 34.3022C43.6676 35.6837 40.608 34.8639 39.2265 32.471L31.5293 19.1392L23.9741 32.4717C22.5963 34.9031 19.4736 35.7224 17.0648 34.3055C14.7104 32.9206 13.8825 29.8918 15.2291 27.5153L27.1233 6.52593C28.5011 4.09455 31.6238 3.27524 34.0326 4.69216C34.8897 5.19631 35.5445 5.91831 35.9657 6.74739L38.0402 10.405L47.8916 27.4682C49.2731 29.861 48.4533 32.9207 46.0605 34.3022ZM57.6544 32.3693C59.0322 34.8007 62.1549 35.62 64.5637 34.2031C66.918 32.8182 67.746 29.7894 66.3993 27.4129L54.5052 6.42353C53.1274 3.99215 50.0046 3.17285 47.5958 4.58977C46.7395 5.09346 46.0852 5.81462 45.6639 6.64276L41.9572 13.178C43.3898 11.6567 45.8695 11.8817 47.0048 13.6361L47.2778 14.058L57.6544 32.3693Z" fill="url(#paint0_linear_118_5600)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_118_5600" x1="52.993" y1="27.5055" x2="1.00004" y2="20.6384" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#006EFF"/>
|
||||
<stop offset="1" stop-color="#2DB2FF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
15
src/views/im/assets/image/txc-logo.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="45px" height="33px" viewBox="0 0 45 33" version="1.1">
|
||||
<title>编组 8</title>
|
||||
<g id="web" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="登录" transform="translate(-32.000000, -37.000000)">
|
||||
<g id="Group-1322" transform="translate(32.000000, 37.200000)">
|
||||
<g id="编组-8" transform="translate(0.000000, -0.000108)">
|
||||
<path d="M41.4141377,14.5526416 C39.557447,12.6651244 36.9696233,11.4755334 34.0927508,11.4755334 C31.6058158,11.4752249 29.4648729,12.3302 27.5956485,13.8477731 C26.7806481,14.5092911 25.9258802,15.3013233 24.850612,16.3426588 C24.3164594,16.8597784 8.83160619,31.839892 8.83160619,31.839892 C9.64335713,31.9551332 10.7597855,31.9895358 11.7552094,31.995861 C12.68781,32.001569 30.4793295,31.999872 31.2240793,31.999872 C32.7230178,31.999872 33.6986353,31.998175 34.7465151,31.9218104 C37.1497374,31.7470203 39.4200404,30.8682874 41.2552227,29.0716364 C45.3305342,25.081547 45.3918101,18.6056739 41.4141377,14.5526416 M38.4377692,26.2004814 C37.6479909,26.9797089 36.2392641,27.864767 33.9267178,27.9429829 C32.8573296,27.9793911 31.608601,27.9832479 31.0371568,27.9832479 L18.6114565,27.9832479 C23.132411,23.6054731 27.0760413,19.7866256 27.5233863,19.3537385 C27.9332849,18.9566425 28.8550539,18.0774468 29.6500933,17.3637848 C31.3953733,15.7968447 32.9668835,15.4815129 34.077896,15.4918491 C35.8191528,15.5082019 37.4027325,16.2172358 38.5346346,17.361625 C40.9559611,19.8290504 40.8987083,23.7723953 38.4377692,26.2004814" id="Fill-10" fill="#00A3FF"></path>
|
||||
<path d="M16.4306689,13.5894293 C14.6104961,12.2312191 12.5726082,11.4722012 10.262383,11.4754306 C7.38551042,11.4754306 4.79753206,12.6650318 2.94084133,14.5527033 C-1.03667638,18.6057356 -0.97540048,25.0814544 3.09991109,29.0713896 C4.73610142,30.6735036 6.71828395,31.5451401 8.83214777,31.8393367 L12.8191044,27.9822297 C12.1744696,27.9796071 11.2492963,27.9708136 10.4282612,27.9430446 C8.11586963,27.8646745 6.70714287,26.9799249 5.91720987,26.2005431 C3.45627069,23.7724571 3.39901795,19.8289578 5.82049917,17.3613782 C6.95240121,16.2171432 8.53598092,15.5082636 10.277083,15.4920651 C11.3681345,15.4875912 12.8489687,15.8033859 14.5221412,17.1862795 C15.3208942,17.8464091 17.0943364,19.4006989 17.8723546,20.1001679 C17.9119673,20.1358047 17.9596264,20.1388901 18.0060475,20.1010935 L20.7512388,17.430492 C20.7987431,17.3846732 20.7959578,17.3225016 20.7490725,17.2803854 C19.4288553,16.0904859 17.5571551,14.4257375 16.4306689,13.5894293" id="Fill-11" fill="#00C8DC"></path>
|
||||
<path d="M35.172135,9.15742793 C33.2778432,3.82285861 28.176934,0 22.1774663,0 C15.2955328,0 9.59254146,5.04546371 8.55967117,11.6176025 C9.11316585,11.5247308 9.68167004,11.4753638 10.2623985,11.4753638 C11.070281,11.4742839 11.8441213,11.5683898 12.5877879,11.7467281 C12.6023332,11.7498136 12.6168785,11.7515106 12.6312691,11.7550588 C13.5637149,7.31758081 17.4983705,4.02156086 22.1774663,4.02156086 C26.074366,4.02156086 29.4931279,6.36495159 31.0344644,9.68565505 C31.0587581,9.73795323 31.0997635,9.75523169 31.141852,9.74366129 C32.3009878,9.42616965 33.6908366,9.24150614 35.0331811,9.34024018 C35.163934,9.34980504 35.2142235,9.2763716 35.172135,9.15742793" id="Fill-12" fill="#006EFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.3 KiB |
17
src/views/im/assets/image/warn.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116px" height="116px" viewBox="0 0 116 116" version="1.1">
|
||||
<title>椭圆形</title>
|
||||
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="注销账户" transform="translate(-317.000000, -427.000000)">
|
||||
<rect fill="#F7F8FA" x="0" y="0" width="750" height="1624"></rect>
|
||||
<g id="编组-24" transform="translate(0.000000, 268.000000)" fill="#FFFFFF">
|
||||
<polygon id="矩形" points="0 -8.32003216e-12 750 -8.32003216e-12 750 1356 0 1356"></polygon>
|
||||
</g>
|
||||
<g id="编组-9" transform="translate(317.000000, 427.000000)">
|
||||
<circle id="椭圆形" fill="#FF9C19" cx="58" cy="58" r="58"></circle>
|
||||
<rect id="矩形" fill="#FFFFFF" x="54.4848485" y="26.3636364" width="7.03030303" height="47.4545455" rx="3.51515152"></rect>
|
||||
<rect id="矩形备份-9" fill="#FFFFFF" x="54.4848485" y="80.8484848" width="7.03030303" height="7.03030303" rx="3.51515152"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -1,85 +1,42 @@
|
||||
<template>
|
||||
<div
|
||||
:class="['about-container', 'container', isH5 && 'container-h5']"
|
||||
@click="closeAboutBox"
|
||||
@mousedown.stop
|
||||
>
|
||||
<div
|
||||
:class="['about-box', 'box', isH5 && 'box-h5']"
|
||||
@click.stop
|
||||
>
|
||||
<header
|
||||
v-if="isH5"
|
||||
class="title"
|
||||
>
|
||||
<div
|
||||
class="title-back"
|
||||
@click="closeAboutBox"
|
||||
>
|
||||
<div :class="['about-container', 'container', isH5 && 'container-h5']" @click="closeAboutBox" @mousedown.stop>
|
||||
<div :class="['about-box', 'box', isH5 && 'box-h5']" @click.stop>
|
||||
<header v-if="isH5" class="title">
|
||||
<div class="title-back" @click="closeAboutBox">
|
||||
<Icon :file="backSVG" />
|
||||
</div>
|
||||
<div class="title-name">
|
||||
{{ TUITranslateService.t("Home.关于腾讯云·通信") }}
|
||||
{{ TUITranslateService.t('Home.关于腾讯云·通信') }}
|
||||
</div>
|
||||
</header>
|
||||
<main class="main">
|
||||
<div class="main-name">
|
||||
<img
|
||||
class="logo"
|
||||
src="../assets/image/logo.svg"
|
||||
alt=""
|
||||
>
|
||||
<img class="logo" src="../assets/image/logo.svg" alt="" />
|
||||
<div class="name">
|
||||
{{ TUITranslateService.t("即时通信") }}
|
||||
{{ TUITranslateService.t('即时通信') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-version">
|
||||
{{ TUITranslateService.t("Home.SDK版本") }}: {{ SDKVersion }}
|
||||
</div>
|
||||
<div class="main-version">{{ TUITranslateService.t('Home.SDK版本') }}: {{ SDKVersion }}</div>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<ul class="list">
|
||||
<li class="line">
|
||||
<a
|
||||
class="link"
|
||||
:href="Link.privacy.url"
|
||||
target="_blank"
|
||||
>
|
||||
<a class="link" :href="Link.privacy.url" target="_blank">
|
||||
{{ TUITranslateService.t(`Login.${Link.privacy.label}`) }}
|
||||
</a>
|
||||
<a
|
||||
class="link"
|
||||
:href="Link.agreement.url"
|
||||
target="_blank"
|
||||
>
|
||||
<a class="link" :href="Link.agreement.url" target="_blank">
|
||||
{{ TUITranslateService.t(`Login.${Link.agreement.label}`) }}
|
||||
</a>
|
||||
<a
|
||||
class="link"
|
||||
@click="toggleDisclaimer"
|
||||
>
|
||||
{{ TUITranslateService.t("Home.免责声明") }}
|
||||
<div
|
||||
v-if="isDisclaimerBoxShow"
|
||||
:class="['disclaimer-container', 'container', isH5 && 'container-h5']"
|
||||
@click="toggleDisclaimer"
|
||||
>
|
||||
<div
|
||||
:class="['disclaimer-box', 'box', isH5 && 'box-h5']"
|
||||
@click.stop
|
||||
>
|
||||
<header
|
||||
v-if="isH5"
|
||||
class="title"
|
||||
>
|
||||
<div
|
||||
class="title-back"
|
||||
@click="toggleDisclaimer"
|
||||
>
|
||||
<a class="link" @click="toggleDisclaimer">
|
||||
{{ TUITranslateService.t('Home.免责声明') }}
|
||||
<div v-if="isDisclaimerBoxShow" :class="['disclaimer-container', 'container', isH5 && 'container-h5']" @click="toggleDisclaimer">
|
||||
<div :class="['disclaimer-box', 'box', isH5 && 'box-h5']" @click.stop>
|
||||
<header v-if="isH5" class="title">
|
||||
<div class="title-back" @click="toggleDisclaimer">
|
||||
<Icon :file="backSVG" />
|
||||
</div>
|
||||
<div class="title-name">
|
||||
{{ TUITranslateService.t("Home.关于腾讯云·通信") }}
|
||||
{{ TUITranslateService.t('Home.关于腾讯云·通信') }}
|
||||
</div>
|
||||
</header>
|
||||
<main class="main">
|
||||
@ -95,11 +52,8 @@
|
||||
</p>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<button
|
||||
class="btn btn-default"
|
||||
@click.stop="submitDisclaimer"
|
||||
>
|
||||
{{ TUITranslateService.t("Home.同意") }}
|
||||
<button class="btn btn-default" @click.stop="submitDisclaimer">
|
||||
{{ TUITranslateService.t('Home.同意') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
@ -107,80 +61,45 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="line">
|
||||
<a
|
||||
class="link"
|
||||
:href="Link.contact.url"
|
||||
target="_blank"
|
||||
>
|
||||
<a class="link" :href="Link.contact.url" target="_blank">
|
||||
{{ TUITranslateService.t(`Home.${Link.contact.label}`) }}
|
||||
</a>
|
||||
<a
|
||||
class="link"
|
||||
@click="toggleCancellation"
|
||||
>
|
||||
{{ TUITranslateService.t("Home.注销账户") }}
|
||||
<div
|
||||
v-if="isCancellationBoxShow"
|
||||
:class="['cancellation-container', 'container', isH5 && 'container-h5']"
|
||||
@click="toggleCancellation"
|
||||
>
|
||||
<div
|
||||
:class="['cancellation-box', 'box', isH5 && 'box-h5']"
|
||||
@click.stop
|
||||
>
|
||||
<header
|
||||
v-if="isH5"
|
||||
class="title"
|
||||
>
|
||||
<div
|
||||
class="title-back"
|
||||
@click="toggleCancellation"
|
||||
>
|
||||
<a class="link" @click="toggleCancellation">
|
||||
{{ TUITranslateService.t('Home.注销账户') }}
|
||||
<div v-if="isCancellationBoxShow" :class="['cancellation-container', 'container', isH5 && 'container-h5']" @click="toggleCancellation">
|
||||
<div :class="['cancellation-box', 'box', isH5 && 'box-h5']" @click.stop>
|
||||
<header v-if="isH5" class="title">
|
||||
<div class="title-back" @click="toggleCancellation">
|
||||
<Icon :file="backSVG" />
|
||||
</div>
|
||||
<div class="title-name">
|
||||
{{ TUITranslateService.t("Home.关于腾讯云·通信") }}
|
||||
{{ TUITranslateService.t('Home.关于腾讯云·通信') }}
|
||||
</div>
|
||||
</header>
|
||||
<main class="main">
|
||||
<img
|
||||
src="../assets/image/warn.svg"
|
||||
width="60"
|
||||
height="60"
|
||||
>
|
||||
<img src="../assets/image/warn.svg" width="60" height="60" />
|
||||
<p class="main-text">
|
||||
{{
|
||||
TUITranslateService.t(
|
||||
"Home.注销后,您将无法使用当前账号,相关数据也将删除无法找回"
|
||||
)
|
||||
}}
|
||||
{{ TUITranslateService.t('Home.注销后,您将无法使用当前账号,相关数据也将删除无法找回') }}
|
||||
</p>
|
||||
<p>
|
||||
<span>{{ TUITranslateService.t("Home.当前账号") + ": " }}</span>
|
||||
<span>{{ TUITranslateService.t('Home.当前账号') + ': ' }}</span>
|
||||
<span class="main-id">{{ props.userProfile.userID }}</span>
|
||||
</p>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<button
|
||||
class="btn btn-error"
|
||||
@click.stop="submitCancellation"
|
||||
>
|
||||
{{ TUITranslateService.t("Home.注销") }}
|
||||
<button class="btn btn-error" @click.stop="submitCancellation">
|
||||
{{ TUITranslateService.t('Home.注销') }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-default"
|
||||
@click.stop="toggleCancellation"
|
||||
>
|
||||
{{ TUITranslateService.t("Home.取消") }}
|
||||
<button class="btn btn-default" @click.stop="toggleCancellation">
|
||||
{{ TUITranslateService.t('Home.取消') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div></a>
|
||||
</div></a
|
||||
>
|
||||
</li>
|
||||
<li class="line">
|
||||
<p class="copyright">
|
||||
Copyright © 2013-2023 Tencent Cloud. All Rights Reserved.
|
||||
</p>
|
||||
<p class="copyright">Copyright © 2013-2023 Tencent Cloud. All Rights Reserved.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
@ -191,21 +110,21 @@
|
||||
import { ref, withDefaults, defineProps, defineEmits } from '@/TUIKit/adapter-vue';
|
||||
import { TUITranslateService, TUIStore, StoreName } from '@tencentcloud/chat-uikit-engine';
|
||||
import { TUILogin } from '@tencentcloud/tui-core';
|
||||
import Icon from '../TUIKit/components/common/Icon.vue';
|
||||
import backSVG from '../TUIKit/assets/icon/back.svg';
|
||||
import { isH5 } from '../TUIKit/utils/env';
|
||||
import { Link } from '../utils/link';
|
||||
import { cancellation } from '../api';
|
||||
import { IUserProfile } from '../TUIKit/interface';
|
||||
import router from '../router';
|
||||
import Icon from '@/TUIKit/components/common/Icon.vue';
|
||||
import backSVG from '@/TUIKit/assets/icon/back.svg';
|
||||
import { isH5 } from '@/TUIKit/utils/env';
|
||||
import { Link } from '@/utils/link';
|
||||
import { cancellation } from '@/api/im';
|
||||
import { IUserProfile } from '@/TUIKit/interface';
|
||||
import router from '@/router';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
userProfile: IUserProfile;
|
||||
}>(),
|
||||
{
|
||||
userProfile: () => ({} as IUserProfile),
|
||||
},
|
||||
userProfile: () => ({}) as IUserProfile
|
||||
}
|
||||
);
|
||||
|
||||
const emits = defineEmits(['closeAboutBox']);
|
||||
@ -237,7 +156,7 @@ function submitCancellation() {
|
||||
const options: any = {
|
||||
userId: deleteInfoList.userId,
|
||||
token: deleteInfoList.token,
|
||||
phone: deleteInfoList.phone,
|
||||
phone: deleteInfoList.phone
|
||||
};
|
||||
TUILogin.logout().then(() => {
|
||||
localStorage.removeItem('TUIKit-userInfo');
|
||||
@ -247,7 +166,7 @@ function submitCancellation() {
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "../styles/common";
|
||||
@import '../styles/common';
|
||||
|
||||
.main {
|
||||
flex: 1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from "../TUIKit/adapter-vue";
|
||||
import { defineProps } from "@/TUIKit/adapter-vue";
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
|
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { defineProps, defineEmits, withDefaults } from "../TUIKit/adapter-vue";
|
||||
import { defineProps, defineEmits, withDefaults } from "@/TUIKit/adapter-vue";
|
||||
import { TUITranslateService } from "@tencentcloud/chat-uikit-engine";
|
||||
|
||||
type IAdvListItem = {
|
||||
|
@ -10,12 +10,12 @@
|
||||
<div v-if="isH5" class="title-back" @click="closeEditProfileBox">
|
||||
<Icon :file="backSVG"></Icon>
|
||||
</div>
|
||||
<div class="title-name">{{ TUITranslateService.t("Profile.编辑资料") }}</div>
|
||||
<div class="title-name">{{ TUITranslateService.t('Profile.编辑资料') }}</div>
|
||||
</header>
|
||||
<div class="edit-form">
|
||||
<div v-if="isH5" class="edit-form-space"></div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.头像") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.头像') }}</div>
|
||||
<div v-if="isH5" class="form-info" @click="showBottomPopup('avatar')">
|
||||
<Avatar useSkeletonAnimation :url="userProfile.avatar" size="60px" />
|
||||
<Icon class="form-info-arrow" :file="rightArrowIcon" size="14px"></Icon>
|
||||
@ -29,10 +29,7 @@
|
||||
>
|
||||
<ul class="avatar-list">
|
||||
<li
|
||||
:class="[
|
||||
'avatar-list-item',
|
||||
currentEditProfile.avatar === avatar && 'avatar-list-item-selected',
|
||||
]"
|
||||
:class="['avatar-list-item', currentEditProfile.avatar === avatar && 'avatar-list-item-selected']"
|
||||
v-for="avatar in avatarList"
|
||||
:key="avatar"
|
||||
@click="changeCurrentEditProfile('avatar', avatar)"
|
||||
@ -44,7 +41,7 @@
|
||||
</div>
|
||||
<div v-if="isH5" class="edit-form-space"></div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.昵称") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.昵称') }}</div>
|
||||
<div v-if="isH5" class="form-info" @click="showBottomPopup('nick')">
|
||||
<div class="form-info-content">{{ userProfile.nick }}</div>
|
||||
<Icon class="form-info-arrow" :file="rightArrowIcon" size="14px"></Icon>
|
||||
@ -60,12 +57,12 @@
|
||||
</EditProfilePopup>
|
||||
</div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.账号") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.账号') }}</div>
|
||||
<div class="form-info">{{ userProfile.userID }}</div>
|
||||
</div>
|
||||
<div v-if="isH5" class="edit-form-space"></div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.个性签名") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.个性签名') }}</div>
|
||||
<div v-if="isH5" class="form-info" @click="showBottomPopup('selfSignature')">
|
||||
<div class="form-info-content">{{ userProfile.selfSignature }}</div>
|
||||
<Icon class="form-info-arrow" :file="rightArrowIcon" size="14px"></Icon>
|
||||
@ -81,14 +78,10 @@
|
||||
</EditProfilePopup>
|
||||
</div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.性别") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.性别') }}</div>
|
||||
<div v-if="isH5" class="form-info" @click="showBottomPopup('gender')">
|
||||
<div>
|
||||
{{
|
||||
(userProfile.gender &&
|
||||
TUITranslateService.t(`Profile.${genderLabelList[userProfile.gender]}`)) ||
|
||||
""
|
||||
}}
|
||||
{{ (userProfile.gender && TUITranslateService.t(`Profile.${genderLabelList[userProfile.gender]}`)) || '' }}
|
||||
</div>
|
||||
<Icon class="form-info-arrow" :file="rightArrowIcon" size="14px"></Icon>
|
||||
</div>
|
||||
@ -100,27 +93,12 @@
|
||||
@onSubmit="submitEditProfileBox"
|
||||
>
|
||||
<ul class="gender-list">
|
||||
<li
|
||||
class="gender-list-li"
|
||||
v-for="(value, key) in genderLabelList"
|
||||
:key="key"
|
||||
@click="changeCurrentEditProfile('gender', key)"
|
||||
>
|
||||
<li class="gender-list-li" v-for="(value, key) in genderLabelList" :key="key" @click="changeCurrentEditProfile('gender', key)">
|
||||
<div
|
||||
:class="[
|
||||
'gender-list-item',
|
||||
currentEditProfile.gender === key && 'gender-list-item-selected',
|
||||
]"
|
||||
:class="['gender-list-item', currentEditProfile.gender === key && 'gender-list-item-selected']"
|
||||
@click="changeCurrentEditProfile('gender', key)"
|
||||
>
|
||||
<input
|
||||
v-if="isPC"
|
||||
class="gender-list-radio"
|
||||
type="radio"
|
||||
name="gender"
|
||||
:value="key"
|
||||
:checked="currentEditProfile.gender === key"
|
||||
/>
|
||||
<input v-if="isPC" class="gender-list-radio" type="radio" name="gender" :value="key" :checked="currentEditProfile.gender === key" />
|
||||
{{ TUITranslateService.t(`Profile.${value}`) }}
|
||||
</div>
|
||||
</li>
|
||||
@ -128,7 +106,7 @@
|
||||
</EditProfilePopup>
|
||||
</div>
|
||||
<div class="edit-form-item">
|
||||
<div class="form-label">{{ TUITranslateService.t("Profile.出生年月") }}</div>
|
||||
<div class="form-label">{{ TUITranslateService.t('Profile.出生年月') }}</div>
|
||||
<div v-if="isH5" class="form-info" @click="showBottomPopup('birthday')">
|
||||
<div class="form-info-content">{{ birthdayObj.format }}</div>
|
||||
<Icon class="form-info-arrow" :file="rightArrowIcon" size="14px"></Icon>
|
||||
@ -160,48 +138,41 @@
|
||||
</div>
|
||||
<footer v-if="!isH5" class="edit-footer">
|
||||
<button class="btn-close" @click="closeEditProfileBox">
|
||||
{{ TUITranslateService.t("Profile.取消") }}
|
||||
{{ TUITranslateService.t('Profile.取消') }}
|
||||
</button>
|
||||
<button class="btn-save" @click="submitEditProfileBox">
|
||||
{{ TUITranslateService.t("Profile.保存") }}
|
||||
{{ TUITranslateService.t('Profile.保存') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits } from "../TUIKit/adapter-vue";
|
||||
import TUIChatEngine, {
|
||||
TUITranslateService,
|
||||
TUIUserService,
|
||||
TUIStore,
|
||||
StoreName,
|
||||
} from "@tencentcloud/chat-uikit-engine";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import { Toast, TOAST_TYPE } from "../TUIKit/components/common/Toast/index";
|
||||
import EditProfilePopup from "./EditProfilePopup.vue";
|
||||
import DatePicker from "../TUIKit/components/common/DatePicker";
|
||||
import Avatar from "../TUIKit/components/common/Avatar/index.vue";
|
||||
import Icon from "../TUIKit/components/common/Icon.vue";
|
||||
import backSVG from "../TUIKit/assets/icon/back.svg";
|
||||
import rightArrowIcon from "../TUIKit/assets/icon/right-icon.svg";
|
||||
import calendarSVG from "../assets/icon/calendar.svg";
|
||||
import { IUserProfile } from "../TUIKit/interface";
|
||||
import { isH5, isPC } from "../TUIKit/utils/env";
|
||||
import { enableSampleTaskStatus } from "../TUIKit/utils/enableSampleTaskStatus";
|
||||
import { ref, defineEmits } from '@/TUIKit/adapter-vue';
|
||||
import TUIChatEngine, { TUITranslateService, TUIUserService, TUIStore, StoreName } from '@tencentcloud/chat-uikit-engine';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { Toast, TOAST_TYPE } from '@/TUIKit/components/common/Toast/index';
|
||||
import EditProfilePopup from './EditProfilePopup.vue';
|
||||
import DatePicker from '@/TUIKit/components/common/DatePicker';
|
||||
import Avatar from '@/TUIKit/components/common/Avatar/index.vue';
|
||||
import Icon from '@/TUIKit/components/common/Icon.vue';
|
||||
import backSVG from '@/TUIKit/assets/icon/back.svg';
|
||||
import rightArrowIcon from '@/TUIKit/assets/icon/right-icon.svg';
|
||||
import calendarSVG from '../assets/icon/calendar.svg';
|
||||
import { IUserProfile } from '@/TUIKit/interface';
|
||||
import { isH5, isPC } from '@/TUIKit/utils/env';
|
||||
import { enableSampleTaskStatus } from '@/TUIKit/utils/enableSampleTaskStatus';
|
||||
|
||||
const emits = defineEmits(["closeEditProfileBox"]);
|
||||
const emits = defineEmits(['closeEditProfileBox']);
|
||||
// config
|
||||
const avatarListBaseUrl = "https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_";
|
||||
const avatarList = ["1.png", "2.png", "3.png", "4.png", "5.png", "6.png"].map(
|
||||
(url: string) => avatarListBaseUrl + url
|
||||
);
|
||||
const avatarListBaseUrl = 'https://im.sdk.qcloud.com/download/tuikit-resource/avatar/avatar_';
|
||||
const avatarList = ['1.png', '2.png', '3.png', '4.png', '5.png', '6.png'].map((url: string) => avatarListBaseUrl + url);
|
||||
const genderLabelList: {
|
||||
[propsName: string]: string;
|
||||
} = {
|
||||
[TUIChatEngine.TYPES.GENDER_MALE]: "男",
|
||||
[TUIChatEngine.TYPES.GENDER_FEMALE]: "女",
|
||||
[TUIChatEngine.TYPES.GENDER_UNKNOWN]: "不显示",
|
||||
[TUIChatEngine.TYPES.GENDER_MALE]: '男',
|
||||
[TUIChatEngine.TYPES.GENDER_FEMALE]: '女',
|
||||
[TUIChatEngine.TYPES.GENDER_UNKNOWN]: '不显示'
|
||||
};
|
||||
const userProfile = ref<IUserProfile>({});
|
||||
// current edit value
|
||||
@ -210,10 +181,10 @@ const currentEditProfile = ref<IUserProfile>({
|
||||
nick: userProfile.value?.nick,
|
||||
selfSignature: userProfile.value?.selfSignature,
|
||||
gender: userProfile.value?.gender,
|
||||
birthday: userProfile.value?.birthday,
|
||||
birthday: userProfile.value?.birthday
|
||||
});
|
||||
const birthdayObj = ref<{ obj: typeof Dayjs; format: string; value: number }>({});
|
||||
const currentBottomPopupShow = ref<string>("");
|
||||
const currentBottomPopupShow = ref<string>('');
|
||||
|
||||
TUIStore.watch(StoreName.USER, {
|
||||
userProfile: (userProfileData: IUserProfile) => {
|
||||
@ -221,20 +192,20 @@ TUIStore.watch(StoreName.USER, {
|
||||
const { avatar, nick, selfSignature, gender, birthday } = userProfileData;
|
||||
currentEditProfile.value = { avatar, nick, selfSignature, gender, birthday };
|
||||
birthdayObj.value = generateBirthdayObj(userProfileData.birthday);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
function generateBirthdayObj(YYYYMMDD: any) {
|
||||
let birthdayDayjsObj: typeof Dayjs = null;
|
||||
let birthdayFormat = "";
|
||||
if (YYYYMMDD && typeof YYYYMMDD === "number") {
|
||||
birthdayDayjsObj = dayjs(YYYYMMDD.toString(), "YYYYMMDD");
|
||||
birthdayFormat = birthdayDayjsObj.format("YYYY/MM/DD");
|
||||
let birthdayFormat = '';
|
||||
if (YYYYMMDD && typeof YYYYMMDD === 'number') {
|
||||
birthdayDayjsObj = dayjs(YYYYMMDD.toString(), 'YYYYMMDD');
|
||||
birthdayFormat = birthdayDayjsObj.format('YYYY/MM/DD');
|
||||
}
|
||||
return {
|
||||
obj: birthdayDayjsObj,
|
||||
format: birthdayFormat,
|
||||
value: userProfile.value?.birthday || 0,
|
||||
value: userProfile.value?.birthday || 0
|
||||
};
|
||||
}
|
||||
|
||||
@ -242,11 +213,11 @@ function showBottomPopup(key: string) {
|
||||
currentBottomPopupShow.value = key;
|
||||
}
|
||||
function closeBottomPopup() {
|
||||
currentBottomPopupShow.value = "";
|
||||
currentBottomPopupShow.value = '';
|
||||
}
|
||||
|
||||
function pickBirthday(date: typeof Dayjs) {
|
||||
currentEditProfile.value.birthday = parseInt(date.format("YYYYMMDD"), 10);
|
||||
currentEditProfile.value.birthday = parseInt(date.format('YYYYMMDD'), 10);
|
||||
}
|
||||
|
||||
function changeCurrentEditProfile(key: keyof IUserProfile, value: any) {
|
||||
@ -256,36 +227,36 @@ function changeCurrentEditProfile(key: keyof IUserProfile, value: any) {
|
||||
}
|
||||
|
||||
function closeEditProfileBox() {
|
||||
emits("closeEditProfileBox");
|
||||
emits('closeEditProfileBox');
|
||||
}
|
||||
|
||||
function submitEditProfileBox() {
|
||||
let isNickModified = currentEditProfile.value.nick !== userProfile.value.nick;
|
||||
const isNickModified = currentEditProfile.value.nick !== userProfile.value.nick;
|
||||
const profileOptions = Object.fromEntries(
|
||||
Object.entries(currentEditProfile.value).filter(([key, value]) => {
|
||||
return value !== null && value !== undefined && value !== "";
|
||||
return value !== null && value !== undefined && value !== '';
|
||||
})
|
||||
);
|
||||
TUIUserService.updateMyProfile(profileOptions)
|
||||
.then(() => {
|
||||
isNickModified && enableSampleTaskStatus("modifyNickName");
|
||||
isNickModified && enableSampleTaskStatus('modifyNickName');
|
||||
Toast({
|
||||
message: TUITranslateService.t("Profile.修改个人资料成功"),
|
||||
type: TOAST_TYPE.SUCCESS,
|
||||
message: TUITranslateService.t('Profile.修改个人资料成功'),
|
||||
type: TOAST_TYPE.SUCCESS
|
||||
});
|
||||
isPC && closeEditProfileBox();
|
||||
})
|
||||
.catch((error: Error) => {
|
||||
Toast({
|
||||
message: TUITranslateService.t("Profile.修改个人资料失败") + error?.message,
|
||||
type: TOAST_TYPE.ERROR,
|
||||
message: TUITranslateService.t('Profile.修改个人资料失败') + error?.message,
|
||||
type: TOAST_TYPE.ERROR
|
||||
});
|
||||
isPC && closeEditProfileBox();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "../styles/common.scss";
|
||||
@import '../styles/common.scss';
|
||||
.edit-profile-container {
|
||||
@extend .container;
|
||||
font-size: 14px;
|
||||
|
@ -14,9 +14,9 @@
|
||||
</BottomPopup>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { withDefaults, defineProps, defineEmits } from "../TUIKit/adapter-vue";
|
||||
import { withDefaults, defineProps, defineEmits } from "@/TUIKit/adapter-vue";
|
||||
import { TUITranslateService } from "@tencentcloud/chat-uikit-engine";
|
||||
import BottomPopup from "../TUIKit/components/common/BottomPopup";
|
||||
import BottomPopup from "@/TUIKit/components/common/BottomPopup";
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
show: boolean;
|
||||
|
@ -41,9 +41,9 @@ import { withDefaults, defineProps, defineEmits, ref } from '@/TUIKit/adapter-vu
|
||||
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
||||
import { TUICore, TUIConstants } from '@tencentcloud/tui-core';
|
||||
import Icon from '@/TUIKit/components/common/Icon.vue';
|
||||
import menuPNG from '@/views/im/icon/menu.png';
|
||||
import globalPNG from '@/views/im/icon/global.png';
|
||||
import arrowDownPNG from '@/views/im/icon/arrow-down.png';
|
||||
import menuPNG from '@/views/im/assets/icon/menu.png';
|
||||
import globalPNG from '@/views/im/assets/icon/global.png';
|
||||
import arrowDownPNG from '@/views/im/assets/icon/arrow-down.png';
|
||||
import { Link } from '@/utils/link';
|
||||
|
||||
const props = withDefaults(
|
||||
|
@ -40,15 +40,15 @@ import { ref, computed, defineEmits, watch, withDefaults, defineProps } from '@/
|
||||
import { TUIStore, StoreName, TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
||||
import Icon from '@/TUIKit/components/common/Icon.vue';
|
||||
import Avatar from '@/TUIKit/components/common/Avatar/index.vue';
|
||||
import messageWebSVG from '@/views/im/icon/message.svg';
|
||||
import messageH5SVG from '@/views/im/icon/message-real.svg';
|
||||
import messageSelectedSVG from '@/views/im/icon/message-selected.svg';
|
||||
import relationWebSVG from '@/views/im/icon/relation.svg';
|
||||
import relationH5SVG from '@/views/im/icon/relation-real.svg';
|
||||
import relationSelectedSVG from '@/views/im/icon/relation-selected.svg';
|
||||
import profileH5SVG from '@/views/im/icon/profile.svg';
|
||||
import profileSelectedSVG from '@/views/im/icon/profile-selected.svg';
|
||||
import settingPNG from '@/views/im/icon/setting.png';
|
||||
import messageWebSVG from '@/views/im/assets/icon/message.svg';
|
||||
import messageH5SVG from '@/views/im/assets/icon/message-real.svg';
|
||||
import messageSelectedSVG from '@/views/im/assets/icon/message-selected.svg';
|
||||
import relationWebSVG from '@/views/im/assets/icon/relation.svg';
|
||||
import relationH5SVG from '@/views/im/assets/icon/relation-real.svg';
|
||||
import relationSelectedSVG from '@/views/im/assets/icon/relation-selected.svg';
|
||||
import profileH5SVG from '@/views/im/assets/icon/profile.svg';
|
||||
import profileSelectedSVG from '@/views/im/assets/icon/profile-selected.svg';
|
||||
import settingPNG from '@/views/im/assets/icon/setting.png';
|
||||
import { IUserProfile } from '@/TUIKit/interface';
|
||||
import { isPC, isH5 } from '@/TUIKit/utils/env';
|
||||
|
||||
|
@ -2,49 +2,19 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="MEMBER_ID" prop="memberId">
|
||||
<el-input
|
||||
v-model="queryParams.memberId"
|
||||
placeholder="请输入MEMBER_ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.memberId" placeholder="请输入MEMBER_ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.orderId" placeholder="请输入订单id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子订单id" prop="orderItemId">
|
||||
<el-input
|
||||
v-model="queryParams.orderItemId"
|
||||
placeholder="请输入子订单id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.orderItemId" placeholder="请输入子订单id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退款金额" prop="returnAmount">
|
||||
<el-input
|
||||
v-model="queryParams.returnAmount"
|
||||
placeholder="请输入退款金额"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.returnAmount" placeholder="请输入退款金额" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退货数量" prop="quantity">
|
||||
<el-input
|
||||
v-model="queryParams.quantity"
|
||||
placeholder="请输入退货数量"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.quantity" placeholder="请输入退货数量" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -54,15 +24,7 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['oms:aftersaleItem:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['oms:aftersaleItem:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -74,35 +36,21 @@
|
||||
<el-table-column label="退款金额" align="center" prop="returnAmount" />
|
||||
<el-table-column label="退货数量" align="center" prop="quantity" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['oms:aftersaleItem:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['oms:aftersaleItem:remove']"
|
||||
>删除</el-button>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['oms:aftersaleItem:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['oms:aftersaleItem:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改订单售后对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="MEMBER_ID" prop="memberId">
|
||||
<el-input v-model="form.memberId" placeholder="请输入MEMBER_ID" />
|
||||
@ -120,19 +68,28 @@
|
||||
<el-input v-model="form.quantity" placeholder="请输入退货数量" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOmsAftersaleItem, getOmsAftersaleItem, delOmsAftersaleItem, addOmsAftersaleItem, updateOmsAftersaleItem, exportOmsAftersaleItem } from "@/api/oms/aftersaleItem";
|
||||
import {
|
||||
listOmsAftersaleItem,
|
||||
getOmsAftersaleItem,
|
||||
delOmsAftersaleItem,
|
||||
addOmsAftersaleItem,
|
||||
updateOmsAftersaleItem,
|
||||
exportOmsAftersaleItem
|
||||
} from '@/api/oms/aftersaleItem';
|
||||
|
||||
export default {
|
||||
name: "OmsAftersaleItem",
|
||||
name: 'OmsAftersaleItem',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -152,7 +109,7 @@ export default {
|
||||
// 订单售后表格数据
|
||||
omsAftersaleItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -163,16 +120,14 @@ export default {
|
||||
orderId: null,
|
||||
orderItemId: null,
|
||||
returnAmount: null,
|
||||
quantity: null,
|
||||
quantity: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
memberId: [
|
||||
{ required: true, message: "MEMBER_ID不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
memberId: [{ required: true, message: 'MEMBER_ID不能为空', trigger: 'blur' }]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -185,8 +140,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listOmsAftersaleItem(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listOmsAftersaleItem(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.omsAftersaleItemList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -211,7 +166,7 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -220,44 +175,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加订单售后";
|
||||
this.title = '添加订单售后';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOmsAftersaleItem(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getOmsAftersaleItem(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改订单售后";
|
||||
this.title = '修改订单售后';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateOmsAftersaleItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateOmsAftersaleItem(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOmsAftersaleItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addOmsAftersaleItem(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -268,23 +223,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单售后编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除订单售后编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delOmsAftersaleItem(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有订单售后数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有订单售后数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportOmsAftersaleItem(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,13 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.orderId" placeholder="请输入订单id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司(配送方式)" prop="deliveryCompany">
|
||||
<el-input
|
||||
@ -20,13 +14,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流单号" prop="deliverySn">
|
||||
<el-input
|
||||
v-model="queryParams.deliverySn"
|
||||
placeholder="请输入物流单号"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.deliverySn" placeholder="请输入物流单号" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -36,15 +24,9 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['oms:orderDeliveryHistory:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['oms:orderDeliveryHistory:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -54,35 +36,21 @@
|
||||
<el-table-column label="物流公司(配送方式)" align="center" prop="deliveryCompany" />
|
||||
<el-table-column label="物流单号" align="center" prop="deliverySn" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['oms:orderDeliveryHistory:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['oms:orderDeliveryHistory:remove']"
|
||||
>删除</el-button>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['oms:orderDeliveryHistory:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['oms:orderDeliveryHistory:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改订单发货记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input v-model="form.orderId" placeholder="请输入订单id" />
|
||||
@ -94,19 +62,28 @@
|
||||
<el-input v-model="form.deliverySn" placeholder="请输入物流单号" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOmsOrderDeliveryHistory, getOmsOrderDeliveryHistory, delOmsOrderDeliveryHistory, addOmsOrderDeliveryHistory, updateOmsOrderDeliveryHistory, exportOmsOrderDeliveryHistory } from "@/api/oms/orderDeliveryHistory";
|
||||
import {
|
||||
listOmsOrderDeliveryHistory,
|
||||
getOmsOrderDeliveryHistory,
|
||||
delOmsOrderDeliveryHistory,
|
||||
addOmsOrderDeliveryHistory,
|
||||
updateOmsOrderDeliveryHistory,
|
||||
exportOmsOrderDeliveryHistory
|
||||
} from '@/api/oms/orderDeliveryHistory';
|
||||
|
||||
export default {
|
||||
name: "OmsOrderDeliveryHistory",
|
||||
name: 'OmsOrderDeliveryHistory',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -126,7 +103,7 @@ export default {
|
||||
// 订单发货记录表格数据
|
||||
omsOrderDeliveryHistoryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -135,13 +112,12 @@ export default {
|
||||
pageSize: 10,
|
||||
orderId: null,
|
||||
deliveryCompany: null,
|
||||
deliverySn: null,
|
||||
deliverySn: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -154,8 +130,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listOmsOrderDeliveryHistory(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listOmsOrderDeliveryHistory(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.omsOrderDeliveryHistoryList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -178,7 +154,7 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -187,44 +163,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加订单发货记录";
|
||||
this.title = '添加订单发货记录';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOmsOrderDeliveryHistory(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getOmsOrderDeliveryHistory(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改订单发货记录";
|
||||
this.title = '修改订单发货记录';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateOmsOrderDeliveryHistory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateOmsOrderDeliveryHistory(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOmsOrderDeliveryHistory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addOmsOrderDeliveryHistory(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -235,23 +211,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单发货记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除订单发货记录编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delOmsOrderDeliveryHistory(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有订单发货记录数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有订单发货记录数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportOmsOrderDeliveryHistory(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,142 +2,61 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.orderId" placeholder="请输入订单id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="PRODUCT_ID" prop="productId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入PRODUCT_ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.productId" placeholder="请输入PRODUCT_ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" prop="outProductId">
|
||||
<el-input
|
||||
v-model="queryParams.outProductId"
|
||||
placeholder="请输入商品编码"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.outProductId" placeholder="请输入商品编码" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品sku id" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入商品sku id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.skuId" placeholder="请输入商品sku id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="sku编码" prop="outSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.outSkuId"
|
||||
placeholder="请输入sku编码"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.outSkuId" placeholder="请输入sku编码" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品快照id" prop="productSnapshotId">
|
||||
<el-input
|
||||
v-model="queryParams.productSnapshotId"
|
||||
placeholder="请输入商品快照id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.productSnapshotId" placeholder="请输入商品快照id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="sku快照id" prop="skuSnapshotId">
|
||||
<el-input
|
||||
v-model="queryParams.skuSnapshotId"
|
||||
placeholder="请输入sku快照id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.skuSnapshotId" placeholder="请输入sku快照id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<template v-if="showMoreCondition">
|
||||
<el-form-item label="展示图片" prop="pic">
|
||||
<el-input
|
||||
v-model="queryParams.pic"
|
||||
placeholder="请输入展示图片"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.pic" placeholder="请输入展示图片" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="PRODUCT_NAME" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入PRODUCT_NAME"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.productName" placeholder="请输入PRODUCT_NAME" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="销售价格" prop="salePrice">
|
||||
<el-input
|
||||
v-model="queryParams.salePrice"
|
||||
placeholder="请输入销售价格"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.salePrice" placeholder="请输入销售价格" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="采购价" prop="purchasePrice">
|
||||
<el-input
|
||||
v-model="queryParams.purchasePrice"
|
||||
placeholder="请输入采购价"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.purchasePrice" placeholder="请输入采购价" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="购买数量" prop="quantity">
|
||||
<el-input
|
||||
v-model="queryParams.quantity"
|
||||
placeholder="请输入购买数量"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.quantity" placeholder="请输入购买数量" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类id" prop="productCategoryId">
|
||||
<el-input
|
||||
v-model="queryParams.productCategoryId"
|
||||
placeholder="请输入商品分类id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.productCategoryId" placeholder="请输入商品分类id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
|
||||
<el-button
|
||||
:icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
||||
size="mini"
|
||||
@click="showMoreCondition = !showMoreCondition"
|
||||
>{{ showMoreCondition ? '收起条件' : '展开条件' }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['oms:orderItem:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['oms:orderItem:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -156,37 +75,22 @@
|
||||
<el-table-column label="采购价" align="center" prop="purchasePrice" />
|
||||
<el-table-column label="购买数量" align="center" prop="quantity" />
|
||||
<el-table-column label="商品分类id" align="center" prop="productCategoryId" />
|
||||
<el-table-column label="商品sku属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}]" align="center" prop="spData" />
|
||||
<!-- <el-table-column label="商品sku属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}]" align="center" prop="spData" />-->
|
||||
<el-table-column label="商品sku属性:" align="center" prop="spData" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['oms:orderItem:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['oms:orderItem:remove']"
|
||||
>删除</el-button>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['oms:orderItem:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['oms:orderItem:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改订单中所包含的商品对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="订单id" prop="orderId">
|
||||
<el-input v-model="form.orderId" placeholder="请输入订单id" />
|
||||
@ -227,23 +131,26 @@
|
||||
<el-form-item label="商品分类id" prop="productCategoryId">
|
||||
<el-input v-model="form.productCategoryId" placeholder="请输入商品分类id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品sku属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}]" prop="spData">
|
||||
<!-- <el-form-item label="商品sku属性:[{"key":"颜色","value":"颜色"},{"key":"容量","value":"4G"}]" prop="spData">-->
|
||||
<el-form-item label="商品sku属性:" prop="spData">
|
||||
<el-input v-model="form.spData" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOmsOrderItem, getOmsOrderItem, delOmsOrderItem, addOmsOrderItem, updateOmsOrderItem, exportOmsOrderItem } from "@/api/oms/orderItem";
|
||||
import { listOmsOrderItem, getOmsOrderItem, delOmsOrderItem, addOmsOrderItem, updateOmsOrderItem, exportOmsOrderItem } from '@/api/oms/orderItem';
|
||||
|
||||
export default {
|
||||
name: "OmsOrderItem",
|
||||
name: 'OmsOrderItem',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -263,7 +170,7 @@ export default {
|
||||
// 订单中所包含的商品表格数据
|
||||
omsOrderItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -283,18 +190,14 @@ export default {
|
||||
purchasePrice: null,
|
||||
quantity: null,
|
||||
productCategoryId: null,
|
||||
spData: null,
|
||||
spData: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
outProductId: [
|
||||
{ required: true, message: "商品编码不能为空", trigger: "blur" }
|
||||
],
|
||||
outSkuId: [
|
||||
{ required: true, message: "sku编码不能为空", trigger: "blur" }
|
||||
],
|
||||
outProductId: [{ required: true, message: '商品编码不能为空', trigger: 'blur' }],
|
||||
outSkuId: [{ required: true, message: 'sku编码不能为空', trigger: 'blur' }]
|
||||
},
|
||||
showMoreCondition: false
|
||||
};
|
||||
@ -309,8 +212,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listOmsOrderItem(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listOmsOrderItem(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.omsOrderItemList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -344,7 +247,7 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -353,44 +256,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加订单中所包含的商品";
|
||||
this.title = '添加订单中所包含的商品';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOmsOrderItem(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getOmsOrderItem(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改订单中所包含的商品";
|
||||
this.title = '修改订单中所包含的商品';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateOmsOrderItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateOmsOrderItem(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOmsOrderItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addOmsOrderItem(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -401,23 +304,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单中所包含的商品编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除订单中所包含的商品编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delOmsOrderItem(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有订单中所包含的商品数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有订单中所包含的商品数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportOmsOrderItem(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,49 +2,19 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="payment_id" prop="paymentId">
|
||||
<el-input
|
||||
v-model="queryParams.paymentId"
|
||||
placeholder="请输入payment_id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.paymentId" placeholder="请输入payment_id" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户 ID" prop="memberId">
|
||||
<el-input
|
||||
v-model="queryParams.memberId"
|
||||
placeholder="请输入用户 ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.memberId" placeholder="请输入用户 ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="OPENID" prop="openid">
|
||||
<el-input
|
||||
v-model="queryParams.openid"
|
||||
placeholder="请输入OPENID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.openid" placeholder="请输入OPENID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="真实姓名,提现需要" prop="realName">
|
||||
<el-input
|
||||
v-model="queryParams.realName"
|
||||
placeholder="请输入真实姓名,提现需要"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.realName" placeholder="请输入真实姓名,提现需要" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标题|商品名称" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入标题|商品名称"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.title" placeholder="请输入标题|商品名称" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号 支付时是payId 其他为orderId" prop="orderId">
|
||||
<el-input
|
||||
@ -56,13 +26,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="金额,单位分" prop="money">
|
||||
<el-input
|
||||
v-model="queryParams.money"
|
||||
placeholder="请输入金额,单位分"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.money" placeholder="请输入金额,单位分" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<template v-if="showMoreCondition">
|
||||
<el-form-item label="交易类型" prop="opType">
|
||||
@ -76,33 +40,26 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="附加数据" prop="attach">
|
||||
<el-input
|
||||
v-model="queryParams.attach"
|
||||
placeholder="请输入附加数据"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.attach" placeholder="请输入附加数据" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
|
||||
<el-button
|
||||
:icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
||||
size="mini"
|
||||
@click="showMoreCondition = !showMoreCondition"
|
||||
>{{ showMoreCondition ? '收起条件' : '展开条件' }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['pms:wechatPaymentHistory:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['pms:wechatPaymentHistory:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -121,35 +78,21 @@
|
||||
<el-table-column label="附加数据" align="center" prop="attach" />
|
||||
<el-table-column label="响应内容" align="center" prop="responseBody" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:wechatPaymentHistory:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:wechatPaymentHistory:remove']"
|
||||
>删除</el-button>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['pms:wechatPaymentHistory:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['pms:wechatPaymentHistory:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改微信订单表对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="payment_id" prop="paymentId">
|
||||
<el-input v-model="form.paymentId" placeholder="请输入payment_id" />
|
||||
@ -192,19 +135,28 @@
|
||||
<el-input v-model="form.responseBody" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOmsWechatPaymentHistory, getOmsWechatPaymentHistory, delOmsWechatPaymentHistory, addOmsWechatPaymentHistory, updateOmsWechatPaymentHistory, exportOmsWechatPaymentHistory } from "@/api/oms/wechatPaymentHistory";
|
||||
import {
|
||||
listOmsWechatPaymentHistory,
|
||||
getOmsWechatPaymentHistory,
|
||||
delOmsWechatPaymentHistory,
|
||||
addOmsWechatPaymentHistory,
|
||||
updateOmsWechatPaymentHistory,
|
||||
exportOmsWechatPaymentHistory
|
||||
} from '@/api/oms/wechatPaymentHistory';
|
||||
|
||||
export default {
|
||||
name: "OmsWechatPaymentHistory",
|
||||
name: 'OmsWechatPaymentHistory',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -224,7 +176,7 @@ export default {
|
||||
// 微信订单表表格数据
|
||||
omsWechatPaymentHistoryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -241,33 +193,19 @@ export default {
|
||||
opType: null,
|
||||
paymentStatus: null,
|
||||
attach: null,
|
||||
responseBody: null,
|
||||
responseBody: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
memberId: [
|
||||
{ required: true, message: "用户 ID不能为空", trigger: "blur" }
|
||||
],
|
||||
openid: [
|
||||
{ required: true, message: "OPENID不能为空", trigger: "blur" }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: "标题|商品名称不能为空", trigger: "blur" }
|
||||
],
|
||||
orderId: [
|
||||
{ required: true, message: "订单号 支付时是payId 其他为orderId不能为空", trigger: "blur" }
|
||||
],
|
||||
money: [
|
||||
{ required: true, message: "金额,单位分不能为空", trigger: "blur" }
|
||||
],
|
||||
opType: [
|
||||
{ required: true, message: "交易类型不能为空", trigger: "change" }
|
||||
],
|
||||
paymentStatus: [
|
||||
{ required: true, message: "状态不能为空", trigger: "blur" }
|
||||
],
|
||||
memberId: [{ required: true, message: '用户 ID不能为空', trigger: 'blur' }],
|
||||
openid: [{ required: true, message: 'OPENID不能为空', trigger: 'blur' }],
|
||||
title: [{ required: true, message: '标题|商品名称不能为空', trigger: 'blur' }],
|
||||
orderId: [{ required: true, message: '订单号 支付时是payId 其他为orderId不能为空', trigger: 'blur' }],
|
||||
money: [{ required: true, message: '金额,单位分不能为空', trigger: 'blur' }],
|
||||
opType: [{ required: true, message: '交易类型不能为空', trigger: 'change' }],
|
||||
paymentStatus: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
|
||||
},
|
||||
showMoreCondition: false
|
||||
};
|
||||
@ -282,8 +220,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listOmsWechatPaymentHistory(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listOmsWechatPaymentHistory(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.omsWechatPaymentHistoryList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -315,7 +253,7 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -324,44 +262,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加微信订单表";
|
||||
this.title = '添加微信订单表';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOmsWechatPaymentHistory(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getOmsWechatPaymentHistory(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改微信订单表";
|
||||
this.title = '修改微信订单表';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateOmsWechatPaymentHistory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateOmsWechatPaymentHistory(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOmsWechatPaymentHistory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addOmsWechatPaymentHistory(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -372,23 +310,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除微信订单表编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除微信订单表编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delOmsWechatPaymentHistory(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有微信订单表数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有微信订单表数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportOmsWechatPaymentHistory(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ import ThirdParty from './thirdParty.vue';
|
||||
import OnlineDevice from './onlineDevice.vue';
|
||||
import { getAuthList } from '@/api/system/social/auth';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
import { getOnline } from '@/api/monitor/online';
|
||||
import { getOnline } from '@/api/monitor/online/index';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
|
||||
const activeTab = ref('userinfo');
|
||||
|
@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Online" lang="ts">
|
||||
import { delOnline } from '@/api/monitor/online';
|
||||
import { delOnline } from '@/api/monitor/online/index';
|
||||
import { propTypes } from '@/utils/propTypes';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
@ -2,13 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
|
||||
<el-form-item label="MEMBER_ID" prop="memberId">
|
||||
<el-input
|
||||
v-model="queryParams.memberId"
|
||||
placeholder="请输入MEMBER_ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.memberId" placeholder="请输入MEMBER_ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段" prop="unionid">
|
||||
<el-input
|
||||
@ -29,22 +23,10 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序唯一身份ID" prop="routineOpenid">
|
||||
<el-input
|
||||
v-model="queryParams.routineOpenid"
|
||||
placeholder="请输入小程序唯一身份ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.routineOpenid" placeholder="请输入小程序唯一身份ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户所在的分组ID" prop="groupid">
|
||||
<el-input
|
||||
v-model="queryParams.groupid"
|
||||
placeholder="请输入用户所在的分组ID"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.groupid" placeholder="请输入用户所在的分组ID" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户被打上的标签ID列表" prop="tagidList">
|
||||
<el-input
|
||||
@ -66,13 +48,7 @@
|
||||
</el-form-item>
|
||||
<template v-if="showMoreCondition">
|
||||
<el-form-item label="关注公众号时间" prop="subscribeTime">
|
||||
<el-input
|
||||
v-model="queryParams.subscribeTime"
|
||||
placeholder="请输入关注公众号时间"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.subscribeTime" placeholder="请输入关注公众号时间" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小程序用户会话密匙" prop="sessionKey">
|
||||
<el-input
|
||||
@ -84,13 +60,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期时间" prop="expiresIn">
|
||||
<el-input
|
||||
v-model="queryParams.expiresIn"
|
||||
placeholder="请输入过期时间"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.expiresIn" placeholder="请输入过期时间" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="过期时间" prop="expireTime">
|
||||
<el-date-picker
|
||||
@ -99,28 +69,26 @@
|
||||
v-model="queryParams.expireTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择过期时间">
|
||||
placeholder="选择过期时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item class="flex_one tr">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
|
||||
<el-button
|
||||
:icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
||||
size="mini"
|
||||
@click="showMoreCondition = !showMoreCondition"
|
||||
>{{ showMoreCondition ? '收起条件' : '展开条件' }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['ums:memberWechat:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ums:memberWechat:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -139,40 +107,26 @@
|
||||
<el-table-column label="过期时间" align="center" prop="expiresIn" />
|
||||
<el-table-column label="刷新token" align="center" prop="refreshToken" />
|
||||
<el-table-column label="过期时间" align="center" prop="expireTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.expireTime, '') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['ums:memberWechat:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['ums:memberWechat:remove']"
|
||||
>删除</el-button>
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['ums:memberWechat:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['ums:memberWechat:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改用户微信信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
|
||||
<el-form-item label="MEMBER_ID" prop="memberId">
|
||||
<el-input v-model="form.memberId" placeholder="请输入MEMBER_ID" />
|
||||
@ -211,27 +165,39 @@
|
||||
<el-input v-model="form.refreshToken" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="过期时间" prop="expireTime">
|
||||
<el-date-picker clearable size="small"
|
||||
<el-date-picker
|
||||
clearable
|
||||
size="small"
|
||||
v-model="form.expireTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-ddTHH:mm:ss"
|
||||
placeholder="选择过期时间">
|
||||
placeholder="选择过期时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUmsMemberWechat, getUmsMemberWechat, delUmsMemberWechat, addUmsMemberWechat, updateUmsMemberWechat, exportUmsMemberWechat } from "@/api/ums/memberWechat";
|
||||
import {
|
||||
listUmsMemberWechat,
|
||||
getUmsMemberWechat,
|
||||
delUmsMemberWechat,
|
||||
addUmsMemberWechat,
|
||||
updateUmsMemberWechat,
|
||||
exportUmsMemberWechat
|
||||
} from '@/api/ums/memberWechat';
|
||||
|
||||
export default {
|
||||
name: "UmsMemberWechat",
|
||||
name: 'UmsMemberWechat',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -251,7 +217,7 @@ export default {
|
||||
// 用户微信信息表格数据
|
||||
umsMemberWechatList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -270,13 +236,12 @@ export default {
|
||||
accessToken: null,
|
||||
expiresIn: null,
|
||||
refreshToken: null,
|
||||
expireTime: null,
|
||||
expireTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
rules: {},
|
||||
showMoreCondition: false
|
||||
};
|
||||
},
|
||||
@ -290,8 +255,8 @@ export default {
|
||||
const { pageNum, pageSize } = this.queryParams;
|
||||
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
|
||||
const pageReq = { page: pageNum - 1, size: pageSize };
|
||||
listUmsMemberWechat(query, pageReq).then(response => {
|
||||
const { content, totalElements } = response
|
||||
listUmsMemberWechat(query, pageReq).then((response) => {
|
||||
const { content, totalElements } = response;
|
||||
this.umsMemberWechatList = content;
|
||||
this.total = totalElements;
|
||||
this.loading = false;
|
||||
@ -324,7 +289,7 @@ export default {
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -333,44 +298,44 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加用户微信信息";
|
||||
this.title = '添加用户微信信息';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getUmsMemberWechat(id).then(response => {
|
||||
const id = row.id || this.ids;
|
||||
getUmsMemberWechat(id).then((response) => {
|
||||
this.form = response;
|
||||
this.open = true;
|
||||
this.title = "修改用户微信信息";
|
||||
this.title = '修改用户微信信息';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateUmsMemberWechat(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
updateUmsMemberWechat(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUmsMemberWechat(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
addUmsMemberWechat(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@ -381,23 +346,31 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除用户微信信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal
|
||||
.confirm('是否确认删除用户微信信息编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delUmsMemberWechat(ids);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$modal.confirm('是否确认导出所有用户微信信息数据项?').then(() => {
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有用户微信信息数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportUmsMemberWechat(queryParams);
|
||||
}).then(response => {
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.download(response);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|