|
|
@@ -6,14 +6,17 @@
|
|
|
<div class="menu-content">
|
|
|
<div>
|
|
|
<el-form :inline="true" :model="qo" class="demo-form-inline">
|
|
|
- <el-form-item label="种类:">
|
|
|
- <el-input v-model="qo.LIKES_categories" placeholder="请输入种类" clearable style="width: 300px"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="标签:">
|
|
|
- <el-input v-model="qo.LIKES_labels" placeholder="请输入标签" clearable style="width: 300px"></el-input>
|
|
|
+ <el-form-item label="唯一标识:">
|
|
|
+ <el-input v-model="qo.LIKES_fid" placeholder="请输入唯一标识" clearable style="width: 300px"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <!-- <el-form-item label="种类:">-->
|
|
|
+ <!-- <el-input v-model="qo.LIKES_categories" placeholder="请输入种类" clearable style="width: 300px"></el-input>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="标签:">-->
|
|
|
+ <!-- <el-input v-model="qo.LIKES_labels" placeholder="请输入标签" clearable style="width: 300px"></el-input>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="qo.pageNo=1;queryData()">搜 索</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="queryDataById()">搜 索</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="queryData(-1)">上一页</el-button>
|
|
|
@@ -29,7 +32,7 @@
|
|
|
<el-button type="primary" @click="showImportItemPage()" icon="el-icon-upload2">导入物类</el-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-table :data="result.records" style="width: 100%" v-loading="loading">
|
|
|
+ <el-table :data="result.records" style="width: 100%" v-loading="loading">
|
|
|
<el-table-column type="index" label="行号" width="60"></el-table-column>
|
|
|
<el-table-column prop="fid" label="唯一标识"></el-table-column>
|
|
|
<el-table-column prop="categories" label="种类">
|
|
|
@@ -74,15 +77,15 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
-<!-- <div class="page-box">-->
|
|
|
-<!-- <el-pagination background-->
|
|
|
-<!-- @current-change="handleCurrentChange"-->
|
|
|
-<!-- :current-page="qo.pageNo"-->
|
|
|
-<!-- :page-size="qo.pageSize"-->
|
|
|
-<!-- layout="total, prev, pager, next"-->
|
|
|
-<!-- :total="result.total">-->
|
|
|
-<!-- </el-pagination>-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="page-box">-->
|
|
|
+ <!-- <el-pagination background-->
|
|
|
+ <!-- @current-change="handleCurrentChange"-->
|
|
|
+ <!-- :current-page="qo.pageNo"-->
|
|
|
+ <!-- :page-size="qo.pageSize"-->
|
|
|
+ <!-- layout="total, prev, pager, next"-->
|
|
|
+ <!-- :total="result.total">-->
|
|
|
+ <!-- </el-pagination>-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
:title="dialogName"
|
|
|
@@ -161,6 +164,7 @@ export default {
|
|
|
qo: {
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
+ LIKES_fid: '',
|
|
|
LIKES_categories: '',
|
|
|
LIKES_labels: '',
|
|
|
},
|
|
|
@@ -200,6 +204,37 @@ export default {
|
|
|
_this.queryData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ queryDataById() {
|
|
|
+ if (this.qo.LIKES_fid.length > 0) {
|
|
|
+ this.loading = true;
|
|
|
+ request({
|
|
|
+ url: '/gorse/query_item/' + this.qo.LIKES_fid,
|
|
|
+ method: 'get',
|
|
|
+ }).then(res => {
|
|
|
+ let user = res.data;
|
|
|
+ if (!user) {
|
|
|
+ _this.result.records = [];
|
|
|
+ } else {
|
|
|
+ if (user.categories) {
|
|
|
+ user.categoriesArr = user.categories.split(',');
|
|
|
+ } else {
|
|
|
+ user.categoriesArr = [];
|
|
|
+ }
|
|
|
+ if (user.labels) {
|
|
|
+ user.labelsArr = user.labels.split(',');
|
|
|
+ } else {
|
|
|
+ user.labelsArr = [];
|
|
|
+ }
|
|
|
+ _this.result.records = [user];
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.cursorArr = [''];
|
|
|
+ this.queryData(1);
|
|
|
+ }
|
|
|
+ },
|
|
|
queryData(index) {
|
|
|
this.loading = true;
|
|
|
if (index < 0 && this.cursorArr.length >= 2) {
|
|
|
@@ -258,7 +293,7 @@ export default {
|
|
|
createRow() {
|
|
|
_this.dialogName = '新建';
|
|
|
_this.cmdDialogVisible = true;
|
|
|
- _this.$nextTick(_=> {
|
|
|
+ _this.$nextTick(_ => {
|
|
|
_this.$refs['cmd'].clearValidate();
|
|
|
_this.cmd = {
|
|
|
fid: '',
|
|
|
@@ -272,7 +307,7 @@ export default {
|
|
|
modifyRow(item) {
|
|
|
_this.dialogName = '编辑';
|
|
|
_this.cmdDialogVisible = true;
|
|
|
- _this.$nextTick(_=> {
|
|
|
+ _this.$nextTick(_ => {
|
|
|
_this.$refs['cmd'].clearValidate();
|
|
|
_this.cmd = JSON.parse(JSON.stringify(item));
|
|
|
})
|
|
|
@@ -280,10 +315,10 @@ export default {
|
|
|
submitModify() {
|
|
|
this.$refs.cmd.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if(_this.cmd.categoriesArr) {
|
|
|
+ if (_this.cmd.categoriesArr) {
|
|
|
_this.cmd.categories = _this.cmd.categoriesArr.toString();
|
|
|
}
|
|
|
- if(_this.cmd.labelsArr) {
|
|
|
+ if (_this.cmd.labelsArr) {
|
|
|
_this.cmd.labels = _this.cmd.labelsArr.toString();
|
|
|
}
|
|
|
|
|
|
@@ -328,7 +363,7 @@ export default {
|
|
|
},
|
|
|
handleInputConfirm(typeName) {
|
|
|
let inputValue = _this[typeName + "InputValue"];
|
|
|
- if(inputValue) {
|
|
|
+ if (inputValue) {
|
|
|
_this.cmd[typeName + "Arr"].push(inputValue);
|
|
|
}
|
|
|
_this[typeName + "InputVisible"] = false;
|