creatApplication.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <style lang="less" scoped>
  2. .require-class {
  3. /deep/ .ant-form-item-label {
  4. label::before {
  5. display: inline-block;
  6. margin-right: 4px;
  7. color: #f5222d;
  8. font-size: 14px;
  9. font-family: SimSun, sans-serif;
  10. line-height: 1;
  11. content: '*';
  12. }
  13. }
  14. }
  15. </style>
  16. <template>
  17. <div>
  18. <a-modal
  19. title="添加应用"
  20. :visible="application"
  21. @ok="handleOk"
  22. :confirmLoading="confirmLoading"
  23. @cancel="handleCancel"
  24. width="800px"
  25. >
  26. <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
  27. <a-form :form="form">
  28. <selectTable :projectId.sync="projectId" ref="selectTable" :requireCheck="true"></selectTable>
  29. <a-form-item
  30. label="设备类型"
  31. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  32. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  33. >
  34. <a-radio-group v-model="appType" @change="changePlatform">
  35. <a-radio-button value="android">安卓</a-radio-button>
  36. <a-radio-button value="ios">IOS</a-radio-button>
  37. </a-radio-group>
  38. </a-form-item>
  39. <!-- <a-form-item v-if="appType == 'android'"> -->
  40. <a-form-item
  41. label="推广类型"
  42. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  43. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  44. >
  45. <a-radio-group v-model="platform" @change="changeShowUploadType">
  46. <a-radio value="1">应用下载</a-radio>
  47. <a-radio value="2">网页游戏</a-radio>
  48. </a-radio-group>
  49. </a-form-item>
  50. <a-form-item
  51. label="上传应用"
  52. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  53. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  54. >
  55. <a-radio-group v-model="uploadType" @change="changeShowUpload">
  56. <a-radio-button value="1">本地上传</a-radio-button>
  57. <a-radio-button value="2">填写链接</a-radio-button>
  58. </a-radio-group>
  59. </a-form-item>
  60. <a-form-item
  61. v-if="uploadType == '2'"
  62. label="下载链接"
  63. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  64. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  65. >
  66. <a-input
  67. placeholder="请填写应用下载链接"
  68. v-decorator="[
  69. 'url',
  70. {
  71. rules: [{ required: true, validator: handleConfirmValue }],
  72. },
  73. ]"
  74. />
  75. </a-form-item>
  76. <a-form-item
  77. label="应用包名"
  78. v-if="uploadType == '2' && appType == 'android'"
  79. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  80. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  81. >
  82. <a-input
  83. v-decorator="[
  84. 'packageName',
  85. {
  86. rules: [{ required: true, message: '请填写正确的应用包名称' }],
  87. },
  88. ]"
  89. placeholder="请填写包名称,如com.smile.gifmaker"
  90. />
  91. </a-form-item>
  92. <a-form-item
  93. label="应用名称"
  94. v-if="uploadType == '2'"
  95. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  96. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  97. >
  98. <a-input
  99. v-decorator="[
  100. 'appName',
  101. {
  102. rules: [{ required: true, message: '请填写应用名称' }],
  103. },
  104. ]"
  105. placeholder="请填写应用名称"
  106. />
  107. </a-form-item>
  108. <a-form-item
  109. label="上传图标"
  110. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  111. :wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
  112. v-if="application"
  113. class="require-class"
  114. >
  115. <uploadFile
  116. v-if="application"
  117. :value.sync="fileUrl"
  118. :multiple="false"
  119. :fileCount="1"
  120. uploadType="image"
  121. @overUpload="overUpload"
  122. :size="100"
  123. ></uploadFile>
  124. <p class="upload-txt-rules">文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb</p>
  125. </a-form-item>
  126. <a-form-item
  127. label="上传文件"
  128. v-if="uploadType == '1'"
  129. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  130. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  131. class="require-class fileUpload"
  132. id="fileUpload"
  133. >
  134. <!-- <a-upload name="file" :file-list="fileList" :before-upload="beforeUpload" @change="handleChange">
  135. <a-button><a-icon type="upload" />文件上传</a-button>
  136. </a-upload> -->
  137. <!-- :action="uploadAction" -->
  138. <a-upload
  139. name="file"
  140. :multiple="false"
  141. :headers="tokenHeader"
  142. :file-list="fileList"
  143. :showUploadList="false"
  144. :beforeUpload="beforeUpload"
  145. @change="handleChange"
  146. style="margin-right: 20px"
  147. >
  148. <a-button :disabled="fileUrl == '' && !projectId">
  149. <a-icon type="upload" />
  150. {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
  151. </a-button>
  152. </a-upload>
  153. <a @click="downLoadFile">文件格式下载</a>
  154. </a-form-item>
  155. <a-form-item
  156. label="应用标记"
  157. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  158. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  159. v-if="uploadType == '2'"
  160. >
  161. <a-input
  162. v-decorator="[
  163. 'appVersion',
  164. {
  165. rules: [{ required: true, message: ' ' }, { validator: checkAppVersion }],
  166. },
  167. ]"
  168. placeholder="请填写应用标记,必填且不可重复,如快手-5.6.1.66"
  169. />
  170. </a-form-item>
  171. <!-- <a-form-item>
  172. <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
  173. <a-button htmlType="submit" type="primary">提交</a-button>
  174. <a-button style="margin-left: 8px">保存</a-button>
  175. </a-form-item>
  176. </a-form-item> -->
  177. <a-form-item
  178. label=""
  179. :labelCol="{ span: 5 }"
  180. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 }, offset: 5 }"
  181. v-if="uploadType == '2' && appType == 'android'"
  182. >
  183. <!-- <a-radio-group
  184. v-decorator="[
  185. 'useSdk',
  186. {
  187. rules: [{ required: true }],
  188. initialValue: '0',
  189. },
  190. ]"
  191. >
  192. <a-radio value="0">未接入</a-radio>
  193. <a-radio value="1">已接入</a-radio>
  194. </a-radio-group> -->
  195. <a-checkbox-group
  196. v-decorator="[
  197. 'useSdk',
  198. {
  199. rules: [{ message: '安卓应用已接入快手广告监测SDK必选' }],
  200. },
  201. ]"
  202. >
  203. <a-checkbox :value="0"> 该应用已接入快手广告监测SDK </a-checkbox>
  204. </a-checkbox-group>
  205. </a-form-item>
  206. <a-form-item
  207. label="隐私政策链接"
  208. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  209. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  210. v-if="uploadType == '2' && appType == 'android'"
  211. >
  212. <a-input
  213. v-decorator="[
  214. 'appPrivacyUrl',
  215. {
  216. rules: [{ required: true, message: '请填写隐私政策链接' }, { validator: handleConfirmValue }],
  217. },
  218. ]"
  219. placeholder="请填写隐私政策链接"
  220. />
  221. </a-form-item>
  222. <a-form-item
  223. label="监测链接"
  224. :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
  225. :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
  226. v-if="uploadType == '2' && appType == 'android'"
  227. >
  228. <a-input v-decorator="['trackUrl']" placeholder="请填写监测链接" />
  229. </a-form-item>
  230. </a-form>
  231. </a-card>
  232. </a-modal>
  233. </div>
  234. </template>
  235. <script>
  236. import Vue from 'vue'
  237. import { ACCESS_TOKEN } from '@/store/mutation-types'
  238. import { deleteAction, postAction, getAction, downFilePost, downFile } from '@/api/manage'
  239. import uploadFile from './uploadFile.vue'
  240. import { mapActions, mapGetters } from 'vuex'
  241. import BMF from 'browser-md5-file'
  242. import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
  243. import $ from 'jquery'
  244. const fileSuffix = ['xlsx', 'xls', 'zip']
  245. export default {
  246. name: 'BaseForm',
  247. components: {
  248. uploadFile,
  249. selectTable,
  250. },
  251. data() {
  252. return {
  253. useSdk: [],
  254. loadDisabled: false,
  255. projectId: '',
  256. accountId: '',
  257. fileList: [],
  258. fileUrl: '',
  259. accountList: {},
  260. appType: 'android', //设备类型
  261. platform: '1', //应用类型 : 1 Android 应用下载,2: Android 网页游戏,3: iOS 应用下载, 4:iOS 网页游戏
  262. uploadType: '1', //上传类型 1 本地上传 2 填写链接
  263. appVersion: '', //应用标记
  264. appName: '', // 应用名称
  265. packageName: '', //应用包名
  266. file: '', // 上传文件
  267. imageUrl: '', // 上传图标链接链接
  268. downloadUrl: '', //下载链接
  269. showUploadFile: true,
  270. showDownLoad: false,
  271. showUpload: true,
  272. showAndroid: true,
  273. showIOS: false,
  274. customDomain: '',
  275. acceptVideo: '/*.apk,/*.png,/*.jpg,/*.jpeg,/*.mp4',
  276. accessKeyId: 'LTAIbNbqWzSOklQV',
  277. accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
  278. region: 'oss-cn-beijing',
  279. bucket: 'ctop-media',
  280. form: this.$form.createForm(this),
  281. url: {
  282. insertTemplateUrl: '/kuaishouAppPackage/fillInLink',
  283. userAllocationList: '/ctop/userAllocation/list',
  284. },
  285. application: false,
  286. confirmLoading: false,
  287. imageToken: '',
  288. // uploadAction: '/kuaishouAppPackage/importAppExcel',
  289. tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
  290. okCreated: false,
  291. dataFile: null,
  292. }
  293. },
  294. methods: {
  295. checkAppVersion(rule, value, callback) {
  296. if (value != '') {
  297. if (this.projectId) {
  298. let params = {}
  299. params.projectId = this.projectId
  300. params.appVersion = value
  301. getAction('/kuaishouAppPackage/checkAppVersion', params).then((res) => {
  302. if (res.success) {
  303. callback()
  304. } else {
  305. callback(res.message)
  306. }
  307. })
  308. }
  309. } else {
  310. callback('应用标记必填')
  311. }
  312. },
  313. overUpload(file) {},
  314. downLoadFile() {
  315. downFile('/kuaishouAppPackage/exportAppTemplate').then((res) => {
  316. let blob = new Blob([res], {
  317. type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  318. })
  319. let downloadElement = document.createElement('a')
  320. let href = window.URL.createObjectURL(blob) //创建下载的链接
  321. downloadElement.href = href
  322. downloadElement.download = '应用模板' //下载后文件名
  323. document.body.appendChild(downloadElement)
  324. downloadElement.click() //点击下载
  325. document.body.removeChild(downloadElement) //下载完成移除元素
  326. window.URL.revokeObjectURL(href) //释放掉blob对象
  327. })
  328. },
  329. handleChange(info) {
  330. // let fileList = [...info.fileList]
  331. // // 1. Limit the number of uploaded files
  332. // // Only to show two recent uploaded files, and old ones will be replaced by the new
  333. // fileList = fileList.slice(-2)
  334. // // 2. read from response and show file link
  335. // fileList = fileList.map((file) => {
  336. // if (file.response) {
  337. // // Component will show file.url as link
  338. // file.url = file.response.url
  339. // }
  340. // return file
  341. // })
  342. // if (fileList.length > 0) {
  343. // this.fileList = [
  344. // {
  345. // ...fileList[fileList.length - 1],
  346. // },
  347. // ]
  348. // } else {
  349. // this.fileList = []
  350. // }
  351. this.loadDisabled = false
  352. this.$message.success('文件导入成功')
  353. // if (info.file.status !== 'uploading') {
  354. // console.log(info.file, info.fileList)
  355. // }
  356. // if (info.file.status === 'done') {
  357. // this.loadDisabled = false
  358. // if (info.file.response.code == 200) {
  359. // // this.application = true
  360. // // this.$emit('getDataList')
  361. // this.okCreated = true
  362. // this.$message.success(info.file.response.message)
  363. // } else {
  364. // this.okCreated = false
  365. // this.$message.error(info.file.response.message)
  366. // }
  367. // } else if (info.file.status === 'error') {
  368. // this.$message.error(`${info.file.name}上传失败`)
  369. // this.loadDisabled = false
  370. // }
  371. // console.log(this.form)
  372. },
  373. beforeUpload(file) {
  374. // this.cosUpload(file)
  375. // if (process.env.NODE_ENV == 'development') {
  376. // this.uploadAction = `/jeecg-boot/kuaishouAppPackage/importAppExcel?projectId=${this.projectId}&platform=${
  377. // this.appType == 'ios' ? +this.platform + 2 : +this.platform
  378. // }&imageUrl=${this.fileUrl}`
  379. // } else if (process.env.NODE_ENV == 'debug') {
  380. // } else if (process.env.NODE_ENV == 'production') {
  381. // this.uploadAction = `${this.axios.defaults.baseURL}/kuaishouAppPackage/importAppExcel?projectId=${
  382. // this.projectId
  383. // }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
  384. // }
  385. // this.dataFile = file
  386. this.dataFile = $('.fileUpload').eq(0).find('input')[0].files[0]
  387. this.loadDisabled = true
  388. const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
  389. const fileName = file.name
  390. const fileStrArr = fileName.split('.')
  391. const suffix = fileStrArr[fileStrArr.length - 1]
  392. let result = fileSuffix.some((item) => {
  393. return item === suffix
  394. })
  395. if (!result) {
  396. this.$message.error('不支持该文件类型')
  397. this.loadDisabled = false
  398. return false
  399. }
  400. },
  401. cosUpload(file) {
  402. let that = this
  403. let date = new Date()
  404. let y = date.getFullYear()
  405. let MM = date.getMonth() + 1
  406. MM = MM < 10 ? '0' + MM : MM
  407. let d = date.getDate()
  408. d = d < 10 ? '0' + d : d
  409. let timeElse = new Date().getTime()
  410. let arr = file.name.split('.')
  411. let str = ''
  412. for (let i = 0; i < arr.length; i++) {
  413. if (i === arr.length - 1) {
  414. } else {
  415. if (i === arr.length - 2) {
  416. str += arr[i]
  417. } else {
  418. str += arr[i] + '.'
  419. }
  420. }
  421. }
  422. cos.putObject(
  423. {
  424. Bucket: 'media-1301855440',
  425. Region: 'ap-chongqing',
  426. // 存储桶所在地域,必须字段
  427. Key: that.appType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
  428. StorageClass: 'STANDARD',
  429. Body: file, // 上传文件对象
  430. },
  431. function (err, data) {
  432. if (err) {
  433. that.$message.error('上传失败!!!' + err)
  434. return
  435. }
  436. that.loadingElse = false
  437. that.fileList.push({
  438. uid: file.name,
  439. name: file.name,
  440. status: 'done',
  441. url: '//' + data.Location,
  442. })
  443. if (that.fileList.length > 1) {
  444. that.fileList = that.fileList.slice(-1)
  445. }
  446. const isZip = file.type.includes('zip') || file.type.includes('text')
  447. const fileOvesize = file.size > 1024 * 1024 * 1024
  448. if (!isZip) {
  449. that.$message.error('只能上传zip格式的文件或者txt文件')
  450. return
  451. }
  452. if (fileOvesize) {
  453. that.$message.error('文件大小不能超过1G')
  454. return
  455. }
  456. that.handleMd5(file)
  457. }
  458. )
  459. },
  460. handleMd5(file) {
  461. let bmf = new BMF()
  462. let that = this
  463. return new Promise(function (resolve, reject) {
  464. bmf.md5(file, (err, md5) => {
  465. // getAction('kuaishouPopulationPackage/checkPopulationPackage', { signature: md5 })
  466. // .then((result) => {
  467. // if (result.code === 200) {
  468. that.personNameDisabled = false
  469. that.personResourceDisabled = false
  470. resolve()
  471. // } else if (result.code === 201) {
  472. // that.$message.error(result.message)
  473. // that.personForm.name = result.result.orientationName
  474. // that.personForm.resource = result.result.type
  475. // that.personNameDisabled = true
  476. // that.personResourceDisabled = true
  477. // reject()
  478. // }
  479. // })
  480. // .catch((error) => {
  481. // console.log(error, 'eeee')
  482. // reject()
  483. // })
  484. })
  485. })
  486. },
  487. handleOk() {
  488. this.handleSubmit()
  489. },
  490. handleCancel() {
  491. this.dataFile = null
  492. this.appType = 'android'
  493. this.okCreated = false
  494. this.form.resetFields()
  495. this.fileUrl = ''
  496. this.projectId = undefined
  497. this.$refs.selectTable.keyValue = ''
  498. this.$refs.selectTable.getData()
  499. this.file = ''
  500. this.platform = '1'
  501. this.application = false
  502. this.uploadType = '1'
  503. },
  504. showApplication() {
  505. this.application = true
  506. },
  507. handleConfirmValue(rule, value, callback) {
  508. if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '') {
  509. callback()
  510. } else {
  511. callback('链接不能为空且开头为http://或https://')
  512. }
  513. },
  514. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  515. changePlatform() {
  516. this.form.resetFields()
  517. if (this.appType == 'android') {
  518. this.showAndroid = true
  519. this.showIOS = false
  520. this.platform = '1'
  521. } else {
  522. this.showAndroid = false
  523. this.showIOS = true
  524. this.showDownLoad = true
  525. this.platform = '1'
  526. }
  527. },
  528. changeShowUpload() {
  529. this.form.resetFields()
  530. this.fileUrl = ''
  531. },
  532. changeShowUploadType() {
  533. this.form.resetFields()
  534. if (this.platform == '2') {
  535. this.showUpload = false
  536. this.showUploadFile = false
  537. this.showDownLoad = true
  538. this.uploadType = '1'
  539. } else {
  540. this.showUpload = true
  541. this.showUploadFile = true
  542. this.showDownLoad = false
  543. }
  544. },
  545. handleSubmit() {
  546. // console.log('设备类型:' + this.appType)
  547. // console.log('应用类型:' + this.platform)
  548. // console.log('上传类型:' + this.uploadType)
  549. // console.log('应用标记:' + this.appVersion)
  550. // console.log('应用名称:' + this.appName)
  551. // console.log('包名称:' + this.packageName)
  552. // console.log('文件地址:' + this.file)
  553. // console.log('图片地址:' + this.imageUrl)
  554. // e.preventDefault()
  555. this.form.validateFields((err, values) => {
  556. if (!err) {
  557. if (this.fileUrl && this.projectId) {
  558. this.confirmLoading = true
  559. let params = {}
  560. params.projectId = this.projectId
  561. if (this.uploadType == '1') {
  562. // var file = document.getElementById('fileId').files[0] //获取文件流
  563. this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
  564. params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
  565. params.imageUrl = this.fileUrl
  566. if (this.dataFile) {
  567. let formData = new FormData()
  568. formData.append('file', this.dataFile)
  569. formData.append('projectId', this.projectId)
  570. formData.append('platform', this.appType == 'ios' ? +this.platform + 2 : +this.platform)
  571. formData.append('imageUrl', this.fileUrl)
  572. // if (process.env.NODE_ENV == 'development') {
  573. // this.uploadAction = `/jeecg-boot/kuaishouAppPackage/importAppExcel?projectId=${
  574. // this.projectId
  575. // }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
  576. // } else if (process.env.NODE_ENV == 'debug') {
  577. // } else if (process.env.NODE_ENV == 'production') {
  578. // this.uploadAction = `${this.axios.defaults.baseURL}/kuaishouAppPackage/importAppExcel?projectId=${
  579. // this.projectId
  580. // }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
  581. // }
  582. postAction('/kuaishouAppPackage/importAppExcel', formData).then((res) => {
  583. this.confirmLoading = false
  584. if (res.code === 200) {
  585. this.$message.success('创建成功')
  586. this.handleCancel()
  587. this.$emit('getDataList')
  588. } else {
  589. this.$message.error(res.message)
  590. }
  591. })
  592. } else {
  593. this.$message.error('请上传文件')
  594. }
  595. return
  596. } else {
  597. this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
  598. params = { ...values }
  599. params.useSdk = params.useSdk ? (params.useSdk.length > 0 ? 1 : 0) : null
  600. params.projectId = this.projectId
  601. params.appIconUrl = this.fileUrl
  602. params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
  603. }
  604. postAction(this.url.insertTemplateUrl, params).then((res) => {
  605. this.confirmLoading = false
  606. if (res.success) {
  607. this.$message.success('创建成功')
  608. this.handleCancel()
  609. this.$emit('getDataList')
  610. } else {
  611. this.$message.error(res.message)
  612. }
  613. })
  614. } else {
  615. this.$message.error('请填写必填项')
  616. }
  617. }
  618. })
  619. },
  620. onChange(value) {},
  621. },
  622. created: function () {
  623. let params = {}
  624. params.pageSize = '1000'
  625. params.mediaId = '2'
  626. params.userId = this.userInfo().id
  627. getAction(this.url.userAllocationList, params).then((res) => {
  628. if (res.success) {
  629. this.accountList = res.result.records
  630. }
  631. })
  632. },
  633. }
  634. </script>