Merge branch 'dev' into build
This commit is contained in:
@@ -10,16 +10,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.userName" clearable
|
<el-input size="small" placeholder="请输入居民名称或真实姓名" v-model="search.userName" clearable
|
||||||
@clear="page.current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
|
@clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
|
||||||
v-throttle="() => {(page.current = 1), getTableData();}"/>
|
v-throttle="() => {(current = 1), getTableData();}"/>
|
||||||
<ai-download :instance="instance" url="`/app/appintegraluser/girdIntegralExport" :params="search" fileName="网格员积分"
|
<ai-download :instance="instance" url="`/app/appintegraluser/girdIntegralExport" :params="search" fileName="网格员积分"
|
||||||
:disabled="tableData.length == 0">
|
:disabled="tableData.length == 0">
|
||||||
<el-button size="small">导出</el-button>
|
<el-button size="small">导出</el-button>
|
||||||
</ai-download>
|
</ai-download>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
|
<ai-table :tableData="tableData" :total="page.total" :current.sync="current" :size.sync="page.size"
|
||||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
@getList="getTableData()" :col-configs="colConfigs" :dict="dict">
|
||||||
<el-table-column slot="integral" label="积分余额" align="center" :sortable="'custom'">
|
<el-table-column slot="integral" label="积分余额" align="center" :sortable="'custom'">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<span>{{ row.integral }}</span>
|
<span>{{ row.integral }}</span>
|
||||||
@@ -100,9 +100,9 @@ export default {
|
|||||||
size: 10,
|
size: 10,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
page: {current: 1, size: 10, total: 0},
|
page: {size: 10, total: 0},
|
||||||
|
current: 1,
|
||||||
girdList: [],
|
girdList: [],
|
||||||
|
|
||||||
form: {
|
form: {
|
||||||
ids: [],
|
ids: [],
|
||||||
eventDesc: "",
|
eventDesc: "",
|
||||||
@@ -153,6 +153,7 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
...this.page,
|
...this.page,
|
||||||
...this.search,
|
...this.search,
|
||||||
|
current: this.current
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res?.data) {
|
if(res?.data) {
|
||||||
|
|||||||
@@ -6,41 +6,77 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
<el-button
|
||||||
<el-cascader size="small" v-model="search.eventType" :options="rulesOpsList" placeholder="请选择事件/类型" clearable
|
type="primary"
|
||||||
:props="rulesProps" @change="handleTypeSearch" ref="eventTypeSearch" />
|
icon="iconfont iconAdd"
|
||||||
|
@click="dialog = true"
|
||||||
|
>添加</el-button
|
||||||
|
>
|
||||||
|
<el-cascader
|
||||||
|
size="small"
|
||||||
|
v-model="search.systemRuleId"
|
||||||
|
:options="rulesOps"
|
||||||
|
placeholder="请选择事件/类型"
|
||||||
|
clearable
|
||||||
|
:props="rulesProps"
|
||||||
|
@change="handleTypeSearch"
|
||||||
|
ref="eventTypeSearch"
|
||||||
|
/>
|
||||||
<ai-select
|
<ai-select
|
||||||
v-model="search.status"
|
v-model="search.status"
|
||||||
@change="page.current = 1, getList()"
|
@change="(page.current = 1), getList()"
|
||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
:selectList="$dict.getDict('integralRuleStatus')">
|
:selectList="$dict.getDict('integralRuleStatus')"
|
||||||
|
>
|
||||||
</ai-select>
|
</ai-select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table
|
<ai-table
|
||||||
:tableData="tableData"
|
:tableData="tableData"
|
||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="page.total" :dict="dict"
|
:total="page.total"
|
||||||
:current.sync="page.current"
|
:dict="dict"
|
||||||
:size.sync="page.size"
|
:current.sync="page.current"
|
||||||
@getList="getList">
|
:size.sync="page.size"
|
||||||
|
@getList="getList()"
|
||||||
|
>
|
||||||
<el-table-column slot="integral" label="分值" align="center">
|
<el-table-column slot="integral" label="分值" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<span
|
<span v-if="row.integralValueType == 1">
|
||||||
v-if="row.integralValueType == 1">
|
{{
|
||||||
{{ row.integralStart > 0 ? '+' + row.integralStart : row.integralStart }} ~ {{ row.integralEnd > 0 ? '+' + row.integralEnd : row.integralEnd }}
|
row.integralStart > 0
|
||||||
</span>
|
? "+" + row.integralStart
|
||||||
<span v-else>{{ row.integral > 0 ? '+' : '' }}{{ row.integral }}</span>
|
: row.integralStart
|
||||||
|
}}
|
||||||
|
~
|
||||||
|
{{
|
||||||
|
row.integralEnd > 0 ? "+" + row.integralEnd : row.integralEnd
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span v-else
|
||||||
|
>{{ row.integral > 0 ? "+" : "" }}{{ row.integral }}</span
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="200">
|
<el-table-column
|
||||||
|
slot="options"
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
fixed="right"
|
||||||
|
width="200"
|
||||||
|
>
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="changeStatus(row.id, 0)" v-if="row.status == 1">
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="changeStatus(row.id, 0)"
|
||||||
|
v-if="row.status == 1"
|
||||||
|
>
|
||||||
停用
|
停用
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" @click="changeStatus(row.id, 1)" v-else>启用</el-button>
|
<el-button type="text" @click="changeStatus(row.id, 1)" v-else
|
||||||
|
>启用</el-button
|
||||||
|
>
|
||||||
<el-button type="text" @click="toEdit(row)">编辑</el-button>
|
<el-button type="text" @click="toEdit(row)">编辑</el-button>
|
||||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,23 +86,40 @@
|
|||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
<!-- <ai-empty v-else>暂无应用权限</ai-empty> -->
|
<!-- <ai-empty v-else>暂无应用权限</ai-empty> -->
|
||||||
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="form={ }" width="900px" >
|
<ai-dialog
|
||||||
|
:title="dialogTitle"
|
||||||
|
:visible.sync="dialog"
|
||||||
|
@onConfirm="onConfirm"
|
||||||
|
@closed="closed"
|
||||||
|
width="900px"
|
||||||
|
>
|
||||||
<div class="form_div">
|
<div class="form_div">
|
||||||
<el-form ref="DialogForm" :model="form" :rules="formRules" size="small" label-suffix=":" label-width="150px">
|
<el-form
|
||||||
<el-form-item label="规则类型" prop="rulueType" :rules="[{required: true, message: '请选择规则类型', trigger: 'change'}]">
|
ref="DialogForm"
|
||||||
<el-radio-group v-model="rulueType">
|
:model="form"
|
||||||
<el-radio label="0">系统规则</el-radio>
|
:rules="formRules"
|
||||||
<el-radio label="1">自定义规则</el-radio>
|
size="small"
|
||||||
</el-radio-group>
|
label-suffix=":"
|
||||||
</el-form-item>
|
label-width="150px"
|
||||||
|
>
|
||||||
<el-form-item label="事件类型" prop="systemRuleId">
|
<el-form-item label="事件类型" prop="systemRuleId">
|
||||||
<el-cascader v-model="form.systemRuleId" :props="etOps" clearable placeholder="请选择" @change="handleTypeForm"
|
<el-cascader
|
||||||
:options="rulesOps"/>
|
v-model="form.systemRuleId"
|
||||||
|
ref="cascaderArr"
|
||||||
|
:props="etOps"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="handleTypeForm"
|
||||||
|
:options="rulesOps"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="自定义事件" v-if="rulueType == 1">
|
<el-form-item label="自定义事件" v-if="form.systemRuleId == '自定义'">
|
||||||
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model="form.ruleName" clearable/>
|
<el-input
|
||||||
|
placeholder="请输入,周期范围内,不填写表示不限制"
|
||||||
|
v-model="form.ruleName"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="规则">
|
<el-form-item label="规则">
|
||||||
@@ -101,15 +154,22 @@
|
|||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
|
|
||||||
<el-form-item label="周期范围" prop="scoringCycle">
|
<el-form-item label="周期范围" prop="scoringCycle">
|
||||||
<ai-select v-model="form.scoringCycle" :selectList="$dict.getDict('integralRuleScoringCycle')"/>
|
<ai-select
|
||||||
|
v-model="form.scoringCycle"
|
||||||
|
:selectList="$dict.getDict('integralRuleScoringCycle')"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="奖励次数">
|
<el-form-item label="奖励次数">
|
||||||
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/>
|
<el-input
|
||||||
|
placeholder="请输入,周期范围内,不填写表示不限制"
|
||||||
|
v-model.number="form.numberLimit"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="积分分值" prop="integral">
|
<el-form-item label="积分分值" prop="integral">
|
||||||
<el-input placeholder="请输入" v-model="form.integral" clearable/>
|
<el-input placeholder="请输入" v-model="form.integral" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="有效范围" prop="validRangeType" required>
|
<el-form-item label="有效范围" prop="validRangeType" required>
|
||||||
@@ -119,29 +179,50 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="生效网格" :prop="form.validRangeType == 1? 'validRangeData' :''" :rules="[{required: true, message: '请选择生效网格', trigger: 'change'}]" v-if="form.validRangeType == 1">
|
<el-form-item
|
||||||
<el-button type="text" @click="showGrid = true,beforeSelectTree()">请选择</el-button>
|
label="生效网格"
|
||||||
|
:prop="form.validRangeType == 1 ? 'validRangeData' : ''"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '请选择生效网格', trigger: 'change' },
|
||||||
|
]"
|
||||||
|
v-if="form.validRangeType == 1"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
@click="(showGrid = true), beforeSelectTree()"
|
||||||
|
>{{ girdInfoList.length ? "已选择" : "请选择" }}</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" border width="720px" append-to-body>
|
<ai-dialog
|
||||||
|
title="选择网格"
|
||||||
|
:visible.sync="showGrid"
|
||||||
|
:customFooter="true"
|
||||||
|
:destroyOnClose="true"
|
||||||
|
border
|
||||||
|
width="720px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<el-tree
|
<el-tree
|
||||||
:data="treeObj.treeList"
|
:data="treeObj.treeList"
|
||||||
:props="treeObj.defaultProps"
|
:props="treeObj.defaultProps"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
ref="tree"
|
ref="tree"
|
||||||
:check-strictly="true"
|
:check-strictly="true"
|
||||||
show-checkbox
|
show-checkbox
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:default-checked-keys="currCheckedKeys"
|
:default-checked-keys="currCheckedKeys"
|
||||||
@check="onCheckChange">
|
@check="onCheckChange"
|
||||||
|
>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-footer" slot="footer">
|
<div class="dialog-footer" slot="footer">
|
||||||
<el-button size="medium" @click="showGrid=false">取消</el-button>
|
<el-button size="medium" @click="showGrid = false">取消</el-button>
|
||||||
<el-button type="primary" size="medium" @click="getCheckedTree()">确认</el-button>
|
<el-button type="primary" size="medium" @click="getCheckedTree()"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
@@ -155,47 +236,89 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
dict: Object,
|
dict: Object,
|
||||||
permissions: Function
|
permissions: Function,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
search: {status: "", eventType: null},
|
search: {
|
||||||
page: {current: 1, size: 10, total: 0},
|
status: "",
|
||||||
|
systemRuleId: "",
|
||||||
|
},
|
||||||
|
page: { current: 1, size: 10, total: 0 },
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{prop: "event", label: "事件", dict: "integralRuleEvent"},
|
{
|
||||||
{prop: "type", label: "类型", dict: "integralRuleEventType"},
|
prop: "parentRuleName",
|
||||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
label: "类型",
|
||||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
dict: "integralRuleEventType",
|
||||||
{slot: "integral",label: "积分分值", align: "center"},
|
},
|
||||||
{prop: "validRangeType", label: "有效范围", dict: "integralRuleScoringCycle"},
|
{ prop: "ruleName", label: "事件", dict: "integralRuleEvent" },
|
||||||
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
{ prop: "ruleType", label: "规则", dict: "integralRuleRuleType" },
|
||||||
{slot: "options", label: "操作", align: "center"},
|
{
|
||||||
|
prop: "scoringCycle",
|
||||||
|
label: "周期范围",
|
||||||
|
dict: "integralRuleScoringCycle",
|
||||||
|
render: (h, { row }) => {
|
||||||
|
return h(
|
||||||
|
"span",
|
||||||
|
{},
|
||||||
|
row.numberLimit.length
|
||||||
|
? $dict.getLabel("integralRuleScoringCycle", row.scoringCycle)
|
||||||
|
: $dict.getLabel("integralRuleScoringCycle", row.scoringCycle) +
|
||||||
|
row.numberLimit +
|
||||||
|
"次"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ slot: "integral", label: "积分分值", align: "center" },
|
||||||
|
{
|
||||||
|
prop: "validRangeType",
|
||||||
|
label: "有效范围",
|
||||||
|
formart: (v) => (v == 0 ? "全局" : "指定网格"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "status",
|
||||||
|
label: "状态",
|
||||||
|
align: "center",
|
||||||
|
width: 96,
|
||||||
|
dict: "integralRuleStatus",
|
||||||
|
},
|
||||||
|
{ slot: "options", label: "操作", align: "center" },
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
dialog: false,
|
dialog: false,
|
||||||
form: {
|
form: {
|
||||||
systemRuleId: '',
|
ruleType: "0",
|
||||||
ruleName: '',
|
systemRuleId: "",
|
||||||
scoringCycle: '',
|
ruleName: "",
|
||||||
numberLimit: '',
|
scoringCycle: "",
|
||||||
integral: '',
|
numberLimit: "",
|
||||||
validRangeType: '0',
|
integral: "",
|
||||||
validRangeData: ''
|
validRangeType: "0",
|
||||||
|
validRangeData: "",
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
systemRuleId: [{required: true, message: "请选择事件/类型", trigger: "change"}],
|
systemRuleId: [
|
||||||
scoringCycle: [{required: true, message: "请选择周期范围", trigger: "change"}],
|
{ required: true, message: "请选择事件/类型", trigger: "change" },
|
||||||
// numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}],
|
],
|
||||||
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
|
scoringCycle: [
|
||||||
validRangeType: [{required: true, message: "请选择有效范围", trigger: "change"}],
|
{ required: true, message: "请选择周期范围", trigger: "change" },
|
||||||
// validRangeData: [{required: true, message: "请选择生效网格", trigger: "change"}],
|
],
|
||||||
|
integral: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
pattern: /^\d*[.\d]\d?$/,
|
||||||
|
message: "请输入积分分值,最多保留一位小数",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
validRangeType: [
|
||||||
|
{ required: true, message: "请选择有效范围", trigger: "change" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
rulesOps: [],
|
rulesOps: [],
|
||||||
rulesOpsList: [],
|
|
||||||
rulesProps: {
|
rulesProps: {
|
||||||
label: "ruleName",
|
label: "ruleName",
|
||||||
value: "id",
|
value: "id",
|
||||||
checkStrictly:true,
|
checkStrictly: true,
|
||||||
},
|
},
|
||||||
radio: 0,
|
radio: 0,
|
||||||
showGrid: false,
|
showGrid: false,
|
||||||
@@ -209,144 +332,164 @@ export default {
|
|||||||
},
|
},
|
||||||
girdInfoList: [],
|
girdInfoList: [],
|
||||||
currCheckedKeys: [],
|
currCheckedKeys: [],
|
||||||
rulueType: '0',
|
rulueType: "0",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType').then(() => {
|
this.$dict
|
||||||
this.getList()
|
.load(
|
||||||
this.getRulesList()
|
"integralRuleStatus",
|
||||||
this.beforeSelectTree()
|
"integralRuleRuleType",
|
||||||
});
|
"integralRuleScoringCycle",
|
||||||
|
"integralRuleEvent",
|
||||||
|
"integralRuleEventType"
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.getRulesList();
|
||||||
|
this.beforeSelectTree();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.instance.post(`/app/appintegralrule/list`, null, {
|
this.instance
|
||||||
params: {...this.search, ...this.page},
|
.post(`/app/appintegralrule/list`, null, {
|
||||||
}).then(res => {
|
params: {
|
||||||
if (res?.data) {
|
...this.search,
|
||||||
this.tableData = res.data.records;
|
...this.page,
|
||||||
this.page.total = res.data.total;
|
},
|
||||||
}
|
})
|
||||||
});
|
.then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.tableData = res.data.records;
|
||||||
|
this.page.total = res.data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
closed() {
|
||||||
|
this.form = {
|
||||||
|
ruleType: "0",
|
||||||
|
systemRuleId: "",
|
||||||
|
ruleName: "",
|
||||||
|
scoringCycle: "",
|
||||||
|
numberLimit: "",
|
||||||
|
integral: "",
|
||||||
|
validRangeType: "0",
|
||||||
|
validRangeData: "",
|
||||||
|
};
|
||||||
},
|
},
|
||||||
toEdit(row) {
|
toEdit(row) {
|
||||||
this.form = this.$copy(row)
|
this.form = this.$copy(row);
|
||||||
let {ladderRule, event, type} = this.form,
|
this.girdInfoList = this.form?.validRangeData?.split(",");
|
||||||
dict = 'integralRuleEvent' + event
|
this.$nextTick(() => {
|
||||||
this.$dict.load(dict).then(() => {
|
this.dialog = true;
|
||||||
this.form.eventType = [event, type]
|
});
|
||||||
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
|
||||||
this.cacheOps = this.$dict.getDict('integralRuleEvent').map(e => {
|
|
||||||
if (e.dictValue == event) {
|
|
||||||
e.children = this.$dict.getDict(dict).map(d => ({...d, leaf: true}))
|
|
||||||
}
|
|
||||||
return e
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.dialog = true
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
remove(id) {
|
remove(id) {
|
||||||
this.$confirm("删除后不可恢复,是否要删除该事项?", {
|
this.$confirm("删除后不可恢复,是否要删除该事项?", {
|
||||||
type: 'error'
|
type: "error",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.instance.post(`/app/appintegralrule/delete?ids=${id}`).then((res) => {
|
this.instance
|
||||||
if (res.code == 0) {
|
.post(`/app/appintegralrule/delete?ids=${id}`)
|
||||||
this.$message.success("删除成功!")
|
.then((res) => {
|
||||||
this.getList();
|
if (res.code == 0) {
|
||||||
}
|
this.$message.success("删除成功!");
|
||||||
});
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
changeStatus(id, status) {
|
changeStatus(id, status) {
|
||||||
let text = status == 1 ? '启用' : '停用'
|
let text = status == 1 ? "启用" : "停用";
|
||||||
this.$confirm(`确定${text}该条规则?`).then(() => {
|
this.$confirm(`确定${text}该条规则?`).then(() => {
|
||||||
this.instance.post(`/app/appintegralrule/enableStatus?id=${id}`).then((res) => {
|
this.instance
|
||||||
if (res.code == 0) {
|
.post(`/app/appintegralrule/enableStatus?id=${id}`)
|
||||||
this.$message.success(`${text}成功!`)
|
.then((res) => {
|
||||||
this.getList();
|
if (res.code == 0) {
|
||||||
}
|
this.$message.success(`${text}成功!`);
|
||||||
});
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onReset() {
|
onReset() {
|
||||||
this.page.current = 1
|
this.page.current = 1;
|
||||||
this.search.classification = ""
|
this.search.classification = "";
|
||||||
this.search.integralType = ""
|
this.search.integralType = "";
|
||||||
this.search.ruleStatus = ""
|
this.search.ruleStatus = "";
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
onConfirm() {
|
onConfirm() {
|
||||||
if(this.form.ruleType==1 && !this.form.ladderRule.length) {
|
// if(this.form.ruleType==1 && !this.form.ladderRule.length) {
|
||||||
return this.$message.error('请添加规则')
|
// return this.$message.error('请添加规则')
|
||||||
}
|
// }
|
||||||
this.$refs.DialogForm.validate((valid) => {
|
this.$refs.DialogForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let formData = this.$copy(this.form)
|
let formData = this.$copy(this.form);
|
||||||
formData.ladderRule = JSON.stringify(formData.ladderRule)
|
// formData.ladderRule = JSON.stringify(formData.ladderRule)
|
||||||
formData.integral = formData.integral || 0
|
formData.integral = formData.integral || 0;
|
||||||
this.instance.post(`/app/appintegralrule/addOrUpdate`, formData).then((res) => {
|
this.instance
|
||||||
if (res.code == 0) {
|
.post(`/app/appintegralrule/addOrUpdate`, formData)
|
||||||
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
.then((res) => {
|
||||||
this.onReset()
|
if (res.code == 0) {
|
||||||
this.dialog = false;
|
this.$message.success(
|
||||||
}
|
`${this.isEdit ? "编辑成功" : "添加成功"}`
|
||||||
});
|
);
|
||||||
|
this.onReset();
|
||||||
|
this.dialog = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleTypeSearch(v) {
|
handleTypeSearch(v) {
|
||||||
this.search.event = v?.[0]
|
this.search.systemRuleId = v?.[v.length - 1];
|
||||||
this.search.type = v?.[1]
|
this.page.current = 1;
|
||||||
this.page.current = 1
|
this.$refs.eventTypeSearch.dropDownVisible = false;
|
||||||
this.$refs.eventTypeSearch.dropDownVisible = false
|
this.getList();
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
handleTypeForm(v) {
|
handleTypeForm(v) {
|
||||||
if (this.dialog) {
|
if (this.dialog) {
|
||||||
// this.form.event = v?.[0]
|
this.form.systemRuleId = v?.[v.length - 1];
|
||||||
this.form.systemRuleId = v?.[v.length - 1]
|
|
||||||
console.log(this.form.systemRuleId);
|
|
||||||
// this.form.ruleType = !this.form.event ? null : this.form.event == 3 ? 1 : 0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDelete(i) {
|
handleDelete(i) {
|
||||||
this.$confirm("是否要删除该规则?").then(() => {
|
this.$confirm("是否要删除该规则?")
|
||||||
this.form.ladderRule.splice(i, 1)
|
.then(() => {
|
||||||
}).catch(() => 0)
|
this.form.ladderRule.splice(i, 1);
|
||||||
|
})
|
||||||
|
.catch(() => 0);
|
||||||
},
|
},
|
||||||
checkIntegral(v) {
|
checkIntegral(v) {
|
||||||
return /\.\d{2,}$/.test(v) ? Math.abs(v).toFixed(1) : Math.abs(v)
|
return /\.\d{2,}$/.test(v) ? Math.abs(v).toFixed(1) : Math.abs(v);
|
||||||
},
|
},
|
||||||
getRulesList() {
|
getRulesList() {
|
||||||
this.instance.post(`/app/appintegralsystemrule/list?current=1&sizes=3000`).then(res=> {
|
this.instance
|
||||||
if(res?.data) {
|
.post(`/app/appintegralsystemrule/list?current=1&sizes=3000`)
|
||||||
this.rulesOps = this.toTree(res.data.records)
|
.then((res) => {
|
||||||
this.rulesOpsList = this.rulesOps
|
if (res?.data) {
|
||||||
this.rulesOpsList.push({
|
this.rulesOps = this.toTree(res.data.records);
|
||||||
ruleName: '自定义',
|
this.rulesOps.push({
|
||||||
id: '自定义'
|
ruleName: "自定义",
|
||||||
})
|
id: "自定义",
|
||||||
}
|
});
|
||||||
})
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 转树形结构
|
// 转树形结构
|
||||||
toTree(data) {
|
toTree(data) {
|
||||||
let result = [];
|
let result = [];
|
||||||
if (!Array.isArray(data)) {
|
if (!Array.isArray(data)) {
|
||||||
return result
|
return result;
|
||||||
}
|
}
|
||||||
let map = {};
|
let map = {};
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
map[item.id] = item;
|
map[item.id] = item;
|
||||||
});
|
});
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
let parent = map[item.parentRuleId];
|
let parent = map[item.parentRuleId];
|
||||||
console.log(parent);
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
(parent.children || (parent.children = [])).push(item);
|
(parent.children || (parent.children = [])).push(item);
|
||||||
} else {
|
} else {
|
||||||
@@ -359,13 +502,13 @@ export default {
|
|||||||
girdToTree(data) {
|
girdToTree(data) {
|
||||||
let result = [];
|
let result = [];
|
||||||
if (!Array.isArray(data)) {
|
if (!Array.isArray(data)) {
|
||||||
return result
|
return result;
|
||||||
}
|
}
|
||||||
let map = {};
|
let map = {};
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
map[item.id] = item;
|
map[item.id] = item;
|
||||||
});
|
});
|
||||||
data.forEach(item => {
|
data.forEach((item) => {
|
||||||
let parent = map[item.parentGirdId];
|
let parent = map[item.parentGirdId];
|
||||||
if (parent) {
|
if (parent) {
|
||||||
(parent.children || (parent.children = [])).push(item);
|
(parent.children || (parent.children = [])).push(item);
|
||||||
@@ -378,58 +521,77 @@ export default {
|
|||||||
|
|
||||||
getCheckedTree() {
|
getCheckedTree() {
|
||||||
if (!this.$refs.tree.getCheckedNodes().length) {
|
if (!this.$refs.tree.getCheckedNodes().length) {
|
||||||
return this.$message.error('请选择网格')
|
return this.$message.error("请选择网格");
|
||||||
}
|
}
|
||||||
|
console.log(this.girdInfoList, this.$refs.tree.getCheckedNodes());
|
||||||
this.$set(this.girdInfoList, this.currIndex, {
|
this.girdInfoList = this.$refs.tree.getCheckedNodes().map((item) => {
|
||||||
...this.$refs.tree.getCheckedNodes(),
|
return { ...item, checkType: true };
|
||||||
checkType: true
|
});
|
||||||
})
|
// this.$set(this.girdInfoList, this.currIndex, {
|
||||||
|
// ...this.$refs.tree.getCheckedNodes(),
|
||||||
// this.girdInfoList = this.$refs.tree.getCheckedNodes()
|
// checkType: true
|
||||||
|
// })
|
||||||
|
this.form.validRangeData = this.$refs.tree
|
||||||
|
.getCheckedNodes()
|
||||||
|
.map((e) => e.id)
|
||||||
|
.toString();
|
||||||
this.showGrid = false;
|
this.showGrid = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeSelectTree() {
|
beforeSelectTree() {
|
||||||
this.treeObj.checkedKeys = [];
|
this.treeObj.checkedKeys = [];
|
||||||
this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
|
this.instance
|
||||||
if (res.code == 0) {
|
.post(`/app/appgirdinfo/listAll3`, null, null)
|
||||||
this.treeObj.treeList = this.girdToTree(res.data)
|
.then((res) => {
|
||||||
this.girdInfoList.map((e) => {
|
if (res.code == 0) {
|
||||||
this.treeObj.checkedKeys.push(e.id);
|
// res.data.forEach((item)=>{
|
||||||
});
|
// const isChecked= this.girdInfoList.find((checkedId)=>{
|
||||||
}
|
// return item.id===checkedId
|
||||||
});
|
// })
|
||||||
|
|
||||||
|
// if(isChecked) item.checkType=true
|
||||||
|
// })
|
||||||
|
// console.log(res.data)
|
||||||
|
|
||||||
|
this.treeObj.treeList = this.girdToTree(res.data);
|
||||||
|
this.girdInfoList.map((e) => {
|
||||||
|
this.treeObj.checkedKeys.push(e.id);
|
||||||
|
});
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.currCheckedKeys = this.girdInfoList;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.tree?.setCheckedKeys(this.currCheckedKeys);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onCheckChange(e) {
|
onCheckChange(e) {
|
||||||
this.$refs.tree.setChecked(e.id, true)
|
this.$refs.tree.setChecked(e.id, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isEdit() {
|
isEdit() {
|
||||||
return !!this.form.id
|
return !!this.form.id;
|
||||||
},
|
},
|
||||||
dialogTitle() {
|
dialogTitle() {
|
||||||
return this.isEdit ? "编辑积分规则" : "添加积分规则"
|
return this.isEdit ? "编辑积分规则" : "添加积分规则";
|
||||||
},
|
},
|
||||||
etOps() {
|
etOps() {
|
||||||
return {
|
return {
|
||||||
value: "id",
|
value: "id",
|
||||||
label: "ruleName",
|
label: "ruleName",
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
// currCheckedKeys() {
|
// currCheckedKeys() {
|
||||||
// if (this.girdInfoList && this.girdInfoList[this.currIndex] && this.girdInfoList[this.currIndex].id) {
|
// if (this.girdInfoList) {
|
||||||
// return [this.girdInfoList[this.currIndex].id]
|
// return this.girdInfoList
|
||||||
// }
|
// }
|
||||||
// return []
|
// return []
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
|
};
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<template #left>
|
<template #left>
|
||||||
<el-cascader ref="cascader2" v-model="search.girdId" :options="girdOptions" placeholder="所属网格" size="small"
|
<el-cascader ref="cascader2" v-model="search.girdId" :options="girdOptions" placeholder="所属网格" size="small"
|
||||||
:props="defaultProps" :show-all-levels="false" clearable @change="gridChangeOpt"></el-cascader>
|
:props="defaultProps" :show-all-levels="false" clearable @change="gridChangeOpt"></el-cascader>
|
||||||
<ai-select v-model="search.integralType" placeholder="请选择类型" @change="page.current=1, getTableData()"
|
<ai-select v-model="search.integralType" placeholder="请选择类型" @change="current=1, getTableData()"
|
||||||
:selectList="dict.getDict('integralType')"/>
|
:selectList="dict.getDict('integralType')"/>
|
||||||
<el-date-picker v-model="time" size="small" type="daterange" value-format="yyyy-MM-dd"
|
<el-date-picker v-model="time" size="small" type="daterange" value-format="yyyy-MM-dd"
|
||||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="onChange">
|
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="onChange">
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<el-input size="small" placeholder="请输入姓名" v-model="search.userName" clearable
|
<el-input size="small" placeholder="请输入姓名" v-model="search.userName" clearable
|
||||||
@clear="page.current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
|
@clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
|
||||||
v-throttle="() => {(page.current = 1), getTableData();}" />
|
v-throttle="() => {(current = 1), getTableData();}" />
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
|
<ai-table :tableData="tableData" :total="page.total" :current.sync="current" :size.sync="page.size"
|
||||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
|
||||||
<el-table-column slot="changeIntegral" label="积分变动" align="center">
|
<el-table-column slot="changeIntegral" label="积分变动" align="center">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
@@ -140,7 +140,12 @@ export default {
|
|||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
},
|
},
|
||||||
page: {current: 1, size: 10,total: 0,},
|
page: {
|
||||||
|
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
current: 1,
|
||||||
girdList: [],
|
girdList: [],
|
||||||
time: [],
|
time: [],
|
||||||
timeCheck: ['昨日','近7天','近30天','自定义'],
|
timeCheck: ['昨日','近7天','近30天','自定义'],
|
||||||
@@ -162,7 +167,9 @@ export default {
|
|||||||
fileDownLoad: [],
|
fileDownLoad: [],
|
||||||
userSortListX: [],
|
userSortListX: [],
|
||||||
userSortListY: [],
|
userSortListY: [],
|
||||||
girdSortListX: [],
|
girdSortListX: [
|
||||||
|
|
||||||
|
],
|
||||||
girdSortListY: [],
|
girdSortListY: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -174,13 +181,6 @@ export default {
|
|||||||
{ prop: "girdName", label: '所属网格', align: "center", width: "180px" },
|
{ prop: "girdName", label: '所属网格', align: "center", width: "180px" },
|
||||||
{ prop: "eventDesc", label: '事件', align: "center",width: "200px" },
|
{ prop: "eventDesc", label: '事件', align: "center",width: "200px" },
|
||||||
{ prop: "integralType", label: '类型', align: "center",width: "200px", dict:"integralType" },
|
{ prop: "integralType", label: '类型', align: "center",width: "200px", dict:"integralType" },
|
||||||
// render: (h, {row}) => {
|
|
||||||
// return h('span', {
|
|
||||||
// style: {
|
|
||||||
// // color: row.status === '0' ? 'red' : '#333'
|
|
||||||
// }
|
|
||||||
// }, (row.integralCalcType == '0' ? `- ${row.integralCalcType}` : `+ ${row.integralCalcType}`))
|
|
||||||
// } },
|
|
||||||
{ slot: "changeIntegral", label: '积分变动', align: "center", },
|
{ slot: "changeIntegral", label: '积分变动', align: "center", },
|
||||||
{ prop: "nowIntegral", label: '剩余积分', align: "center", },
|
{ prop: "nowIntegral", label: '剩余积分', align: "center", },
|
||||||
{ prop: "createTime", label: '时间', align: "center", },
|
{ prop: "createTime", label: '时间', align: "center", },
|
||||||
@@ -227,18 +227,57 @@ export default {
|
|||||||
this.userSortListX = res.data.userSortList.map(e=> e.userName).reverse()
|
this.userSortListX = res.data.userSortList.map(e=> e.userName).reverse()
|
||||||
this.userSortListY = res.data.userSortList.map(e=> e.changeIntegral).reverse()
|
this.userSortListY = res.data.userSortList.map(e=> e.changeIntegral).reverse()
|
||||||
this.girdSortListX = res.data.girdSortList.map(e=> e.girdName).reverse()
|
this.girdSortListX = res.data.girdSortList.map(e=> e.girdName).reverse()
|
||||||
|
// this.girdSortListX = ['好家伙规定非官方多喝点黑胡椒发布会','好好发挥或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或或']
|
||||||
this.girdSortListY = res.data.girdSortList.map(e=> e.changeIntegral).reverse()
|
this.girdSortListY = res.data.girdSortList.map(e=> e.changeIntegral).reverse()
|
||||||
this.getColEcherts1(this.userSortListX,this.userSortListY)
|
this.getColEcherts1(this.userSortListX,this.userSortListY)
|
||||||
this.getColEcherts2(this.girdSortListX,this.girdSortListY)
|
this.getColEcherts2(this.girdSortListX,this.girdSortListY)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// extension(chart){
|
||||||
|
// //判断是否创建过div框,如果创建过就不再创建了
|
||||||
|
// //该div用来盛放文本显示内容的,方便对其悬浮位置进行处理
|
||||||
|
// var id = document.getElementById("extension");
|
||||||
|
// if(!id) {
|
||||||
|
// var div = "<div id = 'extension' sytle=\"display:block\"></div>";
|
||||||
|
// document.documentElement.append(div);
|
||||||
|
// }
|
||||||
|
// chart.on('mouseover', function(params) {
|
||||||
|
// //注意这里,我是以Y轴显示内容过长为例,如果是x轴的话,需要改为xAxis
|
||||||
|
// if(params.componentType == "xAxis") {
|
||||||
|
// //设置悬浮文本的位置以及样式
|
||||||
|
// document.getElementById('extension').style.className = "chartCss"
|
||||||
|
// // ({
|
||||||
|
// // "position": "absolute",
|
||||||
|
// // "color": "black",
|
||||||
|
// // "background":"white",
|
||||||
|
// // "font-family": "Arial",
|
||||||
|
// // "font-size": "12px",
|
||||||
|
// // "padding": "5px",
|
||||||
|
// // "display": "inline"
|
||||||
|
// // })
|
||||||
|
// // .text(params.value);
|
||||||
|
// document.documentElement.mousemove(function(event) {
|
||||||
|
// var xx = event.pageX - 10;
|
||||||
|
// var yy = event.pageY + 15;
|
||||||
|
// document.getElementById('extension').css('top', yy).style('left', xx);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// chart.on('mouseout', function(params) {
|
||||||
|
// //注意这里,我是以Y轴显示内容过长为例,如果是x轴的话,需要改为xAxis
|
||||||
|
// if(params.componentType == "yAxis") {
|
||||||
|
// document.getElementById('extension').style('display', 'none');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// },
|
||||||
// 积分明细
|
// 积分明细
|
||||||
getTableData() {
|
getTableData() {
|
||||||
this.instance.post('/app/appintegraluser/girdIntegralDetail',null,{
|
this.instance.post('/app/appintegraluser/girdIntegralDetail',null,{
|
||||||
params: {
|
params: {
|
||||||
...this.page,
|
...this.page,
|
||||||
...this.search,
|
...this.search,
|
||||||
|
current: this.current
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res?.data) {
|
if(res?.data) {
|
||||||
@@ -380,6 +419,7 @@ export default {
|
|||||||
]
|
]
|
||||||
}, true);
|
}, true);
|
||||||
window.addEventListener("resize", this.onResize2)
|
window.addEventListener("resize", this.onResize2)
|
||||||
|
// this.extension(this.myChart2)
|
||||||
},
|
},
|
||||||
onResize1() {
|
onResize1() {
|
||||||
this.myChart1.resize()
|
this.myChart1.resize()
|
||||||
@@ -591,6 +631,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chartCss {
|
||||||
|
position: absolute;
|
||||||
|
color: black;
|
||||||
|
background:white;
|
||||||
|
font-family: Aril;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 5px;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .el-dialog__footer {
|
::v-deep .el-dialog__footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user