|
@@ -85,15 +85,16 @@
|
|
|
<template v-else-if="['prepayMoney','amount','amountReceivable','amountReceived','cardBalance','coinMoney','discountAmount','discountMoney'].includes(field.prop)">
|
|
<template v-else-if="['prepayMoney','amount','amountReceivable','amountReceived','cardBalance','coinMoney','discountAmount','discountMoney'].includes(field.prop)">
|
|
|
{{ u.fmt.fmtMoney(row[field.prop]) }}
|
|
{{ u.fmt.fmtMoney(row[field.prop]) }}
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else-if="field.prop==='idleRemainTime'||field.prop==='operationRemainTime'">
|
|
|
|
|
- {{ u.fmt.fmtDuration(row[field.prop]) }}
|
|
|
|
|
|
|
+ <template v-else-if="field.prop==='delete'">
|
|
|
|
|
+ <ext-d-label type="Common.status" :model-value="row[field.prop]?2:1"></ext-d-label>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="['createTime','updateTime'].includes(field.prop)">
|
|
<template v-else-if="['createTime','updateTime'].includes(field.prop)">
|
|
|
{{ u.fmt.fmtDateTime(row[field.prop]) }}
|
|
{{ u.fmt.fmtDateTime(row[field.prop]) }}
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="field.prop==='action'">
|
|
<template v-else-if="field.prop==='action'">
|
|
|
- <el-button v-auth="'config.modify'" type="warning" size="small" text @click="handleRowClick('edit',row)"> 编辑</el-button>
|
|
|
|
|
- <el-button v-auth="'config.remove'" type="danger" size="small" text @click="handleRowDelete(row)"> 禁用</el-button>
|
|
|
|
|
|
|
+ <el-button v-auth="'config.modify'" type="warning" size="default" text @click="handleRowClick('edit',row)"> 编辑</el-button>
|
|
|
|
|
+ <el-button v-auth="'config.remove'" v-if="row.delete" type="success" size="default" text @click="handleRowDelete(row)"> 启用</el-button>
|
|
|
|
|
+ <el-button v-auth="'config.remove'" v-if="!row.delete" type="danger" size="default" text @click="handleRowDelete(row)"> 禁用</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<div>{{ row[field.prop] }}</div>
|
|
<div>{{ row[field.prop] }}</div>
|
|
@@ -103,7 +104,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
-<!-- <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
|
|
|
|
|
|
|
+ <!-- <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>-->
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
<ConfigDialog ref="configDialogRef" @refresh="loadData(true)"/>
|
|
<ConfigDialog ref="configDialogRef" @refresh="loadData(true)"/>
|
|
@@ -111,18 +112,19 @@
|
|
|
|
|
|
|
|
<script setup lang="ts" name="ConfigList">
|
|
<script setup lang="ts" name="ConfigList">
|
|
|
import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
|
|
import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
|
|
|
-import {$body, $get} from "/@/utils/request";
|
|
|
|
|
|
|
+import {$body, $get, $post} from "/@/utils/request";
|
|
|
import u from '/@/utils/u'
|
|
import u from '/@/utils/u'
|
|
|
import {Msg} from "/@/utils/message";
|
|
import {Msg} from "/@/utils/message";
|
|
|
import {Session} from "/@/utils/storage";
|
|
import {Session} from "/@/utils/storage";
|
|
|
|
|
|
|
|
|
|
|
|
|
import ExtPage from '/@/components/form/ExtPage.vue'
|
|
import ExtPage from '/@/components/form/ExtPage.vue'
|
|
|
-import ExtQueryForm from "/@/components/form/ExtAdminQueryForm.vue";
|
|
|
|
|
|
|
+import ExtQueryForm from "/@/components/form/ExtQueryForm.vue";
|
|
|
|
|
|
|
|
import mittBus from '/@/utils/mitt';
|
|
import mittBus from '/@/utils/mitt';
|
|
|
|
|
|
|
|
import {ElButton} from 'element-plus'
|
|
import {ElButton} from 'element-plus'
|
|
|
|
|
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
|
|
|
|
|
|
|
|
|
|
|
|
|
const ConfigDialog = defineAsyncComponent(() => import("/@/views/admin/config/dialog.vue"));
|
|
const ConfigDialog = defineAsyncComponent(() => import("/@/views/admin/config/dialog.vue"));
|
|
@@ -147,9 +149,10 @@ const state = reactive({
|
|
|
importConfig: {},
|
|
importConfig: {},
|
|
|
exportConfig: {},
|
|
exportConfig: {},
|
|
|
columns: [
|
|
columns: [
|
|
|
- {label: '配置key', width: 180, prop: 'key', query: true, type: 'text', resizable: true},
|
|
|
|
|
|
|
+ {label: '配置关键字', width: 180, prop: 'configKey', query: true, type: 'text', resizable: true},
|
|
|
|
|
+ {label: '配置值', width: 280, prop: 'configValue', query: true, type: 'text', resizable: true},
|
|
|
{label: '值类型', width: 180, prop: 'valueType', query: true, type: 'text', resizable: true},
|
|
{label: '值类型', width: 180, prop: 'valueType', query: true, type: 'text', resizable: true},
|
|
|
- {label: '状态', prop: 'status', sortable: 'custom', align: 'center', query: true, type: 'dict', conf: {dict: 'Config.status'}},
|
|
|
|
|
|
|
+ {label: '是否禁用',width: 120, prop: 'delete', sortable: 'custom', align: 'center',type:'bool', query: true},
|
|
|
{label: '备注', width: 180, prop: 'remark', query: true, type: 'text', resizable: true},
|
|
{label: '备注', width: 180, prop: 'remark', query: true, type: 'text', resizable: true},
|
|
|
{label: '创建时间', width: 180, prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
|
|
{label: '创建时间', width: 180, prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
|
|
|
{label: '更新时间', width: 180, prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
|
|
{label: '更新时间', width: 180, prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
|
|
@@ -212,11 +215,13 @@ const handleRowClick = (type: string, row: any) => {
|
|
|
};
|
|
};
|
|
|
// 删除点击
|
|
// 删除点击
|
|
|
const handleRowDelete = (row: any) => {
|
|
const handleRowDelete = (row: any) => {
|
|
|
- Msg.confirm(`此操作将禁用配置项,是否继续?`).then(() => {
|
|
|
|
|
- $get(`/config/remove/${row.id}`).then(() => {
|
|
|
|
|
- Msg.message("操作成功", 'success')
|
|
|
|
|
|
|
+ let label = row.delete ? '启用' : '禁用'
|
|
|
|
|
+ Msg.confirm(`此操作将${label}配置项,是否继续?`).then(() => {
|
|
|
|
|
+ $body(`/config/status`,Object.assign({},row,{delete:!row.delete})).then(() => {
|
|
|
|
|
+ Msg.message(label + "成功", 'success')
|
|
|
|
|
+ loadData(true)
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
- Msg.message("操作失败", 'error')
|
|
|
|
|
|
|
+ Msg.message(label + "失败", 'error')
|
|
|
})
|
|
})
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|