|
@@ -9,22 +9,42 @@
|
|
|
<el-row :gutter="24">
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="标题">
|
|
<el-form-item label="标题">
|
|
|
- <el-input v-model="form.title"/>
|
|
|
|
|
|
|
+ <el-input v-model="form.siteName"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
|
|
- <el-row :gutter="24">
|
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="监控词">
|
|
|
|
|
|
|
+ <el-form-item label="监控舆论词">
|
|
|
<el-input v-model="form.keywords"/>
|
|
<el-input v-model="form.keywords"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="监控网站">
|
|
|
|
|
- <el-input v-model="form.siteUrl"/>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="监控域名">
|
|
|
|
|
+ <el-input v-model="form.domain"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="启动地址">
|
|
|
|
|
+ <el-tag
|
|
|
|
|
+ v-for="tag in startUrls"
|
|
|
|
|
+ :key="tag"
|
|
|
|
|
+ closable
|
|
|
|
|
+ :disable-transitions="false"
|
|
|
|
|
+ @close="handleCloseTag(tag)"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ tag }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="inputTagVisible"
|
|
|
|
|
+ ref="saveTagInput"
|
|
|
|
|
+ v-model="inputStartUrl"
|
|
|
|
|
+ class="input-new-tag"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @keyup.enter.native="handleInputConfirmTag"
|
|
|
|
|
+ @blur="handleInputConfirmTag"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button v-else class="button-new-tag" size="small" @click="inputTagVisible=true">+ 添加地址</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="visible = false">取 消</el-button>
|
|
<el-button @click="visible = false">取 消</el-button>
|
|
@@ -32,7 +52,25 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+<style type="text/css">
|
|
|
|
|
+.el-tag + .el-tag {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.button-new-tag {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ line-height: 30px;
|
|
|
|
|
+ padding-top: 0;
|
|
|
|
|
+ padding-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+.input-new-tag {
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ vertical-align: bottom;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
|
|
import { save, updateById } from '@/api/statistics/popular_feelings'
|
|
import { save, updateById } from '@/api/statistics/popular_feelings'
|
|
@@ -42,9 +80,11 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
|
|
+ inputTagVisible: false,
|
|
|
isLoading: false,
|
|
isLoading: false,
|
|
|
form: {},
|
|
form: {},
|
|
|
- fileList: []
|
|
|
|
|
|
|
+ startUrls: [],
|
|
|
|
|
+ inputStartUrl: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -53,23 +93,29 @@ export default {
|
|
|
open(data) {
|
|
open(data) {
|
|
|
this.visible = true
|
|
this.visible = true
|
|
|
this.isLoading = false
|
|
this.isLoading = false
|
|
|
- this.fileList = []
|
|
|
|
|
|
|
+ this.startUrls = []
|
|
|
this.form = {}
|
|
this.form = {}
|
|
|
console.log(data)
|
|
console.log(data)
|
|
|
- if (data.litpics) {
|
|
|
|
|
- data.litpics.forEach(o => {
|
|
|
|
|
- this.fileList.push({ url: o })
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (data.startUrls) {
|
|
|
|
|
+ this.startUrls = data.startUrls
|
|
|
}
|
|
}
|
|
|
this.form = Object.assign({}, data)
|
|
this.form = Object.assign({}, data)
|
|
|
},
|
|
},
|
|
|
|
|
+ handleInputConfirmTag() {
|
|
|
|
|
+ const inputStartUrl = this.inputStartUrl
|
|
|
|
|
+ if (inputStartUrl) {
|
|
|
|
|
+ this.startUrls.push(inputStartUrl)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.inputTagVisible = false
|
|
|
|
|
+ this.inputStartUrl = ''
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCloseTag(tag) {
|
|
|
|
|
+ this.startUrls.splice(this.startUrls.indexOf(tag), 1)
|
|
|
|
|
+ },
|
|
|
handleSubmit() {
|
|
handleSubmit() {
|
|
|
- const litpics = []
|
|
|
|
|
- this.fileList.forEach(o => {
|
|
|
|
|
- litpics.push(o.url)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const startUrls = this.startUrls
|
|
|
this.isLoading = true
|
|
this.isLoading = true
|
|
|
- const param = { ...this.form, 'litpics': litpics }
|
|
|
|
|
|
|
+ const param = { ...this.form, 'startUrls': startUrls }
|
|
|
console.log(param)
|
|
console.log(param)
|
|
|
if (this.form.id) {
|
|
if (this.form.id) {
|
|
|
updateById(this.form.id, param).then(() => {
|
|
updateById(this.form.id, param).then(() => {
|