This commit is contained in:
yaosen 2024-07-02 16:35:41 +08:00
parent 65a94c3988
commit 2da265a3c8
8 changed files with 20 additions and 9 deletions

View File

@ -7,6 +7,11 @@
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
<el-table-column align="center" fixed label="ID" width="80" prop="city_id" />
<el-table-column align="center" fixed label="城市" width="220" prop="city_name" />
<el-table-column align="center" label="排序" width="140">
<template #default="scope">
<el-input-number v-model="scope.row.sort" :max="100" :min="0" class="small-input-number" style="width: 110px; height: 36px;" @change="updateSort(scope.row)" />
</template>
</el-table-column>
<el-table-column align="center" width="220" label="操作">
<template #default="scope">
<el-button type="primary" size="small" icon="el-icon-edit" @click="onEdit(scope.row)">编辑</el-button>
@ -22,6 +27,9 @@
<el-form-item label="城市">
<el-input v-model="anchors.city_name" type="text" placeholder="请输入城市" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="anchors.sort" :max="9999" :min="0" controls-position="right" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="onSave"> </el-button>
@ -33,6 +41,9 @@
<el-form-item label="城市">
<el-input v-model="anchors.city_name" type="text" placeholder="请输入城市" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="anchors.sort" :max="9999" :min="0" controls-position="right" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="onSave"> </el-button>
@ -112,13 +123,13 @@ export default {
})
},
updateSort(item) {
this.$axios.post('/admin/qacity/editQaCity', { id: item.id, sort: item.sort }).then(() => {
this.$axios.post('/admin/qacity/editQaCity', { city_id: item.city_id, sort: item.sort }).then(() => {
this.getQaCityList()
}).catch(() => {
})
},
updateStatus(item) {
this.$axios.post('/admin/qacity/editQaCity', { id: item.id, status: item.status }).then(() => {
this.$axios.post('/admin/qacity/editQaCity', { city_id: item.city_id, status: item.status }).then(() => {
this.getQaCityList()
}).catch(() => {
})

View File

@ -16,14 +16,14 @@ class QaCityController extends base
*/
public function getQaCityList(Request $request)
{
$list = QaCitys::paginate($request->get('limit',10));
$list = QaCitys::order('sort desc')->paginate($request->get('limit',10));
return $this->success($list);
}
public function getQaCity(Request $request)
{
$list = QaCitys::order('city_id desc')->select();
$list = QaCitys::order('sort desc')->select();
return $this->success($list);
}

View File

@ -147,7 +147,7 @@ class QaController extends base
public function getQaCityList()
{
$list = QaCitys::order('city_id desc')->select();
$list = QaCitys::order('sort desc')->select();
return $this->success($list);
}
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-10230e9d]{position:relative;padding-bottom:60px}.el-table[data-v-10230e9d],.filter-container[data-v-10230e9d]{padding-bottom:52px}.search[data-v-10230e9d]{margin-left:10px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-47215198]{position:relative;padding-bottom:60px}.el-table[data-v-47215198],.filter-container[data-v-47215198]{padding-bottom:52px}.search[data-v-47215198]{margin-left:10px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long